diff options
author | Rosen Penev <rosenp@gmail.com> | 2021-08-17 00:22:48 -0700 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2021-09-01 16:54:29 +0200 |
commit | 787434a789f3413f0aff054af883ae2b632ffcdb (patch) | |
tree | ab81f027ebbdf2a4231b21da242cc8a29c3da113 | |
parent | d61d087f2f74d3751a39a9000805184efd78d3fb (diff) | |
download | v4l-utils-787434a789f3413f0aff054af883ae2b632ffcdb.tar.gz |
utils: replace push_back with emplace_back
Avoids having to call the constructor as it forwards the arguments
directly.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r-- | utils/v4l2-compliance/v4l2-test-buffers.cpp | 2 | ||||
-rw-r--r-- | utils/v4l2-ctl/v4l2-ctl-common.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp index 2d1c3da2..c9d5d622 100644 --- a/utils/v4l2-compliance/v4l2-test-buffers.cpp +++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp @@ -3056,7 +3056,7 @@ static void streamFmt(struct node *node, __u32 pixelformat, __u32 w, __u32 h, selTest test = createSelTest(node); if (!haveSelTest(test)) - selTests.push_back(createSelTest(node)); + selTests.push_back(test); for (unsigned i = 0; i < 8; i++) { v4l2_selection *sel1 = selections[node->can_output][i & 1]; diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp index 51919fa7..c9401714 100644 --- a/utils/v4l2-ctl/v4l2-ctl-common.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp @@ -996,8 +996,8 @@ void common_cmd(const std::string &media_bus_info, int ch, char *optarg) std::exit(EXIT_FAILURE); } if (const char *equal = std::strchr(value, '=')) { - set_ctrls.push_back(std::make_pair(std::string(value, (equal - value)), - std::string(equal + 1))); + set_ctrls.emplace_back(std::string(value, (equal - value)), + std::string(equal + 1)); } else { fprintf(stderr, "control '%s' without '='\n", value); |