mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Fetch pack micro-optimizations.
This commit is contained in:
@@ -2208,7 +2208,7 @@ void NetworkOPs::makeFetchPack (Job&, boost::weak_ptr<Peer> wPeer,
|
||||
if (reply.objects ().size () >= 256)
|
||||
break;
|
||||
|
||||
haveLedger = wantLedger;
|
||||
haveLedger = MOVE_P(wantLedger);
|
||||
wantLedger = getLedgerByHash (haveLedger->getParentHash ());
|
||||
}
|
||||
while (wantLedger && (UptimeTimer::getInstance ().getElapsedSeconds () <= (uUptime + 1)));
|
||||
|
||||
@@ -512,7 +512,7 @@ void SHAMap::getFetchPack (SHAMap* have, bool includeLeaves, int max,
|
||||
{
|
||||
Serializer s;
|
||||
root->addRaw (s, snfPREFIX);
|
||||
func (root->getNodeHash (), s.peekData ());
|
||||
func (boost::cref(root->getNodeHash ()), boost::cref(s.peekData ()));
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -535,7 +535,7 @@ void SHAMap::getFetchPack (SHAMap* have, bool includeLeaves, int max,
|
||||
// 1) Add this node to the pack
|
||||
Serializer s;
|
||||
node->addRaw (s, snfPREFIX);
|
||||
func (node->getNodeHash (), s.peekData ());
|
||||
func (boost::cref(node->getNodeHash ()), boost::cref(s.peekData ()));
|
||||
--max;
|
||||
|
||||
// 2) push non-matching child inner nodes
|
||||
@@ -557,7 +557,7 @@ void SHAMap::getFetchPack (SHAMap* have, bool includeLeaves, int max,
|
||||
{
|
||||
Serializer s;
|
||||
node->addRaw (s, snfPREFIX);
|
||||
func (node->getNodeHash (), s.peekData ());
|
||||
func (boost::cref(node->getNodeHash ()), boost::cref(s.peekData ()));
|
||||
--max;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user