1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 04:30:33 +00:00

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
This commit is contained in:
Carles Fernandez 2019-07-20 11:39:08 +02:00
parent 49e64f94f6
commit f440a0e9f1
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
6 changed files with 8 additions and 8 deletions

View File

@ -51,7 +51,7 @@ Monitor_Pvt_Udp_Sink::Monitor_Pvt_Udp_Sink(const std::vector<std::string>& addre
} }
bool Monitor_Pvt_Udp_Sink::write_monitor_pvt(std::shared_ptr<Monitor_Pvt> monitor_pvt) bool Monitor_Pvt_Udp_Sink::write_monitor_pvt(const std::shared_ptr<Monitor_Pvt>& monitor_pvt)
{ {
std::string outbound_data; std::string outbound_data;
if (use_protobuf == false) if (use_protobuf == false)

View File

@ -46,7 +46,7 @@ class Monitor_Pvt_Udp_Sink
{ {
public: public:
Monitor_Pvt_Udp_Sink(const std::vector<std::string>& addresses, const uint16_t& port, bool protobuf_enabled); Monitor_Pvt_Udp_Sink(const std::vector<std::string>& addresses, const uint16_t& port, bool protobuf_enabled);
bool write_monitor_pvt(std::shared_ptr<Monitor_Pvt> monitor_pvt); bool write_monitor_pvt(const std::shared_ptr<Monitor_Pvt>& monitor_pvt);
private: private:
b_io_context io_context; b_io_context io_context;

View File

@ -56,7 +56,7 @@ channel_status_msg_receiver::channel_status_msg_receiver() : gr::block("channel_
channel_status_msg_receiver::~channel_status_msg_receiver() = default; 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 gr::thread::scoped_lock lock(d_setlock); // require mutex with msg_handler_events function called by the scheduler
try try

View File

@ -65,7 +65,7 @@ private:
std::map<int, std::shared_ptr<Gnss_Synchro>> d_channel_status_map; std::map<int, std::shared_ptr<Gnss_Synchro>> d_channel_status_map;
Monitor_Pvt d_pvt_status{}; Monitor_Pvt d_pvt_status{};
void msg_handler_events(pmt::pmt_t msg); void msg_handler_events(const pmt::pmt_t& msg);
}; };
#endif #endif

View File

@ -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()]) 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()]) switch (mapStringValues_[gs.get_signal_str()])
{ {

View File

@ -111,8 +111,8 @@ public:
void apply_action(unsigned int who, unsigned int what); void apply_action(unsigned int who, unsigned int what);
void push_back_signal(Gnss_Signal gs); void push_back_signal(const Gnss_Signal& gs);
void remove_signal(Gnss_Signal gs); void remove_signal(const Gnss_Signal& gs);
void set_configuration(std::shared_ptr<ConfigurationInterface> configuration); void set_configuration(std::shared_ptr<ConfigurationInterface> configuration);