Fix clang-tidy bugprone-branch-clone warnings
This commit is contained in:
@@ -413,30 +413,10 @@ main(int argc, char* argv[])
|
||||
apDevice = wifi.Install(spectrumPhy, mac, wifiApNode);
|
||||
}
|
||||
|
||||
if (i <= 7)
|
||||
{
|
||||
Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
|
||||
"ShortGuardIntervalSupported",
|
||||
BooleanValue(false));
|
||||
}
|
||||
else if (i > 7 && i <= 15)
|
||||
{
|
||||
Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
|
||||
"ShortGuardIntervalSupported",
|
||||
BooleanValue(true));
|
||||
}
|
||||
else if (i > 15 && i <= 23)
|
||||
{
|
||||
Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
|
||||
"ShortGuardIntervalSupported",
|
||||
BooleanValue(false));
|
||||
}
|
||||
else
|
||||
{
|
||||
Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
|
||||
"ShortGuardIntervalSupported",
|
||||
BooleanValue(true));
|
||||
}
|
||||
bool shortGuardIntervalSupported = (i > 7 && i <= 15) || (i > 23);
|
||||
Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
|
||||
"ShortGuardIntervalSupported",
|
||||
BooleanValue(shortGuardIntervalSupported));
|
||||
|
||||
// mobility.
|
||||
MobilityHelper mobility;
|
||||
|
||||
@@ -468,30 +468,10 @@ main(int argc, char* argv[])
|
||||
apDevice = wifi.Install(spectrumPhy, mac, wifiApNode);
|
||||
}
|
||||
|
||||
if (i <= 7)
|
||||
{
|
||||
Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
|
||||
"ShortGuardIntervalSupported",
|
||||
BooleanValue(false));
|
||||
}
|
||||
else if (i > 7 && i <= 15)
|
||||
{
|
||||
Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
|
||||
"ShortGuardIntervalSupported",
|
||||
BooleanValue(true));
|
||||
}
|
||||
else if (i > 15 && i <= 23)
|
||||
{
|
||||
Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
|
||||
"ShortGuardIntervalSupported",
|
||||
BooleanValue(false));
|
||||
}
|
||||
else
|
||||
{
|
||||
Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
|
||||
"ShortGuardIntervalSupported",
|
||||
BooleanValue(true));
|
||||
}
|
||||
bool shortGuardIntervalSupported = (i > 7 && i <= 15) || (i > 23);
|
||||
Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
|
||||
"ShortGuardIntervalSupported",
|
||||
BooleanValue(shortGuardIntervalSupported));
|
||||
|
||||
// mobility.
|
||||
MobilityHelper mobility;
|
||||
|
||||
@@ -152,25 +152,7 @@ main(int argc, char* argv[])
|
||||
phy.Set("TxPowerStart", DoubleValue(1));
|
||||
phy.Set("TxPowerEnd", DoubleValue(1));
|
||||
|
||||
if (i > 31 && i <= 39)
|
||||
{
|
||||
phy.Set("Antennas", UintegerValue(2));
|
||||
phy.Set("MaxSupportedTxSpatialStreams", UintegerValue(2));
|
||||
phy.Set("MaxSupportedRxSpatialStreams", UintegerValue(2));
|
||||
}
|
||||
else if (i > 39 && i <= 47)
|
||||
{
|
||||
phy.Set("Antennas", UintegerValue(2));
|
||||
phy.Set("MaxSupportedTxSpatialStreams", UintegerValue(2));
|
||||
phy.Set("MaxSupportedRxSpatialStreams", UintegerValue(2));
|
||||
}
|
||||
else if (i > 47 && i <= 55)
|
||||
{
|
||||
phy.Set("Antennas", UintegerValue(2));
|
||||
phy.Set("MaxSupportedTxSpatialStreams", UintegerValue(2));
|
||||
phy.Set("MaxSupportedRxSpatialStreams", UintegerValue(2));
|
||||
}
|
||||
else if (i > 55 && i <= 63)
|
||||
if (i > 31 && i <= 63)
|
||||
{
|
||||
phy.Set("Antennas", UintegerValue(2));
|
||||
phy.Set("MaxSupportedTxSpatialStreams", UintegerValue(2));
|
||||
@@ -193,25 +175,7 @@ main(int argc, char* argv[])
|
||||
spectrumPhy.Set("TxPowerStart", DoubleValue(1));
|
||||
spectrumPhy.Set("TxPowerEnd", DoubleValue(1));
|
||||
|
||||
if (i > 31 && i <= 39)
|
||||
{
|
||||
spectrumPhy.Set("Antennas", UintegerValue(2));
|
||||
spectrumPhy.Set("MaxSupportedTxSpatialStreams", UintegerValue(2));
|
||||
spectrumPhy.Set("MaxSupportedRxSpatialStreams", UintegerValue(2));
|
||||
}
|
||||
else if (i > 39 && i <= 47)
|
||||
{
|
||||
spectrumPhy.Set("Antennas", UintegerValue(2));
|
||||
spectrumPhy.Set("MaxSupportedTxSpatialStreams", UintegerValue(2));
|
||||
spectrumPhy.Set("MaxSupportedRxSpatialStreams", UintegerValue(2));
|
||||
}
|
||||
else if (i > 47 && i <= 55)
|
||||
{
|
||||
spectrumPhy.Set("Antennas", UintegerValue(2));
|
||||
spectrumPhy.Set("MaxSupportedTxSpatialStreams", UintegerValue(2));
|
||||
spectrumPhy.Set("MaxSupportedRxSpatialStreams", UintegerValue(2));
|
||||
}
|
||||
else if (i > 55 && i <= 63)
|
||||
if (i > 31 && i <= 63)
|
||||
{
|
||||
spectrumPhy.Set("Antennas", UintegerValue(2));
|
||||
spectrumPhy.Set("MaxSupportedTxSpatialStreams", UintegerValue(2));
|
||||
@@ -588,30 +552,11 @@ main(int argc, char* argv[])
|
||||
apDevice = wifi.Install(spectrumPhy, mac, wifiApNode);
|
||||
}
|
||||
|
||||
if ((i <= 7) || (i > 31 && i <= 39))
|
||||
{
|
||||
Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
|
||||
"ShortGuardIntervalSupported",
|
||||
BooleanValue(false));
|
||||
}
|
||||
else if ((i > 7 && i <= 15) || (i > 39 && i <= 47))
|
||||
{
|
||||
Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
|
||||
"ShortGuardIntervalSupported",
|
||||
BooleanValue(true));
|
||||
}
|
||||
else if ((i > 15 && i <= 23) || (i > 47 && i <= 55))
|
||||
{
|
||||
Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
|
||||
"ShortGuardIntervalSupported",
|
||||
BooleanValue(false));
|
||||
}
|
||||
else
|
||||
{
|
||||
Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
|
||||
"ShortGuardIntervalSupported",
|
||||
BooleanValue(true));
|
||||
}
|
||||
bool shortGuardIntervalSupported =
|
||||
(i > 7 && i <= 15) || (i > 23 && i <= 31) || (i > 39 && i <= 47) || (i > 55);
|
||||
Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/"
|
||||
"ShortGuardIntervalSupported",
|
||||
BooleanValue(shortGuardIntervalSupported));
|
||||
|
||||
// mobility.
|
||||
MobilityHelper mobility;
|
||||
|
||||
Reference in New Issue
Block a user