tape: Fix table decoding restarting after each pull
This commit is contained in:
parent
37c3e49833
commit
dd5325b351
@ -9,7 +9,8 @@ type TablePushFunc func(tag uint16, value []byte) (n int, err error)
|
||||
type TablePullFunc func() (tag uint16, value []byte, n int, err error)
|
||||
|
||||
func DecodeTable(data []byte) TablePullFunc {
|
||||
return func() (tag uint16, value []byte, n int, err error) {
|
||||
n := 0
|
||||
return func() (tag uint16, value []byte, n_ int, err error) {
|
||||
tag, nn, err := DecodeI16[uint16](data[n:])
|
||||
if err != nil { return tag, value, n, err }
|
||||
n += nn
|
||||
|
Loading…
Reference in New Issue
Block a user