internet: simplify Ipv6L3Protocol::GetInterface

This commit is contained in:
Alexander Krotov
2016-12-26 10:41:23 +03:00
parent 05d6ac4a56
commit 69fea27502

View File

@@ -225,15 +225,10 @@ uint32_t Ipv6L3Protocol::AddIpv6Interface (Ptr<Ipv6Interface> interface)
Ptr<Ipv6Interface> Ipv6L3Protocol::GetInterface (uint32_t index) const
{
NS_LOG_FUNCTION (this << index);
uint32_t tmp = 0;
for (Ipv6InterfaceList::const_iterator it = m_interfaces.begin (); it != m_interfaces.end (); it++)
if (index < m_interfaces.size ())
{
if (index == tmp)
{
return *it;
}
tmp++;
return m_interfaces[index];
}
return 0;
}