aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-01-15 17:49:14 -0800
committerChris Robinson <[email protected]>2023-01-15 17:49:14 -0800
commiteef886b0f215877a3888391122bac8bdb0b76ddf (patch)
treee30884590938213edc724906f6b3cd9536fbda79 /common
parent88796d2ad51f014f0ec236c0e1df624ac8224cb7 (diff)
Precalculate reused scale factors
Diffstat (limited to 'common')
-rw-r--r--common/alcomplex.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/alcomplex.cpp b/common/alcomplex.cpp
index 2e3e0a60..b6cac4cd 100644
--- a/common/alcomplex.cpp
+++ b/common/alcomplex.cpp
@@ -158,7 +158,7 @@ void complex_hilbert(const al::span<std::complex<double>> buffer)
*bufiter *= inverse_size; ++bufiter;
bufiter = std::transform(bufiter, halfiter, bufiter,
- [inverse_size](auto a){ return a * (2.0 * inverse_size); });
+ [scale=inverse_size*2.0](auto a){ return a * scale; });
*bufiter *= inverse_size; ++bufiter;
std::fill(bufiter, buffer.end(), std::complex<double>{});