[PATCH] utils: replace push_back with emplace_back

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Avoids having to call the constructor as it forwards the arguments
directly.

Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
---
 utils/v4l2-compliance/v4l2-test-buffers.cpp | 2 +-
 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 197baaeb7..e6a0630d9 100644
--- a/utils/v4l2-compliance/v4l2-test-buffers.cpp
+++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp
@@ -3058,7 +3058,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 51919fa71..c94017149 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);
-- 
2.31.1




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux