core/state: optimize some internals during encoding

This commit is contained in:
Martin Holst Swende
2019-09-05 13:19:55 +02:00
parent 67bfc93053
commit 72045dff4f
3 changed files with 82 additions and 1 deletions

View File

@ -274,7 +274,7 @@ func (s *stateObject) updateTrie(db Database) Trie {
continue
}
// Encoding []byte cannot fail, ok to ignore the error.
v, _ := rlp.EncodeToBytes(bytes.TrimLeft(value[:], "\x00"))
v, _ := rlp.EncodeToBytes(common.TrimLeftZeroes(value[:]))
s.setError(tr.TryUpdate(key[:], v))
}
return tr