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

Unified Diff: third_party/WebKit/Source/platform/audio/VectorMath.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/VectorMath.cpp
diff --git a/third_party/WebKit/Source/platform/audio/VectorMath.cpp b/third_party/WebKit/Source/platform/audio/VectorMath.cpp
index 9ee13512122aefd377ba240067dd2ee6f5dfef7c..6c8614914f7eed7fcb9bee148c8354d92d237bfb 100644
--- a/third_party/WebKit/Source/platform/audio/VectorMath.cpp
+++ b/third_party/WebKit/Source/platform/audio/VectorMath.cpp
@@ -27,6 +27,7 @@
#if ENABLE(WEB_AUDIO)
#include "wtf/Assertions.h"
#include "wtf/CPU.h"
+#include "wtf/MathExtras.h"
#include <stdint.h>
#if OS(MACOSX)
@@ -673,7 +674,7 @@ void vclip(const float* sourceP, int sourceStride, const float* lowThresholdP, c
}
#endif
while (n--) {
- *destP = std::max(std::min(*sourceP, highThreshold), lowThreshold);
+ *destP = clampTo(*sourceP, lowThreshold, highThreshold);
sourceP += sourceStride;
destP += destStride;
}
« no previous file with comments | « third_party/WebKit/Source/platform/audio/HRTFPanner.cpp ('k') | third_party/WebKit/Source/platform/graphics/Color.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698