From c6cb3bbc35153a9635d69eddab0d252f7441b854 Mon Sep 17 00:00:00 2001 From: Marcus Müller <mmueller@gnuradio.org> Date: Sat, 17 Aug 2019 17:41:00 +0200 Subject: Use emplace_back(params) instead of push_back(type(params)) This is C++11: you can convert std::vector<complextype> vec; vec.push_back(complextype(foo, bar, baz)); by std::vector<complextype> vec; vec.emplace_back(foo, bar, baz); which saves one unnecessary copy. This mostly happened in rpc code. The automated clang-tidy check failed miserably, so most of this was done by hand. --- gr-qtgui/lib/edit_box_msg_impl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gr-qtgui/lib/edit_box_msg_impl.cc') diff --git a/gr-qtgui/lib/edit_box_msg_impl.cc b/gr-qtgui/lib/edit_box_msg_impl.cc index 4b38a59004..0339276276 100644 --- a/gr-qtgui/lib/edit_box_msg_impl.cc +++ b/gr-qtgui/lib/edit_box_msg_impl.cc @@ -492,7 +492,7 @@ void edit_box_msg_impl::edit_finished() if (conv_ok) { if (even) { im = t; - xv.push_back(gr_complex(re, im)); + xv.emplace_back(re, im); even = false; } else { re = t; -- cgit v1.2.3