diff --git a/selfdrive/locationd/estimators/lateral_lag.py b/selfdrive/locationd/estimators/lateral_lag.py index afa41256da..bde9bf79f1 100644 --- a/selfdrive/locationd/estimators/lateral_lag.py +++ b/selfdrive/locationd/estimators/lateral_lag.py @@ -23,8 +23,9 @@ def fft_next_good_size(n): smallest composite of 2, 3, 5, 7, 11 that is >= n inspired by pocketfft """ - if n <= 6: return n - best = 2 * n; f2 = 1 + if n <= 6: + return n + best, f2 = 2 * n, 1 while f2 < best: f23 = f2 while f23 < best: @@ -34,7 +35,8 @@ def fft_next_good_size(n): while f2357 < best: f235711 = f2357 while f235711 < best: - best = f235711 if f235711 >= n else best; f235711 *= 11 + best = f235711 if f235711 >= n else best + f235711 *= 11 f2357 *= 7 f235 *= 5 f23 *= 3