1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-11-12 13:23:09 +00:00

Improve performance by using const and std::move() to avoid unnecessary copies

This commit is contained in:
Carles Fernandez
2018-12-03 19:01:47 +01:00
parent 2709dc5ec7
commit 1743a773b5
136 changed files with 309 additions and 268 deletions

View File

@@ -38,7 +38,7 @@
using google::LogMessage;
HybridObservables::HybridObservables(ConfigurationInterface* configuration,
std::string role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
{
std::string default_dump_filename = "./observables.dat";
DLOG(INFO) << "role " << role;

View File

@@ -47,7 +47,7 @@ class HybridObservables : public ObservablesInterface
{
public:
HybridObservables(ConfigurationInterface* configuration,
std::string role,
const std::string& role,
unsigned int in_streams,
unsigned int out_streams);

View File

@@ -42,6 +42,7 @@
#include <cstdlib>
#include <iostream>
#include <limits>
#include <utility>
using google::LogMessage;
@@ -49,7 +50,7 @@ using google::LogMessage;
hybrid_observables_cc_sptr hybrid_make_observables_cc(unsigned int nchannels_in, unsigned int nchannels_out, bool dump, bool dump_mat, std::string dump_filename)
{
return hybrid_observables_cc_sptr(new hybrid_observables_cc(nchannels_in, nchannels_out, dump, dump_mat, dump_filename));
return hybrid_observables_cc_sptr(new hybrid_observables_cc(nchannels_in, nchannels_out, dump, dump_mat, std::move(dump_filename)));
}
@@ -63,7 +64,7 @@ hybrid_observables_cc::hybrid_observables_cc(uint32_t nchannels_in,
{
d_dump = dump;
d_dump_mat = dump_mat and d_dump;
d_dump_filename = dump_filename;
d_dump_filename = std::move(dump_filename);
d_nchannels_out = nchannels_out;
d_nchannels_in = nchannels_in;
T_rx_clock_step_samples = 0U;