more const optimisations
This commit is contained in:
@@ -422,7 +422,7 @@ OlsrAgentImpl::MprComputation()
|
||||
{
|
||||
TwoHopNeighborTuple const &twoHopNeigh = *it;
|
||||
bool ok = true;
|
||||
NeighborTuple *nb_tuple = m_state.FindSymNeighborTuple (twoHopNeigh.neighborMainAddr);
|
||||
const NeighborTuple *nb_tuple = m_state.FindSymNeighborTuple (twoHopNeigh.neighborMainAddr);
|
||||
if (nb_tuple == NULL)
|
||||
{
|
||||
ok = false;
|
||||
@@ -711,7 +711,7 @@ OlsrAgentImpl::RoutingTableComputation ()
|
||||
{
|
||||
TwoHopNeighborTuple const &nb2hop_tuple = *it;
|
||||
bool ok = true;
|
||||
NeighborTuple *nb_tuple = m_state.FindSymNeighborTuple
|
||||
const NeighborTuple *nb_tuple = m_state.FindSymNeighborTuple
|
||||
(nb2hop_tuple.neighborMainAddr);
|
||||
if (nb_tuple == NULL)
|
||||
ok = false;
|
||||
|
||||
@@ -94,10 +94,10 @@ OlsrState::FindNeighborTuple (Ipv4Address const &mainAddr)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
NeighborTuple*
|
||||
OlsrState::FindSymNeighborTuple (Ipv4Address const &mainAddr)
|
||||
const NeighborTuple*
|
||||
OlsrState::FindSymNeighborTuple (Ipv4Address const &mainAddr) const
|
||||
{
|
||||
for (NeighborSet::iterator it = m_neighborSet.begin ();
|
||||
for (NeighborSet::const_iterator it = m_neighborSet.begin ();
|
||||
it != m_neighborSet.end (); it++)
|
||||
{
|
||||
if (it->neighborMainAddr == mainAddr && it->status == NeighborTuple::STATUS_SYM)
|
||||
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
return m_neighborSet;
|
||||
}
|
||||
NeighborTuple* FindNeighborTuple (const Ipv4Address &mainAddr);
|
||||
NeighborTuple* FindSymNeighborTuple (const Ipv4Address &mainAddr);
|
||||
const NeighborTuple* FindSymNeighborTuple (const Ipv4Address &mainAddr) const;
|
||||
NeighborTuple* FindNeighborTuple (const Ipv4Address &mainAddr,
|
||||
uint8_t willingness);
|
||||
void EraseNeighborTuple (const NeighborTuple &neighborTuple);
|
||||
|
||||
Reference in New Issue
Block a user