From 97e4e692f54a7aada8ad44d4f3f1e65e7f568763 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Wed, 7 Apr 2021 17:34:03 -0500 Subject: [PATCH] Correction to index check in Tally::nuclide_name. --- src/tallies/tally.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/tallies/tally.cpp b/src/tallies/tally.cpp index b3a259f79a..5fd034f92c 100644 --- a/src/tallies/tally.cpp +++ b/src/tallies/tally.cpp @@ -679,13 +679,12 @@ Tally::score_name(int score_idx) const { std::string Tally::nuclide_name(int nuclide_idx) const { - if (nuclide_idx != -1) { - return "total"; - } else if (nuclide_idx < 0 || nuclide_idx >= nuclides_.size()) { + if (nuclide_idx < 0 || nuclide_idx >= nuclides_.size()) { fatal_error("Index in nuclides array is out of bounds"); } int nuclide = nuclides_.at(nuclide_idx); + if (nuclide == -1) { return "total"; } return data::nuclides.at(nuclide)->name_; }