wifi: Cache results of Get{Ack,Rts,Cts}Size() functions in wifi-utils.h
Thanks to Peter Barnes
This commit is contained in:
@@ -57,9 +57,9 @@ RatioToDb(double ratio)
|
||||
uint32_t
|
||||
GetAckSize()
|
||||
{
|
||||
WifiMacHeader ack;
|
||||
ack.SetType(WIFI_MAC_CTL_ACK);
|
||||
return ack.GetSize() + 4;
|
||||
static const uint32_t size = WifiMacHeader(WIFI_MAC_CTL_ACK).GetSize() + 4;
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
@@ -102,17 +102,17 @@ GetMuBarSize(std::list<BlockAckReqType> types)
|
||||
uint32_t
|
||||
GetRtsSize()
|
||||
{
|
||||
WifiMacHeader rts;
|
||||
rts.SetType(WIFI_MAC_CTL_RTS);
|
||||
return rts.GetSize() + 4;
|
||||
static const uint32_t size = WifiMacHeader(WIFI_MAC_CTL_RTS).GetSize() + 4;
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
GetCtsSize()
|
||||
{
|
||||
WifiMacHeader cts;
|
||||
cts.SetType(WIFI_MAC_CTL_CTS);
|
||||
return cts.GetSize() + 4;
|
||||
static const uint32_t size = WifiMacHeader(WIFI_MAC_CTL_CTS).GetSize() + 4;
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
Reference in New Issue
Block a user