mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-07 15:07:36 +00:00
stackitem: use Bool
item directly
It is always copied. Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
5aff82aef4
commit
cff8b1c24e
6 changed files with 40 additions and 44 deletions
|
@ -120,8 +120,8 @@ func toJSON(data []byte, seen map[Item]sliceNoPointer, item Item) ([]byte, error
|
|||
return nil, err
|
||||
}
|
||||
data = append(data, raw...)
|
||||
case *Bool:
|
||||
if it.value {
|
||||
case Bool:
|
||||
if it {
|
||||
data = append(data, "true"...)
|
||||
} else {
|
||||
data = append(data, "false"...)
|
||||
|
@ -288,8 +288,8 @@ func toJSONWithTypes(item Item, seen map[Item]bool) (interface{}, error) {
|
|||
}
|
||||
value = arr
|
||||
delete(seen, item)
|
||||
case *Bool:
|
||||
value = it.value
|
||||
case Bool:
|
||||
value = bool(it)
|
||||
case *Buffer, *ByteArray:
|
||||
value = base64.StdEncoding.EncodeToString(it.Value().([]byte))
|
||||
case *BigInteger:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue