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

Unified Diff: chrome/browser/chromeos/input_method/input_method_util.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/chromeos/input_method/input_method_util.cc
diff --git a/chrome/browser/chromeos/input_method/input_method_util.cc b/chrome/browser/chromeos/input_method/input_method_util.cc
index 97971601d00109f31cc9f2091f85829bdd351d2a..baa4e7d92750d9a0ee32017c30e272d278b0ee33 100644
--- a/chrome/browser/chromeos/input_method/input_method_util.cc
+++ b/chrome/browser/chromeos/input_method/input_method_util.cc
@@ -6,13 +6,13 @@
#include <stddef.h>
-#include <algorithm>
#include <functional>
#include <map>
#include <utility>
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
+#include "base/stl_util.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -692,7 +692,7 @@ bool InputMethodUtil::MigrateInputMethods(
// Removes the duplicates.
std::vector<std::string> new_ids;
sky 2016/03/02 17:19:34 Make this use std::unique
chakshu 2016/03/07 08:10:46 Done.
for (size_t i = 0; i < ids.size(); ++i) {
- if (std::find(new_ids.begin(), new_ids.end(), ids[i]) == new_ids.end())
+ if (!ContainsValue(new_ids, ids[i]))
new_ids.push_back(ids[i]);
}
ids.swap(new_ids);

Powered by Google App Engine
This is Rietveld 408576698