From b685faa52330d15118bd20949be6b6453bee50e2 Mon Sep 17 00:00:00 2001 From: James Paul Turner Date: Thu, 3 Aug 2023 18:52:16 +0100 Subject: [PATCH] Small tidy up. --- src/HealthGPS.Console/configuration.cpp | 2 +- src/HealthGPS.Core/datastore.h | 4 ++-- src/HealthGPS.Datastore/datamanager.cpp | 4 ++-- src/HealthGPS.Datastore/datamanager.h | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/HealthGPS.Console/configuration.cpp b/src/HealthGPS.Console/configuration.cpp index 0c5d5f4a3..a987dad86 100644 --- a/src/HealthGPS.Console/configuration.cpp +++ b/src/HealthGPS.Console/configuration.cpp @@ -293,7 +293,7 @@ std::vector get_diseases_info(core::Datastore &data_api, Conf config.diseases.size()); for (const auto &code : config.diseases) { - result.emplace_back(data_api.get_disease_info(core::Identifier{code})); + result.emplace_back(data_api.get_disease_info(code)); } return result; diff --git a/src/HealthGPS.Core/datastore.h b/src/HealthGPS.Core/datastore.h index 3877aa3b3..2277cb417 100644 --- a/src/HealthGPS.Core/datastore.h +++ b/src/HealthGPS.Core/datastore.h @@ -21,7 +21,7 @@ class Datastore { /// @brief Gets a single country by the alpha code /// @param alpha The country alpha 2 or 3 format code to search /// @return The country's definition - virtual Country get_country(std::string alpha) const = 0; + virtual Country get_country(const std::string &alpha) const = 0; /// @brief Gets the population growth trend for a country filtered by time /// @param country The target country definition @@ -46,7 +46,7 @@ class Datastore { /// @brief Gets a single disease information by identifier /// @param code The target disease identifier /// @return The disease information - virtual DiseaseInfo get_disease_info(Identifier code) const = 0; + virtual DiseaseInfo get_disease_info(const Identifier &code) const = 0; /// @brief Gets a disease full definition by identifier for a country /// @param info The target disease information diff --git a/src/HealthGPS.Datastore/datamanager.cpp b/src/HealthGPS.Datastore/datamanager.cpp index 68782e566..b7d43e087 100644 --- a/src/HealthGPS.Datastore/datamanager.cpp +++ b/src/HealthGPS.Datastore/datamanager.cpp @@ -58,7 +58,7 @@ std::vector DataManager::get_countries() const { return results; } -Country DataManager::get_country(std::string alpha) const { +Country DataManager::get_country(const std::string &alpha) const { auto c = get_countries(); auto is_target = [&alpha](const hgps::core::Country &c) { return core::case_insensitive::equals(c.alpha2, alpha) || @@ -201,7 +201,7 @@ std::vector DataManager::get_diseases() const { return result; } -DiseaseInfo DataManager::get_disease_info(core::Identifier code) const { +DiseaseInfo DataManager::get_disease_info(const core::Identifier &code) const { if (index_.contains("diseases")) { auto ®istry = index_["diseases"]["registry"]; auto disease_code_str = code.to_string(); diff --git a/src/HealthGPS.Datastore/datamanager.h b/src/HealthGPS.Datastore/datamanager.h index 33a3dbe21..42fa447c1 100644 --- a/src/HealthGPS.Datastore/datamanager.h +++ b/src/HealthGPS.Datastore/datamanager.h @@ -35,7 +35,7 @@ class DataManager : public Datastore { std::vector get_countries() const override; - Country get_country(std::string alpha) const override; + Country get_country(const std::string &alpha) const override; std::vector get_population(Country country) const; @@ -51,7 +51,7 @@ class DataManager : public Datastore { std::vector get_diseases() const override; - DiseaseInfo get_disease_info(core::Identifier code) const override; + DiseaseInfo get_disease_info(const core::Identifier &code) const override; DiseaseEntity get_disease(DiseaseInfo code, Country country) const override;