Revert "Reduce SHAMapTreeNode copying during SHAMap unsharing:"

This reverts commit 47c6ab0ced.
This commit is contained in:
Mark Travis
2015-05-30 13:55:20 -07:00
committed by Vinnie Falco
parent aaf209485c
commit 52879d964e
4 changed files with 3 additions and 6 deletions

View File

@@ -413,7 +413,6 @@ public:
}
if (didApply)
{
ledger->setImmutable (); // So the next line doesn't have to copy
mCurrentLedger.set (ledger);
getApp().getOPs ().pubProposedTransaction (ledger, txn, result);
}

View File

@@ -1068,7 +1068,6 @@ void ApplicationImp::startNewLedger ()
firstLedger->updateHash ();
firstLedger->setClosed ();
firstLedger->setAccepted ();
firstLedger->setImmutable();
m_ledgerMaster->pushLedger (firstLedger);
Ledger::pointer secondLedger = std::make_shared<Ledger> (true, std::ref (*firstLedger));

View File

@@ -278,7 +278,6 @@ void
SHAMap::setImmutable ()
{
assert (state_ != SHAMapState::Invalid);
unshare ();
state_ = SHAMapState::Immutable;
}

View File

@@ -75,7 +75,7 @@ SHAMap::snapShot (bool isMutable) const
newMap.seq_ = seq_ + 1;
newMap.root_ = root_;
if ((state_ != SHAMapState::Immutable) || isMutable)
if ((state_ != SHAMapState::Immutable) || !isMutable)
{
// If either map may change, they cannot share nodes
newMap.unshare ();