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

Unified Diff: chromecast/media/audio/cast_audio_mixer.cc

Issue 2920723002: Use ContainsValue() instead of std::find() in chromecast/ (Closed)
Patch Set: Adding blank line and removing an extra line. Created 3 years, 7 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: chromecast/media/audio/cast_audio_mixer.cc
diff --git a/chromecast/media/audio/cast_audio_mixer.cc b/chromecast/media/audio/cast_audio_mixer.cc
index a7ed6f5bc1682434c460ad263ea0374ca1d52f0b..d1d3520ec9e904be8f934bb6031cea36c8199e45 100644
--- a/chromecast/media/audio/cast_audio_mixer.cc
+++ b/chromecast/media/audio/cast_audio_mixer.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
+#include "base/stl_util.h"
#include "chromecast/media/audio/cast_audio_manager.h"
#include "chromecast/media/audio/cast_audio_output_stream.h"
#include "media/base/audio_timestamp_helper.h"
@@ -201,8 +202,7 @@ CastAudioMixer::~CastAudioMixer() {}
bool CastAudioMixer::Register(MixerProxyStream* proxy_stream) {
DCHECK_CALLED_ON_VALID_THREAD(audio_thread_checker_);
- DCHECK(std::find(proxy_streams_.begin(), proxy_streams_.end(),
- proxy_stream) == proxy_streams_.end());
+ DCHECK(!base::ContainsValue(proxy_streams_, proxy_stream));
// Do not allow opening new streams while in error state.
if (error_)
@@ -227,8 +227,7 @@ bool CastAudioMixer::Register(MixerProxyStream* proxy_stream) {
void CastAudioMixer::Unregister(MixerProxyStream* proxy_stream) {
DCHECK_CALLED_ON_VALID_THREAD(audio_thread_checker_);
- DCHECK(std::find(proxy_streams_.begin(), proxy_streams_.end(),
- proxy_stream) != proxy_streams_.end());
+ DCHECK(base::ContainsValue(proxy_streams_, proxy_stream));
proxy_streams_.erase(proxy_stream);
« no previous file with comments | « chromecast/graphics/cast_focus_client_aura.cc ('k') | chromecast/media/cma/backend/alsa/stream_mixer_alsa.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698