diff --git a/src/core/model/time.cc b/src/core/model/time.cc index 32a0f9446..f89a95621 100644 --- a/src/core/model/time.cc +++ b/src/core/model/time.cc @@ -137,43 +137,43 @@ Time::Time(const std::string& s) double r; iss >> r; std::string trailer = s.substr(n, std::string::npos); - if (trailer == std::string("s")) + if (trailer == "s") { *this = Time::FromDouble(r, Time::S); } - else if (trailer == std::string("ms")) + else if (trailer == "ms") { *this = Time::FromDouble(r, Time::MS); } - else if (trailer == std::string("us")) + else if (trailer == "us") { *this = Time::FromDouble(r, Time::US); } - else if (trailer == std::string("ns")) + else if (trailer == "ns") { *this = Time::FromDouble(r, Time::NS); } - else if (trailer == std::string("ps")) + else if (trailer == "ps") { *this = Time::FromDouble(r, Time::PS); } - else if (trailer == std::string("fs")) + else if (trailer == "fs") { *this = Time::FromDouble(r, Time::FS); } - else if (trailer == std::string("min")) + else if (trailer == "min") { *this = Time::FromDouble(r, Time::MIN); } - else if (trailer == std::string("h")) + else if (trailer == "h") { *this = Time::FromDouble(r, Time::H); } - else if (trailer == std::string("d")) + else if (trailer == "d") { *this = Time::FromDouble(r, Time::D); } - else if (trailer == std::string("y")) + else if (trailer == "y") { *this = Time::FromDouble(r, Time::Y); } diff --git a/src/dsr/model/dsr-rcache.cc b/src/dsr/model/dsr-rcache.cc index 6f326156d..8e5487f44 100644 --- a/src/dsr/model/dsr-rcache.cc +++ b/src/dsr/model/dsr-rcache.cc @@ -308,11 +308,11 @@ void DsrRouteCache::SetCacheType(std::string type) { NS_LOG_FUNCTION(this << type); - if (type == std::string("LinkCache")) + if (type == "LinkCache") { m_isLinkCache = true; } - else if (type == std::string("PathCache")) + else if (type == "PathCache") { m_isLinkCache = false; } diff --git a/src/netanim/model/animation-interface.cc b/src/netanim/model/animation-interface.cc index f207812d2..08a601520 100644 --- a/src/netanim/model/animation-interface.cc +++ b/src/netanim/model/animation-interface.cc @@ -2007,7 +2007,7 @@ AnimationInterface::WriteLinkProperties() } NS_LOG_DEBUG("Got ChannelType" << channelType); - if (!ch || (channelType != std::string("ns3::PointToPointChannel"))) + if (!ch || (channelType != "ns3::PointToPointChannel")) { NS_LOG_DEBUG("No channel can't be a p2p device"); /* @@ -2042,7 +2042,7 @@ AnimationInterface::WriteLinkProperties() continue; } - else if (channelType == std::string("ns3::PointToPointChannel")) + else if (channelType == "ns3::PointToPointChannel") { // Since these are duplex links, we only need to dump // if srcid < dstid std::size_t nChDev = ch->GetNDevices();