From 719d4ff458ff37ad7af3cf419423da25e0fb1e84 Mon Sep 17 00:00:00 2001 From: Sebastien Deronne Date: Sat, 23 Apr 2022 11:53:03 +0200 Subject: [PATCH] wifi: Use std::min to update m_endCcaBusy upon channel switching --- src/wifi/model/wifi-phy-state-helper.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/wifi/model/wifi-phy-state-helper.cc b/src/wifi/model/wifi-phy-state-helper.cc index d163aa179..79dc6f2e4 100644 --- a/src/wifi/model/wifi-phy-state-helper.cc +++ b/src/wifi/model/wifi-phy-state-helper.cc @@ -445,11 +445,7 @@ WifiPhyStateHelper::SwitchToChannelSwitching (Time switchingDuration) break; } - if (now < m_endCcaBusy) - { - m_endCcaBusy = now; - } - + m_endCcaBusy = std::min (now, m_endCcaBusy); m_stateLogger (now, switchingDuration, WifiPhyState::SWITCHING); m_previousStateChangeTime = now; m_startSwitching = now;