From bd6384bf11ae88e54f67c21e271afae6db7848d8 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Mon, 6 Apr 2020 17:12:26 -0400 Subject: [PATCH] Use std::fill for std::vector --- source/differentiation/ad/ad_helpers.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/differentiation/ad/ad_helpers.cc b/source/differentiation/ad/ad_helpers.cc index 392fa59555..4d7fd6f79a 100644 --- a/source/differentiation/ad/ad_helpers.cc +++ b/source/differentiation/ad/ad_helpers.cc @@ -81,9 +81,9 @@ namespace Differentiation HelperBase::reset_registered_independent_variables() { - for (auto &®istered_independent_variable_value : - registered_independent_variable_values) - registered_independent_variable_value = false; + std::fill(registered_independent_variable_values.begin(), + registered_independent_variable_values.end(), + false); } @@ -93,9 +93,9 @@ namespace Differentiation HelperBase:: reset_registered_dependent_variables(const bool flag) { - for (auto &®istered_marked_dependent_variable : - registered_marked_dependent_variables) - registered_marked_dependent_variable = flag; + std::fill(registered_marked_dependent_variables.begin(), + registered_marked_dependent_variables.end(), + flag); } -- 2.39.5