forked from qt-creator/qt-creator
PluginManager: Code clean up
Mostly refactor some explicit loops, and nicer reverse looping. Change-Id: I102b86da597b37cd496762bd776af73ec407d838 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -418,4 +418,15 @@ inline void sort(Container &c, Predicate p)
|
||||
std::sort(c.begin(), c.end(), p);
|
||||
}
|
||||
|
||||
//////////////////
|
||||
// reverseForeach
|
||||
/////////////////
|
||||
template <typename Container, typename Op>
|
||||
inline void reverseForeach(const Container &c, const Op &operation)
|
||||
{
|
||||
auto rend = c.rend();
|
||||
for (auto it = c.rbegin(); it != rend; ++it)
|
||||
operation(*it);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user