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

Unified Diff: chrome/browser/android/offline_pages/offline_page_utils.cc

Issue 2950803002: Use ContainsValue() instead of std::find() in chrome/browser/ and chrome/test/ (Closed)
Patch Set: Reverted code for file thumbnail_cache.cc Created 3 years, 6 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 | « no previous file | chrome/browser/android/preferences/website_preference_bridge.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/offline_pages/offline_page_utils.cc
diff --git a/chrome/browser/android/offline_pages/offline_page_utils.cc b/chrome/browser/android/offline_pages/offline_page_utils.cc
index 645041f9ca8f1005a1554293d4d742aa7cde0a5e..60573176593072e036ba258adb747b4bd00fba27 100644
--- a/chrome/browser/android/offline_pages/offline_page_utils.cc
+++ b/chrome/browser/android/offline_pages/offline_page_utils.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/location.h"
#include "base/metrics/histogram_macros.h"
+#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_util.h"
@@ -45,10 +46,8 @@ void OnGetPagesByURLDone(
std::string tab_id_str = base::IntToString(tab_id);
for (const auto& page : pages) {
- auto result = std::find(namespaces_to_show_in_original_tab.begin(),
- namespaces_to_show_in_original_tab.end(),
- page.client_id.name_space);
- if (result != namespaces_to_show_in_original_tab.end() &&
+ if (base::ContainsValue(namespaces_to_show_in_original_tab,
+ page.client_id.name_space) &&
page.client_id.id != tab_id_str) {
continue;
}
« no previous file with comments | « no previous file | chrome/browser/android/preferences/website_preference_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698