From 20b68b01282781d91bbbdf621b0d749808eaae4a Mon Sep 17 00:00:00 2001 From: Tolik Zinovyev Date: Thu, 18 Apr 2024 10:24:53 -0400 Subject: [PATCH] wifi: avoid copying PpduFormats. --- src/wifi/model/phy-entity.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wifi/model/phy-entity.cc b/src/wifi/model/phy-entity.cc index e8b1da69f..5d76240f2 100644 --- a/src/wifi/model/phy-entity.cc +++ b/src/wifi/model/phy-entity.cc @@ -161,7 +161,7 @@ PhyEntity::GetSigMode(WifiPpduField field, const WifiTxVector& txVector) const WifiPpduField PhyEntity::GetNextField(WifiPpduField currentField, WifiPreamble preamble) const { - auto ppduFormats = GetPpduFormats(); + const auto& ppduFormats = GetPpduFormats(); const auto itPpdu = ppduFormats.find(preamble); if (itPpdu != ppduFormats.end()) { @@ -371,7 +371,7 @@ PhyEntity::DoStartReceiveField(WifiPpduField field, Ptr event) NS_LOG_FUNCTION(this << field << *event); NS_ASSERT(field != WIFI_PPDU_FIELD_PREAMBLE && field != WIFI_PPDU_FIELD_DATA); // handled apart for the time being - auto ppduFormats = GetPpduFormats(); + const auto& ppduFormats = GetPpduFormats(); auto itFormat = ppduFormats.find(event->GetPpdu()->GetPreamble()); if (itFormat != ppduFormats.end()) {