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

Unified Diff: ui/android/view_android.cc

Issue 2930573005: Use ContainsValue() instead of std::find() in ui/android, ui/base and ui/views (Closed)
Patch Set: Changed EXPECT_FALSE to EXPECT_TRUE 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 | ui/base/accelerators/accelerator_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/android/view_android.cc
diff --git a/ui/android/view_android.cc b/ui/android/view_android.cc
index abec6aba03397c9236c6797d82e460e71c0cb5be..3fc07b50c1a45c51fc0eff7177c7906c646bde5c 100644
--- a/ui/android/view_android.cc
+++ b/ui/android/view_android.cc
@@ -9,6 +9,7 @@
#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
#include "base/containers/adapters.h"
+#include "base/stl_util.h"
#include "cc/layers/layer.h"
#include "jni/ViewAndroidDelegate_jni.h"
#include "ui/android/event_forwarder.h"
@@ -116,8 +117,7 @@ ScopedJavaLocalRef<jobject> ViewAndroid::GetEventForwarder() {
void ViewAndroid::AddChild(ViewAndroid* child) {
DCHECK(child);
- DCHECK(std::find(children_.begin(), children_.end(), child) ==
- children_.end());
+ DCHECK(!base::ContainsValue(children_, child));
DCHECK(!RootPathHasEventForwarder(this) || !SubtreeHasEventForwarder(child))
<< "Some view tree path will have more than one event forwarder "
"if the child is added.";
« no previous file with comments | « no previous file | ui/base/accelerators/accelerator_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698