mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Correction to index check in Tally::nuclide_name.
This commit is contained in:
parent
1262bcde7d
commit
97e4e692f5
1 changed files with 2 additions and 3 deletions
|
|
@ -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_;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue