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

Unified Diff: ui/views/view.cc

Issue 1485093003: ui: use base's ContainsValue helper function instead of std::find (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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: ui/views/view.cc
diff --git a/ui/views/view.cc b/ui/views/view.cc
index e00d1299d823d6788fa8a2a08748b80850b495ac..fafa9e39649f2b331068d7ef985fedc1f27f7537 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -12,6 +12,7 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
+#include "base/stl_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/trace_event/trace_event.h"
@@ -1090,8 +1091,7 @@ void View::AddAccelerator(const ui::Accelerator& accelerator) {
if (!accelerators_.get())
accelerators_.reset(new std::vector<ui::Accelerator>());
- if (std::find(accelerators_->begin(), accelerators_->end(), accelerator) ==
- accelerators_->end()) {
+ if (!ContainsValue(accelerators_.get(), accelerator)) {
sky 2015/12/01 22:08:31 nit: nuke {}
tfarina 2015/12/02 20:31:41 Done.
accelerators_->push_back(accelerator);
}
RegisterPendingAccelerators();

Powered by Google App Engine
This is Rietveld 408576698