stackitem: use Bool item directly

It is always copied.

Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgeniy Stratonikov 2021-08-03 19:37:06 +03:00
parent 5aff82aef4
commit cff8b1c24e
6 changed files with 40 additions and 44 deletions

View file

@ -103,9 +103,9 @@ func (w *serContext) serialize(item Item) error {
data := t.Value().([]byte)
w.appendVarUint(uint64(len(data)))
w.data = append(w.data, data...)
case *Bool:
case Bool:
w.data = append(w.data, byte(BooleanT))
if t.Value().(bool) {
if t {
w.data = append(w.data, 1)
} else {
w.data = append(w.data, 0)