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

Unified Diff: chrome/browser/predictors/autocomplete_action_predictor.cc

Issue 1715683002: chrome: Use base's ContainsValue helper function instead of std::find (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing non ContainsValue changes Created 4 years, 9 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/predictors/autocomplete_action_predictor.cc
diff --git a/chrome/browser/predictors/autocomplete_action_predictor.cc b/chrome/browser/predictors/autocomplete_action_predictor.cc
index 6e63728012885931e61e700bab1e480398774c10..edf387246cffb1eb9caa3ca957dbdb1858ed40c3 100644
--- a/chrome/browser/predictors/autocomplete_action_predictor.cc
+++ b/chrome/browser/predictors/autocomplete_action_predictor.cc
@@ -14,6 +14,7 @@
#include "base/i18n/case_conversion.h"
#include "base/macros.h"
#include "base/metrics/histogram.h"
+#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
@@ -127,12 +128,9 @@ void AutocompleteActionPredictor::RegisterTransitionalMatches(
transitional_match);
}
- for (const auto& i : result) {
- if (std::find(match_it->urls.begin(), match_it->urls.end(),
- i.destination_url) == match_it->urls.end()) {
+ for (const auto& i : result)
sky 2016/04/04 15:39:00 keep the {} here.
chakshu 2016/04/05 05:03:36 Done.
+ if (!ContainsValue(match_it->urls, i.destination_url))
match_it->urls.push_back(i.destination_url);
- }
- }
}
void AutocompleteActionPredictor::ClearTransitionalMatches() {
« no previous file with comments | « chrome/browser/extensions/external_provider_impl.cc ('k') | chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698