From f440a0e9f122883a59549fad454928dd1273f77f Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 20 Jul 2019 11:39:08 +0200 Subject: [PATCH] Avoid passing big parameters by value clang-tidy check: performance-unnecessary-value-param See https://clang.llvm.org/extra/clang-tidy/checks/performance-unnecessary-value-param.html --- src/algorithms/PVT/libs/monitor_pvt_udp_sink.cc | 2 +- src/algorithms/PVT/libs/monitor_pvt_udp_sink.h | 2 +- src/core/libs/channel_status_msg_receiver.cc | 2 +- src/core/libs/channel_status_msg_receiver.h | 2 +- src/core/receiver/gnss_flowgraph.cc | 4 ++-- src/core/receiver/gnss_flowgraph.h | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/algorithms/PVT/libs/monitor_pvt_udp_sink.cc b/src/algorithms/PVT/libs/monitor_pvt_udp_sink.cc index ed23fbb5d..2824dbb7d 100644 --- a/src/algorithms/PVT/libs/monitor_pvt_udp_sink.cc +++ b/src/algorithms/PVT/libs/monitor_pvt_udp_sink.cc @@ -51,7 +51,7 @@ Monitor_Pvt_Udp_Sink::Monitor_Pvt_Udp_Sink(const std::vector& addre } -bool Monitor_Pvt_Udp_Sink::write_monitor_pvt(std::shared_ptr monitor_pvt) +bool Monitor_Pvt_Udp_Sink::write_monitor_pvt(const std::shared_ptr& monitor_pvt) { std::string outbound_data; if (use_protobuf == false) diff --git a/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h b/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h index 588e70257..dc55528cc 100644 --- a/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h +++ b/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h @@ -46,7 +46,7 @@ class Monitor_Pvt_Udp_Sink { public: Monitor_Pvt_Udp_Sink(const std::vector& addresses, const uint16_t& port, bool protobuf_enabled); - bool write_monitor_pvt(std::shared_ptr monitor_pvt); + bool write_monitor_pvt(const std::shared_ptr& monitor_pvt); private: b_io_context io_context; diff --git a/src/core/libs/channel_status_msg_receiver.cc b/src/core/libs/channel_status_msg_receiver.cc index 965a99a46..2dd58bc4f 100644 --- a/src/core/libs/channel_status_msg_receiver.cc +++ b/src/core/libs/channel_status_msg_receiver.cc @@ -56,7 +56,7 @@ channel_status_msg_receiver::channel_status_msg_receiver() : gr::block("channel_ channel_status_msg_receiver::~channel_status_msg_receiver() = default; -void channel_status_msg_receiver::msg_handler_events(pmt::pmt_t msg) +void channel_status_msg_receiver::msg_handler_events(const pmt::pmt_t& msg) { gr::thread::scoped_lock lock(d_setlock); // require mutex with msg_handler_events function called by the scheduler try diff --git a/src/core/libs/channel_status_msg_receiver.h b/src/core/libs/channel_status_msg_receiver.h index ac155cdaf..a4259834e 100644 --- a/src/core/libs/channel_status_msg_receiver.h +++ b/src/core/libs/channel_status_msg_receiver.h @@ -65,7 +65,7 @@ private: std::map> d_channel_status_map; Monitor_Pvt d_pvt_status{}; - void msg_handler_events(pmt::pmt_t msg); + void msg_handler_events(const pmt::pmt_t& msg); }; #endif diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 5710b375e..7f7558599 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -1063,7 +1063,7 @@ bool GNSSFlowgraph::send_telemetry_msg(const pmt::pmt_t& msg) } -void GNSSFlowgraph::push_back_signal(Gnss_Signal gs) +void GNSSFlowgraph::push_back_signal(const Gnss_Signal& gs) { switch (mapStringValues_[gs.get_signal_str()]) { @@ -1119,7 +1119,7 @@ void GNSSFlowgraph::push_back_signal(Gnss_Signal gs) } -void GNSSFlowgraph::remove_signal(Gnss_Signal gs) +void GNSSFlowgraph::remove_signal(const Gnss_Signal& gs) { switch (mapStringValues_[gs.get_signal_str()]) { diff --git a/src/core/receiver/gnss_flowgraph.h b/src/core/receiver/gnss_flowgraph.h index 8d3c3fa58..d60995b36 100644 --- a/src/core/receiver/gnss_flowgraph.h +++ b/src/core/receiver/gnss_flowgraph.h @@ -111,8 +111,8 @@ public: void apply_action(unsigned int who, unsigned int what); - void push_back_signal(Gnss_Signal gs); - void remove_signal(Gnss_Signal gs); + void push_back_signal(const Gnss_Signal& gs); + void remove_signal(const Gnss_Signal& gs); void set_configuration(std::shared_ptr configuration);