Skip to content

Commit

Permalink
wifi: No need to check if event is running to cancel it
Browse files Browse the repository at this point in the history
  • Loading branch information
sderonne authored and Sébastien Deronne committed Dec 13, 2023
1 parent 24d270d commit ac1573c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/wifi/model/phy-entity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1125,10 +1125,7 @@ PhyEntity::CancelRunningEndPreambleDetectionEvents(bool clear /* = false */)
NS_LOG_FUNCTION(this << clear);
for (auto& endPreambleDetectionEvent : m_endPreambleDetectionEvents)
{
if (endPreambleDetectionEvent.IsRunning())
{
endPreambleDetectionEvent.Cancel();
}
endPreambleDetectionEvent.Cancel();
}
if (clear)
{
Expand Down
5 changes: 1 addition & 4 deletions src/wifi/model/wifi-phy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2138,10 +2138,7 @@ WifiPhy::AbortCurrentReception(WifiPhyRxfailureReason reason)
{
phyEntity.second->CancelAllEvents();
}
if (m_endPhyRxEvent.IsRunning())
{
m_endPhyRxEvent.Cancel();
}
m_endPhyRxEvent.Cancel();
m_interference->NotifyRxEnd(Simulator::Now(), GetCurrentFrequencyRange());
if (!m_currentEvent)
{
Expand Down

0 comments on commit ac1573c

Please sign in to comment.