copy ellimination for ranges #part1

This commit is contained in:
brain5lug 2016-08-05 21:23:54 +03:00
parent 788d1650a2
commit b8ec63cf8c
17 changed files with 67 additions and 66 deletions

View file

@ -64,10 +64,10 @@ namespace data
return;
}
// reset existing leases
// reset existing leases
if (m_StoreLeases)
for (auto it: m_Leases)
it->isUpdated = false;
for (auto& it: m_Leases)
it->isUpdated = false;
else
m_Leases.clear ();
@ -123,7 +123,7 @@ namespace data
m_Leases.erase (it++);
}
else
it++;
++it;
}
}
@ -167,7 +167,7 @@ namespace data
{
auto ts = i2p::util::GetMillisecondsSinceEpoch ();
std::vector<std::shared_ptr<const Lease> > leases;
for (auto it: m_Leases)
for (const auto& it: m_Leases)
{
auto endDate = it->endDate;
if (withThreshold)
@ -183,7 +183,7 @@ namespace data
bool LeaseSet::HasExpiredLeases () const
{
auto ts = i2p::util::GetMillisecondsSinceEpoch ();
for (auto it: m_Leases)
for (const auto& it: m_Leases)
if (ts >= it->endDate) return true;
return false;
}