From 50979b2a90ca31a4deafe5ec1d25f7bd1d0f18a4 Mon Sep 17 00:00:00 2001 From: Tolik Zinovyev Date: Fri, 24 Nov 2023 23:51:39 -0500 Subject: [PATCH] wifi: avoid computing durations when logging is disabled. --- src/wifi/model/phy-entity.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/wifi/model/phy-entity.cc b/src/wifi/model/phy-entity.cc index 23b668168..a861159f7 100644 --- a/src/wifi/model/phy-entity.cc +++ b/src/wifi/model/phy-entity.cc @@ -702,9 +702,8 @@ PhyEntity::EndReceivePayload(Ptr event) { const auto ppdu = event->GetPpdu(); const auto& txVector = ppdu->GetTxVector(); - const auto psduDuration = - ppdu->GetTxDuration() - CalculatePhyPreambleAndHeaderDuration(txVector); - NS_LOG_FUNCTION(this << *event << psduDuration); + NS_LOG_FUNCTION( + this << *event << ppdu->GetTxDuration() - CalculatePhyPreambleAndHeaderDuration(txVector)); NS_ASSERT(event->GetEndTime() == Simulator::Now()); const auto staId = GetStaId(ppdu); const auto channelWidthAndBand = GetChannelWidthAndBand(txVector, staId);