Fix a large number of cases where we copy construct a shared_ptr just to destroy it.

This commit is contained in:
JoelKatz
2012-08-15 04:01:22 -07:00
parent 11f7012d09
commit abf41dd4de
10 changed files with 41 additions and 46 deletions

View File

@@ -61,7 +61,7 @@ LedgerEntryAction LedgerEntrySet::hasEntry(const uint256& index) const
return it->second.mAction;
}
void LedgerEntrySet::entryCache(SLE::pointer& sle)
void LedgerEntrySet::entryCache(const SLE::pointer& sle)
{
boost::unordered_map<uint256, LedgerEntrySetEntry>::iterator it = mEntries.find(sle->getIndex());
if (it == mEntries.end())
@@ -82,7 +82,7 @@ void LedgerEntrySet::entryCache(SLE::pointer& sle)
}
}
void LedgerEntrySet::entryCreate(SLE::pointer& sle)
void LedgerEntrySet::entryCreate(const SLE::pointer& sle)
{
boost::unordered_map<uint256, LedgerEntrySetEntry>::iterator it = mEntries.find(sle->getIndex());
if (it == mEntries.end())
@@ -112,7 +112,7 @@ void LedgerEntrySet::entryCreate(SLE::pointer& sle)
}
}
void LedgerEntrySet::entryModify(SLE::pointer& sle)
void LedgerEntrySet::entryModify(const SLE::pointer& sle)
{
boost::unordered_map<uint256, LedgerEntrySetEntry>::iterator it = mEntries.find(sle->getIndex());
if (it == mEntries.end())
@@ -147,7 +147,7 @@ void LedgerEntrySet::entryModify(SLE::pointer& sle)
}
}
void LedgerEntrySet::entryDelete(SLE::pointer& sle, bool unfunded)
void LedgerEntrySet::entryDelete(const SLE::pointer& sle, bool unfunded)
{
boost::unordered_map<uint256, LedgerEntrySetEntry>::iterator it = mEntries.find(sle->getIndex());
if (it == mEntries.end())