Fetch pack micro-optimizations.

This commit is contained in:
JoelKatz
2013-07-03 00:42:29 -07:00
parent 89f6e7b4a5
commit 69d38d8844
2 changed files with 4 additions and 4 deletions

View File

@@ -2195,7 +2195,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)));

View File

@@ -520,7 +520,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;
@@ -543,7 +543,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
@@ -565,7 +565,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;
}
}