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

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: More rebase 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 1afed4427c2c985dbe2cf3e8de16c249620d16bf..dc164cb503b8be54248259461ddaf11d9d1c85d2 100644
--- a/third_party/WebKit/Source/platform/audio/HRTFPanner.cpp
+++ b/third_party/WebKit/Source/platform/audio/HRTFPanner.cpp
@@ -25,7 +25,6 @@
#include "platform/audio/HRTFPanner.h"
#if ENABLE(WEB_AUDIO)
-#include <algorithm>
#include "platform/audio/AudioBus.h"
#include "platform/audio/AudioUtilities.h"
#include "platform/audio/HRTFDatabase.h"
@@ -116,8 +115,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;
}
« no previous file with comments | « third_party/WebKit/Source/platform/audio/HRTFKernel.cpp ('k') | third_party/WebKit/Source/platform/audio/VectorMath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698