Skip to content

Commit

Permalink
Small tidy up.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesturner246 committed Aug 3, 2023
1 parent f71d951 commit b685faa
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/HealthGPS.Console/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ std::vector<core::DiseaseInfo> 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;
Expand Down
4 changes: 2 additions & 2 deletions src/HealthGPS.Core/datastore.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/HealthGPS.Datastore/datamanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ std::vector<Country> 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) ||
Expand Down Expand Up @@ -201,7 +201,7 @@ std::vector<DiseaseInfo> 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 &registry = index_["diseases"]["registry"];
auto disease_code_str = code.to_string();
Expand Down
4 changes: 2 additions & 2 deletions src/HealthGPS.Datastore/datamanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class DataManager : public Datastore {

std::vector<Country> get_countries() const override;

Country get_country(std::string alpha) const override;
Country get_country(const std::string &alpha) const override;

std::vector<PopulationItem> get_population(Country country) const;

Expand All @@ -51,7 +51,7 @@ class DataManager : public Datastore {

std::vector<DiseaseInfo> 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;

Expand Down

0 comments on commit b685faa

Please sign in to comment.