diff options
author | Marcus Müller <mmueller@gnuradio.org> | 2019-08-17 17:41:00 +0200 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2019-08-22 15:05:58 +0200 |
commit | c6cb3bbc35153a9635d69eddab0d252f7441b854 (patch) | |
tree | f9ab04c336fa6f228ce0c7b90c3722955a1aa53f /gr-blocks/lib/ctrlport_probe_c_impl.cc | |
parent | bcf35e64b5662f716e0de59e95fdd9ffb02238a7 (diff) |
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.
Diffstat (limited to 'gr-blocks/lib/ctrlport_probe_c_impl.cc')
-rw-r--r-- | gr-blocks/lib/ctrlport_probe_c_impl.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gr-blocks/lib/ctrlport_probe_c_impl.cc b/gr-blocks/lib/ctrlport_probe_c_impl.cc index a899917c98..951647d61c 100644 --- a/gr-blocks/lib/ctrlport_probe_c_impl.cc +++ b/gr-blocks/lib/ctrlport_probe_c_impl.cc @@ -81,7 +81,7 @@ int ctrlport_probe_c_impl::work(int noutput_items, void ctrlport_probe_c_impl::setup_rpc() { #ifdef GR_CTRLPORT - d_rpc_vars.push_back(rpcbasic_sptr( + d_rpc_vars.emplace_back( new rpcbasic_register_get<ctrlport_probe_c, std::vector<std::complex<float>>>( alias(), d_id.c_str(), @@ -92,7 +92,7 @@ void ctrlport_probe_c_impl::setup_rpc() "volts", d_desc.c_str(), RPC_PRIVLVL_MIN, - DISPXY | DISPOPTSCATTER))); + DISPXY | DISPOPTSCATTER)); #endif /* GR_CTRLPORT */ } |