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

Unified Diff: ios/chrome/browser/reading_list/url_downloader.cc

Issue 2945803002: Use ContainsValue() instead of std::find() in ios/ (Closed)
Patch Set: Fixed compilation error. 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
Index: ios/chrome/browser/reading_list/url_downloader.cc
diff --git a/ios/chrome/browser/reading_list/url_downloader.cc b/ios/chrome/browser/reading_list/url_downloader.cc
index 35c09342b2c8d572cb6c0f2589827ed64ee1651f..ddf99e64f44e7cb43aed156aaa6f68b2a34ba956 100644
--- a/ios/chrome/browser/reading_list/url_downloader.cc
+++ b/ios/chrome/browser/reading_list/url_downloader.cc
@@ -11,6 +11,7 @@
#include "base/files/file_util.h"
#include "base/memory/ptr_util.h"
#include "base/path_service.h"
+#include "base/stl_util.h"
#include "components/reading_list/core/offline_url_utils.h"
#include "ios/chrome/browser/chrome_paths.h"
#include "ios/chrome/browser/dom_distiller/distiller_viewer.h"
@@ -80,8 +81,7 @@ void URLDownloader::RemoveOfflineURL(const GURL& url) {
}
void URLDownloader::DownloadOfflineURL(const GURL& url) {
- if (std::find(tasks_.begin(), tasks_.end(), std::make_pair(DOWNLOAD, url)) ==
- tasks_.end()) {
+ if (!base::ContainsValue(tasks_, std::make_pair(DOWNLOAD, url))) {
tasks_.push_back(std::make_pair(DOWNLOAD, url));
HandleNextTask();
}
« no previous file with comments | « ios/chrome/browser/payments/payment_request.mm ('k') | ios/chrome/browser/reading_list/url_downloader_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698