Use buffer in STBlob

This commit is contained in:
seelabs
2015-03-12 11:54:15 -07:00
committed by Tom Ritchford
parent 8ca9fa1c26
commit 803f5b5613
10 changed files with 102 additions and 77 deletions

View File

@@ -735,7 +735,9 @@ Account STObject::getFieldAccount160 (SField::ref field) const
Blob STObject::getFieldVL (SField::ref field) const
{
return getFieldByValue <STBlob> (field);
STBlob empty;
STBlob const& b = getFieldByConstRef <STBlob> (field, empty);
return Blob (b.data (), b.data () + b.size ());
}
STAmount const& STObject::getFieldAmount (SField::ref field) const
@@ -835,7 +837,8 @@ void STObject::setFieldAccount (SField::ref field, Account const& v)
void STObject::setFieldVL (SField::ref field, Blob const& v)
{
setFieldUsingSetValue <STBlob> (field, v);
setFieldUsingSetValue <STBlob>
(field, Buffer(v.data (), v.size ()));
}
void STObject::setFieldAmount (SField::ref field, STAmount const& v)