mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 21:25:36 -04:00
Change initialization order instead of declaration order for FilterBinIter.
This commit is contained in:
parent
19c9f3464c
commit
d9a135f234
2 changed files with 7 additions and 10 deletions
|
|
@ -39,18 +39,15 @@ public:
|
|||
|
||||
FilterBinIter& operator++();
|
||||
|
||||
int index_ {1};
|
||||
double weight_ {1.};
|
||||
|
||||
std::vector<FilterMatch>& filter_matches_;
|
||||
|
||||
private:
|
||||
void compute_index_weight();
|
||||
|
||||
// Data members
|
||||
const Tally& tally_;
|
||||
|
||||
public:
|
||||
|
||||
int index_ {1};
|
||||
double weight_ {1.};
|
||||
|
||||
std::vector<FilterMatch>& filter_matches_;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ namespace openmc {
|
|||
//==============================================================================
|
||||
|
||||
FilterBinIter::FilterBinIter(const Tally& tally, Particle* p)
|
||||
: tally_{tally}, filter_matches_{p->filter_matches_}
|
||||
: filter_matches_{p->filter_matches_}, tally_{tally}
|
||||
{
|
||||
// Find all valid bins in each relevant filter if they have not already been
|
||||
// found for this event.
|
||||
|
|
@ -57,7 +57,7 @@ FilterBinIter::FilterBinIter(const Tally& tally, Particle* p)
|
|||
|
||||
FilterBinIter::FilterBinIter(const Tally& tally, bool end,
|
||||
std::vector<FilterMatch>* particle_filter_matches)
|
||||
: tally_{tally}, filter_matches_{*particle_filter_matches}
|
||||
: filter_matches_{*particle_filter_matches}, tally_{tally}
|
||||
{
|
||||
// Handle the special case for an iterator that points to the end.
|
||||
if (end) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue