From 6125f11c9db31caf5652148900ac23ba4ad846aa Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Mon, 25 Mar 2024 10:26:52 -0400 Subject: [PATCH] use ranged-for for problem parameter array init --- Util/scripts/write_probdata.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Util/scripts/write_probdata.py b/Util/scripts/write_probdata.py index 68cb716aac..2cd7cdd398 100755 --- a/Util/scripts/write_probdata.py +++ b/Util/scripts/write_probdata.py @@ -237,8 +237,8 @@ def write_probin(prob_param_files, cxx_prefix): size = p.size if (size == "nspec"): size = "NumSpec" - fout.write(f" for (int n = 0; n < {size}; n++) {{\n") - fout.write(f" problem::{p.name}[n] = {p.default_format(lang='C++')};\n") + fout.write(f" for (auto & e : problem::{p.name}) {{\n") + fout.write(f" e = {p.default_format(lang='C++')};\n") fout.write(f" }}\n") else: fout.write(f" {p.get_default_string()}")