update_engine: Use C++11 range-based for loop when possible.
This cleanup just simplifies the notation of several for loops using
the new range-based syntax.
BUG=None
TEST=`FEATURES=test USE="lang clang" emerge-link update_engine`
Change-Id: I2120a1b1c3fd00e9a02a62abfa8427932080d0f9
Reviewed-on: https://chromium-review.googlesource.com/227897
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
diff --git a/update_attempter.cc b/update_attempter.cc
index 200493d..32c3728 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -673,9 +673,8 @@
actions_.push_back(shared_ptr<AbstractAction>(update_complete_action));
// Enqueue the actions
- for (vector<shared_ptr<AbstractAction>>::iterator it = actions_.begin();
- it != actions_.end(); ++it) {
- processor_->EnqueueAction(it->get());
+ for (const shared_ptr<AbstractAction>& action : actions_) {
+ processor_->EnqueueAction(action.get());
}
}
@@ -727,9 +726,8 @@
BuildPostInstallActions(install_plan_action.get());
// Enqueue the actions
- for (vector<shared_ptr<AbstractAction>>::iterator it = actions_.begin();
- it != actions_.end(); ++it) {
- processor_->EnqueueAction(it->get());
+ for (const shared_ptr<AbstractAction>& action : actions_) {
+ processor_->EnqueueAction(action.get());
}
// Update the payload state for Rollback.