sim: Use a range based for loop in EmbeddedPython::initAll.

Change-Id: I380bed880735a411c6069079b4ae38a9d9080744
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48366
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
This commit is contained in:
Gabe Black
2021-07-17 05:21:53 -07:00
committed by Gabe Black
parent 21c1d03dda
commit b2067870e5

View File

@@ -143,12 +143,10 @@ EmbeddedPython::initAll()
// Load the rest of the embedded python files into the embedded
// python importer
std::list<EmbeddedPython *>::iterator i = getList().begin();
std::list<EmbeddedPython *>::iterator end = getList().end();
for (; i != end; ++i)
if (!(*i)->addModule())
for (auto *embedded: getList()) {
if (!embedded->addModule())
return 1;
}
return 0;
}