From ee139e493c062d2efb4e195c43da04865dfd0593 Mon Sep 17 00:00:00 2001 From: Tolik Zinovyev Date: Tue, 29 Oct 2024 20:35:43 +0000 Subject: [PATCH] wifi: optimize WifiPpdu destructor --- src/wifi/model/wifi-ppdu.cc | 9 --------- src/wifi/model/wifi-ppdu.h | 4 ++-- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/wifi/model/wifi-ppdu.cc b/src/wifi/model/wifi-ppdu.cc index cfbe0c5fcf..9f9b644fe3 100644 --- a/src/wifi/model/wifi-ppdu.cc +++ b/src/wifi/model/wifi-ppdu.cc @@ -100,15 +100,6 @@ WifiPpdu::WifiPpdu(const WifiConstPsduMap& psdus, m_psdus = psdus; } -WifiPpdu::~WifiPpdu() -{ - for (auto& psdu : m_psdus) - { - psdu.second = nullptr; - } - m_psdus.clear(); -} - const WifiTxVector& WifiPpdu::GetTxVector() const { diff --git a/src/wifi/model/wifi-ppdu.h b/src/wifi/model/wifi-ppdu.h index 0cb48c0aa5..4b001eaeab 100644 --- a/src/wifi/model/wifi-ppdu.h +++ b/src/wifi/model/wifi-ppdu.h @@ -9,6 +9,7 @@ #ifndef WIFI_PPDU_H #define WIFI_PPDU_H +#include "wifi-psdu.h" #include "wifi-tx-vector.h" #include "ns3/nstime.h" @@ -29,7 +30,6 @@ namespace ns3 { class Packet; -class WifiPsdu; class WifiPhyOperatingChannel; /** @@ -73,7 +73,7 @@ class WifiPpdu : public SimpleRefCount /** * Destructor for WifiPpdu. */ - virtual ~WifiPpdu(); + virtual ~WifiPpdu() = default; /** * Get the TXVECTOR used to send the PPDU.