From c9413e89310f5949c1d66c7713df23fa7aa4ab9d Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 16 Aug 2018 10:20:03 +0200 Subject: [PATCH] Replace map.size() > 0 by map.empty == false --- src/algorithms/PVT/adapters/rtklib_pvt.cc | 2 +- .../PVT/gnuradio_blocks/rtklib_pvt_cc.cc | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index 2d498d360..dc8cf894a 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -504,7 +504,7 @@ bool RtklibPvt::save_assistance_to_XML() LOG(INFO) << "SUPL: Try to save GPS ephemeris to XML file " << eph_xml_filename_; std::map eph_map = pvt_->get_GPS_L1_ephemeris_map(); - if (eph_map.size() > 0) + if (eph_map.empty() == false) { try { diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index fc2c4c7e8..6bbf91c2d 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -412,7 +412,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc() // save GPS L2CM ephemeris to XML file std::string file_name = "eph_GPS_CNAV.xml"; - if (d_ls_pvt->gps_cnav_ephemeris_map.size() > 0) + if (d_ls_pvt->gps_cnav_ephemeris_map.empty() == false) { try { @@ -435,7 +435,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc() // save GPS L1 CA ephemeris to XML file file_name = "eph_GPS_L1CA.xml"; - if (d_ls_pvt->gps_ephemeris_map.size() > 0) + if (d_ls_pvt->gps_ephemeris_map.empty() == false) { try { @@ -458,7 +458,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc() // save Galileo E1 ephemeris to XML file file_name = "eph_Galileo_E1.xml"; - if (d_ls_pvt->galileo_ephemeris_map.size() > 0) + if (d_ls_pvt->galileo_ephemeris_map.empty() == false) { try { @@ -481,7 +481,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc() // save GLONASS GNAV ephemeris to XML file file_name = "eph_GLONASS_GNAV.xml"; - if (d_ls_pvt->glonass_gnav_ephemeris_map.size() > 0) + if (d_ls_pvt->glonass_gnav_ephemeris_map.empty() == false) { try { @@ -573,28 +573,28 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } try { - if (d_ls_pvt->gps_ephemeris_map.size() > 0) + if (d_ls_pvt->gps_ephemeris_map.empty() == false) { if (tmp_eph_iter_gps != d_ls_pvt->gps_ephemeris_map.end()) { d_rtcm_printer->lock_time(d_ls_pvt->gps_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time } } - if (d_ls_pvt->galileo_ephemeris_map.size() > 0) + if (d_ls_pvt->galileo_ephemeris_map.empty() == false) { if (tmp_eph_iter_gal != d_ls_pvt->galileo_ephemeris_map.end()) { d_rtcm_printer->lock_time(d_ls_pvt->galileo_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time } } - if (d_ls_pvt->gps_cnav_ephemeris_map.size() > 0) + if (d_ls_pvt->gps_cnav_ephemeris_map.empty() == false) { if (tmp_eph_iter_cnav != d_ls_pvt->gps_cnav_ephemeris_map.end()) { d_rtcm_printer->lock_time(d_ls_pvt->gps_cnav_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time } } - if (d_ls_pvt->glonass_gnav_ephemeris_map.size() > 0) + if (d_ls_pvt->glonass_gnav_ephemeris_map.empty() == false) { if (tmp_eph_iter_glo_gnav != d_ls_pvt->glonass_gnav_ephemeris_map.end()) { @@ -616,7 +616,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } // ############ 2 COMPUTE THE PVT ################################ - if (gnss_observables_map.size() > 0) + if (gnss_observables_map.empty() == false) { double current_RX_time = gnss_observables_map.begin()->second.RX_time; uint32_t current_RX_time_ms = static_cast(current_RX_time * 1000.0);