From 99c0f78547eb5679046fcb93415e21bb5c8bed84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Garc=C3=A9s?= Date: Fri, 22 Oct 2021 23:03:43 +0200 Subject: [PATCH] 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. --- core/rtw_ieee80211.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/core/rtw_ieee80211.c b/core/rtw_ieee80211.c index 12e230e..2134a34 100644 --- a/core/rtw_ieee80211.c +++ b/core/rtw_ieee80211.c @@ -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; }