From aea31e85f6c2718e5fb4b3cf41462f31889b19eb Mon Sep 17 00:00:00 2001 From: Armel FAUVEAU Date: Tue, 2 Jul 2024 02:01:50 +0200 Subject: [PATCH] Fix pull request #152 --- app/spectrum.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/spectrum.c b/app/spectrum.c index c5383cc..3edecc0 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(blacklistFreqs[0]) // cheaper than checking blacklistFreqsIdx + for(uint8_t i = 0; i < ARRAY_SIZE(blacklistFreqs); i++) + if(blacklistFreqs[i] == idx) + return true; return false; } #endif