From 360134a8d4d2b488522ef5ca01329a658aa520ff Mon Sep 17 00:00:00 2001 From: prokrypt Date: Sat, 29 Jun 2024 13:56:16 -0700 Subject: [PATCH] spectrum: don't check blacklistFreqs if unset Fixes part of https://github.com/armel/uv-k5-firmware-custom/issues/151 --- app/spectrum.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/spectrum.c b/app/spectrum.c index c5383cc..fd46e8e 100644 --- a/app/spectrum.c +++ b/app/spectrum.c @@ -671,9 +671,10 @@ static void Blacklist() { #ifdef ENABLE_SCAN_RANGES static bool IsBlacklisted(uint16_t idx) { - for(uint8_t i = 0; i < ARRAY_SIZE(blacklistFreqs); i++) - if(blacklistFreqs[i] == idx) - return true; + if(blacklistedFreqs[0]) // cheaper than checking blacklistFreqsIdx + for(uint8_t i = 0; i < ARRAY_SIZE(blacklistFreqs); i++) + if(blacklistFreqs[i] == idx) + return true; return false; } #endif