more const optimisations

This commit is contained in:
Gustavo J. A. M. Carneiro
2007-10-17 18:16:09 +01:00
parent eca4117497
commit 860df74295
3 changed files with 6 additions and 6 deletions

View File

@@ -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;

View File

@@ -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)

View File

@@ -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);