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

Unified Diff: ui/base/clipboard/clipboard.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 | « ui/base/accelerators/accelerator_manager.cc ('k') | ui/base/ime/chromeos/character_composer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/clipboard/clipboard.cc
diff --git a/ui/base/clipboard/clipboard.cc b/ui/base/clipboard/clipboard.cc
index c8c0c38d6b19b21a5fc66f48162f656169297bf6..4b222a5823a694f0037add95269c6730c57a9054 100644
--- a/ui/base/clipboard/clipboard.cc
+++ b/ui/base/clipboard/clipboard.cc
@@ -4,7 +4,6 @@
#include "ui/base/clipboard/clipboard.h"
-#include <algorithm>
#include <iterator>
#include <limits>
#include <memory>
@@ -12,6 +11,7 @@
#include "base/debug/dump_without_crashing.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
+#include "base/stl_util.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/geometry/size.h"
@@ -159,9 +159,7 @@ base::PlatformThreadId Clipboard::GetAndValidateThreadID() {
// TODO(fdoray): Surround this block with #if DCHECK_IS_ON() and remove the
// DumpWithoutCrashing() call once https://crbug.com/662055 is resolved.
AllowedThreadsVector* allowed_threads = allowed_threads_.Pointer();
- if (!allowed_threads->empty() &&
- std::find(allowed_threads->begin(), allowed_threads->end(), id) ==
- allowed_threads->end()) {
+ if (!allowed_threads->empty() && !base::ContainsValue(*allowed_threads, id)) {
NOTREACHED();
base::debug::DumpWithoutCrashing();
}
« no previous file with comments | « ui/base/accelerators/accelerator_manager.cc ('k') | ui/base/ime/chromeos/character_composer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698