Fix move sequencing

This commit is contained in:
Nik Bougalis
2015-06-03 14:30:23 -07:00
committed by Vinnie Falco
parent 7b5bf7f129
commit eb0ece417d
3 changed files with 9 additions and 8 deletions

View File

@@ -45,9 +45,10 @@ convertBlobsToTxResult (
tr->setStatus (Transaction::sqlTransactionStatus(status));
tr->setLedger (ledger_index);
to.emplace_back(std::make_pair(std::move(tr),
std::make_shared<TransactionMetaSet> (
tr->getID (), tr->getLedger (), rawMeta)));
auto metaset = std::make_shared<TransactionMetaSet> (
tr->getID (), tr->getLedger (), rawMeta);
to.emplace_back(std::move(tr), metaset);
};
void

View File

@@ -287,13 +287,13 @@ public:
uint256 const& hash,
Backend& backend)
{
std::shared_ptr<NodeObject> object = NodeObject::createObject(
type, std::move(data), hash);
#if RIPPLE_VERIFY_NODEOBJECT_KEYS
assert (hash == sha512Hash(make_Slice(data)));
#endif
std::shared_ptr<NodeObject> object = NodeObject::createObject(
type, std::move(data), hash);
m_cache.canonicalize (hash, object, true);
backend.store (object);

View File

@@ -713,8 +713,8 @@ OverlayImpl::selectPeers (PeerSet& set, std::size_t limit,
v.reserve(m_publicKeyMap.size());
for_each_unlocked ([&](std::shared_ptr<PeerImp> && e)
{
v.emplace_back(
e->getScore(score(e)), std::move(e));
auto const s = e->getScore(score(e));
v.emplace_back(s, std::move(e));
});
}
std::sort(v.begin(), v.end(),