"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "vendor/google.golang.org/protobuf/proto/size.go" between
k6-0.45.0.tar.gz and k6-0.45.1.tar.gz

About: k6 is a load and performance testing tool that provides a clean, approachable scripting API, local and cloud execution, and flexible configuration.

size.go  (k6-0.45.0):size.go  (k6-0.45.1)
skipping to change at line 76 skipping to change at line 76
case fd.IsList(): case fd.IsList():
return o.sizeList(num, fd, value.List()) return o.sizeList(num, fd, value.List())
case fd.IsMap(): case fd.IsMap():
return o.sizeMap(num, fd, value.Map()) return o.sizeMap(num, fd, value.Map())
default: default:
return protowire.SizeTag(num) + o.sizeSingular(num, fd.Kind(), va lue) return protowire.SizeTag(num) + o.sizeSingular(num, fd.Kind(), va lue)
} }
} }
func (o MarshalOptions) sizeList(num protowire.Number, fd protoreflect.FieldDesc riptor, list protoreflect.List) (size int) { func (o MarshalOptions) sizeList(num protowire.Number, fd protoreflect.FieldDesc riptor, list protoreflect.List) (size int) {
sizeTag := protowire.SizeTag(num)
if fd.IsPacked() && list.Len() > 0 { if fd.IsPacked() && list.Len() > 0 {
content := 0 content := 0
for i, llen := 0, list.Len(); i < llen; i++ { for i, llen := 0, list.Len(); i < llen; i++ {
content += o.sizeSingular(num, fd.Kind(), list.Get(i)) content += o.sizeSingular(num, fd.Kind(), list.Get(i))
} }
return protowire.SizeTag(num) + protowire.SizeBytes(content) return sizeTag + protowire.SizeBytes(content)
} }
for i, llen := 0, list.Len(); i < llen; i++ { for i, llen := 0, list.Len(); i < llen; i++ {
size += protowire.SizeTag(num) + o.sizeSingular(num, fd.Kind(), l ist.Get(i)) size += sizeTag + o.sizeSingular(num, fd.Kind(), list.Get(i))
} }
return size return size
} }
func (o MarshalOptions) sizeMap(num protowire.Number, fd protoreflect.FieldDescr iptor, mapv protoreflect.Map) (size int) { func (o MarshalOptions) sizeMap(num protowire.Number, fd protoreflect.FieldDescr iptor, mapv protoreflect.Map) (size int) {
sizeTag := protowire.SizeTag(num)
mapv.Range(func(key protoreflect.MapKey, value protoreflect.Value) bool { mapv.Range(func(key protoreflect.MapKey, value protoreflect.Value) bool {
size += protowire.SizeTag(num) size += sizeTag
size += protowire.SizeBytes(o.sizeField(fd.MapKey(), key.Value()) + o.sizeField(fd.MapValue(), value)) size += protowire.SizeBytes(o.sizeField(fd.MapKey(), key.Value()) + o.sizeField(fd.MapValue(), value))
return true return true
}) })
return size return size
} }
 End of changes. 5 change blocks. 
3 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)