mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Reduce memory allocation, remove some functions in Serializer.
This commit is contained in:
@@ -79,8 +79,18 @@ SHAMapTreeNode::SHAMapTreeNode (Blob const& rawNode,
|
||||
{
|
||||
if (format == snfWIRE)
|
||||
{
|
||||
Serializer s (rawNode);
|
||||
int type = s.removeLastByte ();
|
||||
if (rawNode.empty ())
|
||||
{
|
||||
#ifdef BEAST_DEBUG
|
||||
deprecatedLogs().journal("SHAMapTreeNode").fatal <<
|
||||
"Wire format node is empty";
|
||||
assert (false);
|
||||
#endif
|
||||
throw std::runtime_error ("invalid node AW type");
|
||||
}
|
||||
|
||||
Serializer s (rawNode.begin (), rawNode.end () - 1);
|
||||
int type = rawNode.back ();
|
||||
int len = s.getLength ();
|
||||
|
||||
if ((type < 0) || (type > 4))
|
||||
|
||||
Reference in New Issue
Block a user