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

Unified Diff: chromecast/media/cma/backend/alsa/stream_mixer_alsa.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
« no previous file with comments | « chromecast/media/audio/cast_audio_mixer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/media/cma/backend/alsa/stream_mixer_alsa.cc
diff --git a/chromecast/media/cma/backend/alsa/stream_mixer_alsa.cc b/chromecast/media/cma/backend/alsa/stream_mixer_alsa.cc
index 3779dcdb65afba5af17754efa9b763da6c3d665d..c6f5ba3142eed2c98e95f875b660d7ed6e850357 100644
--- a/chromecast/media/cma/backend/alsa/stream_mixer_alsa.cc
+++ b/chromecast/media/cma/backend/alsa/stream_mixer_alsa.cc
@@ -17,6 +17,7 @@
#include "base/memory/weak_ptr.h"
#include "base/numerics/saturated_arithmetic.h"
#include "base/single_thread_task_runner.h"
+#include "base/stl_util.h"
#include "base/threading/platform_thread.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
@@ -1021,16 +1022,14 @@ void StreamMixerAlsa::AddLoopbackAudioObserver(
CastMediaShlib::LoopbackAudioObserver* observer) {
RUN_ON_MIXER_THREAD(&StreamMixerAlsa::AddLoopbackAudioObserver, observer);
DCHECK(observer);
- DCHECK(std::find(loopback_observers_.begin(), loopback_observers_.end(),
- observer) == loopback_observers_.end());
+ DCHECK(!base::ContainsValue(loopback_observers_, observer));
loopback_observers_.push_back(observer);
}
void StreamMixerAlsa::RemoveLoopbackAudioObserver(
CastMediaShlib::LoopbackAudioObserver* observer) {
RUN_ON_MIXER_THREAD(&StreamMixerAlsa::RemoveLoopbackAudioObserver, observer);
- DCHECK(std::find(loopback_observers_.begin(), loopback_observers_.end(),
- observer) != loopback_observers_.end());
+ DCHECK(base::ContainsValue(loopback_observers_, observer));
loopback_observers_.erase(std::remove(loopback_observers_.begin(),
loopback_observers_.end(), observer),
loopback_observers_.end());
« no previous file with comments | « chromecast/media/audio/cast_audio_mixer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698