Use resize() operator in fission bank sorting function.

Co-Authored-By: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
John Tramm 2020-01-17 14:19:02 -06:00 committed by GitHub
parent 1c497e1759
commit 38dacc97e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -88,7 +88,7 @@ void sort_fission_bank()
// If there is not enough space, allocate a temporary vector and point to it
if (simulation::fission_bank_length > simulation::fission_bank_max / 2) {
sorted_bank_holder = std::vector<Particle::Bank>(simulation::fission_bank_length);
sorted_bank_holder.resize(simulation::fission_bank_length);
sorted_bank = sorted_bank_holder.data();
} else { // otherwise, point sorted_bank to unused portion of the fission bank
sorted_bank = &simulation::fission_bank[simulation::fission_bank_length];