Skip to content

Commit 00f34c9

Browse files
committed
Move up check on materials_ in get_all_bins
1 parent 628993a commit 00f34c9

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/tallies/filter_meshmaterial.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ void MeshMaterialFilter::set_translation(const double translation[3])
9999
void MeshMaterialFilter::get_all_bins(
100100
const Particle& p, TallyEstimator estimator, FilterMatch& match) const
101101
{
102+
// If current material is not in any bins, don't bother checking
103+
if (!contains(materials_, p.material())) {
104+
return;
105+
}
102106

103107
Position last_r = p.r_last();
104108
Position r = p.r();
@@ -120,11 +124,6 @@ void MeshMaterialFilter::get_all_bins(
120124
}
121125
}
122126
} else {
123-
// If current material is not in any bins, don't bother checking
124-
if (!contains(materials_, p.material())) {
125-
return;
126-
}
127-
128127
// First determine which elements the particle crosses (may or may not
129128
// actually match bins so we have to adjust bins_/weight_ after)
130129
int32_t n_start = match.bins_.size();

0 commit comments

Comments
 (0)