Modernize to C++11: Use for-range loop.
This commit is contained in:
parent
3bdeac98bf
commit
55b3f1936f
17 changed files with 66 additions and 71 deletions
|
@ -241,10 +241,10 @@ void OnGetBackend(disk_cache::Backend** backend_ptr,
|
|||
} else if (action == Session::CacheAction::STATS) {
|
||||
base::StringPairs stats;
|
||||
(*backend_ptr)->GetStats(&stats);
|
||||
for (size_t i = 0; i < stats.size(); ++i) {
|
||||
if (stats[i].first == "Current size") {
|
||||
for (auto& stat : stats) {
|
||||
if (stat.first == "Current size") {
|
||||
int current_size;
|
||||
base::StringToInt(stats[i].second, ¤t_size);
|
||||
base::StringToInt(stat.second, ¤t_size);
|
||||
RunCallbackInUI(callback, current_size);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -685,10 +685,10 @@ void WebContents::TitleWasSet(content::NavigationEntry* entry,
|
|||
void WebContents::DidUpdateFaviconURL(
|
||||
const std::vector<content::FaviconURL>& urls) {
|
||||
std::set<GURL> unique_urls;
|
||||
for (auto iter = urls.begin(); iter != urls.end(); ++iter) {
|
||||
if (iter->icon_type != content::FaviconURL::FAVICON)
|
||||
for (const auto& iter : urls) {
|
||||
if (iter.icon_type != content::FaviconURL::FAVICON)
|
||||
continue;
|
||||
const GURL& url = iter->icon_url;
|
||||
const GURL& url = iter.icon_url;
|
||||
if (url.is_valid())
|
||||
unique_urls.insert(url);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue