diff --git a/src/HealthGPS/static_linear_model.cpp b/src/HealthGPS/static_linear_model.cpp index b093f707b..ac7e6cded 100644 --- a/src/HealthGPS/static_linear_model.cpp +++ b/src/HealthGPS/static_linear_model.cpp @@ -241,7 +241,8 @@ void StaticLinearModel::update_policies(Person &person, bool intervene) const { // Set zero policy if not intervening. if (!intervene) { for (size_t i = 0; i < names_.size(); i++) { - auto policy_name = core::Identifier{names_[i].to_string() + "_policy"}; + for (const auto & name : names_) { + auto policy_name = core::Identifier{name.to_string() + "_policy"}; person.risk_factors[policy_name] = 0.0; } return;