reading mask without preceding nil value
This commit is contained in:
parent
800c5d04d0
commit
de9695a724
|
@ -530,25 +530,15 @@ func (rd *msgpackReader) Skip() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rd *msgpackReader) TryReadMask() (bool, FieldsMask, error) {
|
func (rd *msgpackReader) TryReadMask() (bool, FieldsMask, error) {
|
||||||
code, err := rd.dec.PeekCode()
|
maskLen, err := rd.dec.DecodeArrayLen()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, FieldsMask{}, errors.WithStack(err)
|
if err == io.EOF {
|
||||||
}
|
|
||||||
|
|
||||||
if code != msgpcode.Nil {
|
|
||||||
return false, FieldsMask{}, nil
|
return false, FieldsMask{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := rd.dec.Skip(); err != nil {
|
|
||||||
return false, FieldsMask{}, errors.WithStack(err)
|
return false, FieldsMask{}, errors.WithStack(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var mask FieldsMask
|
var mask FieldsMask
|
||||||
maskLen, err := rd.dec.DecodeArrayLen()
|
|
||||||
if err != nil {
|
|
||||||
return false, FieldsMask{}, errors.WithStack(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
for i := 0; i < maskLen; i++ {
|
for i := 0; i < maskLen; i++ {
|
||||||
maskPart, err := rd.dec.DecodeUint64()
|
maskPart, err := rd.dec.DecodeUint64()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue