aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2021-08-17 00:22:48 -0700
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2021-09-01 16:54:29 +0200
commit787434a789f3413f0aff054af883ae2b632ffcdb (patch)
treeab81f027ebbdf2a4231b21da242cc8a29c3da113
parentd61d087f2f74d3751a39a9000805184efd78d3fb (diff)
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.cpp2
-rw-r--r--utils/v4l2-ctl/v4l2-ctl-common.cpp4
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);

Privacy Policy