Some manual change to for-ranged loop.

Use "const auto&" where possible.
This commit is contained in:
Haojian Wu 2016-07-10 15:56:42 +02:00
parent 2717b96310
commit 4ac4dacffe
8 changed files with 9 additions and 8 deletions

View file

@ -241,7 +241,7 @@ void OnGetBackend(disk_cache::Backend** backend_ptr,
} else if (action == Session::CacheAction::STATS) {
base::StringPairs stats;
(*backend_ptr)->GetStats(&stats);
for (auto& stat : stats) {
for (const auto& stat : stats) {
if (stat.first == "Current size") {
int current_size;
base::StringToInt(stat.second, &current_size);

View file

@ -435,7 +435,7 @@ void CommonWebContentsDelegate::DevToolsRequestFileSystems() {
}
base::ListValue file_system_value;
for (auto& file_system : file_systems)
for (const auto& file_system : file_systems)
file_system_value.Append(CreateFileSystemValue(file_system));
web_contents_->CallClientFunction("DevToolsAPI.fileSystemsLoaded",
&file_system_value, nullptr, nullptr);

View file

@ -30,7 +30,7 @@ bool StringToAccelerator(const std::string& shortcut,
// Now, parse it into an accelerator.
int modifiers = ui::EF_NONE;
ui::KeyboardCode key = ui::VKEY_UNKNOWN;
for (auto& token : tokens) {
for (const auto& token : tokens) {
bool shifted = false;
ui::KeyboardCode code = atom::KeyboardCodeFromStr(token, &shifted);
if (shifted)

View file

@ -70,7 +70,7 @@ void WindowList::RemoveObserver(WindowListObserver* observer) {
// static
void WindowList::CloseAllWindows() {
WindowVector windows = GetInstance()->windows_;
for (auto& window : windows)
for (const auto& window : windows)
window->Close();
}