X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-core%2Fsrc%2Fdsp%2Ffft.rs;h=ee4ab7c774b58c065a75b2263126ec40fbc9a7fb;hb=e243ceb4d694cc08767ad70027bb6963f4cefea3;hp=1255f6c5db0138d2299adde56a89fa97b43c4640;hpb=9e78289cc98dddb8f6d6ea4fc4c3655636e31a72;p=nihav.git diff --git a/nihav-core/src/dsp/fft.rs b/nihav-core/src/dsp/fft.rs index 1255f6c..ee4ab7c 100644 --- a/nihav-core/src/dsp/fft.rs +++ b/nihav-core/src/dsp/fft.rs @@ -542,9 +542,7 @@ impl FFT { for idx in 0..self.swaps.len() { let nidx = self.swaps[idx]; if idx != nidx { - let t = data[nidx]; - data[nidx] = data[idx]; - data[idx] = t; + data.swap(nidx, idx); } } self.do_fft_core(data); @@ -553,9 +551,7 @@ impl FFT { for idx in 0..self.swaps.len() { let nidx = self.swaps[idx]; if idx != nidx { - let t = data[nidx]; - data[nidx] = data[idx]; - data[idx] = t; + data.swap(nidx, idx); } } self.do_ifft_core(data);