Fetch pack micro-optimizations.

This commit is contained in:
JoelKatz
2013-07-03 00:42:29 -07:00
parent 4155a6a45e
commit 47598a4d8d
2 changed files with 4 additions and 4 deletions

View File

@@ -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)));

View File

@@ -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;
}
}