Added BoostSerializeTypeBool to levin portable storage

This commit is contained in:
DataHoarder 2023-03-20 21:26:21 +01:00
parent d8d87587c8
commit f9cc428f9e
Signed by: DataHoarder
SSH key fingerprint: SHA256:EnPQOqPpbCa7nzalCEJY2sd9iPluFIBuJu2rDFalACI

View file

@ -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