spectrum: don't check blacklistFreqs if unset

Fixes part of https://github.com/armel/uv-k5-firmware-custom/issues/151
This commit is contained in:
prokrypt
2024-06-29 13:56:16 -07:00
committed by GitHub
parent 45987500f2
commit 360134a8d4

View File

@@ -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