Refactor uses of strCopy (RIPD-1256)

Replace the sparsely used strCopy function with Slice. Change some of
the SHAMap interface to use Slice instead of Blob, which should
eliminate a copy.
This commit is contained in:
Mike Ellery
2016-08-05 10:46:41 -07:00
committed by Nik Bougalis
parent c1b8efb7af
commit 0d803e0fa2
13 changed files with 47 additions and 92 deletions

View File

@@ -215,14 +215,14 @@ SHAMapAddNode TransactionAcquire::takeNodes (const std::list<SHAMapNodeID>& node
if (mHaveRoot)
JLOG (j_.debug()) << "Got root TXS node, already have it";
else if (!mMap->addRootNode (SHAMapHash{getHash ()},
*nodeDatait, snfWIRE, nullptr).isGood())
makeSlice(*nodeDatait), snfWIRE, nullptr).isGood())
{
JLOG (j_.warn()) << "TX acquire got bad root node";
}
else
mHaveRoot = true;
}
else if (!mMap->addKnownNode (*nodeIDit, *nodeDatait, &sf).isGood())
else if (!mMap->addKnownNode (*nodeIDit, makeSlice(*nodeDatait), &sf).isGood())
{
JLOG (j_.warn()) << "TX acquire got bad non-root node";
return SHAMapAddNode::invalid ();