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

Unified Diff: extensions/common/matcher/url_matcher.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
« no previous file with comments | « chrome/common/extensions/permissions/permission_set.cc ('k') | ui/base/test/ui_cocoa_test_helper.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/matcher/url_matcher.cc
diff --git a/extensions/common/matcher/url_matcher.cc b/extensions/common/matcher/url_matcher.cc
index be3057a26b5f06502e55f407ec1de9223ee971c2..5a1d876cc6b8fa38967d1053df1de06f6f0d2c39 100644
--- a/extensions/common/matcher/url_matcher.cc
+++ b/extensions/common/matcher/url_matcher.cc
@@ -752,19 +752,15 @@ void URLMatcher::UpdateSubstringSetMatcher(bool full_url_conditions) {
: registered_url_component_patterns_;
// Add all patterns that are in new_patterns but not in registered_patterns.
- std::vector<const StringPattern*> patterns_to_register;
- std::set_difference(
- new_patterns.begin(), new_patterns.end(),
- registered_patterns.begin(), registered_patterns.end(),
- std::back_inserter(patterns_to_register));
+ std::vector<const StringPattern*> patterns_to_register =
+ base::STLSetDifference<std::vector<const StringPattern*> >(
+ new_patterns, registered_patterns);
// Remove all patterns that are in registered_patterns but not in
// new_patterns.
- std::vector<const StringPattern*> patterns_to_unregister;
- std::set_difference(
- registered_patterns.begin(), registered_patterns.end(),
- new_patterns.begin(), new_patterns.end(),
- std::back_inserter(patterns_to_unregister));
+ std::vector<const StringPattern*> patterns_to_unregister =
+ base::STLSetDifference<std::vector<const StringPattern*> >(
+ registered_patterns, new_patterns);
// Update the SubstringSetMatcher.
SubstringSetMatcher& url_matcher =
« no previous file with comments | « chrome/common/extensions/permissions/permission_set.cc ('k') | ui/base/test/ui_cocoa_test_helper.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698