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

Unified Diff: chrome/browser/extensions/blacklist.cc

Issue 22460011: [CleanUp] Use base::STLSetDifference in place of std::set_difference (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing head file. Created 7 years, 4 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
Index: chrome/browser/extensions/blacklist.cc
diff --git a/chrome/browser/extensions/blacklist.cc b/chrome/browser/extensions/blacklist.cc
index e0f6dbb5fe368c49138b269938faf40191e7b666..902bbcdd998c819ab337fb0140180132a3e55c17 100644
--- a/chrome/browser/extensions/blacklist.cc
+++ b/chrome/browser/extensions/blacklist.cc
@@ -10,6 +10,7 @@
#include "base/lazy_instance.h"
#include "base/memory/ref_counted.h"
#include "base/prefs/pref_service.h"
+#include "base/stl_util.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/extensions/extension_prefs.h"
@@ -217,16 +218,12 @@ void Blacklist::SetFromUpdater(const std::vector<std::string>& ids,
std::set<std::string> from_prefs = prefs_->GetBlacklistedExtensions();
- std::set<std::string> no_longer_blacklisted;
- std::set_difference(from_prefs.begin(), from_prefs.end(),
- ids_as_set.begin(), ids_as_set.end(),
- std::inserter(no_longer_blacklisted,
- no_longer_blacklisted.begin()));
- std::set<std::string> not_yet_blacklisted;
- std::set_difference(ids_as_set.begin(), ids_as_set.end(),
- from_prefs.begin(), from_prefs.end(),
- std::inserter(not_yet_blacklisted,
- not_yet_blacklisted.begin()));
+ std::set<std::string> no_longer_blacklisted =
+ base::STLSetDifference<std::set<std::string> >(from_prefs,
+ ids_as_set);
+ std::set<std::string> not_yet_blacklisted =
+ base::STLSetDifference<std::set<std::string> >(ids_as_set,
+ from_prefs);
for (std::set<std::string>::iterator it = no_longer_blacklisted.begin();
it != no_longer_blacklisted.end(); ++it) {
« no previous file with comments | « chrome/browser/download/download_history_unittest.cc ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698