mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 21:25:36 -04:00
Append rather than prepend to neighbor lists
This commit is contained in:
parent
e6466e9867
commit
f5059cfaca
1 changed files with 9 additions and 1 deletions
|
|
@ -39,7 +39,15 @@ public:
|
|||
// while this thread was searching for a cell so make sure the given
|
||||
// element isn't a duplicate before adding it.
|
||||
if (std::find(list_.cbegin(), list_.cend(), new_elem) == list_.cend()) {
|
||||
list_.push_front(new_elem);
|
||||
// Find the end of the list and add the the new element there.
|
||||
if (!list_.empty()) {
|
||||
auto it1 = list_.cbegin();
|
||||
auto it2 = ++list_.cbegin();
|
||||
while (it2 != list_.cend()) it1 = it2++;
|
||||
list_.insert_after(it1, new_elem);
|
||||
} else {
|
||||
list_.push_front(new_elem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue