diff --git a/tooling/pipeline/src/data_generation/mock/deterministic_hash.cc b/tooling/pipeline/src/data_generation/mock/deterministic_hash.cc index 26adc6aa..ebe79a15 100644 --- a/tooling/pipeline/src/data_generation/mock/deterministic_hash.cc +++ b/tooling/pipeline/src/data_generation/mock/deterministic_hash.cc @@ -9,18 +9,18 @@ #include "data_generation/mock_generator.h" size_t MockGenerator::DeterministicHash(const City& location) { - size_t seed = 0; - boost::hash_combine(seed, location.city); - boost::hash_combine(seed, location.country); - return seed; + size_t seed = 0; + boost::hash_combine(seed, location.city); + boost::hash_combine(seed, location.country); + return seed; } size_t MockGenerator::DeterministicHash(const City& location, const UserPersona& persona, const Name& name) { - size_t seed = DeterministicHash(location); - boost::hash_combine(seed, persona.name); - boost::hash_combine(seed, name.first_name); - boost::hash_combine(seed, name.last_name); - return seed; + size_t seed = DeterministicHash(location); + boost::hash_combine(seed, persona.name); + boost::hash_combine(seed, name.first_name); + boost::hash_combine(seed, name.last_name); + return seed; } diff --git a/tooling/pipeline/src/data_generation/mock/generate_brewery.cc b/tooling/pipeline/src/data_generation/mock/generate_brewery.cc index ea4d56c7..8bedb476 100644 --- a/tooling/pipeline/src/data_generation/mock/generate_brewery.cc +++ b/tooling/pipeline/src/data_generation/mock/generate_brewery.cc @@ -12,34 +12,34 @@ BreweryResult MockGenerator::GenerateBrewery( const EnrichedCity& enriched_city) { - const City& location = enriched_city.location; - const size_t hash = DeterministicHash(location); + const City& location = enriched_city.location; + const size_t hash = DeterministicHash(location); - const std::string_view adjective = - kBreweryAdjectives.at(hash % kBreweryAdjectives.size()); - const std::string_view noun = - kBreweryNouns.at(hash / kNounHashStride % kBreweryNouns.size()); - const std::string_view base_description = kBreweryDescriptions.at( - (hash / kDescriptionHashStride) % kBreweryDescriptions.size()); + const std::string_view adjective = + kBreweryAdjectives.at(hash % kBreweryAdjectives.size()); + const std::string_view noun = + kBreweryNouns.at(hash / kNounHashStride % kBreweryNouns.size()); + const std::string_view base_description = kBreweryDescriptions.at( + (hash / kDescriptionHashStride) % kBreweryDescriptions.size()); - const std::string name = - std::format("{} {} {}", location.city, adjective, noun); + const std::string name = + std::format("{} {} {}", location.city, adjective, noun); - const std::string state_suffix = - location.state_province.empty() - ? std::string{} - : std::format(", {}", location.state_province); - const std::string country_suffix = - location.country.empty() ? std::string{} - : std::format(", {}", location.country); - const std::string description = - std::format("{} Located in {}{}{}.", base_description, location.city, - state_suffix, country_suffix); + const std::string state_suffix = + location.state_province.empty() + ? std::string{} + : std::format(", {}", location.state_province); + const std::string country_suffix = + location.country.empty() ? std::string{} + : std::format(", {}", location.country); + const std::string description = + std::format("{} Located in {}{}{}.", base_description, location.city, + state_suffix, country_suffix); - return { - .name_en = name, - .description_en = description, - .name_local = name, - .description_local = description, - }; + return { + .name_en = name, + .description_en = description, + .name_local = name, + .description_local = description, + }; } diff --git a/tooling/pipeline/src/data_generation/mock/generate_user.cc b/tooling/pipeline/src/data_generation/mock/generate_user.cc index 3a66047b..29d74efd 100644 --- a/tooling/pipeline/src/data_generation/mock/generate_user.cc +++ b/tooling/pipeline/src/data_generation/mock/generate_user.cc @@ -11,21 +11,21 @@ UserResult MockGenerator::GenerateUser(const EnrichedCity& city, const UserPersona& persona, const Name& name) { - const size_t hash = DeterministicHash(city.location, persona, name); + const size_t hash = DeterministicHash(city.location, persona, name); - const std::string_view username = kUsernames[hash % kUsernames.size()]; - const std::string_view bio = kBios[hash / kBioHashStride % kBios.size()]; - const float activity_weight = - static_cast(hash / kActivityWeightHashStride % - kActivityWeightHashRange) / - static_cast(kActivityWeightHashRange); + const std::string_view username = kUsernames[hash % kUsernames.size()]; + const std::string_view bio = kBios[hash / kBioHashStride % kBios.size()]; + const float activity_weight = + static_cast(hash / kActivityWeightHashStride % + kActivityWeightHashRange) / + static_cast(kActivityWeightHashRange); - return { - .first_name = name.first_name, - .last_name = name.last_name, - .gender = name.gender, - .username = std::string(username), - .bio = std::string(bio), - .activity_weight = activity_weight, - }; + return { + .first_name = name.first_name, + .last_name = name.last_name, + .gender = name.gender, + .username = std::string(username), + .bio = std::string(bio), + .activity_weight = activity_weight, + }; }