more const optimisations

--HG--
extra : transplant_source : %1Ere%14c%26%07%B1%AD%29%FA/eb%E9%1A%D6%93%B3J
This commit is contained in:
Gustavo J. A. M. Carneiro committed 2007-10-17 18:16:09 +01:00
1 parent 309508979d
commit cd535c2ea4
3 files changed
+6 -6

No files matched your search

+2 -2
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;
+3 -3
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)
+1 -1
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);