Reduce code duplication with TallyFilter::type()

This commit is contained in:
Sterling Harper 2018-10-11 23:06:47 -04:00
parent f2a5e10c46
commit 9d0c1ff7e2
9 changed files with 53 additions and 81 deletions

View file

@ -188,9 +188,8 @@ prepare_distribcell()
// Find all cells listed in a DistribcellFilter.
std::unordered_set<int32_t> distribcells;
for (auto* filt : tally_filters) {
//TODO: replace this cast
auto* distrib_filt = dynamic_cast<DistribcellFilter*>(filt);
if (distrib_filt) {
if (filt->type() == "distribcell") {
auto* distrib_filt = static_cast<DistribcellFilter*>(filt);
distribcells.insert(distrib_filt->cell_);
}
}