From 3a356aafefabca0a76f0b828d6b2ff5d4c31c96b Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 24 Jun 2020 11:34:07 +0300 Subject: [PATCH] io: make maxArraySize public --- pkg/io/binaryReader.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/io/binaryReader.go b/pkg/io/binaryReader.go index bd62b53ee..b8c935c80 100644 --- a/pkg/io/binaryReader.go +++ b/pkg/io/binaryReader.go @@ -8,9 +8,9 @@ import ( "reflect" ) -// maxArraySize is a maximums size of an array which can be decoded. +// MaxArraySize is the maximum size of an array which can be decoded. // It is taken from https://github.com/neo-project/neo/blob/master/neo/IO/Helper.cs#L130 -const maxArraySize = 0x1000000 +const MaxArraySize = 0x1000000 // BinReader is a convenient wrapper around a io.Reader and err object. // Used to simplify error handling when reading into a struct with many fields. @@ -110,7 +110,7 @@ func (r *BinReader) ReadArray(t interface{}, maxSize ...int) { elemType := sliceType.Elem() isPtr := elemType.Kind() == reflect.Ptr - ms := maxArraySize + ms := MaxArraySize if len(maxSize) != 0 { ms = maxSize[0] } @@ -170,7 +170,7 @@ func (r *BinReader) ReadVarUint() uint64 { // ReadVarUInt() is used to determine how large that slice is func (r *BinReader) ReadVarBytes(maxSize ...int) []byte { n := r.ReadVarUint() - ms := maxArraySize + ms := MaxArraySize if len(maxSize) != 0 { ms = maxSize[0] }