internet: simplify Ipv6L3Protocol::GetInterface
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user