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

Unified Diff: chrome/browser/spellchecker/spellcheck_service.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: Updated as per latest code Created 4 years, 10 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/spellchecker/spellcheck_service.cc
diff --git a/chrome/browser/spellchecker/spellcheck_service.cc b/chrome/browser/spellchecker/spellcheck_service.cc
index 7360f061548efc9d4258c6ee0d3eac1bec9a3719..9b0b9962f51ef9827c185ede2cd9391df29774b6 100644
--- a/chrome/browser/spellchecker/spellcheck_service.cc
+++ b/chrome/browser/spellchecker/spellcheck_service.cc
@@ -7,6 +7,7 @@
#include <set>
#include "base/logging.h"
+#include "base/stl_util.h"
#include "base/strings/string_split.h"
#include "base/supports_user_data.h"
#include "base/synchronization/waitable_event.h"
@@ -354,8 +355,7 @@ void SpellcheckService::OnAcceptLanguagesChanged() {
std::vector<std::string> filtered_dictionaries;
for (const auto& dictionary : dictionaries) {
sky 2016/03/02 17:19:34 Isn't this std::set_intersection?
chakshu 2016/03/07 08:10:46 Yes, probably it is. Made the changes using set_in
- if (std::find(accept_languages.begin(), accept_languages.end(),
- dictionary) != accept_languages.end()) {
+ if (ContainsValue(accept_languages, dictionary)) {
sky 2016/03/02 17:19:34 nit: no {}
chakshu 2016/03/07 08:10:46 Done.
filtered_dictionaries.push_back(dictionary);
}
}

Powered by Google App Engine
This is Rietveld 408576698