mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Cleanup nodestore backend classes:
* Add README.md * Add missing std::move calls * Refactor visitAll in backend
This commit is contained in:
committed by
Vinnie Falco
parent
6e428054ef
commit
98612a7cd6
@@ -131,7 +131,7 @@ bool InboundLedger::tryLocal ()
|
||||
"Ledger base found in fetch pack";
|
||||
mLedger = boost::make_shared<Ledger> (data, true);
|
||||
getApp().getNodeStore ().store (hotLEDGER,
|
||||
mLedger->getLedgerSeq (), data, mHash);
|
||||
mLedger->getLedgerSeq (), std::move (data), mHash);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -790,7 +790,7 @@ bool InboundLedger::takeBase (const std::string& data)
|
||||
s.add32 (HashPrefix::ledgerMaster);
|
||||
s.addRaw (data);
|
||||
getApp().getNodeStore ().store (hotLEDGER,
|
||||
mLedger->getLedgerSeq (), s.modData (), mHash);
|
||||
mLedger->getLedgerSeq (), std::move (s.modData ()), mHash);
|
||||
|
||||
progress ();
|
||||
|
||||
|
||||
@@ -589,7 +589,7 @@ bool Ledger::saveValidatedLedger (bool current)
|
||||
Serializer s (128);
|
||||
s.add32 (HashPrefix::ledgerMaster);
|
||||
addRaw (s);
|
||||
getApp().getNodeStore ().store (hotLEDGER, mLedgerSeq, s.modData (), mHash);
|
||||
getApp().getNodeStore ().store (hotLEDGER, mLedgerSeq, std::move (s.modData ()), mHash);
|
||||
}
|
||||
|
||||
AcceptedLedger::pointer aLedger;
|
||||
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
*pObject = NodeObject::createObject (
|
||||
getTypeFromString (pSt.peekString (0)),
|
||||
pSt.getUInt32 (1),
|
||||
data,
|
||||
std::move(data),
|
||||
hash);
|
||||
}
|
||||
else
|
||||
@@ -145,9 +145,9 @@ public:
|
||||
pStE.reset();
|
||||
}
|
||||
|
||||
void visitAll (NodeStore::VisitCallback& callback)
|
||||
void for_each (std::function <void(NodeObject::Ptr)> f)
|
||||
{
|
||||
// No lock needed as per the visitAll() API
|
||||
// No lock needed as per the for_each() API
|
||||
|
||||
uint256 hash;
|
||||
|
||||
@@ -164,10 +164,10 @@ public:
|
||||
NodeObject::Ptr const object (NodeObject::createObject (
|
||||
getTypeFromString (pSt.peekString (0)),
|
||||
pSt.getUInt32 (1),
|
||||
data,
|
||||
std::move(data),
|
||||
hash));
|
||||
|
||||
callback.visitObject (object);
|
||||
f (object);
|
||||
}
|
||||
|
||||
pSt.reset ();
|
||||
|
||||
@@ -1124,7 +1124,7 @@ int SHAMap::flushDirty (NodeMap& map, int maxNodes, NodeObjectType t, std::uint3
|
||||
|
||||
#endif
|
||||
|
||||
getApp().getNodeStore ().store (t, seq, s.modData (), it->second->getNodeHash ());
|
||||
getApp().getNodeStore ().store (t, seq, std::move (s.modData ()), it->second->getNodeHash ());
|
||||
|
||||
if (flushed++ >= maxNodes)
|
||||
return flushed;
|
||||
|
||||
@@ -90,7 +90,7 @@ void AccountStateSF::gotNode (bool fromFilter,
|
||||
Blob& nodeData,
|
||||
SHAMapTreeNode::TNType)
|
||||
{
|
||||
getApp().getNodeStore ().store (hotACCOUNT_NODE, mLedgerSeq, nodeData, nodeHash);
|
||||
getApp().getNodeStore ().store (hotACCOUNT_NODE, mLedgerSeq, std::move (nodeData), nodeHash);
|
||||
}
|
||||
|
||||
bool AccountStateSF::haveNode (SHAMapNode const& id,
|
||||
@@ -116,7 +116,7 @@ void TransactionStateSF::gotNode (bool fromFilter,
|
||||
getApp().getNodeStore ().store (
|
||||
(type == SHAMapTreeNode::tnTRANSACTION_NM) ? hotTRANSACTION : hotTRANSACTION_NODE,
|
||||
mLedgerSeq,
|
||||
nodeData,
|
||||
std::move (nodeData),
|
||||
nodeHash);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user