This commit is contained in:
JoelKatz
2013-04-09 20:08:19 -07:00
parent fd296b4411
commit 289e86483a

View File

@@ -284,6 +284,7 @@ STAccount* STAccount::construct(SerializerIterator& u, SField::ref name)
STVector256* STVector256::construct(SerializerIterator& u, SField::ref name)
{
std::vector<unsigned char> data = u.getVL();
std::vector<unsigned char>::iterator begin = data.begin();
UPTR_T<STVector256> vec(new STVector256(name));
@@ -293,10 +294,10 @@ STVector256* STVector256::construct(SerializerIterator& u, SField::ref name)
unsigned int uStart = 0;
for (unsigned int i = 0; i != count; i++)
{
unsigned int uEnd = uStart+(256/8);
unsigned int uEnd = uStart + (256 / 8);
// This next line could be optimized to construct a default uint256 in the vector and then copy into it
vec->mValue.push_back(uint256(std::vector<unsigned char>(data.begin()+uStart, data.begin()+uEnd)));
vec->mValue.push_back(uint256(std::vector<unsigned char>(begin + uStart, begin + uEnd)));
uStart = uEnd;
}