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

Unified Diff: ui/aura/window.cc

Issue 2926383003: Use ContainsValue() instead of std::find() in ui/aura, ui/display and ui/events (Closed)
Patch Set: 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/aura/window_event_dispatcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window.cc
diff --git a/ui/aura/window.cc b/ui/aura/window.cc
index 2712b0660894b2dd27d3702e0033be7a70f078a0..5ed1291f06fc7c9f7640ce673e2eab5929b53232 100644
--- a/ui/aura/window.cc
+++ b/ui/aura/window.cc
@@ -15,6 +15,7 @@
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
+#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -359,8 +360,7 @@ void Window::AddChild(Window* child) {
port_->OnWillAddChild(child);
- DCHECK(std::find(children_.begin(), children_.end(), child) ==
- children_.end());
+ DCHECK(!base::ContainsValue(children_, child));
if (child->parent())
child->parent()->RemoveChildImpl(child, this);
@@ -634,8 +634,7 @@ void Window::RemoveOrDestroyChildren() {
if (child->owned_by_parent_) {
delete child;
// Deleting the child so remove it from out children_ list.
- DCHECK(std::find(children_.begin(), children_.end(), child) ==
- children_.end());
+ DCHECK(!base::ContainsValue(children_, child));
} else {
// Even if we can't delete the child, we still need to remove it from the
// parent so that relevant bookkeeping (parent_ back-pointers etc) are
« no previous file with comments | « no previous file | ui/aura/window_event_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698