Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1235)

Unified Diff: chrome/browser/extensions/updater/extension_updater.cc

Issue 2961033002: Use ContainsValue() instead of std::find() in chrome/browser/extensions (Closed)
Patch Set: Reverted code changes in language_settings_private_api.cc:307 Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/updater/extension_updater.cc
diff --git a/chrome/browser/extensions/updater/extension_updater.cc b/chrome/browser/extensions/updater/extension_updater.cc
index 4c666766412938f41e65d91a0d7b3352700106cb..0d8e0b7750461a7bbb4cd93d6312207e9f2698fb 100644
--- a/chrome/browser/extensions/updater/extension_updater.cc
+++ b/chrome/browser/extensions/updater/extension_updater.cc
@@ -6,7 +6,6 @@
#include <stdint.h>
-#include <algorithm>
#include <set>
#include <vector>
@@ -319,11 +318,9 @@ void ExtensionUpdater::AddToDownloader(
// An extension might be overwritten by policy, and have its update url
// changed. Make sure existing extensions aren't fetched again, if a
// pending fetch for an extension with the same id already exists.
- std::list<std::string>::const_iterator pending_id_iter = std::find(
- pending_ids.begin(), pending_ids.end(), extension.id());
- if (pending_id_iter == pending_ids.end()) {
- if (downloader_->AddExtension(extension, request_id, fetch_priority))
- request.in_progress_ids_.push_back(extension.id());
+ if (!base::ContainsValue(pending_ids, extension.id()) &&
+ downloader_->AddExtension(extension, request_id, fetch_priority)) {
+ request.in_progress_ids_.push_back(extension.id());
}
}
}
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698