Fix clang-tidy warnings (detected by clang-tidy-18)
This commit is contained in:
@@ -86,7 +86,7 @@ Ipv4ClickRouting::DoInitialize()
|
||||
m_nodeName = name.str();
|
||||
}
|
||||
|
||||
NS_ASSERT(m_clickFile.length() > 0);
|
||||
NS_ASSERT(!m_clickFile.empty());
|
||||
|
||||
// Even though simclick_click_create() will halt programme execution
|
||||
// if it is unable to initialise a Click router, we play safe
|
||||
|
||||
@@ -59,8 +59,7 @@ PcapHelperForIpv4::EnablePcapIpv4(std::string prefix, Ipv4InterfaceContainer c)
|
||||
{
|
||||
for (Ipv4InterfaceContainer::Iterator i = c.Begin(); i != c.End(); ++i)
|
||||
{
|
||||
std::pair<Ptr<Ipv4>, uint32_t> pair = *i;
|
||||
EnablePcapIpv4(prefix, pair.first, pair.second, false);
|
||||
EnablePcapIpv4(prefix, (*i).first, (*i).second, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,8 +199,7 @@ AsciiTraceHelperForIpv4::EnableAsciiIpv4Impl(Ptr<OutputStreamWrapper> stream,
|
||||
{
|
||||
for (Ipv4InterfaceContainer::Iterator i = c.Begin(); i != c.End(); ++i)
|
||||
{
|
||||
std::pair<Ptr<Ipv4>, uint32_t> pair = *i;
|
||||
EnableAsciiIpv4Internal(stream, prefix, pair.first, pair.second, false);
|
||||
EnableAsciiIpv4Internal(stream, prefix, (*i).first, (*i).second, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,8 +339,7 @@ PcapHelperForIpv6::EnablePcapIpv6(std::string prefix, Ipv6InterfaceContainer c)
|
||||
{
|
||||
for (Ipv6InterfaceContainer::Iterator i = c.Begin(); i != c.End(); ++i)
|
||||
{
|
||||
std::pair<Ptr<Ipv6>, uint32_t> pair = *i;
|
||||
EnablePcapIpv6(prefix, pair.first, pair.second, false);
|
||||
EnablePcapIpv6(prefix, (*i).first, (*i).second, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -482,8 +479,7 @@ AsciiTraceHelperForIpv6::EnableAsciiIpv6Impl(Ptr<OutputStreamWrapper> stream,
|
||||
{
|
||||
for (Ipv6InterfaceContainer::Iterator i = c.Begin(); i != c.End(); ++i)
|
||||
{
|
||||
std::pair<Ptr<Ipv6>, uint32_t> pair = *i;
|
||||
EnableAsciiIpv6Internal(stream, prefix, pair.first, pair.second, false);
|
||||
EnableAsciiIpv6Internal(stream, prefix, (*i).first, (*i).second, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ TcpHeader::FlagsToString(uint8_t flags, const std::string& delimiter)
|
||||
{
|
||||
if (flags & (1 << i))
|
||||
{
|
||||
if (flagsDescription.length() > 0)
|
||||
if (!flagsDescription.empty())
|
||||
{
|
||||
flagsDescription += delimiter;
|
||||
}
|
||||
|
||||
@@ -523,7 +523,7 @@ ParseNs2Line(const std::string& str)
|
||||
{
|
||||
std::string x;
|
||||
s >> x;
|
||||
if (x.length() == 0)
|
||||
if (x.empty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ PathSplit(std::string str)
|
||||
}
|
||||
str = str.substr(cutAt + 1);
|
||||
}
|
||||
if (str.length() > 0)
|
||||
if (!str.empty())
|
||||
{
|
||||
results.push_back(str);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user