replace while with shorter for loop

Simplify rtw_get_rateset_len() by replacing the while loop
with a shorter for loop. Also replace tabs with spaces in
the definition line.
This commit is contained in:
Carlos Garcés 2021-10-22 23:03:43 +02:00 committed by Carlos Garces
parent 879f617f82
commit 99c0f78547

View File

@ -482,18 +482,13 @@ void rtw_set_supported_rate(u8 *SupportedRates, uint mode)
}
}
uint rtw_get_rateset_len(u8 *rateset)
uint rtw_get_rateset_len(u8 *rateset)
{
uint i = 0;
while (1) {
if ((rateset[i]) == 0)
break;
uint i;
if (i > 12)
for (i = 0; i < 13; i++)
if (rateset[i] == 0)
break;
i++;
}
return i;
}