[skip ci] erasing the tally from the tallies vector calls the destructor, which already handles removing this tally from the map

This commit is contained in:
lewisgross1296 2022-08-15 13:43:53 -05:00
parent d1775181e9
commit d69a6ec647

View file

@ -1281,8 +1281,8 @@ extern "C" int openmc_remove_tally(int32_t index)
}
// grab tally so it's ID can be obtained to remove the (ID,index) pair from tally_map
auto& tally = model::tallies[index];
model::tally_map.erase(tally->id_);
// delete the tally via iterator pointing to correct position
// this calls the Tally destructor, removing the tally from the map as well
model::tallies.erase(model::tallies.begin() + index);
return 0;