From cae3ee4fa9199fdf1729c73ddf847a7c6cf27cc0 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Thu, 15 Oct 2015 17:52:18 -0400 Subject: [PATCH] Update godeps, especially to get in hashicorp/consul#1310 --- Godeps/Godeps.json | 62 +- .../aws-sdk-go/aws/service/default_retryer.go | 4 +- .../github.com/aws/aws-sdk-go/aws/version.go | 2 +- .../internal/protocol/rest/build.go | 101 +- .../aws/aws-sdk-go/service/s3/api.go | 14 + .../coreos/go-etcd/etcd/response.generated.go | 188 +- .../coreos/go-etcd/etcd/response.go | 2 +- .../src/github.com/fatih/structs/.travis.yml | 9 +- .../google/go-github/github/orgs_members.go | 2 +- .../github.com/hashicorp/consul/api/api.go | 2 +- .../ugorji/go/codec/codecgen/gen.go | 12 - .../src/github.com/ugorji/go/codec/decode.go | 145 +- .../src/github.com/ugorji/go/codec/encode.go | 239 +- .../ugorji/go/codec/fast-path.generated.go | 10759 +++++++++++++--- .../ugorji/go/codec/fast-path.go.tmpl | 78 +- .../ugorji/go/codec/gen-dec-map.go.tmpl | 33 +- .../ugorji/go/codec/gen.generated.go | 33 +- .../src/github.com/ugorji/go/codec/gen.go | 49 +- .../src/github.com/ugorji/go/codec/helper.go | 112 + .../src/github.com/ugorji/go/codec/json.go | 98 +- .../github.com/ugorji/go/codec/prebuild.sh | 39 +- .../src/github.com/ugorji/go/codec/tests.sh | 2 +- .../clientcredentials/clientcredentials.go | 2 +- 23 files changed, 9733 insertions(+), 2254 deletions(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 912dd92fc1..5041d04734 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -15,63 +15,63 @@ }, { "ImportPath": "github.com/aws/aws-sdk-go/aws", - "Comment": "v0.9.14-1-g7d9ac5f", - "Rev": "7d9ac5f2079172b9725513796718eaad96218f3b" + "Comment": "v0.9.15", + "Rev": "7ab6754ddaaa7972ac1c896ddd7f796cc726e79d" }, { "ImportPath": "github.com/aws/aws-sdk-go/internal/endpoints", - "Comment": "v0.9.14-1-g7d9ac5f", - "Rev": "7d9ac5f2079172b9725513796718eaad96218f3b" + "Comment": "v0.9.15", + "Rev": "7ab6754ddaaa7972ac1c896ddd7f796cc726e79d" }, { "ImportPath": "github.com/aws/aws-sdk-go/internal/protocol/ec2query", - "Comment": "v0.9.14-1-g7d9ac5f", - "Rev": "7d9ac5f2079172b9725513796718eaad96218f3b" + "Comment": "v0.9.15", + "Rev": "7ab6754ddaaa7972ac1c896ddd7f796cc726e79d" }, { "ImportPath": "github.com/aws/aws-sdk-go/internal/protocol/query", - "Comment": "v0.9.14-1-g7d9ac5f", - "Rev": "7d9ac5f2079172b9725513796718eaad96218f3b" + "Comment": "v0.9.15", + "Rev": "7ab6754ddaaa7972ac1c896ddd7f796cc726e79d" }, { "ImportPath": "github.com/aws/aws-sdk-go/internal/protocol/rest", - "Comment": "v0.9.14-1-g7d9ac5f", - "Rev": "7d9ac5f2079172b9725513796718eaad96218f3b" + "Comment": "v0.9.15", + "Rev": "7ab6754ddaaa7972ac1c896ddd7f796cc726e79d" }, { "ImportPath": "github.com/aws/aws-sdk-go/internal/protocol/restxml", - "Comment": "v0.9.14-1-g7d9ac5f", - "Rev": "7d9ac5f2079172b9725513796718eaad96218f3b" + "Comment": "v0.9.15", + "Rev": "7ab6754ddaaa7972ac1c896ddd7f796cc726e79d" }, { "ImportPath": "github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil", - "Comment": "v0.9.14-1-g7d9ac5f", - "Rev": "7d9ac5f2079172b9725513796718eaad96218f3b" + "Comment": "v0.9.15", + "Rev": "7ab6754ddaaa7972ac1c896ddd7f796cc726e79d" }, { "ImportPath": "github.com/aws/aws-sdk-go/internal/signer/v4", - "Comment": "v0.9.14-1-g7d9ac5f", - "Rev": "7d9ac5f2079172b9725513796718eaad96218f3b" + "Comment": "v0.9.15", + "Rev": "7ab6754ddaaa7972ac1c896ddd7f796cc726e79d" }, { "ImportPath": "github.com/aws/aws-sdk-go/service/ec2", - "Comment": "v0.9.14-1-g7d9ac5f", - "Rev": "7d9ac5f2079172b9725513796718eaad96218f3b" + "Comment": "v0.9.15", + "Rev": "7ab6754ddaaa7972ac1c896ddd7f796cc726e79d" }, { "ImportPath": "github.com/aws/aws-sdk-go/service/iam", - "Comment": "v0.9.14-1-g7d9ac5f", - "Rev": "7d9ac5f2079172b9725513796718eaad96218f3b" + "Comment": "v0.9.15", + "Rev": "7ab6754ddaaa7972ac1c896ddd7f796cc726e79d" }, { "ImportPath": "github.com/aws/aws-sdk-go/service/s3", - "Comment": "v0.9.14-1-g7d9ac5f", - "Rev": "7d9ac5f2079172b9725513796718eaad96218f3b" + "Comment": "v0.9.15", + "Rev": "7ab6754ddaaa7972ac1c896ddd7f796cc726e79d" }, { "ImportPath": "github.com/coreos/go-etcd/etcd", - "Comment": "v2.0.0-34-gde3514f", - "Rev": "de3514f25635bbfb024fdaf2a8d5f67378492675" + "Comment": "v2.0.0-36-g2038b59", + "Rev": "2038b5942e8e7f4f244729ff9353afab8ba11afc" }, { "ImportPath": "github.com/duosecurity/duo_api_golang", @@ -79,7 +79,7 @@ }, { "ImportPath": "github.com/fatih/structs", - "Rev": "a9f7daa9c2729e97450c2da2feda19130a367d8f" + "Rev": "c701457aaa1ff6709d5e35fccb5c129448e0a37b" }, { "ImportPath": "github.com/go-ldap/ldap", @@ -102,7 +102,7 @@ }, { "ImportPath": "github.com/google/go-github/github", - "Rev": "2570a87f54b43ed0957cabd7a0819f0dab85217b" + "Rev": "9420d0f48acb838ccf8a7f8dde9eaee19af71132" }, { "ImportPath": "github.com/google/go-querystring/query", @@ -110,8 +110,8 @@ }, { "ImportPath": "github.com/hashicorp/consul/api", - "Comment": "v0.5.2-323-ge34c321", - "Rev": "e34c321fce1bbf0502c74d55448c8e41a7bcb5a3" + "Comment": "v0.5.2-334-gd6af59c", + "Rev": "d6af59cdedcc01e71bccf90061decbb724425fe5" }, { "ImportPath": "github.com/hashicorp/errwrap", @@ -181,7 +181,7 @@ }, { "ImportPath": "github.com/ugorji/go/codec", - "Rev": "2f4b94206aae781e63846a9bf02ad83c387d5296" + "Rev": "8a2a3a8c488c3ebd98f422a965260278267a0551" }, { "ImportPath": "github.com/vaughan0/go-ini", @@ -213,11 +213,11 @@ }, { "ImportPath": "golang.org/x/net/context", - "Rev": "4b709d93778b93d2f34943e3142c71578d83ad31" + "Rev": "21c3935a8fc0f954d03e6b8a560c9600ffee38d2" }, { "ImportPath": "golang.org/x/oauth2", - "Rev": "2fbf3d7329d847b125188ad64b68cfb1f548938a" + "Rev": "ef4eca6b097fad7cec79afcc278d213a6de1c960" }, { "ImportPath": "gopkg.in/asn1-ber.v1", diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service/default_retryer.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service/default_retryer.go index e642d16b71..c3dd0fa35a 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service/default_retryer.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service/default_retryer.go @@ -34,11 +34,9 @@ func (d DefaultRetryer) MaxRetries() uint { return uint(aws.IntValue(d.Service.Config.MaxRetries)) } -var seededRand = rand.New(rand.NewSource(time.Now().UnixNano())) - // RetryRules returns the delay duration before retrying this request again func (d DefaultRetryer) RetryRules(r *request.Request) time.Duration { - delay := int(math.Pow(2, float64(r.RetryCount))) * (seededRand.Intn(30) + 30) + delay := int(math.Pow(2, float64(r.RetryCount))) * (rand.Intn(30) + 30) return time.Duration(delay) * time.Millisecond } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/version.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/version.go index 7613984d96..a1247d1104 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/version.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/version.go @@ -5,4 +5,4 @@ package aws const SDKName = "aws-sdk-go" // SDKVersion is the version of this SDK -const SDKVersion = "0.9.13" +const SDKVersion = "0.9.15" diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest/build.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest/build.go index 326e96cc62..87352bc60d 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest/build.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest/build.go @@ -6,6 +6,7 @@ import ( "encoding/base64" "fmt" "io" + "net/http" "net/url" "path" "reflect" @@ -23,6 +24,8 @@ const RFC822 = "Mon, 2 Jan 2006 15:04:05 GMT" // Whether the byte value can be sent without escaping in AWS URLs var noEscape [256]bool +var errValueNotSet = fmt.Errorf("value not set") + func init() { for i := 0; i < len(noEscape); i++ { // AWS expects every character except these to be escaped @@ -67,16 +70,18 @@ func buildLocationElements(r *request.Request, v reflect.Value) { continue } + var err error switch field.Tag.Get("location") { case "headers": // header maps - buildHeaderMap(r, m, field.Tag.Get("locationName")) + err = buildHeaderMap(&r.HTTPRequest.Header, m, field.Tag.Get("locationName")) case "header": - buildHeader(r, m, name) + err = buildHeader(&r.HTTPRequest.Header, m, name) case "uri": - buildURI(r, m, name) + err = buildURI(r.HTTPRequest.URL, m, name) case "querystring": - buildQueryString(r, m, name, query) + err = buildQueryString(query, m, name) } + r.Error = err } if r.Error != nil { return @@ -112,45 +117,77 @@ func buildBody(r *request.Request, v reflect.Value) { } } -func buildHeader(r *request.Request, v reflect.Value, name string) { +func buildHeader(header *http.Header, v reflect.Value, name string) error { str, err := convertType(v) - if err != nil { - r.Error = awserr.New("SerializationError", "failed to encode REST request", err) - } else if str != nil { - r.HTTPRequest.Header.Add(name, *str) + if err == errValueNotSet { + return nil + } else if err != nil { + return awserr.New("SerializationError", "failed to encode REST request", err) } + + header.Add(name, str) + + return nil } -func buildHeaderMap(r *request.Request, v reflect.Value, prefix string) { +func buildHeaderMap(header *http.Header, v reflect.Value, prefix string) error { for _, key := range v.MapKeys() { str, err := convertType(v.MapIndex(key)) - if err != nil { - r.Error = awserr.New("SerializationError", "failed to encode REST request", err) - } else if str != nil { - r.HTTPRequest.Header.Add(prefix+key.String(), *str) + if err == errValueNotSet { + continue + } else if err != nil { + return awserr.New("SerializationError", "failed to encode REST request", err) + } + + header.Add(prefix+key.String(), str) } + return nil } -func buildURI(r *request.Request, v reflect.Value, name string) { +func buildURI(u *url.URL, v reflect.Value, name string) error { value, err := convertType(v) - if err != nil { - r.Error = awserr.New("SerializationError", "failed to encode REST request", err) - } else if value != nil { - uri := r.HTTPRequest.URL.Path - uri = strings.Replace(uri, "{"+name+"}", EscapePath(*value, true), -1) - uri = strings.Replace(uri, "{"+name+"+}", EscapePath(*value, false), -1) - r.HTTPRequest.URL.Path = uri + if err == errValueNotSet { + return nil + } else if err != nil { + return awserr.New("SerializationError", "failed to encode REST request", err) } + + uri := u.Path + uri = strings.Replace(uri, "{"+name+"}", EscapePath(value, true), -1) + uri = strings.Replace(uri, "{"+name+"+}", EscapePath(value, false), -1) + u.Path = uri + + return nil } -func buildQueryString(r *request.Request, v reflect.Value, name string, query url.Values) { - str, err := convertType(v) - if err != nil { - r.Error = awserr.New("SerializationError", "failed to encode REST request", err) - } else if str != nil { - query.Set(name, *str) +func buildQueryString(query url.Values, v reflect.Value, name string) error { + switch value := v.Interface().(type) { + case []*string: + for _, item := range value { + query.Add(name, *item) + } + case map[string]*string: + for key, item := range value { + query.Add(key, *item) + } + case map[string][]*string: + for key, items := range value { + for _, item := range items { + query.Add(key, *item) + } + } + default: + str, err := convertType(v) + if err == errValueNotSet { + return nil + } else if err != nil { + return awserr.New("SerializationError", "failed to encode REST request", err) + } + query.Set(name, str) } + + return nil } func updatePath(url *url.URL, urlPath string) { @@ -189,10 +226,10 @@ func EscapePath(path string, encodeSep bool) string { return buf.String() } -func convertType(v reflect.Value) (*string, error) { +func convertType(v reflect.Value) (string, error) { v = reflect.Indirect(v) if !v.IsValid() { - return nil, nil + return "", errValueNotSet } var str string @@ -211,7 +248,7 @@ func convertType(v reflect.Value) (*string, error) { str = value.UTC().Format(RFC822) default: err := fmt.Errorf("Unsupported value for param %v (%s)", v.Interface(), v.Type()) - return nil, err + return "", err } - return &str, nil + return str, nil } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/s3/api.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/s3/api.go index 20bcc637f2..8fdcacbb4f 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/s3/api.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/s3/api.go @@ -2177,6 +2177,9 @@ type CopyObjectOutput struct { // (e.g., AES256, aws:kms). ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` + // Version ID of the newly created copy. + VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` + metadataCopyObjectOutput `json:"-" xml:"-"` } @@ -6578,6 +6581,10 @@ type UploadPartInput struct { // key was transmitted without error. SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` + // The Server-side encryption algorithm used when storing this object in S3 + // (e.g., AES256). + ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"UploadPartRequestServerSideEncryption"` + // Upload ID identifying the multipart upload whose part is being uploaded. UploadId *string `location:"querystring" locationName:"uploadId" type:"string" required:"true"` @@ -6932,3 +6939,10 @@ const ( // @enum Type TypeGroup = "Group" ) + +// The Server-side encryption algorithm used when storing this object in S3 +// (e.g., AES256). +const ( + // @enum UploadPartRequestServerSideEncryption + UploadPartRequestServerSideEncryptionAes256 = "AES256" +) diff --git a/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/response.generated.go b/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/response.generated.go index 397488b14c..0701dc09d4 100644 --- a/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/response.generated.go +++ b/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/response.generated.go @@ -16,18 +16,18 @@ import ( ) const ( - codecSelferC_UTF86669 = 1 - codecSelferC_RAW6669 = 0 - codecSelverValueTypeArray6669 = 10 - codecSelverValueTypeMap6669 = 9 + codecSelferC_UTF81978 = 1 + codecSelferC_RAW1978 = 0 + codecSelferValueTypeArray1978 = 10 + codecSelferValueTypeMap1978 = 9 ) var ( - codecSelferBitsize6669 = uint8(reflect.TypeOf(uint(0)).Bits()) - codecSelferOnlyMapOrArrayEncodeToStructErr6669 = errors.New(`only encoded map or array can be decoded into a struct`) + codecSelferBitsize1978 = uint8(reflect.TypeOf(uint(0)).Bits()) + codecSelferOnlyMapOrArrayEncodeToStructErr1978 = errors.New(`only encoded map or array can be decoded into a struct`) ) -type codecSelfer6669 struct{} +type codecSelfer1978 struct{} func init() { if codec1978.GenVersion != 4 { @@ -44,7 +44,7 @@ func init() { } func (x responseType) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer6669 + var h codecSelfer1978 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r yym1 := z.EncBinary() @@ -57,7 +57,7 @@ func (x responseType) CodecEncodeSelf(e *codec1978.Encoder) { } func (x *responseType) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer6669 + var h codecSelfer1978 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r yym2 := z.DecBinary() @@ -65,12 +65,12 @@ func (x *responseType) CodecDecodeSelf(d *codec1978.Decoder) { if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - *((*int)(x)) = int(r.DecodeInt(codecSelferBitsize6669)) + *((*int)(x)) = int(r.DecodeInt(codecSelferBitsize1978)) } } func (x *RawResponse) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer6669 + var h codecSelfer1978 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { @@ -105,7 +105,7 @@ func (x *RawResponse) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeInt(int64(x.StatusCode)) } } else { - r.EncodeString(codecSelferC_UTF86669, string("StatusCode")) + r.EncodeString(codecSelferC_UTF81978, string("StatusCode")) yym7 := z.EncBinary() _ = yym7 if false { @@ -121,11 +121,11 @@ func (x *RawResponse) CodecEncodeSelf(e *codec1978.Encoder) { _ = yym9 if false { } else { - r.EncodeStringBytes(codecSelferC_RAW6669, []byte(x.Body)) + r.EncodeStringBytes(codecSelferC_RAW1978, []byte(x.Body)) } } } else { - r.EncodeString(codecSelferC_UTF86669, string("Body")) + r.EncodeString(codecSelferC_UTF81978, string("Body")) if x.Body == nil { r.EncodeNil() } else { @@ -133,7 +133,7 @@ func (x *RawResponse) CodecEncodeSelf(e *codec1978.Encoder) { _ = yym10 if false { } else { - r.EncodeStringBytes(codecSelferC_RAW6669, []byte(x.Body)) + r.EncodeStringBytes(codecSelferC_RAW1978, []byte(x.Body)) } } } @@ -150,7 +150,7 @@ func (x *RawResponse) CodecEncodeSelf(e *codec1978.Encoder) { } } } else { - r.EncodeString(codecSelferC_UTF86669, string("Header")) + r.EncodeString(codecSelferC_UTF81978, string("Header")) if x.Header == nil { r.EncodeNil() } else { @@ -171,7 +171,7 @@ func (x *RawResponse) CodecEncodeSelf(e *codec1978.Encoder) { } func (x *RawResponse) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer6669 + var h codecSelfer1978 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r yym14 := z.DecBinary() @@ -179,14 +179,14 @@ func (x *RawResponse) CodecDecodeSelf(d *codec1978.Decoder) { if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - if r.IsContainerType(codecSelverValueTypeMap6669) { + if r.IsContainerType(codecSelferValueTypeMap1978) { yyl15 := r.ReadMapStart() if yyl15 == 0 { r.ReadEnd() } else { x.codecDecodeSelfFromMap(yyl15, d) } - } else if r.IsContainerType(codecSelverValueTypeArray6669) { + } else if r.IsContainerType(codecSelferValueTypeArray1978) { yyl15 := r.ReadArrayStart() if yyl15 == 0 { r.ReadEnd() @@ -194,13 +194,13 @@ func (x *RawResponse) CodecDecodeSelf(d *codec1978.Decoder) { x.codecDecodeSelfFromArray(yyl15, d) } } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr6669) + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1978) } } } func (x *RawResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer6669 + var h codecSelfer1978 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yys16Slc = z.DecScratchBuffer() // default slice to decode into @@ -223,7 +223,7 @@ func (x *RawResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.StatusCode = 0 } else { - x.StatusCode = int(r.DecodeInt(codecSelferBitsize6669)) + x.StatusCode = int(r.DecodeInt(codecSelferBitsize1978)) } case "Body": if r.TryDecodeAsNil() { @@ -260,7 +260,7 @@ func (x *RawResponse) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } func (x *RawResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer6669 + var h codecSelfer1978 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj22 int @@ -279,7 +279,7 @@ func (x *RawResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { if r.TryDecodeAsNil() { x.StatusCode = 0 } else { - x.StatusCode = int(r.DecodeInt(codecSelferBitsize6669)) + x.StatusCode = int(r.DecodeInt(codecSelferBitsize1978)) } yyj22++ if yyhl22 { @@ -340,7 +340,7 @@ func (x *RawResponse) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } func (x *Response) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer6669 + var h codecSelfer1978 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { @@ -373,15 +373,15 @@ func (x *Response) CodecEncodeSelf(e *codec1978.Encoder) { _ = yym31 if false { } else { - r.EncodeString(codecSelferC_UTF86669, string(x.Action)) + r.EncodeString(codecSelferC_UTF81978, string(x.Action)) } } else { - r.EncodeString(codecSelferC_UTF86669, string("action")) + r.EncodeString(codecSelferC_UTF81978, string("action")) yym32 := z.EncBinary() _ = yym32 if false { } else { - r.EncodeString(codecSelferC_UTF86669, string(x.Action)) + r.EncodeString(codecSelferC_UTF81978, string(x.Action)) } } if yyr29 || yy2arr29 { @@ -391,7 +391,7 @@ func (x *Response) CodecEncodeSelf(e *codec1978.Encoder) { x.Node.CodecEncodeSelf(e) } } else { - r.EncodeString(codecSelferC_UTF86669, string("node")) + r.EncodeString(codecSelferC_UTF81978, string("node")) if x.Node == nil { r.EncodeNil() } else { @@ -410,7 +410,7 @@ func (x *Response) CodecEncodeSelf(e *codec1978.Encoder) { } } else { if yyq29[2] { - r.EncodeString(codecSelferC_UTF86669, string("prevNode")) + r.EncodeString(codecSelferC_UTF81978, string("prevNode")) if x.PrevNode == nil { r.EncodeNil() } else { @@ -426,7 +426,7 @@ func (x *Response) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeUint(uint64(x.EtcdIndex)) } } else { - r.EncodeString(codecSelferC_UTF86669, string("etcdIndex")) + r.EncodeString(codecSelferC_UTF81978, string("etcdIndex")) yym37 := z.EncBinary() _ = yym37 if false { @@ -442,7 +442,7 @@ func (x *Response) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeUint(uint64(x.RaftIndex)) } } else { - r.EncodeString(codecSelferC_UTF86669, string("raftIndex")) + r.EncodeString(codecSelferC_UTF81978, string("raftIndex")) yym40 := z.EncBinary() _ = yym40 if false { @@ -458,7 +458,7 @@ func (x *Response) CodecEncodeSelf(e *codec1978.Encoder) { r.EncodeUint(uint64(x.RaftTerm)) } } else { - r.EncodeString(codecSelferC_UTF86669, string("raftTerm")) + r.EncodeString(codecSelferC_UTF81978, string("raftTerm")) yym43 := z.EncBinary() _ = yym43 if false { @@ -474,7 +474,7 @@ func (x *Response) CodecEncodeSelf(e *codec1978.Encoder) { } func (x *Response) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer6669 + var h codecSelfer1978 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r yym44 := z.DecBinary() @@ -482,14 +482,14 @@ func (x *Response) CodecDecodeSelf(d *codec1978.Decoder) { if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - if r.IsContainerType(codecSelverValueTypeMap6669) { + if r.IsContainerType(codecSelferValueTypeMap1978) { yyl45 := r.ReadMapStart() if yyl45 == 0 { r.ReadEnd() } else { x.codecDecodeSelfFromMap(yyl45, d) } - } else if r.IsContainerType(codecSelverValueTypeArray6669) { + } else if r.IsContainerType(codecSelferValueTypeArray1978) { yyl45 := r.ReadArrayStart() if yyl45 == 0 { r.ReadEnd() @@ -497,13 +497,13 @@ func (x *Response) CodecDecodeSelf(d *codec1978.Decoder) { x.codecDecodeSelfFromArray(yyl45, d) } } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr6669) + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1978) } } } func (x *Response) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer6669 + var h codecSelfer1978 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yys46Slc = z.DecScratchBuffer() // default slice to decode into @@ -578,7 +578,7 @@ func (x *Response) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } func (x *Response) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer6669 + var h codecSelfer1978 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj53 int @@ -700,7 +700,7 @@ func (x *Response) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } func (x *Node) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer6669 + var h codecSelfer1978 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { @@ -739,15 +739,15 @@ func (x *Node) CodecEncodeSelf(e *codec1978.Encoder) { _ = yym63 if false { } else { - r.EncodeString(codecSelferC_UTF86669, string(x.Key)) + r.EncodeString(codecSelferC_UTF81978, string(x.Key)) } } else { - r.EncodeString(codecSelferC_UTF86669, string("key")) + r.EncodeString(codecSelferC_UTF81978, string("key")) yym64 := z.EncBinary() _ = yym64 if false { } else { - r.EncodeString(codecSelferC_UTF86669, string(x.Key)) + r.EncodeString(codecSelferC_UTF81978, string(x.Key)) } } if yyr61 || yy2arr61 { @@ -756,19 +756,19 @@ func (x *Node) CodecEncodeSelf(e *codec1978.Encoder) { _ = yym66 if false { } else { - r.EncodeString(codecSelferC_UTF86669, string(x.Value)) + r.EncodeString(codecSelferC_UTF81978, string(x.Value)) } } else { - r.EncodeString(codecSelferC_UTF86669, "") + r.EncodeString(codecSelferC_UTF81978, "") } } else { if yyq61[1] { - r.EncodeString(codecSelferC_UTF86669, string("value")) + r.EncodeString(codecSelferC_UTF81978, string("value")) yym67 := z.EncBinary() _ = yym67 if false { } else { - r.EncodeString(codecSelferC_UTF86669, string(x.Value)) + r.EncodeString(codecSelferC_UTF81978, string(x.Value)) } } } @@ -785,7 +785,7 @@ func (x *Node) CodecEncodeSelf(e *codec1978.Encoder) { } } else { if yyq61[2] { - r.EncodeString(codecSelferC_UTF86669, string("dir")) + r.EncodeString(codecSelferC_UTF81978, string("dir")) yym70 := z.EncBinary() _ = yym70 if false { @@ -818,7 +818,7 @@ func (x *Node) CodecEncodeSelf(e *codec1978.Encoder) { } } else { if yyq61[3] { - r.EncodeString(codecSelferC_UTF86669, string("expiration")) + r.EncodeString(codecSelferC_UTF81978, string("expiration")) if x.Expiration == nil { r.EncodeNil() } else { @@ -851,7 +851,7 @@ func (x *Node) CodecEncodeSelf(e *codec1978.Encoder) { } } else { if yyq61[4] { - r.EncodeString(codecSelferC_UTF86669, string("ttl")) + r.EncodeString(codecSelferC_UTF81978, string("ttl")) yym78 := z.EncBinary() _ = yym78 if false { @@ -872,7 +872,7 @@ func (x *Node) CodecEncodeSelf(e *codec1978.Encoder) { } } else { if yyq61[5] { - r.EncodeString(codecSelferC_UTF86669, string("nodes")) + r.EncodeString(codecSelferC_UTF81978, string("nodes")) if x.Nodes == nil { r.EncodeNil() } else { @@ -893,7 +893,7 @@ func (x *Node) CodecEncodeSelf(e *codec1978.Encoder) { } } else { if yyq61[6] { - r.EncodeString(codecSelferC_UTF86669, string("modifiedIndex")) + r.EncodeString(codecSelferC_UTF81978, string("modifiedIndex")) yym82 := z.EncBinary() _ = yym82 if false { @@ -915,7 +915,7 @@ func (x *Node) CodecEncodeSelf(e *codec1978.Encoder) { } } else { if yyq61[7] { - r.EncodeString(codecSelferC_UTF86669, string("createdIndex")) + r.EncodeString(codecSelferC_UTF81978, string("createdIndex")) yym85 := z.EncBinary() _ = yym85 if false { @@ -932,7 +932,7 @@ func (x *Node) CodecEncodeSelf(e *codec1978.Encoder) { } func (x *Node) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer6669 + var h codecSelfer1978 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r yym86 := z.DecBinary() @@ -940,14 +940,14 @@ func (x *Node) CodecDecodeSelf(d *codec1978.Decoder) { if false { } else if z.HasExtensions() && z.DecExt(x) { } else { - if r.IsContainerType(codecSelverValueTypeMap6669) { + if r.IsContainerType(codecSelferValueTypeMap1978) { yyl87 := r.ReadMapStart() if yyl87 == 0 { r.ReadEnd() } else { x.codecDecodeSelfFromMap(yyl87, d) } - } else if r.IsContainerType(codecSelverValueTypeArray6669) { + } else if r.IsContainerType(codecSelferValueTypeArray1978) { yyl87 := r.ReadArrayStart() if yyl87 == 0 { r.ReadEnd() @@ -955,13 +955,13 @@ func (x *Node) CodecDecodeSelf(d *codec1978.Decoder) { x.codecDecodeSelfFromArray(yyl87, d) } } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr6669) + panic(codecSelferOnlyMapOrArrayEncodeToStructErr1978) } } } func (x *Node) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer6669 + var h codecSelfer1978 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yys88Slc = z.DecScratchBuffer() // default slice to decode into @@ -1056,7 +1056,7 @@ func (x *Node) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { } func (x *Node) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer6669 + var h codecSelfer1978 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r var yyj99 int @@ -1216,7 +1216,7 @@ func (x *Node) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { } func (x Nodes) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer6669 + var h codecSelfer1978 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r if x == nil { @@ -1233,7 +1233,7 @@ func (x Nodes) CodecEncodeSelf(e *codec1978.Encoder) { } func (x *Nodes) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer6669 + var h codecSelfer1978 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r yym111 := z.DecBinary() @@ -1245,8 +1245,8 @@ func (x *Nodes) CodecDecodeSelf(d *codec1978.Decoder) { } } -func (x codecSelfer6669) enchttp_Header(v pkg1_http.Header, e *codec1978.Encoder) { - var h codecSelfer6669 +func (x codecSelfer1978) enchttp_Header(v pkg1_http.Header, e *codec1978.Encoder) { + var h codecSelfer1978 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeMapStart(len(v)) @@ -1255,7 +1255,7 @@ func (x codecSelfer6669) enchttp_Header(v pkg1_http.Header, e *codec1978.Encoder _ = yym113 if false { } else { - r.EncodeString(codecSelferC_UTF86669, string(yyk112)) + r.EncodeString(codecSelferC_UTF81978, string(yyk112)) } if yyv112 == nil { r.EncodeNil() @@ -1271,19 +1271,16 @@ func (x codecSelfer6669) enchttp_Header(v pkg1_http.Header, e *codec1978.Encoder r.EncodeEnd() } -func (x codecSelfer6669) dechttp_Header(v *pkg1_http.Header, d *codec1978.Decoder) { - var h codecSelfer6669 +func (x codecSelfer1978) dechttp_Header(v *pkg1_http.Header, d *codec1978.Decoder) { + var h codecSelfer1978 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r yyv115 := *v yyl115 := r.ReadMapStart() if yyv115 == nil { - if yyl115 > 0 { - yyv115 = make(map[string][]string, yyl115) - } else { - yyv115 = make(map[string][]string) // supports indefinite-length, etc - } + yyrl115, _ := z.DecInferLen(yyl115, z.DecBasicHandle().MaxInitLen, 40) + yyv115 = make(map[string][]string, yyrl115) *v = yyv115 } if yyl115 > 0 { @@ -1342,8 +1339,8 @@ func (x codecSelfer6669) dechttp_Header(v *pkg1_http.Header, d *codec1978.Decode } // else len==0: TODO: Should we clear map entries? } -func (x codecSelfer6669) encNodes(v Nodes, e *codec1978.Encoder) { - var h codecSelfer6669 +func (x codecSelfer1978) encNodes(v Nodes, e *codec1978.Encoder) { + var h codecSelfer1978 z, r := codec1978.GenHelperEncoder(e) _, _, _ = h, z, r r.EncodeArrayStart(len(v)) @@ -1357,23 +1354,24 @@ func (x codecSelfer6669) encNodes(v Nodes, e *codec1978.Encoder) { r.EncodeEnd() } -func (x codecSelfer6669) decNodes(v *Nodes, d *codec1978.Decoder) { - var h codecSelfer6669 +func (x codecSelfer1978) decNodes(v *Nodes, d *codec1978.Decoder) { + var h codecSelfer1978 z, r := codec1978.GenHelperDecoder(d) _, _, _ = h, z, r yyv123 := *v yyh123, yyl123 := z.DecSliceHelperStart() - var yyc123 bool - _ = yyc123 + var yyrr123, yyrl123 int + var yyc123, yyrt123 bool + _, _, _ = yyc123, yyrt123, yyrl123 + yyrr123 = yyl123 if yyv123 == nil { - if yyl123 <= 0 { - yyv123 = make(Nodes, 0) - } else { - yyv123 = make(Nodes, yyl123) + if yyrl123, yyrt123 = z.DecInferLen(yyl123, z.DecBasicHandle().MaxInitLen, 8); yyrt123 { + yyrr123 = yyrl123 } + yyv123 = make(Nodes, yyrl123) yyc123 = true } @@ -1384,17 +1382,18 @@ func (x codecSelfer6669) decNodes(v *Nodes, d *codec1978.Decoder) { } } else if yyl123 > 0 { - yyn123 := yyl123 if yyl123 > cap(yyv123) { - yyv123 = make([]*Node, yyl123, yyl123) + yyrl123, yyrt123 = z.DecInferLen(yyl123, z.DecBasicHandle().MaxInitLen, 8) + yyv123 = make([]*Node, yyrl123) yyc123 = true + yyrr123 = len(yyv123) } else if yyl123 != len(yyv123) { yyv123 = yyv123[:yyl123] yyc123 = true } yyj123 := 0 - for ; yyj123 < yyn123; yyj123++ { + for ; yyj123 < yyrr123; yyj123++ { if r.TryDecodeAsNil() { if yyv123[yyj123] != nil { *yyv123[yyj123] = Node{} @@ -1408,6 +1407,23 @@ func (x codecSelfer6669) decNodes(v *Nodes, d *codec1978.Decoder) { } } + if yyrt123 { + for ; yyj123 < yyl123; yyj123++ { + yyv123 = append(yyv123, nil) + if r.TryDecodeAsNil() { + if yyv123[yyj123] != nil { + *yyv123[yyj123] = Node{} + } + } else { + if yyv123[yyj123] == nil { + yyv123[yyj123] = new(Node) + } + yyw125 := yyv123[yyj123] + yyw125.CodecDecodeSelf(d) + } + + } + } } else { for yyj123 := 0; !r.CheckBreak(); yyj123++ { @@ -1425,8 +1441,8 @@ func (x codecSelfer6669) decNodes(v *Nodes, d *codec1978.Decoder) { if yyv123[yyj123] == nil { yyv123[yyj123] = new(Node) } - yyw125 := yyv123[yyj123] - yyw125.CodecDecodeSelf(d) + yyw126 := yyv123[yyj123] + yyw126.CodecDecodeSelf(d) } } else { diff --git a/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/response.go b/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/response.go index dff20c3561..69b38be46e 100644 --- a/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/response.go +++ b/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd/response.go @@ -1,6 +1,6 @@ package etcd -//go:generate codecgen -o response.generated.go response.go +//go:generate codecgen -d 1978 -o response.generated.go response.go import ( "net/http" diff --git a/Godeps/_workspace/src/github.com/fatih/structs/.travis.yml b/Godeps/_workspace/src/github.com/fatih/structs/.travis.yml index 28381ef8e6..c3bd50e2e1 100644 --- a/Godeps/_workspace/src/github.com/fatih/structs/.travis.yml +++ b/Godeps/_workspace/src/github.com/fatih/structs/.travis.yml @@ -1,11 +1,8 @@ language: go -go: 1.3 +go: 1.5 before_install: - go get github.com/axw/gocov/gocov - go get github.com/mattn/goveralls -- go get code.google.com/p/go.tools/cmd/cover +- if ! go get github.com/golang/tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi script: -- $HOME/gopath/bin/goveralls -repotoken $COVERALLS_TOKEN -env: - global: - - secure: hkc+92KPmMFqIH9n4yWdnH1JpZjahmOyDJwpTh8Yl0JieJNG0XEXpOqNao27eA0cLF+UHdyjFeGcPUJKNmgE46AoQjtovt+ICjCXKR2yF6S2kKJcUOz/Vd6boZF7qHV06jjxyxOebpID5iSoW6UfFr001bFxpd3jaSLFTzSHWRQ= +- $HOME/gopath/bin/goveralls -service=travis-ci diff --git a/Godeps/_workspace/src/github.com/google/go-github/github/orgs_members.go b/Godeps/_workspace/src/github.com/google/go-github/github/orgs_members.go index 554cb1d50d..c66b4956f9 100644 --- a/Godeps/_workspace/src/github.com/google/go-github/github/orgs_members.go +++ b/Godeps/_workspace/src/github.com/google/go-github/github/orgs_members.go @@ -172,7 +172,7 @@ func (s *OrganizationsService) ConcealMembership(org, user string) (*Response, e // ListOrgMembershipsOptions specifies optional parameters to the // OrganizationsService.ListOrgMemberships method. type ListOrgMembershipsOptions struct { - // Filter memberships to include only those withe the specified state. + // Filter memberships to include only those with the specified state. // Possible values are: "active", "pending". State string `url:"state,omitempty"` diff --git a/Godeps/_workspace/src/github.com/hashicorp/consul/api/api.go b/Godeps/_workspace/src/github.com/hashicorp/consul/api/api.go index b0b7128340..0d248f6553 100644 --- a/Godeps/_workspace/src/github.com/hashicorp/consul/api/api.go +++ b/Godeps/_workspace/src/github.com/hashicorp/consul/api/api.go @@ -119,7 +119,7 @@ func DefaultConfig() *Config { config := &Config{ Address: "127.0.0.1:8500", Scheme: "http", - HttpClient: http.DefaultClient, + HttpClient: &http.Client{}, } if addr := os.Getenv("CONSUL_HTTP_ADDR"); addr != "" { diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/codecgen/gen.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/codecgen/gen.go index 582ba44434..f370b4c796 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/codecgen/gen.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/codecgen/gen.go @@ -41,10 +41,6 @@ package {{ $.PackageName }} import ( {{ if not .CodecPkgFiles }}{{ .CodecPkgName }} "{{ .CodecImportPath }}"{{ end }} -{{/* - {{ if .Types }}"{{ .ImportPath }}"{{ end }} - "io" -*/}} "os" "reflect" "bytes" @@ -52,14 +48,6 @@ import ( "go/format" ) -{{/* This is not used anymore. Remove it. -func write(w io.Writer, s string) { - if _, err := io.WriteString(w, s); err != nil { - panic(err) - } -} -*/}} - func CodecGenTempWrite{{ .RandString }}() { fout, err := os.Create("{{ .OutFile }}") if err != nil { diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/decode.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/decode.go index d068cf61e2..71dd71c892 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/decode.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/decode.go @@ -95,6 +95,14 @@ type DecodeOptions struct { // If nil, we use []interface{} SliceType reflect.Type + // MaxInitLen defines the initial length that we "make" a collection (slice, chan or map) with. + // If 0 or negative, we default to a sensible value based on the size of an element in the collection. + // + // For example, when decoding, a stream may say that it has MAX_UINT elements. + // We should not auto-matically provision a slice of that length, to prevent Out-Of-Memory crash. + // Instead, we provision up to MaxInitLen, fill that up, and start appending after that. + MaxInitLen int + // If ErrorIfNoField, return an error when decoding a map // from a codec stream into a struct, and no matching struct field is found. ErrorIfNoField bool @@ -107,13 +115,42 @@ type DecodeOptions struct { // If SignedInteger, use the int64 during schema-less decoding of unsigned values (not uint64). SignedInteger bool - // MaxInitLen defines the initial length that we "make" a collection (slice, chan or map) with. - // If 0 or negative, we default to a sensible value based on the size of an element in the collection. + // MapValueReset controls how we decode into a map value. // - // For example, when decoding, a stream may say that it has MAX_UINT elements. - // We should not auto-matically provision a slice of that length, to prevent Out-Of-Memory crash. - // Instead, we provision up to MaxInitLen, fill that up, and start appending after that. - MaxInitLen int + // By default, we MAY retrieve the mapping for a key, and then decode into that. + // However, especially with big maps, that retrieval may be expensive and unnecessary + // if the stream already contains all that is necessary to recreate the value. + // + // If true, we will never retrieve the previous mapping, + // but rather decode into a new value and set that in the map. + // + // If false, we will retrieve the previous mapping if necessary e.g. + // the previous mapping is a pointer, or is a struct or array with pre-set state, + // or is an interface. + MapValueReset bool + + // InterfaceReset controls how we decode into an interface. + // + // By default, when we see a field that is an interface{...}, + // or a map with interface{...} value, we will attempt decoding into the + // "contained" value. + // + // However, this prevents us from reading a string into an interface{} + // that formerly contained a number. + // + // If true, we will decode into a new "blank" value, and set that in the interface. + // If false, we will decode into whatever is contained in the interface. + InterfaceReset bool + + // InternString controls interning of strings during decoding. + // + // Some handles, e.g. json, typically will read map keys as strings. + // If the set of keys are finite, it may help reduce allocation to + // look them up from a map (than to allocate them afresh). + // + // Note: Handles will be smart when using the intern functionality. + // So everything will not be interned. + InternString bool } // ------------------------------------ @@ -582,25 +619,34 @@ func (f *decFnInfo) kInterface(rv reflect.Value) { // to decode into what was there before. // We do not replace with a generic value (as got from decodeNaked). + var rvn reflect.Value if rv.IsNil() { - rvn := f.kInterfaceNaked() + rvn = f.kInterfaceNaked() if rvn.IsValid() { rv.Set(rvn) } + } else if f.d.h.InterfaceReset { + rvn = f.kInterfaceNaked() + if rvn.IsValid() { + rv.Set(rvn) + } else { + // reset to zero value based on current type in there. + rv.Set(reflect.Zero(rv.Elem().Type())) + } } else { - rve := rv.Elem() + rvn = rv.Elem() // Note: interface{} is settable, but underlying type may not be. // Consequently, we have to set the reflect.Value directly. // if underlying type is settable (e.g. ptr or interface), // we just decode into it. // Else we create a settable value, decode into it, and set on the interface. - if rve.CanSet() { - f.d.decodeValue(rve, nil) + if rvn.CanSet() { + f.d.decodeValue(rvn, nil) } else { - rve2 := reflect.New(rve.Type()).Elem() - rve2.Set(rve) - f.d.decodeValue(rve2, nil) - rv.Set(rve2) + rvn2 := reflect.New(rvn.Type()).Elem() + rvn2.Set(rvn) + f.d.decodeValue(rvn2, nil) + rv.Set(rvn2) } } } @@ -887,22 +933,45 @@ func (f *decFnInfo) kMap(rv reflect.Value) { for xtyp = vtype; xtyp.Kind() == reflect.Ptr; xtyp = xtyp.Elem() { } valFn = d.getDecFn(xtyp, true, true) + var mapGet bool + if !f.d.h.MapValueReset { + // if pointer, mapGet = true + // if interface, mapGet = true if !DecodeNakedAlways (else false) + // if builtin, mapGet = false + // else mapGet = true + vtypeKind := vtype.Kind() + if vtypeKind == reflect.Ptr { + mapGet = true + } else if vtypeKind == reflect.Interface { + if !f.d.h.InterfaceReset { + mapGet = true + } + } else if !isImmutableKind(vtypeKind) { + mapGet = true + } + } + + var rvk, rvv reflect.Value + // for j := 0; j < containerLen; j++ { if containerLen > 0 { for j := 0; j < containerLen; j++ { - rvk := reflect.New(ktype).Elem() + rvk = reflect.New(ktype).Elem() d.decodeValue(rvk, keyFn) // special case if a byte array. if ktypeId == intfTypId { rvk = rvk.Elem() if rvk.Type() == uint8SliceTyp { - rvk = reflect.ValueOf(string(rvk.Bytes())) + rvk = reflect.ValueOf(d.string(rvk.Bytes())) } } - rvv := rv.MapIndex(rvk) - // TODO: is !IsValid check required? - if !rvv.IsValid() { + if mapGet { + rvv = rv.MapIndex(rvk) + if !rvv.IsValid() { + rvv = reflect.New(vtype).Elem() + } + } else { rvv = reflect.New(vtype).Elem() } d.decodeValue(rvv, valFn) @@ -910,18 +979,22 @@ func (f *decFnInfo) kMap(rv reflect.Value) { } } else { for j := 0; !dd.CheckBreak(); j++ { - rvk := reflect.New(ktype).Elem() + rvk = reflect.New(ktype).Elem() d.decodeValue(rvk, keyFn) // special case if a byte array. if ktypeId == intfTypId { rvk = rvk.Elem() if rvk.Type() == uint8SliceTyp { - rvk = reflect.ValueOf(string(rvk.Bytes())) + rvk = reflect.ValueOf(d.string(rvk.Bytes())) } } - rvv := rv.MapIndex(rvk) - if !rvv.IsValid() { + if mapGet { + rvv = rv.MapIndex(rvk) + if !rvv.IsValid() { + rvv = reflect.New(vtype).Elem() + } + } else { rvv = reflect.New(vtype).Elem() } d.decodeValue(rvv, valFn) @@ -957,6 +1030,8 @@ type Decoder struct { ri ioDecReader f map[uintptr]*decFn + is map[string]string // used for interning strings + // _ uintptr // for alignment purposes, so next one starts from a cache line b [scratchByteArrayLen]byte @@ -977,6 +1052,9 @@ func NewDecoder(r io.Reader, h Handle) (d *Decoder) { d.ri.br = &d.ri.bs } d.r = &d.ri + if d.h.InternString { + d.is = make(map[string]string, 32) + } _, d.js = h.(*JsonHandle) d.d = h.newDecDriver(d) return @@ -990,6 +1068,9 @@ func NewDecoderBytes(in []byte, h Handle) (d *Decoder) { d.rb.b = in d.rb.a = len(in) d.r = &d.rb + if d.h.InternString { + d.is = make(map[string]string, 32) + } _, d.js = h.(*JsonHandle) d.d = h.newDecDriver(d) // d.d = h.newDecDriver(decReaderT{true, &d.rb, &d.ri}) @@ -1472,6 +1553,24 @@ func (d *Decoder) errorf(format string, params ...interface{}) { panic(err) } +func (d *Decoder) string(v []byte) (s string) { + if d.is != nil { + s, ok := d.is[string(v)] // no allocation here. + if !ok { + s = string(v) + d.is[s] = s + } + return s + } + return string(v) // don't return stringView, as we need a real string here. +} + +func (d *Decoder) intern(s string) { + if d.is != nil { + d.is[s] = s + } +} + // -------------------------------------------------- // decSliceHelper assists when decoding into a slice, from a map or an array in the stream. diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/encode.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/encode.go index 9f1def5dc7..49c3a45771 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/encode.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/encode.go @@ -4,7 +4,6 @@ package codec import ( - "bytes" "encoding" "fmt" "io" @@ -80,17 +79,6 @@ type encNoSeparator struct{} func (_ encNoSeparator) EncodeEnd() {} -type encStructFieldBytesV struct { - b []byte - v reflect.Value -} - -type encStructFieldBytesVslice []encStructFieldBytesV - -func (p encStructFieldBytesVslice) Len() int { return len(p) } -func (p encStructFieldBytesVslice) Less(i, j int) bool { return bytes.Compare(p[i].b, p[j].b) == -1 } -func (p encStructFieldBytesVslice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - type ioEncWriterWriter interface { WriteByte(c byte) error WriteString(s string) (n int, err error) @@ -109,8 +97,16 @@ type EncodeOptions struct { // sequence of bytes. // // This only affects maps, as the iteration order for maps is random. - // In this case, the map keys will first be encoded into []byte, and then sorted, - // before writing the sorted keys and the corresponding map values to the stream. + // + // The implementation MAY use the natural sort order for the map keys if possible: + // + // - If there is a natural sort order (ie for number, bool, string or []byte keys), + // then the map keys are first sorted in natural order and then written + // with corresponding map values to the strema. + // - If there is no natural sort order, then the map keys will first be + // encoded into []byte, and then sorted, + // before writing the sorted keys and the corresponding map values to the stream. + // Canonical bool // AsSymbols defines what should be encoded as symbols. @@ -493,27 +489,27 @@ func (f *encFnInfo) kStruct(rv reflect.Value) { tisfi = fti.sfi } newlen = 0 - var kv encStructFieldKV + var kv stringRv for _, si := range tisfi { - kv.v = si.field(rv, false) + kv.r = si.field(rv, false) // if si.i != -1 { // rvals[newlen] = rv.Field(int(si.i)) // } else { // rvals[newlen] = rv.FieldByIndex(si.is) // } if toMap { - if si.omitEmpty && isEmptyValue(kv.v) { + if si.omitEmpty && isEmptyValue(kv.r) { continue } - kv.k = si.encName + kv.v = si.encName } else { // use the zero value. // if a reference or struct, set to nil (so you do not output too much) - if si.omitEmpty && isEmptyValue(kv.v) { - switch kv.v.Kind() { + if si.omitEmpty && isEmptyValue(kv.r) { + switch kv.r.Kind() { case reflect.Struct, reflect.Interface, reflect.Ptr, reflect.Array, reflect.Map, reflect.Slice: - kv.v = reflect.Value{} //encode as nil + kv.r = reflect.Value{} //encode as nil } } } @@ -532,17 +528,17 @@ func (f *encFnInfo) kStruct(rv reflect.Value) { for j := 0; j < newlen; j++ { kv = fkvs[j] if asSymbols { - ee.EncodeSymbol(kv.k) + ee.EncodeSymbol(kv.v) } else { - ee.EncodeString(c_UTF8, kv.k) + ee.EncodeString(c_UTF8, kv.v) } - e.encodeValue(kv.v, nil) + e.encodeValue(kv.r, nil) } } else { ee.EncodeArrayStart(newlen) for j := 0; j < newlen; j++ { kv = fkvs[j] - e.encodeValue(kv.v, nil) + e.encodeValue(kv.r, nil) } } ee.EncodeEnd() @@ -621,24 +617,9 @@ func (f *encFnInfo) kMap(rv reflect.Value) { } mks := rv.MapKeys() // for j, lmks := 0, len(mks); j < lmks; j++ { + if e.h.Canonical { - // first encode each key to a []byte first, then sort them, then record - // println(">>>>>>>> CANONICAL <<<<<<<<") - var mksv []byte = make([]byte, 0, len(mks)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - mksbv := make([]encStructFieldBytesV, len(mks)) - for i, k := range mks { - l := len(mksv) - e2.MustEncode(k) - mksbv[i].v = k - mksbv[i].b = mksv[l:] - // fmt.Printf(">>>>> %s\n", mksv[l:]) - } - sort.Sort(encStructFieldBytesVslice(mksbv)) - for j := range mksbv { - e.asis(mksbv[j].b) - e.encodeValue(rv.MapIndex(mksbv[j].v), valFn) - } + e.kMapCanonical(rtkeyid, rtkey, rv, mks, valFn, asSymbols) } else { for j := range mks { if keyTypeIsString { @@ -653,9 +634,128 @@ func (f *encFnInfo) kMap(rv reflect.Value) { e.encodeValue(rv.MapIndex(mks[j]), valFn) } } + ee.EncodeEnd() } +func (e *Encoder) kMapCanonical(rtkeyid uintptr, rtkey reflect.Type, rv reflect.Value, mks []reflect.Value, valFn *encFn, asSymbols bool) { + ee := e.e + // we previously did out-of-band if an extension was registered. + // This is not necessary, as the natural kind is sufficient for ordering. + + if rtkeyid == uint8SliceTypId { + mksv := make([]bytesRv, len(mks)) + for i, k := range mks { + v := &mksv[i] + v.r = k + v.v = k.Bytes() + } + sort.Sort(bytesRvSlice(mksv)) + for i := range mksv { + ee.EncodeStringBytes(c_RAW, mksv[i].v) + e.encodeValue(rv.MapIndex(mksv[i].r), valFn) + } + } else { + switch rtkey.Kind() { + case reflect.Bool: + mksv := make([]boolRv, len(mks)) + for i, k := range mks { + v := &mksv[i] + v.r = k + v.v = k.Bool() + } + sort.Sort(boolRvSlice(mksv)) + for i := range mksv { + ee.EncodeBool(mksv[i].v) + e.encodeValue(rv.MapIndex(mksv[i].r), valFn) + } + case reflect.String: + mksv := make([]stringRv, len(mks)) + for i, k := range mks { + v := &mksv[i] + v.r = k + v.v = k.String() + } + sort.Sort(stringRvSlice(mksv)) + for i := range mksv { + if asSymbols { + ee.EncodeSymbol(mksv[i].v) + } else { + ee.EncodeString(c_UTF8, mksv[i].v) + } + e.encodeValue(rv.MapIndex(mksv[i].r), valFn) + } + case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint, reflect.Uintptr: + mksv := make([]uintRv, len(mks)) + for i, k := range mks { + v := &mksv[i] + v.r = k + v.v = k.Uint() + } + sort.Sort(uintRvSlice(mksv)) + for i := range mksv { + ee.EncodeUint(mksv[i].v) + e.encodeValue(rv.MapIndex(mksv[i].r), valFn) + } + case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: + mksv := make([]intRv, len(mks)) + for i, k := range mks { + v := &mksv[i] + v.r = k + v.v = k.Int() + } + sort.Sort(intRvSlice(mksv)) + for i := range mksv { + ee.EncodeInt(mksv[i].v) + e.encodeValue(rv.MapIndex(mksv[i].r), valFn) + } + case reflect.Float32: + mksv := make([]floatRv, len(mks)) + for i, k := range mks { + v := &mksv[i] + v.r = k + v.v = k.Float() + } + sort.Sort(floatRvSlice(mksv)) + for i := range mksv { + ee.EncodeFloat32(float32(mksv[i].v)) + e.encodeValue(rv.MapIndex(mksv[i].r), valFn) + } + case reflect.Float64: + mksv := make([]floatRv, len(mks)) + for i, k := range mks { + v := &mksv[i] + v.r = k + v.v = k.Float() + } + sort.Sort(floatRvSlice(mksv)) + for i := range mksv { + ee.EncodeFloat64(mksv[i].v) + e.encodeValue(rv.MapIndex(mksv[i].r), valFn) + } + default: + // out-of-band + // first encode each key to a []byte first, then sort them, then record + var mksv []byte = make([]byte, 0, len(mks)*16) // temporary byte slice for the encoding + e2 := NewEncoderBytes(&mksv, e.hh) + mksbv := make([]bytesRv, len(mks)) + for i, k := range mks { + v := &mksbv[i] + l := len(mksv) + e2.MustEncode(k) + v.r = k + v.v = mksv[l:] + // fmt.Printf(">>>>> %s\n", mksv[l:]) + } + sort.Sort(bytesRvSlice(mksbv)) + for j := range mksbv { + e.asis(mksbv[j].v) + e.encodeValue(rv.MapIndex(mksbv[j].r), valFn) + } + } + } +} + // -------------------------------------------------- // encFn encapsulates the captured variables and the encode function. @@ -903,16 +1003,9 @@ func (e *Encoder) encode(iv interface{}) { e.e.EncodeStringBytes(c_RAW, *v) default: - // canonical mode is not supported for fastpath of maps (but is fine for slices) const checkCodecSelfer1 = true // in case T is passed, where *T is a Selfer, still checkCodecSelfer - if e.h.Canonical { - if !fastpathEncodeTypeSwitchSlice(iv, e) { - e.encodeI(iv, false, checkCodecSelfer1) - } - } else { - if !fastpathEncodeTypeSwitch(iv, e) { - e.encodeI(iv, false, checkCodecSelfer1) - } + if !fastpathEncodeTypeSwitch(iv, e) { + e.encodeI(iv, false, checkCodecSelfer1) } } } @@ -1019,8 +1112,7 @@ func (e *Encoder) getEncFn(rtid uintptr, rt reflect.Type, checkFastpath, checkCo fn.f = (*encFnInfo).textMarshal } else { rk := rt.Kind() - // if fastpathEnabled && checkFastpath && (rk == reflect.Map || rk == reflect.Slice) { - if fastpathEnabled && checkFastpath && (rk == reflect.Slice || (rk == reflect.Map && !e.h.Canonical)) { + if fastpathEnabled && checkFastpath && (rk == reflect.Map || rk == reflect.Slice) { if rt.PkgPath() == "" { if idx := fastpathAV.index(rtid); idx != -1 { fn.f = fastpathAV[idx].encfn @@ -1114,11 +1206,6 @@ func (e *Encoder) errorf(format string, params ...interface{}) { // ---------------------------------------- -type encStructFieldKV struct { - k string - v reflect.Value -} - const encStructPoolLen = 5 // encStructPool is an array of sync.Pool. @@ -1133,33 +1220,33 @@ const encStructPoolLen = 5 var encStructPool [encStructPoolLen]sync.Pool func init() { - encStructPool[0].New = func() interface{} { return new([8]encStructFieldKV) } - encStructPool[1].New = func() interface{} { return new([16]encStructFieldKV) } - encStructPool[2].New = func() interface{} { return new([32]encStructFieldKV) } - encStructPool[3].New = func() interface{} { return new([64]encStructFieldKV) } - encStructPool[4].New = func() interface{} { return new([128]encStructFieldKV) } + encStructPool[0].New = func() interface{} { return new([8]stringRv) } + encStructPool[1].New = func() interface{} { return new([16]stringRv) } + encStructPool[2].New = func() interface{} { return new([32]stringRv) } + encStructPool[3].New = func() interface{} { return new([64]stringRv) } + encStructPool[4].New = func() interface{} { return new([128]stringRv) } } -func encStructPoolGet(newlen int) (p *sync.Pool, v interface{}, s []encStructFieldKV) { +func encStructPoolGet(newlen int) (p *sync.Pool, v interface{}, s []stringRv) { // if encStructPoolLen != 5 { // constant chec, so removed at build time. // panic(errors.New("encStructPoolLen must be equal to 4")) // defensive, in case it is changed // } // idxpool := newlen / 8 // if pool == nil { - // fkvs = make([]encStructFieldKV, newlen) + // fkvs = make([]stringRv, newlen) // } else { // poolv = pool.Get() // switch vv := poolv.(type) { - // case *[8]encStructFieldKV: + // case *[8]stringRv: // fkvs = vv[:newlen] - // case *[16]encStructFieldKV: + // case *[16]stringRv: // fkvs = vv[:newlen] - // case *[32]encStructFieldKV: + // case *[32]stringRv: // fkvs = vv[:newlen] - // case *[64]encStructFieldKV: + // case *[64]stringRv: // fkvs = vv[:newlen] - // case *[128]encStructFieldKV: + // case *[128]stringRv: // fkvs = vv[:newlen] // } // } @@ -1167,25 +1254,25 @@ func encStructPoolGet(newlen int) (p *sync.Pool, v interface{}, s []encStructFie if newlen <= 8 { p = &encStructPool[0] v = p.Get() - s = v.(*[8]encStructFieldKV)[:newlen] + s = v.(*[8]stringRv)[:newlen] } else if newlen <= 16 { p = &encStructPool[1] v = p.Get() - s = v.(*[16]encStructFieldKV)[:newlen] + s = v.(*[16]stringRv)[:newlen] } else if newlen <= 32 { p = &encStructPool[2] v = p.Get() - s = v.(*[32]encStructFieldKV)[:newlen] + s = v.(*[32]stringRv)[:newlen] } else if newlen <= 64 { p = &encStructPool[3] v = p.Get() - s = v.(*[64]encStructFieldKV)[:newlen] + s = v.(*[64]stringRv)[:newlen] } else if newlen <= 128 { p = &encStructPool[4] v = p.Get() - s = v.(*[128]encStructFieldKV)[:newlen] + s = v.(*[128]stringRv)[:newlen] } else { - s = make([]encStructFieldKV, newlen) + s = make([]stringRv, newlen) } return } diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/fast-path.generated.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/fast-path.generated.go index 554e80b613..cb5d6a694e 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/fast-path.generated.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/fast-path.generated.go @@ -52,11 +52,11 @@ type fastpathE struct { decfn func(*decFnInfo, reflect.Value) } -type fastpathA [239]fastpathE +type fastpathA [271]fastpathE func (x *fastpathA) index(rtid uintptr) int { // use binary search to grab the index (adapted from sort/search.go) - h, i, j := 0, 0, 239 // len(x) + h, i, j := 0, 0, 271 // len(x) for i < j { h = i + (j-i)/2 if x[h].rtid < rtid { @@ -65,7 +65,7 @@ func (x *fastpathA) index(rtid uintptr) int { j = h } } - if i < 239 && x[i].rtid == rtid { + if i < 271 && x[i].rtid == rtid { return i } return -1 @@ -101,6 +101,7 @@ func init() { fn([]uint16(nil), (*encFnInfo).fastpathEncSliceUint16R, (*decFnInfo).fastpathDecSliceUint16R) fn([]uint32(nil), (*encFnInfo).fastpathEncSliceUint32R, (*decFnInfo).fastpathDecSliceUint32R) fn([]uint64(nil), (*encFnInfo).fastpathEncSliceUint64R, (*decFnInfo).fastpathDecSliceUint64R) + fn([]uintptr(nil), (*encFnInfo).fastpathEncSliceUintptrR, (*decFnInfo).fastpathDecSliceUintptrR) fn([]int(nil), (*encFnInfo).fastpathEncSliceIntR, (*decFnInfo).fastpathDecSliceIntR) fn([]int8(nil), (*encFnInfo).fastpathEncSliceInt8R, (*decFnInfo).fastpathDecSliceInt8R) fn([]int16(nil), (*encFnInfo).fastpathEncSliceInt16R, (*decFnInfo).fastpathDecSliceInt16R) @@ -115,6 +116,7 @@ func init() { fn(map[interface{}]uint16(nil), (*encFnInfo).fastpathEncMapIntfUint16R, (*decFnInfo).fastpathDecMapIntfUint16R) fn(map[interface{}]uint32(nil), (*encFnInfo).fastpathEncMapIntfUint32R, (*decFnInfo).fastpathDecMapIntfUint32R) fn(map[interface{}]uint64(nil), (*encFnInfo).fastpathEncMapIntfUint64R, (*decFnInfo).fastpathDecMapIntfUint64R) + fn(map[interface{}]uintptr(nil), (*encFnInfo).fastpathEncMapIntfUintptrR, (*decFnInfo).fastpathDecMapIntfUintptrR) fn(map[interface{}]int(nil), (*encFnInfo).fastpathEncMapIntfIntR, (*decFnInfo).fastpathDecMapIntfIntR) fn(map[interface{}]int8(nil), (*encFnInfo).fastpathEncMapIntfInt8R, (*decFnInfo).fastpathDecMapIntfInt8R) fn(map[interface{}]int16(nil), (*encFnInfo).fastpathEncMapIntfInt16R, (*decFnInfo).fastpathDecMapIntfInt16R) @@ -130,6 +132,7 @@ func init() { fn(map[string]uint16(nil), (*encFnInfo).fastpathEncMapStringUint16R, (*decFnInfo).fastpathDecMapStringUint16R) fn(map[string]uint32(nil), (*encFnInfo).fastpathEncMapStringUint32R, (*decFnInfo).fastpathDecMapStringUint32R) fn(map[string]uint64(nil), (*encFnInfo).fastpathEncMapStringUint64R, (*decFnInfo).fastpathDecMapStringUint64R) + fn(map[string]uintptr(nil), (*encFnInfo).fastpathEncMapStringUintptrR, (*decFnInfo).fastpathDecMapStringUintptrR) fn(map[string]int(nil), (*encFnInfo).fastpathEncMapStringIntR, (*decFnInfo).fastpathDecMapStringIntR) fn(map[string]int8(nil), (*encFnInfo).fastpathEncMapStringInt8R, (*decFnInfo).fastpathDecMapStringInt8R) fn(map[string]int16(nil), (*encFnInfo).fastpathEncMapStringInt16R, (*decFnInfo).fastpathDecMapStringInt16R) @@ -145,6 +148,7 @@ func init() { fn(map[float32]uint16(nil), (*encFnInfo).fastpathEncMapFloat32Uint16R, (*decFnInfo).fastpathDecMapFloat32Uint16R) fn(map[float32]uint32(nil), (*encFnInfo).fastpathEncMapFloat32Uint32R, (*decFnInfo).fastpathDecMapFloat32Uint32R) fn(map[float32]uint64(nil), (*encFnInfo).fastpathEncMapFloat32Uint64R, (*decFnInfo).fastpathDecMapFloat32Uint64R) + fn(map[float32]uintptr(nil), (*encFnInfo).fastpathEncMapFloat32UintptrR, (*decFnInfo).fastpathDecMapFloat32UintptrR) fn(map[float32]int(nil), (*encFnInfo).fastpathEncMapFloat32IntR, (*decFnInfo).fastpathDecMapFloat32IntR) fn(map[float32]int8(nil), (*encFnInfo).fastpathEncMapFloat32Int8R, (*decFnInfo).fastpathDecMapFloat32Int8R) fn(map[float32]int16(nil), (*encFnInfo).fastpathEncMapFloat32Int16R, (*decFnInfo).fastpathDecMapFloat32Int16R) @@ -160,6 +164,7 @@ func init() { fn(map[float64]uint16(nil), (*encFnInfo).fastpathEncMapFloat64Uint16R, (*decFnInfo).fastpathDecMapFloat64Uint16R) fn(map[float64]uint32(nil), (*encFnInfo).fastpathEncMapFloat64Uint32R, (*decFnInfo).fastpathDecMapFloat64Uint32R) fn(map[float64]uint64(nil), (*encFnInfo).fastpathEncMapFloat64Uint64R, (*decFnInfo).fastpathDecMapFloat64Uint64R) + fn(map[float64]uintptr(nil), (*encFnInfo).fastpathEncMapFloat64UintptrR, (*decFnInfo).fastpathDecMapFloat64UintptrR) fn(map[float64]int(nil), (*encFnInfo).fastpathEncMapFloat64IntR, (*decFnInfo).fastpathDecMapFloat64IntR) fn(map[float64]int8(nil), (*encFnInfo).fastpathEncMapFloat64Int8R, (*decFnInfo).fastpathDecMapFloat64Int8R) fn(map[float64]int16(nil), (*encFnInfo).fastpathEncMapFloat64Int16R, (*decFnInfo).fastpathDecMapFloat64Int16R) @@ -175,6 +180,7 @@ func init() { fn(map[uint]uint16(nil), (*encFnInfo).fastpathEncMapUintUint16R, (*decFnInfo).fastpathDecMapUintUint16R) fn(map[uint]uint32(nil), (*encFnInfo).fastpathEncMapUintUint32R, (*decFnInfo).fastpathDecMapUintUint32R) fn(map[uint]uint64(nil), (*encFnInfo).fastpathEncMapUintUint64R, (*decFnInfo).fastpathDecMapUintUint64R) + fn(map[uint]uintptr(nil), (*encFnInfo).fastpathEncMapUintUintptrR, (*decFnInfo).fastpathDecMapUintUintptrR) fn(map[uint]int(nil), (*encFnInfo).fastpathEncMapUintIntR, (*decFnInfo).fastpathDecMapUintIntR) fn(map[uint]int8(nil), (*encFnInfo).fastpathEncMapUintInt8R, (*decFnInfo).fastpathDecMapUintInt8R) fn(map[uint]int16(nil), (*encFnInfo).fastpathEncMapUintInt16R, (*decFnInfo).fastpathDecMapUintInt16R) @@ -190,6 +196,7 @@ func init() { fn(map[uint8]uint16(nil), (*encFnInfo).fastpathEncMapUint8Uint16R, (*decFnInfo).fastpathDecMapUint8Uint16R) fn(map[uint8]uint32(nil), (*encFnInfo).fastpathEncMapUint8Uint32R, (*decFnInfo).fastpathDecMapUint8Uint32R) fn(map[uint8]uint64(nil), (*encFnInfo).fastpathEncMapUint8Uint64R, (*decFnInfo).fastpathDecMapUint8Uint64R) + fn(map[uint8]uintptr(nil), (*encFnInfo).fastpathEncMapUint8UintptrR, (*decFnInfo).fastpathDecMapUint8UintptrR) fn(map[uint8]int(nil), (*encFnInfo).fastpathEncMapUint8IntR, (*decFnInfo).fastpathDecMapUint8IntR) fn(map[uint8]int8(nil), (*encFnInfo).fastpathEncMapUint8Int8R, (*decFnInfo).fastpathDecMapUint8Int8R) fn(map[uint8]int16(nil), (*encFnInfo).fastpathEncMapUint8Int16R, (*decFnInfo).fastpathDecMapUint8Int16R) @@ -205,6 +212,7 @@ func init() { fn(map[uint16]uint16(nil), (*encFnInfo).fastpathEncMapUint16Uint16R, (*decFnInfo).fastpathDecMapUint16Uint16R) fn(map[uint16]uint32(nil), (*encFnInfo).fastpathEncMapUint16Uint32R, (*decFnInfo).fastpathDecMapUint16Uint32R) fn(map[uint16]uint64(nil), (*encFnInfo).fastpathEncMapUint16Uint64R, (*decFnInfo).fastpathDecMapUint16Uint64R) + fn(map[uint16]uintptr(nil), (*encFnInfo).fastpathEncMapUint16UintptrR, (*decFnInfo).fastpathDecMapUint16UintptrR) fn(map[uint16]int(nil), (*encFnInfo).fastpathEncMapUint16IntR, (*decFnInfo).fastpathDecMapUint16IntR) fn(map[uint16]int8(nil), (*encFnInfo).fastpathEncMapUint16Int8R, (*decFnInfo).fastpathDecMapUint16Int8R) fn(map[uint16]int16(nil), (*encFnInfo).fastpathEncMapUint16Int16R, (*decFnInfo).fastpathDecMapUint16Int16R) @@ -220,6 +228,7 @@ func init() { fn(map[uint32]uint16(nil), (*encFnInfo).fastpathEncMapUint32Uint16R, (*decFnInfo).fastpathDecMapUint32Uint16R) fn(map[uint32]uint32(nil), (*encFnInfo).fastpathEncMapUint32Uint32R, (*decFnInfo).fastpathDecMapUint32Uint32R) fn(map[uint32]uint64(nil), (*encFnInfo).fastpathEncMapUint32Uint64R, (*decFnInfo).fastpathDecMapUint32Uint64R) + fn(map[uint32]uintptr(nil), (*encFnInfo).fastpathEncMapUint32UintptrR, (*decFnInfo).fastpathDecMapUint32UintptrR) fn(map[uint32]int(nil), (*encFnInfo).fastpathEncMapUint32IntR, (*decFnInfo).fastpathDecMapUint32IntR) fn(map[uint32]int8(nil), (*encFnInfo).fastpathEncMapUint32Int8R, (*decFnInfo).fastpathDecMapUint32Int8R) fn(map[uint32]int16(nil), (*encFnInfo).fastpathEncMapUint32Int16R, (*decFnInfo).fastpathDecMapUint32Int16R) @@ -235,6 +244,7 @@ func init() { fn(map[uint64]uint16(nil), (*encFnInfo).fastpathEncMapUint64Uint16R, (*decFnInfo).fastpathDecMapUint64Uint16R) fn(map[uint64]uint32(nil), (*encFnInfo).fastpathEncMapUint64Uint32R, (*decFnInfo).fastpathDecMapUint64Uint32R) fn(map[uint64]uint64(nil), (*encFnInfo).fastpathEncMapUint64Uint64R, (*decFnInfo).fastpathDecMapUint64Uint64R) + fn(map[uint64]uintptr(nil), (*encFnInfo).fastpathEncMapUint64UintptrR, (*decFnInfo).fastpathDecMapUint64UintptrR) fn(map[uint64]int(nil), (*encFnInfo).fastpathEncMapUint64IntR, (*decFnInfo).fastpathDecMapUint64IntR) fn(map[uint64]int8(nil), (*encFnInfo).fastpathEncMapUint64Int8R, (*decFnInfo).fastpathDecMapUint64Int8R) fn(map[uint64]int16(nil), (*encFnInfo).fastpathEncMapUint64Int16R, (*decFnInfo).fastpathDecMapUint64Int16R) @@ -243,6 +253,22 @@ func init() { fn(map[uint64]float32(nil), (*encFnInfo).fastpathEncMapUint64Float32R, (*decFnInfo).fastpathDecMapUint64Float32R) fn(map[uint64]float64(nil), (*encFnInfo).fastpathEncMapUint64Float64R, (*decFnInfo).fastpathDecMapUint64Float64R) fn(map[uint64]bool(nil), (*encFnInfo).fastpathEncMapUint64BoolR, (*decFnInfo).fastpathDecMapUint64BoolR) + fn(map[uintptr]interface{}(nil), (*encFnInfo).fastpathEncMapUintptrIntfR, (*decFnInfo).fastpathDecMapUintptrIntfR) + fn(map[uintptr]string(nil), (*encFnInfo).fastpathEncMapUintptrStringR, (*decFnInfo).fastpathDecMapUintptrStringR) + fn(map[uintptr]uint(nil), (*encFnInfo).fastpathEncMapUintptrUintR, (*decFnInfo).fastpathDecMapUintptrUintR) + fn(map[uintptr]uint8(nil), (*encFnInfo).fastpathEncMapUintptrUint8R, (*decFnInfo).fastpathDecMapUintptrUint8R) + fn(map[uintptr]uint16(nil), (*encFnInfo).fastpathEncMapUintptrUint16R, (*decFnInfo).fastpathDecMapUintptrUint16R) + fn(map[uintptr]uint32(nil), (*encFnInfo).fastpathEncMapUintptrUint32R, (*decFnInfo).fastpathDecMapUintptrUint32R) + fn(map[uintptr]uint64(nil), (*encFnInfo).fastpathEncMapUintptrUint64R, (*decFnInfo).fastpathDecMapUintptrUint64R) + fn(map[uintptr]uintptr(nil), (*encFnInfo).fastpathEncMapUintptrUintptrR, (*decFnInfo).fastpathDecMapUintptrUintptrR) + fn(map[uintptr]int(nil), (*encFnInfo).fastpathEncMapUintptrIntR, (*decFnInfo).fastpathDecMapUintptrIntR) + fn(map[uintptr]int8(nil), (*encFnInfo).fastpathEncMapUintptrInt8R, (*decFnInfo).fastpathDecMapUintptrInt8R) + fn(map[uintptr]int16(nil), (*encFnInfo).fastpathEncMapUintptrInt16R, (*decFnInfo).fastpathDecMapUintptrInt16R) + fn(map[uintptr]int32(nil), (*encFnInfo).fastpathEncMapUintptrInt32R, (*decFnInfo).fastpathDecMapUintptrInt32R) + fn(map[uintptr]int64(nil), (*encFnInfo).fastpathEncMapUintptrInt64R, (*decFnInfo).fastpathDecMapUintptrInt64R) + fn(map[uintptr]float32(nil), (*encFnInfo).fastpathEncMapUintptrFloat32R, (*decFnInfo).fastpathDecMapUintptrFloat32R) + fn(map[uintptr]float64(nil), (*encFnInfo).fastpathEncMapUintptrFloat64R, (*decFnInfo).fastpathDecMapUintptrFloat64R) + fn(map[uintptr]bool(nil), (*encFnInfo).fastpathEncMapUintptrBoolR, (*decFnInfo).fastpathDecMapUintptrBoolR) fn(map[int]interface{}(nil), (*encFnInfo).fastpathEncMapIntIntfR, (*decFnInfo).fastpathDecMapIntIntfR) fn(map[int]string(nil), (*encFnInfo).fastpathEncMapIntStringR, (*decFnInfo).fastpathDecMapIntStringR) fn(map[int]uint(nil), (*encFnInfo).fastpathEncMapIntUintR, (*decFnInfo).fastpathDecMapIntUintR) @@ -250,6 +276,7 @@ func init() { fn(map[int]uint16(nil), (*encFnInfo).fastpathEncMapIntUint16R, (*decFnInfo).fastpathDecMapIntUint16R) fn(map[int]uint32(nil), (*encFnInfo).fastpathEncMapIntUint32R, (*decFnInfo).fastpathDecMapIntUint32R) fn(map[int]uint64(nil), (*encFnInfo).fastpathEncMapIntUint64R, (*decFnInfo).fastpathDecMapIntUint64R) + fn(map[int]uintptr(nil), (*encFnInfo).fastpathEncMapIntUintptrR, (*decFnInfo).fastpathDecMapIntUintptrR) fn(map[int]int(nil), (*encFnInfo).fastpathEncMapIntIntR, (*decFnInfo).fastpathDecMapIntIntR) fn(map[int]int8(nil), (*encFnInfo).fastpathEncMapIntInt8R, (*decFnInfo).fastpathDecMapIntInt8R) fn(map[int]int16(nil), (*encFnInfo).fastpathEncMapIntInt16R, (*decFnInfo).fastpathDecMapIntInt16R) @@ -265,6 +292,7 @@ func init() { fn(map[int8]uint16(nil), (*encFnInfo).fastpathEncMapInt8Uint16R, (*decFnInfo).fastpathDecMapInt8Uint16R) fn(map[int8]uint32(nil), (*encFnInfo).fastpathEncMapInt8Uint32R, (*decFnInfo).fastpathDecMapInt8Uint32R) fn(map[int8]uint64(nil), (*encFnInfo).fastpathEncMapInt8Uint64R, (*decFnInfo).fastpathDecMapInt8Uint64R) + fn(map[int8]uintptr(nil), (*encFnInfo).fastpathEncMapInt8UintptrR, (*decFnInfo).fastpathDecMapInt8UintptrR) fn(map[int8]int(nil), (*encFnInfo).fastpathEncMapInt8IntR, (*decFnInfo).fastpathDecMapInt8IntR) fn(map[int8]int8(nil), (*encFnInfo).fastpathEncMapInt8Int8R, (*decFnInfo).fastpathDecMapInt8Int8R) fn(map[int8]int16(nil), (*encFnInfo).fastpathEncMapInt8Int16R, (*decFnInfo).fastpathDecMapInt8Int16R) @@ -280,6 +308,7 @@ func init() { fn(map[int16]uint16(nil), (*encFnInfo).fastpathEncMapInt16Uint16R, (*decFnInfo).fastpathDecMapInt16Uint16R) fn(map[int16]uint32(nil), (*encFnInfo).fastpathEncMapInt16Uint32R, (*decFnInfo).fastpathDecMapInt16Uint32R) fn(map[int16]uint64(nil), (*encFnInfo).fastpathEncMapInt16Uint64R, (*decFnInfo).fastpathDecMapInt16Uint64R) + fn(map[int16]uintptr(nil), (*encFnInfo).fastpathEncMapInt16UintptrR, (*decFnInfo).fastpathDecMapInt16UintptrR) fn(map[int16]int(nil), (*encFnInfo).fastpathEncMapInt16IntR, (*decFnInfo).fastpathDecMapInt16IntR) fn(map[int16]int8(nil), (*encFnInfo).fastpathEncMapInt16Int8R, (*decFnInfo).fastpathDecMapInt16Int8R) fn(map[int16]int16(nil), (*encFnInfo).fastpathEncMapInt16Int16R, (*decFnInfo).fastpathDecMapInt16Int16R) @@ -295,6 +324,7 @@ func init() { fn(map[int32]uint16(nil), (*encFnInfo).fastpathEncMapInt32Uint16R, (*decFnInfo).fastpathDecMapInt32Uint16R) fn(map[int32]uint32(nil), (*encFnInfo).fastpathEncMapInt32Uint32R, (*decFnInfo).fastpathDecMapInt32Uint32R) fn(map[int32]uint64(nil), (*encFnInfo).fastpathEncMapInt32Uint64R, (*decFnInfo).fastpathDecMapInt32Uint64R) + fn(map[int32]uintptr(nil), (*encFnInfo).fastpathEncMapInt32UintptrR, (*decFnInfo).fastpathDecMapInt32UintptrR) fn(map[int32]int(nil), (*encFnInfo).fastpathEncMapInt32IntR, (*decFnInfo).fastpathDecMapInt32IntR) fn(map[int32]int8(nil), (*encFnInfo).fastpathEncMapInt32Int8R, (*decFnInfo).fastpathDecMapInt32Int8R) fn(map[int32]int16(nil), (*encFnInfo).fastpathEncMapInt32Int16R, (*decFnInfo).fastpathDecMapInt32Int16R) @@ -310,6 +340,7 @@ func init() { fn(map[int64]uint16(nil), (*encFnInfo).fastpathEncMapInt64Uint16R, (*decFnInfo).fastpathDecMapInt64Uint16R) fn(map[int64]uint32(nil), (*encFnInfo).fastpathEncMapInt64Uint32R, (*decFnInfo).fastpathDecMapInt64Uint32R) fn(map[int64]uint64(nil), (*encFnInfo).fastpathEncMapInt64Uint64R, (*decFnInfo).fastpathDecMapInt64Uint64R) + fn(map[int64]uintptr(nil), (*encFnInfo).fastpathEncMapInt64UintptrR, (*decFnInfo).fastpathDecMapInt64UintptrR) fn(map[int64]int(nil), (*encFnInfo).fastpathEncMapInt64IntR, (*decFnInfo).fastpathDecMapInt64IntR) fn(map[int64]int8(nil), (*encFnInfo).fastpathEncMapInt64Int8R, (*decFnInfo).fastpathDecMapInt64Int8R) fn(map[int64]int16(nil), (*encFnInfo).fastpathEncMapInt64Int16R, (*decFnInfo).fastpathDecMapInt64Int16R) @@ -325,6 +356,7 @@ func init() { fn(map[bool]uint16(nil), (*encFnInfo).fastpathEncMapBoolUint16R, (*decFnInfo).fastpathDecMapBoolUint16R) fn(map[bool]uint32(nil), (*encFnInfo).fastpathEncMapBoolUint32R, (*decFnInfo).fastpathDecMapBoolUint32R) fn(map[bool]uint64(nil), (*encFnInfo).fastpathEncMapBoolUint64R, (*decFnInfo).fastpathDecMapBoolUint64R) + fn(map[bool]uintptr(nil), (*encFnInfo).fastpathEncMapBoolUintptrR, (*decFnInfo).fastpathDecMapBoolUintptrR) fn(map[bool]int(nil), (*encFnInfo).fastpathEncMapBoolIntR, (*decFnInfo).fastpathDecMapBoolIntR) fn(map[bool]int8(nil), (*encFnInfo).fastpathEncMapBoolInt8R, (*decFnInfo).fastpathDecMapBoolInt8R) fn(map[bool]int16(nil), (*encFnInfo).fastpathEncMapBoolInt16R, (*decFnInfo).fastpathDecMapBoolInt16R) @@ -383,6 +415,11 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { case *map[interface{}]uint64: fastpathTV.EncMapIntfUint64V(*v, fastpathCheckNilTrue, e) + case map[interface{}]uintptr: + fastpathTV.EncMapIntfUintptrV(v, fastpathCheckNilTrue, e) + case *map[interface{}]uintptr: + fastpathTV.EncMapIntfUintptrV(*v, fastpathCheckNilTrue, e) + case map[interface{}]int: fastpathTV.EncMapIntfIntV(v, fastpathCheckNilTrue, e) case *map[interface{}]int: @@ -463,6 +500,11 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { case *map[string]uint64: fastpathTV.EncMapStringUint64V(*v, fastpathCheckNilTrue, e) + case map[string]uintptr: + fastpathTV.EncMapStringUintptrV(v, fastpathCheckNilTrue, e) + case *map[string]uintptr: + fastpathTV.EncMapStringUintptrV(*v, fastpathCheckNilTrue, e) + case map[string]int: fastpathTV.EncMapStringIntV(v, fastpathCheckNilTrue, e) case *map[string]int: @@ -543,6 +585,11 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { case *map[float32]uint64: fastpathTV.EncMapFloat32Uint64V(*v, fastpathCheckNilTrue, e) + case map[float32]uintptr: + fastpathTV.EncMapFloat32UintptrV(v, fastpathCheckNilTrue, e) + case *map[float32]uintptr: + fastpathTV.EncMapFloat32UintptrV(*v, fastpathCheckNilTrue, e) + case map[float32]int: fastpathTV.EncMapFloat32IntV(v, fastpathCheckNilTrue, e) case *map[float32]int: @@ -623,6 +670,11 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { case *map[float64]uint64: fastpathTV.EncMapFloat64Uint64V(*v, fastpathCheckNilTrue, e) + case map[float64]uintptr: + fastpathTV.EncMapFloat64UintptrV(v, fastpathCheckNilTrue, e) + case *map[float64]uintptr: + fastpathTV.EncMapFloat64UintptrV(*v, fastpathCheckNilTrue, e) + case map[float64]int: fastpathTV.EncMapFloat64IntV(v, fastpathCheckNilTrue, e) case *map[float64]int: @@ -703,6 +755,11 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { case *map[uint]uint64: fastpathTV.EncMapUintUint64V(*v, fastpathCheckNilTrue, e) + case map[uint]uintptr: + fastpathTV.EncMapUintUintptrV(v, fastpathCheckNilTrue, e) + case *map[uint]uintptr: + fastpathTV.EncMapUintUintptrV(*v, fastpathCheckNilTrue, e) + case map[uint]int: fastpathTV.EncMapUintIntV(v, fastpathCheckNilTrue, e) case *map[uint]int: @@ -778,6 +835,11 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { case *map[uint8]uint64: fastpathTV.EncMapUint8Uint64V(*v, fastpathCheckNilTrue, e) + case map[uint8]uintptr: + fastpathTV.EncMapUint8UintptrV(v, fastpathCheckNilTrue, e) + case *map[uint8]uintptr: + fastpathTV.EncMapUint8UintptrV(*v, fastpathCheckNilTrue, e) + case map[uint8]int: fastpathTV.EncMapUint8IntV(v, fastpathCheckNilTrue, e) case *map[uint8]int: @@ -858,6 +920,11 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { case *map[uint16]uint64: fastpathTV.EncMapUint16Uint64V(*v, fastpathCheckNilTrue, e) + case map[uint16]uintptr: + fastpathTV.EncMapUint16UintptrV(v, fastpathCheckNilTrue, e) + case *map[uint16]uintptr: + fastpathTV.EncMapUint16UintptrV(*v, fastpathCheckNilTrue, e) + case map[uint16]int: fastpathTV.EncMapUint16IntV(v, fastpathCheckNilTrue, e) case *map[uint16]int: @@ -938,6 +1005,11 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { case *map[uint32]uint64: fastpathTV.EncMapUint32Uint64V(*v, fastpathCheckNilTrue, e) + case map[uint32]uintptr: + fastpathTV.EncMapUint32UintptrV(v, fastpathCheckNilTrue, e) + case *map[uint32]uintptr: + fastpathTV.EncMapUint32UintptrV(*v, fastpathCheckNilTrue, e) + case map[uint32]int: fastpathTV.EncMapUint32IntV(v, fastpathCheckNilTrue, e) case *map[uint32]int: @@ -1018,6 +1090,11 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { case *map[uint64]uint64: fastpathTV.EncMapUint64Uint64V(*v, fastpathCheckNilTrue, e) + case map[uint64]uintptr: + fastpathTV.EncMapUint64UintptrV(v, fastpathCheckNilTrue, e) + case *map[uint64]uintptr: + fastpathTV.EncMapUint64UintptrV(*v, fastpathCheckNilTrue, e) + case map[uint64]int: fastpathTV.EncMapUint64IntV(v, fastpathCheckNilTrue, e) case *map[uint64]int: @@ -1058,6 +1135,91 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { case *map[uint64]bool: fastpathTV.EncMapUint64BoolV(*v, fastpathCheckNilTrue, e) + case []uintptr: + fastpathTV.EncSliceUintptrV(v, fastpathCheckNilTrue, e) + case *[]uintptr: + fastpathTV.EncSliceUintptrV(*v, fastpathCheckNilTrue, e) + + case map[uintptr]interface{}: + fastpathTV.EncMapUintptrIntfV(v, fastpathCheckNilTrue, e) + case *map[uintptr]interface{}: + fastpathTV.EncMapUintptrIntfV(*v, fastpathCheckNilTrue, e) + + case map[uintptr]string: + fastpathTV.EncMapUintptrStringV(v, fastpathCheckNilTrue, e) + case *map[uintptr]string: + fastpathTV.EncMapUintptrStringV(*v, fastpathCheckNilTrue, e) + + case map[uintptr]uint: + fastpathTV.EncMapUintptrUintV(v, fastpathCheckNilTrue, e) + case *map[uintptr]uint: + fastpathTV.EncMapUintptrUintV(*v, fastpathCheckNilTrue, e) + + case map[uintptr]uint8: + fastpathTV.EncMapUintptrUint8V(v, fastpathCheckNilTrue, e) + case *map[uintptr]uint8: + fastpathTV.EncMapUintptrUint8V(*v, fastpathCheckNilTrue, e) + + case map[uintptr]uint16: + fastpathTV.EncMapUintptrUint16V(v, fastpathCheckNilTrue, e) + case *map[uintptr]uint16: + fastpathTV.EncMapUintptrUint16V(*v, fastpathCheckNilTrue, e) + + case map[uintptr]uint32: + fastpathTV.EncMapUintptrUint32V(v, fastpathCheckNilTrue, e) + case *map[uintptr]uint32: + fastpathTV.EncMapUintptrUint32V(*v, fastpathCheckNilTrue, e) + + case map[uintptr]uint64: + fastpathTV.EncMapUintptrUint64V(v, fastpathCheckNilTrue, e) + case *map[uintptr]uint64: + fastpathTV.EncMapUintptrUint64V(*v, fastpathCheckNilTrue, e) + + case map[uintptr]uintptr: + fastpathTV.EncMapUintptrUintptrV(v, fastpathCheckNilTrue, e) + case *map[uintptr]uintptr: + fastpathTV.EncMapUintptrUintptrV(*v, fastpathCheckNilTrue, e) + + case map[uintptr]int: + fastpathTV.EncMapUintptrIntV(v, fastpathCheckNilTrue, e) + case *map[uintptr]int: + fastpathTV.EncMapUintptrIntV(*v, fastpathCheckNilTrue, e) + + case map[uintptr]int8: + fastpathTV.EncMapUintptrInt8V(v, fastpathCheckNilTrue, e) + case *map[uintptr]int8: + fastpathTV.EncMapUintptrInt8V(*v, fastpathCheckNilTrue, e) + + case map[uintptr]int16: + fastpathTV.EncMapUintptrInt16V(v, fastpathCheckNilTrue, e) + case *map[uintptr]int16: + fastpathTV.EncMapUintptrInt16V(*v, fastpathCheckNilTrue, e) + + case map[uintptr]int32: + fastpathTV.EncMapUintptrInt32V(v, fastpathCheckNilTrue, e) + case *map[uintptr]int32: + fastpathTV.EncMapUintptrInt32V(*v, fastpathCheckNilTrue, e) + + case map[uintptr]int64: + fastpathTV.EncMapUintptrInt64V(v, fastpathCheckNilTrue, e) + case *map[uintptr]int64: + fastpathTV.EncMapUintptrInt64V(*v, fastpathCheckNilTrue, e) + + case map[uintptr]float32: + fastpathTV.EncMapUintptrFloat32V(v, fastpathCheckNilTrue, e) + case *map[uintptr]float32: + fastpathTV.EncMapUintptrFloat32V(*v, fastpathCheckNilTrue, e) + + case map[uintptr]float64: + fastpathTV.EncMapUintptrFloat64V(v, fastpathCheckNilTrue, e) + case *map[uintptr]float64: + fastpathTV.EncMapUintptrFloat64V(*v, fastpathCheckNilTrue, e) + + case map[uintptr]bool: + fastpathTV.EncMapUintptrBoolV(v, fastpathCheckNilTrue, e) + case *map[uintptr]bool: + fastpathTV.EncMapUintptrBoolV(*v, fastpathCheckNilTrue, e) + case []int: fastpathTV.EncSliceIntV(v, fastpathCheckNilTrue, e) case *[]int: @@ -1098,6 +1260,11 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { case *map[int]uint64: fastpathTV.EncMapIntUint64V(*v, fastpathCheckNilTrue, e) + case map[int]uintptr: + fastpathTV.EncMapIntUintptrV(v, fastpathCheckNilTrue, e) + case *map[int]uintptr: + fastpathTV.EncMapIntUintptrV(*v, fastpathCheckNilTrue, e) + case map[int]int: fastpathTV.EncMapIntIntV(v, fastpathCheckNilTrue, e) case *map[int]int: @@ -1178,6 +1345,11 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { case *map[int8]uint64: fastpathTV.EncMapInt8Uint64V(*v, fastpathCheckNilTrue, e) + case map[int8]uintptr: + fastpathTV.EncMapInt8UintptrV(v, fastpathCheckNilTrue, e) + case *map[int8]uintptr: + fastpathTV.EncMapInt8UintptrV(*v, fastpathCheckNilTrue, e) + case map[int8]int: fastpathTV.EncMapInt8IntV(v, fastpathCheckNilTrue, e) case *map[int8]int: @@ -1258,6 +1430,11 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { case *map[int16]uint64: fastpathTV.EncMapInt16Uint64V(*v, fastpathCheckNilTrue, e) + case map[int16]uintptr: + fastpathTV.EncMapInt16UintptrV(v, fastpathCheckNilTrue, e) + case *map[int16]uintptr: + fastpathTV.EncMapInt16UintptrV(*v, fastpathCheckNilTrue, e) + case map[int16]int: fastpathTV.EncMapInt16IntV(v, fastpathCheckNilTrue, e) case *map[int16]int: @@ -1338,6 +1515,11 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { case *map[int32]uint64: fastpathTV.EncMapInt32Uint64V(*v, fastpathCheckNilTrue, e) + case map[int32]uintptr: + fastpathTV.EncMapInt32UintptrV(v, fastpathCheckNilTrue, e) + case *map[int32]uintptr: + fastpathTV.EncMapInt32UintptrV(*v, fastpathCheckNilTrue, e) + case map[int32]int: fastpathTV.EncMapInt32IntV(v, fastpathCheckNilTrue, e) case *map[int32]int: @@ -1418,6 +1600,11 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { case *map[int64]uint64: fastpathTV.EncMapInt64Uint64V(*v, fastpathCheckNilTrue, e) + case map[int64]uintptr: + fastpathTV.EncMapInt64UintptrV(v, fastpathCheckNilTrue, e) + case *map[int64]uintptr: + fastpathTV.EncMapInt64UintptrV(*v, fastpathCheckNilTrue, e) + case map[int64]int: fastpathTV.EncMapInt64IntV(v, fastpathCheckNilTrue, e) case *map[int64]int: @@ -1498,6 +1685,11 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { case *map[bool]uint64: fastpathTV.EncMapBoolUint64V(*v, fastpathCheckNilTrue, e) + case map[bool]uintptr: + fastpathTV.EncMapBoolUintptrV(v, fastpathCheckNilTrue, e) + case *map[bool]uintptr: + fastpathTV.EncMapBoolUintptrV(*v, fastpathCheckNilTrue, e) + case map[bool]int: fastpathTV.EncMapBoolIntV(v, fastpathCheckNilTrue, e) case *map[bool]int: @@ -1587,6 +1779,11 @@ func fastpathEncodeTypeSwitchSlice(iv interface{}, e *Encoder) bool { case *[]uint64: fastpathTV.EncSliceUint64V(*v, fastpathCheckNilTrue, e) + case []uintptr: + fastpathTV.EncSliceUintptrV(v, fastpathCheckNilTrue, e) + case *[]uintptr: + fastpathTV.EncSliceUintptrV(*v, fastpathCheckNilTrue, e) + case []int: fastpathTV.EncSliceIntV(v, fastpathCheckNilTrue, e) case *[]int: @@ -1661,6 +1858,11 @@ func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { case *map[interface{}]uint64: fastpathTV.EncMapIntfUint64V(*v, fastpathCheckNilTrue, e) + case map[interface{}]uintptr: + fastpathTV.EncMapIntfUintptrV(v, fastpathCheckNilTrue, e) + case *map[interface{}]uintptr: + fastpathTV.EncMapIntfUintptrV(*v, fastpathCheckNilTrue, e) + case map[interface{}]int: fastpathTV.EncMapIntfIntV(v, fastpathCheckNilTrue, e) case *map[interface{}]int: @@ -1736,6 +1938,11 @@ func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { case *map[string]uint64: fastpathTV.EncMapStringUint64V(*v, fastpathCheckNilTrue, e) + case map[string]uintptr: + fastpathTV.EncMapStringUintptrV(v, fastpathCheckNilTrue, e) + case *map[string]uintptr: + fastpathTV.EncMapStringUintptrV(*v, fastpathCheckNilTrue, e) + case map[string]int: fastpathTV.EncMapStringIntV(v, fastpathCheckNilTrue, e) case *map[string]int: @@ -1811,6 +2018,11 @@ func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { case *map[float32]uint64: fastpathTV.EncMapFloat32Uint64V(*v, fastpathCheckNilTrue, e) + case map[float32]uintptr: + fastpathTV.EncMapFloat32UintptrV(v, fastpathCheckNilTrue, e) + case *map[float32]uintptr: + fastpathTV.EncMapFloat32UintptrV(*v, fastpathCheckNilTrue, e) + case map[float32]int: fastpathTV.EncMapFloat32IntV(v, fastpathCheckNilTrue, e) case *map[float32]int: @@ -1886,6 +2098,11 @@ func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { case *map[float64]uint64: fastpathTV.EncMapFloat64Uint64V(*v, fastpathCheckNilTrue, e) + case map[float64]uintptr: + fastpathTV.EncMapFloat64UintptrV(v, fastpathCheckNilTrue, e) + case *map[float64]uintptr: + fastpathTV.EncMapFloat64UintptrV(*v, fastpathCheckNilTrue, e) + case map[float64]int: fastpathTV.EncMapFloat64IntV(v, fastpathCheckNilTrue, e) case *map[float64]int: @@ -1961,6 +2178,11 @@ func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { case *map[uint]uint64: fastpathTV.EncMapUintUint64V(*v, fastpathCheckNilTrue, e) + case map[uint]uintptr: + fastpathTV.EncMapUintUintptrV(v, fastpathCheckNilTrue, e) + case *map[uint]uintptr: + fastpathTV.EncMapUintUintptrV(*v, fastpathCheckNilTrue, e) + case map[uint]int: fastpathTV.EncMapUintIntV(v, fastpathCheckNilTrue, e) case *map[uint]int: @@ -2036,6 +2258,11 @@ func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { case *map[uint8]uint64: fastpathTV.EncMapUint8Uint64V(*v, fastpathCheckNilTrue, e) + case map[uint8]uintptr: + fastpathTV.EncMapUint8UintptrV(v, fastpathCheckNilTrue, e) + case *map[uint8]uintptr: + fastpathTV.EncMapUint8UintptrV(*v, fastpathCheckNilTrue, e) + case map[uint8]int: fastpathTV.EncMapUint8IntV(v, fastpathCheckNilTrue, e) case *map[uint8]int: @@ -2111,6 +2338,11 @@ func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { case *map[uint16]uint64: fastpathTV.EncMapUint16Uint64V(*v, fastpathCheckNilTrue, e) + case map[uint16]uintptr: + fastpathTV.EncMapUint16UintptrV(v, fastpathCheckNilTrue, e) + case *map[uint16]uintptr: + fastpathTV.EncMapUint16UintptrV(*v, fastpathCheckNilTrue, e) + case map[uint16]int: fastpathTV.EncMapUint16IntV(v, fastpathCheckNilTrue, e) case *map[uint16]int: @@ -2186,6 +2418,11 @@ func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { case *map[uint32]uint64: fastpathTV.EncMapUint32Uint64V(*v, fastpathCheckNilTrue, e) + case map[uint32]uintptr: + fastpathTV.EncMapUint32UintptrV(v, fastpathCheckNilTrue, e) + case *map[uint32]uintptr: + fastpathTV.EncMapUint32UintptrV(*v, fastpathCheckNilTrue, e) + case map[uint32]int: fastpathTV.EncMapUint32IntV(v, fastpathCheckNilTrue, e) case *map[uint32]int: @@ -2261,6 +2498,11 @@ func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { case *map[uint64]uint64: fastpathTV.EncMapUint64Uint64V(*v, fastpathCheckNilTrue, e) + case map[uint64]uintptr: + fastpathTV.EncMapUint64UintptrV(v, fastpathCheckNilTrue, e) + case *map[uint64]uintptr: + fastpathTV.EncMapUint64UintptrV(*v, fastpathCheckNilTrue, e) + case map[uint64]int: fastpathTV.EncMapUint64IntV(v, fastpathCheckNilTrue, e) case *map[uint64]int: @@ -2301,6 +2543,86 @@ func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { case *map[uint64]bool: fastpathTV.EncMapUint64BoolV(*v, fastpathCheckNilTrue, e) + case map[uintptr]interface{}: + fastpathTV.EncMapUintptrIntfV(v, fastpathCheckNilTrue, e) + case *map[uintptr]interface{}: + fastpathTV.EncMapUintptrIntfV(*v, fastpathCheckNilTrue, e) + + case map[uintptr]string: + fastpathTV.EncMapUintptrStringV(v, fastpathCheckNilTrue, e) + case *map[uintptr]string: + fastpathTV.EncMapUintptrStringV(*v, fastpathCheckNilTrue, e) + + case map[uintptr]uint: + fastpathTV.EncMapUintptrUintV(v, fastpathCheckNilTrue, e) + case *map[uintptr]uint: + fastpathTV.EncMapUintptrUintV(*v, fastpathCheckNilTrue, e) + + case map[uintptr]uint8: + fastpathTV.EncMapUintptrUint8V(v, fastpathCheckNilTrue, e) + case *map[uintptr]uint8: + fastpathTV.EncMapUintptrUint8V(*v, fastpathCheckNilTrue, e) + + case map[uintptr]uint16: + fastpathTV.EncMapUintptrUint16V(v, fastpathCheckNilTrue, e) + case *map[uintptr]uint16: + fastpathTV.EncMapUintptrUint16V(*v, fastpathCheckNilTrue, e) + + case map[uintptr]uint32: + fastpathTV.EncMapUintptrUint32V(v, fastpathCheckNilTrue, e) + case *map[uintptr]uint32: + fastpathTV.EncMapUintptrUint32V(*v, fastpathCheckNilTrue, e) + + case map[uintptr]uint64: + fastpathTV.EncMapUintptrUint64V(v, fastpathCheckNilTrue, e) + case *map[uintptr]uint64: + fastpathTV.EncMapUintptrUint64V(*v, fastpathCheckNilTrue, e) + + case map[uintptr]uintptr: + fastpathTV.EncMapUintptrUintptrV(v, fastpathCheckNilTrue, e) + case *map[uintptr]uintptr: + fastpathTV.EncMapUintptrUintptrV(*v, fastpathCheckNilTrue, e) + + case map[uintptr]int: + fastpathTV.EncMapUintptrIntV(v, fastpathCheckNilTrue, e) + case *map[uintptr]int: + fastpathTV.EncMapUintptrIntV(*v, fastpathCheckNilTrue, e) + + case map[uintptr]int8: + fastpathTV.EncMapUintptrInt8V(v, fastpathCheckNilTrue, e) + case *map[uintptr]int8: + fastpathTV.EncMapUintptrInt8V(*v, fastpathCheckNilTrue, e) + + case map[uintptr]int16: + fastpathTV.EncMapUintptrInt16V(v, fastpathCheckNilTrue, e) + case *map[uintptr]int16: + fastpathTV.EncMapUintptrInt16V(*v, fastpathCheckNilTrue, e) + + case map[uintptr]int32: + fastpathTV.EncMapUintptrInt32V(v, fastpathCheckNilTrue, e) + case *map[uintptr]int32: + fastpathTV.EncMapUintptrInt32V(*v, fastpathCheckNilTrue, e) + + case map[uintptr]int64: + fastpathTV.EncMapUintptrInt64V(v, fastpathCheckNilTrue, e) + case *map[uintptr]int64: + fastpathTV.EncMapUintptrInt64V(*v, fastpathCheckNilTrue, e) + + case map[uintptr]float32: + fastpathTV.EncMapUintptrFloat32V(v, fastpathCheckNilTrue, e) + case *map[uintptr]float32: + fastpathTV.EncMapUintptrFloat32V(*v, fastpathCheckNilTrue, e) + + case map[uintptr]float64: + fastpathTV.EncMapUintptrFloat64V(v, fastpathCheckNilTrue, e) + case *map[uintptr]float64: + fastpathTV.EncMapUintptrFloat64V(*v, fastpathCheckNilTrue, e) + + case map[uintptr]bool: + fastpathTV.EncMapUintptrBoolV(v, fastpathCheckNilTrue, e) + case *map[uintptr]bool: + fastpathTV.EncMapUintptrBoolV(*v, fastpathCheckNilTrue, e) + case map[int]interface{}: fastpathTV.EncMapIntIntfV(v, fastpathCheckNilTrue, e) case *map[int]interface{}: @@ -2336,6 +2658,11 @@ func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { case *map[int]uint64: fastpathTV.EncMapIntUint64V(*v, fastpathCheckNilTrue, e) + case map[int]uintptr: + fastpathTV.EncMapIntUintptrV(v, fastpathCheckNilTrue, e) + case *map[int]uintptr: + fastpathTV.EncMapIntUintptrV(*v, fastpathCheckNilTrue, e) + case map[int]int: fastpathTV.EncMapIntIntV(v, fastpathCheckNilTrue, e) case *map[int]int: @@ -2411,6 +2738,11 @@ func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { case *map[int8]uint64: fastpathTV.EncMapInt8Uint64V(*v, fastpathCheckNilTrue, e) + case map[int8]uintptr: + fastpathTV.EncMapInt8UintptrV(v, fastpathCheckNilTrue, e) + case *map[int8]uintptr: + fastpathTV.EncMapInt8UintptrV(*v, fastpathCheckNilTrue, e) + case map[int8]int: fastpathTV.EncMapInt8IntV(v, fastpathCheckNilTrue, e) case *map[int8]int: @@ -2486,6 +2818,11 @@ func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { case *map[int16]uint64: fastpathTV.EncMapInt16Uint64V(*v, fastpathCheckNilTrue, e) + case map[int16]uintptr: + fastpathTV.EncMapInt16UintptrV(v, fastpathCheckNilTrue, e) + case *map[int16]uintptr: + fastpathTV.EncMapInt16UintptrV(*v, fastpathCheckNilTrue, e) + case map[int16]int: fastpathTV.EncMapInt16IntV(v, fastpathCheckNilTrue, e) case *map[int16]int: @@ -2561,6 +2898,11 @@ func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { case *map[int32]uint64: fastpathTV.EncMapInt32Uint64V(*v, fastpathCheckNilTrue, e) + case map[int32]uintptr: + fastpathTV.EncMapInt32UintptrV(v, fastpathCheckNilTrue, e) + case *map[int32]uintptr: + fastpathTV.EncMapInt32UintptrV(*v, fastpathCheckNilTrue, e) + case map[int32]int: fastpathTV.EncMapInt32IntV(v, fastpathCheckNilTrue, e) case *map[int32]int: @@ -2636,6 +2978,11 @@ func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { case *map[int64]uint64: fastpathTV.EncMapInt64Uint64V(*v, fastpathCheckNilTrue, e) + case map[int64]uintptr: + fastpathTV.EncMapInt64UintptrV(v, fastpathCheckNilTrue, e) + case *map[int64]uintptr: + fastpathTV.EncMapInt64UintptrV(*v, fastpathCheckNilTrue, e) + case map[int64]int: fastpathTV.EncMapInt64IntV(v, fastpathCheckNilTrue, e) case *map[int64]int: @@ -2711,6 +3058,11 @@ func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { case *map[bool]uint64: fastpathTV.EncMapBoolUint64V(*v, fastpathCheckNilTrue, e) + case map[bool]uintptr: + fastpathTV.EncMapBoolUintptrV(v, fastpathCheckNilTrue, e) + case *map[bool]uintptr: + fastpathTV.EncMapBoolUintptrV(*v, fastpathCheckNilTrue, e) + case map[bool]int: fastpathTV.EncMapBoolIntV(v, fastpathCheckNilTrue, e) case *map[bool]int: @@ -2752,6 +3104,7 @@ func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { fastpathTV.EncMapBoolBoolV(*v, fastpathCheckNilTrue, e) default: + _ = v // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release) return false } return true @@ -2887,6 +3240,22 @@ func (_ fastpathT) EncSliceUint64V(v []uint64, checkNil bool, e *Encoder) { ee.EncodeEnd() } +func (f *encFnInfo) fastpathEncSliceUintptrR(rv reflect.Value) { + fastpathTV.EncSliceUintptrV(rv.Interface().([]uintptr), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncSliceUintptrV(v []uintptr, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeArrayStart(len(v)) + for _, v2 := range v { + e.encode(v2) + } + ee.EncodeEnd() +} + func (f *encFnInfo) fastpathEncSliceIntR(rv reflect.Value) { fastpathTV.EncSliceIntV(rv.Interface().([]int), fastpathCheckNilFalse, f.e) } @@ -2993,10 +3362,30 @@ func (_ fastpathT) EncMapIntfIntfV(v map[interface{}]interface{}, checkNil bool, return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - e.encode(k2) - e.encode(v2) + if e.h.Canonical { + var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding + e2 := NewEncoderBytes(&mksv, e.hh) + v2 := make([]bytesI, len(v)) + var i, l int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + e.asis(v2[j].v) + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + e.encode(k2) + e.encode(v2) + } } ee.EncodeEnd() } @@ -3011,10 +3400,30 @@ func (_ fastpathT) EncMapIntfStringV(v map[interface{}]string, checkNil bool, e return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - e.encode(k2) - ee.EncodeString(c_UTF8, v2) + if e.h.Canonical { + var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding + e2 := NewEncoderBytes(&mksv, e.hh) + v2 := make([]bytesI, len(v)) + var i, l int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + e.asis(v2[j].v) + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeString(c_UTF8, v2) + } } ee.EncodeEnd() } @@ -3029,10 +3438,30 @@ func (_ fastpathT) EncMapIntfUintV(v map[interface{}]uint, checkNil bool, e *Enc return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - e.encode(k2) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding + e2 := NewEncoderBytes(&mksv, e.hh) + v2 := make([]bytesI, len(v)) + var i, l int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + e.asis(v2[j].v) + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -3047,10 +3476,30 @@ func (_ fastpathT) EncMapIntfUint8V(v map[interface{}]uint8, checkNil bool, e *E return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - e.encode(k2) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding + e2 := NewEncoderBytes(&mksv, e.hh) + v2 := make([]bytesI, len(v)) + var i, l int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + e.asis(v2[j].v) + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -3065,10 +3514,30 @@ func (_ fastpathT) EncMapIntfUint16V(v map[interface{}]uint16, checkNil bool, e return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - e.encode(k2) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding + e2 := NewEncoderBytes(&mksv, e.hh) + v2 := make([]bytesI, len(v)) + var i, l int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + e.asis(v2[j].v) + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -3083,10 +3552,30 @@ func (_ fastpathT) EncMapIntfUint32V(v map[interface{}]uint32, checkNil bool, e return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - e.encode(k2) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding + e2 := NewEncoderBytes(&mksv, e.hh) + v2 := make([]bytesI, len(v)) + var i, l int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + e.asis(v2[j].v) + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -3101,10 +3590,68 @@ func (_ fastpathT) EncMapIntfUint64V(v map[interface{}]uint64, checkNil bool, e return } ee.EncodeMapStart(len(v)) + if e.h.Canonical { + var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding + e2 := NewEncoderBytes(&mksv, e.hh) + v2 := make([]bytesI, len(v)) + var i, l int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + e.asis(v2[j].v) + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeUint(uint64(v2)) + } + } + ee.EncodeEnd() +} - for k2, v2 := range v { - e.encode(k2) - ee.EncodeUint(uint64(v2)) +func (f *encFnInfo) fastpathEncMapIntfUintptrR(rv reflect.Value) { + fastpathTV.EncMapIntfUintptrV(rv.Interface().(map[interface{}]uintptr), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapIntfUintptrV(v map[interface{}]uintptr, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding + e2 := NewEncoderBytes(&mksv, e.hh) + v2 := make([]bytesI, len(v)) + var i, l int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + e.asis(v2[j].v) + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + e.encode(k2) + e.encode(v2) + } } ee.EncodeEnd() } @@ -3119,10 +3666,30 @@ func (_ fastpathT) EncMapIntfIntV(v map[interface{}]int, checkNil bool, e *Encod return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - e.encode(k2) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding + e2 := NewEncoderBytes(&mksv, e.hh) + v2 := make([]bytesI, len(v)) + var i, l int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + e.asis(v2[j].v) + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -3137,10 +3704,30 @@ func (_ fastpathT) EncMapIntfInt8V(v map[interface{}]int8, checkNil bool, e *Enc return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - e.encode(k2) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding + e2 := NewEncoderBytes(&mksv, e.hh) + v2 := make([]bytesI, len(v)) + var i, l int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + e.asis(v2[j].v) + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -3155,10 +3742,30 @@ func (_ fastpathT) EncMapIntfInt16V(v map[interface{}]int16, checkNil bool, e *E return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - e.encode(k2) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding + e2 := NewEncoderBytes(&mksv, e.hh) + v2 := make([]bytesI, len(v)) + var i, l int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + e.asis(v2[j].v) + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -3173,10 +3780,30 @@ func (_ fastpathT) EncMapIntfInt32V(v map[interface{}]int32, checkNil bool, e *E return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - e.encode(k2) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding + e2 := NewEncoderBytes(&mksv, e.hh) + v2 := make([]bytesI, len(v)) + var i, l int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + e.asis(v2[j].v) + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -3191,10 +3818,30 @@ func (_ fastpathT) EncMapIntfInt64V(v map[interface{}]int64, checkNil bool, e *E return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - e.encode(k2) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding + e2 := NewEncoderBytes(&mksv, e.hh) + v2 := make([]bytesI, len(v)) + var i, l int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + e.asis(v2[j].v) + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -3209,10 +3856,30 @@ func (_ fastpathT) EncMapIntfFloat32V(v map[interface{}]float32, checkNil bool, return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - e.encode(k2) - ee.EncodeFloat32(v2) + if e.h.Canonical { + var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding + e2 := NewEncoderBytes(&mksv, e.hh) + v2 := make([]bytesI, len(v)) + var i, l int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + e.asis(v2[j].v) + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeFloat32(v2) + } } ee.EncodeEnd() } @@ -3227,10 +3894,30 @@ func (_ fastpathT) EncMapIntfFloat64V(v map[interface{}]float64, checkNil bool, return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - e.encode(k2) - ee.EncodeFloat64(v2) + if e.h.Canonical { + var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding + e2 := NewEncoderBytes(&mksv, e.hh) + v2 := make([]bytesI, len(v)) + var i, l int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + e.asis(v2[j].v) + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeFloat64(v2) + } } ee.EncodeEnd() } @@ -3245,10 +3932,30 @@ func (_ fastpathT) EncMapIntfBoolV(v map[interface{}]bool, checkNil bool, e *Enc return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - e.encode(k2) - ee.EncodeBool(v2) + if e.h.Canonical { + var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding + e2 := NewEncoderBytes(&mksv, e.hh) + v2 := make([]bytesI, len(v)) + var i, l int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + e.asis(v2[j].v) + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeBool(v2) + } } ee.EncodeEnd() } @@ -3264,13 +3971,31 @@ func (_ fastpathT) EncMapStringIntfV(v map[string]interface{}, checkNil bool, e } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + e.encode(v[string(k2)]) + } + } else { + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + e.encode(v2) } - e.encode(v2) } ee.EncodeEnd() } @@ -3286,13 +4011,31 @@ func (_ fastpathT) EncMapStringStringV(v map[string]string, checkNil bool, e *En } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeString(c_UTF8, v[string(k2)]) + } + } else { + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeString(c_UTF8, v2) } - ee.EncodeString(c_UTF8, v2) } ee.EncodeEnd() } @@ -3308,13 +4051,31 @@ func (_ fastpathT) EncMapStringUintV(v map[string]uint, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeUint(uint64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeUint(uint64(v2)) } - ee.EncodeUint(uint64(v2)) } ee.EncodeEnd() } @@ -3330,13 +4091,31 @@ func (_ fastpathT) EncMapStringUint8V(v map[string]uint8, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeUint(uint64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeUint(uint64(v2)) } - ee.EncodeUint(uint64(v2)) } ee.EncodeEnd() } @@ -3352,13 +4131,31 @@ func (_ fastpathT) EncMapStringUint16V(v map[string]uint16, checkNil bool, e *En } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeUint(uint64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeUint(uint64(v2)) } - ee.EncodeUint(uint64(v2)) } ee.EncodeEnd() } @@ -3374,13 +4171,31 @@ func (_ fastpathT) EncMapStringUint32V(v map[string]uint32, checkNil bool, e *En } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeUint(uint64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeUint(uint64(v2)) } - ee.EncodeUint(uint64(v2)) } ee.EncodeEnd() } @@ -3396,13 +4211,71 @@ func (_ fastpathT) EncMapStringUint64V(v map[string]uint64, checkNil bool, e *En } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeUint(uint64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeUint(uint64(v2)) + } + } + ee.EncodeEnd() +} + +func (f *encFnInfo) fastpathEncMapStringUintptrR(rv reflect.Value) { + fastpathTV.EncMapStringUintptrV(rv.Interface().(map[string]uintptr), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapStringUintptrV(v map[string]uintptr, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + e.encode(v[string(k2)]) + } + } else { + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + e.encode(v2) } - ee.EncodeUint(uint64(v2)) } ee.EncodeEnd() } @@ -3418,13 +4291,31 @@ func (_ fastpathT) EncMapStringIntV(v map[string]int, checkNil bool, e *Encoder) } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeInt(int64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeInt(int64(v2)) } - ee.EncodeInt(int64(v2)) } ee.EncodeEnd() } @@ -3440,13 +4331,31 @@ func (_ fastpathT) EncMapStringInt8V(v map[string]int8, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeInt(int64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeInt(int64(v2)) } - ee.EncodeInt(int64(v2)) } ee.EncodeEnd() } @@ -3462,13 +4371,31 @@ func (_ fastpathT) EncMapStringInt16V(v map[string]int16, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeInt(int64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeInt(int64(v2)) } - ee.EncodeInt(int64(v2)) } ee.EncodeEnd() } @@ -3484,13 +4411,31 @@ func (_ fastpathT) EncMapStringInt32V(v map[string]int32, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeInt(int64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeInt(int64(v2)) } - ee.EncodeInt(int64(v2)) } ee.EncodeEnd() } @@ -3506,13 +4451,31 @@ func (_ fastpathT) EncMapStringInt64V(v map[string]int64, checkNil bool, e *Enco } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeInt(int64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeInt(int64(v2)) } - ee.EncodeInt(int64(v2)) } ee.EncodeEnd() } @@ -3528,13 +4491,31 @@ func (_ fastpathT) EncMapStringFloat32V(v map[string]float32, checkNil bool, e * } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeFloat32(v[string(k2)]) + } + } else { + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeFloat32(v2) } - ee.EncodeFloat32(v2) } ee.EncodeEnd() } @@ -3550,13 +4531,31 @@ func (_ fastpathT) EncMapStringFloat64V(v map[string]float64, checkNil bool, e * } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeFloat64(v[string(k2)]) + } + } else { + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeFloat64(v2) } - ee.EncodeFloat64(v2) } ee.EncodeEnd() } @@ -3572,13 +4571,31 @@ func (_ fastpathT) EncMapStringBoolV(v map[string]bool, checkNil bool, e *Encode } ee.EncodeMapStart(len(v)) asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - for k2, v2 := range v { - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeBool(v[string(k2)]) + } + } else { + for k2, v2 := range v { + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + } + ee.EncodeBool(v2) } - ee.EncodeBool(v2) } ee.EncodeEnd() } @@ -3593,10 +4610,23 @@ func (_ fastpathT) EncMapFloat32IntfV(v map[float32]interface{}, checkNil bool, return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat32(k2) - e.encode(v2) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat32(float32(k2)) + e.encode(v[float32(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat32(k2) + e.encode(v2) + } } ee.EncodeEnd() } @@ -3611,10 +4641,23 @@ func (_ fastpathT) EncMapFloat32StringV(v map[float32]string, checkNil bool, e * return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeString(c_UTF8, v2) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat32(float32(k2)) + ee.EncodeString(c_UTF8, v[float32(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeString(c_UTF8, v2) + } } ee.EncodeEnd() } @@ -3629,10 +4672,23 @@ func (_ fastpathT) EncMapFloat32UintV(v map[float32]uint, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat32(float32(k2)) + ee.EncodeUint(uint64(v[float32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -3647,10 +4703,23 @@ func (_ fastpathT) EncMapFloat32Uint8V(v map[float32]uint8, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat32(float32(k2)) + ee.EncodeUint(uint64(v[float32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -3665,10 +4734,23 @@ func (_ fastpathT) EncMapFloat32Uint16V(v map[float32]uint16, checkNil bool, e * return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat32(float32(k2)) + ee.EncodeUint(uint64(v[float32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -3683,10 +4765,23 @@ func (_ fastpathT) EncMapFloat32Uint32V(v map[float32]uint32, checkNil bool, e * return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat32(float32(k2)) + ee.EncodeUint(uint64(v[float32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -3701,10 +4796,54 @@ func (_ fastpathT) EncMapFloat32Uint64V(v map[float32]uint64, checkNil bool, e * return } ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat32(float32(k2)) + ee.EncodeUint(uint64(v[float32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeUint(uint64(v2)) + } + } + ee.EncodeEnd() +} - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeUint(uint64(v2)) +func (f *encFnInfo) fastpathEncMapFloat32UintptrR(rv reflect.Value) { + fastpathTV.EncMapFloat32UintptrV(rv.Interface().(map[float32]uintptr), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapFloat32UintptrV(v map[float32]uintptr, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat32(float32(k2)) + e.encode(v[float32(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat32(k2) + e.encode(v2) + } } ee.EncodeEnd() } @@ -3719,10 +4858,23 @@ func (_ fastpathT) EncMapFloat32IntV(v map[float32]int, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat32(float32(k2)) + ee.EncodeInt(int64(v[float32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -3737,10 +4889,23 @@ func (_ fastpathT) EncMapFloat32Int8V(v map[float32]int8, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat32(float32(k2)) + ee.EncodeInt(int64(v[float32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -3755,10 +4920,23 @@ func (_ fastpathT) EncMapFloat32Int16V(v map[float32]int16, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat32(float32(k2)) + ee.EncodeInt(int64(v[float32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -3773,10 +4951,23 @@ func (_ fastpathT) EncMapFloat32Int32V(v map[float32]int32, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat32(float32(k2)) + ee.EncodeInt(int64(v[float32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -3791,10 +4982,23 @@ func (_ fastpathT) EncMapFloat32Int64V(v map[float32]int64, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat32(float32(k2)) + ee.EncodeInt(int64(v[float32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -3809,10 +5013,23 @@ func (_ fastpathT) EncMapFloat32Float32V(v map[float32]float32, checkNil bool, e return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeFloat32(v2) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat32(float32(k2)) + ee.EncodeFloat32(v[float32(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeFloat32(v2) + } } ee.EncodeEnd() } @@ -3827,10 +5044,23 @@ func (_ fastpathT) EncMapFloat32Float64V(v map[float32]float64, checkNil bool, e return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeFloat64(v2) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat32(float32(k2)) + ee.EncodeFloat64(v[float32(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeFloat64(v2) + } } ee.EncodeEnd() } @@ -3845,10 +5075,23 @@ func (_ fastpathT) EncMapFloat32BoolV(v map[float32]bool, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeBool(v2) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat32(float32(k2)) + ee.EncodeBool(v[float32(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat32(k2) + ee.EncodeBool(v2) + } } ee.EncodeEnd() } @@ -3863,10 +5106,23 @@ func (_ fastpathT) EncMapFloat64IntfV(v map[float64]interface{}, checkNil bool, return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat64(k2) - e.encode(v2) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat64(float64(k2)) + e.encode(v[float64(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat64(k2) + e.encode(v2) + } } ee.EncodeEnd() } @@ -3881,10 +5137,23 @@ func (_ fastpathT) EncMapFloat64StringV(v map[float64]string, checkNil bool, e * return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeString(c_UTF8, v2) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat64(float64(k2)) + ee.EncodeString(c_UTF8, v[float64(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeString(c_UTF8, v2) + } } ee.EncodeEnd() } @@ -3899,10 +5168,23 @@ func (_ fastpathT) EncMapFloat64UintV(v map[float64]uint, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat64(float64(k2)) + ee.EncodeUint(uint64(v[float64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -3917,10 +5199,23 @@ func (_ fastpathT) EncMapFloat64Uint8V(v map[float64]uint8, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat64(float64(k2)) + ee.EncodeUint(uint64(v[float64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -3935,10 +5230,23 @@ func (_ fastpathT) EncMapFloat64Uint16V(v map[float64]uint16, checkNil bool, e * return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat64(float64(k2)) + ee.EncodeUint(uint64(v[float64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -3953,10 +5261,23 @@ func (_ fastpathT) EncMapFloat64Uint32V(v map[float64]uint32, checkNil bool, e * return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat64(float64(k2)) + ee.EncodeUint(uint64(v[float64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -3971,10 +5292,54 @@ func (_ fastpathT) EncMapFloat64Uint64V(v map[float64]uint64, checkNil bool, e * return } ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat64(float64(k2)) + ee.EncodeUint(uint64(v[float64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeUint(uint64(v2)) + } + } + ee.EncodeEnd() +} - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeUint(uint64(v2)) +func (f *encFnInfo) fastpathEncMapFloat64UintptrR(rv reflect.Value) { + fastpathTV.EncMapFloat64UintptrV(rv.Interface().(map[float64]uintptr), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapFloat64UintptrV(v map[float64]uintptr, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat64(float64(k2)) + e.encode(v[float64(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat64(k2) + e.encode(v2) + } } ee.EncodeEnd() } @@ -3989,10 +5354,23 @@ func (_ fastpathT) EncMapFloat64IntV(v map[float64]int, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat64(float64(k2)) + ee.EncodeInt(int64(v[float64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -4007,10 +5385,23 @@ func (_ fastpathT) EncMapFloat64Int8V(v map[float64]int8, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat64(float64(k2)) + ee.EncodeInt(int64(v[float64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -4025,10 +5416,23 @@ func (_ fastpathT) EncMapFloat64Int16V(v map[float64]int16, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat64(float64(k2)) + ee.EncodeInt(int64(v[float64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -4043,10 +5447,23 @@ func (_ fastpathT) EncMapFloat64Int32V(v map[float64]int32, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat64(float64(k2)) + ee.EncodeInt(int64(v[float64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -4061,10 +5478,23 @@ func (_ fastpathT) EncMapFloat64Int64V(v map[float64]int64, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat64(float64(k2)) + ee.EncodeInt(int64(v[float64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -4079,10 +5509,23 @@ func (_ fastpathT) EncMapFloat64Float32V(v map[float64]float32, checkNil bool, e return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeFloat32(v2) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat64(float64(k2)) + ee.EncodeFloat32(v[float64(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeFloat32(v2) + } } ee.EncodeEnd() } @@ -4097,10 +5540,23 @@ func (_ fastpathT) EncMapFloat64Float64V(v map[float64]float64, checkNil bool, e return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeFloat64(v2) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat64(float64(k2)) + ee.EncodeFloat64(v[float64(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeFloat64(v2) + } } ee.EncodeEnd() } @@ -4115,10 +5571,23 @@ func (_ fastpathT) EncMapFloat64BoolV(v map[float64]bool, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeBool(v2) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i int + for k, _ := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + ee.EncodeFloat64(float64(k2)) + ee.EncodeBool(v[float64(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeFloat64(k2) + ee.EncodeBool(v2) + } } ee.EncodeEnd() } @@ -4133,10 +5602,23 @@ func (_ fastpathT) EncMapUintIntfV(v map[uint]interface{}, checkNil bool, e *Enc return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - e.encode(v2) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint(k2))) + e.encode(v[uint(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + e.encode(v2) + } } ee.EncodeEnd() } @@ -4151,10 +5633,23 @@ func (_ fastpathT) EncMapUintStringV(v map[uint]string, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeString(c_UTF8, v2) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint(k2))) + ee.EncodeString(c_UTF8, v[uint(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeString(c_UTF8, v2) + } } ee.EncodeEnd() } @@ -4169,10 +5664,23 @@ func (_ fastpathT) EncMapUintUintV(v map[uint]uint, checkNil bool, e *Encoder) { return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint(k2))) + ee.EncodeUint(uint64(v[uint(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -4187,10 +5695,23 @@ func (_ fastpathT) EncMapUintUint8V(v map[uint]uint8, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint(k2))) + ee.EncodeUint(uint64(v[uint(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -4205,10 +5726,23 @@ func (_ fastpathT) EncMapUintUint16V(v map[uint]uint16, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint(k2))) + ee.EncodeUint(uint64(v[uint(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -4223,10 +5757,23 @@ func (_ fastpathT) EncMapUintUint32V(v map[uint]uint32, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint(k2))) + ee.EncodeUint(uint64(v[uint(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -4241,10 +5788,54 @@ func (_ fastpathT) EncMapUintUint64V(v map[uint]uint64, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint(k2))) + ee.EncodeUint(uint64(v[uint(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) + } + } + ee.EncodeEnd() +} - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) +func (f *encFnInfo) fastpathEncMapUintUintptrR(rv reflect.Value) { + fastpathTV.EncMapUintUintptrV(rv.Interface().(map[uint]uintptr), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapUintUintptrV(v map[uint]uintptr, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint(k2))) + e.encode(v[uint(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + e.encode(v2) + } } ee.EncodeEnd() } @@ -4259,10 +5850,23 @@ func (_ fastpathT) EncMapUintIntV(v map[uint]int, checkNil bool, e *Encoder) { return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint(k2))) + ee.EncodeInt(int64(v[uint(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -4277,10 +5881,23 @@ func (_ fastpathT) EncMapUintInt8V(v map[uint]int8, checkNil bool, e *Encoder) { return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint(k2))) + ee.EncodeInt(int64(v[uint(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -4295,10 +5912,23 @@ func (_ fastpathT) EncMapUintInt16V(v map[uint]int16, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint(k2))) + ee.EncodeInt(int64(v[uint(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -4313,10 +5943,23 @@ func (_ fastpathT) EncMapUintInt32V(v map[uint]int32, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint(k2))) + ee.EncodeInt(int64(v[uint(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -4331,10 +5974,23 @@ func (_ fastpathT) EncMapUintInt64V(v map[uint]int64, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint(k2))) + ee.EncodeInt(int64(v[uint(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -4349,10 +6005,23 @@ func (_ fastpathT) EncMapUintFloat32V(v map[uint]float32, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat32(v2) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint(k2))) + ee.EncodeFloat32(v[uint(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeFloat32(v2) + } } ee.EncodeEnd() } @@ -4367,10 +6036,23 @@ func (_ fastpathT) EncMapUintFloat64V(v map[uint]float64, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat64(v2) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint(k2))) + ee.EncodeFloat64(v[uint(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeFloat64(v2) + } } ee.EncodeEnd() } @@ -4385,10 +6067,23 @@ func (_ fastpathT) EncMapUintBoolV(v map[uint]bool, checkNil bool, e *Encoder) { return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeBool(v2) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint(k2))) + ee.EncodeBool(v[uint(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeBool(v2) + } } ee.EncodeEnd() } @@ -4403,10 +6098,23 @@ func (_ fastpathT) EncMapUint8IntfV(v map[uint8]interface{}, checkNil bool, e *E return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - e.encode(v2) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint8(k2))) + e.encode(v[uint8(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + e.encode(v2) + } } ee.EncodeEnd() } @@ -4421,10 +6129,23 @@ func (_ fastpathT) EncMapUint8StringV(v map[uint8]string, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeString(c_UTF8, v2) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint8(k2))) + ee.EncodeString(c_UTF8, v[uint8(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeString(c_UTF8, v2) + } } ee.EncodeEnd() } @@ -4439,10 +6160,23 @@ func (_ fastpathT) EncMapUint8UintV(v map[uint8]uint, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint8(k2))) + ee.EncodeUint(uint64(v[uint8(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -4457,10 +6191,23 @@ func (_ fastpathT) EncMapUint8Uint8V(v map[uint8]uint8, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint8(k2))) + ee.EncodeUint(uint64(v[uint8(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -4475,10 +6222,23 @@ func (_ fastpathT) EncMapUint8Uint16V(v map[uint8]uint16, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint8(k2))) + ee.EncodeUint(uint64(v[uint8(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -4493,10 +6253,23 @@ func (_ fastpathT) EncMapUint8Uint32V(v map[uint8]uint32, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint8(k2))) + ee.EncodeUint(uint64(v[uint8(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -4511,10 +6284,54 @@ func (_ fastpathT) EncMapUint8Uint64V(v map[uint8]uint64, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint8(k2))) + ee.EncodeUint(uint64(v[uint8(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) + } + } + ee.EncodeEnd() +} - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) +func (f *encFnInfo) fastpathEncMapUint8UintptrR(rv reflect.Value) { + fastpathTV.EncMapUint8UintptrV(rv.Interface().(map[uint8]uintptr), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapUint8UintptrV(v map[uint8]uintptr, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint8(k2))) + e.encode(v[uint8(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + e.encode(v2) + } } ee.EncodeEnd() } @@ -4529,10 +6346,23 @@ func (_ fastpathT) EncMapUint8IntV(v map[uint8]int, checkNil bool, e *Encoder) { return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint8(k2))) + ee.EncodeInt(int64(v[uint8(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -4547,10 +6377,23 @@ func (_ fastpathT) EncMapUint8Int8V(v map[uint8]int8, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint8(k2))) + ee.EncodeInt(int64(v[uint8(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -4565,10 +6408,23 @@ func (_ fastpathT) EncMapUint8Int16V(v map[uint8]int16, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint8(k2))) + ee.EncodeInt(int64(v[uint8(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -4583,10 +6439,23 @@ func (_ fastpathT) EncMapUint8Int32V(v map[uint8]int32, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint8(k2))) + ee.EncodeInt(int64(v[uint8(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -4601,10 +6470,23 @@ func (_ fastpathT) EncMapUint8Int64V(v map[uint8]int64, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint8(k2))) + ee.EncodeInt(int64(v[uint8(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -4619,10 +6501,23 @@ func (_ fastpathT) EncMapUint8Float32V(v map[uint8]float32, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat32(v2) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint8(k2))) + ee.EncodeFloat32(v[uint8(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeFloat32(v2) + } } ee.EncodeEnd() } @@ -4637,10 +6532,23 @@ func (_ fastpathT) EncMapUint8Float64V(v map[uint8]float64, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat64(v2) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint8(k2))) + ee.EncodeFloat64(v[uint8(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeFloat64(v2) + } } ee.EncodeEnd() } @@ -4655,10 +6563,23 @@ func (_ fastpathT) EncMapUint8BoolV(v map[uint8]bool, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeBool(v2) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint8(k2))) + ee.EncodeBool(v[uint8(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeBool(v2) + } } ee.EncodeEnd() } @@ -4673,10 +6594,23 @@ func (_ fastpathT) EncMapUint16IntfV(v map[uint16]interface{}, checkNil bool, e return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - e.encode(v2) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint16(k2))) + e.encode(v[uint16(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + e.encode(v2) + } } ee.EncodeEnd() } @@ -4691,10 +6625,23 @@ func (_ fastpathT) EncMapUint16StringV(v map[uint16]string, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeString(c_UTF8, v2) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint16(k2))) + ee.EncodeString(c_UTF8, v[uint16(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeString(c_UTF8, v2) + } } ee.EncodeEnd() } @@ -4709,10 +6656,23 @@ func (_ fastpathT) EncMapUint16UintV(v map[uint16]uint, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint16(k2))) + ee.EncodeUint(uint64(v[uint16(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -4727,10 +6687,23 @@ func (_ fastpathT) EncMapUint16Uint8V(v map[uint16]uint8, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint16(k2))) + ee.EncodeUint(uint64(v[uint16(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -4745,10 +6718,23 @@ func (_ fastpathT) EncMapUint16Uint16V(v map[uint16]uint16, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint16(k2))) + ee.EncodeUint(uint64(v[uint16(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -4763,10 +6749,23 @@ func (_ fastpathT) EncMapUint16Uint32V(v map[uint16]uint32, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint16(k2))) + ee.EncodeUint(uint64(v[uint16(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -4781,10 +6780,54 @@ func (_ fastpathT) EncMapUint16Uint64V(v map[uint16]uint64, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint16(k2))) + ee.EncodeUint(uint64(v[uint16(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) + } + } + ee.EncodeEnd() +} - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) +func (f *encFnInfo) fastpathEncMapUint16UintptrR(rv reflect.Value) { + fastpathTV.EncMapUint16UintptrV(rv.Interface().(map[uint16]uintptr), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapUint16UintptrV(v map[uint16]uintptr, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint16(k2))) + e.encode(v[uint16(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + e.encode(v2) + } } ee.EncodeEnd() } @@ -4799,10 +6842,23 @@ func (_ fastpathT) EncMapUint16IntV(v map[uint16]int, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint16(k2))) + ee.EncodeInt(int64(v[uint16(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -4817,10 +6873,23 @@ func (_ fastpathT) EncMapUint16Int8V(v map[uint16]int8, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint16(k2))) + ee.EncodeInt(int64(v[uint16(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -4835,10 +6904,23 @@ func (_ fastpathT) EncMapUint16Int16V(v map[uint16]int16, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint16(k2))) + ee.EncodeInt(int64(v[uint16(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -4853,10 +6935,23 @@ func (_ fastpathT) EncMapUint16Int32V(v map[uint16]int32, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint16(k2))) + ee.EncodeInt(int64(v[uint16(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -4871,10 +6966,23 @@ func (_ fastpathT) EncMapUint16Int64V(v map[uint16]int64, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint16(k2))) + ee.EncodeInt(int64(v[uint16(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -4889,10 +6997,23 @@ func (_ fastpathT) EncMapUint16Float32V(v map[uint16]float32, checkNil bool, e * return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat32(v2) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint16(k2))) + ee.EncodeFloat32(v[uint16(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeFloat32(v2) + } } ee.EncodeEnd() } @@ -4907,10 +7028,23 @@ func (_ fastpathT) EncMapUint16Float64V(v map[uint16]float64, checkNil bool, e * return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat64(v2) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint16(k2))) + ee.EncodeFloat64(v[uint16(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeFloat64(v2) + } } ee.EncodeEnd() } @@ -4925,10 +7059,23 @@ func (_ fastpathT) EncMapUint16BoolV(v map[uint16]bool, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeBool(v2) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint16(k2))) + ee.EncodeBool(v[uint16(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeBool(v2) + } } ee.EncodeEnd() } @@ -4943,10 +7090,23 @@ func (_ fastpathT) EncMapUint32IntfV(v map[uint32]interface{}, checkNil bool, e return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - e.encode(v2) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint32(k2))) + e.encode(v[uint32(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + e.encode(v2) + } } ee.EncodeEnd() } @@ -4961,10 +7121,23 @@ func (_ fastpathT) EncMapUint32StringV(v map[uint32]string, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeString(c_UTF8, v2) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint32(k2))) + ee.EncodeString(c_UTF8, v[uint32(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeString(c_UTF8, v2) + } } ee.EncodeEnd() } @@ -4979,10 +7152,23 @@ func (_ fastpathT) EncMapUint32UintV(v map[uint32]uint, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint32(k2))) + ee.EncodeUint(uint64(v[uint32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -4997,10 +7183,23 @@ func (_ fastpathT) EncMapUint32Uint8V(v map[uint32]uint8, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint32(k2))) + ee.EncodeUint(uint64(v[uint32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -5015,10 +7214,23 @@ func (_ fastpathT) EncMapUint32Uint16V(v map[uint32]uint16, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint32(k2))) + ee.EncodeUint(uint64(v[uint32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -5033,10 +7245,23 @@ func (_ fastpathT) EncMapUint32Uint32V(v map[uint32]uint32, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint32(k2))) + ee.EncodeUint(uint64(v[uint32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -5051,10 +7276,54 @@ func (_ fastpathT) EncMapUint32Uint64V(v map[uint32]uint64, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint32(k2))) + ee.EncodeUint(uint64(v[uint32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) + } + } + ee.EncodeEnd() +} - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) +func (f *encFnInfo) fastpathEncMapUint32UintptrR(rv reflect.Value) { + fastpathTV.EncMapUint32UintptrV(rv.Interface().(map[uint32]uintptr), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapUint32UintptrV(v map[uint32]uintptr, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint32(k2))) + e.encode(v[uint32(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + e.encode(v2) + } } ee.EncodeEnd() } @@ -5069,10 +7338,23 @@ func (_ fastpathT) EncMapUint32IntV(v map[uint32]int, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint32(k2))) + ee.EncodeInt(int64(v[uint32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -5087,10 +7369,23 @@ func (_ fastpathT) EncMapUint32Int8V(v map[uint32]int8, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint32(k2))) + ee.EncodeInt(int64(v[uint32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -5105,10 +7400,23 @@ func (_ fastpathT) EncMapUint32Int16V(v map[uint32]int16, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint32(k2))) + ee.EncodeInt(int64(v[uint32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -5123,10 +7431,23 @@ func (_ fastpathT) EncMapUint32Int32V(v map[uint32]int32, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint32(k2))) + ee.EncodeInt(int64(v[uint32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -5141,10 +7462,23 @@ func (_ fastpathT) EncMapUint32Int64V(v map[uint32]int64, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint32(k2))) + ee.EncodeInt(int64(v[uint32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -5159,10 +7493,23 @@ func (_ fastpathT) EncMapUint32Float32V(v map[uint32]float32, checkNil bool, e * return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat32(v2) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint32(k2))) + ee.EncodeFloat32(v[uint32(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeFloat32(v2) + } } ee.EncodeEnd() } @@ -5177,10 +7524,23 @@ func (_ fastpathT) EncMapUint32Float64V(v map[uint32]float64, checkNil bool, e * return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat64(v2) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint32(k2))) + ee.EncodeFloat64(v[uint32(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeFloat64(v2) + } } ee.EncodeEnd() } @@ -5195,10 +7555,23 @@ func (_ fastpathT) EncMapUint32BoolV(v map[uint32]bool, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeBool(v2) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint32(k2))) + ee.EncodeBool(v[uint32(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeBool(v2) + } } ee.EncodeEnd() } @@ -5213,10 +7586,23 @@ func (_ fastpathT) EncMapUint64IntfV(v map[uint64]interface{}, checkNil bool, e return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - e.encode(v2) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint64(k2))) + e.encode(v[uint64(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + e.encode(v2) + } } ee.EncodeEnd() } @@ -5231,10 +7617,23 @@ func (_ fastpathT) EncMapUint64StringV(v map[uint64]string, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeString(c_UTF8, v2) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint64(k2))) + ee.EncodeString(c_UTF8, v[uint64(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeString(c_UTF8, v2) + } } ee.EncodeEnd() } @@ -5249,10 +7648,23 @@ func (_ fastpathT) EncMapUint64UintV(v map[uint64]uint, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint64(k2))) + ee.EncodeUint(uint64(v[uint64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -5267,10 +7679,23 @@ func (_ fastpathT) EncMapUint64Uint8V(v map[uint64]uint8, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint64(k2))) + ee.EncodeUint(uint64(v[uint64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -5285,10 +7710,23 @@ func (_ fastpathT) EncMapUint64Uint16V(v map[uint64]uint16, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint64(k2))) + ee.EncodeUint(uint64(v[uint64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -5303,10 +7741,23 @@ func (_ fastpathT) EncMapUint64Uint32V(v map[uint64]uint32, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint64(k2))) + ee.EncodeUint(uint64(v[uint64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -5321,10 +7772,54 @@ func (_ fastpathT) EncMapUint64Uint64V(v map[uint64]uint64, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint64(k2))) + ee.EncodeUint(uint64(v[uint64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeUint(uint64(v2)) + } + } + ee.EncodeEnd() +} - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) +func (f *encFnInfo) fastpathEncMapUint64UintptrR(rv reflect.Value) { + fastpathTV.EncMapUint64UintptrV(rv.Interface().(map[uint64]uintptr), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapUint64UintptrV(v map[uint64]uintptr, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint64(k2))) + e.encode(v[uint64(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + e.encode(v2) + } } ee.EncodeEnd() } @@ -5339,10 +7834,23 @@ func (_ fastpathT) EncMapUint64IntV(v map[uint64]int, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint64(k2))) + ee.EncodeInt(int64(v[uint64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -5357,10 +7865,23 @@ func (_ fastpathT) EncMapUint64Int8V(v map[uint64]int8, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint64(k2))) + ee.EncodeInt(int64(v[uint64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -5375,10 +7896,23 @@ func (_ fastpathT) EncMapUint64Int16V(v map[uint64]int16, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint64(k2))) + ee.EncodeInt(int64(v[uint64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -5393,10 +7927,23 @@ func (_ fastpathT) EncMapUint64Int32V(v map[uint64]int32, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint64(k2))) + ee.EncodeInt(int64(v[uint64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -5411,10 +7958,23 @@ func (_ fastpathT) EncMapUint64Int64V(v map[uint64]int64, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint64(k2))) + ee.EncodeInt(int64(v[uint64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -5429,10 +7989,23 @@ func (_ fastpathT) EncMapUint64Float32V(v map[uint64]float32, checkNil bool, e * return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat32(v2) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint64(k2))) + ee.EncodeFloat32(v[uint64(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeFloat32(v2) + } } ee.EncodeEnd() } @@ -5447,10 +8020,23 @@ func (_ fastpathT) EncMapUint64Float64V(v map[uint64]float64, checkNil bool, e * return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat64(v2) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint64(k2))) + ee.EncodeFloat64(v[uint64(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeFloat64(v2) + } } ee.EncodeEnd() } @@ -5465,10 +8051,519 @@ func (_ fastpathT) EncMapUint64BoolV(v map[uint64]bool, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + ee.EncodeUint(uint64(uint64(k2))) + ee.EncodeBool(v[uint64(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeUint(uint64(k2)) + ee.EncodeBool(v2) + } + } + ee.EncodeEnd() +} - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeBool(v2) +func (f *encFnInfo) fastpathEncMapUintptrIntfR(rv reflect.Value) { + fastpathTV.EncMapUintptrIntfV(rv.Interface().(map[uintptr]interface{}), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapUintptrIntfV(v map[uintptr]interface{}, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + e.encode(uintptr(k2)) + e.encode(v[uintptr(k2)]) + } + } else { + for k2, v2 := range v { + e.encode(k2) + e.encode(v2) + } + } + ee.EncodeEnd() +} + +func (f *encFnInfo) fastpathEncMapUintptrStringR(rv reflect.Value) { + fastpathTV.EncMapUintptrStringV(rv.Interface().(map[uintptr]string), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapUintptrStringV(v map[uintptr]string, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + e.encode(uintptr(k2)) + ee.EncodeString(c_UTF8, v[uintptr(k2)]) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeString(c_UTF8, v2) + } + } + ee.EncodeEnd() +} + +func (f *encFnInfo) fastpathEncMapUintptrUintR(rv reflect.Value) { + fastpathTV.EncMapUintptrUintV(rv.Interface().(map[uintptr]uint), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapUintptrUintV(v map[uintptr]uint, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + e.encode(uintptr(k2)) + ee.EncodeUint(uint64(v[uintptr(k2)])) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeUint(uint64(v2)) + } + } + ee.EncodeEnd() +} + +func (f *encFnInfo) fastpathEncMapUintptrUint8R(rv reflect.Value) { + fastpathTV.EncMapUintptrUint8V(rv.Interface().(map[uintptr]uint8), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapUintptrUint8V(v map[uintptr]uint8, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + e.encode(uintptr(k2)) + ee.EncodeUint(uint64(v[uintptr(k2)])) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeUint(uint64(v2)) + } + } + ee.EncodeEnd() +} + +func (f *encFnInfo) fastpathEncMapUintptrUint16R(rv reflect.Value) { + fastpathTV.EncMapUintptrUint16V(rv.Interface().(map[uintptr]uint16), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapUintptrUint16V(v map[uintptr]uint16, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + e.encode(uintptr(k2)) + ee.EncodeUint(uint64(v[uintptr(k2)])) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeUint(uint64(v2)) + } + } + ee.EncodeEnd() +} + +func (f *encFnInfo) fastpathEncMapUintptrUint32R(rv reflect.Value) { + fastpathTV.EncMapUintptrUint32V(rv.Interface().(map[uintptr]uint32), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapUintptrUint32V(v map[uintptr]uint32, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + e.encode(uintptr(k2)) + ee.EncodeUint(uint64(v[uintptr(k2)])) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeUint(uint64(v2)) + } + } + ee.EncodeEnd() +} + +func (f *encFnInfo) fastpathEncMapUintptrUint64R(rv reflect.Value) { + fastpathTV.EncMapUintptrUint64V(rv.Interface().(map[uintptr]uint64), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapUintptrUint64V(v map[uintptr]uint64, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + e.encode(uintptr(k2)) + ee.EncodeUint(uint64(v[uintptr(k2)])) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeUint(uint64(v2)) + } + } + ee.EncodeEnd() +} + +func (f *encFnInfo) fastpathEncMapUintptrUintptrR(rv reflect.Value) { + fastpathTV.EncMapUintptrUintptrV(rv.Interface().(map[uintptr]uintptr), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapUintptrUintptrV(v map[uintptr]uintptr, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + e.encode(uintptr(k2)) + e.encode(v[uintptr(k2)]) + } + } else { + for k2, v2 := range v { + e.encode(k2) + e.encode(v2) + } + } + ee.EncodeEnd() +} + +func (f *encFnInfo) fastpathEncMapUintptrIntR(rv reflect.Value) { + fastpathTV.EncMapUintptrIntV(rv.Interface().(map[uintptr]int), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapUintptrIntV(v map[uintptr]int, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + e.encode(uintptr(k2)) + ee.EncodeInt(int64(v[uintptr(k2)])) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeInt(int64(v2)) + } + } + ee.EncodeEnd() +} + +func (f *encFnInfo) fastpathEncMapUintptrInt8R(rv reflect.Value) { + fastpathTV.EncMapUintptrInt8V(rv.Interface().(map[uintptr]int8), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapUintptrInt8V(v map[uintptr]int8, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + e.encode(uintptr(k2)) + ee.EncodeInt(int64(v[uintptr(k2)])) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeInt(int64(v2)) + } + } + ee.EncodeEnd() +} + +func (f *encFnInfo) fastpathEncMapUintptrInt16R(rv reflect.Value) { + fastpathTV.EncMapUintptrInt16V(rv.Interface().(map[uintptr]int16), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapUintptrInt16V(v map[uintptr]int16, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + e.encode(uintptr(k2)) + ee.EncodeInt(int64(v[uintptr(k2)])) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeInt(int64(v2)) + } + } + ee.EncodeEnd() +} + +func (f *encFnInfo) fastpathEncMapUintptrInt32R(rv reflect.Value) { + fastpathTV.EncMapUintptrInt32V(rv.Interface().(map[uintptr]int32), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapUintptrInt32V(v map[uintptr]int32, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + e.encode(uintptr(k2)) + ee.EncodeInt(int64(v[uintptr(k2)])) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeInt(int64(v2)) + } + } + ee.EncodeEnd() +} + +func (f *encFnInfo) fastpathEncMapUintptrInt64R(rv reflect.Value) { + fastpathTV.EncMapUintptrInt64V(rv.Interface().(map[uintptr]int64), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapUintptrInt64V(v map[uintptr]int64, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + e.encode(uintptr(k2)) + ee.EncodeInt(int64(v[uintptr(k2)])) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeInt(int64(v2)) + } + } + ee.EncodeEnd() +} + +func (f *encFnInfo) fastpathEncMapUintptrFloat32R(rv reflect.Value) { + fastpathTV.EncMapUintptrFloat32V(rv.Interface().(map[uintptr]float32), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapUintptrFloat32V(v map[uintptr]float32, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + e.encode(uintptr(k2)) + ee.EncodeFloat32(v[uintptr(k2)]) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeFloat32(v2) + } + } + ee.EncodeEnd() +} + +func (f *encFnInfo) fastpathEncMapUintptrFloat64R(rv reflect.Value) { + fastpathTV.EncMapUintptrFloat64V(rv.Interface().(map[uintptr]float64), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapUintptrFloat64V(v map[uintptr]float64, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + e.encode(uintptr(k2)) + ee.EncodeFloat64(v[uintptr(k2)]) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeFloat64(v2) + } + } + ee.EncodeEnd() +} + +func (f *encFnInfo) fastpathEncMapUintptrBoolR(rv reflect.Value) { + fastpathTV.EncMapUintptrBoolV(rv.Interface().(map[uintptr]bool), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapUintptrBoolV(v map[uintptr]bool, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i int + for k, _ := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + e.encode(uintptr(k2)) + ee.EncodeBool(v[uintptr(k2)]) + } + } else { + for k2, v2 := range v { + e.encode(k2) + ee.EncodeBool(v2) + } } ee.EncodeEnd() } @@ -5483,10 +8578,23 @@ func (_ fastpathT) EncMapIntIntfV(v map[int]interface{}, checkNil bool, e *Encod return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - e.encode(v2) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int(k2))) + e.encode(v[int(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + e.encode(v2) + } } ee.EncodeEnd() } @@ -5501,10 +8609,23 @@ func (_ fastpathT) EncMapIntStringV(v map[int]string, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeString(c_UTF8, v2) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int(k2))) + ee.EncodeString(c_UTF8, v[int(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeString(c_UTF8, v2) + } } ee.EncodeEnd() } @@ -5519,10 +8640,23 @@ func (_ fastpathT) EncMapIntUintV(v map[int]uint, checkNil bool, e *Encoder) { return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int(k2))) + ee.EncodeUint(uint64(v[int(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -5537,10 +8671,23 @@ func (_ fastpathT) EncMapIntUint8V(v map[int]uint8, checkNil bool, e *Encoder) { return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int(k2))) + ee.EncodeUint(uint64(v[int(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -5555,10 +8702,23 @@ func (_ fastpathT) EncMapIntUint16V(v map[int]uint16, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int(k2))) + ee.EncodeUint(uint64(v[int(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -5573,10 +8733,23 @@ func (_ fastpathT) EncMapIntUint32V(v map[int]uint32, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int(k2))) + ee.EncodeUint(uint64(v[int(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -5591,10 +8764,54 @@ func (_ fastpathT) EncMapIntUint64V(v map[int]uint64, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int(k2))) + ee.EncodeUint(uint64(v[int(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) + } + } + ee.EncodeEnd() +} - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) +func (f *encFnInfo) fastpathEncMapIntUintptrR(rv reflect.Value) { + fastpathTV.EncMapIntUintptrV(rv.Interface().(map[int]uintptr), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapIntUintptrV(v map[int]uintptr, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int(k2))) + e.encode(v[int(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + e.encode(v2) + } } ee.EncodeEnd() } @@ -5609,10 +8826,23 @@ func (_ fastpathT) EncMapIntIntV(v map[int]int, checkNil bool, e *Encoder) { return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int(k2))) + ee.EncodeInt(int64(v[int(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -5627,10 +8857,23 @@ func (_ fastpathT) EncMapIntInt8V(v map[int]int8, checkNil bool, e *Encoder) { return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int(k2))) + ee.EncodeInt(int64(v[int(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -5645,10 +8888,23 @@ func (_ fastpathT) EncMapIntInt16V(v map[int]int16, checkNil bool, e *Encoder) { return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int(k2))) + ee.EncodeInt(int64(v[int(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -5663,10 +8919,23 @@ func (_ fastpathT) EncMapIntInt32V(v map[int]int32, checkNil bool, e *Encoder) { return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int(k2))) + ee.EncodeInt(int64(v[int(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -5681,10 +8950,23 @@ func (_ fastpathT) EncMapIntInt64V(v map[int]int64, checkNil bool, e *Encoder) { return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int(k2))) + ee.EncodeInt(int64(v[int(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -5699,10 +8981,23 @@ func (_ fastpathT) EncMapIntFloat32V(v map[int]float32, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat32(v2) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int(k2))) + ee.EncodeFloat32(v[int(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeFloat32(v2) + } } ee.EncodeEnd() } @@ -5717,10 +9012,23 @@ func (_ fastpathT) EncMapIntFloat64V(v map[int]float64, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat64(v2) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int(k2))) + ee.EncodeFloat64(v[int(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeFloat64(v2) + } } ee.EncodeEnd() } @@ -5735,10 +9043,23 @@ func (_ fastpathT) EncMapIntBoolV(v map[int]bool, checkNil bool, e *Encoder) { return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeBool(v2) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int(k2))) + ee.EncodeBool(v[int(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeBool(v2) + } } ee.EncodeEnd() } @@ -5753,10 +9074,23 @@ func (_ fastpathT) EncMapInt8IntfV(v map[int8]interface{}, checkNil bool, e *Enc return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - e.encode(v2) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int8(k2))) + e.encode(v[int8(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + e.encode(v2) + } } ee.EncodeEnd() } @@ -5771,10 +9105,23 @@ func (_ fastpathT) EncMapInt8StringV(v map[int8]string, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeString(c_UTF8, v2) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int8(k2))) + ee.EncodeString(c_UTF8, v[int8(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeString(c_UTF8, v2) + } } ee.EncodeEnd() } @@ -5789,10 +9136,23 @@ func (_ fastpathT) EncMapInt8UintV(v map[int8]uint, checkNil bool, e *Encoder) { return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int8(k2))) + ee.EncodeUint(uint64(v[int8(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -5807,10 +9167,23 @@ func (_ fastpathT) EncMapInt8Uint8V(v map[int8]uint8, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int8(k2))) + ee.EncodeUint(uint64(v[int8(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -5825,10 +9198,23 @@ func (_ fastpathT) EncMapInt8Uint16V(v map[int8]uint16, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int8(k2))) + ee.EncodeUint(uint64(v[int8(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -5843,10 +9229,23 @@ func (_ fastpathT) EncMapInt8Uint32V(v map[int8]uint32, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int8(k2))) + ee.EncodeUint(uint64(v[int8(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -5861,10 +9260,54 @@ func (_ fastpathT) EncMapInt8Uint64V(v map[int8]uint64, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int8(k2))) + ee.EncodeUint(uint64(v[int8(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) + } + } + ee.EncodeEnd() +} - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) +func (f *encFnInfo) fastpathEncMapInt8UintptrR(rv reflect.Value) { + fastpathTV.EncMapInt8UintptrV(rv.Interface().(map[int8]uintptr), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapInt8UintptrV(v map[int8]uintptr, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int8(k2))) + e.encode(v[int8(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + e.encode(v2) + } } ee.EncodeEnd() } @@ -5879,10 +9322,23 @@ func (_ fastpathT) EncMapInt8IntV(v map[int8]int, checkNil bool, e *Encoder) { return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int8(k2))) + ee.EncodeInt(int64(v[int8(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -5897,10 +9353,23 @@ func (_ fastpathT) EncMapInt8Int8V(v map[int8]int8, checkNil bool, e *Encoder) { return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int8(k2))) + ee.EncodeInt(int64(v[int8(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -5915,10 +9384,23 @@ func (_ fastpathT) EncMapInt8Int16V(v map[int8]int16, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int8(k2))) + ee.EncodeInt(int64(v[int8(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -5933,10 +9415,23 @@ func (_ fastpathT) EncMapInt8Int32V(v map[int8]int32, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int8(k2))) + ee.EncodeInt(int64(v[int8(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -5951,10 +9446,23 @@ func (_ fastpathT) EncMapInt8Int64V(v map[int8]int64, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int8(k2))) + ee.EncodeInt(int64(v[int8(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -5969,10 +9477,23 @@ func (_ fastpathT) EncMapInt8Float32V(v map[int8]float32, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat32(v2) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int8(k2))) + ee.EncodeFloat32(v[int8(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeFloat32(v2) + } } ee.EncodeEnd() } @@ -5987,10 +9508,23 @@ func (_ fastpathT) EncMapInt8Float64V(v map[int8]float64, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat64(v2) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int8(k2))) + ee.EncodeFloat64(v[int8(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeFloat64(v2) + } } ee.EncodeEnd() } @@ -6005,10 +9539,23 @@ func (_ fastpathT) EncMapInt8BoolV(v map[int8]bool, checkNil bool, e *Encoder) { return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeBool(v2) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int8(k2))) + ee.EncodeBool(v[int8(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeBool(v2) + } } ee.EncodeEnd() } @@ -6023,10 +9570,23 @@ func (_ fastpathT) EncMapInt16IntfV(v map[int16]interface{}, checkNil bool, e *E return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - e.encode(v2) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int16(k2))) + e.encode(v[int16(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + e.encode(v2) + } } ee.EncodeEnd() } @@ -6041,10 +9601,23 @@ func (_ fastpathT) EncMapInt16StringV(v map[int16]string, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeString(c_UTF8, v2) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int16(k2))) + ee.EncodeString(c_UTF8, v[int16(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeString(c_UTF8, v2) + } } ee.EncodeEnd() } @@ -6059,10 +9632,23 @@ func (_ fastpathT) EncMapInt16UintV(v map[int16]uint, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int16(k2))) + ee.EncodeUint(uint64(v[int16(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -6077,10 +9663,23 @@ func (_ fastpathT) EncMapInt16Uint8V(v map[int16]uint8, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int16(k2))) + ee.EncodeUint(uint64(v[int16(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -6095,10 +9694,23 @@ func (_ fastpathT) EncMapInt16Uint16V(v map[int16]uint16, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int16(k2))) + ee.EncodeUint(uint64(v[int16(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -6113,10 +9725,23 @@ func (_ fastpathT) EncMapInt16Uint32V(v map[int16]uint32, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int16(k2))) + ee.EncodeUint(uint64(v[int16(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -6131,10 +9756,54 @@ func (_ fastpathT) EncMapInt16Uint64V(v map[int16]uint64, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int16(k2))) + ee.EncodeUint(uint64(v[int16(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) + } + } + ee.EncodeEnd() +} - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) +func (f *encFnInfo) fastpathEncMapInt16UintptrR(rv reflect.Value) { + fastpathTV.EncMapInt16UintptrV(rv.Interface().(map[int16]uintptr), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapInt16UintptrV(v map[int16]uintptr, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int16(k2))) + e.encode(v[int16(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + e.encode(v2) + } } ee.EncodeEnd() } @@ -6149,10 +9818,23 @@ func (_ fastpathT) EncMapInt16IntV(v map[int16]int, checkNil bool, e *Encoder) { return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int16(k2))) + ee.EncodeInt(int64(v[int16(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -6167,10 +9849,23 @@ func (_ fastpathT) EncMapInt16Int8V(v map[int16]int8, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int16(k2))) + ee.EncodeInt(int64(v[int16(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -6185,10 +9880,23 @@ func (_ fastpathT) EncMapInt16Int16V(v map[int16]int16, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int16(k2))) + ee.EncodeInt(int64(v[int16(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -6203,10 +9911,23 @@ func (_ fastpathT) EncMapInt16Int32V(v map[int16]int32, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int16(k2))) + ee.EncodeInt(int64(v[int16(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -6221,10 +9942,23 @@ func (_ fastpathT) EncMapInt16Int64V(v map[int16]int64, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int16(k2))) + ee.EncodeInt(int64(v[int16(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -6239,10 +9973,23 @@ func (_ fastpathT) EncMapInt16Float32V(v map[int16]float32, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat32(v2) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int16(k2))) + ee.EncodeFloat32(v[int16(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeFloat32(v2) + } } ee.EncodeEnd() } @@ -6257,10 +10004,23 @@ func (_ fastpathT) EncMapInt16Float64V(v map[int16]float64, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat64(v2) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int16(k2))) + ee.EncodeFloat64(v[int16(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeFloat64(v2) + } } ee.EncodeEnd() } @@ -6275,10 +10035,23 @@ func (_ fastpathT) EncMapInt16BoolV(v map[int16]bool, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeBool(v2) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int16(k2))) + ee.EncodeBool(v[int16(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeBool(v2) + } } ee.EncodeEnd() } @@ -6293,10 +10066,23 @@ func (_ fastpathT) EncMapInt32IntfV(v map[int32]interface{}, checkNil bool, e *E return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - e.encode(v2) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int32(k2))) + e.encode(v[int32(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + e.encode(v2) + } } ee.EncodeEnd() } @@ -6311,10 +10097,23 @@ func (_ fastpathT) EncMapInt32StringV(v map[int32]string, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeString(c_UTF8, v2) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int32(k2))) + ee.EncodeString(c_UTF8, v[int32(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeString(c_UTF8, v2) + } } ee.EncodeEnd() } @@ -6329,10 +10128,23 @@ func (_ fastpathT) EncMapInt32UintV(v map[int32]uint, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int32(k2))) + ee.EncodeUint(uint64(v[int32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -6347,10 +10159,23 @@ func (_ fastpathT) EncMapInt32Uint8V(v map[int32]uint8, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int32(k2))) + ee.EncodeUint(uint64(v[int32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -6365,10 +10190,23 @@ func (_ fastpathT) EncMapInt32Uint16V(v map[int32]uint16, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int32(k2))) + ee.EncodeUint(uint64(v[int32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -6383,10 +10221,23 @@ func (_ fastpathT) EncMapInt32Uint32V(v map[int32]uint32, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int32(k2))) + ee.EncodeUint(uint64(v[int32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -6401,10 +10252,54 @@ func (_ fastpathT) EncMapInt32Uint64V(v map[int32]uint64, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int32(k2))) + ee.EncodeUint(uint64(v[int32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) + } + } + ee.EncodeEnd() +} - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) +func (f *encFnInfo) fastpathEncMapInt32UintptrR(rv reflect.Value) { + fastpathTV.EncMapInt32UintptrV(rv.Interface().(map[int32]uintptr), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapInt32UintptrV(v map[int32]uintptr, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int32(k2))) + e.encode(v[int32(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + e.encode(v2) + } } ee.EncodeEnd() } @@ -6419,10 +10314,23 @@ func (_ fastpathT) EncMapInt32IntV(v map[int32]int, checkNil bool, e *Encoder) { return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int32(k2))) + ee.EncodeInt(int64(v[int32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -6437,10 +10345,23 @@ func (_ fastpathT) EncMapInt32Int8V(v map[int32]int8, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int32(k2))) + ee.EncodeInt(int64(v[int32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -6455,10 +10376,23 @@ func (_ fastpathT) EncMapInt32Int16V(v map[int32]int16, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int32(k2))) + ee.EncodeInt(int64(v[int32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -6473,10 +10407,23 @@ func (_ fastpathT) EncMapInt32Int32V(v map[int32]int32, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int32(k2))) + ee.EncodeInt(int64(v[int32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -6491,10 +10438,23 @@ func (_ fastpathT) EncMapInt32Int64V(v map[int32]int64, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int32(k2))) + ee.EncodeInt(int64(v[int32(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -6509,10 +10469,23 @@ func (_ fastpathT) EncMapInt32Float32V(v map[int32]float32, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat32(v2) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int32(k2))) + ee.EncodeFloat32(v[int32(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeFloat32(v2) + } } ee.EncodeEnd() } @@ -6527,10 +10500,23 @@ func (_ fastpathT) EncMapInt32Float64V(v map[int32]float64, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat64(v2) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int32(k2))) + ee.EncodeFloat64(v[int32(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeFloat64(v2) + } } ee.EncodeEnd() } @@ -6545,10 +10531,23 @@ func (_ fastpathT) EncMapInt32BoolV(v map[int32]bool, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeBool(v2) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int32(k2))) + ee.EncodeBool(v[int32(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeBool(v2) + } } ee.EncodeEnd() } @@ -6563,10 +10562,23 @@ func (_ fastpathT) EncMapInt64IntfV(v map[int64]interface{}, checkNil bool, e *E return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - e.encode(v2) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int64(k2))) + e.encode(v[int64(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + e.encode(v2) + } } ee.EncodeEnd() } @@ -6581,10 +10593,23 @@ func (_ fastpathT) EncMapInt64StringV(v map[int64]string, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeString(c_UTF8, v2) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int64(k2))) + ee.EncodeString(c_UTF8, v[int64(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeString(c_UTF8, v2) + } } ee.EncodeEnd() } @@ -6599,10 +10624,23 @@ func (_ fastpathT) EncMapInt64UintV(v map[int64]uint, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int64(k2))) + ee.EncodeUint(uint64(v[int64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -6617,10 +10655,23 @@ func (_ fastpathT) EncMapInt64Uint8V(v map[int64]uint8, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int64(k2))) + ee.EncodeUint(uint64(v[int64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -6635,10 +10686,23 @@ func (_ fastpathT) EncMapInt64Uint16V(v map[int64]uint16, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int64(k2))) + ee.EncodeUint(uint64(v[int64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -6653,10 +10717,23 @@ func (_ fastpathT) EncMapInt64Uint32V(v map[int64]uint32, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int64(k2))) + ee.EncodeUint(uint64(v[int64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -6671,10 +10748,54 @@ func (_ fastpathT) EncMapInt64Uint64V(v map[int64]uint64, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int64(k2))) + ee.EncodeUint(uint64(v[int64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeUint(uint64(v2)) + } + } + ee.EncodeEnd() +} - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) +func (f *encFnInfo) fastpathEncMapInt64UintptrR(rv reflect.Value) { + fastpathTV.EncMapInt64UintptrV(rv.Interface().(map[int64]uintptr), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapInt64UintptrV(v map[int64]uintptr, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int64(k2))) + e.encode(v[int64(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + e.encode(v2) + } } ee.EncodeEnd() } @@ -6689,10 +10810,23 @@ func (_ fastpathT) EncMapInt64IntV(v map[int64]int, checkNil bool, e *Encoder) { return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int64(k2))) + ee.EncodeInt(int64(v[int64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -6707,10 +10841,23 @@ func (_ fastpathT) EncMapInt64Int8V(v map[int64]int8, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int64(k2))) + ee.EncodeInt(int64(v[int64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -6725,10 +10872,23 @@ func (_ fastpathT) EncMapInt64Int16V(v map[int64]int16, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int64(k2))) + ee.EncodeInt(int64(v[int64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -6743,10 +10903,23 @@ func (_ fastpathT) EncMapInt64Int32V(v map[int64]int32, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int64(k2))) + ee.EncodeInt(int64(v[int64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -6761,10 +10934,23 @@ func (_ fastpathT) EncMapInt64Int64V(v map[int64]int64, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int64(k2))) + ee.EncodeInt(int64(v[int64(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -6779,10 +10965,23 @@ func (_ fastpathT) EncMapInt64Float32V(v map[int64]float32, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat32(v2) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int64(k2))) + ee.EncodeFloat32(v[int64(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeFloat32(v2) + } } ee.EncodeEnd() } @@ -6797,10 +10996,23 @@ func (_ fastpathT) EncMapInt64Float64V(v map[int64]float64, checkNil bool, e *En return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat64(v2) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int64(k2))) + ee.EncodeFloat64(v[int64(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeFloat64(v2) + } } ee.EncodeEnd() } @@ -6815,10 +11027,23 @@ func (_ fastpathT) EncMapInt64BoolV(v map[int64]bool, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeBool(v2) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i int + for k, _ := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + ee.EncodeInt(int64(int64(k2))) + ee.EncodeBool(v[int64(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeInt(int64(k2)) + ee.EncodeBool(v2) + } } ee.EncodeEnd() } @@ -6833,10 +11058,23 @@ func (_ fastpathT) EncMapBoolIntfV(v map[bool]interface{}, checkNil bool, e *Enc return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeBool(k2) - e.encode(v2) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i int + for k, _ := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + ee.EncodeBool(bool(k2)) + e.encode(v[bool(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeBool(k2) + e.encode(v2) + } } ee.EncodeEnd() } @@ -6851,10 +11089,23 @@ func (_ fastpathT) EncMapBoolStringV(v map[bool]string, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeString(c_UTF8, v2) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i int + for k, _ := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + ee.EncodeBool(bool(k2)) + ee.EncodeString(c_UTF8, v[bool(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeString(c_UTF8, v2) + } } ee.EncodeEnd() } @@ -6869,10 +11120,23 @@ func (_ fastpathT) EncMapBoolUintV(v map[bool]uint, checkNil bool, e *Encoder) { return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i int + for k, _ := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + ee.EncodeBool(bool(k2)) + ee.EncodeUint(uint64(v[bool(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -6887,10 +11151,23 @@ func (_ fastpathT) EncMapBoolUint8V(v map[bool]uint8, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i int + for k, _ := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + ee.EncodeBool(bool(k2)) + ee.EncodeUint(uint64(v[bool(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -6905,10 +11182,23 @@ func (_ fastpathT) EncMapBoolUint16V(v map[bool]uint16, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i int + for k, _ := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + ee.EncodeBool(bool(k2)) + ee.EncodeUint(uint64(v[bool(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -6923,10 +11213,23 @@ func (_ fastpathT) EncMapBoolUint32V(v map[bool]uint32, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeUint(uint64(v2)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i int + for k, _ := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + ee.EncodeBool(bool(k2)) + ee.EncodeUint(uint64(v[bool(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeUint(uint64(v2)) + } } ee.EncodeEnd() } @@ -6941,10 +11244,54 @@ func (_ fastpathT) EncMapBoolUint64V(v map[bool]uint64, checkNil bool, e *Encode return } ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i int + for k, _ := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + ee.EncodeBool(bool(k2)) + ee.EncodeUint(uint64(v[bool(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeUint(uint64(v2)) + } + } + ee.EncodeEnd() +} - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeUint(uint64(v2)) +func (f *encFnInfo) fastpathEncMapBoolUintptrR(rv reflect.Value) { + fastpathTV.EncMapBoolUintptrV(rv.Interface().(map[bool]uintptr), fastpathCheckNilFalse, f.e) +} +func (_ fastpathT) EncMapBoolUintptrV(v map[bool]uintptr, checkNil bool, e *Encoder) { + ee := e.e + if checkNil && v == nil { + ee.EncodeNil() + return + } + ee.EncodeMapStart(len(v)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i int + for k, _ := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + ee.EncodeBool(bool(k2)) + e.encode(v[bool(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeBool(k2) + e.encode(v2) + } } ee.EncodeEnd() } @@ -6959,10 +11306,23 @@ func (_ fastpathT) EncMapBoolIntV(v map[bool]int, checkNil bool, e *Encoder) { return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i int + for k, _ := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + ee.EncodeBool(bool(k2)) + ee.EncodeInt(int64(v[bool(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -6977,10 +11337,23 @@ func (_ fastpathT) EncMapBoolInt8V(v map[bool]int8, checkNil bool, e *Encoder) { return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i int + for k, _ := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + ee.EncodeBool(bool(k2)) + ee.EncodeInt(int64(v[bool(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -6995,10 +11368,23 @@ func (_ fastpathT) EncMapBoolInt16V(v map[bool]int16, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i int + for k, _ := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + ee.EncodeBool(bool(k2)) + ee.EncodeInt(int64(v[bool(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -7013,10 +11399,23 @@ func (_ fastpathT) EncMapBoolInt32V(v map[bool]int32, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i int + for k, _ := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + ee.EncodeBool(bool(k2)) + ee.EncodeInt(int64(v[bool(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -7031,10 +11430,23 @@ func (_ fastpathT) EncMapBoolInt64V(v map[bool]int64, checkNil bool, e *Encoder) return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeInt(int64(v2)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i int + for k, _ := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + ee.EncodeBool(bool(k2)) + ee.EncodeInt(int64(v[bool(k2)])) + } + } else { + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeInt(int64(v2)) + } } ee.EncodeEnd() } @@ -7049,10 +11461,23 @@ func (_ fastpathT) EncMapBoolFloat32V(v map[bool]float32, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeFloat32(v2) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i int + for k, _ := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + ee.EncodeBool(bool(k2)) + ee.EncodeFloat32(v[bool(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeFloat32(v2) + } } ee.EncodeEnd() } @@ -7067,10 +11492,23 @@ func (_ fastpathT) EncMapBoolFloat64V(v map[bool]float64, checkNil bool, e *Enco return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeFloat64(v2) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i int + for k, _ := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + ee.EncodeBool(bool(k2)) + ee.EncodeFloat64(v[bool(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeFloat64(v2) + } } ee.EncodeEnd() } @@ -7085,10 +11523,23 @@ func (_ fastpathT) EncMapBoolBoolV(v map[bool]bool, checkNil bool, e *Encoder) { return } ee.EncodeMapStart(len(v)) - - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeBool(v2) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i int + for k, _ := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + ee.EncodeBool(bool(k2)) + ee.EncodeBool(v[bool(k2)]) + } + } else { + for k2, v2 := range v { + ee.EncodeBool(k2) + ee.EncodeBool(v2) + } } ee.EncodeEnd() } @@ -7163,6 +11614,14 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { *v = v2 } + case map[interface{}]uintptr: + fastpathTV.DecMapIntfUintptrV(v, fastpathCheckNilFalse, false, d) + case *map[interface{}]uintptr: + v2, changed2 := fastpathTV.DecMapIntfUintptrV(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + case map[interface{}]int: fastpathTV.DecMapIntfIntV(v, fastpathCheckNilFalse, false, d) case *map[interface{}]int: @@ -7291,6 +11750,14 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { *v = v2 } + case map[string]uintptr: + fastpathTV.DecMapStringUintptrV(v, fastpathCheckNilFalse, false, d) + case *map[string]uintptr: + v2, changed2 := fastpathTV.DecMapStringUintptrV(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + case map[string]int: fastpathTV.DecMapStringIntV(v, fastpathCheckNilFalse, false, d) case *map[string]int: @@ -7419,6 +11886,14 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { *v = v2 } + case map[float32]uintptr: + fastpathTV.DecMapFloat32UintptrV(v, fastpathCheckNilFalse, false, d) + case *map[float32]uintptr: + v2, changed2 := fastpathTV.DecMapFloat32UintptrV(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + case map[float32]int: fastpathTV.DecMapFloat32IntV(v, fastpathCheckNilFalse, false, d) case *map[float32]int: @@ -7547,6 +12022,14 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { *v = v2 } + case map[float64]uintptr: + fastpathTV.DecMapFloat64UintptrV(v, fastpathCheckNilFalse, false, d) + case *map[float64]uintptr: + v2, changed2 := fastpathTV.DecMapFloat64UintptrV(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + case map[float64]int: fastpathTV.DecMapFloat64IntV(v, fastpathCheckNilFalse, false, d) case *map[float64]int: @@ -7675,6 +12158,14 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { *v = v2 } + case map[uint]uintptr: + fastpathTV.DecMapUintUintptrV(v, fastpathCheckNilFalse, false, d) + case *map[uint]uintptr: + v2, changed2 := fastpathTV.DecMapUintUintptrV(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + case map[uint]int: fastpathTV.DecMapUintIntV(v, fastpathCheckNilFalse, false, d) case *map[uint]int: @@ -7795,6 +12286,14 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { *v = v2 } + case map[uint8]uintptr: + fastpathTV.DecMapUint8UintptrV(v, fastpathCheckNilFalse, false, d) + case *map[uint8]uintptr: + v2, changed2 := fastpathTV.DecMapUint8UintptrV(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + case map[uint8]int: fastpathTV.DecMapUint8IntV(v, fastpathCheckNilFalse, false, d) case *map[uint8]int: @@ -7923,6 +12422,14 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { *v = v2 } + case map[uint16]uintptr: + fastpathTV.DecMapUint16UintptrV(v, fastpathCheckNilFalse, false, d) + case *map[uint16]uintptr: + v2, changed2 := fastpathTV.DecMapUint16UintptrV(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + case map[uint16]int: fastpathTV.DecMapUint16IntV(v, fastpathCheckNilFalse, false, d) case *map[uint16]int: @@ -8051,6 +12558,14 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { *v = v2 } + case map[uint32]uintptr: + fastpathTV.DecMapUint32UintptrV(v, fastpathCheckNilFalse, false, d) + case *map[uint32]uintptr: + v2, changed2 := fastpathTV.DecMapUint32UintptrV(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + case map[uint32]int: fastpathTV.DecMapUint32IntV(v, fastpathCheckNilFalse, false, d) case *map[uint32]int: @@ -8179,6 +12694,14 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { *v = v2 } + case map[uint64]uintptr: + fastpathTV.DecMapUint64UintptrV(v, fastpathCheckNilFalse, false, d) + case *map[uint64]uintptr: + v2, changed2 := fastpathTV.DecMapUint64UintptrV(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + case map[uint64]int: fastpathTV.DecMapUint64IntV(v, fastpathCheckNilFalse, false, d) case *map[uint64]int: @@ -8243,6 +12766,142 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { *v = v2 } + case []uintptr: + fastpathTV.DecSliceUintptrV(v, fastpathCheckNilFalse, false, d) + case *[]uintptr: + v2, changed2 := fastpathTV.DecSliceUintptrV(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + + case map[uintptr]interface{}: + fastpathTV.DecMapUintptrIntfV(v, fastpathCheckNilFalse, false, d) + case *map[uintptr]interface{}: + v2, changed2 := fastpathTV.DecMapUintptrIntfV(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + + case map[uintptr]string: + fastpathTV.DecMapUintptrStringV(v, fastpathCheckNilFalse, false, d) + case *map[uintptr]string: + v2, changed2 := fastpathTV.DecMapUintptrStringV(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + + case map[uintptr]uint: + fastpathTV.DecMapUintptrUintV(v, fastpathCheckNilFalse, false, d) + case *map[uintptr]uint: + v2, changed2 := fastpathTV.DecMapUintptrUintV(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + + case map[uintptr]uint8: + fastpathTV.DecMapUintptrUint8V(v, fastpathCheckNilFalse, false, d) + case *map[uintptr]uint8: + v2, changed2 := fastpathTV.DecMapUintptrUint8V(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + + case map[uintptr]uint16: + fastpathTV.DecMapUintptrUint16V(v, fastpathCheckNilFalse, false, d) + case *map[uintptr]uint16: + v2, changed2 := fastpathTV.DecMapUintptrUint16V(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + + case map[uintptr]uint32: + fastpathTV.DecMapUintptrUint32V(v, fastpathCheckNilFalse, false, d) + case *map[uintptr]uint32: + v2, changed2 := fastpathTV.DecMapUintptrUint32V(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + + case map[uintptr]uint64: + fastpathTV.DecMapUintptrUint64V(v, fastpathCheckNilFalse, false, d) + case *map[uintptr]uint64: + v2, changed2 := fastpathTV.DecMapUintptrUint64V(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + + case map[uintptr]uintptr: + fastpathTV.DecMapUintptrUintptrV(v, fastpathCheckNilFalse, false, d) + case *map[uintptr]uintptr: + v2, changed2 := fastpathTV.DecMapUintptrUintptrV(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + + case map[uintptr]int: + fastpathTV.DecMapUintptrIntV(v, fastpathCheckNilFalse, false, d) + case *map[uintptr]int: + v2, changed2 := fastpathTV.DecMapUintptrIntV(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + + case map[uintptr]int8: + fastpathTV.DecMapUintptrInt8V(v, fastpathCheckNilFalse, false, d) + case *map[uintptr]int8: + v2, changed2 := fastpathTV.DecMapUintptrInt8V(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + + case map[uintptr]int16: + fastpathTV.DecMapUintptrInt16V(v, fastpathCheckNilFalse, false, d) + case *map[uintptr]int16: + v2, changed2 := fastpathTV.DecMapUintptrInt16V(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + + case map[uintptr]int32: + fastpathTV.DecMapUintptrInt32V(v, fastpathCheckNilFalse, false, d) + case *map[uintptr]int32: + v2, changed2 := fastpathTV.DecMapUintptrInt32V(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + + case map[uintptr]int64: + fastpathTV.DecMapUintptrInt64V(v, fastpathCheckNilFalse, false, d) + case *map[uintptr]int64: + v2, changed2 := fastpathTV.DecMapUintptrInt64V(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + + case map[uintptr]float32: + fastpathTV.DecMapUintptrFloat32V(v, fastpathCheckNilFalse, false, d) + case *map[uintptr]float32: + v2, changed2 := fastpathTV.DecMapUintptrFloat32V(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + + case map[uintptr]float64: + fastpathTV.DecMapUintptrFloat64V(v, fastpathCheckNilFalse, false, d) + case *map[uintptr]float64: + v2, changed2 := fastpathTV.DecMapUintptrFloat64V(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + + case map[uintptr]bool: + fastpathTV.DecMapUintptrBoolV(v, fastpathCheckNilFalse, false, d) + case *map[uintptr]bool: + v2, changed2 := fastpathTV.DecMapUintptrBoolV(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + case []int: fastpathTV.DecSliceIntV(v, fastpathCheckNilFalse, false, d) case *[]int: @@ -8307,6 +12966,14 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { *v = v2 } + case map[int]uintptr: + fastpathTV.DecMapIntUintptrV(v, fastpathCheckNilFalse, false, d) + case *map[int]uintptr: + v2, changed2 := fastpathTV.DecMapIntUintptrV(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + case map[int]int: fastpathTV.DecMapIntIntV(v, fastpathCheckNilFalse, false, d) case *map[int]int: @@ -8435,6 +13102,14 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { *v = v2 } + case map[int8]uintptr: + fastpathTV.DecMapInt8UintptrV(v, fastpathCheckNilFalse, false, d) + case *map[int8]uintptr: + v2, changed2 := fastpathTV.DecMapInt8UintptrV(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + case map[int8]int: fastpathTV.DecMapInt8IntV(v, fastpathCheckNilFalse, false, d) case *map[int8]int: @@ -8563,6 +13238,14 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { *v = v2 } + case map[int16]uintptr: + fastpathTV.DecMapInt16UintptrV(v, fastpathCheckNilFalse, false, d) + case *map[int16]uintptr: + v2, changed2 := fastpathTV.DecMapInt16UintptrV(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + case map[int16]int: fastpathTV.DecMapInt16IntV(v, fastpathCheckNilFalse, false, d) case *map[int16]int: @@ -8691,6 +13374,14 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { *v = v2 } + case map[int32]uintptr: + fastpathTV.DecMapInt32UintptrV(v, fastpathCheckNilFalse, false, d) + case *map[int32]uintptr: + v2, changed2 := fastpathTV.DecMapInt32UintptrV(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + case map[int32]int: fastpathTV.DecMapInt32IntV(v, fastpathCheckNilFalse, false, d) case *map[int32]int: @@ -8819,6 +13510,14 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { *v = v2 } + case map[int64]uintptr: + fastpathTV.DecMapInt64UintptrV(v, fastpathCheckNilFalse, false, d) + case *map[int64]uintptr: + v2, changed2 := fastpathTV.DecMapInt64UintptrV(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + case map[int64]int: fastpathTV.DecMapInt64IntV(v, fastpathCheckNilFalse, false, d) case *map[int64]int: @@ -8947,6 +13646,14 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { *v = v2 } + case map[bool]uintptr: + fastpathTV.DecMapBoolUintptrV(v, fastpathCheckNilFalse, false, d) + case *map[bool]uintptr: + v2, changed2 := fastpathTV.DecMapBoolUintptrV(*v, fastpathCheckNilFalse, true, d) + if changed2 { + *v = v2 + } + case map[bool]int: fastpathTV.DecMapBoolIntV(v, fastpathCheckNilFalse, false, d) case *map[bool]int: @@ -9852,6 +14559,110 @@ func (_ fastpathT) DecSliceUint64V(v []uint64, checkNil bool, canChange bool, return v, changed } +func (f *decFnInfo) fastpathDecSliceUintptrR(rv reflect.Value) { + array := f.seq == seqTypeArray + if !array && rv.CanAddr() { + vp := rv.Addr().Interface().(*[]uintptr) + v, changed := fastpathTV.DecSliceUintptrV(*vp, fastpathCheckNilFalse, !array, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().([]uintptr) + fastpathTV.DecSliceUintptrV(v, fastpathCheckNilFalse, false, f.d) + } +} + +func (f fastpathT) DecSliceUintptrX(vp *[]uintptr, checkNil bool, d *Decoder) { + v, changed := f.DecSliceUintptrV(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecSliceUintptrV(v []uintptr, checkNil bool, canChange bool, + d *Decoder) (_ []uintptr, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + slh, containerLenS := d.decSliceHelperStart() + x2read := containerLenS + var xtrunc bool + if canChange && v == nil { + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 8); xtrunc { + x2read = xlen + } + v = make([]uintptr, xlen) + changed = true + } + if containerLenS == 0 { + if canChange && len(v) != 0 { + v = v[:0] + changed = true + } + return v, changed + } + + if containerLenS > 0 { + if containerLenS > cap(v) { + if canChange { + var xlen int + if xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 8); xtrunc { + x2read = xlen + } + v = make([]uintptr, xlen) + changed = true + } else { + d.arrayCannotExpand(len(v), containerLenS) + x2read = len(v) + } + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + + j := 0 + for ; j < x2read; j++ { + v[j] = uintptr(dd.DecodeUint(uintBitsize)) + } + if xtrunc { + for ; j < containerLenS; j++ { + v = append(v, 0) + v[j] = uintptr(dd.DecodeUint(uintBitsize)) + } + } else if !canChange { + for ; j < containerLenS; j++ { + d.swallow() + } + } + } else { + j := 0 + for ; !dd.CheckBreak(); j++ { + if j >= len(v) { + if canChange { + v = append(v, 0) + changed = true + } else { + d.arrayCannotExpand(len(v), j+1) + } + } + if j < len(v) { + v[j] = uintptr(dd.DecodeUint(uintBitsize)) + } else { + d.swallow() + } + } + slh.End() + } + return v, changed +} + func (f *decFnInfo) fastpathDecSliceIntR(rv reflect.Value) { array := f.seq == seqTypeArray if !array && rv.CanAddr() { @@ -10511,30 +15322,39 @@ func (_ fastpathT) DecMapIntfIntfV(v map[interface{}]interface{}, checkNil bool, v = make(map[interface{}]interface{}, xlen) changed = true } + mapGet := !d.h.MapValueReset && !d.h.InterfaceReset + var mk interface{} + var mv interface{} if containerLen > 0 { for j := 0; j < containerLen; j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) + } + if mapGet { + mv = v[mk] + } else { + mv = nil } - mv := v[mk] d.decode(&mv) - if v != nil { v[mk] = mv } } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) + } + if mapGet { + mv = v[mk] + } else { + mv = nil } - mv := v[mk] d.decode(&mv) - if v != nil { v[mk] = mv } @@ -10579,14 +15399,16 @@ func (_ fastpathT) DecMapIntfStringV(v map[interface{}]string, checkNil bool, ca v = make(map[interface{}]string, xlen) changed = true } + + var mk interface{} + var mv string if containerLen > 0 { for j := 0; j < containerLen; j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -10594,12 +15416,11 @@ func (_ fastpathT) DecMapIntfStringV(v map[interface{}]string, checkNil bool, ca } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -10645,14 +15466,16 @@ func (_ fastpathT) DecMapIntfUintV(v map[interface{}]uint, checkNil bool, canCha v = make(map[interface{}]uint, xlen) changed = true } + + var mk interface{} + var mv uint if containerLen > 0 { for j := 0; j < containerLen; j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -10660,12 +15483,11 @@ func (_ fastpathT) DecMapIntfUintV(v map[interface{}]uint, checkNil bool, canCha } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -10711,14 +15533,16 @@ func (_ fastpathT) DecMapIntfUint8V(v map[interface{}]uint8, checkNil bool, canC v = make(map[interface{}]uint8, xlen) changed = true } + + var mk interface{} + var mv uint8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -10726,12 +15550,11 @@ func (_ fastpathT) DecMapIntfUint8V(v map[interface{}]uint8, checkNil bool, canC } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -10777,14 +15600,16 @@ func (_ fastpathT) DecMapIntfUint16V(v map[interface{}]uint16, checkNil bool, ca v = make(map[interface{}]uint16, xlen) changed = true } + + var mk interface{} + var mv uint16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -10792,12 +15617,11 @@ func (_ fastpathT) DecMapIntfUint16V(v map[interface{}]uint16, checkNil bool, ca } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -10843,14 +15667,16 @@ func (_ fastpathT) DecMapIntfUint32V(v map[interface{}]uint32, checkNil bool, ca v = make(map[interface{}]uint32, xlen) changed = true } + + var mk interface{} + var mv uint32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -10858,12 +15684,11 @@ func (_ fastpathT) DecMapIntfUint32V(v map[interface{}]uint32, checkNil bool, ca } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -10909,14 +15734,16 @@ func (_ fastpathT) DecMapIntfUint64V(v map[interface{}]uint64, checkNil bool, ca v = make(map[interface{}]uint64, xlen) changed = true } + + var mk interface{} + var mv uint64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -10924,12 +15751,11 @@ func (_ fastpathT) DecMapIntfUint64V(v map[interface{}]uint64, checkNil bool, ca } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -10940,6 +15766,73 @@ func (_ fastpathT) DecMapIntfUint64V(v map[interface{}]uint64, checkNil bool, ca return v, changed } +func (f *decFnInfo) fastpathDecMapIntfUintptrR(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[interface{}]uintptr) + v, changed := fastpathTV.DecMapIntfUintptrV(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[interface{}]uintptr) + fastpathTV.DecMapIntfUintptrV(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapIntfUintptrX(vp *map[interface{}]uintptr, checkNil bool, d *Decoder) { + v, changed := f.DecMapIntfUintptrV(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntfUintptrV(v map[interface{}]uintptr, checkNil bool, canChange bool, + d *Decoder) (_ map[interface{}]uintptr, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[interface{}]uintptr, xlen) + changed = true + } + + var mk interface{} + var mv uintptr + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = nil + d.decode(&mk) + if bv, bok := mk.([]byte); bok { + mk = d.string(bv) + } + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = nil + d.decode(&mk) + if bv, bok := mk.([]byte); bok { + mk = d.string(bv) + } + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + func (f *decFnInfo) fastpathDecMapIntfIntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[interface{}]int) @@ -10975,14 +15868,16 @@ func (_ fastpathT) DecMapIntfIntV(v map[interface{}]int, checkNil bool, canChang v = make(map[interface{}]int, xlen) changed = true } + + var mk interface{} + var mv int if containerLen > 0 { for j := 0; j < containerLen; j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -10990,12 +15885,11 @@ func (_ fastpathT) DecMapIntfIntV(v map[interface{}]int, checkNil bool, canChang } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -11041,14 +15935,16 @@ func (_ fastpathT) DecMapIntfInt8V(v map[interface{}]int8, checkNil bool, canCha v = make(map[interface{}]int8, xlen) changed = true } + + var mk interface{} + var mv int8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -11056,12 +15952,11 @@ func (_ fastpathT) DecMapIntfInt8V(v map[interface{}]int8, checkNil bool, canCha } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -11107,14 +16002,16 @@ func (_ fastpathT) DecMapIntfInt16V(v map[interface{}]int16, checkNil bool, canC v = make(map[interface{}]int16, xlen) changed = true } + + var mk interface{} + var mv int16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -11122,12 +16019,11 @@ func (_ fastpathT) DecMapIntfInt16V(v map[interface{}]int16, checkNil bool, canC } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -11173,14 +16069,16 @@ func (_ fastpathT) DecMapIntfInt32V(v map[interface{}]int32, checkNil bool, canC v = make(map[interface{}]int32, xlen) changed = true } + + var mk interface{} + var mv int32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -11188,12 +16086,11 @@ func (_ fastpathT) DecMapIntfInt32V(v map[interface{}]int32, checkNil bool, canC } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -11239,14 +16136,16 @@ func (_ fastpathT) DecMapIntfInt64V(v map[interface{}]int64, checkNil bool, canC v = make(map[interface{}]int64, xlen) changed = true } + + var mk interface{} + var mv int64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -11254,12 +16153,11 @@ func (_ fastpathT) DecMapIntfInt64V(v map[interface{}]int64, checkNil bool, canC } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -11305,14 +16203,16 @@ func (_ fastpathT) DecMapIntfFloat32V(v map[interface{}]float32, checkNil bool, v = make(map[interface{}]float32, xlen) changed = true } + + var mk interface{} + var mv float32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -11320,12 +16220,11 @@ func (_ fastpathT) DecMapIntfFloat32V(v map[interface{}]float32, checkNil bool, } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -11371,14 +16270,16 @@ func (_ fastpathT) DecMapIntfFloat64V(v map[interface{}]float64, checkNil bool, v = make(map[interface{}]float64, xlen) changed = true } + + var mk interface{} + var mv float64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -11386,12 +16287,11 @@ func (_ fastpathT) DecMapIntfFloat64V(v map[interface{}]float64, checkNil bool, } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -11437,14 +16337,16 @@ func (_ fastpathT) DecMapIntfBoolV(v map[interface{}]bool, checkNil bool, canCha v = make(map[interface{}]bool, xlen) changed = true } + + var mk interface{} + var mv bool if containerLen > 0 { for j := 0; j < containerLen; j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -11452,12 +16354,11 @@ func (_ fastpathT) DecMapIntfBoolV(v map[interface{}]bool, checkNil bool, canCha } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - var mk interface{} + mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) + mk = d.string(bv) } - mv := v[mk] mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -11503,22 +16404,31 @@ func (_ fastpathT) DecMapStringIntfV(v map[string]interface{}, checkNil bool, ca v = make(map[string]interface{}, xlen) changed = true } + mapGet := !d.h.MapValueReset && !d.h.InterfaceReset + var mk string + var mv interface{} if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } @@ -11563,10 +16473,12 @@ func (_ fastpathT) DecMapStringStringV(v map[string]string, checkNil bool, canCh v = make(map[string]string, xlen) changed = true } + + var mk string + var mv string if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -11574,8 +16486,7 @@ func (_ fastpathT) DecMapStringStringV(v map[string]string, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -11621,10 +16532,12 @@ func (_ fastpathT) DecMapStringUintV(v map[string]uint, checkNil bool, canChange v = make(map[string]uint, xlen) changed = true } + + var mk string + var mv uint if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -11632,8 +16545,7 @@ func (_ fastpathT) DecMapStringUintV(v map[string]uint, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -11679,10 +16591,12 @@ func (_ fastpathT) DecMapStringUint8V(v map[string]uint8, checkNil bool, canChan v = make(map[string]uint8, xlen) changed = true } + + var mk string + var mv uint8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -11690,8 +16604,7 @@ func (_ fastpathT) DecMapStringUint8V(v map[string]uint8, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -11737,10 +16650,12 @@ func (_ fastpathT) DecMapStringUint16V(v map[string]uint16, checkNil bool, canCh v = make(map[string]uint16, xlen) changed = true } + + var mk string + var mv uint16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -11748,8 +16663,7 @@ func (_ fastpathT) DecMapStringUint16V(v map[string]uint16, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -11795,10 +16709,12 @@ func (_ fastpathT) DecMapStringUint32V(v map[string]uint32, checkNil bool, canCh v = make(map[string]uint32, xlen) changed = true } + + var mk string + var mv uint32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -11806,8 +16722,7 @@ func (_ fastpathT) DecMapStringUint32V(v map[string]uint32, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -11853,10 +16768,12 @@ func (_ fastpathT) DecMapStringUint64V(v map[string]uint64, checkNil bool, canCh v = make(map[string]uint64, xlen) changed = true } + + var mk string + var mv uint64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -11864,8 +16781,7 @@ func (_ fastpathT) DecMapStringUint64V(v map[string]uint64, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -11876,6 +16792,65 @@ func (_ fastpathT) DecMapStringUint64V(v map[string]uint64, checkNil bool, canCh return v, changed } +func (f *decFnInfo) fastpathDecMapStringUintptrR(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[string]uintptr) + v, changed := fastpathTV.DecMapStringUintptrV(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[string]uintptr) + fastpathTV.DecMapStringUintptrV(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapStringUintptrX(vp *map[string]uintptr, checkNil bool, d *Decoder) { + v, changed := f.DecMapStringUintptrV(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapStringUintptrV(v map[string]uintptr, checkNil bool, canChange bool, + d *Decoder) (_ map[string]uintptr, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[string]uintptr, xlen) + changed = true + } + + var mk string + var mv uintptr + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = dd.DecodeString() + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = dd.DecodeString() + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + func (f *decFnInfo) fastpathDecMapStringIntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[string]int) @@ -11911,10 +16886,12 @@ func (_ fastpathT) DecMapStringIntV(v map[string]int, checkNil bool, canChange b v = make(map[string]int, xlen) changed = true } + + var mk string + var mv int if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -11922,8 +16899,7 @@ func (_ fastpathT) DecMapStringIntV(v map[string]int, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -11969,10 +16945,12 @@ func (_ fastpathT) DecMapStringInt8V(v map[string]int8, checkNil bool, canChange v = make(map[string]int8, xlen) changed = true } + + var mk string + var mv int8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -11980,8 +16958,7 @@ func (_ fastpathT) DecMapStringInt8V(v map[string]int8, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -12027,10 +17004,12 @@ func (_ fastpathT) DecMapStringInt16V(v map[string]int16, checkNil bool, canChan v = make(map[string]int16, xlen) changed = true } + + var mk string + var mv int16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -12038,8 +17017,7 @@ func (_ fastpathT) DecMapStringInt16V(v map[string]int16, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -12085,10 +17063,12 @@ func (_ fastpathT) DecMapStringInt32V(v map[string]int32, checkNil bool, canChan v = make(map[string]int32, xlen) changed = true } + + var mk string + var mv int32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -12096,8 +17076,7 @@ func (_ fastpathT) DecMapStringInt32V(v map[string]int32, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -12143,10 +17122,12 @@ func (_ fastpathT) DecMapStringInt64V(v map[string]int64, checkNil bool, canChan v = make(map[string]int64, xlen) changed = true } + + var mk string + var mv int64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -12154,8 +17135,7 @@ func (_ fastpathT) DecMapStringInt64V(v map[string]int64, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -12201,10 +17181,12 @@ func (_ fastpathT) DecMapStringFloat32V(v map[string]float32, checkNil bool, can v = make(map[string]float32, xlen) changed = true } + + var mk string + var mv float32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -12212,8 +17194,7 @@ func (_ fastpathT) DecMapStringFloat32V(v map[string]float32, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -12259,10 +17240,12 @@ func (_ fastpathT) DecMapStringFloat64V(v map[string]float64, checkNil bool, can v = make(map[string]float64, xlen) changed = true } + + var mk string + var mv float64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -12270,8 +17253,7 @@ func (_ fastpathT) DecMapStringFloat64V(v map[string]float64, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -12317,10 +17299,12 @@ func (_ fastpathT) DecMapStringBoolV(v map[string]bool, checkNil bool, canChange v = make(map[string]bool, xlen) changed = true } + + var mk string + var mv bool if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -12328,8 +17312,7 @@ func (_ fastpathT) DecMapStringBoolV(v map[string]bool, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeString() - mv := v[mk] + mk = dd.DecodeString() mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -12375,22 +17358,31 @@ func (_ fastpathT) DecMapFloat32IntfV(v map[float32]interface{}, checkNil bool, v = make(map[float32]interface{}, xlen) changed = true } + mapGet := !d.h.MapValueReset && !d.h.InterfaceReset + var mk float32 + var mv interface{} if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } @@ -12435,10 +17427,12 @@ func (_ fastpathT) DecMapFloat32StringV(v map[float32]string, checkNil bool, can v = make(map[float32]string, xlen) changed = true } + + var mk float32 + var mv string if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -12446,8 +17440,7 @@ func (_ fastpathT) DecMapFloat32StringV(v map[float32]string, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -12493,10 +17486,12 @@ func (_ fastpathT) DecMapFloat32UintV(v map[float32]uint, checkNil bool, canChan v = make(map[float32]uint, xlen) changed = true } + + var mk float32 + var mv uint if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -12504,8 +17499,7 @@ func (_ fastpathT) DecMapFloat32UintV(v map[float32]uint, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -12551,10 +17545,12 @@ func (_ fastpathT) DecMapFloat32Uint8V(v map[float32]uint8, checkNil bool, canCh v = make(map[float32]uint8, xlen) changed = true } + + var mk float32 + var mv uint8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -12562,8 +17558,7 @@ func (_ fastpathT) DecMapFloat32Uint8V(v map[float32]uint8, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -12609,10 +17604,12 @@ func (_ fastpathT) DecMapFloat32Uint16V(v map[float32]uint16, checkNil bool, can v = make(map[float32]uint16, xlen) changed = true } + + var mk float32 + var mv uint16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -12620,8 +17617,7 @@ func (_ fastpathT) DecMapFloat32Uint16V(v map[float32]uint16, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -12667,10 +17663,12 @@ func (_ fastpathT) DecMapFloat32Uint32V(v map[float32]uint32, checkNil bool, can v = make(map[float32]uint32, xlen) changed = true } + + var mk float32 + var mv uint32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -12678,8 +17676,7 @@ func (_ fastpathT) DecMapFloat32Uint32V(v map[float32]uint32, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -12725,10 +17722,12 @@ func (_ fastpathT) DecMapFloat32Uint64V(v map[float32]uint64, checkNil bool, can v = make(map[float32]uint64, xlen) changed = true } + + var mk float32 + var mv uint64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -12736,8 +17735,7 @@ func (_ fastpathT) DecMapFloat32Uint64V(v map[float32]uint64, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -12748,6 +17746,65 @@ func (_ fastpathT) DecMapFloat32Uint64V(v map[float32]uint64, checkNil bool, can return v, changed } +func (f *decFnInfo) fastpathDecMapFloat32UintptrR(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[float32]uintptr) + v, changed := fastpathTV.DecMapFloat32UintptrV(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[float32]uintptr) + fastpathTV.DecMapFloat32UintptrV(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapFloat32UintptrX(vp *map[float32]uintptr, checkNil bool, d *Decoder) { + v, changed := f.DecMapFloat32UintptrV(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat32UintptrV(v map[float32]uintptr, checkNil bool, canChange bool, + d *Decoder) (_ map[float32]uintptr, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[float32]uintptr, xlen) + changed = true + } + + var mk float32 + var mv uintptr + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = float32(dd.DecodeFloat(true)) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = float32(dd.DecodeFloat(true)) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + func (f *decFnInfo) fastpathDecMapFloat32IntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float32]int) @@ -12783,10 +17840,12 @@ func (_ fastpathT) DecMapFloat32IntV(v map[float32]int, checkNil bool, canChange v = make(map[float32]int, xlen) changed = true } + + var mk float32 + var mv int if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -12794,8 +17853,7 @@ func (_ fastpathT) DecMapFloat32IntV(v map[float32]int, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -12841,10 +17899,12 @@ func (_ fastpathT) DecMapFloat32Int8V(v map[float32]int8, checkNil bool, canChan v = make(map[float32]int8, xlen) changed = true } + + var mk float32 + var mv int8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -12852,8 +17912,7 @@ func (_ fastpathT) DecMapFloat32Int8V(v map[float32]int8, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -12899,10 +17958,12 @@ func (_ fastpathT) DecMapFloat32Int16V(v map[float32]int16, checkNil bool, canCh v = make(map[float32]int16, xlen) changed = true } + + var mk float32 + var mv int16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -12910,8 +17971,7 @@ func (_ fastpathT) DecMapFloat32Int16V(v map[float32]int16, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -12957,10 +18017,12 @@ func (_ fastpathT) DecMapFloat32Int32V(v map[float32]int32, checkNil bool, canCh v = make(map[float32]int32, xlen) changed = true } + + var mk float32 + var mv int32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -12968,8 +18030,7 @@ func (_ fastpathT) DecMapFloat32Int32V(v map[float32]int32, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -13015,10 +18076,12 @@ func (_ fastpathT) DecMapFloat32Int64V(v map[float32]int64, checkNil bool, canCh v = make(map[float32]int64, xlen) changed = true } + + var mk float32 + var mv int64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -13026,8 +18089,7 @@ func (_ fastpathT) DecMapFloat32Int64V(v map[float32]int64, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -13073,10 +18135,12 @@ func (_ fastpathT) DecMapFloat32Float32V(v map[float32]float32, checkNil bool, c v = make(map[float32]float32, xlen) changed = true } + + var mk float32 + var mv float32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -13084,8 +18148,7 @@ func (_ fastpathT) DecMapFloat32Float32V(v map[float32]float32, checkNil bool, c } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -13131,10 +18194,12 @@ func (_ fastpathT) DecMapFloat32Float64V(v map[float32]float64, checkNil bool, c v = make(map[float32]float64, xlen) changed = true } + + var mk float32 + var mv float64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -13142,8 +18207,7 @@ func (_ fastpathT) DecMapFloat32Float64V(v map[float32]float64, checkNil bool, c } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -13189,10 +18253,12 @@ func (_ fastpathT) DecMapFloat32BoolV(v map[float32]bool, checkNil bool, canChan v = make(map[float32]bool, xlen) changed = true } + + var mk float32 + var mv bool if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -13200,8 +18266,7 @@ func (_ fastpathT) DecMapFloat32BoolV(v map[float32]bool, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := float32(dd.DecodeFloat(true)) - mv := v[mk] + mk = float32(dd.DecodeFloat(true)) mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -13247,22 +18312,31 @@ func (_ fastpathT) DecMapFloat64IntfV(v map[float64]interface{}, checkNil bool, v = make(map[float64]interface{}, xlen) changed = true } + mapGet := !d.h.MapValueReset && !d.h.InterfaceReset + var mk float64 + var mv interface{} if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } @@ -13307,10 +18381,12 @@ func (_ fastpathT) DecMapFloat64StringV(v map[float64]string, checkNil bool, can v = make(map[float64]string, xlen) changed = true } + + var mk float64 + var mv string if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -13318,8 +18394,7 @@ func (_ fastpathT) DecMapFloat64StringV(v map[float64]string, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -13365,10 +18440,12 @@ func (_ fastpathT) DecMapFloat64UintV(v map[float64]uint, checkNil bool, canChan v = make(map[float64]uint, xlen) changed = true } + + var mk float64 + var mv uint if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -13376,8 +18453,7 @@ func (_ fastpathT) DecMapFloat64UintV(v map[float64]uint, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -13423,10 +18499,12 @@ func (_ fastpathT) DecMapFloat64Uint8V(v map[float64]uint8, checkNil bool, canCh v = make(map[float64]uint8, xlen) changed = true } + + var mk float64 + var mv uint8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -13434,8 +18512,7 @@ func (_ fastpathT) DecMapFloat64Uint8V(v map[float64]uint8, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -13481,10 +18558,12 @@ func (_ fastpathT) DecMapFloat64Uint16V(v map[float64]uint16, checkNil bool, can v = make(map[float64]uint16, xlen) changed = true } + + var mk float64 + var mv uint16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -13492,8 +18571,7 @@ func (_ fastpathT) DecMapFloat64Uint16V(v map[float64]uint16, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -13539,10 +18617,12 @@ func (_ fastpathT) DecMapFloat64Uint32V(v map[float64]uint32, checkNil bool, can v = make(map[float64]uint32, xlen) changed = true } + + var mk float64 + var mv uint32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -13550,8 +18630,7 @@ func (_ fastpathT) DecMapFloat64Uint32V(v map[float64]uint32, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -13597,10 +18676,12 @@ func (_ fastpathT) DecMapFloat64Uint64V(v map[float64]uint64, checkNil bool, can v = make(map[float64]uint64, xlen) changed = true } + + var mk float64 + var mv uint64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -13608,8 +18689,7 @@ func (_ fastpathT) DecMapFloat64Uint64V(v map[float64]uint64, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -13620,6 +18700,65 @@ func (_ fastpathT) DecMapFloat64Uint64V(v map[float64]uint64, checkNil bool, can return v, changed } +func (f *decFnInfo) fastpathDecMapFloat64UintptrR(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[float64]uintptr) + v, changed := fastpathTV.DecMapFloat64UintptrV(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[float64]uintptr) + fastpathTV.DecMapFloat64UintptrV(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapFloat64UintptrX(vp *map[float64]uintptr, checkNil bool, d *Decoder) { + v, changed := f.DecMapFloat64UintptrV(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat64UintptrV(v map[float64]uintptr, checkNil bool, canChange bool, + d *Decoder) (_ map[float64]uintptr, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[float64]uintptr, xlen) + changed = true + } + + var mk float64 + var mv uintptr + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = dd.DecodeFloat(false) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = dd.DecodeFloat(false) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + func (f *decFnInfo) fastpathDecMapFloat64IntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[float64]int) @@ -13655,10 +18794,12 @@ func (_ fastpathT) DecMapFloat64IntV(v map[float64]int, checkNil bool, canChange v = make(map[float64]int, xlen) changed = true } + + var mk float64 + var mv int if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -13666,8 +18807,7 @@ func (_ fastpathT) DecMapFloat64IntV(v map[float64]int, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -13713,10 +18853,12 @@ func (_ fastpathT) DecMapFloat64Int8V(v map[float64]int8, checkNil bool, canChan v = make(map[float64]int8, xlen) changed = true } + + var mk float64 + var mv int8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -13724,8 +18866,7 @@ func (_ fastpathT) DecMapFloat64Int8V(v map[float64]int8, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -13771,10 +18912,12 @@ func (_ fastpathT) DecMapFloat64Int16V(v map[float64]int16, checkNil bool, canCh v = make(map[float64]int16, xlen) changed = true } + + var mk float64 + var mv int16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -13782,8 +18925,7 @@ func (_ fastpathT) DecMapFloat64Int16V(v map[float64]int16, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -13829,10 +18971,12 @@ func (_ fastpathT) DecMapFloat64Int32V(v map[float64]int32, checkNil bool, canCh v = make(map[float64]int32, xlen) changed = true } + + var mk float64 + var mv int32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -13840,8 +18984,7 @@ func (_ fastpathT) DecMapFloat64Int32V(v map[float64]int32, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -13887,10 +19030,12 @@ func (_ fastpathT) DecMapFloat64Int64V(v map[float64]int64, checkNil bool, canCh v = make(map[float64]int64, xlen) changed = true } + + var mk float64 + var mv int64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -13898,8 +19043,7 @@ func (_ fastpathT) DecMapFloat64Int64V(v map[float64]int64, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -13945,10 +19089,12 @@ func (_ fastpathT) DecMapFloat64Float32V(v map[float64]float32, checkNil bool, c v = make(map[float64]float32, xlen) changed = true } + + var mk float64 + var mv float32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -13956,8 +19102,7 @@ func (_ fastpathT) DecMapFloat64Float32V(v map[float64]float32, checkNil bool, c } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -14003,10 +19148,12 @@ func (_ fastpathT) DecMapFloat64Float64V(v map[float64]float64, checkNil bool, c v = make(map[float64]float64, xlen) changed = true } + + var mk float64 + var mv float64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -14014,8 +19161,7 @@ func (_ fastpathT) DecMapFloat64Float64V(v map[float64]float64, checkNil bool, c } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -14061,10 +19207,12 @@ func (_ fastpathT) DecMapFloat64BoolV(v map[float64]bool, checkNil bool, canChan v = make(map[float64]bool, xlen) changed = true } + + var mk float64 + var mv bool if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -14072,8 +19220,7 @@ func (_ fastpathT) DecMapFloat64BoolV(v map[float64]bool, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeFloat(false) - mv := v[mk] + mk = dd.DecodeFloat(false) mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -14119,22 +19266,31 @@ func (_ fastpathT) DecMapUintIntfV(v map[uint]interface{}, checkNil bool, canCha v = make(map[uint]interface{}, xlen) changed = true } + mapGet := !d.h.MapValueReset && !d.h.InterfaceReset + var mk uint + var mv interface{} if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } @@ -14179,10 +19335,12 @@ func (_ fastpathT) DecMapUintStringV(v map[uint]string, checkNil bool, canChange v = make(map[uint]string, xlen) changed = true } + + var mk uint + var mv string if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -14190,8 +19348,7 @@ func (_ fastpathT) DecMapUintStringV(v map[uint]string, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -14237,10 +19394,12 @@ func (_ fastpathT) DecMapUintUintV(v map[uint]uint, checkNil bool, canChange boo v = make(map[uint]uint, xlen) changed = true } + + var mk uint + var mv uint if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -14248,8 +19407,7 @@ func (_ fastpathT) DecMapUintUintV(v map[uint]uint, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -14295,10 +19453,12 @@ func (_ fastpathT) DecMapUintUint8V(v map[uint]uint8, checkNil bool, canChange b v = make(map[uint]uint8, xlen) changed = true } + + var mk uint + var mv uint8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -14306,8 +19466,7 @@ func (_ fastpathT) DecMapUintUint8V(v map[uint]uint8, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -14353,10 +19512,12 @@ func (_ fastpathT) DecMapUintUint16V(v map[uint]uint16, checkNil bool, canChange v = make(map[uint]uint16, xlen) changed = true } + + var mk uint + var mv uint16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -14364,8 +19525,7 @@ func (_ fastpathT) DecMapUintUint16V(v map[uint]uint16, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -14411,10 +19571,12 @@ func (_ fastpathT) DecMapUintUint32V(v map[uint]uint32, checkNil bool, canChange v = make(map[uint]uint32, xlen) changed = true } + + var mk uint + var mv uint32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -14422,8 +19584,7 @@ func (_ fastpathT) DecMapUintUint32V(v map[uint]uint32, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -14469,10 +19630,12 @@ func (_ fastpathT) DecMapUintUint64V(v map[uint]uint64, checkNil bool, canChange v = make(map[uint]uint64, xlen) changed = true } + + var mk uint + var mv uint64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -14480,8 +19643,7 @@ func (_ fastpathT) DecMapUintUint64V(v map[uint]uint64, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -14492,6 +19654,65 @@ func (_ fastpathT) DecMapUintUint64V(v map[uint]uint64, checkNil bool, canChange return v, changed } +func (f *decFnInfo) fastpathDecMapUintUintptrR(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[uint]uintptr) + v, changed := fastpathTV.DecMapUintUintptrV(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[uint]uintptr) + fastpathTV.DecMapUintUintptrV(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapUintUintptrX(vp *map[uint]uintptr, checkNil bool, d *Decoder) { + v, changed := f.DecMapUintUintptrV(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintUintptrV(v map[uint]uintptr, checkNil bool, canChange bool, + d *Decoder) (_ map[uint]uintptr, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uint]uintptr, xlen) + changed = true + } + + var mk uint + var mv uintptr + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = uint(dd.DecodeUint(uintBitsize)) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = uint(dd.DecodeUint(uintBitsize)) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + func (f *decFnInfo) fastpathDecMapUintIntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint]int) @@ -14527,10 +19748,12 @@ func (_ fastpathT) DecMapUintIntV(v map[uint]int, checkNil bool, canChange bool, v = make(map[uint]int, xlen) changed = true } + + var mk uint + var mv int if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -14538,8 +19761,7 @@ func (_ fastpathT) DecMapUintIntV(v map[uint]int, checkNil bool, canChange bool, } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -14585,10 +19807,12 @@ func (_ fastpathT) DecMapUintInt8V(v map[uint]int8, checkNil bool, canChange boo v = make(map[uint]int8, xlen) changed = true } + + var mk uint + var mv int8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -14596,8 +19820,7 @@ func (_ fastpathT) DecMapUintInt8V(v map[uint]int8, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -14643,10 +19866,12 @@ func (_ fastpathT) DecMapUintInt16V(v map[uint]int16, checkNil bool, canChange b v = make(map[uint]int16, xlen) changed = true } + + var mk uint + var mv int16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -14654,8 +19879,7 @@ func (_ fastpathT) DecMapUintInt16V(v map[uint]int16, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -14701,10 +19925,12 @@ func (_ fastpathT) DecMapUintInt32V(v map[uint]int32, checkNil bool, canChange b v = make(map[uint]int32, xlen) changed = true } + + var mk uint + var mv int32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -14712,8 +19938,7 @@ func (_ fastpathT) DecMapUintInt32V(v map[uint]int32, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -14759,10 +19984,12 @@ func (_ fastpathT) DecMapUintInt64V(v map[uint]int64, checkNil bool, canChange b v = make(map[uint]int64, xlen) changed = true } + + var mk uint + var mv int64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -14770,8 +19997,7 @@ func (_ fastpathT) DecMapUintInt64V(v map[uint]int64, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -14817,10 +20043,12 @@ func (_ fastpathT) DecMapUintFloat32V(v map[uint]float32, checkNil bool, canChan v = make(map[uint]float32, xlen) changed = true } + + var mk uint + var mv float32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -14828,8 +20056,7 @@ func (_ fastpathT) DecMapUintFloat32V(v map[uint]float32, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -14875,10 +20102,12 @@ func (_ fastpathT) DecMapUintFloat64V(v map[uint]float64, checkNil bool, canChan v = make(map[uint]float64, xlen) changed = true } + + var mk uint + var mv float64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -14886,8 +20115,7 @@ func (_ fastpathT) DecMapUintFloat64V(v map[uint]float64, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -14933,10 +20161,12 @@ func (_ fastpathT) DecMapUintBoolV(v map[uint]bool, checkNil bool, canChange boo v = make(map[uint]bool, xlen) changed = true } + + var mk uint + var mv bool if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -14944,8 +20174,7 @@ func (_ fastpathT) DecMapUintBoolV(v map[uint]bool, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint(dd.DecodeUint(uintBitsize)) - mv := v[mk] + mk = uint(dd.DecodeUint(uintBitsize)) mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -14991,22 +20220,31 @@ func (_ fastpathT) DecMapUint8IntfV(v map[uint8]interface{}, checkNil bool, canC v = make(map[uint8]interface{}, xlen) changed = true } + mapGet := !d.h.MapValueReset && !d.h.InterfaceReset + var mk uint8 + var mv interface{} if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } @@ -15051,10 +20289,12 @@ func (_ fastpathT) DecMapUint8StringV(v map[uint8]string, checkNil bool, canChan v = make(map[uint8]string, xlen) changed = true } + + var mk uint8 + var mv string if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -15062,8 +20302,7 @@ func (_ fastpathT) DecMapUint8StringV(v map[uint8]string, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -15109,10 +20348,12 @@ func (_ fastpathT) DecMapUint8UintV(v map[uint8]uint, checkNil bool, canChange b v = make(map[uint8]uint, xlen) changed = true } + + var mk uint8 + var mv uint if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -15120,8 +20361,7 @@ func (_ fastpathT) DecMapUint8UintV(v map[uint8]uint, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -15167,10 +20407,12 @@ func (_ fastpathT) DecMapUint8Uint8V(v map[uint8]uint8, checkNil bool, canChange v = make(map[uint8]uint8, xlen) changed = true } + + var mk uint8 + var mv uint8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -15178,8 +20420,7 @@ func (_ fastpathT) DecMapUint8Uint8V(v map[uint8]uint8, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -15225,10 +20466,12 @@ func (_ fastpathT) DecMapUint8Uint16V(v map[uint8]uint16, checkNil bool, canChan v = make(map[uint8]uint16, xlen) changed = true } + + var mk uint8 + var mv uint16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -15236,8 +20479,7 @@ func (_ fastpathT) DecMapUint8Uint16V(v map[uint8]uint16, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -15283,10 +20525,12 @@ func (_ fastpathT) DecMapUint8Uint32V(v map[uint8]uint32, checkNil bool, canChan v = make(map[uint8]uint32, xlen) changed = true } + + var mk uint8 + var mv uint32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -15294,8 +20538,7 @@ func (_ fastpathT) DecMapUint8Uint32V(v map[uint8]uint32, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -15341,10 +20584,12 @@ func (_ fastpathT) DecMapUint8Uint64V(v map[uint8]uint64, checkNil bool, canChan v = make(map[uint8]uint64, xlen) changed = true } + + var mk uint8 + var mv uint64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -15352,8 +20597,7 @@ func (_ fastpathT) DecMapUint8Uint64V(v map[uint8]uint64, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -15364,6 +20608,65 @@ func (_ fastpathT) DecMapUint8Uint64V(v map[uint8]uint64, checkNil bool, canChan return v, changed } +func (f *decFnInfo) fastpathDecMapUint8UintptrR(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[uint8]uintptr) + v, changed := fastpathTV.DecMapUint8UintptrV(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[uint8]uintptr) + fastpathTV.DecMapUint8UintptrV(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapUint8UintptrX(vp *map[uint8]uintptr, checkNil bool, d *Decoder) { + v, changed := f.DecMapUint8UintptrV(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint8UintptrV(v map[uint8]uintptr, checkNil bool, canChange bool, + d *Decoder) (_ map[uint8]uintptr, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uint8]uintptr, xlen) + changed = true + } + + var mk uint8 + var mv uintptr + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = uint8(dd.DecodeUint(8)) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = uint8(dd.DecodeUint(8)) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + func (f *decFnInfo) fastpathDecMapUint8IntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint8]int) @@ -15399,10 +20702,12 @@ func (_ fastpathT) DecMapUint8IntV(v map[uint8]int, checkNil bool, canChange boo v = make(map[uint8]int, xlen) changed = true } + + var mk uint8 + var mv int if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -15410,8 +20715,7 @@ func (_ fastpathT) DecMapUint8IntV(v map[uint8]int, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -15457,10 +20761,12 @@ func (_ fastpathT) DecMapUint8Int8V(v map[uint8]int8, checkNil bool, canChange b v = make(map[uint8]int8, xlen) changed = true } + + var mk uint8 + var mv int8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -15468,8 +20774,7 @@ func (_ fastpathT) DecMapUint8Int8V(v map[uint8]int8, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -15515,10 +20820,12 @@ func (_ fastpathT) DecMapUint8Int16V(v map[uint8]int16, checkNil bool, canChange v = make(map[uint8]int16, xlen) changed = true } + + var mk uint8 + var mv int16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -15526,8 +20833,7 @@ func (_ fastpathT) DecMapUint8Int16V(v map[uint8]int16, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -15573,10 +20879,12 @@ func (_ fastpathT) DecMapUint8Int32V(v map[uint8]int32, checkNil bool, canChange v = make(map[uint8]int32, xlen) changed = true } + + var mk uint8 + var mv int32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -15584,8 +20892,7 @@ func (_ fastpathT) DecMapUint8Int32V(v map[uint8]int32, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -15631,10 +20938,12 @@ func (_ fastpathT) DecMapUint8Int64V(v map[uint8]int64, checkNil bool, canChange v = make(map[uint8]int64, xlen) changed = true } + + var mk uint8 + var mv int64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -15642,8 +20951,7 @@ func (_ fastpathT) DecMapUint8Int64V(v map[uint8]int64, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -15689,10 +20997,12 @@ func (_ fastpathT) DecMapUint8Float32V(v map[uint8]float32, checkNil bool, canCh v = make(map[uint8]float32, xlen) changed = true } + + var mk uint8 + var mv float32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -15700,8 +21010,7 @@ func (_ fastpathT) DecMapUint8Float32V(v map[uint8]float32, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -15747,10 +21056,12 @@ func (_ fastpathT) DecMapUint8Float64V(v map[uint8]float64, checkNil bool, canCh v = make(map[uint8]float64, xlen) changed = true } + + var mk uint8 + var mv float64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -15758,8 +21069,7 @@ func (_ fastpathT) DecMapUint8Float64V(v map[uint8]float64, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -15805,10 +21115,12 @@ func (_ fastpathT) DecMapUint8BoolV(v map[uint8]bool, checkNil bool, canChange b v = make(map[uint8]bool, xlen) changed = true } + + var mk uint8 + var mv bool if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -15816,8 +21128,7 @@ func (_ fastpathT) DecMapUint8BoolV(v map[uint8]bool, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint8(dd.DecodeUint(8)) - mv := v[mk] + mk = uint8(dd.DecodeUint(8)) mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -15863,22 +21174,31 @@ func (_ fastpathT) DecMapUint16IntfV(v map[uint16]interface{}, checkNil bool, ca v = make(map[uint16]interface{}, xlen) changed = true } + mapGet := !d.h.MapValueReset && !d.h.InterfaceReset + var mk uint16 + var mv interface{} if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } @@ -15923,10 +21243,12 @@ func (_ fastpathT) DecMapUint16StringV(v map[uint16]string, checkNil bool, canCh v = make(map[uint16]string, xlen) changed = true } + + var mk uint16 + var mv string if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -15934,8 +21256,7 @@ func (_ fastpathT) DecMapUint16StringV(v map[uint16]string, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -15981,10 +21302,12 @@ func (_ fastpathT) DecMapUint16UintV(v map[uint16]uint, checkNil bool, canChange v = make(map[uint16]uint, xlen) changed = true } + + var mk uint16 + var mv uint if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -15992,8 +21315,7 @@ func (_ fastpathT) DecMapUint16UintV(v map[uint16]uint, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -16039,10 +21361,12 @@ func (_ fastpathT) DecMapUint16Uint8V(v map[uint16]uint8, checkNil bool, canChan v = make(map[uint16]uint8, xlen) changed = true } + + var mk uint16 + var mv uint8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -16050,8 +21374,7 @@ func (_ fastpathT) DecMapUint16Uint8V(v map[uint16]uint8, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -16097,10 +21420,12 @@ func (_ fastpathT) DecMapUint16Uint16V(v map[uint16]uint16, checkNil bool, canCh v = make(map[uint16]uint16, xlen) changed = true } + + var mk uint16 + var mv uint16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -16108,8 +21433,7 @@ func (_ fastpathT) DecMapUint16Uint16V(v map[uint16]uint16, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -16155,10 +21479,12 @@ func (_ fastpathT) DecMapUint16Uint32V(v map[uint16]uint32, checkNil bool, canCh v = make(map[uint16]uint32, xlen) changed = true } + + var mk uint16 + var mv uint32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -16166,8 +21492,7 @@ func (_ fastpathT) DecMapUint16Uint32V(v map[uint16]uint32, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -16213,10 +21538,12 @@ func (_ fastpathT) DecMapUint16Uint64V(v map[uint16]uint64, checkNil bool, canCh v = make(map[uint16]uint64, xlen) changed = true } + + var mk uint16 + var mv uint64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -16224,8 +21551,7 @@ func (_ fastpathT) DecMapUint16Uint64V(v map[uint16]uint64, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -16236,6 +21562,65 @@ func (_ fastpathT) DecMapUint16Uint64V(v map[uint16]uint64, checkNil bool, canCh return v, changed } +func (f *decFnInfo) fastpathDecMapUint16UintptrR(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[uint16]uintptr) + v, changed := fastpathTV.DecMapUint16UintptrV(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[uint16]uintptr) + fastpathTV.DecMapUint16UintptrV(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapUint16UintptrX(vp *map[uint16]uintptr, checkNil bool, d *Decoder) { + v, changed := f.DecMapUint16UintptrV(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint16UintptrV(v map[uint16]uintptr, checkNil bool, canChange bool, + d *Decoder) (_ map[uint16]uintptr, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[uint16]uintptr, xlen) + changed = true + } + + var mk uint16 + var mv uintptr + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = uint16(dd.DecodeUint(16)) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = uint16(dd.DecodeUint(16)) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + func (f *decFnInfo) fastpathDecMapUint16IntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint16]int) @@ -16271,10 +21656,12 @@ func (_ fastpathT) DecMapUint16IntV(v map[uint16]int, checkNil bool, canChange b v = make(map[uint16]int, xlen) changed = true } + + var mk uint16 + var mv int if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -16282,8 +21669,7 @@ func (_ fastpathT) DecMapUint16IntV(v map[uint16]int, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -16329,10 +21715,12 @@ func (_ fastpathT) DecMapUint16Int8V(v map[uint16]int8, checkNil bool, canChange v = make(map[uint16]int8, xlen) changed = true } + + var mk uint16 + var mv int8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -16340,8 +21728,7 @@ func (_ fastpathT) DecMapUint16Int8V(v map[uint16]int8, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -16387,10 +21774,12 @@ func (_ fastpathT) DecMapUint16Int16V(v map[uint16]int16, checkNil bool, canChan v = make(map[uint16]int16, xlen) changed = true } + + var mk uint16 + var mv int16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -16398,8 +21787,7 @@ func (_ fastpathT) DecMapUint16Int16V(v map[uint16]int16, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -16445,10 +21833,12 @@ func (_ fastpathT) DecMapUint16Int32V(v map[uint16]int32, checkNil bool, canChan v = make(map[uint16]int32, xlen) changed = true } + + var mk uint16 + var mv int32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -16456,8 +21846,7 @@ func (_ fastpathT) DecMapUint16Int32V(v map[uint16]int32, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -16503,10 +21892,12 @@ func (_ fastpathT) DecMapUint16Int64V(v map[uint16]int64, checkNil bool, canChan v = make(map[uint16]int64, xlen) changed = true } + + var mk uint16 + var mv int64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -16514,8 +21905,7 @@ func (_ fastpathT) DecMapUint16Int64V(v map[uint16]int64, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -16561,10 +21951,12 @@ func (_ fastpathT) DecMapUint16Float32V(v map[uint16]float32, checkNil bool, can v = make(map[uint16]float32, xlen) changed = true } + + var mk uint16 + var mv float32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -16572,8 +21964,7 @@ func (_ fastpathT) DecMapUint16Float32V(v map[uint16]float32, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -16619,10 +22010,12 @@ func (_ fastpathT) DecMapUint16Float64V(v map[uint16]float64, checkNil bool, can v = make(map[uint16]float64, xlen) changed = true } + + var mk uint16 + var mv float64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -16630,8 +22023,7 @@ func (_ fastpathT) DecMapUint16Float64V(v map[uint16]float64, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -16677,10 +22069,12 @@ func (_ fastpathT) DecMapUint16BoolV(v map[uint16]bool, checkNil bool, canChange v = make(map[uint16]bool, xlen) changed = true } + + var mk uint16 + var mv bool if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -16688,8 +22082,7 @@ func (_ fastpathT) DecMapUint16BoolV(v map[uint16]bool, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint16(dd.DecodeUint(16)) - mv := v[mk] + mk = uint16(dd.DecodeUint(16)) mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -16735,22 +22128,31 @@ func (_ fastpathT) DecMapUint32IntfV(v map[uint32]interface{}, checkNil bool, ca v = make(map[uint32]interface{}, xlen) changed = true } + mapGet := !d.h.MapValueReset && !d.h.InterfaceReset + var mk uint32 + var mv interface{} if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } @@ -16795,10 +22197,12 @@ func (_ fastpathT) DecMapUint32StringV(v map[uint32]string, checkNil bool, canCh v = make(map[uint32]string, xlen) changed = true } + + var mk uint32 + var mv string if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -16806,8 +22210,7 @@ func (_ fastpathT) DecMapUint32StringV(v map[uint32]string, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -16853,10 +22256,12 @@ func (_ fastpathT) DecMapUint32UintV(v map[uint32]uint, checkNil bool, canChange v = make(map[uint32]uint, xlen) changed = true } + + var mk uint32 + var mv uint if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -16864,8 +22269,7 @@ func (_ fastpathT) DecMapUint32UintV(v map[uint32]uint, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -16911,10 +22315,12 @@ func (_ fastpathT) DecMapUint32Uint8V(v map[uint32]uint8, checkNil bool, canChan v = make(map[uint32]uint8, xlen) changed = true } + + var mk uint32 + var mv uint8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -16922,8 +22328,7 @@ func (_ fastpathT) DecMapUint32Uint8V(v map[uint32]uint8, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -16969,10 +22374,12 @@ func (_ fastpathT) DecMapUint32Uint16V(v map[uint32]uint16, checkNil bool, canCh v = make(map[uint32]uint16, xlen) changed = true } + + var mk uint32 + var mv uint16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -16980,8 +22387,7 @@ func (_ fastpathT) DecMapUint32Uint16V(v map[uint32]uint16, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -17027,10 +22433,12 @@ func (_ fastpathT) DecMapUint32Uint32V(v map[uint32]uint32, checkNil bool, canCh v = make(map[uint32]uint32, xlen) changed = true } + + var mk uint32 + var mv uint32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -17038,8 +22446,7 @@ func (_ fastpathT) DecMapUint32Uint32V(v map[uint32]uint32, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -17085,10 +22492,12 @@ func (_ fastpathT) DecMapUint32Uint64V(v map[uint32]uint64, checkNil bool, canCh v = make(map[uint32]uint64, xlen) changed = true } + + var mk uint32 + var mv uint64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -17096,8 +22505,7 @@ func (_ fastpathT) DecMapUint32Uint64V(v map[uint32]uint64, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -17108,6 +22516,65 @@ func (_ fastpathT) DecMapUint32Uint64V(v map[uint32]uint64, checkNil bool, canCh return v, changed } +func (f *decFnInfo) fastpathDecMapUint32UintptrR(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[uint32]uintptr) + v, changed := fastpathTV.DecMapUint32UintptrV(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[uint32]uintptr) + fastpathTV.DecMapUint32UintptrV(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapUint32UintptrX(vp *map[uint32]uintptr, checkNil bool, d *Decoder) { + v, changed := f.DecMapUint32UintptrV(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint32UintptrV(v map[uint32]uintptr, checkNil bool, canChange bool, + d *Decoder) (_ map[uint32]uintptr, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uint32]uintptr, xlen) + changed = true + } + + var mk uint32 + var mv uintptr + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = uint32(dd.DecodeUint(32)) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = uint32(dd.DecodeUint(32)) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + func (f *decFnInfo) fastpathDecMapUint32IntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint32]int) @@ -17143,10 +22610,12 @@ func (_ fastpathT) DecMapUint32IntV(v map[uint32]int, checkNil bool, canChange b v = make(map[uint32]int, xlen) changed = true } + + var mk uint32 + var mv int if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -17154,8 +22623,7 @@ func (_ fastpathT) DecMapUint32IntV(v map[uint32]int, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -17201,10 +22669,12 @@ func (_ fastpathT) DecMapUint32Int8V(v map[uint32]int8, checkNil bool, canChange v = make(map[uint32]int8, xlen) changed = true } + + var mk uint32 + var mv int8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -17212,8 +22682,7 @@ func (_ fastpathT) DecMapUint32Int8V(v map[uint32]int8, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -17259,10 +22728,12 @@ func (_ fastpathT) DecMapUint32Int16V(v map[uint32]int16, checkNil bool, canChan v = make(map[uint32]int16, xlen) changed = true } + + var mk uint32 + var mv int16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -17270,8 +22741,7 @@ func (_ fastpathT) DecMapUint32Int16V(v map[uint32]int16, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -17317,10 +22787,12 @@ func (_ fastpathT) DecMapUint32Int32V(v map[uint32]int32, checkNil bool, canChan v = make(map[uint32]int32, xlen) changed = true } + + var mk uint32 + var mv int32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -17328,8 +22800,7 @@ func (_ fastpathT) DecMapUint32Int32V(v map[uint32]int32, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -17375,10 +22846,12 @@ func (_ fastpathT) DecMapUint32Int64V(v map[uint32]int64, checkNil bool, canChan v = make(map[uint32]int64, xlen) changed = true } + + var mk uint32 + var mv int64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -17386,8 +22859,7 @@ func (_ fastpathT) DecMapUint32Int64V(v map[uint32]int64, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -17433,10 +22905,12 @@ func (_ fastpathT) DecMapUint32Float32V(v map[uint32]float32, checkNil bool, can v = make(map[uint32]float32, xlen) changed = true } + + var mk uint32 + var mv float32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -17444,8 +22918,7 @@ func (_ fastpathT) DecMapUint32Float32V(v map[uint32]float32, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -17491,10 +22964,12 @@ func (_ fastpathT) DecMapUint32Float64V(v map[uint32]float64, checkNil bool, can v = make(map[uint32]float64, xlen) changed = true } + + var mk uint32 + var mv float64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -17502,8 +22977,7 @@ func (_ fastpathT) DecMapUint32Float64V(v map[uint32]float64, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -17549,10 +23023,12 @@ func (_ fastpathT) DecMapUint32BoolV(v map[uint32]bool, checkNil bool, canChange v = make(map[uint32]bool, xlen) changed = true } + + var mk uint32 + var mv bool if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -17560,8 +23036,7 @@ func (_ fastpathT) DecMapUint32BoolV(v map[uint32]bool, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := uint32(dd.DecodeUint(32)) - mv := v[mk] + mk = uint32(dd.DecodeUint(32)) mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -17607,22 +23082,31 @@ func (_ fastpathT) DecMapUint64IntfV(v map[uint64]interface{}, checkNil bool, ca v = make(map[uint64]interface{}, xlen) changed = true } + mapGet := !d.h.MapValueReset && !d.h.InterfaceReset + var mk uint64 + var mv interface{} if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } @@ -17667,10 +23151,12 @@ func (_ fastpathT) DecMapUint64StringV(v map[uint64]string, checkNil bool, canCh v = make(map[uint64]string, xlen) changed = true } + + var mk uint64 + var mv string if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -17678,8 +23164,7 @@ func (_ fastpathT) DecMapUint64StringV(v map[uint64]string, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -17725,10 +23210,12 @@ func (_ fastpathT) DecMapUint64UintV(v map[uint64]uint, checkNil bool, canChange v = make(map[uint64]uint, xlen) changed = true } + + var mk uint64 + var mv uint if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -17736,8 +23223,7 @@ func (_ fastpathT) DecMapUint64UintV(v map[uint64]uint, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -17783,10 +23269,12 @@ func (_ fastpathT) DecMapUint64Uint8V(v map[uint64]uint8, checkNil bool, canChan v = make(map[uint64]uint8, xlen) changed = true } + + var mk uint64 + var mv uint8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -17794,8 +23282,7 @@ func (_ fastpathT) DecMapUint64Uint8V(v map[uint64]uint8, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -17841,10 +23328,12 @@ func (_ fastpathT) DecMapUint64Uint16V(v map[uint64]uint16, checkNil bool, canCh v = make(map[uint64]uint16, xlen) changed = true } + + var mk uint64 + var mv uint16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -17852,8 +23341,7 @@ func (_ fastpathT) DecMapUint64Uint16V(v map[uint64]uint16, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -17899,10 +23387,12 @@ func (_ fastpathT) DecMapUint64Uint32V(v map[uint64]uint32, checkNil bool, canCh v = make(map[uint64]uint32, xlen) changed = true } + + var mk uint64 + var mv uint32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -17910,8 +23400,7 @@ func (_ fastpathT) DecMapUint64Uint32V(v map[uint64]uint32, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -17957,10 +23446,12 @@ func (_ fastpathT) DecMapUint64Uint64V(v map[uint64]uint64, checkNil bool, canCh v = make(map[uint64]uint64, xlen) changed = true } + + var mk uint64 + var mv uint64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -17968,8 +23459,7 @@ func (_ fastpathT) DecMapUint64Uint64V(v map[uint64]uint64, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -17980,6 +23470,65 @@ func (_ fastpathT) DecMapUint64Uint64V(v map[uint64]uint64, checkNil bool, canCh return v, changed } +func (f *decFnInfo) fastpathDecMapUint64UintptrR(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[uint64]uintptr) + v, changed := fastpathTV.DecMapUint64UintptrV(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[uint64]uintptr) + fastpathTV.DecMapUint64UintptrV(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapUint64UintptrX(vp *map[uint64]uintptr, checkNil bool, d *Decoder) { + v, changed := f.DecMapUint64UintptrV(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint64UintptrV(v map[uint64]uintptr, checkNil bool, canChange bool, + d *Decoder) (_ map[uint64]uintptr, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uint64]uintptr, xlen) + changed = true + } + + var mk uint64 + var mv uintptr + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = dd.DecodeUint(64) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = dd.DecodeUint(64) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + func (f *decFnInfo) fastpathDecMapUint64IntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[uint64]int) @@ -18015,10 +23564,12 @@ func (_ fastpathT) DecMapUint64IntV(v map[uint64]int, checkNil bool, canChange b v = make(map[uint64]int, xlen) changed = true } + + var mk uint64 + var mv int if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -18026,8 +23577,7 @@ func (_ fastpathT) DecMapUint64IntV(v map[uint64]int, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -18073,10 +23623,12 @@ func (_ fastpathT) DecMapUint64Int8V(v map[uint64]int8, checkNil bool, canChange v = make(map[uint64]int8, xlen) changed = true } + + var mk uint64 + var mv int8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -18084,8 +23636,7 @@ func (_ fastpathT) DecMapUint64Int8V(v map[uint64]int8, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -18131,10 +23682,12 @@ func (_ fastpathT) DecMapUint64Int16V(v map[uint64]int16, checkNil bool, canChan v = make(map[uint64]int16, xlen) changed = true } + + var mk uint64 + var mv int16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -18142,8 +23695,7 @@ func (_ fastpathT) DecMapUint64Int16V(v map[uint64]int16, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -18189,10 +23741,12 @@ func (_ fastpathT) DecMapUint64Int32V(v map[uint64]int32, checkNil bool, canChan v = make(map[uint64]int32, xlen) changed = true } + + var mk uint64 + var mv int32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -18200,8 +23754,7 @@ func (_ fastpathT) DecMapUint64Int32V(v map[uint64]int32, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -18247,10 +23800,12 @@ func (_ fastpathT) DecMapUint64Int64V(v map[uint64]int64, checkNil bool, canChan v = make(map[uint64]int64, xlen) changed = true } + + var mk uint64 + var mv int64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -18258,8 +23813,7 @@ func (_ fastpathT) DecMapUint64Int64V(v map[uint64]int64, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -18305,10 +23859,12 @@ func (_ fastpathT) DecMapUint64Float32V(v map[uint64]float32, checkNil bool, can v = make(map[uint64]float32, xlen) changed = true } + + var mk uint64 + var mv float32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -18316,8 +23872,7 @@ func (_ fastpathT) DecMapUint64Float32V(v map[uint64]float32, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -18363,10 +23918,12 @@ func (_ fastpathT) DecMapUint64Float64V(v map[uint64]float64, checkNil bool, can v = make(map[uint64]float64, xlen) changed = true } + + var mk uint64 + var mv float64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -18374,8 +23931,7 @@ func (_ fastpathT) DecMapUint64Float64V(v map[uint64]float64, checkNil bool, can } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -18421,10 +23977,12 @@ func (_ fastpathT) DecMapUint64BoolV(v map[uint64]bool, checkNil bool, canChange v = make(map[uint64]bool, xlen) changed = true } + + var mk uint64 + var mv bool if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -18432,8 +23990,961 @@ func (_ fastpathT) DecMapUint64BoolV(v map[uint64]bool, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeUint(64) - mv := v[mk] + mk = dd.DecodeUint(64) + mv = dd.DecodeBool() + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + +func (f *decFnInfo) fastpathDecMapUintptrIntfR(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[uintptr]interface{}) + v, changed := fastpathTV.DecMapUintptrIntfV(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[uintptr]interface{}) + fastpathTV.DecMapUintptrIntfV(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapUintptrIntfX(vp *map[uintptr]interface{}, checkNil bool, d *Decoder) { + v, changed := f.DecMapUintptrIntfV(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrIntfV(v map[uintptr]interface{}, checkNil bool, canChange bool, + d *Decoder) (_ map[uintptr]interface{}, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[uintptr]interface{}, xlen) + changed = true + } + mapGet := !d.h.MapValueReset && !d.h.InterfaceReset + var mk uintptr + var mv interface{} + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + if mapGet { + mv = v[mk] + } else { + mv = nil + } + d.decode(&mv) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + if mapGet { + mv = v[mk] + } else { + mv = nil + } + d.decode(&mv) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + +func (f *decFnInfo) fastpathDecMapUintptrStringR(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[uintptr]string) + v, changed := fastpathTV.DecMapUintptrStringV(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[uintptr]string) + fastpathTV.DecMapUintptrStringV(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapUintptrStringX(vp *map[uintptr]string, checkNil bool, d *Decoder) { + v, changed := f.DecMapUintptrStringV(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrStringV(v map[uintptr]string, checkNil bool, canChange bool, + d *Decoder) (_ map[uintptr]string, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[uintptr]string, xlen) + changed = true + } + + var mk uintptr + var mv string + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = dd.DecodeString() + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = dd.DecodeString() + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + +func (f *decFnInfo) fastpathDecMapUintptrUintR(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[uintptr]uint) + v, changed := fastpathTV.DecMapUintptrUintV(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[uintptr]uint) + fastpathTV.DecMapUintptrUintV(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapUintptrUintX(vp *map[uintptr]uint, checkNil bool, d *Decoder) { + v, changed := f.DecMapUintptrUintV(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrUintV(v map[uintptr]uint, checkNil bool, canChange bool, + d *Decoder) (_ map[uintptr]uint, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uintptr]uint, xlen) + changed = true + } + + var mk uintptr + var mv uint + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = uint(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = uint(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + +func (f *decFnInfo) fastpathDecMapUintptrUint8R(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[uintptr]uint8) + v, changed := fastpathTV.DecMapUintptrUint8V(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[uintptr]uint8) + fastpathTV.DecMapUintptrUint8V(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapUintptrUint8X(vp *map[uintptr]uint8, checkNil bool, d *Decoder) { + v, changed := f.DecMapUintptrUint8V(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrUint8V(v map[uintptr]uint8, checkNil bool, canChange bool, + d *Decoder) (_ map[uintptr]uint8, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uintptr]uint8, xlen) + changed = true + } + + var mk uintptr + var mv uint8 + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = uint8(dd.DecodeUint(8)) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = uint8(dd.DecodeUint(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + +func (f *decFnInfo) fastpathDecMapUintptrUint16R(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[uintptr]uint16) + v, changed := fastpathTV.DecMapUintptrUint16V(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[uintptr]uint16) + fastpathTV.DecMapUintptrUint16V(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapUintptrUint16X(vp *map[uintptr]uint16, checkNil bool, d *Decoder) { + v, changed := f.DecMapUintptrUint16V(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrUint16V(v map[uintptr]uint16, checkNil bool, canChange bool, + d *Decoder) (_ map[uintptr]uint16, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[uintptr]uint16, xlen) + changed = true + } + + var mk uintptr + var mv uint16 + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = uint16(dd.DecodeUint(16)) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = uint16(dd.DecodeUint(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + +func (f *decFnInfo) fastpathDecMapUintptrUint32R(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[uintptr]uint32) + v, changed := fastpathTV.DecMapUintptrUint32V(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[uintptr]uint32) + fastpathTV.DecMapUintptrUint32V(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapUintptrUint32X(vp *map[uintptr]uint32, checkNil bool, d *Decoder) { + v, changed := f.DecMapUintptrUint32V(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrUint32V(v map[uintptr]uint32, checkNil bool, canChange bool, + d *Decoder) (_ map[uintptr]uint32, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uintptr]uint32, xlen) + changed = true + } + + var mk uintptr + var mv uint32 + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = uint32(dd.DecodeUint(32)) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = uint32(dd.DecodeUint(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + +func (f *decFnInfo) fastpathDecMapUintptrUint64R(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[uintptr]uint64) + v, changed := fastpathTV.DecMapUintptrUint64V(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[uintptr]uint64) + fastpathTV.DecMapUintptrUint64V(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapUintptrUint64X(vp *map[uintptr]uint64, checkNil bool, d *Decoder) { + v, changed := f.DecMapUintptrUint64V(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrUint64V(v map[uintptr]uint64, checkNil bool, canChange bool, + d *Decoder) (_ map[uintptr]uint64, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uintptr]uint64, xlen) + changed = true + } + + var mk uintptr + var mv uint64 + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = dd.DecodeUint(64) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = dd.DecodeUint(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + +func (f *decFnInfo) fastpathDecMapUintptrUintptrR(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[uintptr]uintptr) + v, changed := fastpathTV.DecMapUintptrUintptrV(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[uintptr]uintptr) + fastpathTV.DecMapUintptrUintptrV(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapUintptrUintptrX(vp *map[uintptr]uintptr, checkNil bool, d *Decoder) { + v, changed := f.DecMapUintptrUintptrV(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrUintptrV(v map[uintptr]uintptr, checkNil bool, canChange bool, + d *Decoder) (_ map[uintptr]uintptr, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uintptr]uintptr, xlen) + changed = true + } + + var mk uintptr + var mv uintptr + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + +func (f *decFnInfo) fastpathDecMapUintptrIntR(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[uintptr]int) + v, changed := fastpathTV.DecMapUintptrIntV(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[uintptr]int) + fastpathTV.DecMapUintptrIntV(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapUintptrIntX(vp *map[uintptr]int, checkNil bool, d *Decoder) { + v, changed := f.DecMapUintptrIntV(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrIntV(v map[uintptr]int, checkNil bool, canChange bool, + d *Decoder) (_ map[uintptr]int, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uintptr]int, xlen) + changed = true + } + + var mk uintptr + var mv int + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = int(dd.DecodeInt(intBitsize)) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = int(dd.DecodeInt(intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + +func (f *decFnInfo) fastpathDecMapUintptrInt8R(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[uintptr]int8) + v, changed := fastpathTV.DecMapUintptrInt8V(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[uintptr]int8) + fastpathTV.DecMapUintptrInt8V(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapUintptrInt8X(vp *map[uintptr]int8, checkNil bool, d *Decoder) { + v, changed := f.DecMapUintptrInt8V(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrInt8V(v map[uintptr]int8, checkNil bool, canChange bool, + d *Decoder) (_ map[uintptr]int8, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uintptr]int8, xlen) + changed = true + } + + var mk uintptr + var mv int8 + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = int8(dd.DecodeInt(8)) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = int8(dd.DecodeInt(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + +func (f *decFnInfo) fastpathDecMapUintptrInt16R(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[uintptr]int16) + v, changed := fastpathTV.DecMapUintptrInt16V(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[uintptr]int16) + fastpathTV.DecMapUintptrInt16V(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapUintptrInt16X(vp *map[uintptr]int16, checkNil bool, d *Decoder) { + v, changed := f.DecMapUintptrInt16V(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrInt16V(v map[uintptr]int16, checkNil bool, canChange bool, + d *Decoder) (_ map[uintptr]int16, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[uintptr]int16, xlen) + changed = true + } + + var mk uintptr + var mv int16 + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = int16(dd.DecodeInt(16)) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = int16(dd.DecodeInt(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + +func (f *decFnInfo) fastpathDecMapUintptrInt32R(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[uintptr]int32) + v, changed := fastpathTV.DecMapUintptrInt32V(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[uintptr]int32) + fastpathTV.DecMapUintptrInt32V(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapUintptrInt32X(vp *map[uintptr]int32, checkNil bool, d *Decoder) { + v, changed := f.DecMapUintptrInt32V(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrInt32V(v map[uintptr]int32, checkNil bool, canChange bool, + d *Decoder) (_ map[uintptr]int32, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uintptr]int32, xlen) + changed = true + } + + var mk uintptr + var mv int32 + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = int32(dd.DecodeInt(32)) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = int32(dd.DecodeInt(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + +func (f *decFnInfo) fastpathDecMapUintptrInt64R(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[uintptr]int64) + v, changed := fastpathTV.DecMapUintptrInt64V(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[uintptr]int64) + fastpathTV.DecMapUintptrInt64V(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapUintptrInt64X(vp *map[uintptr]int64, checkNil bool, d *Decoder) { + v, changed := f.DecMapUintptrInt64V(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrInt64V(v map[uintptr]int64, checkNil bool, canChange bool, + d *Decoder) (_ map[uintptr]int64, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uintptr]int64, xlen) + changed = true + } + + var mk uintptr + var mv int64 + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = dd.DecodeInt(64) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = dd.DecodeInt(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + +func (f *decFnInfo) fastpathDecMapUintptrFloat32R(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[uintptr]float32) + v, changed := fastpathTV.DecMapUintptrFloat32V(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[uintptr]float32) + fastpathTV.DecMapUintptrFloat32V(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapUintptrFloat32X(vp *map[uintptr]float32, checkNil bool, d *Decoder) { + v, changed := f.DecMapUintptrFloat32V(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrFloat32V(v map[uintptr]float32, checkNil bool, canChange bool, + d *Decoder) (_ map[uintptr]float32, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uintptr]float32, xlen) + changed = true + } + + var mk uintptr + var mv float32 + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = float32(dd.DecodeFloat(true)) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = float32(dd.DecodeFloat(true)) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + +func (f *decFnInfo) fastpathDecMapUintptrFloat64R(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[uintptr]float64) + v, changed := fastpathTV.DecMapUintptrFloat64V(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[uintptr]float64) + fastpathTV.DecMapUintptrFloat64V(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapUintptrFloat64X(vp *map[uintptr]float64, checkNil bool, d *Decoder) { + v, changed := f.DecMapUintptrFloat64V(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrFloat64V(v map[uintptr]float64, checkNil bool, canChange bool, + d *Decoder) (_ map[uintptr]float64, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uintptr]float64, xlen) + changed = true + } + + var mk uintptr + var mv float64 + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = dd.DecodeFloat(false) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = dd.DecodeFloat(false) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + +func (f *decFnInfo) fastpathDecMapUintptrBoolR(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[uintptr]bool) + v, changed := fastpathTV.DecMapUintptrBoolV(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[uintptr]bool) + fastpathTV.DecMapUintptrBoolV(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapUintptrBoolX(vp *map[uintptr]bool, checkNil bool, d *Decoder) { + v, changed := f.DecMapUintptrBoolV(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrBoolV(v map[uintptr]bool, checkNil bool, canChange bool, + d *Decoder) (_ map[uintptr]bool, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uintptr]bool, xlen) + changed = true + } + + var mk uintptr + var mv bool + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) + mv = dd.DecodeBool() + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = uintptr(dd.DecodeUint(uintBitsize)) mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -18479,22 +24990,31 @@ func (_ fastpathT) DecMapIntIntfV(v map[int]interface{}, checkNil bool, canChang v = make(map[int]interface{}, xlen) changed = true } + mapGet := !d.h.MapValueReset && !d.h.InterfaceReset + var mk int + var mv interface{} if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } @@ -18539,10 +25059,12 @@ func (_ fastpathT) DecMapIntStringV(v map[int]string, checkNil bool, canChange b v = make(map[int]string, xlen) changed = true } + + var mk int + var mv string if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -18550,8 +25072,7 @@ func (_ fastpathT) DecMapIntStringV(v map[int]string, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -18597,10 +25118,12 @@ func (_ fastpathT) DecMapIntUintV(v map[int]uint, checkNil bool, canChange bool, v = make(map[int]uint, xlen) changed = true } + + var mk int + var mv uint if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -18608,8 +25131,7 @@ func (_ fastpathT) DecMapIntUintV(v map[int]uint, checkNil bool, canChange bool, } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -18655,10 +25177,12 @@ func (_ fastpathT) DecMapIntUint8V(v map[int]uint8, checkNil bool, canChange boo v = make(map[int]uint8, xlen) changed = true } + + var mk int + var mv uint8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -18666,8 +25190,7 @@ func (_ fastpathT) DecMapIntUint8V(v map[int]uint8, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -18713,10 +25236,12 @@ func (_ fastpathT) DecMapIntUint16V(v map[int]uint16, checkNil bool, canChange b v = make(map[int]uint16, xlen) changed = true } + + var mk int + var mv uint16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -18724,8 +25249,7 @@ func (_ fastpathT) DecMapIntUint16V(v map[int]uint16, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -18771,10 +25295,12 @@ func (_ fastpathT) DecMapIntUint32V(v map[int]uint32, checkNil bool, canChange b v = make(map[int]uint32, xlen) changed = true } + + var mk int + var mv uint32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -18782,8 +25308,7 @@ func (_ fastpathT) DecMapIntUint32V(v map[int]uint32, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -18829,10 +25354,12 @@ func (_ fastpathT) DecMapIntUint64V(v map[int]uint64, checkNil bool, canChange b v = make(map[int]uint64, xlen) changed = true } + + var mk int + var mv uint64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -18840,8 +25367,7 @@ func (_ fastpathT) DecMapIntUint64V(v map[int]uint64, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -18852,6 +25378,65 @@ func (_ fastpathT) DecMapIntUint64V(v map[int]uint64, checkNil bool, canChange b return v, changed } +func (f *decFnInfo) fastpathDecMapIntUintptrR(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[int]uintptr) + v, changed := fastpathTV.DecMapIntUintptrV(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[int]uintptr) + fastpathTV.DecMapIntUintptrV(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapIntUintptrX(vp *map[int]uintptr, checkNil bool, d *Decoder) { + v, changed := f.DecMapIntUintptrV(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntUintptrV(v map[int]uintptr, checkNil bool, canChange bool, + d *Decoder) (_ map[int]uintptr, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[int]uintptr, xlen) + changed = true + } + + var mk int + var mv uintptr + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = int(dd.DecodeInt(intBitsize)) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = int(dd.DecodeInt(intBitsize)) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + func (f *decFnInfo) fastpathDecMapIntIntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int]int) @@ -18887,10 +25472,12 @@ func (_ fastpathT) DecMapIntIntV(v map[int]int, checkNil bool, canChange bool, v = make(map[int]int, xlen) changed = true } + + var mk int + var mv int if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -18898,8 +25485,7 @@ func (_ fastpathT) DecMapIntIntV(v map[int]int, checkNil bool, canChange bool, } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -18945,10 +25531,12 @@ func (_ fastpathT) DecMapIntInt8V(v map[int]int8, checkNil bool, canChange bool, v = make(map[int]int8, xlen) changed = true } + + var mk int + var mv int8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -18956,8 +25544,7 @@ func (_ fastpathT) DecMapIntInt8V(v map[int]int8, checkNil bool, canChange bool, } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -19003,10 +25590,12 @@ func (_ fastpathT) DecMapIntInt16V(v map[int]int16, checkNil bool, canChange boo v = make(map[int]int16, xlen) changed = true } + + var mk int + var mv int16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -19014,8 +25603,7 @@ func (_ fastpathT) DecMapIntInt16V(v map[int]int16, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -19061,10 +25649,12 @@ func (_ fastpathT) DecMapIntInt32V(v map[int]int32, checkNil bool, canChange boo v = make(map[int]int32, xlen) changed = true } + + var mk int + var mv int32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -19072,8 +25662,7 @@ func (_ fastpathT) DecMapIntInt32V(v map[int]int32, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -19119,10 +25708,12 @@ func (_ fastpathT) DecMapIntInt64V(v map[int]int64, checkNil bool, canChange boo v = make(map[int]int64, xlen) changed = true } + + var mk int + var mv int64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -19130,8 +25721,7 @@ func (_ fastpathT) DecMapIntInt64V(v map[int]int64, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -19177,10 +25767,12 @@ func (_ fastpathT) DecMapIntFloat32V(v map[int]float32, checkNil bool, canChange v = make(map[int]float32, xlen) changed = true } + + var mk int + var mv float32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -19188,8 +25780,7 @@ func (_ fastpathT) DecMapIntFloat32V(v map[int]float32, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -19235,10 +25826,12 @@ func (_ fastpathT) DecMapIntFloat64V(v map[int]float64, checkNil bool, canChange v = make(map[int]float64, xlen) changed = true } + + var mk int + var mv float64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -19246,8 +25839,7 @@ func (_ fastpathT) DecMapIntFloat64V(v map[int]float64, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -19293,10 +25885,12 @@ func (_ fastpathT) DecMapIntBoolV(v map[int]bool, checkNil bool, canChange bool, v = make(map[int]bool, xlen) changed = true } + + var mk int + var mv bool if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -19304,8 +25898,7 @@ func (_ fastpathT) DecMapIntBoolV(v map[int]bool, checkNil bool, canChange bool, } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int(dd.DecodeInt(intBitsize)) - mv := v[mk] + mk = int(dd.DecodeInt(intBitsize)) mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -19351,22 +25944,31 @@ func (_ fastpathT) DecMapInt8IntfV(v map[int8]interface{}, checkNil bool, canCha v = make(map[int8]interface{}, xlen) changed = true } + mapGet := !d.h.MapValueReset && !d.h.InterfaceReset + var mk int8 + var mv interface{} if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } @@ -19411,10 +26013,12 @@ func (_ fastpathT) DecMapInt8StringV(v map[int8]string, checkNil bool, canChange v = make(map[int8]string, xlen) changed = true } + + var mk int8 + var mv string if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -19422,8 +26026,7 @@ func (_ fastpathT) DecMapInt8StringV(v map[int8]string, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -19469,10 +26072,12 @@ func (_ fastpathT) DecMapInt8UintV(v map[int8]uint, checkNil bool, canChange boo v = make(map[int8]uint, xlen) changed = true } + + var mk int8 + var mv uint if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -19480,8 +26085,7 @@ func (_ fastpathT) DecMapInt8UintV(v map[int8]uint, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -19527,10 +26131,12 @@ func (_ fastpathT) DecMapInt8Uint8V(v map[int8]uint8, checkNil bool, canChange b v = make(map[int8]uint8, xlen) changed = true } + + var mk int8 + var mv uint8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -19538,8 +26144,7 @@ func (_ fastpathT) DecMapInt8Uint8V(v map[int8]uint8, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -19585,10 +26190,12 @@ func (_ fastpathT) DecMapInt8Uint16V(v map[int8]uint16, checkNil bool, canChange v = make(map[int8]uint16, xlen) changed = true } + + var mk int8 + var mv uint16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -19596,8 +26203,7 @@ func (_ fastpathT) DecMapInt8Uint16V(v map[int8]uint16, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -19643,10 +26249,12 @@ func (_ fastpathT) DecMapInt8Uint32V(v map[int8]uint32, checkNil bool, canChange v = make(map[int8]uint32, xlen) changed = true } + + var mk int8 + var mv uint32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -19654,8 +26262,7 @@ func (_ fastpathT) DecMapInt8Uint32V(v map[int8]uint32, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -19701,10 +26308,12 @@ func (_ fastpathT) DecMapInt8Uint64V(v map[int8]uint64, checkNil bool, canChange v = make(map[int8]uint64, xlen) changed = true } + + var mk int8 + var mv uint64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -19712,8 +26321,7 @@ func (_ fastpathT) DecMapInt8Uint64V(v map[int8]uint64, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -19724,6 +26332,65 @@ func (_ fastpathT) DecMapInt8Uint64V(v map[int8]uint64, checkNil bool, canChange return v, changed } +func (f *decFnInfo) fastpathDecMapInt8UintptrR(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[int8]uintptr) + v, changed := fastpathTV.DecMapInt8UintptrV(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[int8]uintptr) + fastpathTV.DecMapInt8UintptrV(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapInt8UintptrX(vp *map[int8]uintptr, checkNil bool, d *Decoder) { + v, changed := f.DecMapInt8UintptrV(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt8UintptrV(v map[int8]uintptr, checkNil bool, canChange bool, + d *Decoder) (_ map[int8]uintptr, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[int8]uintptr, xlen) + changed = true + } + + var mk int8 + var mv uintptr + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = int8(dd.DecodeInt(8)) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = int8(dd.DecodeInt(8)) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + func (f *decFnInfo) fastpathDecMapInt8IntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int8]int) @@ -19759,10 +26426,12 @@ func (_ fastpathT) DecMapInt8IntV(v map[int8]int, checkNil bool, canChange bool, v = make(map[int8]int, xlen) changed = true } + + var mk int8 + var mv int if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -19770,8 +26439,7 @@ func (_ fastpathT) DecMapInt8IntV(v map[int8]int, checkNil bool, canChange bool, } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -19817,10 +26485,12 @@ func (_ fastpathT) DecMapInt8Int8V(v map[int8]int8, checkNil bool, canChange boo v = make(map[int8]int8, xlen) changed = true } + + var mk int8 + var mv int8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -19828,8 +26498,7 @@ func (_ fastpathT) DecMapInt8Int8V(v map[int8]int8, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -19875,10 +26544,12 @@ func (_ fastpathT) DecMapInt8Int16V(v map[int8]int16, checkNil bool, canChange b v = make(map[int8]int16, xlen) changed = true } + + var mk int8 + var mv int16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -19886,8 +26557,7 @@ func (_ fastpathT) DecMapInt8Int16V(v map[int8]int16, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -19933,10 +26603,12 @@ func (_ fastpathT) DecMapInt8Int32V(v map[int8]int32, checkNil bool, canChange b v = make(map[int8]int32, xlen) changed = true } + + var mk int8 + var mv int32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -19944,8 +26616,7 @@ func (_ fastpathT) DecMapInt8Int32V(v map[int8]int32, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -19991,10 +26662,12 @@ func (_ fastpathT) DecMapInt8Int64V(v map[int8]int64, checkNil bool, canChange b v = make(map[int8]int64, xlen) changed = true } + + var mk int8 + var mv int64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -20002,8 +26675,7 @@ func (_ fastpathT) DecMapInt8Int64V(v map[int8]int64, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -20049,10 +26721,12 @@ func (_ fastpathT) DecMapInt8Float32V(v map[int8]float32, checkNil bool, canChan v = make(map[int8]float32, xlen) changed = true } + + var mk int8 + var mv float32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -20060,8 +26734,7 @@ func (_ fastpathT) DecMapInt8Float32V(v map[int8]float32, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -20107,10 +26780,12 @@ func (_ fastpathT) DecMapInt8Float64V(v map[int8]float64, checkNil bool, canChan v = make(map[int8]float64, xlen) changed = true } + + var mk int8 + var mv float64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -20118,8 +26793,7 @@ func (_ fastpathT) DecMapInt8Float64V(v map[int8]float64, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -20165,10 +26839,12 @@ func (_ fastpathT) DecMapInt8BoolV(v map[int8]bool, checkNil bool, canChange boo v = make(map[int8]bool, xlen) changed = true } + + var mk int8 + var mv bool if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -20176,8 +26852,7 @@ func (_ fastpathT) DecMapInt8BoolV(v map[int8]bool, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int8(dd.DecodeInt(8)) - mv := v[mk] + mk = int8(dd.DecodeInt(8)) mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -20223,22 +26898,31 @@ func (_ fastpathT) DecMapInt16IntfV(v map[int16]interface{}, checkNil bool, canC v = make(map[int16]interface{}, xlen) changed = true } + mapGet := !d.h.MapValueReset && !d.h.InterfaceReset + var mk int16 + var mv interface{} if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } @@ -20283,10 +26967,12 @@ func (_ fastpathT) DecMapInt16StringV(v map[int16]string, checkNil bool, canChan v = make(map[int16]string, xlen) changed = true } + + var mk int16 + var mv string if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -20294,8 +26980,7 @@ func (_ fastpathT) DecMapInt16StringV(v map[int16]string, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -20341,10 +27026,12 @@ func (_ fastpathT) DecMapInt16UintV(v map[int16]uint, checkNil bool, canChange b v = make(map[int16]uint, xlen) changed = true } + + var mk int16 + var mv uint if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -20352,8 +27039,7 @@ func (_ fastpathT) DecMapInt16UintV(v map[int16]uint, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -20399,10 +27085,12 @@ func (_ fastpathT) DecMapInt16Uint8V(v map[int16]uint8, checkNil bool, canChange v = make(map[int16]uint8, xlen) changed = true } + + var mk int16 + var mv uint8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -20410,8 +27098,7 @@ func (_ fastpathT) DecMapInt16Uint8V(v map[int16]uint8, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -20457,10 +27144,12 @@ func (_ fastpathT) DecMapInt16Uint16V(v map[int16]uint16, checkNil bool, canChan v = make(map[int16]uint16, xlen) changed = true } + + var mk int16 + var mv uint16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -20468,8 +27157,7 @@ func (_ fastpathT) DecMapInt16Uint16V(v map[int16]uint16, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -20515,10 +27203,12 @@ func (_ fastpathT) DecMapInt16Uint32V(v map[int16]uint32, checkNil bool, canChan v = make(map[int16]uint32, xlen) changed = true } + + var mk int16 + var mv uint32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -20526,8 +27216,7 @@ func (_ fastpathT) DecMapInt16Uint32V(v map[int16]uint32, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -20573,10 +27262,12 @@ func (_ fastpathT) DecMapInt16Uint64V(v map[int16]uint64, checkNil bool, canChan v = make(map[int16]uint64, xlen) changed = true } + + var mk int16 + var mv uint64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -20584,8 +27275,7 @@ func (_ fastpathT) DecMapInt16Uint64V(v map[int16]uint64, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -20596,6 +27286,65 @@ func (_ fastpathT) DecMapInt16Uint64V(v map[int16]uint64, checkNil bool, canChan return v, changed } +func (f *decFnInfo) fastpathDecMapInt16UintptrR(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[int16]uintptr) + v, changed := fastpathTV.DecMapInt16UintptrV(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[int16]uintptr) + fastpathTV.DecMapInt16UintptrV(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapInt16UintptrX(vp *map[int16]uintptr, checkNil bool, d *Decoder) { + v, changed := f.DecMapInt16UintptrV(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt16UintptrV(v map[int16]uintptr, checkNil bool, canChange bool, + d *Decoder) (_ map[int16]uintptr, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[int16]uintptr, xlen) + changed = true + } + + var mk int16 + var mv uintptr + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = int16(dd.DecodeInt(16)) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = int16(dd.DecodeInt(16)) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + func (f *decFnInfo) fastpathDecMapInt16IntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int16]int) @@ -20631,10 +27380,12 @@ func (_ fastpathT) DecMapInt16IntV(v map[int16]int, checkNil bool, canChange boo v = make(map[int16]int, xlen) changed = true } + + var mk int16 + var mv int if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -20642,8 +27393,7 @@ func (_ fastpathT) DecMapInt16IntV(v map[int16]int, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -20689,10 +27439,12 @@ func (_ fastpathT) DecMapInt16Int8V(v map[int16]int8, checkNil bool, canChange b v = make(map[int16]int8, xlen) changed = true } + + var mk int16 + var mv int8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -20700,8 +27452,7 @@ func (_ fastpathT) DecMapInt16Int8V(v map[int16]int8, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -20747,10 +27498,12 @@ func (_ fastpathT) DecMapInt16Int16V(v map[int16]int16, checkNil bool, canChange v = make(map[int16]int16, xlen) changed = true } + + var mk int16 + var mv int16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -20758,8 +27511,7 @@ func (_ fastpathT) DecMapInt16Int16V(v map[int16]int16, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -20805,10 +27557,12 @@ func (_ fastpathT) DecMapInt16Int32V(v map[int16]int32, checkNil bool, canChange v = make(map[int16]int32, xlen) changed = true } + + var mk int16 + var mv int32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -20816,8 +27570,7 @@ func (_ fastpathT) DecMapInt16Int32V(v map[int16]int32, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -20863,10 +27616,12 @@ func (_ fastpathT) DecMapInt16Int64V(v map[int16]int64, checkNil bool, canChange v = make(map[int16]int64, xlen) changed = true } + + var mk int16 + var mv int64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -20874,8 +27629,7 @@ func (_ fastpathT) DecMapInt16Int64V(v map[int16]int64, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -20921,10 +27675,12 @@ func (_ fastpathT) DecMapInt16Float32V(v map[int16]float32, checkNil bool, canCh v = make(map[int16]float32, xlen) changed = true } + + var mk int16 + var mv float32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -20932,8 +27688,7 @@ func (_ fastpathT) DecMapInt16Float32V(v map[int16]float32, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -20979,10 +27734,12 @@ func (_ fastpathT) DecMapInt16Float64V(v map[int16]float64, checkNil bool, canCh v = make(map[int16]float64, xlen) changed = true } + + var mk int16 + var mv float64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -20990,8 +27747,7 @@ func (_ fastpathT) DecMapInt16Float64V(v map[int16]float64, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -21037,10 +27793,12 @@ func (_ fastpathT) DecMapInt16BoolV(v map[int16]bool, checkNil bool, canChange b v = make(map[int16]bool, xlen) changed = true } + + var mk int16 + var mv bool if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -21048,8 +27806,7 @@ func (_ fastpathT) DecMapInt16BoolV(v map[int16]bool, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int16(dd.DecodeInt(16)) - mv := v[mk] + mk = int16(dd.DecodeInt(16)) mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -21095,22 +27852,31 @@ func (_ fastpathT) DecMapInt32IntfV(v map[int32]interface{}, checkNil bool, canC v = make(map[int32]interface{}, xlen) changed = true } + mapGet := !d.h.MapValueReset && !d.h.InterfaceReset + var mk int32 + var mv interface{} if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } @@ -21155,10 +27921,12 @@ func (_ fastpathT) DecMapInt32StringV(v map[int32]string, checkNil bool, canChan v = make(map[int32]string, xlen) changed = true } + + var mk int32 + var mv string if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -21166,8 +27934,7 @@ func (_ fastpathT) DecMapInt32StringV(v map[int32]string, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -21213,10 +27980,12 @@ func (_ fastpathT) DecMapInt32UintV(v map[int32]uint, checkNil bool, canChange b v = make(map[int32]uint, xlen) changed = true } + + var mk int32 + var mv uint if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -21224,8 +27993,7 @@ func (_ fastpathT) DecMapInt32UintV(v map[int32]uint, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -21271,10 +28039,12 @@ func (_ fastpathT) DecMapInt32Uint8V(v map[int32]uint8, checkNil bool, canChange v = make(map[int32]uint8, xlen) changed = true } + + var mk int32 + var mv uint8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -21282,8 +28052,7 @@ func (_ fastpathT) DecMapInt32Uint8V(v map[int32]uint8, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -21329,10 +28098,12 @@ func (_ fastpathT) DecMapInt32Uint16V(v map[int32]uint16, checkNil bool, canChan v = make(map[int32]uint16, xlen) changed = true } + + var mk int32 + var mv uint16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -21340,8 +28111,7 @@ func (_ fastpathT) DecMapInt32Uint16V(v map[int32]uint16, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -21387,10 +28157,12 @@ func (_ fastpathT) DecMapInt32Uint32V(v map[int32]uint32, checkNil bool, canChan v = make(map[int32]uint32, xlen) changed = true } + + var mk int32 + var mv uint32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -21398,8 +28170,7 @@ func (_ fastpathT) DecMapInt32Uint32V(v map[int32]uint32, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -21445,10 +28216,12 @@ func (_ fastpathT) DecMapInt32Uint64V(v map[int32]uint64, checkNil bool, canChan v = make(map[int32]uint64, xlen) changed = true } + + var mk int32 + var mv uint64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -21456,8 +28229,7 @@ func (_ fastpathT) DecMapInt32Uint64V(v map[int32]uint64, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -21468,6 +28240,65 @@ func (_ fastpathT) DecMapInt32Uint64V(v map[int32]uint64, checkNil bool, canChan return v, changed } +func (f *decFnInfo) fastpathDecMapInt32UintptrR(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[int32]uintptr) + v, changed := fastpathTV.DecMapInt32UintptrV(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[int32]uintptr) + fastpathTV.DecMapInt32UintptrV(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapInt32UintptrX(vp *map[int32]uintptr, checkNil bool, d *Decoder) { + v, changed := f.DecMapInt32UintptrV(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt32UintptrV(v map[int32]uintptr, checkNil bool, canChange bool, + d *Decoder) (_ map[int32]uintptr, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[int32]uintptr, xlen) + changed = true + } + + var mk int32 + var mv uintptr + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = int32(dd.DecodeInt(32)) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = int32(dd.DecodeInt(32)) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + func (f *decFnInfo) fastpathDecMapInt32IntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int32]int) @@ -21503,10 +28334,12 @@ func (_ fastpathT) DecMapInt32IntV(v map[int32]int, checkNil bool, canChange boo v = make(map[int32]int, xlen) changed = true } + + var mk int32 + var mv int if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -21514,8 +28347,7 @@ func (_ fastpathT) DecMapInt32IntV(v map[int32]int, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -21561,10 +28393,12 @@ func (_ fastpathT) DecMapInt32Int8V(v map[int32]int8, checkNil bool, canChange b v = make(map[int32]int8, xlen) changed = true } + + var mk int32 + var mv int8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -21572,8 +28406,7 @@ func (_ fastpathT) DecMapInt32Int8V(v map[int32]int8, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -21619,10 +28452,12 @@ func (_ fastpathT) DecMapInt32Int16V(v map[int32]int16, checkNil bool, canChange v = make(map[int32]int16, xlen) changed = true } + + var mk int32 + var mv int16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -21630,8 +28465,7 @@ func (_ fastpathT) DecMapInt32Int16V(v map[int32]int16, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -21677,10 +28511,12 @@ func (_ fastpathT) DecMapInt32Int32V(v map[int32]int32, checkNil bool, canChange v = make(map[int32]int32, xlen) changed = true } + + var mk int32 + var mv int32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -21688,8 +28524,7 @@ func (_ fastpathT) DecMapInt32Int32V(v map[int32]int32, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -21735,10 +28570,12 @@ func (_ fastpathT) DecMapInt32Int64V(v map[int32]int64, checkNil bool, canChange v = make(map[int32]int64, xlen) changed = true } + + var mk int32 + var mv int64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -21746,8 +28583,7 @@ func (_ fastpathT) DecMapInt32Int64V(v map[int32]int64, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -21793,10 +28629,12 @@ func (_ fastpathT) DecMapInt32Float32V(v map[int32]float32, checkNil bool, canCh v = make(map[int32]float32, xlen) changed = true } + + var mk int32 + var mv float32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -21804,8 +28642,7 @@ func (_ fastpathT) DecMapInt32Float32V(v map[int32]float32, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -21851,10 +28688,12 @@ func (_ fastpathT) DecMapInt32Float64V(v map[int32]float64, checkNil bool, canCh v = make(map[int32]float64, xlen) changed = true } + + var mk int32 + var mv float64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -21862,8 +28701,7 @@ func (_ fastpathT) DecMapInt32Float64V(v map[int32]float64, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -21909,10 +28747,12 @@ func (_ fastpathT) DecMapInt32BoolV(v map[int32]bool, checkNil bool, canChange b v = make(map[int32]bool, xlen) changed = true } + + var mk int32 + var mv bool if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -21920,8 +28760,7 @@ func (_ fastpathT) DecMapInt32BoolV(v map[int32]bool, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := int32(dd.DecodeInt(32)) - mv := v[mk] + mk = int32(dd.DecodeInt(32)) mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -21967,22 +28806,31 @@ func (_ fastpathT) DecMapInt64IntfV(v map[int64]interface{}, checkNil bool, canC v = make(map[int64]interface{}, xlen) changed = true } + mapGet := !d.h.MapValueReset && !d.h.InterfaceReset + var mk int64 + var mv interface{} if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } @@ -22027,10 +28875,12 @@ func (_ fastpathT) DecMapInt64StringV(v map[int64]string, checkNil bool, canChan v = make(map[int64]string, xlen) changed = true } + + var mk int64 + var mv string if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -22038,8 +28888,7 @@ func (_ fastpathT) DecMapInt64StringV(v map[int64]string, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -22085,10 +28934,12 @@ func (_ fastpathT) DecMapInt64UintV(v map[int64]uint, checkNil bool, canChange b v = make(map[int64]uint, xlen) changed = true } + + var mk int64 + var mv uint if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -22096,8 +28947,7 @@ func (_ fastpathT) DecMapInt64UintV(v map[int64]uint, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -22143,10 +28993,12 @@ func (_ fastpathT) DecMapInt64Uint8V(v map[int64]uint8, checkNil bool, canChange v = make(map[int64]uint8, xlen) changed = true } + + var mk int64 + var mv uint8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -22154,8 +29006,7 @@ func (_ fastpathT) DecMapInt64Uint8V(v map[int64]uint8, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -22201,10 +29052,12 @@ func (_ fastpathT) DecMapInt64Uint16V(v map[int64]uint16, checkNil bool, canChan v = make(map[int64]uint16, xlen) changed = true } + + var mk int64 + var mv uint16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -22212,8 +29065,7 @@ func (_ fastpathT) DecMapInt64Uint16V(v map[int64]uint16, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -22259,10 +29111,12 @@ func (_ fastpathT) DecMapInt64Uint32V(v map[int64]uint32, checkNil bool, canChan v = make(map[int64]uint32, xlen) changed = true } + + var mk int64 + var mv uint32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -22270,8 +29124,7 @@ func (_ fastpathT) DecMapInt64Uint32V(v map[int64]uint32, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -22317,10 +29170,12 @@ func (_ fastpathT) DecMapInt64Uint64V(v map[int64]uint64, checkNil bool, canChan v = make(map[int64]uint64, xlen) changed = true } + + var mk int64 + var mv uint64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -22328,8 +29183,7 @@ func (_ fastpathT) DecMapInt64Uint64V(v map[int64]uint64, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -22340,6 +29194,65 @@ func (_ fastpathT) DecMapInt64Uint64V(v map[int64]uint64, checkNil bool, canChan return v, changed } +func (f *decFnInfo) fastpathDecMapInt64UintptrR(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[int64]uintptr) + v, changed := fastpathTV.DecMapInt64UintptrV(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[int64]uintptr) + fastpathTV.DecMapInt64UintptrV(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapInt64UintptrX(vp *map[int64]uintptr, checkNil bool, d *Decoder) { + v, changed := f.DecMapInt64UintptrV(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt64UintptrV(v map[int64]uintptr, checkNil bool, canChange bool, + d *Decoder) (_ map[int64]uintptr, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[int64]uintptr, xlen) + changed = true + } + + var mk int64 + var mv uintptr + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = dd.DecodeInt(64) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = dd.DecodeInt(64) + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + func (f *decFnInfo) fastpathDecMapInt64IntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[int64]int) @@ -22375,10 +29288,12 @@ func (_ fastpathT) DecMapInt64IntV(v map[int64]int, checkNil bool, canChange boo v = make(map[int64]int, xlen) changed = true } + + var mk int64 + var mv int if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -22386,8 +29301,7 @@ func (_ fastpathT) DecMapInt64IntV(v map[int64]int, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -22433,10 +29347,12 @@ func (_ fastpathT) DecMapInt64Int8V(v map[int64]int8, checkNil bool, canChange b v = make(map[int64]int8, xlen) changed = true } + + var mk int64 + var mv int8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -22444,8 +29360,7 @@ func (_ fastpathT) DecMapInt64Int8V(v map[int64]int8, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -22491,10 +29406,12 @@ func (_ fastpathT) DecMapInt64Int16V(v map[int64]int16, checkNil bool, canChange v = make(map[int64]int16, xlen) changed = true } + + var mk int64 + var mv int16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -22502,8 +29419,7 @@ func (_ fastpathT) DecMapInt64Int16V(v map[int64]int16, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -22549,10 +29465,12 @@ func (_ fastpathT) DecMapInt64Int32V(v map[int64]int32, checkNil bool, canChange v = make(map[int64]int32, xlen) changed = true } + + var mk int64 + var mv int32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -22560,8 +29478,7 @@ func (_ fastpathT) DecMapInt64Int32V(v map[int64]int32, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -22607,10 +29524,12 @@ func (_ fastpathT) DecMapInt64Int64V(v map[int64]int64, checkNil bool, canChange v = make(map[int64]int64, xlen) changed = true } + + var mk int64 + var mv int64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -22618,8 +29537,7 @@ func (_ fastpathT) DecMapInt64Int64V(v map[int64]int64, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -22665,10 +29583,12 @@ func (_ fastpathT) DecMapInt64Float32V(v map[int64]float32, checkNil bool, canCh v = make(map[int64]float32, xlen) changed = true } + + var mk int64 + var mv float32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -22676,8 +29596,7 @@ func (_ fastpathT) DecMapInt64Float32V(v map[int64]float32, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -22723,10 +29642,12 @@ func (_ fastpathT) DecMapInt64Float64V(v map[int64]float64, checkNil bool, canCh v = make(map[int64]float64, xlen) changed = true } + + var mk int64 + var mv float64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -22734,8 +29655,7 @@ func (_ fastpathT) DecMapInt64Float64V(v map[int64]float64, checkNil bool, canCh } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -22781,10 +29701,12 @@ func (_ fastpathT) DecMapInt64BoolV(v map[int64]bool, checkNil bool, canChange b v = make(map[int64]bool, xlen) changed = true } + + var mk int64 + var mv bool if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -22792,8 +29714,7 @@ func (_ fastpathT) DecMapInt64BoolV(v map[int64]bool, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeInt(64) - mv := v[mk] + mk = dd.DecodeInt(64) mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -22839,22 +29760,31 @@ func (_ fastpathT) DecMapBoolIntfV(v map[bool]interface{}, checkNil bool, canCha v = make(map[bool]interface{}, xlen) changed = true } + mapGet := !d.h.MapValueReset && !d.h.InterfaceReset + var mk bool + var mv interface{} if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() + if mapGet { + mv = v[mk] + } else { + mv = nil + } d.decode(&mv) - if v != nil { v[mk] = mv } @@ -22899,10 +29829,12 @@ func (_ fastpathT) DecMapBoolStringV(v map[bool]string, checkNil bool, canChange v = make(map[bool]string, xlen) changed = true } + + var mk bool + var mv string if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -22910,8 +29842,7 @@ func (_ fastpathT) DecMapBoolStringV(v map[bool]string, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = dd.DecodeString() if v != nil { v[mk] = mv @@ -22957,10 +29888,12 @@ func (_ fastpathT) DecMapBoolUintV(v map[bool]uint, checkNil bool, canChange boo v = make(map[bool]uint, xlen) changed = true } + + var mk bool + var mv uint if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -22968,8 +29901,7 @@ func (_ fastpathT) DecMapBoolUintV(v map[bool]uint, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = uint(dd.DecodeUint(uintBitsize)) if v != nil { v[mk] = mv @@ -23015,10 +29947,12 @@ func (_ fastpathT) DecMapBoolUint8V(v map[bool]uint8, checkNil bool, canChange b v = make(map[bool]uint8, xlen) changed = true } + + var mk bool + var mv uint8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -23026,8 +29960,7 @@ func (_ fastpathT) DecMapBoolUint8V(v map[bool]uint8, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = uint8(dd.DecodeUint(8)) if v != nil { v[mk] = mv @@ -23073,10 +30006,12 @@ func (_ fastpathT) DecMapBoolUint16V(v map[bool]uint16, checkNil bool, canChange v = make(map[bool]uint16, xlen) changed = true } + + var mk bool + var mv uint16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -23084,8 +30019,7 @@ func (_ fastpathT) DecMapBoolUint16V(v map[bool]uint16, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = uint16(dd.DecodeUint(16)) if v != nil { v[mk] = mv @@ -23131,10 +30065,12 @@ func (_ fastpathT) DecMapBoolUint32V(v map[bool]uint32, checkNil bool, canChange v = make(map[bool]uint32, xlen) changed = true } + + var mk bool + var mv uint32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -23142,8 +30078,7 @@ func (_ fastpathT) DecMapBoolUint32V(v map[bool]uint32, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = uint32(dd.DecodeUint(32)) if v != nil { v[mk] = mv @@ -23189,10 +30124,12 @@ func (_ fastpathT) DecMapBoolUint64V(v map[bool]uint64, checkNil bool, canChange v = make(map[bool]uint64, xlen) changed = true } + + var mk bool + var mv uint64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -23200,8 +30137,7 @@ func (_ fastpathT) DecMapBoolUint64V(v map[bool]uint64, checkNil bool, canChange } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = dd.DecodeUint(64) if v != nil { v[mk] = mv @@ -23212,6 +30148,65 @@ func (_ fastpathT) DecMapBoolUint64V(v map[bool]uint64, checkNil bool, canChange return v, changed } +func (f *decFnInfo) fastpathDecMapBoolUintptrR(rv reflect.Value) { + if rv.CanAddr() { + vp := rv.Addr().Interface().(*map[bool]uintptr) + v, changed := fastpathTV.DecMapBoolUintptrV(*vp, fastpathCheckNilFalse, true, f.d) + if changed { + *vp = v + } + } else { + v := rv.Interface().(map[bool]uintptr) + fastpathTV.DecMapBoolUintptrV(v, fastpathCheckNilFalse, false, f.d) + } +} +func (f fastpathT) DecMapBoolUintptrX(vp *map[bool]uintptr, checkNil bool, d *Decoder) { + v, changed := f.DecMapBoolUintptrV(*vp, checkNil, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapBoolUintptrV(v map[bool]uintptr, checkNil bool, canChange bool, + d *Decoder) (_ map[bool]uintptr, changed bool) { + dd := d.d + + if checkNil && dd.TryDecodeAsNil() { + if v != nil { + changed = true + } + return nil, changed + } + + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[bool]uintptr, xlen) + changed = true + } + + var mk bool + var mv uintptr + if containerLen > 0 { + for j := 0; j < containerLen; j++ { + mk = dd.DecodeBool() + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + } else if containerLen < 0 { + for j := 0; !dd.CheckBreak(); j++ { + mk = dd.DecodeBool() + mv = uintptr(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadEnd() + } + return v, changed +} + func (f *decFnInfo) fastpathDecMapBoolIntR(rv reflect.Value) { if rv.CanAddr() { vp := rv.Addr().Interface().(*map[bool]int) @@ -23247,10 +30242,12 @@ func (_ fastpathT) DecMapBoolIntV(v map[bool]int, checkNil bool, canChange bool, v = make(map[bool]int, xlen) changed = true } + + var mk bool + var mv int if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -23258,8 +30255,7 @@ func (_ fastpathT) DecMapBoolIntV(v map[bool]int, checkNil bool, canChange bool, } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = int(dd.DecodeInt(intBitsize)) if v != nil { v[mk] = mv @@ -23305,10 +30301,12 @@ func (_ fastpathT) DecMapBoolInt8V(v map[bool]int8, checkNil bool, canChange boo v = make(map[bool]int8, xlen) changed = true } + + var mk bool + var mv int8 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -23316,8 +30314,7 @@ func (_ fastpathT) DecMapBoolInt8V(v map[bool]int8, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = int8(dd.DecodeInt(8)) if v != nil { v[mk] = mv @@ -23363,10 +30360,12 @@ func (_ fastpathT) DecMapBoolInt16V(v map[bool]int16, checkNil bool, canChange b v = make(map[bool]int16, xlen) changed = true } + + var mk bool + var mv int16 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -23374,8 +30373,7 @@ func (_ fastpathT) DecMapBoolInt16V(v map[bool]int16, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = int16(dd.DecodeInt(16)) if v != nil { v[mk] = mv @@ -23421,10 +30419,12 @@ func (_ fastpathT) DecMapBoolInt32V(v map[bool]int32, checkNil bool, canChange b v = make(map[bool]int32, xlen) changed = true } + + var mk bool + var mv int32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -23432,8 +30432,7 @@ func (_ fastpathT) DecMapBoolInt32V(v map[bool]int32, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = int32(dd.DecodeInt(32)) if v != nil { v[mk] = mv @@ -23479,10 +30478,12 @@ func (_ fastpathT) DecMapBoolInt64V(v map[bool]int64, checkNil bool, canChange b v = make(map[bool]int64, xlen) changed = true } + + var mk bool + var mv int64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -23490,8 +30491,7 @@ func (_ fastpathT) DecMapBoolInt64V(v map[bool]int64, checkNil bool, canChange b } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = dd.DecodeInt(64) if v != nil { v[mk] = mv @@ -23537,10 +30537,12 @@ func (_ fastpathT) DecMapBoolFloat32V(v map[bool]float32, checkNil bool, canChan v = make(map[bool]float32, xlen) changed = true } + + var mk bool + var mv float32 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -23548,8 +30550,7 @@ func (_ fastpathT) DecMapBoolFloat32V(v map[bool]float32, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = float32(dd.DecodeFloat(true)) if v != nil { v[mk] = mv @@ -23595,10 +30596,12 @@ func (_ fastpathT) DecMapBoolFloat64V(v map[bool]float64, checkNil bool, canChan v = make(map[bool]float64, xlen) changed = true } + + var mk bool + var mv float64 if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -23606,8 +30609,7 @@ func (_ fastpathT) DecMapBoolFloat64V(v map[bool]float64, checkNil bool, canChan } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = dd.DecodeFloat(false) if v != nil { v[mk] = mv @@ -23653,10 +30655,12 @@ func (_ fastpathT) DecMapBoolBoolV(v map[bool]bool, checkNil bool, canChange boo v = make(map[bool]bool, xlen) changed = true } + + var mk bool + var mv bool if containerLen > 0 { for j := 0; j < containerLen; j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = dd.DecodeBool() if v != nil { v[mk] = mv @@ -23664,8 +30668,7 @@ func (_ fastpathT) DecMapBoolBoolV(v map[bool]bool, checkNil bool, canChange boo } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - mk := dd.DecodeBool() - mv := v[mk] + mk = dd.DecodeBool() mv = dd.DecodeBool() if v != nil { v[mk] = mv diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/fast-path.go.tmpl b/Godeps/_workspace/src/github.com/ugorji/go/codec/fast-path.go.tmpl index 5fecafd21c..7bcbaf8310 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/fast-path.go.tmpl +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/fast-path.go.tmpl @@ -116,6 +116,7 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { fastpathTV.{{ .MethodNamePfx "Enc" false }}V(*v, fastpathCheckNilTrue, e) {{end}}{{end}} default: + _ = v // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release) return false } return true @@ -182,14 +183,50 @@ func (_ fastpathT) {{ .MethodNamePfx "Enc" false }}V(v map[{{ .MapKey }}]{{ .Ele return } ee.EncodeMapStart(len(v)) - {{if eq .MapKey "string"}}asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0{{end}} - for k2, v2 := range v { - {{if eq .MapKey "string"}}if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - }{{else}}{{ encmd .MapKey "k2"}}{{end}} - {{ encmd .Elem "v2"}} + {{if eq .MapKey "string"}}asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 + {{end}}if e.h.Canonical { + {{if eq .MapKey "interface{}"}}{{/* out of band + */}}var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding + e2 := NewEncoderBytes(&mksv, e.hh) + v2 := make([]bytesI, len(v)) + var i, l int + var vp *bytesI {{/* put loop variables outside. seems currently needed for better perf */}} + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + e.asis(v2[j].v) + e.encode(v[v2[j].i]) + } {{else}}{{ $x := sorttype .MapKey true}}v2 := make([]{{ $x }}, len(v)) + var i int + for k, _ := range v { + v2[i] = {{ $x }}(k) + i++ + } + sort.Sort({{ sorttype .MapKey false}}(v2)) + for _, k2 := range v2 { + {{if eq .MapKey "string"}}if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + }{{else}}{{ $y := printf "%s(k2)" .MapKey }}{{ encmd .MapKey $y }}{{end}} + {{ $y := printf "v[%s(k2)]" .MapKey }}{{ encmd .Elem $y }} + } {{end}} + } else { + for k2, v2 := range v { + {{if eq .MapKey "string"}}if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(c_UTF8, k2) + }{{else}}{{ encmd .MapKey "k2"}}{{end}} + {{ encmd .Elem "v2"}} + } } ee.EncodeEnd() } @@ -382,30 +419,31 @@ func (_ fastpathT) {{ .MethodNamePfx "Dec" false }}V(v map[{{ .MapKey }}]{{ .Ele v = make(map[{{ .MapKey }}]{{ .Elem }}, xlen) changed = true } + {{ if eq .Elem "interface{}" }}mapGet := !d.h.MapValueReset && !d.h.InterfaceReset{{end}} + var mk {{ .MapKey }} + var mv {{ .Elem }} if containerLen > 0 { for j := 0; j < containerLen; j++ { - {{ if eq .MapKey "interface{}" }}var mk interface{} + {{ if eq .MapKey "interface{}" }}mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) {{/* // maps cannot have []byte as key. switch to string. */}} - }{{ else }}mk := {{ decmd .MapKey }}{{ end }} - mv := v[mk] - {{ if eq .Elem "interface{}" }}d.decode(&mv) - {{ else }}mv = {{ decmd .Elem }}{{ end }} + mk = d.string(bv) {{/* // maps cannot have []byte as key. switch to string. */}} + }{{ else }}mk = {{ decmd .MapKey }}{{ end }} + {{ if eq .Elem "interface{}" }}if mapGet { mv = v[mk] } else { mv = nil } + d.decode(&mv){{ else }}mv = {{ decmd .Elem }}{{ end }} if v != nil { v[mk] = mv } } } else if containerLen < 0 { for j := 0; !dd.CheckBreak(); j++ { - {{ if eq .MapKey "interface{}" }}var mk interface{} + {{ if eq .MapKey "interface{}" }}mk = nil d.decode(&mk) if bv, bok := mk.([]byte); bok { - mk = string(bv) {{/* // maps cannot have []byte as key. switch to string. */}} - }{{ else }}mk := {{ decmd .MapKey }}{{ end }} - mv := v[mk] - {{ if eq .Elem "interface{}" }}d.decode(&mv) - {{ else }}mv = {{ decmd .Elem }}{{ end }} + mk = d.string(bv) {{/* // maps cannot have []byte as key. switch to string. */}} + }{{ else }}mk = {{ decmd .MapKey }}{{ end }} + {{ if eq .Elem "interface{}" }}if mapGet { mv = v[mk] } else { mv = nil } + d.decode(&mv){{ else }}mv = {{ decmd .Elem }}{{ end }} if v != nil { v[mk] = mv } diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/gen-dec-map.go.tmpl b/Godeps/_workspace/src/github.com/ugorji/go/codec/gen-dec-map.go.tmpl index d1535f4a69..836eb3b5d7 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/gen-dec-map.go.tmpl +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/gen-dec-map.go.tmpl @@ -1,20 +1,28 @@ {{var "v"}} := *{{ .Varname }} {{var "l"}} := r.ReadMapStart() +{{var "bh"}} := z.DecBasicHandle() if {{var "v"}} == nil { - {{var "rl"}}, _ := z.DecInferLen({{var "l"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }}) + {{var "rl"}}, _ := z.DecInferLen({{var "l"}}, {{var "bh"}}.MaxInitLen, {{ .Size }}) {{var "v"}} = make(map[{{ .KTyp }}]{{ .Typ }}, {{var "rl"}}) *{{ .Varname }} = {{var "v"}} } +var {{var "mk"}} {{ .KTyp }} +var {{var "mv"}} {{ .Typ }} +var {{var "mg"}} bool +if {{var "bh"}}.MapValueReset { + {{if decElemKindPtr}}{{var "mg"}} = true + {{else if decElemKindIntf}}if !{{var "bh"}}.InterfaceReset { {{var "mg"}} = true } + {{else if not decElemKindImmutable}}{{var "mg"}} = true + {{end}} } if {{var "l"}} > 0 { for {{var "j"}} := 0; {{var "j"}} < {{var "l"}}; {{var "j"}}++ { - var {{var "mk"}} {{ .KTyp }} {{ $x := printf "%vmk%v" .TempVar .Rand }}{{ decLineVarK $x }} -{{ if eq .KTyp "interface{}" }}// special case if a byte array. - if {{var "bv"}}, {{var "bok"}} := {{var "mk"}}.([]byte); {{var "bok"}} { +{{ if eq .KTyp "interface{}" }}{{/* // special case if a byte array. */}}if {{var "bv"}}, {{var "bok"}} := {{var "mk"}}.([]byte); {{var "bok"}} { {{var "mk"}} = string({{var "bv"}}) - } -{{ end }} - {{var "mv"}} := {{var "v"}}[{{var "mk"}}] + }{{ end }} + if {{var "mg"}} { + {{var "mv"}} = {{var "v"}}[{{var "mk"}}] + } {{if not decElemKindImmutable}}else { {{var "mv"}} = {{decElemZero}} }{{end}} {{ $x := printf "%vmv%v" .TempVar .Rand }}{{ decLineVar $x }} if {{var "v"}} != nil { {{var "v"}}[{{var "mk"}}] = {{var "mv"}} @@ -22,14 +30,13 @@ for {{var "j"}} := 0; {{var "j"}} < {{var "l"}}; {{var "j"}}++ { } } else if {{var "l"}} < 0 { for {{var "j"}} := 0; !r.CheckBreak(); {{var "j"}}++ { - var {{var "mk"}} {{ .KTyp }} {{ $x := printf "%vmk%v" .TempVar .Rand }}{{ decLineVarK $x }} -{{ if eq .KTyp "interface{}" }}// special case if a byte array. - if {{var "bv"}}, {{var "bok"}} := {{var "mk"}}.([]byte); {{var "bok"}} { +{{ if eq .KTyp "interface{}" }}{{/* // special case if a byte array. */}}if {{var "bv"}}, {{var "bok"}} := {{var "mk"}}.([]byte); {{var "bok"}} { {{var "mk"}} = string({{var "bv"}}) - } -{{ end }} - {{var "mv"}} := {{var "v"}}[{{var "mk"}}] + }{{ end }} + if {{var "mg"}} { + {{var "mv"}} = {{var "v"}}[{{var "mk"}}] + } {{if not decElemKindImmutable}}else { {{var "mv"}} = {{decElemZero}} }{{end}} {{ $x := printf "%vmv%v" .TempVar .Rand }}{{ decLineVar $x }} if {{var "v"}} != nil { {{var "v"}}[{{var "mk"}}] = {{var "mv"}} diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/gen.generated.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/gen.generated.go index 9a35f02fae..dab6d94bd2 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/gen.generated.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/gen.generated.go @@ -8,21 +8,29 @@ package codec const genDecMapTmpl = ` {{var "v"}} := *{{ .Varname }} {{var "l"}} := r.ReadMapStart() +{{var "bh"}} := z.DecBasicHandle() if {{var "v"}} == nil { - {{var "rl"}}, _ := z.DecInferLen({{var "l"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }}) + {{var "rl"}}, _ := z.DecInferLen({{var "l"}}, {{var "bh"}}.MaxInitLen, {{ .Size }}) {{var "v"}} = make(map[{{ .KTyp }}]{{ .Typ }}, {{var "rl"}}) *{{ .Varname }} = {{var "v"}} } +var {{var "mk"}} {{ .KTyp }} +var {{var "mv"}} {{ .Typ }} +var {{var "mg"}} bool +if {{var "bh"}}.MapValueReset { + {{if decElemKindPtr}}{{var "mg"}} = true + {{else if decElemKindIntf}}if !{{var "bh"}}.InterfaceReset { {{var "mg"}} = true } + {{else if not decElemKindImmutable}}{{var "mg"}} = true + {{end}} } if {{var "l"}} > 0 { for {{var "j"}} := 0; {{var "j"}} < {{var "l"}}; {{var "j"}}++ { - var {{var "mk"}} {{ .KTyp }} {{ $x := printf "%vmk%v" .TempVar .Rand }}{{ decLineVarK $x }} -{{ if eq .KTyp "interface{}" }}// special case if a byte array. - if {{var "bv"}}, {{var "bok"}} := {{var "mk"}}.([]byte); {{var "bok"}} { +{{ if eq .KTyp "interface{}" }}{{/* // special case if a byte array. */}}if {{var "bv"}}, {{var "bok"}} := {{var "mk"}}.([]byte); {{var "bok"}} { {{var "mk"}} = string({{var "bv"}}) - } -{{ end }} - {{var "mv"}} := {{var "v"}}[{{var "mk"}}] + }{{ end }} + if {{var "mg"}} { + {{var "mv"}} = {{var "v"}}[{{var "mk"}}] + } {{if not decElemKindImmutable}}else { {{var "mv"}} = {{decElemZero}} }{{end}} {{ $x := printf "%vmv%v" .TempVar .Rand }}{{ decLineVar $x }} if {{var "v"}} != nil { {{var "v"}}[{{var "mk"}}] = {{var "mv"}} @@ -30,14 +38,13 @@ for {{var "j"}} := 0; {{var "j"}} < {{var "l"}}; {{var "j"}}++ { } } else if {{var "l"}} < 0 { for {{var "j"}} := 0; !r.CheckBreak(); {{var "j"}}++ { - var {{var "mk"}} {{ .KTyp }} {{ $x := printf "%vmk%v" .TempVar .Rand }}{{ decLineVarK $x }} -{{ if eq .KTyp "interface{}" }}// special case if a byte array. - if {{var "bv"}}, {{var "bok"}} := {{var "mk"}}.([]byte); {{var "bok"}} { +{{ if eq .KTyp "interface{}" }}{{/* // special case if a byte array. */}}if {{var "bv"}}, {{var "bok"}} := {{var "mk"}}.([]byte); {{var "bok"}} { {{var "mk"}} = string({{var "bv"}}) - } -{{ end }} - {{var "mv"}} := {{var "v"}}[{{var "mk"}}] + }{{ end }} + if {{var "mg"}} { + {{var "mv"}} = {{var "v"}}[{{var "mk"}}] + } {{if not decElemKindImmutable}}else { {{var "mv"}} = {{decElemZero}} }{{end}} {{ $x := printf "%vmv%v" .TempVar .Rand }}{{ decLineVar $x }} if {{var "v"}} != nil { {{var "v"}}[{{var "mk"}}] = {{var "mv"}} diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/gen.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/gen.go index 762f25cd54..b158564ba1 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/gen.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/gen.go @@ -169,7 +169,7 @@ func Gen(w io.Writer, buildTags, pkgName, uid string, useUnsafe bool, ti *TypeIn ts: []reflect.Type{}, bp: genImportPath(typ[0]), xs: uid, - ti: ti, //TODO: make it configurable + ti: ti, } if x.ti == nil { x.ti = defTypeInfos @@ -928,6 +928,7 @@ func (x *genRunner) encListFallback(varname string, t reflect.Type) { } func (x *genRunner) encMapFallback(varname string, t reflect.Type) { + // TODO: expand this to handle canonical. i := x.varsfx() x.line("r.EncodeMapStart(len(" + varname + "))") x.linef("for %sk%s, %sv%s := range %s {", genTempVarPfx, i, genTempVarPfx, i, varname) @@ -1301,8 +1302,24 @@ func (x *genRunner) decMapFallback(varname string, rtid uintptr, t reflect.Type) } telem := t.Elem() tkey := t.Key() - ts := tstruc{genTempVarPfx, x.varsfx(), varname, x.genTypeName(tkey), x.genTypeName(telem), int(telem.Size() + tkey.Size())} + ts := tstruc{ + genTempVarPfx, x.varsfx(), varname, x.genTypeName(tkey), + x.genTypeName(telem), int(telem.Size() + tkey.Size()), + } + funcs := make(template.FuncMap) + funcs["decElemZero"] = func() string { + return x.genZeroValueR(telem) + } + funcs["decElemKindImmutable"] = func() bool { + return genIsImmutable(telem) + } + funcs["decElemKindPtr"] = func() bool { + return telem.Kind() == reflect.Ptr + } + funcs["decElemKindIntf"] = func() bool { + return telem.Kind() == reflect.Interface + } funcs["decLineVarK"] = func(varname string) string { x.decVar(varname, tkey, false) return "" @@ -1726,6 +1743,8 @@ func genInternalDecCommandAsString(s string) string { return "uint32(dd.DecodeUint(32))" case "uint64": return "dd.DecodeUint(64)" + case "uintptr": + return "uintptr(dd.DecodeUint(uintBitsize))" case "int": return "int(dd.DecodeInt(intBitsize))" case "int8": @@ -1746,9 +1765,24 @@ func genInternalDecCommandAsString(s string) string { case "bool": return "dd.DecodeBool()" default: - panic(errors.New("unknown type for decode: " + s)) + panic(errors.New("gen internal: unknown type for decode: " + s)) } +} +func genInternalSortType(s string, elem bool) string { + for _, v := range [...]string{"int", "uint", "float", "bool", "string"} { + if strings.HasPrefix(s, v) { + if elem { + if v == "int" || v == "uint" || v == "float" { + return v + "64" + } else { + return v + } + } + return v + "Slice" + } + } + panic("sorttype: unexpected type: " + s) } // var genInternalMu sync.Mutex @@ -1767,6 +1801,7 @@ func genInternalInit() { "uint16", "uint32", "uint64", + "uintptr", "int", "int8", "int16", @@ -1784,6 +1819,7 @@ func genInternalInit() { "uint16", "uint32", "uint64", + "uintptr", "int", "int8", "int16", @@ -1803,6 +1839,7 @@ func genInternalInit() { "uint16": 2, "uint32": 4, "uint64": 8, + "uintptr": 1 * wordSizeBytes, "int": 1 * wordSizeBytes, "int8": 1, "int16": 2, @@ -1837,16 +1874,18 @@ func genInternalInit() { funcs["encmd"] = genInternalEncCommandAsString funcs["decmd"] = genInternalDecCommandAsString funcs["zerocmd"] = genInternalZeroValue + funcs["hasprefix"] = strings.HasPrefix + funcs["sorttype"] = genInternalSortType genInternalV = gt genInternalTmplFuncs = funcs } -// GenInternalGoFile is used to generate source files from templates. +// genInternalGoFile is used to generate source files from templates. // It is run by the program author alone. // Unfortunately, it has to be exported so that it can be called from a command line tool. // *** DO NOT USE *** -func GenInternalGoFile(r io.Reader, w io.Writer, safe bool) (err error) { +func genInternalGoFile(r io.Reader, w io.Writer, safe bool) (err error) { genInternalOnce.Do(genInternalInit) gt := genInternalV diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/helper.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/helper.go index 9c00ba562d..96b5a1f227 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/helper.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/helper.go @@ -101,6 +101,7 @@ package codec // check for these error conditions. import ( + "bytes" "encoding" "encoding/binary" "errors" @@ -975,3 +976,114 @@ func (_ checkOverflow) SignedInt(v uint64) (i int64, overflow bool) { i = int64(v) return } + +// ------------------ SORT ----------------- + +func isNaN(f float64) bool { return f != f } + +// ----------------------- + +type intSlice []int64 +type uintSlice []uint64 +type floatSlice []float64 +type boolSlice []bool +type stringSlice []string +type bytesSlice [][]byte + +func (p intSlice) Len() int { return len(p) } +func (p intSlice) Less(i, j int) bool { return p[i] < p[j] } +func (p intSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } + +func (p uintSlice) Len() int { return len(p) } +func (p uintSlice) Less(i, j int) bool { return p[i] < p[j] } +func (p uintSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } + +func (p floatSlice) Len() int { return len(p) } +func (p floatSlice) Less(i, j int) bool { + return p[i] < p[j] || isNaN(p[i]) && !isNaN(p[j]) +} +func (p floatSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } + +func (p stringSlice) Len() int { return len(p) } +func (p stringSlice) Less(i, j int) bool { return p[i] < p[j] } +func (p stringSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } + +func (p bytesSlice) Len() int { return len(p) } +func (p bytesSlice) Less(i, j int) bool { return bytes.Compare(p[i], p[j]) == -1 } +func (p bytesSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } + +func (p boolSlice) Len() int { return len(p) } +func (p boolSlice) Less(i, j int) bool { return !p[i] && p[j] } +func (p boolSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } + +// --------------------- + +type intRv struct { + v int64 + r reflect.Value +} +type intRvSlice []intRv +type uintRv struct { + v uint64 + r reflect.Value +} +type uintRvSlice []uintRv +type floatRv struct { + v float64 + r reflect.Value +} +type floatRvSlice []floatRv +type boolRv struct { + v bool + r reflect.Value +} +type boolRvSlice []boolRv +type stringRv struct { + v string + r reflect.Value +} +type stringRvSlice []stringRv +type bytesRv struct { + v []byte + r reflect.Value +} +type bytesRvSlice []bytesRv + +func (p intRvSlice) Len() int { return len(p) } +func (p intRvSlice) Less(i, j int) bool { return p[i].v < p[j].v } +func (p intRvSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } + +func (p uintRvSlice) Len() int { return len(p) } +func (p uintRvSlice) Less(i, j int) bool { return p[i].v < p[j].v } +func (p uintRvSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } + +func (p floatRvSlice) Len() int { return len(p) } +func (p floatRvSlice) Less(i, j int) bool { + return p[i].v < p[j].v || isNaN(p[i].v) && !isNaN(p[j].v) +} +func (p floatRvSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } + +func (p stringRvSlice) Len() int { return len(p) } +func (p stringRvSlice) Less(i, j int) bool { return p[i].v < p[j].v } +func (p stringRvSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } + +func (p bytesRvSlice) Len() int { return len(p) } +func (p bytesRvSlice) Less(i, j int) bool { return bytes.Compare(p[i].v, p[j].v) == -1 } +func (p bytesRvSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } + +func (p boolRvSlice) Len() int { return len(p) } +func (p boolRvSlice) Less(i, j int) bool { return !p[i].v && p[j].v } +func (p boolRvSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } + +// ----------------- + +type bytesI struct { + v []byte + i interface{} +} + +type bytesISlice []bytesI + +func (p bytesISlice) Len() int { return len(p) } +func (p bytesISlice) Less(i, j int) bool { return bytes.Compare(p[i].v, p[j].v) == -1 } +func (p bytesISlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } diff --git a/Godeps/_workspace/src/github.com/ugorji/go/codec/json.go b/Godeps/_workspace/src/github.com/ugorji/go/codec/json.go index 59e0bc24a1..e70fc658d0 100644 --- a/Godeps/_workspace/src/github.com/ugorji/go/codec/json.go +++ b/Godeps/_workspace/src/github.com/ugorji/go/codec/json.go @@ -411,7 +411,7 @@ func (e *jsonEncDriver) quoteStr(s string) { //-------------------------------- type jsonNum struct { - bytes []byte // may have [+-.eE0-9] + // bytes []byte // may have [+-.eE0-9] mantissa uint64 // where mantissa ends, and maybe dot begins. exponent int16 // exponent value. manOverflow bool @@ -421,7 +421,6 @@ type jsonNum struct { } func (x *jsonNum) reset() { - x.bytes = x.bytes[:0] x.manOverflow = false x.neg = false x.dot = false @@ -454,29 +453,26 @@ func (x *jsonNum) uintExp() (n uint64, overflow bool) { // return } -func (x *jsonNum) floatVal() (f float64) { +// these constants are only used withn floatVal. +// They are brought out, so that floatVal can be inlined. +const ( + jsonUint64MantissaBits = 52 + jsonMaxExponent = int16(len(jsonFloat64Pow10)) - 1 +) + +func (x *jsonNum) floatVal() (f float64, parseUsingStrConv bool) { // We do not want to lose precision. // Consequently, we will delegate to strconv.ParseFloat if any of the following happen: // - There are more digits than in math.MaxUint64: 18446744073709551615 (20 digits) // We expect up to 99.... (19 digits) // - The mantissa cannot fit into a 52 bits of uint64 // - The exponent is beyond our scope ie beyong 22. - const uint64MantissaBits = 52 - const maxExponent = int16(len(jsonFloat64Pow10)) - 1 + parseUsingStrConv = x.manOverflow || + x.exponent > jsonMaxExponent || + (x.exponent < 0 && -(x.exponent) > jsonMaxExponent) || + x.mantissa>>jsonUint64MantissaBits != 0 - parseUsingStrConv := x.manOverflow || - x.exponent > maxExponent || - (x.exponent < 0 && -(x.exponent) > maxExponent) || - x.mantissa>>uint64MantissaBits != 0 if parseUsingStrConv { - var err error - if f, err = strconv.ParseFloat(stringView(x.bytes), 64); err != nil { - panic(fmt.Errorf("parse float: %s, %v", x.bytes, err)) - return - } - if x.neg { - f = -f - } return } @@ -500,8 +496,9 @@ type jsonDecDriver struct { r decReader // *bytesDecReader decReader ct valueType // container type. one of unset, array or map. bstr [8]byte // scratch used for string \UXXX parsing - b [64]byte // scratch - b2 [64]byte + b [64]byte // scratch, used for parsing strings or numbers + b2 [64]byte // scratch, used only for decodeBytes (after base64) + bs []byte // scratch. Initialized from b. Used for parsing strings or numbers. wsSkipped bool // whitespace skipped @@ -662,8 +659,6 @@ func (d *jsonDecDriver) IsContainerType(vt valueType) bool { } func (d *jsonDecDriver) decNum(storeBytes bool) { - // storeBytes = true // TODO: remove. - // If it is has a . or an e|E, decode as a float; else decode as an int. b := d.skipWhitespace(false) if !(b == '+' || b == '-' || b == '.' || (b >= '0' && b <= '9')) { @@ -674,10 +669,9 @@ func (d *jsonDecDriver) decNum(storeBytes bool) { const cutoff = (1<<64-1)/uint64(10) + 1 // cutoff64(base) const jsonNumUintMaxVal = 1< gen-from-tmpl.codec.generated.go < gen-from-tmpl.generated.go <>>>>>> RUNNING VARIATIONS OF TESTS" -if [[ "x$@" = x ]]; then +if [[ "x$@" = "x" ]]; then # r, x, g, gu _run "-rtcins" _run "-xtcins" diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/clientcredentials/clientcredentials.go b/Godeps/_workspace/src/golang.org/x/oauth2/clientcredentials/clientcredentials.go index 452fb8c124..fb55bcac82 100644 --- a/Godeps/_workspace/src/golang.org/x/oauth2/clientcredentials/clientcredentials.go +++ b/Godeps/_workspace/src/golang.org/x/oauth2/clientcredentials/clientcredentials.go @@ -66,7 +66,7 @@ type Config struct { Scopes []string } -// Token uses client credentials to retreive a token. +// Token uses client credentials to retrieve a token. // The HTTP client to use is derived from the context. // If nil, http.DefaultClient is used. func (c *Config) Token(ctx context.Context) (*oauth2.Token, error) {