Added BoostSerializeTypeBool to levin portable storage
This commit is contained in:
parent
d8d87587c8
commit
f9cc428f9e
|
@ -269,13 +269,20 @@ func ReadAny(bytes []byte, ttype byte) (int, interface{}) {
|
|||
return idx, obj
|
||||
}
|
||||
|
||||
if ttype == BoostSerializeTypeBool {
|
||||
obj := bytes[idx] > 0
|
||||
n += 1
|
||||
idx += n
|
||||
|
||||
return idx, obj
|
||||
}
|
||||
|
||||
panic(fmt.Errorf("unknown ttype %x", ttype))
|
||||
return -1, nil
|
||||
}
|
||||
|
||||
// reads var int, returning number of bytes read and the integer in that byte
|
||||
// sequence.
|
||||
//
|
||||
func ReadVarInt(b []byte) (int, int) {
|
||||
sizeMask := b[0] & PortableRawSizeMarkMask
|
||||
|
||||
|
|
Reference in a new issue