Simplify filter_fir max_idx

Observe that `nn` is at most `signal.size() - 1`, which occurs on the
final pass of the loop.  Therefore, `std::min` will always pick `nn`
instead of `signal.size() - 1`, so simplify out the call.
This commit is contained in:
Kp 2022-11-12 19:31:52 +00:00
parent fcfd237954
commit 48fd582698

View file

@ -203,7 +203,7 @@ static std::unique_ptr<int16_t[]> filter_fir(const std::span<const int16_t> sign
* unsigned subtraction to underflow.
*/
const std::size_t min_idx = (nn + 1 > coeffsLen ? nn + 1 - coeffsLen : 0u);
const std::size_t max_idx = std::min(nn, signal.size() - 1);
const std::size_t max_idx = nn;
if (min_idx > max_idx)
continue;