mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-15 04:30:33 +00:00
clang-tidy: apply performance-faster-string-find (see https://clang.llvm.org/extra/clang-tidy/checks/performance-faster-string-find.html)
This commit is contained in:
parent
b994f466a7
commit
2709dc5ec7
@ -158,10 +158,10 @@ pcps_acquisition::pcps_acquisition(const Acq_Conf& conf_) : gr::block("pcps_acqu
|
||||
{
|
||||
std::string dump_path;
|
||||
// Get path
|
||||
if (d_dump_filename.find_last_of("/") != std::string::npos)
|
||||
if (d_dump_filename.find_last_of('/') != std::string::npos)
|
||||
{
|
||||
std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of("/") + 1);
|
||||
dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of("/"));
|
||||
std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of('/') + 1);
|
||||
dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of('/'));
|
||||
d_dump_filename = dump_filename_;
|
||||
}
|
||||
else
|
||||
@ -173,9 +173,9 @@ pcps_acquisition::pcps_acquisition(const Acq_Conf& conf_) : gr::block("pcps_acqu
|
||||
d_dump_filename = "acquisition";
|
||||
}
|
||||
// remove extension if any
|
||||
if (d_dump_filename.substr(1).find_last_of(".") != std::string::npos)
|
||||
if (d_dump_filename.substr(1).find_last_of('.') != std::string::npos)
|
||||
{
|
||||
d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of("."));
|
||||
d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of('.'));
|
||||
}
|
||||
d_dump_filename = dump_path + boost::filesystem::path::preferred_separator + d_dump_filename;
|
||||
// create directory
|
||||
|
@ -91,10 +91,10 @@ pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc(const Acq_Con
|
||||
{
|
||||
std::string dump_path;
|
||||
// Get path
|
||||
if (d_dump_filename.find_last_of("/") != std::string::npos)
|
||||
if (d_dump_filename.find_last_of('/') != std::string::npos)
|
||||
{
|
||||
std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of("/") + 1);
|
||||
dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of("/"));
|
||||
std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of('/') + 1);
|
||||
dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of('/'));
|
||||
d_dump_filename = dump_filename_;
|
||||
}
|
||||
else
|
||||
@ -106,9 +106,9 @@ pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc(const Acq_Con
|
||||
d_dump_filename = "acquisition";
|
||||
}
|
||||
// remove extension if any
|
||||
if (d_dump_filename.substr(1).find_last_of(".") != std::string::npos)
|
||||
if (d_dump_filename.substr(1).find_last_of('.') != std::string::npos)
|
||||
{
|
||||
d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of("."));
|
||||
d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of('.'));
|
||||
}
|
||||
d_dump_filename = dump_path + boost::filesystem::path::preferred_separator + d_dump_filename;
|
||||
// create directory
|
||||
|
@ -74,10 +74,10 @@ hybrid_observables_cc::hybrid_observables_cc(uint32_t nchannels_in,
|
||||
{
|
||||
std::string dump_path;
|
||||
// Get path
|
||||
if (d_dump_filename.find_last_of("/") != std::string::npos)
|
||||
if (d_dump_filename.find_last_of('/') != std::string::npos)
|
||||
{
|
||||
std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of("/") + 1);
|
||||
dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of("/"));
|
||||
std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of('/') + 1);
|
||||
dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of('/'));
|
||||
d_dump_filename = dump_filename_;
|
||||
}
|
||||
else
|
||||
@ -89,9 +89,9 @@ hybrid_observables_cc::hybrid_observables_cc(uint32_t nchannels_in,
|
||||
d_dump_filename = "observables.dat";
|
||||
}
|
||||
// remove extension if any
|
||||
if (d_dump_filename.substr(1).find_last_of(".") != std::string::npos)
|
||||
if (d_dump_filename.substr(1).find_last_of('.') != std::string::npos)
|
||||
{
|
||||
d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of("."));
|
||||
d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of('.'));
|
||||
}
|
||||
d_dump_filename.append(".dat");
|
||||
d_dump_filename = dump_path + boost::filesystem::path::preferred_separator + d_dump_filename;
|
||||
|
@ -423,10 +423,10 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl
|
||||
d_dump_filename = trk_parameters.dump_filename;
|
||||
std::string dump_path;
|
||||
// Get path
|
||||
if (d_dump_filename.find_last_of("/") != std::string::npos)
|
||||
if (d_dump_filename.find_last_of('/') != std::string::npos)
|
||||
{
|
||||
std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of("/") + 1);
|
||||
dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of("/"));
|
||||
std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of('/') + 1);
|
||||
dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of('/'));
|
||||
d_dump_filename = dump_filename_;
|
||||
}
|
||||
else
|
||||
@ -438,9 +438,9 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl
|
||||
d_dump_filename = "trk_channel_";
|
||||
}
|
||||
// remove extension if any
|
||||
if (d_dump_filename.substr(1).find_last_of(".") != std::string::npos)
|
||||
if (d_dump_filename.substr(1).find_last_of('.') != std::string::npos)
|
||||
{
|
||||
d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of("."));
|
||||
d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of('.'));
|
||||
}
|
||||
|
||||
d_dump_filename = dump_path + boost::filesystem::path::preferred_separator + d_dump_filename;
|
||||
|
@ -77,7 +77,7 @@ int main(int argc, char** argv)
|
||||
// Uncompress if RINEX file is gzipped
|
||||
std::string rinex_filename(argv[1]);
|
||||
std::string input_filename = rinex_filename;
|
||||
std::size_t found = rinex_filename.find_last_of(".");
|
||||
std::size_t found = rinex_filename.find_last_of('.');
|
||||
if (found != std::string::npos)
|
||||
{
|
||||
if (rinex_filename.size() >= found + 3)
|
||||
|
Loading…
Reference in New Issue
Block a user