mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
core: avoid reversing initialization order list
This commit is contained in:
parent
3f8a38adce
commit
2a068ec3a6
1 changed files with 3 additions and 5 deletions
|
@ -76,15 +76,13 @@ CoreFactory::make(PCIeCard* card, json_t *json_ips)
|
|||
|
||||
// Pick out IPs to be initialized first.
|
||||
//
|
||||
// Reverse order of the initialization order list, because we push to the
|
||||
// Reverse walktrough, because we push to the
|
||||
// front of the output list, so that the first element will also be the
|
||||
// first to be initialized.
|
||||
vlnvInitializationOrder.reverse();
|
||||
|
||||
for (auto &vlnvInitFirst : vlnvInitializationOrder) {
|
||||
for (auto viIt = vlnvInitializationOrder.rbegin(); viIt != vlnvInitializationOrder.rend(); ++viIt) {
|
||||
// Iterate over IPs, if VLNV matches, push to front and remove from list
|
||||
for (auto it = allIps.begin(); it != allIps.end(); ++it) {
|
||||
if (vlnvInitFirst == it->getVlnv()) {
|
||||
if (*viIt == it->getVlnv()) {
|
||||
orderedIps.push_front(*it);
|
||||
it = allIps.erase(it);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue