message-size-increase #3

Open
sashakoshka wants to merge 132 commits from message-size-increase into main
Showing only changes of commit c8a2f03ca1 - Show all commits

View File

@ -251,7 +251,7 @@ func setInt(destination reflect.Value, value uint64) error {
return nil return nil
} }
// setInt expects a settable destination. // setFloat expects a settable destination.
func setFloat(destination reflect.Value, value float64) error { func setFloat(destination reflect.Value, value float64) error {
if !destination.CanFloat() { if !destination.CanFloat() {
return fmt.Errorf("cannot assign float to %T", destination.Interface()) return fmt.Errorf("cannot assign float to %T", destination.Interface())
@ -345,11 +345,14 @@ func typeOf(decoder *Decoder, tag Tag) (reflect.Type, error) {
func peekSlice(decoder *Decoder, tag Tag) (Tag, int, error) { func peekSlice(decoder *Decoder, tag Tag) (Tag, int, error) {
offset := 0 offset := 0
dimension := 0 dimension := 0
currentTag := tag
for { for {
elem, populated, n, err := peekSliceOnce(decoder, tag, offset) elem, populated, n, err := peekSliceOnce(decoder, currentTag, offset)
if err != nil { return 0, 0, err } if err != nil { return 0, 0, err }
currentTag = elem
offset = n offset = n
dimension += 1 dimension += 1
fmt.Println(n)
if elem.Is(OTA) { if elem.Is(OTA) {
if !populated { if !populated {
// default to a large byte array, will be // default to a large byte array, will be