Fix wrong API usage

This commit is contained in:
Carles Fernandez 2023-11-28 09:50:11 +01:00
parent 9034ce44cb
commit 2b708c2e4a
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
1 changed files with 10 additions and 2 deletions

View File

@ -596,8 +596,16 @@ int main(int argc, char** argv)
for (auto& it : f_if_estimation_Hz_map)
{
mean_f_if_Hz += it.second;
mean_fs_Hz += f_fs_estimation_Hz_map.find(it.first)->second;
mean_osc_err_ppm += f_ppm_estimation_Hz_map.find(it.first)->second;
const auto est_Hz = f_fs_estimation_Hz_map.find(it.first);
if (est_Hz != f_fs_estimation_Hz_map.cend())
{
mean_fs_Hz += est_Hz->second;
}
const auto est_ppm = f_ppm_estimation_Hz_map.find(it.first);
if (est_ppm != f_ppm_estimation_Hz_map.cend())
{
mean_osc_err_ppm += est_ppm->second;
}
}
mean_f_if_Hz /= n_elements;