Skip to content

Commit

Permalink
use ranged-for for problem parameter array init
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale committed Mar 25, 2024
1 parent 5707c0c commit 6125f11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Util/scripts/write_probdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()}")
Expand Down

0 comments on commit 6125f11

Please sign in to comment.