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

Unified Diff: third_party/WebKit/Source/platform/audio/HRTFKernel.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/HRTFKernel.cpp
diff --git a/third_party/WebKit/Source/platform/audio/HRTFKernel.cpp b/third_party/WebKit/Source/platform/audio/HRTFKernel.cpp
index 3e1a7c2ec5e605028bfdadef3dbd3f6d6d7825ff..8ae0a19d6803114f170d17f05ff56886a448170c 100644
--- a/third_party/WebKit/Source/platform/audio/HRTFKernel.cpp
+++ b/third_party/WebKit/Source/platform/audio/HRTFKernel.cpp
@@ -32,6 +32,7 @@
#include "platform/audio/AudioChannel.h"
#include "platform/FloatConversion.h"
#include "wtf/MathExtras.h"
+#include <algorithm>
namespace blink {
@@ -111,7 +112,7 @@ PassOwnPtr<HRTFKernel> HRTFKernel::createInterpolatedKernel(HRTFKernel* kernel1,
return nullptr;
ASSERT(x >= 0.0 && x < 1.0);
- x = std::min(1.0f, std::max(0.0f, x));
+ x = clampTo(x, 0.0f, 1.0f);
float sampleRate1 = kernel1->sampleRate();
float sampleRate2 = kernel2->sampleRate();
« no previous file with comments | « third_party/WebKit/Source/platform/audio/HRTFDatabase.cpp ('k') | third_party/WebKit/Source/platform/audio/HRTFPanner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698