Skip to content

Commit

Permalink
localize function used once in whole dplug
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Piolat committed Dec 10, 2024
1 parent 92a4ef1 commit f85a728
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion fft/dplug/fft/fft.d
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,21 @@ public void inverseFFT(T)(Complex!T[] buffer) nothrow @nogc
// PERF: use pfft instead would be much faster
private void FFT_internal(T, FFTDirection direction)(Complex!T[] buffer) pure nothrow @nogc
{
static int intFloorLog2(int i) pure nothrow @nogc @safe
{
assert(i >= 1);
int result = 0;
while (i > 1)
{
i = i / 2;
result = result + 1;
}
return result;
}

int size = cast(int)(buffer.length);
assert(isPowerOfTwo(size));
int m = iFloorLog2(size);
int m = intFloorLog2(size);

Complex!T* pbuffer = buffer.ptr;

Expand Down

0 comments on commit f85a728

Please sign in to comment.