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

Unified Diff: third_party/WebKit/Source/platform/audio/HRTFPanner.cpp

Issue 1530723004: Use clampTo instead of chaining std::max(std::min(...)) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Handling that minimumThumbLength > trackLen. Created 5 years 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: third_party/WebKit/Source/platform/audio/HRTFPanner.cpp
diff --git a/third_party/WebKit/Source/platform/audio/HRTFPanner.cpp b/third_party/WebKit/Source/platform/audio/HRTFPanner.cpp
index 062235ff9b27e0f8e647c7369ff8f7582cc7df32..c9558db8e6cec5ea218a400ded69bb87e1d48657 100644
--- a/third_party/WebKit/Source/platform/audio/HRTFPanner.cpp
+++ b/third_party/WebKit/Source/platform/audio/HRTFPanner.cpp
@@ -28,7 +28,6 @@
#include "platform/audio/HRTFPanner.h"
-#include <algorithm>
#include "platform/audio/AudioBus.h"
#include "platform/audio/AudioUtilities.h"
#include "platform/audio/HRTFDatabase.h"
@@ -119,8 +118,7 @@ int HRTFPanner::calculateDesiredAzimuthIndexAndBlend(double azimuth, double& azi
// We don't immediately start using this azimuth index, but instead approach this index from the last index we rendered at.
// This minimizes the clicks and graininess for moving sources which occur otherwise.
- desiredAzimuthIndex = std::max(0, desiredAzimuthIndex);
- desiredAzimuthIndex = std::min(numberOfAzimuths - 1, desiredAzimuthIndex);
+ desiredAzimuthIndex = clampTo(desiredAzimuthIndex, 0, numberOfAzimuths - 1);
return desiredAzimuthIndex;
}

Powered by Google App Engine
This is Rietveld 408576698