Commit a4a66153 authored by Bartek Nowierski's avatar Bartek Nowierski Committed by Commit Bot

Use auto& instead of auto in the range loop

There are a couple reasons for this change:
1. Avoid copying a struct larger than a pointer.
2. If the pointer in the struct gets replaced by CheckedPtr with
   a non-trivial constructor, the compiler will complain.

See go/miracleptr for more details on the experimental CheckedPtr project.

Bug: 1080832
Change-Id: I520614995dcbae3bdab69a1423d288b2eeea9189
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2437991
Commit-Queue: Bartek Nowierski <bartekn@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Auto-Submit: Bartek Nowierski <bartekn@chromium.org>
Reviewed-by: default avatarAaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811661}
parent feec91aa
...@@ -280,7 +280,7 @@ void AutomationAXTreeWrapper::OnAtomicUpdateFinished( ...@@ -280,7 +280,7 @@ void AutomationAXTreeWrapper::OnAtomicUpdateFinished(
bool root_changed, bool root_changed,
const std::vector<ui::AXTreeObserver::Change>& changes) { const std::vector<ui::AXTreeObserver::Change>& changes) {
DCHECK_EQ(&tree_, tree); DCHECK_EQ(&tree_, tree);
for (const auto change : changes) { for (const auto& change : changes) {
ui::AXNode* node = change.node; ui::AXNode* node = change.node;
switch (change.type) { switch (change.type) {
case NODE_CREATED: case NODE_CREATED:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment