diff --git a/AUTHORS b/AUTHORS index f376e783a..6184a6ffc 100644 --- a/AUTHORS +++ b/AUTHORS @@ -35,3 +35,4 @@ List of contributors, in chronological order: * Strajan Sebastian (https://github.com/strajansebastian) * Artem Smirnov (https://github.com/urpylka) * William Manley (https://github.com/wmanley) +* Shengjing Zhu (https://github.com/zhsj) diff --git a/Gopkg.lock b/Gopkg.lock index 85f18e40a..44ae6e33e 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -25,7 +25,7 @@ "ast", "parser", "scanner", - "token" + "token", ] pruneopts = "" revision = "761fd5fbb34e4c2c138c280395b65b48e4ff5a53" @@ -69,7 +69,7 @@ "private/protocol/restxml", "private/protocol/xml/xmlutil", "service/s3", - "service/sts" + "service/sts", ] pruneopts = "" revision = "420cda5d6383f94f7d9c231aa44bad3325181950" @@ -97,7 +97,7 @@ packages = [ ".", "binding", - "render" + "render", ] pruneopts = "" revision = "d459835d2b077e44f7c9b453505ee29881d5d12d" @@ -196,7 +196,7 @@ name = "github.com/ncw/swift" packages = [ ".", - "swifttest" + "swifttest", ] pruneopts = "" revision = "8e9b10220613abdbc2896808ee6b43e411a4fa6c" @@ -273,17 +273,18 @@ "leveldb/opt", "leveldb/storage", "leveldb/table", - "leveldb/util" + "leveldb/util", ] pruneopts = "" revision = "714f901b98fdb3aa954b4193d8cbd64a28d80cad" [[projects]] - digest = "1:b9bca27d5fbe4ad1a1802706629580ce923bb14255c51375480dff1bebcbb8b2" + digest = "1:a1ca17cff1abec6d4ecdeb03c52338c559affd7f0b2474e928c162986da2d348" name = "github.com/ugorji/go" packages = ["codec"] pruneopts = "" - revision = "71c2886f5a673a35f909803f38ece5810165097b" + revision = "2adff0894ba3bc2eeb9f9aea45fefd49802e1a13" + version = "v1.1.4" [[projects]] branch = "master" @@ -306,7 +307,7 @@ "openpgp/errors", "openpgp/packet", "openpgp/s2k", - "ssh/terminal" + "ssh/terminal", ] pruneopts = "" revision = "b2aa35443fbc700ab74c586ae79b81c171851023" @@ -317,7 +318,7 @@ name = "golang.org/x/sys" packages = [ "unix", - "windows" + "windows", ] pruneopts = "" revision = "1d206c9fa8975fb4cf00df1dc8bf3283dc24ba0e" @@ -398,7 +399,7 @@ "golang.org/x/crypto/openpgp/packet", "golang.org/x/crypto/ssh/terminal", "golang.org/x/sys/unix", - "gopkg.in/check.v1" + "gopkg.in/check.v1", ] solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index 75993f0bb..6a2bd732d 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -13,7 +13,7 @@ [[override]] name = "github.com/ugorji/go" - revision = "71c2886f5a673a35f909803f38ece5810165097b" + version = "=1.1.4" [[override]] branch = "master" diff --git a/deb/local.go b/deb/local.go index 229f6e1da..5b8eb2a07 100644 --- a/deb/local.go +++ b/deb/local.go @@ -15,7 +15,7 @@ import ( // LocalRepo is a collection of packages created locally type LocalRepo struct { // Permanent internal ID - UUID string `json:"-"` + UUID string `codec:"UUID" json:"-"` // User-assigned name Name string // Comment @@ -25,7 +25,7 @@ type LocalRepo struct { // DefaultComponent DefaultComponent string `codec:",omitempty"` // Uploaders configuration - Uploaders *Uploaders `code:",omitempty" json:"-"` + Uploaders *Uploaders `codec:"Uploaders,omitempty" json:"-"` // "Snapshot" of current list of packages packageRefs *PackageRefList } diff --git a/deb/remote.go b/deb/remote.go index 72165baf1..7be9cda31 100644 --- a/deb/remote.go +++ b/deb/remote.go @@ -696,6 +696,18 @@ func (repo *RemoteRepo) Decode(input []byte) error { repo.ReleaseFiles = repo11.ReleaseFiles repo.Filter = repo11.Filter repo.FilterWithDeps = repo11.FilterWithDeps + } else if strings.Contains(err.Error(), "invalid length of bytes for decoding time") { + // DB created by old codec version, time.Time is not builtin type. + // https://github.com/ugorji/go-codec/issues/269 + decoder := codec.NewDecoderBytes(input, &codec.MsgpackHandle{ + // only can be configured in Deprecated BasicHandle struct + BasicHandle: codec.BasicHandle{ // nolint: staticcheck + TimeNotBuiltin: true, + }, + }) + if err = decoder.Decode(repo); err != nil { + return err + } } else { return err } diff --git a/deb/snapshot.go b/deb/snapshot.go index 307433af8..46fb438f2 100644 --- a/deb/snapshot.go +++ b/deb/snapshot.go @@ -19,15 +19,15 @@ import ( // Snapshot is immutable state of repository: list of packages type Snapshot struct { // Persisten internal ID - UUID string `json:"-"` + UUID string `codec:"UUID" json:"-"` // Human-readable name Name string // Date of creation CreatedAt time.Time // Source: kind + ID - SourceKind string `json:"-"` - SourceIDs []string `json:"-"` + SourceKind string `codec:"SourceKind" json:"-"` + SourceIDs []string `codec:"SourceIDs" json:"-"` // Description of how snapshot was created Description string @@ -163,6 +163,18 @@ func (s *Snapshot) Decode(input []byte) error { s.SourceKind = snapshot11.SourceKind s.SourceIDs = snapshot11.SourceIDs s.Description = snapshot11.Description + } else if strings.Contains(err.Error(), "invalid length of bytes for decoding time") { + // DB created by old codec version, time.Time is not builtin type. + // https://github.com/ugorji/go-codec/issues/269 + decoder := codec.NewDecoderBytes(input, &codec.MsgpackHandle{ + // only can be configured in Deprecated BasicHandle struct + BasicHandle: codec.BasicHandle{ // nolint: staticcheck + TimeNotBuiltin: true, + }, + }) + if err = decoder.Decode(s); err != nil { + return err + } } else { return err } diff --git a/vendor/github.com/ugorji/go/.travis.yml b/vendor/github.com/ugorji/go/.travis.yml new file mode 100644 index 000000000..95dbc9a95 --- /dev/null +++ b/vendor/github.com/ugorji/go/.travis.yml @@ -0,0 +1,13 @@ +language: go +sudo: false +go: + - 1.7.x # go testing suite support, which we use, was introduced in go 1.7 + - 1.8.x + - 1.9.x + - 1.10.x + - 1.11.x + - tip +script: + - go test -tags "alltests" -run Suite -coverprofile coverage.txt github.com/ugorji/go/codec +after_success: + - bash <(curl -s https://codecov.io/bash) diff --git a/vendor/github.com/ugorji/go/LICENSE b/vendor/github.com/ugorji/go/LICENSE index ccae99f6a..95a0f0541 100644 --- a/vendor/github.com/ugorji/go/LICENSE +++ b/vendor/github.com/ugorji/go/LICENSE @@ -1,25 +1,22 @@ -Copyright (c) 2012, 2013 Ugorji Nwoke. +The MIT License (MIT) + +Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -* Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -* Neither the name of the author nor the names of its contributors may be used - to endorse or promote products derived from this software - without specific prior written permission. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/github.com/ugorji/go/README.md b/vendor/github.com/ugorji/go/README.md index 0d9d754d0..e4595b6a9 100644 --- a/vendor/github.com/ugorji/go/README.md +++ b/vendor/github.com/ugorji/go/README.md @@ -1,14 +1,45 @@ -# go +[![Sourcegraph](https://sourcegraph.com/github.com/ugorji/go/-/badge.svg?v=4)](https://sourcegraph.com/github.com/ugorji/go/-/tree/codec?badge) +[![Build Status](https://travis-ci.org/ugorji/go.svg?branch=master)](https://travis-ci.org/ugorji/go) +[![codecov](https://codecov.io/gh/ugorji/go/branch/master/graph/badge.svg?v=4)](https://codecov.io/gh/ugorji/go) +[![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/ugorji/go/codec) +[![rcard](https://goreportcard.com/badge/github.com/ugorji/go/codec?v=4)](https://goreportcard.com/report/github.com/ugorji/go/codec) +[![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat-square)](https://raw.githubusercontent.com/ugorji/go/master/LICENSE) -Collection of Open-Source Go libraries and tools. +# go-codec -## Codec +This repository contains the `go-codec` library, +a High Performance and Feature-Rich Idiomatic encode/decode and rpc library for -[Codec](https://github.com/ugorji/go/tree/master/codec#readme) is a High Performance and Feature-Rich Idiomatic encode/decode and rpc library for [msgpack](http://msgpack.org) and [Binc](https://github.com/ugorji/binc). + - msgpack: https://github.com/msgpack/msgpack + - binc: http://github.com/ugorji/binc + - cbor: http://cbor.io http://tools.ietf.org/html/rfc7049 + - json: http://json.org http://tools.ietf.org/html/rfc7159 -Online documentation is at [http://godoc.org/github.com/ugorji/go/codec]. +For more information: + + - [see the codec/Readme for quick usage information](https://github.com/ugorji/go/tree/master/codec#readme) + - [view the API on godoc](http://godoc.org/github.com/ugorji/go/codec) + - [read the detailed usage/how-to primer](http://ugorji.net/blog/go-codec-primer) Install using: go get github.com/ugorji/go/codec +# Import Path + +The name of the github repo is being changed from `go` to `go-codec`. +This clarifies that this repo is only for the `go-codec`. + +However, this package has always had a stable import path of "github.com/ugorji/go/codec". +We CANNOT change that without negatively affecting all our users. + +Consequently, we enforce this import path by specifying it in the following files: + + - `go.mod` + - `codec/0_importpath.go` + +If you have a fork and want to change the package path, you will need to modify the above files. + + + + diff --git a/vendor/github.com/ugorji/go/codec/0_importpath.go b/vendor/github.com/ugorji/go/codec/0_importpath.go new file mode 100644 index 000000000..adbe862c2 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/0_importpath.go @@ -0,0 +1,7 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +package codec // import "github.com/ugorji/go/codec" + +// This establishes that this package must be imported as github.com/ugorji/go/codec. +// It makes forking easier, and plays well with pre-module releases of go. diff --git a/vendor/github.com/ugorji/go/codec/0doc.go b/vendor/github.com/ugorji/go/codec/0doc.go index c14d810a7..295ee346f 100644 --- a/vendor/github.com/ugorji/go/codec/0doc.go +++ b/vendor/github.com/ugorji/go/codec/0doc.go @@ -1,64 +1,86 @@ -// Copyright (c) 2012, 2013 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. /* -High Performance, Feature-Rich Idiomatic Go encoding library for msgpack and binc . +Package codec provides a +High Performance, Feature-Rich Idiomatic Go 1.4+ codec/encoding library +for binc, msgpack, cbor, json. Supported Serialization formats are: - - msgpack: [https://github.com/msgpack/msgpack] - - binc: [http://github.com/ugorji/binc] + - msgpack: https://github.com/msgpack/msgpack + - binc: http://github.com/ugorji/binc + - cbor: http://cbor.io http://tools.ietf.org/html/rfc7049 + - json: http://json.org http://tools.ietf.org/html/rfc7159 + - simple: To install: go get github.com/ugorji/go/codec +This package will carefully use 'unsafe' for performance reasons in specific places. +You can build without unsafe use by passing the safe or appengine tag +i.e. 'go install -tags=safe ...'. Note that unsafe is only supported for the last 3 +go sdk versions e.g. current go release is go 1.9, so we support unsafe use only from +go 1.7+ . This is because supporting unsafe requires knowledge of implementation details. + +For detailed usage information, read the primer at http://ugorji.net/blog/go-codec-primer . + The idiomatic Go support is as seen in other encoding packages in the standard library (ie json, xml, gob, etc). Rich Feature Set includes: - Simple but extremely powerful and feature-rich API + - Support for go1.4 and above, while selectively using newer APIs for later releases + - Excellent code coverage ( > 90% ) - Very High Performance. - Our extensive benchmarks show us outperforming Gob, Json and Bson by 2-4X. - This was achieved by taking extreme care on: - - managing allocation - - function frame size (important due to Go's use of split stacks), - - reflection use (and by-passing reflection for common types) - - recursion implications - - zero-copy mode (encoding/decoding to byte slice without using temp buffers) - - Correct. - Care was taken to precisely handle corner cases like: - overflows, nil maps and slices, nil value in stream, etc. - - Efficient zero-copying into temporary byte buffers - when encoding into or decoding from a byte slice. + Our extensive benchmarks show us outperforming Gob, Json, Bson, etc by 2-4X. + - Careful selected use of 'unsafe' for targeted performance gains. + 100% mode exists where 'unsafe' is not used at all. + - Lock-free (sans mutex) concurrency for scaling to 100's of cores + - In-place updates during decode, with option to zero value in maps and slices prior to decode + - Coerce types where appropriate + e.g. decode an int in the stream into a float, decode numbers from formatted strings, etc + - Corner Cases: + Overflows, nil maps/slices, nil values in streams are handled correctly - Standard field renaming via tags - - Encoding from any value + - Support for omitting empty fields during an encoding + - Encoding from any value and decoding into pointer to any value (struct, slice, map, primitives, pointers, interface{}, etc) - - Decoding into pointer to any non-nil typed value - (struct, slice, map, int, float32, bool, string, reflect.Value, etc) - - Supports extension functions to handle the encode/decode of custom types - - Support Go 1.2 encoding.BinaryMarshaler/BinaryUnmarshaler - - Schema-less decoding - (decode into a pointer to a nil interface{} as opposed to a typed non-nil value). + - Extensions to support efficient encoding/decoding of any named types + - Support encoding.(Binary|Text)(M|Unm)arshaler interfaces + - Support IsZero() bool to determine if a value is a zero value. + Analogous to time.Time.IsZero() bool. + - Decoding without a schema (into a interface{}). Includes Options to configure what specific map or slice type to use when decoding an encoded list or map into a nil interface{} + - Mapping a non-interface type to an interface, so we can decode appropriately + into any interface type with a correctly configured non-interface value. + - Encode a struct as an array, and decode struct from an array in the data stream + - Option to encode struct keys as numbers (instead of strings) + (to support structured streams with fields encoded as numeric codes) + - Comprehensive support for anonymous fields + - Fast (no-reflection) encoding/decoding of common maps and slices + - Code-generation for faster performance. + - Support binary (e.g. messagepack, cbor) and text (e.g. json) formats + - Support indefinite-length formats to enable true streaming + (for formats which support it e.g. json, cbor) + - Support canonical encoding, where a value is ALWAYS encoded as same sequence of bytes. + This mostly applies to maps, where iteration order is non-deterministic. + - NIL in data stream decoded as zero value + - Never silently skip data when decoding. + User decides whether to return an error or silently skip data when keys or indexes + in the data stream do not map to fields in the struct. + - Detect and error when encoding a cyclic reference (instead of stack overflow shutdown) + - Encode/Decode from/to chan types (for iterative streaming support) + - Drop-in replacement for encoding/json. `json:` key in struct tag supported. - Provides a RPC Server and Client Codec for net/rpc communication protocol. - - Msgpack Specific: - - Provides extension functions to handle spec-defined extensions (binary, timestamp) - - Options to resolve ambiguities in handling raw bytes (as string or []byte) - during schema-less decoding (decoding into a nil interface{}) - - RPC Server/Client Codec for msgpack-rpc protocol defined at: - https://github.com/msgpack-rpc/msgpack-rpc/blob/master/spec.md - - Fast Paths for some container types: - For some container types, we circumvent reflection and its associated overhead - and allocation costs, and encode/decode directly. These types are: - []interface{} - []int - []string - map[interface{}]interface{} - map[int]interface{} - map[string]interface{} + - Handle unique idiosyncrasies of codecs e.g. + - For messagepack, configure how ambiguities in handling raw bytes are resolved + - For messagepack, provide rpc server/client codec to support + msgpack-rpc protocol defined at: + https://github.com/msgpack-rpc/msgpack-rpc/blob/master/spec.md Extension Support @@ -78,6 +100,27 @@ encoded as an empty map because it has no exported fields, while UUID would be encoded as a string. However, with extension support, you can encode any of these however you like. +Custom Encoding and Decoding + +This package maintains symmetry in the encoding and decoding halfs. +We determine how to encode or decode by walking this decision tree + + - is type a codec.Selfer? + - is there an extension registered for the type? + - is format binary, and is type a encoding.BinaryMarshaler and BinaryUnmarshaler? + - is format specifically json, and is type a encoding/json.Marshaler and Unmarshaler? + - is format text-based, and type an encoding.TextMarshaler and TextUnmarshaler? + - else we use a pair of functions based on the "kind" of the type e.g. map, slice, int64, etc + +This symmetry is important to reduce chances of issues happening because the +encoding and decoding sides are out of sync e.g. decoded via very specific +encoding.TextUnmarshaler but encoded via kind-specific generalized mode. + +Consequently, if a type only defines one-half of the symmetry +(e.g. it implements UnmarshalJSON() but not MarshalJSON() ), +then that type doesn't satisfy the check and we will continue walking down the +decision tree. + RPC RPC Client and Server Codecs are implemented, so the codecs can be used @@ -85,19 +128,34 @@ with the standard net/rpc package. Usage -Typical usage model: +The Handle is SAFE for concurrent READ, but NOT SAFE for concurrent modification. + +The Encoder and Decoder are NOT safe for concurrent use. + +Consequently, the usage model is basically: + + - Create and initialize the Handle before any use. + Once created, DO NOT modify it. + - Multiple Encoders or Decoders can now use the Handle concurrently. + They only read information off the Handle (never write). + - However, each Encoder or Decoder MUST not be used concurrently + - To re-use an Encoder/Decoder, call Reset(...) on it first. + This allows you use state maintained on the Encoder/Decoder. + +Sample usage model: // create and configure Handle var ( bh codec.BincHandle mh codec.MsgpackHandle + ch codec.CborHandle ) mh.MapType = reflect.TypeOf(map[string]interface{}(nil)) // configure extensions // e.g. for msgpack, define functions and enable Time support for tag 1 - // mh.AddExt(reflect.TypeOf(time.Time{}), 1, myMsgpackTimeEncodeExtFn, myMsgpackTimeDecodeExtFn) + // mh.SetExt(reflect.TypeOf(time.Time{}), 1, myExt) // create and use decoder/encoder var ( @@ -131,13 +189,39 @@ Typical usage model: //OR rpcCodec := codec.MsgpackSpecRpc.ClientCodec(conn, h) client := rpc.NewClientWithCodec(rpcCodec) -Representative Benchmark Results +Running Tests -Run the benchmark suite using: - go test -bi -bench=. -benchmem +To run tests, use the following: -To run full benchmark suite (including against vmsgpack and bson), -see notes in ext_dep_test.go + go test + +To run the full suite of tests, use the following: + + go test -tags alltests -run Suite + +You can run the tag 'safe' to run tests or build in safe mode. e.g. + + go test -tags safe -run Json + go test -tags "alltests safe" -run Suite + +Running Benchmarks + +Please see http://github.com/ugorji/go-codec-bench . + +Caveats + +Struct fields matching the following are ignored during encoding and decoding + - struct tag value set to - + - func, complex numbers, unsafe pointers + - unexported and not embedded + - unexported and embedded and not struct kind + - unexported and embedded pointers (from go1.10) + +Every other field in a struct will be encoded/decoded. + +Embedded fields are encoded as if they exist in the top-level struct, +with some caveats. See Encode documentation. */ package codec + diff --git a/vendor/github.com/ugorji/go/codec/README.md b/vendor/github.com/ugorji/go/codec/README.md index 6c95d1bfd..8aa68f5b0 100644 --- a/vendor/github.com/ugorji/go/codec/README.md +++ b/vendor/github.com/ugorji/go/codec/README.md @@ -1,18 +1,28 @@ # Codec -High Performance and Feature-Rich Idiomatic Go Library providing -encode/decode support for different serialization formats. +High Performance, Feature-Rich Idiomatic Go codec/encoding library for +binc, msgpack, cbor, json. Supported Serialization formats are: - - msgpack: [https://github.com/msgpack/msgpack] - - binc: [http://github.com/ugorji/binc] + - msgpack: https://github.com/msgpack/msgpack + - binc: http://github.com/ugorji/binc + - cbor: http://cbor.io http://tools.ietf.org/html/rfc7049 + - json: http://json.org http://tools.ietf.org/html/rfc7159 + - simple: To install: go get github.com/ugorji/go/codec -Online documentation: [http://godoc.org/github.com/ugorji/go/codec] +This package will carefully use 'unsafe' for performance reasons in specific places. +You can build without unsafe use by passing the safe or appengine tag +i.e. 'go install -tags=safe ...'. Note that unsafe is only supported for the last 3 +go sdk versions e.g. current go release is go 1.9, so we support unsafe use only from +go 1.7+ . This is because supporting unsafe requires knowledge of implementation details. + +Online documentation: http://godoc.org/github.com/ugorji/go/codec +Detailed Usage/How-to Primer: http://ugorji.net/blog/go-codec-primer The idiomatic Go support is as seen in other encoding packages in the standard library (ie json, xml, gob, etc). @@ -20,46 +30,54 @@ the standard library (ie json, xml, gob, etc). Rich Feature Set includes: - Simple but extremely powerful and feature-rich API - - Very High Performance. - Our extensive benchmarks show us outperforming Gob, Json and Bson by 2-4X. - This was achieved by taking extreme care on: - - managing allocation - - function frame size (important due to Go's use of split stacks), - - reflection use (and by-passing reflection for common types) - - recursion implications - - zero-copy mode (encoding/decoding to byte slice without using temp buffers) - - Correct. - Care was taken to precisely handle corner cases like: - overflows, nil maps and slices, nil value in stream, etc. - - Efficient zero-copying into temporary byte buffers - when encoding into or decoding from a byte slice. + - Support for go1.4 and above, while selectively using newer APIs for later releases + - Excellent code coverage ( > 90% ) + - Very High Performance. + Our extensive benchmarks show us outperforming Gob, Json, Bson, etc by 2-4X. + - Careful selected use of 'unsafe' for targeted performance gains. + 100% mode exists where 'unsafe' is not used at all. + - Lock-free (sans mutex) concurrency for scaling to 100's of cores + - In-place updates during decode, with option to zero the value in maps and slices prior to decode + - Coerce types where appropriate + e.g. decode an int in the stream into a float, decode numbers from formatted strings, etc + - Corner Cases: + Overflows, nil maps/slices, nil values in streams are handled correctly - Standard field renaming via tags - - Encoding from any value + - Support for omitting empty fields during an encoding + - Encoding from any value and decoding into pointer to any value (struct, slice, map, primitives, pointers, interface{}, etc) - - Decoding into pointer to any non-nil typed value - (struct, slice, map, int, float32, bool, string, reflect.Value, etc) - - Supports extension functions to handle the encode/decode of custom types - - Support Go 1.2 encoding.BinaryMarshaler/BinaryUnmarshaler - - Schema-less decoding - (decode into a pointer to a nil interface{} as opposed to a typed non-nil value). - Includes Options to configure what specific map or slice type to use + - Extensions to support efficient encoding/decoding of any named types + - Support encoding.(Binary|Text)(M|Unm)arshaler interfaces + - Support IsZero() bool to determine if a value is a zero value. + Analogous to time.Time.IsZero() bool. + - Decoding without a schema (into a interface{}). + Includes Options to configure what specific map or slice type to use when decoding an encoded list or map into a nil interface{} + - Mapping a non-interface type to an interface, so we can decode appropriately + into any interface type with a correctly configured non-interface value. + - Encode a struct as an array, and decode struct from an array in the data stream + - Option to encode struct keys as numbers (instead of strings) + (to support structured streams with fields encoded as numeric codes) + - Comprehensive support for anonymous fields + - Fast (no-reflection) encoding/decoding of common maps and slices + - Code-generation for faster performance. + - Support binary (e.g. messagepack, cbor) and text (e.g. json) formats + - Support indefinite-length formats to enable true streaming + (for formats which support it e.g. json, cbor) + - Support canonical encoding, where a value is ALWAYS encoded as same sequence of bytes. + This mostly applies to maps, where iteration order is non-deterministic. + - NIL in data stream decoded as zero value + - Never silently skip data when decoding. + User decides whether to return an error or silently skip data when keys or indexes + in the data stream do not map to fields in the struct. + - Encode/Decode from/to chan types (for iterative streaming support) + - Drop-in replacement for encoding/json. `json:` key in struct tag supported. - Provides a RPC Server and Client Codec for net/rpc communication protocol. - - Msgpack Specific: - - Provides extension functions to handle spec-defined extensions (binary, timestamp) - - Options to resolve ambiguities in handling raw bytes (as string or []byte) - during schema-less decoding (decoding into a nil interface{}) - - RPC Server/Client Codec for msgpack-rpc protocol defined at: - https://github.com/msgpack-rpc/msgpack-rpc/blob/master/spec.md - - Fast Paths for some container types: - For some container types, we circumvent reflection and its associated overhead - and allocation costs, and encode/decode directly. These types are: - []interface{} - []int - []string - map[interface{}]interface{} - map[int]interface{} - map[string]interface{} + - Handle unique idiosyncrasies of codecs e.g. + - For messagepack, configure how ambiguities in handling raw bytes are resolved + - For messagepack, provide rpc server/client codec to support + msgpack-rpc protocol defined at: + https://github.com/msgpack-rpc/msgpack-rpc/blob/master/spec.md ## Extension Support @@ -79,6 +97,27 @@ encoded as an empty map because it has no exported fields, while UUID would be encoded as a string. However, with extension support, you can encode any of these however you like. +## Custom Encoding and Decoding + +This package maintains symmetry in the encoding and decoding halfs. +We determine how to encode or decode by walking this decision tree + + - is type a codec.Selfer? + - is there an extension registered for the type? + - is format binary, and is type a encoding.BinaryMarshaler and BinaryUnmarshaler? + - is format specifically json, and is type a encoding/json.Marshaler and Unmarshaler? + - is format text-based, and type an encoding.TextMarshaler and TextUnmarshaler? + - else we use a pair of functions based on the "kind" of the type e.g. map, slice, int64, etc + +This symmetry is important to reduce chances of issues happening because the +encoding and decoding sides are out of sync e.g. decoded via very specific +encoding.TextUnmarshaler but encoded via kind-specific generalized mode. + +Consequently, if a type only defines one-half of the symmetry +(e.g. it implements UnmarshalJSON() but not MarshalJSON() ), +then that type doesn't satisfy the check and we will continue walking down the +decision tree. + ## RPC RPC Client and Server Codecs are implemented, so the codecs can be used @@ -92,13 +131,14 @@ Typical usage model: var ( bh codec.BincHandle mh codec.MsgpackHandle + ch codec.CborHandle ) mh.MapType = reflect.TypeOf(map[string]interface{}(nil)) - + // configure extensions // e.g. for msgpack, define functions and enable Time support for tag 1 - // mh.AddExt(reflect.TypeOf(time.Time{}), 1, myMsgpackTimeEncodeExtFn, myMsgpackTimeDecodeExtFn) + // mh.SetExt(reflect.TypeOf(time.Time{}), 1, myExt) // create and use decoder/encoder var ( @@ -107,15 +147,15 @@ Typical usage model: b []byte h = &bh // or mh to use msgpack ) - + dec = codec.NewDecoder(r, h) dec = codec.NewDecoderBytes(b, h) - err = dec.Decode(&v) - + err = dec.Decode(&v) + enc = codec.NewEncoder(w, h) enc = codec.NewEncoderBytes(&b, h) err = enc.Encode(v) - + //RPC Server go func() { for { @@ -132,43 +172,36 @@ Typical usage model: //OR rpcCodec := codec.MsgpackSpecRpc.ClientCodec(conn, h) client := rpc.NewClientWithCodec(rpcCodec) -## Representative Benchmark Results - -A sample run of benchmark using "go test -bi -bench=. -benchmem": - - /proc/cpuinfo: Intel(R) Core(TM) i7-2630QM CPU @ 2.00GHz (HT) - - .............................................. - BENCHMARK INIT: 2013-10-16 11:02:50.345970786 -0400 EDT - To run full benchmark comparing encodings (MsgPack, Binc, JSON, GOB, etc), use: "go test -bench=." - Benchmark: - Struct recursive Depth: 1 - ApproxDeepSize Of benchmark Struct: 4694 bytes - Benchmark One-Pass Run: - v-msgpack: len: 1600 bytes - bson: len: 3025 bytes - msgpack: len: 1560 bytes - binc: len: 1187 bytes - gob: len: 1972 bytes - json: len: 2538 bytes - .............................................. - PASS - Benchmark__Msgpack____Encode 50000 54359 ns/op 14953 B/op 83 allocs/op - Benchmark__Msgpack____Decode 10000 106531 ns/op 14990 B/op 410 allocs/op - Benchmark__Binc_NoSym_Encode 50000 53956 ns/op 14966 B/op 83 allocs/op - Benchmark__Binc_NoSym_Decode 10000 103751 ns/op 14529 B/op 386 allocs/op - Benchmark__Binc_Sym___Encode 50000 65961 ns/op 17130 B/op 88 allocs/op - Benchmark__Binc_Sym___Decode 10000 106310 ns/op 15857 B/op 287 allocs/op - Benchmark__Gob________Encode 10000 135944 ns/op 21189 B/op 237 allocs/op - Benchmark__Gob________Decode 5000 405390 ns/op 83460 B/op 1841 allocs/op - Benchmark__Json_______Encode 20000 79412 ns/op 13874 B/op 102 allocs/op - Benchmark__Json_______Decode 10000 247979 ns/op 14202 B/op 493 allocs/op - Benchmark__Bson_______Encode 10000 121762 ns/op 27814 B/op 514 allocs/op - Benchmark__Bson_______Decode 10000 162126 ns/op 16514 B/op 789 allocs/op - Benchmark__VMsgpack___Encode 50000 69155 ns/op 12370 B/op 344 allocs/op - Benchmark__VMsgpack___Decode 10000 151609 ns/op 20307 B/op 571 allocs/op - ok ugorji.net/codec 30.827s - -To run full benchmark suite (including against vmsgpack and bson), -see notes in ext\_dep\_test.go +## Running Tests + +To run tests, use the following: + + go test + +To run the full suite of tests, use the following: + + go test -tags alltests -run Suite + +You can run the tag 'safe' to run tests or build in safe mode. e.g. + + go test -tags safe -run Json + go test -tags "alltests safe" -run Suite + +## Running Benchmarks + +Please see http://github.com/ugorji/go-codec-bench . + +## Caveats + +Struct fields matching the following are ignored during encoding and decoding + + - struct tag value set to - + - func, complex numbers, unsafe pointers + - unexported and not embedded + - unexported and embedded and not struct kind + - unexported and embedded pointers (from go1.10) + +Every other field in a struct will be encoded/decoded. +Embedded fields are encoded as if they exist in the top-level struct, +with some caveats. See Encode documentation. diff --git a/vendor/github.com/ugorji/go/codec/bench_test.go b/vendor/github.com/ugorji/go/codec/bench_test.go deleted file mode 100644 index 4d437035e..000000000 --- a/vendor/github.com/ugorji/go/codec/bench_test.go +++ /dev/null @@ -1,319 +0,0 @@ -// Copyright (c) 2012, 2013 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. - -package codec - -import ( - "bytes" - "encoding/gob" - "encoding/json" - "flag" - "fmt" - "reflect" - "runtime" - "testing" - "time" -) - -// Sample way to run: -// go test -bi -bv -bd=1 -benchmem -bench=. - -var ( - _ = fmt.Printf - benchTs *TestStruc - - approxSize int - - benchDoInitBench bool - benchVerify bool - benchUnscientificRes bool = false - //depth of 0 maps to ~400bytes json-encoded string, 1 maps to ~1400 bytes, etc - //For depth>1, we likely trigger stack growth for encoders, making benchmarking unreliable. - benchDepth int - benchInitDebug bool - benchCheckers []benchChecker -) - -type benchEncFn func(interface{}) ([]byte, error) -type benchDecFn func([]byte, interface{}) error -type benchIntfFn func() interface{} - -type benchChecker struct { - name string - encodefn benchEncFn - decodefn benchDecFn -} - -func benchInitFlags() { - flag.BoolVar(&benchInitDebug, "bg", false, "Bench Debug") - flag.IntVar(&benchDepth, "bd", 1, "Bench Depth: If >1, potential unreliable results due to stack growth") - flag.BoolVar(&benchDoInitBench, "bi", false, "Run Bench Init") - flag.BoolVar(&benchVerify, "bv", false, "Verify Decoded Value during Benchmark") - flag.BoolVar(&benchUnscientificRes, "bu", false, "Show Unscientific Results during Benchmark") -} - -func benchInit() { - benchTs = newTestStruc(benchDepth, true) - approxSize = approxDataSize(reflect.ValueOf(benchTs)) - bytesLen := 1024 * 4 * (benchDepth + 1) * (benchDepth + 1) - if bytesLen < approxSize { - bytesLen = approxSize - } - - benchCheckers = append(benchCheckers, - benchChecker{"msgpack", fnMsgpackEncodeFn, fnMsgpackDecodeFn}, - benchChecker{"binc-nosym", fnBincNoSymEncodeFn, fnBincNoSymDecodeFn}, - benchChecker{"binc-sym", fnBincSymEncodeFn, fnBincSymDecodeFn}, - benchChecker{"simple", fnSimpleEncodeFn, fnSimpleDecodeFn}, - benchChecker{"gob", fnGobEncodeFn, fnGobDecodeFn}, - benchChecker{"json", fnJsonEncodeFn, fnJsonDecodeFn}, - ) - if benchDoInitBench { - runBenchInit() - } -} - -func runBenchInit() { - logT(nil, "..............................................") - logT(nil, "BENCHMARK INIT: %v", time.Now()) - logT(nil, "To run full benchmark comparing encodings (MsgPack, Binc, Simple, JSON, GOB, etc), "+ - "use: \"go test -bench=.\"") - logT(nil, "Benchmark: ") - logT(nil, "\tStruct recursive Depth: %d", benchDepth) - if approxSize > 0 { - logT(nil, "\tApproxDeepSize Of benchmark Struct: %d bytes", approxSize) - } - if benchUnscientificRes { - logT(nil, "Benchmark One-Pass Run (with Unscientific Encode/Decode times): ") - } else { - logT(nil, "Benchmark One-Pass Run:") - } - for _, bc := range benchCheckers { - doBenchCheck(bc.name, bc.encodefn, bc.decodefn) - } - logT(nil, "..............................................") - if benchInitDebug { - logT(nil, "<<<<====>>>> depth: %v, ts: %#v\n", benchDepth, benchTs) - } -} - -func fnBenchNewTs() interface{} { - return new(TestStruc) -} - -func doBenchCheck(name string, encfn benchEncFn, decfn benchDecFn) { - runtime.GC() - tnow := time.Now() - buf, err := encfn(benchTs) - if err != nil { - logT(nil, "\t%10s: **** Error encoding benchTs: %v", name, err) - } - encDur := time.Now().Sub(tnow) - encLen := len(buf) - runtime.GC() - if !benchUnscientificRes { - logT(nil, "\t%10s: len: %d bytes\n", name, encLen) - return - } - tnow = time.Now() - if err = decfn(buf, new(TestStruc)); err != nil { - logT(nil, "\t%10s: **** Error decoding into new TestStruc: %v", name, err) - } - decDur := time.Now().Sub(tnow) - logT(nil, "\t%10s: len: %d bytes, encode: %v, decode: %v\n", name, encLen, encDur, decDur) -} - -func fnBenchmarkEncode(b *testing.B, encName string, ts interface{}, encfn benchEncFn) { - runtime.GC() - b.ResetTimer() - for i := 0; i < b.N; i++ { - _, err := encfn(ts) - if err != nil { - logT(b, "Error encoding benchTs: %s: %v", encName, err) - b.FailNow() - } - } -} - -func fnBenchmarkDecode(b *testing.B, encName string, ts interface{}, - encfn benchEncFn, decfn benchDecFn, newfn benchIntfFn, -) { - buf, err := encfn(ts) - if err != nil { - logT(b, "Error encoding benchTs: %s: %v", encName, err) - b.FailNow() - } - runtime.GC() - b.ResetTimer() - for i := 0; i < b.N; i++ { - ts = newfn() - if err = decfn(buf, ts); err != nil { - logT(b, "Error decoding into new TestStruc: %s: %v", encName, err) - b.FailNow() - } - if benchVerify { - if vts, vok := ts.(*TestStruc); vok { - verifyTsTree(b, vts) - } - } - } -} - -func verifyTsTree(b *testing.B, ts *TestStruc) { - var ts0, ts1m, ts2m, ts1s, ts2s *TestStruc - ts0 = ts - - if benchDepth > 0 { - ts1m, ts1s = verifyCheckAndGet(b, ts0) - } - - if benchDepth > 1 { - ts2m, ts2s = verifyCheckAndGet(b, ts1m) - } - for _, tsx := range []*TestStruc{ts0, ts1m, ts2m, ts1s, ts2s} { - if tsx != nil { - verifyOneOne(b, tsx) - } - } -} - -func verifyCheckAndGet(b *testing.B, ts0 *TestStruc) (ts1m *TestStruc, ts1s *TestStruc) { - // if len(ts1m.Ms) <= 2 { - // logT(b, "Error: ts1m.Ms len should be > 2. Got: %v", len(ts1m.Ms)) - // b.FailNow() - // } - if len(ts0.Its) == 0 { - logT(b, "Error: ts0.Islice len should be > 0. Got: %v", len(ts0.Its)) - b.FailNow() - } - ts1m = ts0.Mtsptr["0"] - ts1s = ts0.Its[0] - if ts1m == nil || ts1s == nil { - logT(b, "Error: At benchDepth 1, No *TestStruc found") - b.FailNow() - } - return -} - -func verifyOneOne(b *testing.B, ts *TestStruc) { - if ts.I64slice[2] != int64(3) { - logT(b, "Error: Decode failed by checking values") - b.FailNow() - } -} - -func fnMsgpackEncodeFn(ts interface{}) (bs []byte, err error) { - err = NewEncoderBytes(&bs, testMsgpackH).Encode(ts) - return -} - -func fnMsgpackDecodeFn(buf []byte, ts interface{}) error { - return NewDecoderBytes(buf, testMsgpackH).Decode(ts) -} - -func fnBincEncodeFn(ts interface{}, sym AsSymbolFlag) (bs []byte, err error) { - tSym := testBincH.AsSymbols - testBincH.AsSymbols = sym - err = NewEncoderBytes(&bs, testBincH).Encode(ts) - testBincH.AsSymbols = tSym - return -} - -func fnBincDecodeFn(buf []byte, ts interface{}, sym AsSymbolFlag) (err error) { - tSym := testBincH.AsSymbols - testBincH.AsSymbols = sym - err = NewDecoderBytes(buf, testBincH).Decode(ts) - testBincH.AsSymbols = tSym - return -} - -func fnBincNoSymEncodeFn(ts interface{}) (bs []byte, err error) { - return fnBincEncodeFn(ts, AsSymbolNone) -} - -func fnBincNoSymDecodeFn(buf []byte, ts interface{}) error { - return fnBincDecodeFn(buf, ts, AsSymbolNone) -} - -func fnBincSymEncodeFn(ts interface{}) (bs []byte, err error) { - return fnBincEncodeFn(ts, AsSymbolAll) -} - -func fnBincSymDecodeFn(buf []byte, ts interface{}) error { - return fnBincDecodeFn(buf, ts, AsSymbolAll) -} - -func fnSimpleEncodeFn(ts interface{}) (bs []byte, err error) { - err = NewEncoderBytes(&bs, testSimpleH).Encode(ts) - return -} - -func fnSimpleDecodeFn(buf []byte, ts interface{}) error { - return NewDecoderBytes(buf, testSimpleH).Decode(ts) -} - -func fnGobEncodeFn(ts interface{}) ([]byte, error) { - bbuf := new(bytes.Buffer) - err := gob.NewEncoder(bbuf).Encode(ts) - return bbuf.Bytes(), err -} - -func fnGobDecodeFn(buf []byte, ts interface{}) error { - return gob.NewDecoder(bytes.NewBuffer(buf)).Decode(ts) -} - -func fnJsonEncodeFn(ts interface{}) ([]byte, error) { - return json.Marshal(ts) -} - -func fnJsonDecodeFn(buf []byte, ts interface{}) error { - return json.Unmarshal(buf, ts) -} - -func Benchmark__Msgpack____Encode(b *testing.B) { - fnBenchmarkEncode(b, "msgpack", benchTs, fnMsgpackEncodeFn) -} - -func Benchmark__Msgpack____Decode(b *testing.B) { - fnBenchmarkDecode(b, "msgpack", benchTs, fnMsgpackEncodeFn, fnMsgpackDecodeFn, fnBenchNewTs) -} - -func Benchmark__Binc_NoSym_Encode(b *testing.B) { - fnBenchmarkEncode(b, "binc", benchTs, fnBincNoSymEncodeFn) -} - -func Benchmark__Binc_NoSym_Decode(b *testing.B) { - fnBenchmarkDecode(b, "binc", benchTs, fnBincNoSymEncodeFn, fnBincNoSymDecodeFn, fnBenchNewTs) -} - -func Benchmark__Binc_Sym___Encode(b *testing.B) { - fnBenchmarkEncode(b, "binc", benchTs, fnBincSymEncodeFn) -} - -func Benchmark__Binc_Sym___Decode(b *testing.B) { - fnBenchmarkDecode(b, "binc", benchTs, fnBincSymEncodeFn, fnBincSymDecodeFn, fnBenchNewTs) -} - -func Benchmark__Simple____Encode(b *testing.B) { - fnBenchmarkEncode(b, "simple", benchTs, fnSimpleEncodeFn) -} - -func Benchmark__Simple____Decode(b *testing.B) { - fnBenchmarkDecode(b, "simple", benchTs, fnSimpleEncodeFn, fnSimpleDecodeFn, fnBenchNewTs) -} - -func Benchmark__Gob________Encode(b *testing.B) { - fnBenchmarkEncode(b, "gob", benchTs, fnGobEncodeFn) -} - -func Benchmark__Gob________Decode(b *testing.B) { - fnBenchmarkDecode(b, "gob", benchTs, fnGobEncodeFn, fnGobDecodeFn, fnBenchNewTs) -} - -func Benchmark__Json_______Encode(b *testing.B) { - fnBenchmarkEncode(b, "json", benchTs, fnJsonEncodeFn) -} - -func Benchmark__Json_______Decode(b *testing.B) { - fnBenchmarkDecode(b, "json", benchTs, fnJsonEncodeFn, fnJsonDecodeFn, fnBenchNewTs) -} diff --git a/vendor/github.com/ugorji/go/codec/binc.go b/vendor/github.com/ugorji/go/codec/binc.go index 2bb5e8fee..c9877ac7c 100644 --- a/vendor/github.com/ugorji/go/codec/binc.go +++ b/vendor/github.com/ugorji/go/codec/binc.go @@ -1,20 +1,16 @@ -// Copyright (c) 2012, 2013 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. package codec import ( "math" - // "reflect" - // "sync/atomic" + "reflect" "time" - //"fmt" ) const bincDoPrune = true // No longer needed. Needed before as C lib did not support pruning. -//var _ = fmt.Printf - // vd as low 4 bits (there are 16 slots) const ( bincVdSpecial byte = iota @@ -59,31 +55,79 @@ const ( // others not currently supported ) +func bincdesc(vd, vs byte) string { + switch vd { + case bincVdSpecial: + switch vs { + case bincSpNil: + return "nil" + case bincSpFalse: + return "false" + case bincSpTrue: + return "true" + case bincSpNan, bincSpPosInf, bincSpNegInf, bincSpZeroFloat: + return "float" + case bincSpZero: + return "uint" + case bincSpNegOne: + return "int" + default: + return "unknown" + } + case bincVdSmallInt, bincVdPosInt: + return "uint" + case bincVdNegInt: + return "int" + case bincVdFloat: + return "float" + case bincVdSymbol: + return "string" + case bincVdString: + return "string" + case bincVdByteArray: + return "bytes" + case bincVdTimestamp: + return "time" + case bincVdCustomExt: + return "ext" + case bincVdArray: + return "array" + case bincVdMap: + return "map" + default: + return "unknown" + } +} + type bincEncDriver struct { - w encWriter + e *Encoder + h *BincHandle + w *encWriterSwitch m map[string]uint16 // symbols - s uint32 // symbols sequencer - b [8]byte + b [16]byte // scratch, used for encoding numbers - bigendian style + s uint16 // symbols sequencer + // c containerState + encDriverTrackContainerWriter + noBuiltInTypes + // encNoSeparator + _ [1]uint64 // padding } -func (e *bincEncDriver) isBuiltinType(rt uintptr) bool { - return rt == timeTypId +func (e *bincEncDriver) EncodeNil() { + e.w.writen1(bincVdSpecial<<4 | bincSpNil) } -func (e *bincEncDriver) encodeBuiltin(rt uintptr, v interface{}) { - switch rt { - case timeTypId: - bs := encodeTime(v.(time.Time)) +func (e *bincEncDriver) EncodeTime(t time.Time) { + if t.IsZero() { + e.EncodeNil() + } else { + bs := bincEncodeTime(t) e.w.writen1(bincVdTimestamp<<4 | uint8(len(bs))) e.w.writeb(bs) } } -func (e *bincEncDriver) encodeNil() { - e.w.writen1(bincVdSpecial<<4 | bincSpNil) -} - -func (e *bincEncDriver) encodeBool(b bool) { +func (e *bincEncDriver) EncodeBool(b bool) { if b { e.w.writen1(bincVdSpecial<<4 | bincSpTrue) } else { @@ -91,21 +135,21 @@ func (e *bincEncDriver) encodeBool(b bool) { } } -func (e *bincEncDriver) encodeFloat32(f float32) { +func (e *bincEncDriver) EncodeFloat32(f float32) { if f == 0 { e.w.writen1(bincVdSpecial<<4 | bincSpZeroFloat) return } e.w.writen1(bincVdFloat<<4 | bincFlBin32) - e.w.writeUint32(math.Float32bits(f)) + bigenHelper{e.b[:4], e.w}.writeUint32(math.Float32bits(f)) } -func (e *bincEncDriver) encodeFloat64(f float64) { +func (e *bincEncDriver) EncodeFloat64(f float64) { if f == 0 { e.w.writen1(bincVdSpecial<<4 | bincSpZeroFloat) return } - bigen.PutUint64(e.b[:], math.Float64bits(f)) + bigen.PutUint64(e.b[:8], math.Float64bits(f)) if bincDoPrune { i := 7 for ; i >= 0 && (e.b[i] == 0); i-- { @@ -119,7 +163,7 @@ func (e *bincEncDriver) encodeFloat64(f float64) { } } e.w.writen1(bincVdFloat<<4 | bincFlBin64) - e.w.writeb(e.b[:]) + e.w.writeb(e.b[:8]) } func (e *bincEncDriver) encIntegerPrune(bd byte, pos bool, v uint64, lim uint8) { @@ -138,64 +182,71 @@ func (e *bincEncDriver) encIntegerPrune(bd byte, pos bool, v uint64, lim uint8) } } -func (e *bincEncDriver) encodeInt(v int64) { - const nbd byte = bincVdNegInt << 4 - switch { - case v >= 0: +func (e *bincEncDriver) EncodeInt(v int64) { + // const nbd byte = bincVdNegInt << 4 + if v >= 0 { e.encUint(bincVdPosInt<<4, true, uint64(v)) - case v == -1: + } else if v == -1 { e.w.writen1(bincVdSpecial<<4 | bincSpNegOne) - default: + } else { e.encUint(bincVdNegInt<<4, false, uint64(-v)) } } -func (e *bincEncDriver) encodeUint(v uint64) { +func (e *bincEncDriver) EncodeUint(v uint64) { e.encUint(bincVdPosInt<<4, true, v) } func (e *bincEncDriver) encUint(bd byte, pos bool, v uint64) { - switch { - case v == 0: + if v == 0 { e.w.writen1(bincVdSpecial<<4 | bincSpZero) - case pos && v >= 1 && v <= 16: + } else if pos && v >= 1 && v <= 16 { e.w.writen1(bincVdSmallInt<<4 | byte(v-1)) - case v <= math.MaxUint8: + } else if v <= math.MaxUint8 { e.w.writen2(bd|0x0, byte(v)) - case v <= math.MaxUint16: + } else if v <= math.MaxUint16 { e.w.writen1(bd | 0x01) - e.w.writeUint16(uint16(v)) - case v <= math.MaxUint32: + bigenHelper{e.b[:2], e.w}.writeUint16(uint16(v)) + } else if v <= math.MaxUint32 { e.encIntegerPrune(bd, pos, v, 4) - default: + } else { e.encIntegerPrune(bd, pos, v, 8) } } +func (e *bincEncDriver) EncodeExt(rv interface{}, xtag uint64, ext Ext, _ *Encoder) { + bs := ext.WriteExt(rv) + if bs == nil { + e.EncodeNil() + return + } + e.encodeExtPreamble(uint8(xtag), len(bs)) + e.w.writeb(bs) +} + +func (e *bincEncDriver) EncodeRawExt(re *RawExt, _ *Encoder) { + e.encodeExtPreamble(uint8(re.Tag), len(re.Data)) + e.w.writeb(re.Data) +} + func (e *bincEncDriver) encodeExtPreamble(xtag byte, length int) { e.encLen(bincVdCustomExt<<4, uint64(length)) e.w.writen1(xtag) } -func (e *bincEncDriver) encodeArrayPreamble(length int) { +func (e *bincEncDriver) WriteArrayStart(length int) { e.encLen(bincVdArray<<4, uint64(length)) + e.c = containerArrayStart } -func (e *bincEncDriver) encodeMapPreamble(length int) { +func (e *bincEncDriver) WriteMapStart(length int) { e.encLen(bincVdMap<<4, uint64(length)) + e.c = containerMapStart } -func (e *bincEncDriver) encodeString(c charEncoding, v string) { - l := uint64(len(v)) - e.encBytesLen(c, l) - if l > 0 { - e.w.writestr(v) - } -} - -func (e *bincEncDriver) encodeSymbol(v string) { +func (e *bincEncDriver) EncodeSymbol(v string) { // if WriteSymbolsNoRefs { - // e.encodeString(c_UTF8, v) + // e.encodeString(cUTF8, v) // return // } @@ -204,12 +255,11 @@ func (e *bincEncDriver) encodeSymbol(v string) { //(bd with embedded length, and single byte for string val). l := len(v) - switch l { - case 0: - e.encBytesLen(c_UTF8, 0) + if l == 0 { + e.encBytesLen(cUTF8, 0) return - case 1: - e.encBytesLen(c_UTF8, 1) + } else if l == 1 { + e.encBytesLen(cUTF8, 1) e.w.writen1(v[0]) return } @@ -222,45 +272,72 @@ func (e *bincEncDriver) encodeSymbol(v string) { e.w.writen2(bincVdSymbol<<4, byte(ui)) } else { e.w.writen1(bincVdSymbol<<4 | 0x8) - e.w.writeUint16(ui) + bigenHelper{e.b[:2], e.w}.writeUint16(ui) } } else { e.s++ - ui = uint16(e.s) + ui = e.s //ui = uint16(atomic.AddUint32(&e.s, 1)) e.m[v] = ui var lenprec uint8 - switch { - case l <= math.MaxUint8: + if l <= math.MaxUint8 { // lenprec = 0 - case l <= math.MaxUint16: + } else if l <= math.MaxUint16 { lenprec = 1 - case int64(l) <= math.MaxUint32: + } else if int64(l) <= math.MaxUint32 { lenprec = 2 - default: + } else { lenprec = 3 } if ui <= math.MaxUint8 { e.w.writen2(bincVdSymbol<<4|0x0|0x4|lenprec, byte(ui)) } else { e.w.writen1(bincVdSymbol<<4 | 0x8 | 0x4 | lenprec) - e.w.writeUint16(ui) + bigenHelper{e.b[:2], e.w}.writeUint16(ui) } - switch lenprec { - case 0: + if lenprec == 0 { e.w.writen1(byte(l)) - case 1: - e.w.writeUint16(uint16(l)) - case 2: - e.w.writeUint32(uint32(l)) - default: - e.w.writeUint64(uint64(l)) + } else if lenprec == 1 { + bigenHelper{e.b[:2], e.w}.writeUint16(uint16(l)) + } else if lenprec == 2 { + bigenHelper{e.b[:4], e.w}.writeUint32(uint32(l)) + } else { + bigenHelper{e.b[:8], e.w}.writeUint64(uint64(l)) } e.w.writestr(v) } } -func (e *bincEncDriver) encodeStringBytes(c charEncoding, v []byte) { +func (e *bincEncDriver) EncodeString(c charEncoding, v string) { + if e.c == containerMapKey && c == cUTF8 && (e.h.AsSymbols == 0 || e.h.AsSymbols == 1) { + e.EncodeSymbol(v) + return + } + l := uint64(len(v)) + e.encBytesLen(c, l) + if l > 0 { + e.w.writestr(v) + } +} + +func (e *bincEncDriver) EncodeStringEnc(c charEncoding, v string) { + if e.c == containerMapKey && c == cUTF8 && (e.h.AsSymbols == 0 || e.h.AsSymbols == 1) { + e.EncodeSymbol(v) + return + } + l := uint64(len(v)) + e.encLen(bincVdString<<4, l) // e.encBytesLen(c, l) + if l > 0 { + e.w.writestr(v) + } + +} + +func (e *bincEncDriver) EncodeStringBytes(c charEncoding, v []byte) { + if v == nil { + e.EncodeNil() + return + } l := uint64(len(v)) e.encBytesLen(c, l) if l > 0 { @@ -268,9 +345,21 @@ func (e *bincEncDriver) encodeStringBytes(c charEncoding, v []byte) { } } +func (e *bincEncDriver) EncodeStringBytesRaw(v []byte) { + if v == nil { + e.EncodeNil() + return + } + l := uint64(len(v)) + e.encLen(bincVdByteArray<<4, l) // e.encBytesLen(c, l) + if l > 0 { + e.w.writeb(v) + } +} + func (e *bincEncDriver) encBytesLen(c charEncoding, length uint64) { //TODO: support bincUnicodeOther (for now, just use string or bytearray) - if c == c_RAW { + if c == cRAW { e.encLen(bincVdByteArray<<4, length) } else { e.encLen(bincVdString<<4, length) @@ -286,93 +375,90 @@ func (e *bincEncDriver) encLen(bd byte, l uint64) { } func (e *bincEncDriver) encLenNumber(bd byte, v uint64) { - switch { - case v <= math.MaxUint8: + if v <= math.MaxUint8 { e.w.writen2(bd, byte(v)) - case v <= math.MaxUint16: + } else if v <= math.MaxUint16 { e.w.writen1(bd | 0x01) - e.w.writeUint16(uint16(v)) - case v <= math.MaxUint32: + bigenHelper{e.b[:2], e.w}.writeUint16(uint16(v)) + } else if v <= math.MaxUint32 { e.w.writen1(bd | 0x02) - e.w.writeUint32(uint32(v)) - default: + bigenHelper{e.b[:4], e.w}.writeUint32(uint32(v)) + } else { e.w.writen1(bd | 0x03) - e.w.writeUint64(uint64(v)) + bigenHelper{e.b[:8], e.w}.writeUint64(uint64(v)) } } //------------------------------------ +type bincDecSymbol struct { + s string + b []byte + i uint16 +} + type bincDecDriver struct { - r decReader + decDriverNoopContainerReader + noBuiltInTypes + + d *Decoder + h *BincHandle + r *decReaderSwitch + br bool // bytes reader bdRead bool - bdType valueType bd byte vd byte vs byte - b [8]byte - m map[uint32]string // symbols (use uint32 as key, as map optimizes for it) + _ [3]byte // padding + // linear searching on this slice is ok, + // because we typically expect < 32 symbols in each stream. + s []bincDecSymbol + + // noStreamingCodec + // decNoSeparator + + b [(8 + 1) * 8]byte // scratch } -func (d *bincDecDriver) initReadNext() { - if d.bdRead { - return - } +func (d *bincDecDriver) readNextBd() { d.bd = d.r.readn1() d.vd = d.bd >> 4 d.vs = d.bd & 0x0f d.bdRead = true - d.bdType = valueTypeUnset -} - -func (d *bincDecDriver) currentEncodedType() valueType { - if d.bdType == valueTypeUnset { - switch d.vd { - case bincVdSpecial: - switch d.vs { - case bincSpNil: - d.bdType = valueTypeNil - case bincSpFalse, bincSpTrue: - d.bdType = valueTypeBool - case bincSpNan, bincSpNegInf, bincSpPosInf, bincSpZeroFloat: - d.bdType = valueTypeFloat - case bincSpZero: - d.bdType = valueTypeUint - case bincSpNegOne: - d.bdType = valueTypeInt - default: - decErr("currentEncodedType: Unrecognized special value 0x%x", d.vs) - } - case bincVdSmallInt: - d.bdType = valueTypeUint - case bincVdPosInt: - d.bdType = valueTypeUint - case bincVdNegInt: - d.bdType = valueTypeInt - case bincVdFloat: - d.bdType = valueTypeFloat - case bincVdString: - d.bdType = valueTypeString - case bincVdSymbol: - d.bdType = valueTypeSymbol - case bincVdByteArray: - d.bdType = valueTypeBytes - case bincVdTimestamp: - d.bdType = valueTypeTimestamp - case bincVdCustomExt: - d.bdType = valueTypeExt - case bincVdArray: - d.bdType = valueTypeArray - case bincVdMap: - d.bdType = valueTypeMap - default: - decErr("currentEncodedType: Unrecognized d.vd: 0x%x", d.vd) - } +} + +func (d *bincDecDriver) uncacheRead() { + if d.bdRead { + d.r.unreadn1() + d.bdRead = false } - return d.bdType } -func (d *bincDecDriver) tryDecodeAsNil() bool { +func (d *bincDecDriver) ContainerType() (vt valueType) { + if !d.bdRead { + d.readNextBd() + } + if d.vd == bincVdSpecial && d.vs == bincSpNil { + return valueTypeNil + } else if d.vd == bincVdByteArray { + return valueTypeBytes + } else if d.vd == bincVdString { + return valueTypeString + } else if d.vd == bincVdArray { + return valueTypeArray + } else if d.vd == bincVdMap { + return valueTypeMap + } + // else { + // d.d.errorf("isContainerType: unsupported parameter: %v", vt) + // } + return valueTypeUnset +} + +func (d *bincDecDriver) TryDecodeAsNil() bool { + if !d.bdRead { + d.readNextBd() + } if d.bd == bincVdSpecial<<4|bincSpNil { d.bdRead = false return true @@ -380,24 +466,24 @@ func (d *bincDecDriver) tryDecodeAsNil() bool { return false } -func (d *bincDecDriver) isBuiltinType(rt uintptr) bool { - return rt == timeTypId -} - -func (d *bincDecDriver) decodeBuiltin(rt uintptr, v interface{}) { - switch rt { - case timeTypId: - if d.vd != bincVdTimestamp { - decErr("Invalid d.vd. Expecting 0x%x. Received: 0x%x", bincVdTimestamp, d.vd) - } - tt, err := decodeTime(d.r.readn(int(d.vs))) - if err != nil { - panic(err) - } - var vt *time.Time = v.(*time.Time) - *vt = tt +func (d *bincDecDriver) DecodeTime() (t time.Time) { + if !d.bdRead { + d.readNextBd() + } + if d.bd == bincVdSpecial<<4|bincSpNil { d.bdRead = false + return } + if d.vd != bincVdTimestamp { + d.d.errorf("cannot decode time - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs)) + return + } + t, err := bincDecodeTime(d.r.readx(uint(d.vs))) + if err != nil { + panic(err) + } + d.bdRead = false + return } func (d *bincDecDriver) decFloatPre(vs, defaultLen byte) { @@ -406,7 +492,8 @@ func (d *bincDecDriver) decFloatPre(vs, defaultLen byte) { } else { l := d.r.readn1() if l > 8 { - decErr("At most 8 bytes used to represent float. Received: %v bytes", l) + d.d.errorf("cannot read float - at most 8 bytes used to represent float - received %v bytes", l) + return } for i := l; i < 8; i++ { d.b[i] = 0 @@ -416,16 +503,17 @@ func (d *bincDecDriver) decFloatPre(vs, defaultLen byte) { } func (d *bincDecDriver) decFloat() (f float64) { - //if true { f = math.Float64frombits(d.r.readUint64()); break; } - switch vs := d.vs; vs & 0x7 { - case bincFlBin32: - d.decFloatPre(vs, 4) + //if true { f = math.Float64frombits(bigen.Uint64(d.r.readx(8))); break; } + if x := d.vs & 0x7; x == bincFlBin32 { + d.decFloatPre(d.vs, 4) f = float64(math.Float32frombits(bigen.Uint32(d.b[0:4]))) - case bincFlBin64: - d.decFloatPre(vs, 8) + } else if x == bincFlBin64 { + d.decFloatPre(d.vs, 8) f = math.Float64frombits(bigen.Uint64(d.b[0:8])) - default: - decErr("only float32 and float64 are supported. d.vd: 0x%x, d.vs: 0x%x", d.vd, d.vs) + } else { + d.d.errorf("read float - only float32 and float64 are supported - %s %x-%x/%s", + msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs)) + return } return } @@ -436,130 +524,148 @@ func (d *bincDecDriver) decUint() (v uint64) { case 0: v = uint64(d.r.readn1()) case 1: - d.r.readb(d.b[6:]) - v = uint64(bigen.Uint16(d.b[6:])) + d.r.readb(d.b[6:8]) + v = uint64(bigen.Uint16(d.b[6:8])) case 2: d.b[4] = 0 - d.r.readb(d.b[5:]) - v = uint64(bigen.Uint32(d.b[4:])) + d.r.readb(d.b[5:8]) + v = uint64(bigen.Uint32(d.b[4:8])) case 3: - d.r.readb(d.b[4:]) - v = uint64(bigen.Uint32(d.b[4:])) + d.r.readb(d.b[4:8]) + v = uint64(bigen.Uint32(d.b[4:8])) case 4, 5, 6: - lim := int(7 - d.vs) - d.r.readb(d.b[lim:]) - for i := 0; i < lim; i++ { + lim := 7 - d.vs + d.r.readb(d.b[lim:8]) + for i := uint8(0); i < lim; i++ { d.b[i] = 0 } - v = uint64(bigen.Uint64(d.b[:])) + v = uint64(bigen.Uint64(d.b[:8])) case 7: - d.r.readb(d.b[:]) - v = uint64(bigen.Uint64(d.b[:])) + d.r.readb(d.b[:8]) + v = uint64(bigen.Uint64(d.b[:8])) default: - decErr("unsigned integers with greater than 64 bits of precision not supported") + d.d.errorf("unsigned integers with greater than 64 bits of precision not supported") + return } return } -func (d *bincDecDriver) decIntAny() (ui uint64, i int64, neg bool) { - switch d.vd { - case bincVdPosInt: +func (d *bincDecDriver) decCheckInteger() (ui uint64, neg bool) { + if !d.bdRead { + d.readNextBd() + } + vd, vs := d.vd, d.vs + if vd == bincVdPosInt { ui = d.decUint() - i = int64(ui) - case bincVdNegInt: + } else if vd == bincVdNegInt { ui = d.decUint() - i = -(int64(ui)) neg = true - case bincVdSmallInt: - i = int64(d.vs) + 1 + } else if vd == bincVdSmallInt { ui = uint64(d.vs) + 1 - case bincVdSpecial: - switch d.vs { - case bincSpZero: + } else if vd == bincVdSpecial { + if vs == bincSpZero { //i = 0 - case bincSpNegOne: + } else if vs == bincSpNegOne { neg = true ui = 1 - i = -1 - default: - decErr("numeric decode fails for special value: d.vs: 0x%x", d.vs) + } else { + d.d.errorf("integer decode fails - invalid special value from descriptor %x-%x/%s", + d.vd, d.vs, bincdesc(d.vd, d.vs)) + return } - default: - decErr("number can only be decoded from uint or int values. d.bd: 0x%x, d.vd: 0x%x", d.bd, d.vd) + } else { + d.d.errorf("integer can only be decoded from int/uint. d.bd: 0x%x, d.vd: 0x%x", d.bd, d.vd) + return } return } -func (d *bincDecDriver) decodeInt(bitsize uint8) (i int64) { - _, i, _ = d.decIntAny() - checkOverflow(0, i, bitsize) +func (d *bincDecDriver) DecodeInt64() (i int64) { + ui, neg := d.decCheckInteger() + i = chkOvf.SignedIntV(ui) + if neg { + i = -i + } d.bdRead = false return } -func (d *bincDecDriver) decodeUint(bitsize uint8) (ui uint64) { - ui, i, neg := d.decIntAny() +func (d *bincDecDriver) DecodeUint64() (ui uint64) { + ui, neg := d.decCheckInteger() if neg { - decErr("Assigning negative signed value: %v, to unsigned type", i) + d.d.errorf("assigning negative signed value to unsigned integer type") + return } - checkOverflow(ui, 0, bitsize) d.bdRead = false return } -func (d *bincDecDriver) decodeFloat(chkOverflow32 bool) (f float64) { - switch d.vd { - case bincVdSpecial: +func (d *bincDecDriver) DecodeFloat64() (f float64) { + if !d.bdRead { + d.readNextBd() + } + vd, vs := d.vd, d.vs + if vd == bincVdSpecial { d.bdRead = false - switch d.vs { - case bincSpNan: + if vs == bincSpNan { return math.NaN() - case bincSpPosInf: + } else if vs == bincSpPosInf { return math.Inf(1) - case bincSpZeroFloat, bincSpZero: + } else if vs == bincSpZeroFloat || vs == bincSpZero { return - case bincSpNegInf: + } else if vs == bincSpNegInf { return math.Inf(-1) - default: - decErr("Invalid d.vs decoding float where d.vd=bincVdSpecial: %v", d.vs) + } else { + d.d.errorf("float - invalid special value from descriptor %x-%x/%s", + d.vd, d.vs, bincdesc(d.vd, d.vs)) + return } - case bincVdFloat: + } else if vd == bincVdFloat { f = d.decFloat() - default: - _, i, _ := d.decIntAny() - f = float64(i) + } else { + f = float64(d.DecodeInt64()) } - checkOverflowFloat32(f, chkOverflow32) d.bdRead = false return } // bool can be decoded from bool only (single byte). -func (d *bincDecDriver) decodeBool() (b bool) { - switch d.bd { - case (bincVdSpecial | bincSpFalse): +func (d *bincDecDriver) DecodeBool() (b bool) { + if !d.bdRead { + d.readNextBd() + } + if bd := d.bd; bd == (bincVdSpecial | bincSpFalse) { // b = false - case (bincVdSpecial | bincSpTrue): + } else if bd == (bincVdSpecial | bincSpTrue) { b = true - default: - decErr("Invalid single-byte value for bool: %s: %x", msgBadDesc, d.bd) + } else { + d.d.errorf("bool - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs)) + return } d.bdRead = false return } -func (d *bincDecDriver) readMapLen() (length int) { +func (d *bincDecDriver) ReadMapStart() (length int) { + if !d.bdRead { + d.readNextBd() + } if d.vd != bincVdMap { - decErr("Invalid d.vd for map. Expecting 0x%x. Got: 0x%x", bincVdMap, d.vd) + d.d.errorf("map - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs)) + return } length = d.decLen() d.bdRead = false return } -func (d *bincDecDriver) readArrayLen() (length int) { +func (d *bincDecDriver) ReadArrayStart() (length int) { + if !d.bdRead { + d.readNextBd() + } if d.vd != bincVdArray { - decErr("Invalid d.vd for array. Expecting 0x%x. Got: 0x%x", bincVdArray, d.vd) + d.d.errorf("array - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs)) + return } length = d.decLen() d.bdRead = false @@ -567,189 +673,299 @@ func (d *bincDecDriver) readArrayLen() (length int) { } func (d *bincDecDriver) decLen() int { - if d.vs <= 3 { - return int(d.decUint()) + if d.vs > 3 { + return int(d.vs - 4) } - return int(d.vs - 4) + return int(d.decLenNumber()) } -func (d *bincDecDriver) decodeString() (s string) { +func (d *bincDecDriver) decLenNumber() (v uint64) { + if x := d.vs; x == 0 { + v = uint64(d.r.readn1()) + } else if x == 1 { + d.r.readb(d.b[6:8]) + v = uint64(bigen.Uint16(d.b[6:8])) + } else if x == 2 { + d.r.readb(d.b[4:8]) + v = uint64(bigen.Uint32(d.b[4:8])) + } else { + d.r.readb(d.b[:8]) + v = bigen.Uint64(d.b[:8]) + } + return +} + +func (d *bincDecDriver) decStringAndBytes(bs []byte, withString, zerocopy bool) ( + bs2 []byte, s string) { + if !d.bdRead { + d.readNextBd() + } + if d.bd == bincVdSpecial<<4|bincSpNil { + d.bdRead = false + return + } + var slen = -1 + // var ok bool switch d.vd { case bincVdString, bincVdByteArray: - if length := d.decLen(); length > 0 { - s = string(d.r.readn(length)) + slen = d.decLen() + if zerocopy { + if d.br { + bs2 = d.r.readx(uint(slen)) + } else if len(bs) == 0 { + bs2 = decByteSlice(d.r, slen, d.d.h.MaxInitLen, d.b[:]) + } else { + bs2 = decByteSlice(d.r, slen, d.d.h.MaxInitLen, bs) + } + } else { + bs2 = decByteSlice(d.r, slen, d.d.h.MaxInitLen, bs) + } + if withString { + s = string(bs2) } case bincVdSymbol: + // zerocopy doesn't apply for symbols, + // as the values must be stored in a table for later use. + // //from vs: extract numSymbolBytes, containsStringVal, strLenPrecision, //extract symbol //if containsStringVal, read it and put in map //else look in map for string value - var symbol uint32 + var symbol uint16 vs := d.vs - //fmt.Printf(">>>> d.vs: 0b%b, & 0x8: %v, & 0x4: %v\n", d.vs, vs & 0x8, vs & 0x4) if vs&0x8 == 0 { - symbol = uint32(d.r.readn1()) + symbol = uint16(d.r.readn1()) } else { - symbol = uint32(d.r.readUint16()) + symbol = uint16(bigen.Uint16(d.r.readx(2))) } - if d.m == nil { - d.m = make(map[uint32]string, 16) + if d.s == nil { + d.s = make([]bincDecSymbol, 0, 16) } if vs&0x4 == 0 { - s = d.m[symbol] + for i := range d.s { + j := &d.s[i] + if j.i == symbol { + bs2 = j.b + if withString { + if j.s == "" && bs2 != nil { + j.s = string(bs2) + } + s = j.s + } + break + } + } } else { - var slen int switch vs & 0x3 { case 0: slen = int(d.r.readn1()) case 1: - slen = int(d.r.readUint16()) + slen = int(bigen.Uint16(d.r.readx(2))) case 2: - slen = int(d.r.readUint32()) + slen = int(bigen.Uint32(d.r.readx(4))) case 3: - slen = int(d.r.readUint64()) + slen = int(bigen.Uint64(d.r.readx(8))) } - s = string(d.r.readn(slen)) - d.m[symbol] = s + // since using symbols, do not store any part of + // the parameter bs in the map, as it might be a shared buffer. + // bs2 = decByteSlice(d.r, slen, bs) + bs2 = decByteSlice(d.r, slen, d.d.h.MaxInitLen, nil) + if withString { + s = string(bs2) + } + d.s = append(d.s, bincDecSymbol{i: symbol, s: s, b: bs2}) } default: - decErr("Invalid d.vd for string. Expecting string:0x%x, bytearray:0x%x or symbol: 0x%x. Got: 0x%x", - bincVdString, bincVdByteArray, bincVdSymbol, d.vd) + d.d.errorf("string/bytes - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs)) + return } d.bdRead = false return } -func (d *bincDecDriver) decodeBytes(bs []byte) (bsOut []byte, changed bool) { +func (d *bincDecDriver) DecodeString() (s string) { + // DecodeBytes does not accommodate symbols, whose impl stores string version in map. + // Use decStringAndBytes directly. + // return string(d.DecodeBytes(d.b[:], true, true)) + _, s = d.decStringAndBytes(d.b[:], true, true) + return +} + +func (d *bincDecDriver) DecodeStringAsBytes() (s []byte) { + s, _ = d.decStringAndBytes(d.b[:], false, true) + return +} + +func (d *bincDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) { + if !d.bdRead { + d.readNextBd() + } + if d.bd == bincVdSpecial<<4|bincSpNil { + d.bdRead = false + return nil + } + // check if an "array" of uint8's (see ContainerType for how to infer if an array) + if d.vd == bincVdArray { + bsOut, _ = fastpathTV.DecSliceUint8V(bs, true, d.d) + return + } var clen int - switch d.vd { - case bincVdString, bincVdByteArray: + if d.vd == bincVdString || d.vd == bincVdByteArray { clen = d.decLen() - default: - decErr("Invalid d.vd for bytes. Expecting string:0x%x or bytearray:0x%x. Got: 0x%x", - bincVdString, bincVdByteArray, d.vd) - } - if clen > 0 { - // if no contents in stream, don't update the passed byteslice - if len(bs) != clen { - if len(bs) > clen { - bs = bs[:clen] - } else { - bs = make([]byte, clen) - } - bsOut = bs - changed = true - } - d.r.readb(bs) + } else { + d.d.errorf("bytes - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs)) + return } d.bdRead = false + if zerocopy { + if d.br { + return d.r.readx(uint(clen)) + } else if len(bs) == 0 { + bs = d.b[:] + } + } + return decByteSlice(d.r, clen, d.d.h.MaxInitLen, bs) +} + +func (d *bincDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) (realxtag uint64) { + if xtag > 0xff { + d.d.errorf("ext: tag must be <= 0xff; got: %v", xtag) + return + } + realxtag1, xbs := d.decodeExtV(ext != nil, uint8(xtag)) + realxtag = uint64(realxtag1) + if ext == nil { + re := rv.(*RawExt) + re.Tag = realxtag + re.Data = detachZeroCopyBytes(d.br, re.Data, xbs) + } else { + ext.ReadExt(rv, xbs) + } return } -func (d *bincDecDriver) decodeExt(verifyTag bool, tag byte) (xtag byte, xbs []byte) { - switch d.vd { - case bincVdCustomExt: +func (d *bincDecDriver) decodeExtV(verifyTag bool, tag byte) (xtag byte, xbs []byte) { + if !d.bdRead { + d.readNextBd() + } + if d.vd == bincVdCustomExt { l := d.decLen() xtag = d.r.readn1() if verifyTag && xtag != tag { - decErr("Wrong extension tag. Got %b. Expecting: %v", xtag, tag) + d.d.errorf("wrong extension tag - got %b, expecting: %v", xtag, tag) + return } - xbs = d.r.readn(l) - case bincVdByteArray: - xbs, _ = d.decodeBytes(nil) - default: - decErr("Invalid d.vd for extensions (Expecting extensions or byte array). Got: 0x%x", d.vd) + if d.br { + xbs = d.r.readx(uint(l)) + } else { + xbs = decByteSlice(d.r, l, d.d.h.MaxInitLen, d.d.b[:]) + } + } else if d.vd == bincVdByteArray { + xbs = d.DecodeBytes(nil, true) + } else { + d.d.errorf("ext - expecting extensions or byte array - %s %x-%x/%s", + msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs)) + return } d.bdRead = false return } -func (d *bincDecDriver) decodeNaked() (v interface{}, vt valueType, decodeFurther bool) { - d.initReadNext() +func (d *bincDecDriver) DecodeNaked() { + if !d.bdRead { + d.readNextBd() + } + + n := d.d.naked() + var decodeFurther bool switch d.vd { case bincVdSpecial: switch d.vs { case bincSpNil: - vt = valueTypeNil + n.v = valueTypeNil case bincSpFalse: - vt = valueTypeBool - v = false + n.v = valueTypeBool + n.b = false case bincSpTrue: - vt = valueTypeBool - v = true + n.v = valueTypeBool + n.b = true case bincSpNan: - vt = valueTypeFloat - v = math.NaN() + n.v = valueTypeFloat + n.f = math.NaN() case bincSpPosInf: - vt = valueTypeFloat - v = math.Inf(1) + n.v = valueTypeFloat + n.f = math.Inf(1) case bincSpNegInf: - vt = valueTypeFloat - v = math.Inf(-1) + n.v = valueTypeFloat + n.f = math.Inf(-1) case bincSpZeroFloat: - vt = valueTypeFloat - v = float64(0) + n.v = valueTypeFloat + n.f = float64(0) case bincSpZero: - vt = valueTypeUint - v = int64(0) // int8(0) + n.v = valueTypeUint + n.u = uint64(0) // int8(0) case bincSpNegOne: - vt = valueTypeInt - v = int64(-1) // int8(-1) + n.v = valueTypeInt + n.i = int64(-1) // int8(-1) default: - decErr("decodeNaked: Unrecognized special value 0x%x", d.vs) + d.d.errorf("cannot infer value - unrecognized special value from descriptor %x-%x/%s", + d.vd, d.vs, bincdesc(d.vd, d.vs)) } case bincVdSmallInt: - vt = valueTypeUint - v = uint64(int8(d.vs)) + 1 // int8(d.vs) + 1 + n.v = valueTypeUint + n.u = uint64(int8(d.vs)) + 1 // int8(d.vs) + 1 case bincVdPosInt: - vt = valueTypeUint - v = d.decUint() + n.v = valueTypeUint + n.u = d.decUint() case bincVdNegInt: - vt = valueTypeInt - v = -(int64(d.decUint())) + n.v = valueTypeInt + n.i = -(int64(d.decUint())) case bincVdFloat: - vt = valueTypeFloat - v = d.decFloat() + n.v = valueTypeFloat + n.f = d.decFloat() case bincVdSymbol: - vt = valueTypeSymbol - v = d.decodeString() + n.v = valueTypeSymbol + n.s = d.DecodeString() case bincVdString: - vt = valueTypeString - v = d.decodeString() + n.v = valueTypeString + n.s = d.DecodeString() case bincVdByteArray: - vt = valueTypeBytes - v, _ = d.decodeBytes(nil) + decNakedReadRawBytes(d, d.d, n, d.h.RawToString) case bincVdTimestamp: - vt = valueTypeTimestamp - tt, err := decodeTime(d.r.readn(int(d.vs))) + n.v = valueTypeTime + tt, err := bincDecodeTime(d.r.readx(uint(d.vs))) if err != nil { panic(err) } - v = tt + n.t = tt case bincVdCustomExt: - vt = valueTypeExt + n.v = valueTypeExt l := d.decLen() - var re RawExt - re.Tag = d.r.readn1() - re.Data = d.r.readn(l) - v = &re - vt = valueTypeExt + n.u = uint64(d.r.readn1()) + if d.br { + n.l = d.r.readx(uint(l)) + } else { + n.l = decByteSlice(d.r, l, d.d.h.MaxInitLen, d.d.b[:]) + } case bincVdArray: - vt = valueTypeArray + n.v = valueTypeArray decodeFurther = true case bincVdMap: - vt = valueTypeMap + n.v = valueTypeMap decodeFurther = true default: - decErr("decodeNaked: Unrecognized d.vd: 0x%x", d.vd) + d.d.errorf("cannot infer value - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs)) } if !decodeFurther { d.bdRead = false } - return + if n.v == valueTypeUint && d.h.SignedInteger { + n.v = valueTypeInt + n.i = int64(n.u) + } } //------------------------------------ @@ -764,23 +980,224 @@ func (d *bincDecDriver) decodeNaked() (v interface{}, vt valueType, decodeFurthe // extended precision and decimal IEEE 754 floats are unsupported. // - Only UTF-8 strings supported. // Unicode_Other Binc types (UTF16, UTF32) are currently unsupported. +// //Note that these EXCEPTIONS are temporary and full support is possible and may happen soon. type BincHandle struct { BasicHandle + binaryEncodingType + noElemSeparators + + // AsSymbols defines what should be encoded as symbols. + // + // Encoding as symbols can reduce the encoded size significantly. + // + // However, during decoding, each string to be encoded as a symbol must + // be checked to see if it has been seen before. Consequently, encoding time + // will increase if using symbols, because string comparisons has a clear cost. + // + // Values: + // - 0: default: library uses best judgement + // - 1: use symbols + // - 2: do not use symbols + AsSymbols uint8 + + // AsSymbols: may later on introduce more options ... + // - m: map keys + // - s: struct fields + // - n: none + // - a: all: same as m, s, ... + + // _ [1]uint64 // padding +} + +// Name returns the name of the handle: binc +func (h *BincHandle) Name() string { return "binc" } + +// SetBytesExt sets an extension +func (h *BincHandle) SetBytesExt(rt reflect.Type, tag uint64, ext BytesExt) (err error) { + return h.SetExt(rt, tag, &extWrapper{ext, interfaceExtFailer{}}) +} + +func (h *BincHandle) newEncDriver(e *Encoder) encDriver { + return &bincEncDriver{e: e, h: h, w: e.w} +} + +func (h *BincHandle) newDecDriver(d *Decoder) decDriver { + return &bincDecDriver{d: d, h: h, r: d.r, br: d.bytes} } -func (h *BincHandle) newEncDriver(w encWriter) encDriver { - return &bincEncDriver{w: w} +func (e *bincEncDriver) reset() { + e.w = e.e.w + e.s = 0 + e.c = 0 + e.m = nil } -func (h *BincHandle) newDecDriver(r decReader) decDriver { - return &bincDecDriver{r: r} +func (d *bincDecDriver) reset() { + d.r, d.br = d.d.r, d.d.bytes + d.s = nil + d.bd, d.bdRead, d.vd, d.vs = 0, false, 0, 0 } -func (_ *BincHandle) writeExt() bool { - return true +// var timeDigits = [...]byte{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} + +// EncodeTime encodes a time.Time as a []byte, including +// information on the instant in time and UTC offset. +// +// Format Description +// +// A timestamp is composed of 3 components: +// +// - secs: signed integer representing seconds since unix epoch +// - nsces: unsigned integer representing fractional seconds as a +// nanosecond offset within secs, in the range 0 <= nsecs < 1e9 +// - tz: signed integer representing timezone offset in minutes east of UTC, +// and a dst (daylight savings time) flag +// +// When encoding a timestamp, the first byte is the descriptor, which +// defines which components are encoded and how many bytes are used to +// encode secs and nsecs components. *If secs/nsecs is 0 or tz is UTC, it +// is not encoded in the byte array explicitly*. +// +// Descriptor 8 bits are of the form `A B C DDD EE`: +// A: Is secs component encoded? 1 = true +// B: Is nsecs component encoded? 1 = true +// C: Is tz component encoded? 1 = true +// DDD: Number of extra bytes for secs (range 0-7). +// If A = 1, secs encoded in DDD+1 bytes. +// If A = 0, secs is not encoded, and is assumed to be 0. +// If A = 1, then we need at least 1 byte to encode secs. +// DDD says the number of extra bytes beyond that 1. +// E.g. if DDD=0, then secs is represented in 1 byte. +// if DDD=2, then secs is represented in 3 bytes. +// EE: Number of extra bytes for nsecs (range 0-3). +// If B = 1, nsecs encoded in EE+1 bytes (similar to secs/DDD above) +// +// Following the descriptor bytes, subsequent bytes are: +// +// secs component encoded in `DDD + 1` bytes (if A == 1) +// nsecs component encoded in `EE + 1` bytes (if B == 1) +// tz component encoded in 2 bytes (if C == 1) +// +// secs and nsecs components are integers encoded in a BigEndian +// 2-complement encoding format. +// +// tz component is encoded as 2 bytes (16 bits). Most significant bit 15 to +// Least significant bit 0 are described below: +// +// Timezone offset has a range of -12:00 to +14:00 (ie -720 to +840 minutes). +// Bit 15 = have\_dst: set to 1 if we set the dst flag. +// Bit 14 = dst\_on: set to 1 if dst is in effect at the time, or 0 if not. +// Bits 13..0 = timezone offset in minutes. It is a signed integer in Big Endian format. +// +func bincEncodeTime(t time.Time) []byte { + //t := rv.Interface().(time.Time) + tsecs, tnsecs := t.Unix(), t.Nanosecond() + var ( + bd byte + btmp [8]byte + bs [16]byte + i int = 1 + ) + l := t.Location() + if l == time.UTC { + l = nil + } + if tsecs != 0 { + bd = bd | 0x80 + bigen.PutUint64(btmp[:], uint64(tsecs)) + f := pruneSignExt(btmp[:], tsecs >= 0) + bd = bd | (byte(7-f) << 2) + copy(bs[i:], btmp[f:]) + i = i + (8 - f) + } + if tnsecs != 0 { + bd = bd | 0x40 + bigen.PutUint32(btmp[:4], uint32(tnsecs)) + f := pruneSignExt(btmp[:4], true) + bd = bd | byte(3-f) + copy(bs[i:], btmp[f:4]) + i = i + (4 - f) + } + if l != nil { + bd = bd | 0x20 + // Note that Go Libs do not give access to dst flag. + _, zoneOffset := t.Zone() + //zoneName, zoneOffset := t.Zone() + zoneOffset /= 60 + z := uint16(zoneOffset) + bigen.PutUint16(btmp[:2], z) + // clear dst flags + bs[i] = btmp[0] & 0x3f + bs[i+1] = btmp[1] + i = i + 2 + } + bs[0] = bd + return bs[0:i] } -func (h *BincHandle) getBasicHandle() *BasicHandle { - return &h.BasicHandle +// bincDecodeTime decodes a []byte into a time.Time. +func bincDecodeTime(bs []byte) (tt time.Time, err error) { + bd := bs[0] + var ( + tsec int64 + tnsec uint32 + tz uint16 + i byte = 1 + i2 byte + n byte + ) + if bd&(1<<7) != 0 { + var btmp [8]byte + n = ((bd >> 2) & 0x7) + 1 + i2 = i + n + copy(btmp[8-n:], bs[i:i2]) + //if first bit of bs[i] is set, then fill btmp[0..8-n] with 0xff (ie sign extend it) + if bs[i]&(1<<7) != 0 { + copy(btmp[0:8-n], bsAll0xff) + //for j,k := byte(0), 8-n; j < k; j++ { btmp[j] = 0xff } + } + i = i2 + tsec = int64(bigen.Uint64(btmp[:])) + } + if bd&(1<<6) != 0 { + var btmp [4]byte + n = (bd & 0x3) + 1 + i2 = i + n + copy(btmp[4-n:], bs[i:i2]) + i = i2 + tnsec = bigen.Uint32(btmp[:]) + } + if bd&(1<<5) == 0 { + tt = time.Unix(tsec, int64(tnsec)).UTC() + return + } + // In stdlib time.Parse, when a date is parsed without a zone name, it uses "" as zone name. + // However, we need name here, so it can be shown when time is printed. + // Zone name is in form: UTC-08:00. + // Note that Go Libs do not give access to dst flag, so we ignore dst bits + + i2 = i + 2 + tz = bigen.Uint16(bs[i:i2]) + // i = i2 + // sign extend sign bit into top 2 MSB (which were dst bits): + if tz&(1<<13) == 0 { // positive + tz = tz & 0x3fff //clear 2 MSBs: dst bits + } else { // negative + tz = tz | 0xc000 //set 2 MSBs: dst bits + } + tzint := int16(tz) + if tzint == 0 { + tt = time.Unix(tsec, int64(tnsec)).UTC() + } else { + // For Go Time, do not use a descriptive timezone. + // It's unnecessary, and makes it harder to do a reflect.DeepEqual. + // The Offset already tells what the offset should be, if not on UTC and unknown zone name. + // var zoneName = timeLocUTCName(tzint) + tt = time.Unix(tsec, int64(tnsec)).In(time.FixedZone("", int(tzint)*60)) + } + return } + +var _ decDriver = (*bincDecDriver)(nil) +var _ encDriver = (*bincEncDriver)(nil) diff --git a/vendor/github.com/ugorji/go/codec/build.sh b/vendor/github.com/ugorji/go/codec/build.sh new file mode 100755 index 000000000..c08530783 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/build.sh @@ -0,0 +1,264 @@ +#!/bin/bash + +# Run all the different permutations of all the tests and other things +# This helps ensure that nothing gets broken. + +_tests() { + local gover=$( go version | cut -f 3 -d ' ' ) + # note that codecgen requires fastpath, so you cannot do "codecgen notfastpath" + local a=( "" "safe" "notfastpath" "notfastpath safe" "codecgen" "codecgen safe" ) + for i in "${a[@]}" + do + echo ">>>> TAGS: $i" + local i2=${i:-default} + case $gover in + go1.[0-6]*) go vet -printfuncs "errorf" "$@" && + go test ${zargs[*]} -vet off -tags "$i" "$@" ;; + *) go vet -printfuncs "errorf" "$@" && + go test ${zargs[*]} -vet off -tags "alltests $i" -run "Suite" -coverprofile "${i2// /-}.cov.out" "$@" ;; + esac + if [[ "$?" != 0 ]]; then return 1; fi + done + echo "++++++++ TEST SUITES ALL PASSED ++++++++" +} + + +# is a generation needed? +_ng() { + local a="$1" + if [[ ! -e "$a" ]]; then echo 1; return; fi + for i in `ls -1 *.go.tmpl gen.go values_test.go` + do + if [[ "$a" -ot "$i" ]]; then echo 1; return; fi + done +} + +_prependbt() { + cat > ${2} <> ${2} + rm -f ${1} +} + +# _build generates fast-path.go and gen-helper.go. +_build() { + if ! [[ "${zforce}" || $(_ng "fast-path.generated.go") || $(_ng "gen-helper.generated.go") || $(_ng "gen.generated.go") ]]; then return 0; fi + + if [ "${zbak}" ]; then + _zts=`date '+%m%d%Y_%H%M%S'` + _gg=".generated.go" + [ -e "gen-helper${_gg}" ] && mv gen-helper${_gg} gen-helper${_gg}__${_zts}.bak + [ -e "fast-path${_gg}" ] && mv fast-path${_gg} fast-path${_gg}__${_zts}.bak + [ -e "gen${_gg}" ] && mv gen${_gg} gen${_gg}__${_zts}.bak + fi + rm -f gen-helper.generated.go fast-path.generated.go gen.generated.go \ + *safe.generated.go *_generated_test.go *.generated_ffjson_expose.go + + cat > gen.generated.go <> gen.generated.go < gen-dec-map.go.tmpl + cat >> gen.generated.go <> gen.generated.go < gen-dec-array.go.tmpl + cat >> gen.generated.go <> gen.generated.go < gen-enc-chan.go.tmpl + cat >> gen.generated.go < gen-from-tmpl.codec.generated.go < gen-from-tmpl.generated.go < " + fnameOut + " ______") +fin, err := os.Open(fnameIn) +if err != nil { panic(err) } +defer fin.Close() +fout, err := os.Create(fnameOut) +if err != nil { panic(err) } +defer fout.Close() +err = codec.GenInternalGoFile(fin, fout) +if err != nil { panic(err) } +} + +func main() { +run("fast-path.go.tmpl", "fast-path.generated.go") +run("gen-helper.go.tmpl", "gen-helper.generated.go") +run("mammoth-test.go.tmpl", "mammoth_generated_test.go") +run("mammoth2-test.go.tmpl", "mammoth2_generated_test.go") +} +EOF + + # explicitly return 0 if this passes, else return 1 + go run -tags "notfastpath safe codecgen.exec" gen-from-tmpl.generated.go && + rm -f gen-from-tmpl.*generated.go && + return 0 + return 1 +} + +_codegenerators() { + if ! [[ $zforce || $(_ng "values_codecgen${zsfx}") ]]; then return 0; fi + + # Note: ensure you run the codecgen for this codebase/directory i.e. ./codecgen/codecgen + local c9="codecgen-scratch.go" + local c7="$zmydir/codecgen" + true && + echo "codecgen ... " && + if [[ $zforce || ! -f "$c7/codecgen" || "$c7/gen.go" -nt "$c7/codecgen" ]]; then + echo "rebuilding codecgen ... " && ( cd codecgen && go build -o codecgen ${zargs[*]} . ) + fi && + $c7/codecgen -rt codecgen -t 'codecgen generated' -o values_codecgen${zsfx} -d 19780 $zfin $zfin2 && + cp mammoth2_generated_test.go $c9 && + $c7/codecgen -t '!notfastpath' -o mammoth2_codecgen${zsfx} -d 19781 mammoth2_generated_test.go && + rm -f $c9 && + echo "generators done!" +} + +_prebuild() { + echo "prebuild: zforce: $zforce , zexternal: $zexternal" + zmydir=`pwd` + zfin="test_values.generated.go" + zfin2="test_values_flex.generated.go" + zsfx="_generated_test.go" + # zpkg="ugorji.net/codec" + zpkg=${zmydir##*/src/} + zgobase=${zmydir%%/src/*} + # rm -f *_generated_test.go + rm -f codecgen-*.go && + _build && + cp $zmydir/values_test.go $zmydir/$zfin && + cp $zmydir/values_flex_test.go $zmydir/$zfin2 && + _codegenerators && + if [[ "$(type -t _codegenerators_external )" = "function" ]]; then _codegenerators_external ; fi && + if [[ $zforce ]]; then go install ${zargs[*]} .; fi && + echo "prebuild done successfully" + rm -f $zmydir/$zfin $zmydir/$zfin2 +} + +_make() { + zforce=1 + zexternal=1 + (cd codecgen && go install ${zargs[*]} .) && _prebuild && go install ${zargs[*]} . + unset zforce zexternal +} + +_clean() { + rm -f gen-from-tmpl.*generated.go \ + codecgen-*.go \ + test_values.generated.go test_values_flex.generated.go +} + +_release() { + local reply + read -p "Pre-release validation takes a few minutes and MUST be run from within GOPATH/src. Confirm y/n? " -n 1 -r reply + echo + if [[ ! $reply =~ ^[Yy]$ ]]; then return 1; fi + + # expects GOROOT, GOROOT_BOOTSTRAP to have been set. + if [[ -z "${GOROOT// }" || -z "${GOROOT_BOOTSTRAP// }" ]]; then return 1; fi + # (cd $GOROOT && git checkout -f master && git pull && git reset --hard) + (cd $GOROOT && git pull) + local f=`pwd`/make.release.out + cat > $f <>$f + if [[ "$i" != "master" ]]; then i="release-branch.go$i"; fi + (false || + (echo "===== BUILDING GO SDK for branch: $i ... =====" && + cd $GOROOT && + git checkout -f $i && git reset --hard && git clean -f . && + cd src && ./make.bash >>$f 2>&1 && sleep 1 ) ) && + echo "===== GO SDK BUILD DONE =====" && + _prebuild && + echo "===== PREBUILD DONE with exit: $? =====" && + _tests "$@" + if [[ "$?" != 0 ]]; then return 1; fi + done + unset zforce + echo "++++++++ RELEASE TEST SUITES ALL PASSED ++++++++" +} + +_usage() { + cat < [tests, make, prebuild (force) (external), inlining diagnostics, mid-stack inlining, race detector] + -v -> verbose +EOF + if [[ "$(type -t _usage_run)" = "function" ]]; then _usage_run ; fi +} + +_main() { + if [[ -z "$1" ]]; then _usage; return 1; fi + local x + unset zforce zexternal + zargs=() + zbenchflags="" + OPTIND=1 + while getopts ":ctmnrgupfvxlzdb:" flag + do + case "x$flag" in + 'xf') zforce=1 ;; + 'xx') zexternal=1 ;; + 'xv') zverbose=1 ;; + 'xl') zargs+=("-gcflags"); zargs+=("-l=4") ;; + 'xn') zargs+=("-gcflags"); zargs+=("-m=2") ;; + 'xd') zargs+=("-race") ;; + 'xb') x='b'; zbenchflags=${OPTARG} ;; + x\?) _usage; return 1 ;; + *) x=$flag ;; + esac + done + shift $((OPTIND-1)) + # echo ">>>> _main: extra args: $@" + case "x$x" in + 'xt') _tests "$@" ;; + 'xm') _make "$@" ;; + 'xr') _release "$@" ;; + 'xg') _go ;; + 'xu') _githubupdate ;; + 'xp') _prebuild "$@" ;; + 'xc') _clean "$@" ;; + 'xz') _analyze "$@" ;; + 'xb') _bench "$@" ;; + esac + unset zforce zexternal +} + +[ "." = `dirname $0` ] && _main "$@" + diff --git a/vendor/github.com/ugorji/go/codec/cbor.go b/vendor/github.com/ugorji/go/codec/cbor.go new file mode 100644 index 000000000..7833f9d68 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/cbor.go @@ -0,0 +1,767 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +package codec + +import ( + "math" + "reflect" + "time" +) + +const ( + cborMajorUint byte = iota + cborMajorNegInt + cborMajorBytes + cborMajorText + cborMajorArray + cborMajorMap + cborMajorTag + cborMajorOther +) + +const ( + cborBdFalse byte = 0xf4 + iota + cborBdTrue + cborBdNil + cborBdUndefined + cborBdExt + cborBdFloat16 + cborBdFloat32 + cborBdFloat64 +) + +const ( + cborBdIndefiniteBytes byte = 0x5f + cborBdIndefiniteString byte = 0x7f + cborBdIndefiniteArray byte = 0x9f + cborBdIndefiniteMap byte = 0xbf + cborBdBreak byte = 0xff +) + +// These define some in-stream descriptors for +// manual encoding e.g. when doing explicit indefinite-length +const ( + CborStreamBytes byte = 0x5f + CborStreamString byte = 0x7f + CborStreamArray byte = 0x9f + CborStreamMap byte = 0xbf + CborStreamBreak byte = 0xff +) + +const ( + cborBaseUint byte = 0x00 + cborBaseNegInt byte = 0x20 + cborBaseBytes byte = 0x40 + cborBaseString byte = 0x60 + cborBaseArray byte = 0x80 + cborBaseMap byte = 0xa0 + cborBaseTag byte = 0xc0 + cborBaseSimple byte = 0xe0 +) + +func cbordesc(bd byte) string { + switch bd { + case cborBdNil: + return "nil" + case cborBdFalse: + return "false" + case cborBdTrue: + return "true" + case cborBdFloat16, cborBdFloat32, cborBdFloat64: + return "float" + case cborBdIndefiniteBytes: + return "bytes*" + case cborBdIndefiniteString: + return "string*" + case cborBdIndefiniteArray: + return "array*" + case cborBdIndefiniteMap: + return "map*" + default: + switch { + case bd >= cborBaseUint && bd < cborBaseNegInt: + return "(u)int" + case bd >= cborBaseNegInt && bd < cborBaseBytes: + return "int" + case bd >= cborBaseBytes && bd < cborBaseString: + return "bytes" + case bd >= cborBaseString && bd < cborBaseArray: + return "string" + case bd >= cborBaseArray && bd < cborBaseMap: + return "array" + case bd >= cborBaseMap && bd < cborBaseTag: + return "map" + case bd >= cborBaseTag && bd < cborBaseSimple: + return "ext" + default: + return "unknown" + } + } +} + +// ------------------- + +type cborEncDriver struct { + noBuiltInTypes + encDriverNoopContainerWriter + e *Encoder + w *encWriterSwitch + h *CborHandle + x [8]byte + // _ [3]uint64 // padding +} + +func (e *cborEncDriver) EncodeNil() { + e.w.writen1(cborBdNil) +} + +func (e *cborEncDriver) EncodeBool(b bool) { + if b { + e.w.writen1(cborBdTrue) + } else { + e.w.writen1(cborBdFalse) + } +} + +func (e *cborEncDriver) EncodeFloat32(f float32) { + e.w.writen1(cborBdFloat32) + bigenHelper{e.x[:4], e.w}.writeUint32(math.Float32bits(f)) +} + +func (e *cborEncDriver) EncodeFloat64(f float64) { + e.w.writen1(cborBdFloat64) + bigenHelper{e.x[:8], e.w}.writeUint64(math.Float64bits(f)) +} + +func (e *cborEncDriver) encUint(v uint64, bd byte) { + if v <= 0x17 { + e.w.writen1(byte(v) + bd) + } else if v <= math.MaxUint8 { + e.w.writen2(bd+0x18, uint8(v)) + } else if v <= math.MaxUint16 { + e.w.writen1(bd + 0x19) + bigenHelper{e.x[:2], e.w}.writeUint16(uint16(v)) + } else if v <= math.MaxUint32 { + e.w.writen1(bd + 0x1a) + bigenHelper{e.x[:4], e.w}.writeUint32(uint32(v)) + } else { // if v <= math.MaxUint64 { + e.w.writen1(bd + 0x1b) + bigenHelper{e.x[:8], e.w}.writeUint64(v) + } +} + +func (e *cborEncDriver) EncodeInt(v int64) { + if v < 0 { + e.encUint(uint64(-1-v), cborBaseNegInt) + } else { + e.encUint(uint64(v), cborBaseUint) + } +} + +func (e *cborEncDriver) EncodeUint(v uint64) { + e.encUint(v, cborBaseUint) +} + +func (e *cborEncDriver) encLen(bd byte, length int) { + e.encUint(uint64(length), bd) +} + +func (e *cborEncDriver) EncodeTime(t time.Time) { + if t.IsZero() { + e.EncodeNil() + } else if e.h.TimeRFC3339 { + e.encUint(0, cborBaseTag) + e.EncodeStringEnc(cUTF8, t.Format(time.RFC3339Nano)) + } else { + e.encUint(1, cborBaseTag) + t = t.UTC().Round(time.Microsecond) + sec, nsec := t.Unix(), uint64(t.Nanosecond()) + if nsec == 0 { + e.EncodeInt(sec) + } else { + e.EncodeFloat64(float64(sec) + float64(nsec)/1e9) + } + } +} + +func (e *cborEncDriver) EncodeExt(rv interface{}, xtag uint64, ext Ext, en *Encoder) { + e.encUint(uint64(xtag), cborBaseTag) + if v := ext.ConvertExt(rv); v == nil { + e.EncodeNil() + } else { + en.encode(v) + } +} + +func (e *cborEncDriver) EncodeRawExt(re *RawExt, en *Encoder) { + e.encUint(uint64(re.Tag), cborBaseTag) + // only encodes re.Value (never re.Data) + // if false && re.Data != nil { + // en.encode(re.Data) + // } else if re.Value != nil { + if re.Value != nil { + en.encode(re.Value) + } else { + e.EncodeNil() + } +} + +func (e *cborEncDriver) WriteArrayStart(length int) { + if e.h.IndefiniteLength { + e.w.writen1(cborBdIndefiniteArray) + } else { + e.encLen(cborBaseArray, length) + } +} + +func (e *cborEncDriver) WriteMapStart(length int) { + if e.h.IndefiniteLength { + e.w.writen1(cborBdIndefiniteMap) + } else { + e.encLen(cborBaseMap, length) + } +} + +func (e *cborEncDriver) WriteMapEnd() { + if e.h.IndefiniteLength { + e.w.writen1(cborBdBreak) + } +} + +func (e *cborEncDriver) WriteArrayEnd() { + if e.h.IndefiniteLength { + e.w.writen1(cborBdBreak) + } +} + +func (e *cborEncDriver) EncodeString(c charEncoding, v string) { + e.encStringBytesS(cborBaseString, v) +} + +func (e *cborEncDriver) EncodeStringEnc(c charEncoding, v string) { + e.encStringBytesS(cborBaseString, v) +} + +func (e *cborEncDriver) EncodeStringBytes(c charEncoding, v []byte) { + if v == nil { + e.EncodeNil() + } else if c == cRAW { + e.encStringBytesS(cborBaseBytes, stringView(v)) + } else { + e.encStringBytesS(cborBaseString, stringView(v)) + } +} + +func (e *cborEncDriver) EncodeStringBytesRaw(v []byte) { + if v == nil { + e.EncodeNil() + } else { + e.encStringBytesS(cborBaseBytes, stringView(v)) + } +} + +func (e *cborEncDriver) encStringBytesS(bb byte, v string) { + if e.h.IndefiniteLength { + if bb == cborBaseBytes { + e.w.writen1(cborBdIndefiniteBytes) + } else { + e.w.writen1(cborBdIndefiniteString) + } + var vlen uint = uint(len(v)) + blen := vlen / 4 + if blen == 0 { + blen = 64 + } else if blen > 1024 { + blen = 1024 + } + for i := uint(0); i < vlen; { + var v2 string + i2 := i + blen + if i2 < vlen { + v2 = v[i:i2] + } else { + v2 = v[i:] + } + e.encLen(bb, len(v2)) + e.w.writestr(v2) + i = i2 + } + e.w.writen1(cborBdBreak) + } else { + e.encLen(bb, len(v)) + e.w.writestr(v) + } +} + +// ---------------------- + +type cborDecDriver struct { + d *Decoder + h *CborHandle + r *decReaderSwitch + br bool // bytes reader + bdRead bool + bd byte + noBuiltInTypes + // decNoSeparator + decDriverNoopContainerReader + // _ [3]uint64 // padding +} + +func (d *cborDecDriver) readNextBd() { + d.bd = d.r.readn1() + d.bdRead = true +} + +func (d *cborDecDriver) uncacheRead() { + if d.bdRead { + d.r.unreadn1() + d.bdRead = false + } +} + +func (d *cborDecDriver) ContainerType() (vt valueType) { + if !d.bdRead { + d.readNextBd() + } + if d.bd == cborBdNil { + return valueTypeNil + } else if d.bd == cborBdIndefiniteBytes || (d.bd >= cborBaseBytes && d.bd < cborBaseString) { + return valueTypeBytes + } else if d.bd == cborBdIndefiniteString || (d.bd >= cborBaseString && d.bd < cborBaseArray) { + return valueTypeString + } else if d.bd == cborBdIndefiniteArray || (d.bd >= cborBaseArray && d.bd < cborBaseMap) { + return valueTypeArray + } else if d.bd == cborBdIndefiniteMap || (d.bd >= cborBaseMap && d.bd < cborBaseTag) { + return valueTypeMap + } + // else { + // d.d.errorf("isContainerType: unsupported parameter: %v", vt) + // } + return valueTypeUnset +} + +func (d *cborDecDriver) TryDecodeAsNil() bool { + if !d.bdRead { + d.readNextBd() + } + // treat Nil and Undefined as nil values + if d.bd == cborBdNil || d.bd == cborBdUndefined { + d.bdRead = false + return true + } + return false +} + +func (d *cborDecDriver) CheckBreak() bool { + if !d.bdRead { + d.readNextBd() + } + if d.bd == cborBdBreak { + d.bdRead = false + return true + } + return false +} + +func (d *cborDecDriver) decUint() (ui uint64) { + v := d.bd & 0x1f + if v <= 0x17 { + ui = uint64(v) + } else { + if v == 0x18 { + ui = uint64(d.r.readn1()) + } else if v == 0x19 { + ui = uint64(bigen.Uint16(d.r.readx(2))) + } else if v == 0x1a { + ui = uint64(bigen.Uint32(d.r.readx(4))) + } else if v == 0x1b { + ui = uint64(bigen.Uint64(d.r.readx(8))) + } else { + d.d.errorf("invalid descriptor decoding uint: %x/%s", d.bd, cbordesc(d.bd)) + return + } + } + return +} + +func (d *cborDecDriver) decCheckInteger() (neg bool) { + if !d.bdRead { + d.readNextBd() + } + major := d.bd >> 5 + if major == cborMajorUint { + } else if major == cborMajorNegInt { + neg = true + } else { + d.d.errorf("not an integer - invalid major %v from descriptor %x/%s", + major, d.bd, cbordesc(d.bd)) + return + } + return +} + +func (d *cborDecDriver) DecodeInt64() (i int64) { + neg := d.decCheckInteger() + ui := d.decUint() + // check if this number can be converted to an int without overflow + if neg { + i = -(chkOvf.SignedIntV(ui + 1)) + } else { + i = chkOvf.SignedIntV(ui) + } + d.bdRead = false + return +} + +func (d *cborDecDriver) DecodeUint64() (ui uint64) { + if d.decCheckInteger() { + d.d.errorf("assigning negative signed value to unsigned type") + return + } + ui = d.decUint() + d.bdRead = false + return +} + +func (d *cborDecDriver) DecodeFloat64() (f float64) { + if !d.bdRead { + d.readNextBd() + } + if bd := d.bd; bd == cborBdFloat16 { + f = float64(math.Float32frombits(halfFloatToFloatBits(bigen.Uint16(d.r.readx(2))))) + } else if bd == cborBdFloat32 { + f = float64(math.Float32frombits(bigen.Uint32(d.r.readx(4)))) + } else if bd == cborBdFloat64 { + f = math.Float64frombits(bigen.Uint64(d.r.readx(8))) + } else if bd >= cborBaseUint && bd < cborBaseBytes { + f = float64(d.DecodeInt64()) + } else { + d.d.errorf("float only valid from float16/32/64 - invalid descriptor %x/%s", bd, cbordesc(bd)) + return + } + d.bdRead = false + return +} + +// bool can be decoded from bool only (single byte). +func (d *cborDecDriver) DecodeBool() (b bool) { + if !d.bdRead { + d.readNextBd() + } + if bd := d.bd; bd == cborBdTrue { + b = true + } else if bd == cborBdFalse { + } else { + d.d.errorf("not bool - %s %x/%s", msgBadDesc, d.bd, cbordesc(d.bd)) + return + } + d.bdRead = false + return +} + +func (d *cborDecDriver) ReadMapStart() (length int) { + if !d.bdRead { + d.readNextBd() + } + d.bdRead = false + if d.bd == cborBdIndefiniteMap { + return -1 + } + return d.decLen() +} + +func (d *cborDecDriver) ReadArrayStart() (length int) { + if !d.bdRead { + d.readNextBd() + } + d.bdRead = false + if d.bd == cborBdIndefiniteArray { + return -1 + } + return d.decLen() +} + +func (d *cborDecDriver) decLen() int { + return int(d.decUint()) +} + +func (d *cborDecDriver) decAppendIndefiniteBytes(bs []byte) []byte { + d.bdRead = false + for { + if d.CheckBreak() { + break + } + if major := d.bd >> 5; major != cborMajorBytes && major != cborMajorText { + d.d.errorf("expect bytes/string major type in indefinite string/bytes;"+ + " got major %v from descriptor %x/%x", major, d.bd, cbordesc(d.bd)) + return nil + } + n := d.decLen() + oldLen := len(bs) + newLen := oldLen + n + if newLen > cap(bs) { + bs2 := make([]byte, newLen, 2*cap(bs)+n) + copy(bs2, bs) + bs = bs2 + } else { + bs = bs[:newLen] + } + d.r.readb(bs[oldLen:newLen]) + // bs = append(bs, d.r.readn()...) + d.bdRead = false + } + d.bdRead = false + return bs +} + +func (d *cborDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) { + if !d.bdRead { + d.readNextBd() + } + if d.bd == cborBdNil || d.bd == cborBdUndefined { + d.bdRead = false + return nil + } + if d.bd == cborBdIndefiniteBytes || d.bd == cborBdIndefiniteString { + d.bdRead = false + if bs == nil { + if zerocopy { + return d.decAppendIndefiniteBytes(d.d.b[:0]) + } + return d.decAppendIndefiniteBytes(zeroByteSlice) + } + return d.decAppendIndefiniteBytes(bs[:0]) + } + // check if an "array" of uint8's (see ContainerType for how to infer if an array) + if d.bd == cborBdIndefiniteArray || (d.bd >= cborBaseArray && d.bd < cborBaseMap) { + bsOut, _ = fastpathTV.DecSliceUint8V(bs, true, d.d) + return + } + clen := d.decLen() + d.bdRead = false + if zerocopy { + if d.br { + return d.r.readx(uint(clen)) + } else if len(bs) == 0 { + bs = d.d.b[:] + } + } + return decByteSlice(d.r, clen, d.h.MaxInitLen, bs) +} + +func (d *cborDecDriver) DecodeString() (s string) { + return string(d.DecodeBytes(d.d.b[:], true)) +} + +func (d *cborDecDriver) DecodeStringAsBytes() (s []byte) { + return d.DecodeBytes(d.d.b[:], true) +} + +func (d *cborDecDriver) DecodeTime() (t time.Time) { + if !d.bdRead { + d.readNextBd() + } + if d.bd == cborBdNil || d.bd == cborBdUndefined { + d.bdRead = false + return + } + xtag := d.decUint() + d.bdRead = false + return d.decodeTime(xtag) +} + +func (d *cborDecDriver) decodeTime(xtag uint64) (t time.Time) { + if !d.bdRead { + d.readNextBd() + } + switch xtag { + case 0: + var err error + if t, err = time.Parse(time.RFC3339, stringView(d.DecodeStringAsBytes())); err != nil { + d.d.errorv(err) + } + case 1: + // decode an int64 or a float, and infer time.Time from there. + // for floats, round to microseconds, as that is what is guaranteed to fit well. + switch { + case d.bd == cborBdFloat16, d.bd == cborBdFloat32: + f1, f2 := math.Modf(d.DecodeFloat64()) + t = time.Unix(int64(f1), int64(f2*1e9)) + case d.bd == cborBdFloat64: + f1, f2 := math.Modf(d.DecodeFloat64()) + t = time.Unix(int64(f1), int64(f2*1e9)) + case d.bd >= cborBaseUint && d.bd < cborBaseNegInt, + d.bd >= cborBaseNegInt && d.bd < cborBaseBytes: + t = time.Unix(d.DecodeInt64(), 0) + default: + d.d.errorf("time.Time can only be decoded from a number (or RFC3339 string)") + } + default: + d.d.errorf("invalid tag for time.Time - expecting 0 or 1, got 0x%x", xtag) + } + t = t.UTC().Round(time.Microsecond) + return +} + +func (d *cborDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) (realxtag uint64) { + if !d.bdRead { + d.readNextBd() + } + u := d.decUint() + d.bdRead = false + realxtag = u + if ext == nil { + re := rv.(*RawExt) + re.Tag = realxtag + d.d.decode(&re.Value) + } else if xtag != realxtag { + d.d.errorf("Wrong extension tag. Got %b. Expecting: %v", realxtag, xtag) + return + } else { + var v interface{} + d.d.decode(&v) + ext.UpdateExt(rv, v) + } + d.bdRead = false + return +} + +func (d *cborDecDriver) DecodeNaked() { + if !d.bdRead { + d.readNextBd() + } + + n := d.d.naked() + var decodeFurther bool + + switch d.bd { + case cborBdNil: + n.v = valueTypeNil + case cborBdFalse: + n.v = valueTypeBool + n.b = false + case cborBdTrue: + n.v = valueTypeBool + n.b = true + case cborBdFloat16, cborBdFloat32, cborBdFloat64: + n.v = valueTypeFloat + n.f = d.DecodeFloat64() + case cborBdIndefiniteBytes: + decNakedReadRawBytes(d, d.d, n, d.h.RawToString) + case cborBdIndefiniteString: + n.v = valueTypeString + n.s = d.DecodeString() + case cborBdIndefiniteArray: + n.v = valueTypeArray + decodeFurther = true + case cborBdIndefiniteMap: + n.v = valueTypeMap + decodeFurther = true + default: + switch { + case d.bd >= cborBaseUint && d.bd < cborBaseNegInt: + if d.h.SignedInteger { + n.v = valueTypeInt + n.i = d.DecodeInt64() + } else { + n.v = valueTypeUint + n.u = d.DecodeUint64() + } + case d.bd >= cborBaseNegInt && d.bd < cborBaseBytes: + n.v = valueTypeInt + n.i = d.DecodeInt64() + case d.bd >= cborBaseBytes && d.bd < cborBaseString: + decNakedReadRawBytes(d, d.d, n, d.h.RawToString) + case d.bd >= cborBaseString && d.bd < cborBaseArray: + n.v = valueTypeString + n.s = d.DecodeString() + case d.bd >= cborBaseArray && d.bd < cborBaseMap: + n.v = valueTypeArray + decodeFurther = true + case d.bd >= cborBaseMap && d.bd < cborBaseTag: + n.v = valueTypeMap + decodeFurther = true + case d.bd >= cborBaseTag && d.bd < cborBaseSimple: + n.v = valueTypeExt + n.u = d.decUint() + n.l = nil + if n.u == 0 || n.u == 1 { + d.bdRead = false + n.v = valueTypeTime + n.t = d.decodeTime(n.u) + } + // d.bdRead = false + // d.d.decode(&re.Value) // handled by decode itself. + // decodeFurther = true + default: + d.d.errorf("decodeNaked: Unrecognized d.bd: 0x%x", d.bd) + return + } + } + + if !decodeFurther { + d.bdRead = false + } +} + +// ------------------------- + +// CborHandle is a Handle for the CBOR encoding format, +// defined at http://tools.ietf.org/html/rfc7049 and documented further at http://cbor.io . +// +// CBOR is comprehensively supported, including support for: +// - indefinite-length arrays/maps/bytes/strings +// - (extension) tags in range 0..0xffff (0 .. 65535) +// - half, single and double-precision floats +// - all numbers (1, 2, 4 and 8-byte signed and unsigned integers) +// - nil, true, false, ... +// - arrays and maps, bytes and text strings +// +// None of the optional extensions (with tags) defined in the spec are supported out-of-the-box. +// Users can implement them as needed (using SetExt), including spec-documented ones: +// - timestamp, BigNum, BigFloat, Decimals, +// - Encoded Text (e.g. URL, regexp, base64, MIME Message), etc. +type CborHandle struct { + binaryEncodingType + noElemSeparators + BasicHandle + + // IndefiniteLength=true, means that we encode using indefinitelength + IndefiniteLength bool + + // TimeRFC3339 says to encode time.Time using RFC3339 format. + // If unset, we encode time.Time using seconds past epoch. + TimeRFC3339 bool + + // _ [1]uint64 // padding +} + +// Name returns the name of the handle: cbor +func (h *CborHandle) Name() string { return "cbor" } + +// SetInterfaceExt sets an extension +func (h *CborHandle) SetInterfaceExt(rt reflect.Type, tag uint64, ext InterfaceExt) (err error) { + return h.SetExt(rt, tag, &extWrapper{bytesExtFailer{}, ext}) +} + +func (h *CborHandle) newEncDriver(e *Encoder) encDriver { + return &cborEncDriver{e: e, w: e.w, h: h} +} + +func (h *CborHandle) newDecDriver(d *Decoder) decDriver { + return &cborDecDriver{d: d, h: h, r: d.r, br: d.bytes} +} + +func (e *cborEncDriver) reset() { + e.w = e.e.w +} + +func (d *cborDecDriver) reset() { + d.r, d.br = d.d.r, d.d.bytes + d.bd, d.bdRead = 0, false +} + +var _ decDriver = (*cborDecDriver)(nil) +var _ encDriver = (*cborEncDriver)(nil) diff --git a/vendor/github.com/ugorji/go/codec/cbor_test.go b/vendor/github.com/ugorji/go/codec/cbor_test.go new file mode 100644 index 000000000..12f5c810a --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/cbor_test.go @@ -0,0 +1,230 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +package codec + +import ( + "bufio" + "bytes" + "encoding/hex" + "math" + "os" + "regexp" + "strings" + "testing" +) + +func TestCborIndefiniteLength(t *testing.T) { + oldMapType := testCborH.MapType + defer func() { + testCborH.MapType = oldMapType + }() + testCborH.MapType = testMapStrIntfTyp + // var ( + // M1 map[string][]byte + // M2 map[uint64]bool + // L1 []interface{} + // S1 []string + // B1 []byte + // ) + var v, vv interface{} + // define it (v), encode it using indefinite lengths, decode it (vv), compare v to vv + v = map[string]interface{}{ + "one-byte-key": []byte{1, 2, 3, 4, 5, 6}, + "two-string-key": "two-value", + "three-list-key": []interface{}{true, false, uint64(1), int64(-1)}, + } + var buf bytes.Buffer + // buf.Reset() + e := NewEncoder(&buf, testCborH) + buf.WriteByte(cborBdIndefiniteMap) + //---- + buf.WriteByte(cborBdIndefiniteString) + e.MustEncode("one-") + e.MustEncode("byte-") + e.MustEncode("key") + buf.WriteByte(cborBdBreak) + + buf.WriteByte(cborBdIndefiniteBytes) + e.MustEncode([]byte{1, 2, 3}) + e.MustEncode([]byte{4, 5, 6}) + buf.WriteByte(cborBdBreak) + + //---- + buf.WriteByte(cborBdIndefiniteString) + e.MustEncode("two-") + e.MustEncode("string-") + e.MustEncode("key") + buf.WriteByte(cborBdBreak) + + buf.WriteByte(cborBdIndefiniteString) + e.MustEncode([]byte("two-")) // encode as bytes, to check robustness of code + e.MustEncode([]byte("value")) + buf.WriteByte(cborBdBreak) + + //---- + buf.WriteByte(cborBdIndefiniteString) + e.MustEncode("three-") + e.MustEncode("list-") + e.MustEncode("key") + buf.WriteByte(cborBdBreak) + + buf.WriteByte(cborBdIndefiniteArray) + e.MustEncode(true) + e.MustEncode(false) + e.MustEncode(uint64(1)) + e.MustEncode(int64(-1)) + buf.WriteByte(cborBdBreak) + + buf.WriteByte(cborBdBreak) // close map + + NewDecoderBytes(buf.Bytes(), testCborH).MustDecode(&vv) + if err := deepEqual(v, vv); err != nil { + logT(t, "-------- Before and After marshal do not match: Error: %v", err) + logT(t, " ....... GOLDEN: (%T) %#v", v, v) + logT(t, " ....... DECODED: (%T) %#v", vv, vv) + failT(t) + } +} + +type testCborGolden struct { + Base64 string `codec:"cbor"` + Hex string `codec:"hex"` + Roundtrip bool `codec:"roundtrip"` + Decoded interface{} `codec:"decoded"` + Diagnostic string `codec:"diagnostic"` + Skip bool `codec:"skip"` +} + +// Some tests are skipped because they include numbers outside the range of int64/uint64 +func TestCborGoldens(t *testing.T) { + oldMapType := testCborH.MapType + defer func() { + testCborH.MapType = oldMapType + }() + testCborH.MapType = testMapStrIntfTyp + // decode test-cbor-goldens.json into a list of []*testCborGolden + // for each one, + // - decode hex into []byte bs + // - decode bs into interface{} v + // - compare both using deepequal + // - for any miss, record it + var gs []*testCborGolden + f, err := os.Open("test-cbor-goldens.json") + if err != nil { + logT(t, "error opening test-cbor-goldens.json: %v", err) + failT(t) + } + defer f.Close() + jh := new(JsonHandle) + jh.MapType = testMapStrIntfTyp + // d := NewDecoder(f, jh) + d := NewDecoder(bufio.NewReader(f), jh) + // err = d.Decode(&gs) + d.MustDecode(&gs) + if err != nil { + logT(t, "error json decoding test-cbor-goldens.json: %v", err) + failT(t) + } + + tagregex := regexp.MustCompile(`[\d]+\(.+?\)`) + hexregex := regexp.MustCompile(`h'([0-9a-fA-F]*)'`) + for i, g := range gs { + // fmt.Printf("%v, skip: %v, isTag: %v, %s\n", i, g.Skip, tagregex.MatchString(g.Diagnostic), g.Diagnostic) + // skip tags or simple or those with prefix, as we can't verify them. + if g.Skip || strings.HasPrefix(g.Diagnostic, "simple(") || tagregex.MatchString(g.Diagnostic) { + // fmt.Printf("%v: skipped\n", i) + logT(t, "[%v] skipping because skip=true OR unsupported simple value or Tag Value", i) + continue + } + // println("++++++++++++", i, "g.Diagnostic", g.Diagnostic) + if hexregex.MatchString(g.Diagnostic) { + // println(i, "g.Diagnostic matched hex") + if s2 := g.Diagnostic[2 : len(g.Diagnostic)-1]; s2 == "" { + g.Decoded = zeroByteSlice + } else if bs2, err2 := hex.DecodeString(s2); err2 == nil { + g.Decoded = bs2 + } + // fmt.Printf("%v: hex: %v\n", i, g.Decoded) + } + bs, err := hex.DecodeString(g.Hex) + if err != nil { + logT(t, "[%v] error hex decoding %s [%v]: %v", i, g.Hex, g.Hex, err) + failT(t) + } + var v interface{} + NewDecoderBytes(bs, testCborH).MustDecode(&v) + if _, ok := v.(RawExt); ok { + continue + } + // check the diagnostics to compare + switch g.Diagnostic { + case "Infinity": + b := math.IsInf(v.(float64), 1) + testCborError(t, i, math.Inf(1), v, nil, &b) + case "-Infinity": + b := math.IsInf(v.(float64), -1) + testCborError(t, i, math.Inf(-1), v, nil, &b) + case "NaN": + // println(i, "checking NaN") + b := math.IsNaN(v.(float64)) + testCborError(t, i, math.NaN(), v, nil, &b) + case "undefined": + b := v == nil + testCborError(t, i, nil, v, nil, &b) + default: + v0 := g.Decoded + // testCborCoerceJsonNumber(reflect.ValueOf(&v0)) + testCborError(t, i, v0, v, deepEqual(v0, v), nil) + } + } +} + +func testCborError(t *testing.T, i int, v0, v1 interface{}, err error, equal *bool) { + if err == nil && equal == nil { + // fmt.Printf("%v testCborError passed (err and equal nil)\n", i) + return + } + if err != nil { + logT(t, "[%v] deepEqual error: %v", i, err) + logT(t, " ....... GOLDEN: (%T) %#v", v0, v0) + logT(t, " ....... DECODED: (%T) %#v", v1, v1) + failT(t) + } + if equal != nil && !*equal { + logT(t, "[%v] values not equal", i) + logT(t, " ....... GOLDEN: (%T) %#v", v0, v0) + logT(t, " ....... DECODED: (%T) %#v", v1, v1) + failT(t) + } + // fmt.Printf("%v testCborError passed (checks passed)\n", i) +} + +func TestCborHalfFloat(t *testing.T) { + m := map[uint16]float64{ + // using examples from + // https://en.wikipedia.org/wiki/Half-precision_floating-point_format + 0x3c00: 1, + 0x3c01: 1 + math.Pow(2, -10), + 0xc000: -2, + 0x7bff: 65504, + 0x0400: math.Pow(2, -14), + 0x03ff: math.Pow(2, -14) - math.Pow(2, -24), + 0x0001: math.Pow(2, -24), + 0x0000: 0, + 0x8000: -0.0, + } + var ba [3]byte + ba[0] = cborBdFloat16 + var res float64 + for k, v := range m { + res = 0 + bigen.PutUint16(ba[1:], k) + testUnmarshalErr(&res, ba[:3], testCborH, t, "-") + if res == v { + logT(t, "equal floats: from %x %b, %v", k, k, v) + } else { + failT(t, "unequal floats: from %x %b, %v != %v", k, k, res, v) + } + } +} diff --git a/vendor/github.com/ugorji/go/codec/codec_test.go b/vendor/github.com/ugorji/go/codec/codec_test.go new file mode 100644 index 000000000..1b0321447 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/codec_test.go @@ -0,0 +1,3291 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +package codec + +import ( + "bufio" + "bytes" + "encoding/gob" + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "math/rand" + "net" + "net/rpc" + "os" + "os/exec" + "path/filepath" + "reflect" + "runtime" + "strconv" + "strings" + "sync/atomic" + "testing" + "time" +) + +func init() { + testPreInitFns = append(testPreInitFns, testInit) + // fmt.Printf("sizeof: Decoder: %v, Encoder: %v, decNaked: %v\n", + // reflect.TypeOf((*Decoder)(nil)).Elem().Size(), + // reflect.TypeOf((*Encoder)(nil)).Elem().Size(), + // reflect.TypeOf((*decNaked)(nil)).Elem().Size(), + // ) +} + +type testCustomStringT string + +// make this a mapbyslice +type testMbsT []interface{} + +func (testMbsT) MapBySlice() {} + +type testMbsCustStrT []testCustomStringT + +func (testMbsCustStrT) MapBySlice() {} + +// type testSelferRecur struct{} + +// func (s *testSelferRecur) CodecEncodeSelf(e *Encoder) { +// e.MustEncode(s) +// } +// func (s *testSelferRecur) CodecDecodeSelf(d *Decoder) { +// d.MustDecode(s) +// } + +type testIntfMapI interface { + GetIntfMapV() string +} + +type testIntfMapT1 struct { + IntfMapV string +} + +func (x *testIntfMapT1) GetIntfMapV() string { return x.IntfMapV } + +type testIntfMapT2 struct { + IntfMapV string +} + +func (x testIntfMapT2) GetIntfMapV() string { return x.IntfMapV } + +var testErrWriterErr = errors.New("testErrWriterErr") + +type testErrWriter struct{} + +func (x *testErrWriter) Write(p []byte) (int, error) { + return 0, testErrWriterErr +} + +// ---- + +type testVerifyFlag uint8 + +const ( + _ testVerifyFlag = 1 << iota + testVerifyMapTypeSame + testVerifyMapTypeStrIntf + testVerifyMapTypeIntfIntf + // testVerifySliceIntf + testVerifyForPython + testVerifyDoNil + testVerifyTimeAsInteger +) + +func (f testVerifyFlag) isset(v testVerifyFlag) bool { + return f&v == v +} + +// const testSkipRPCTests = false + +var ( + testTableNumPrimitives int + testTableIdxTime int + testTableNumMaps int + + // set this when running using bufio, etc + testSkipRPCTests = false +) + +var ( + skipVerifyVal interface{} = &(struct{}{}) + + testMapStrIntfTyp = reflect.TypeOf(map[string]interface{}(nil)) + + // For Go Time, do not use a descriptive timezone. + // It's unnecessary, and makes it harder to do a reflect.DeepEqual. + // The Offset already tells what the offset should be, if not on UTC and unknown zone name. + timeLoc = time.FixedZone("", -8*60*60) // UTC-08:00 //time.UTC-8 + timeToCompare1 = time.Date(2012, 2, 2, 2, 2, 2, 2000, timeLoc).UTC() + timeToCompare2 = time.Date(1900, 2, 2, 2, 2, 2, 2000, timeLoc).UTC() + timeToCompare3 = time.Unix(0, 270).UTC() // use value that must be encoded as uint64 for nanoseconds (for cbor/msgpack comparison) + //timeToCompare4 = time.Time{}.UTC() // does not work well with simple cbor time encoding (overflow) + timeToCompare4 = time.Unix(-2013855848, 4223).UTC() + + table []interface{} // main items we encode + // will encode a float32 as float64, or large int as uint + testRpcInt = new(TestRpcInt) +) + +var wrapInt64Typ = reflect.TypeOf(wrapInt64(0)) +var wrapBytesTyp = reflect.TypeOf(wrapBytes(nil)) + +func testByteBuf(in []byte) *bytes.Buffer { + return bytes.NewBuffer(in) +} + +type TestABC struct { + A, B, C string +} + +func (x *TestABC) MarshalBinary() ([]byte, error) { + return []byte(fmt.Sprintf("%s %s %s", x.A, x.B, x.C)), nil +} +func (x *TestABC) MarshalText() ([]byte, error) { + return []byte(fmt.Sprintf("%s %s %s", x.A, x.B, x.C)), nil +} +func (x *TestABC) MarshalJSON() ([]byte, error) { + return []byte(fmt.Sprintf(`"%s %s %s"`, x.A, x.B, x.C)), nil +} + +func (x *TestABC) UnmarshalBinary(data []byte) (err error) { + ss := strings.Split(string(data), " ") + x.A, x.B, x.C = ss[0], ss[1], ss[2] + return +} +func (x *TestABC) UnmarshalText(data []byte) (err error) { + return x.UnmarshalBinary(data) +} +func (x *TestABC) UnmarshalJSON(data []byte) (err error) { + return x.UnmarshalBinary(data[1 : len(data)-1]) +} + +type TestABC2 struct { + A, B, C string +} + +func (x TestABC2) MarshalText() ([]byte, error) { + return []byte(fmt.Sprintf("%s %s %s", x.A, x.B, x.C)), nil +} +func (x *TestABC2) UnmarshalText(data []byte) (err error) { + ss := strings.Split(string(data), " ") + x.A, x.B, x.C = ss[0], ss[1], ss[2] + return + // _, err = fmt.Sscanf(string(data), "%s %s %s", &x.A, &x.B, &x.C) +} + +type TestSimplish struct { + Ii int + Ss string + Ar [2]*TestSimplish + Sl []*TestSimplish + Mm map[string]*TestSimplish +} + +type TestRpcABC struct { + A, B, C string +} + +type TestRpcInt struct { + i int +} + +func (r *TestRpcInt) Update(n int, res *int) error { r.i = n; *res = r.i; return nil } +func (r *TestRpcInt) Square(ignore int, res *int) error { *res = r.i * r.i; return nil } +func (r *TestRpcInt) Mult(n int, res *int) error { *res = r.i * n; return nil } +func (r *TestRpcInt) EchoStruct(arg TestRpcABC, res *string) error { + *res = fmt.Sprintf("%#v", arg) + return nil +} +func (r *TestRpcInt) Echo123(args []string, res *string) error { + *res = fmt.Sprintf("%#v", args) + return nil +} + +type TestRawValue struct { + R Raw + I int +} + +// ---- + +type testUnixNanoTimeExt struct { + // keep timestamp here, so that do not incur interface-conversion costs + // ts int64 +} + +func (x *testUnixNanoTimeExt) WriteExt(v interface{}) []byte { + v2 := v.(*time.Time) + bs := make([]byte, 8) + bigen.PutUint64(bs, uint64(v2.UnixNano())) + return bs +} +func (x *testUnixNanoTimeExt) ReadExt(v interface{}, bs []byte) { + v2 := v.(*time.Time) + ui := bigen.Uint64(bs) + *v2 = time.Unix(0, int64(ui)).UTC() +} +func (x *testUnixNanoTimeExt) ConvertExt(v interface{}) interface{} { + v2 := v.(*time.Time) // structs are encoded by passing the ptr + return v2.UTC().UnixNano() +} + +func (x *testUnixNanoTimeExt) UpdateExt(dest interface{}, v interface{}) { + tt := dest.(*time.Time) + switch v2 := v.(type) { + case int64: + *tt = time.Unix(0, v2).UTC() + case uint64: + *tt = time.Unix(0, int64(v2)).UTC() + //case float64: + //case string: + default: + panic(fmt.Sprintf("unsupported format for time conversion: expecting int64/uint64; got %T", v)) + } +} + +// ---- + +type wrapInt64Ext int64 + +func (x *wrapInt64Ext) WriteExt(v interface{}) []byte { + v2 := uint64(int64(v.(wrapInt64))) + bs := make([]byte, 8) + bigen.PutUint64(bs, v2) + return bs +} +func (x *wrapInt64Ext) ReadExt(v interface{}, bs []byte) { + v2 := v.(*wrapInt64) + ui := bigen.Uint64(bs) + *v2 = wrapInt64(int64(ui)) +} +func (x *wrapInt64Ext) ConvertExt(v interface{}) interface{} { + return int64(v.(wrapInt64)) +} +func (x *wrapInt64Ext) UpdateExt(dest interface{}, v interface{}) { + v2 := dest.(*wrapInt64) + *v2 = wrapInt64(v.(int64)) +} + +// ---- + +type wrapBytesExt struct{} + +func (x *wrapBytesExt) WriteExt(v interface{}) []byte { + return ([]byte)(v.(wrapBytes)) +} +func (x *wrapBytesExt) ReadExt(v interface{}, bs []byte) { + v2 := v.(*wrapBytes) + *v2 = wrapBytes(bs) +} +func (x *wrapBytesExt) ConvertExt(v interface{}) interface{} { + return ([]byte)(v.(wrapBytes)) +} +func (x *wrapBytesExt) UpdateExt(dest interface{}, v interface{}) { + v2 := dest.(*wrapBytes) + // some formats (e.g. json) cannot nakedly determine []byte from string, so expect both + switch v3 := v.(type) { + case []byte: + *v2 = wrapBytes(v3) + case string: + *v2 = wrapBytes([]byte(v3)) + default: + panic("UpdateExt for wrapBytesExt expects string or []byte") + } + // *v2 = wrapBytes(v.([]byte)) +} + +// ---- + +// timeExt is an extension handler for time.Time, that uses binc model for encoding/decoding time. +// we used binc model, as that is the only custom time representation that we designed ourselves. +type timeExt struct{} + +func (x timeExt) WriteExt(v interface{}) (bs []byte) { + switch v2 := v.(type) { + case time.Time: + bs = bincEncodeTime(v2) + case *time.Time: + bs = bincEncodeTime(*v2) + default: + panic(fmt.Errorf("unsupported format for time conversion: expecting time.Time; got %T", v2)) + } + return +} +func (x timeExt) ReadExt(v interface{}, bs []byte) { + tt, err := bincDecodeTime(bs) + if err != nil { + panic(err) + } + *(v.(*time.Time)) = tt +} + +func (x timeExt) ConvertExt(v interface{}) interface{} { + return x.WriteExt(v) +} +func (x timeExt) UpdateExt(v interface{}, src interface{}) { + x.ReadExt(v, src.([]byte)) +} + +// ---- + +func testCodecEncode(ts interface{}, bsIn []byte, + fn func([]byte) *bytes.Buffer, h Handle) (bs []byte, err error) { + return sTestCodecEncode(ts, bsIn, fn, h, basicHandle(h)) +} + +func testCodecDecode(bs []byte, ts interface{}, h Handle) (err error) { + return sTestCodecDecode(bs, ts, h, basicHandle(h)) +} + +func checkErrT(t *testing.T, err error) { + if err != nil { + failT(t, err.Error()) + } +} + +func checkEqualT(t *testing.T, v1 interface{}, v2 interface{}, desc string) { + if err := deepEqual(v1, v2); err != nil { + failT(t, "Not Equal: %s: %v. v1: %v, v2: %v", desc, err, v1, v2) + } +} + +func failT(t *testing.T, args ...interface{}) { + if len(args) > 0 { + if format, isstr := args[0].(string); isstr { + logT(t, format, args[1:]...) + } + } + t.FailNow() +} + +func testInit() { + gob.Register(new(TestStrucFlex)) + if testInitDebug { + ts0 := newTestStrucFlex(2, testNumRepeatString, false, !testSkipIntf, false) + logT(nil, "====> depth: %v, ts: %#v\n", 2, ts0) + } + + for _, v := range testHandles { + bh := basicHandle(v) + // pre-fill them first + bh.EncodeOptions = testEncodeOptions + bh.DecodeOptions = testDecodeOptions + // bh.InterfaceReset = true + // bh.PreferArrayOverSlice = true + // modify from flag'ish things + bh.InternString = testInternStr + bh.Canonical = testCanonical + bh.CheckCircularRef = testCheckCircRef + bh.StructToArray = testStructToArray + bh.MaxInitLen = testMaxInitLen + } + + testMsgpackH.WriteExt = true + + var tTimeExt timeExt + var tBytesExt wrapBytesExt + var tI64Ext wrapInt64Ext + + // create legacy functions suitable for deprecated AddExt functionality, + // and use on some places for testSimpleH e.g. for time.Time and wrapInt64 + var ( + myExtEncFn = func(x BytesExt, rv reflect.Value) (bs []byte, err error) { + defer panicToErr(errDecoratorDef{}, &err) + bs = x.WriteExt(rv.Interface()) + return + } + myExtDecFn = func(x BytesExt, rv reflect.Value, bs []byte) (err error) { + defer panicToErr(errDecoratorDef{}, &err) + x.ReadExt(rv.Interface(), bs) + return + } + timeExtEncFn = func(rv reflect.Value) (bs []byte, err error) { return myExtEncFn(tTimeExt, rv) } + timeExtDecFn = func(rv reflect.Value, bs []byte) (err error) { return myExtDecFn(tTimeExt, rv, bs) } + wrapInt64ExtEncFn = func(rv reflect.Value) (bs []byte, err error) { return myExtEncFn(&tI64Ext, rv) } + wrapInt64ExtDecFn = func(rv reflect.Value, bs []byte) (err error) { return myExtDecFn(&tI64Ext, rv, bs) } + ) + + chkErr := func(err error) { + if err != nil { + panic(err) + } + } + + // time.Time is a native type, so extensions will have no effect. + // However, we add these here to ensure nothing happens. + chkErr(testSimpleH.AddExt(timeTyp, 1, timeExtEncFn, timeExtDecFn)) + // testBincH.SetBytesExt(timeTyp, 1, timeExt{}) // time is builtin for binc + chkErr(testMsgpackH.SetBytesExt(timeTyp, 1, timeExt{})) + chkErr(testCborH.SetInterfaceExt(timeTyp, 1, &testUnixNanoTimeExt{})) + // testJsonH.SetInterfaceExt(timeTyp, 1, &testUnixNanoTimeExt{}) + + // Now, add extensions for the type wrapInt64 and wrapBytes, + // so we can execute the Encode/Decode Ext paths. + + chkErr(testSimpleH.SetBytesExt(wrapBytesTyp, 32, &tBytesExt)) + chkErr(testMsgpackH.SetBytesExt(wrapBytesTyp, 32, &tBytesExt)) + chkErr(testBincH.SetBytesExt(wrapBytesTyp, 32, &tBytesExt)) + chkErr(testJsonH.SetInterfaceExt(wrapBytesTyp, 32, &tBytesExt)) + chkErr(testCborH.SetInterfaceExt(wrapBytesTyp, 32, &tBytesExt)) + + chkErr(testSimpleH.AddExt(wrapInt64Typ, 16, wrapInt64ExtEncFn, wrapInt64ExtDecFn)) + // chkErr(testSimpleH.SetBytesExt(wrapInt64Typ, 16, &tI64Ext)) + chkErr(testMsgpackH.SetBytesExt(wrapInt64Typ, 16, &tI64Ext)) + chkErr(testBincH.SetBytesExt(wrapInt64Typ, 16, &tI64Ext)) + chkErr(testJsonH.SetInterfaceExt(wrapInt64Typ, 16, &tI64Ext)) + chkErr(testCborH.SetInterfaceExt(wrapInt64Typ, 16, &tI64Ext)) + + // primitives MUST be an even number, so it can be used as a mapBySlice also. + primitives := []interface{}{ + int8(-8), + int16(-1616), + int32(-32323232), + int64(-6464646464646464), + uint8(192), + uint16(1616), + uint32(32323232), + uint64(6464646464646464), + byte(192), + float32(-3232.0), + float64(-6464646464.0), + float32(3232.0), + float64(6464.0), + float64(6464646464.0), + false, + true, + "null", + nil, + "some&day>some lp { // testTableNumPrimitives+1 is the mapBySlice + av[i] = skipVerifyVal + continue + } + av[i] = testVerifyVal(v, f, h) + } + // only do the python verify up to the maps, skipping the last 2 maps. + av = av[:testTableNumPrimitives+2+testTableNumMaps-2] + case f.isset(testVerifyDoNil): + for i, v := range table { + if i > lp { + av[i] = skipVerifyVal + continue + } + av[i] = testVerifyVal(v, f, h) + } + default: + for i, v := range table { + if i == lp { + av[i] = skipVerifyVal + continue + } + //av[i] = testVerifyVal(v, testVerifyMapTypeSame) + switch v.(type) { + case []interface{}: + av[i] = testVerifyVal(v, f, h) + case testMbsT: + av[i] = testVerifyVal(v, f, h) + case map[string]interface{}: + av[i] = testVerifyVal(v, f, h) + case map[interface{}]interface{}: + av[i] = testVerifyVal(v, f, h) + case time.Time: + av[i] = testVerifyVal(v, f, h) + default: + av[i] = v + } + } + } + return +} + +func testVerifyValInt(v int64, isMsgp bool) (v2 interface{}) { + if isMsgp { + if v >= 0 && v <= 127 { + v2 = uint64(v) + } else { + v2 = int64(v) + } + } else if v >= 0 { + v2 = uint64(v) + } else { + v2 = int64(v) + } + return +} + +func testVerifyVal(v interface{}, f testVerifyFlag, h Handle) (v2 interface{}) { + //for python msgpack, + // - all positive integers are unsigned 64-bit ints + // - all floats are float64 + _, isMsgp := h.(*MsgpackHandle) + _, isCbor := h.(*CborHandle) + switch iv := v.(type) { + case int8: + v2 = testVerifyValInt(int64(iv), isMsgp) + // fmt.Printf(">>>> is msgp: %v, v: %T, %v ==> v2: %T, %v\n", isMsgp, v, v, v2, v2) + case int16: + v2 = testVerifyValInt(int64(iv), isMsgp) + case int32: + v2 = testVerifyValInt(int64(iv), isMsgp) + case int64: + v2 = testVerifyValInt(int64(iv), isMsgp) + case uint8: + v2 = uint64(iv) + case uint16: + v2 = uint64(iv) + case uint32: + v2 = uint64(iv) + case uint64: + v2 = uint64(iv) + case float32: + v2 = float64(iv) + case float64: + v2 = float64(iv) + case []interface{}: + m2 := make([]interface{}, len(iv)) + for j, vj := range iv { + m2[j] = testVerifyVal(vj, f, h) + } + v2 = m2 + case testMbsT: + m2 := make([]interface{}, len(iv)) + for j, vj := range iv { + m2[j] = testVerifyVal(vj, f, h) + } + v2 = testMbsT(m2) + case map[string]bool: + switch { + case f.isset(testVerifyMapTypeSame): + m2 := make(map[string]bool) + for kj, kv := range iv { + m2[kj] = kv + } + v2 = m2 + case f.isset(testVerifyMapTypeStrIntf): + m2 := make(map[string]interface{}) + for kj, kv := range iv { + m2[kj] = kv + } + v2 = m2 + case f.isset(testVerifyMapTypeIntfIntf): + m2 := make(map[interface{}]interface{}) + for kj, kv := range iv { + m2[kj] = kv + } + v2 = m2 + } + case map[string]interface{}: + switch { + case f.isset(testVerifyMapTypeSame): + m2 := make(map[string]interface{}) + for kj, kv := range iv { + m2[kj] = testVerifyVal(kv, f, h) + } + v2 = m2 + case f.isset(testVerifyMapTypeStrIntf): + m2 := make(map[string]interface{}) + for kj, kv := range iv { + m2[kj] = testVerifyVal(kv, f, h) + } + v2 = m2 + case f.isset(testVerifyMapTypeIntfIntf): + m2 := make(map[interface{}]interface{}) + for kj, kv := range iv { + m2[kj] = testVerifyVal(kv, f, h) + } + v2 = m2 + } + case map[interface{}]interface{}: + m2 := make(map[interface{}]interface{}) + for kj, kv := range iv { + m2[testVerifyVal(kj, f, h)] = testVerifyVal(kv, f, h) + } + v2 = m2 + case time.Time: + switch { + case f.isset(testVerifyTimeAsInteger): + if iv2 := iv.UnixNano(); iv2 >= 0 { + v2 = uint64(iv2) + } else { + v2 = int64(iv2) + } + case isMsgp: + v2 = iv.UTC() + case isCbor: + // fmt.Printf("%%%% cbor verifier\n") + v2 = iv.UTC().Round(time.Microsecond) + default: + v2 = v + } + default: + v2 = v + } + return +} + +func testUnmarshal(v interface{}, data []byte, h Handle) (err error) { + return testCodecDecode(data, v, h) +} + +func testMarshal(v interface{}, h Handle) (bs []byte, err error) { + return testCodecEncode(v, nil, testByteBuf, h) +} + +func testMarshalErr(v interface{}, h Handle, t *testing.T, name string) (bs []byte) { + bs, err := testMarshal(v, h) + if err != nil { + failT(t, "Error encoding %s: %v, Err: %v", name, v, err) + } + return +} + +func testUnmarshalErr(v interface{}, data []byte, h Handle, t *testing.T, name string) { + if err := testUnmarshal(v, data, h); err != nil { + failT(t, "Error Decoding into %s: %v, Err: %v", name, v, err) + } +} + +func testDeepEqualErr(v1, v2 interface{}, t *testing.T, name string) { + if err := deepEqual(v1, v2); err == nil { + logT(t, "%s: values equal", name) + } else { + failT(t, "%s: values not equal: %v. 1: %v, 2: %v", name, err, v1, v2) + } +} + +func testReadWriteCloser(c io.ReadWriteCloser) io.ReadWriteCloser { + if testRpcBufsize <= 0 && rand.Int63()%2 == 0 { + return c + } + return struct { + io.Closer + *bufio.Reader + *bufio.Writer + }{c, bufio.NewReaderSize(c, testRpcBufsize), bufio.NewWriterSize(c, testRpcBufsize)} +} + +// doTestCodecTableOne allows us test for different variations based on arguments passed. +func doTestCodecTableOne(t *testing.T, testNil bool, h Handle, + vs []interface{}, vsVerify []interface{}) { + //if testNil, then just test for when a pointer to a nil interface{} is passed. It should work. + //Current setup allows us test (at least manually) the nil interface or typed interface. + logT(t, "================ TestNil: %v ================\n", testNil) + for i, v0 := range vs { + logT(t, "..............................................") + logT(t, " Testing: #%d:, %T, %#v\n", i, v0, v0) + b0 := testMarshalErr(v0, h, t, "v0") + var b1 = b0 + if len(b1) > 256 { + b1 = b1[:256] + } + if h.isBinary() { + logT(t, " Encoded bytes: len: %v, %v\n", len(b0), b1) + } else { + logT(t, " Encoded string: len: %v, %v\n", len(b0), string(b1)) + // println("########### encoded string: " + string(b0)) + } + var v1 interface{} + var err error + if testNil { + err = testUnmarshal(&v1, b0, h) + } else { + if v0 != nil { + v0rt := reflect.TypeOf(v0) // ptr + if v0rt.Kind() == reflect.Ptr { + err = testUnmarshal(v0, b0, h) + v1 = v0 + } else { + rv1 := reflect.New(v0rt) + err = testUnmarshal(rv1.Interface(), b0, h) + v1 = rv1.Elem().Interface() + // v1 = reflect.Indirect(reflect.ValueOf(v1)).Interface() + } + } + } + + logT(t, " v1 returned: %T, %v %#v", v1, v1, v1) + // if v1 != nil { + // logT(t, " v1 returned: %T, %#v", v1, v1) + // //we always indirect, because ptr to typed value may be passed (if not testNil) + // v1 = reflect.Indirect(reflect.ValueOf(v1)).Interface() + // } + if err != nil { + failT(t, "-------- Error: %v. Partial return: %v", err, v1) + } + v0check := vsVerify[i] + if v0check == skipVerifyVal { + logT(t, " Nil Check skipped: Decoded: %T, %#v\n", v1, v1) + continue + } + + if err = deepEqual(v0check, v1); err == nil { + logT(t, "++++++++ Before and After marshal matched\n") + } else { + // logT(t, "-------- Before and After marshal do not match: Error: %v"+ + // " ====> GOLDEN: (%T) %#v, DECODED: (%T) %#v\n", err, v0check, v0check, v1, v1) + logT(t, "-------- FAIL: Before and After marshal do not match: Error: %v", err) + logT(t, " ....... GOLDEN: (%T) %v %#v", v0check, v0check, v0check) + logT(t, " ....... DECODED: (%T) %v %#v", v1, v1, v1) + failT(t) + } + } +} + +func testCodecTableOne(t *testing.T, h Handle) { + testOnce.Do(testInitAll) + // func TestMsgpackAllExperimental(t *testing.T) { + // dopts := testDecOpts(nil, nil, false, true, true), + + numPrim, numMap, idxTime, idxMap := testTableNumPrimitives, testTableNumMaps, testTableIdxTime, testTableNumPrimitives+2 + + //println("#################") + tableVerify := testTableVerify(testVerifyMapTypeSame, h) + tableTestNilVerify := testTableVerify(testVerifyDoNil|testVerifyMapTypeStrIntf, h) + switch v := h.(type) { + case *MsgpackHandle: + var oldWriteExt bool + _ = oldWriteExt + oldWriteExt = v.WriteExt + v.WriteExt = true + doTestCodecTableOne(t, false, h, table, tableVerify) + v.WriteExt = oldWriteExt + case *JsonHandle: + //skip []interface{} containing time.Time, as it encodes as a number, but cannot decode back to time.Time. + //As there is no real support for extension tags in json, this must be skipped. + doTestCodecTableOne(t, false, h, table[:numPrim], tableVerify[:numPrim]) + doTestCodecTableOne(t, false, h, table[idxMap:], tableVerify[idxMap:]) + default: + doTestCodecTableOne(t, false, h, table, tableVerify) + } + // func TestMsgpackAll(t *testing.T) { + + // //skip []interface{} containing time.Time + // doTestCodecTableOne(t, false, h, table[:numPrim], tableVerify[:numPrim]) + // doTestCodecTableOne(t, false, h, table[numPrim+1:], tableVerify[numPrim+1:]) + // func TestMsgpackNilStringMap(t *testing.T) { + var oldMapType reflect.Type + v := basicHandle(h) + + oldMapType, v.MapType = v.MapType, testMapStrIntfTyp + // defer func() { v.MapType = oldMapType }() + //skip time.Time, []interface{} containing time.Time, last map, and newStruc + doTestCodecTableOne(t, true, h, table[:idxTime], tableTestNilVerify[:idxTime]) + doTestCodecTableOne(t, true, h, table[idxMap:idxMap+numMap-1], tableTestNilVerify[idxMap:idxMap+numMap-1]) // failing one for msgpack + v.MapType = oldMapType + // func TestMsgpackNilIntf(t *testing.T) { + + //do last map and newStruc + idx2 := idxMap + numMap - 1 + doTestCodecTableOne(t, true, h, table[idx2:], tableTestNilVerify[idx2:]) + //TODO? What is this one? + //doTestCodecTableOne(t, true, h, table[17:18], tableTestNilVerify[17:18]) +} + +func testCodecMiscOne(t *testing.T, h Handle) { + var err error + testOnce.Do(testInitAll) + b := testMarshalErr(32, h, t, "32") + // Cannot do this nil one, because faster type assertion decoding will panic + // var i *int32 + // if err = testUnmarshal(b, i, nil); err == nil { + // logT(t, "------- Expecting error because we cannot unmarshal to int32 nil ptr") + // failT(t) + // } + var i2 int32 + testUnmarshalErr(&i2, b, h, t, "int32-ptr") + if i2 != int32(32) { + logT(t, "------- didn't unmarshal to 32: Received: %d", i2) + failT(t) + } + + // func TestMsgpackDecodePtr(t *testing.T) { + ts := newTestStrucFlex(testDepth, testNumRepeatString, false, !testSkipIntf, false) + b = testMarshalErr(ts, h, t, "pointer-to-struct") + if len(b) < 40 { + logT(t, "------- Size must be > 40. Size: %d", len(b)) + failT(t) + } + var b1 = b + if len(b1) > 256 { + b1 = b1[:256] + } + if h.isBinary() { + logT(t, "------- b: size: %v, value: %v", len(b), b1) + } else { + logT(t, "------- b: size: %v, value: %s", len(b), b1) + } + ts2 := emptyTestStrucFlex() + testUnmarshalErr(ts2, b, h, t, "pointer-to-struct") + if ts2.I64 != math.MaxInt64*2/3 { + logT(t, "------- Unmarshal wrong. Expect I64 = 64. Got: %v", ts2.I64) + failT(t) + } + + // func TestMsgpackIntfDecode(t *testing.T) { + m := map[string]int{"A": 2, "B": 3} + p := []interface{}{m} + bs := testMarshalErr(p, h, t, "p") + + m2 := map[string]int{} + p2 := []interface{}{m2} + testUnmarshalErr(&p2, bs, h, t, "&p2") + + if m2["A"] != 2 || m2["B"] != 3 { + logT(t, "FAIL: m2 not as expected: expecting: %v, got: %v", m, m2) + failT(t) + } + + // log("m: %v, m2: %v, p: %v, p2: %v", m, m2, p, p2) + checkEqualT(t, p, p2, "p=p2") + checkEqualT(t, m, m2, "m=m2") + if err = deepEqual(p, p2); err == nil { + logT(t, "p and p2 match") + } else { + logT(t, "Not Equal: %v. p: %v, p2: %v", err, p, p2) + failT(t) + } + if err = deepEqual(m, m2); err == nil { + logT(t, "m and m2 match") + } else { + logT(t, "Not Equal: %v. m: %v, m2: %v", err, m, m2) + failT(t) + } + + // func TestMsgpackDecodeStructSubset(t *testing.T) { + // test that we can decode a subset of the stream + mm := map[string]interface{}{"A": 5, "B": 99, "C": 333} + bs = testMarshalErr(mm, h, t, "mm") + type ttt struct { + A uint8 + C int32 + } + var t2 ttt + testUnmarshalErr(&t2, bs, h, t, "t2") + t3 := ttt{5, 333} + checkEqualT(t, t2, t3, "t2=t3") + + // println(">>>>>") + // test simple arrays, non-addressable arrays, slices + type tarr struct { + A int64 + B [3]int64 + C []byte + D [3]byte + } + var tarr0 = tarr{1, [3]int64{2, 3, 4}, []byte{4, 5, 6}, [3]byte{7, 8, 9}} + // test both pointer and non-pointer (value) + for _, tarr1 := range []interface{}{tarr0, &tarr0} { + bs = testMarshalErr(tarr1, h, t, "tarr1") + if _, ok := h.(*JsonHandle); ok { + logT(t, "Marshal as: %s", bs) + } + var tarr2 tarr + testUnmarshalErr(&tarr2, bs, h, t, "tarr2") + checkEqualT(t, tarr0, tarr2, "tarr0=tarr2") + } + + // test byte array, even if empty (msgpack only) + if h == testMsgpackH { + type ystruct struct { + Anarray []byte + } + var ya = ystruct{} + testUnmarshalErr(&ya, []byte{0x91, 0x90}, h, t, "ya") + } + + var tt1, tt2 time.Time + tt2 = time.Now() + bs = testMarshalErr(tt1, h, t, "zero-time-enc") + testUnmarshalErr(&tt2, bs, h, t, "zero-time-dec") + testDeepEqualErr(tt1, tt2, t, "zero-time-eq") + + // test encoding a slice of byte (but not []byte) and decoding into a []byte + var sw = []wrapUint8{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'} + var bw []byte // ("ABCDEFGHIJ") + bs = testMarshalErr(sw, h, t, "wrap-bytes-enc") + testUnmarshalErr(&bw, bs, h, t, "wrap-bytes-dec") + testDeepEqualErr(bw, []byte("ABCDEFGHIJ"), t, "wrap-bytes-eq") +} + +func testCodecEmbeddedPointer(t *testing.T, h Handle) { + testOnce.Do(testInitAll) + type Z int + type A struct { + AnInt int + } + type B struct { + *Z + *A + MoreInt int + } + var z Z = 4 + x1 := &B{&z, &A{5}, 6} + bs := testMarshalErr(x1, h, t, "x1") + var x2 = new(B) + testUnmarshalErr(x2, bs, h, t, "x2") + checkEqualT(t, x1, x2, "x1=x2") +} + +func testCodecUnderlyingType(t *testing.T, h Handle) { + testOnce.Do(testInitAll) + // Manual Test. + // Run by hand, with accompanying print statements in fast-path.go + // to ensure that the fast functions are called. + type T1 map[string]string + v := T1{"1": "1s", "2": "2s"} + var bs []byte + var err error + NewEncoderBytes(&bs, h).MustEncode(v) + if err != nil { + logT(t, "Error during encode: %v", err) + failT(t) + } + var v2 T1 + NewDecoderBytes(bs, h).MustDecode(&v2) + if err != nil { + logT(t, "Error during decode: %v", err) + failT(t) + } +} + +func testCodecChan(t *testing.T, h Handle) { + testOnce.Do(testInitAll) + // - send a slice []*int64 (sl1) into an chan (ch1) with cap > len(s1) + // - encode ch1 as a stream array + // - decode a chan (ch2), with cap > len(s1) from the stream array + // - receive from ch2 into slice sl2 + // - compare sl1 and sl2 + // - do this for codecs: json, cbor (covers all types) + + if true { + logT(t, "*int64") + sl1 := make([]*int64, 4) + for i := range sl1 { + var j int64 = int64(i) + sl1[i] = &j + } + ch1 := make(chan *int64, 4) + for _, j := range sl1 { + ch1 <- j + } + var bs []byte + NewEncoderBytes(&bs, h).MustEncode(ch1) + ch2 := make(chan *int64, 8) + NewDecoderBytes(bs, h).MustDecode(&ch2) + close(ch2) + var sl2 []*int64 + for j := range ch2 { + sl2 = append(sl2, j) + } + if err := deepEqual(sl1, sl2); err != nil { + logT(t, "FAIL: Not Match: %v; len: %v, %v", err, len(sl1), len(sl2)) + failT(t) + } + } + + if true { + logT(t, "testBytesT []byte - input []byte") + type testBytesT []byte + sl1 := make([]testBytesT, 4) + for i := range sl1 { + var j = []byte(strings.Repeat(strconv.FormatInt(int64(i), 10), i)) + sl1[i] = j + } + ch1 := make(chan testBytesT, 4) + for _, j := range sl1 { + ch1 <- j + } + var bs []byte + NewEncoderBytes(&bs, h).MustEncode(ch1) + ch2 := make(chan testBytesT, 8) + NewDecoderBytes(bs, h).MustDecode(&ch2) + close(ch2) + var sl2 []testBytesT + for j := range ch2 { + // logT(t, ">>>> from chan: is nil? %v, %v", j == nil, j) + sl2 = append(sl2, j) + } + if err := deepEqual(sl1, sl2); err != nil { + logT(t, "FAIL: Not Match: %v; len: %v, %v", err, len(sl1), len(sl2)) + failT(t) + } + } + if true { + logT(t, "testBytesT byte - input string/testBytesT") + type testBytesT byte + sl1 := make([]testBytesT, 4) + for i := range sl1 { + var j = strconv.FormatInt(int64(i), 10)[0] + sl1[i] = testBytesT(j) + } + ch1 := make(chan testBytesT, 4) + for _, j := range sl1 { + ch1 <- j + } + var bs []byte + NewEncoderBytes(&bs, h).MustEncode(ch1) + ch2 := make(chan testBytesT, 8) + NewDecoderBytes(bs, h).MustDecode(&ch2) + close(ch2) + var sl2 []testBytesT + for j := range ch2 { + sl2 = append(sl2, j) + } + if err := deepEqual(sl1, sl2); err != nil { + logT(t, "FAIL: Not Match: %v; len: %v, %v", err, len(sl1), len(sl2)) + failT(t) + } + } + + if true { + logT(t, "*[]byte") + sl1 := make([]byte, 4) + for i := range sl1 { + var j = strconv.FormatInt(int64(i), 10)[0] + sl1[i] = byte(j) + } + ch1 := make(chan byte, 4) + for _, j := range sl1 { + ch1 <- j + } + var bs []byte + NewEncoderBytes(&bs, h).MustEncode(ch1) + ch2 := make(chan byte, 8) + NewDecoderBytes(bs, h).MustDecode(&ch2) + close(ch2) + var sl2 []byte + for j := range ch2 { + sl2 = append(sl2, j) + } + if err := deepEqual(sl1, sl2); err != nil { + logT(t, "FAIL: Not Match: %v; len: %v, %v", err, len(sl1), len(sl2)) + failT(t) + } + } + +} + +func testCodecRpcOne(t *testing.T, rr Rpc, h Handle, doRequest bool, exitSleepMs time.Duration, +) (port int) { + testOnce.Do(testInitAll) + if testSkipRPCTests { + return + } + // rpc needs EOF, which is sent via a panic, and so must be recovered. + if !recoverPanicToErr { + logT(t, "EXPECTED. set recoverPanicToErr=true, since rpc needs EOF") + failT(t) + } + + if jsonH, ok := h.(*JsonHandle); ok && !jsonH.TermWhitespace { + jsonH.TermWhitespace = true + defer func() { jsonH.TermWhitespace = false }() + } + srv := rpc.NewServer() + srv.Register(testRpcInt) + ln, err := net.Listen("tcp", "127.0.0.1:0") // listen on ipv4 localhost + logT(t, "connFn: addr: %v, network: %v, port: %v", ln.Addr(), ln.Addr().Network(), (ln.Addr().(*net.TCPAddr)).Port) + // log("listener: %v", ln.Addr()) + checkErrT(t, err) + port = (ln.Addr().(*net.TCPAddr)).Port + // var opts *DecoderOptions + // opts := testDecOpts + // opts.MapType = mapStrIntfTyp + serverExitChan := make(chan bool, 1) + var serverExitFlag uint64 + serverFn := func() { + for { + conn1, err1 := ln.Accept() + // if err1 != nil { + // //fmt.Printf("accept err1: %v\n", err1) + // continue + // } + if atomic.LoadUint64(&serverExitFlag) == 1 { + serverExitChan <- true + if conn1 != nil { + conn1.Close() + } + return // exit serverFn goroutine + } + if err1 == nil && conn1 != nil { + sc := rr.ServerCodec(testReadWriteCloser(conn1), h) + srv.ServeCodec(sc) + } + } + } + + clientFn := func(cc rpc.ClientCodec) { + cl := rpc.NewClientWithCodec(cc) + defer cl.Close() + // defer func() { println("##### client closing"); cl.Close() }() + var up, sq, mult int + var rstr string + // log("Calling client") + checkErrT(t, cl.Call("TestRpcInt.Update", 5, &up)) + // log("Called TestRpcInt.Update") + checkEqualT(t, testRpcInt.i, 5, "testRpcInt.i=5") + checkEqualT(t, up, 5, "up=5") + checkErrT(t, cl.Call("TestRpcInt.Square", 1, &sq)) + checkEqualT(t, sq, 25, "sq=25") + checkErrT(t, cl.Call("TestRpcInt.Mult", 20, &mult)) + checkEqualT(t, mult, 100, "mult=100") + checkErrT(t, cl.Call("TestRpcInt.EchoStruct", TestRpcABC{"Aa", "Bb", "Cc"}, &rstr)) + checkEqualT(t, rstr, fmt.Sprintf("%#v", TestRpcABC{"Aa", "Bb", "Cc"}), "rstr=") + checkErrT(t, cl.Call("TestRpcInt.Echo123", []string{"A1", "B2", "C3"}, &rstr)) + checkEqualT(t, rstr, fmt.Sprintf("%#v", []string{"A1", "B2", "C3"}), "rstr=") + } + + connFn := func() (bs net.Conn) { + // log("calling f1") + bs, err2 := net.Dial(ln.Addr().Network(), ln.Addr().String()) + checkErrT(t, err2) + return + } + + exitFn := func() { + atomic.StoreUint64(&serverExitFlag, 1) + bs := connFn() + <-serverExitChan + bs.Close() + // serverExitChan <- true + } + + go serverFn() + runtime.Gosched() + //time.Sleep(100 * time.Millisecond) + if exitSleepMs == 0 { + defer ln.Close() + defer exitFn() + } + if doRequest { + bs := connFn() + cc := rr.ClientCodec(testReadWriteCloser(bs), h) + clientFn(cc) + } + if exitSleepMs != 0 { + go func() { + defer ln.Close() + time.Sleep(exitSleepMs) + exitFn() + }() + } + return +} + +func doTestMapEncodeForCanonical(t *testing.T, name string, h Handle) { + testOnce.Do(testInitAll) + // println("doTestMapEncodeForCanonical") + v1 := map[stringUint64T]interface{}{ + {"a", 1}: 1, + {"b", 2}: "hello", + {"c", 3}: map[string]interface{}{ + "c/a": 1, + "c/b": "world", + "c/c": []int{1, 2, 3, 4}, + "c/d": map[string]interface{}{ + "c/d/a": "fdisajfoidsajfopdjsaopfjdsapofda", + "c/d/b": "fdsafjdposakfodpsakfopdsakfpodsakfpodksaopfkdsopafkdopsa", + "c/d/c": "poir02 ir30qif4p03qir0pogjfpoaerfgjp ofke[padfk[ewapf kdp[afep[aw", + "c/d/d": "fdsopafkd[sa f-32qor-=4qeof -afo-erfo r-eafo 4e- o r4-qwo ag", + "c/d/e": "kfep[a sfkr0[paf[a foe-[wq ewpfao-q ro3-q ro-4qof4-qor 3-e orfkropzjbvoisdb", + "c/d/f": "", + }, + "c/e": map[int]string{ + 1: "1", + 22: "22", + 333: "333", + 4444: "4444", + 55555: "55555", + }, + "c/f": map[string]int{ + "1": 1, + "22": 22, + "333": 333, + "4444": 4444, + "55555": 55555, + }, + "c/g": map[bool]int{ + false: 0, + true: 1, + }, + }, + } + var v2 map[stringUint64T]interface{} + var b1, b2, b3 []byte + + // encode v1 into b1, decode b1 into v2, encode v2 into b2, and compare b1 and b2. + // OR + // encode v1 into b1, decode b1 into v2, encode v2 into b2 and b3, and compare b2 and b3. + // e.g. when doing cbor indefinite, we may haveto use out-of-band encoding + // where each key is encoded as an indefinite length string, which makes it not the same + // order as the strings were lexicographically ordered before. + + var cborIndef bool + if ch, ok := h.(*CborHandle); ok { + cborIndef = ch.IndefiniteLength + } + bh := basicHandle(h) + if !bh.Canonical { + bh.Canonical = true + defer func() { bh.Canonical = false }() + } + + e1 := NewEncoderBytes(&b1, h) + e1.MustEncode(v1) + d1 := NewDecoderBytes(b1, h) + d1.MustDecode(&v2) + // testDeepEqualErr(v1, v2, t, "huh?") + e2 := NewEncoderBytes(&b2, h) + e2.MustEncode(v2) + var b1t, b2t = b1, b2 + if cborIndef { + e2 = NewEncoderBytes(&b3, h) + e2.MustEncode(v2) + b1t, b2t = b2, b3 + } + + if !bytes.Equal(b1t, b2t) { + logT(t, "Unequal bytes: %v VS %v", b1t, b2t) + failT(t) + } +} + +func doTestStdEncIntf(t *testing.T, name string, h Handle) { + testOnce.Do(testInitAll) + args := [][2]interface{}{ + {&TestABC{"A", "BB", "CCC"}, new(TestABC)}, + {&TestABC2{"AAA", "BB", "C"}, new(TestABC2)}, + } + for _, a := range args { + var b []byte + e := NewEncoderBytes(&b, h) + e.MustEncode(a[0]) + d := NewDecoderBytes(b, h) + d.MustDecode(a[1]) + if err := deepEqual(a[0], a[1]); err == nil { + logT(t, "++++ Objects match") + } else { + logT(t, "---- FAIL: Objects do not match: y1: %v, err: %v", a[1], err) + failT(t) + } + } +} + +func doTestEncCircularRef(t *testing.T, name string, h Handle) { + testOnce.Do(testInitAll) + type T1 struct { + S string + B bool + T interface{} + } + type T2 struct { + S string + T *T1 + } + type T3 struct { + S string + T *T2 + } + t1 := T1{"t1", true, nil} + t2 := T2{"t2", &t1} + t3 := T3{"t3", &t2} + t1.T = &t3 + + var bs []byte + var err error + + bh := basicHandle(h) + if !bh.CheckCircularRef { + bh.CheckCircularRef = true + defer func() { bh.CheckCircularRef = false }() + } + err = NewEncoderBytes(&bs, h).Encode(&t3) + if err == nil { + logT(t, "expecting error due to circular reference. found none") + failT(t) + } + if x := err.Error(); strings.Contains(x, "circular") || strings.Contains(x, "cyclic") { + logT(t, "error detected as expected: %v", x) + } else { + logT(t, "FAIL: error detected was not as expected: %v", x) + failT(t) + } +} + +// TestAnonCycleT{1,2,3} types are used to test anonymous cycles. +// They are top-level, so that they can have circular references. +type ( + TestAnonCycleT1 struct { + S string + TestAnonCycleT2 + } + TestAnonCycleT2 struct { + S2 string + TestAnonCycleT3 + } + TestAnonCycleT3 struct { + *TestAnonCycleT1 + } +) + +func doTestAnonCycle(t *testing.T, name string, h Handle) { + testOnce.Do(testInitAll) + var x TestAnonCycleT1 + x.S = "hello" + x.TestAnonCycleT2.S2 = "hello.2" + x.TestAnonCycleT2.TestAnonCycleT3.TestAnonCycleT1 = &x + + // just check that you can get typeInfo for T1 + rt := reflect.TypeOf((*TestAnonCycleT1)(nil)).Elem() + rtid := rt2id(rt) + pti := basicHandle(h).getTypeInfo(rtid, rt) + logT(t, "pti: %v", pti) +} + +func doTestErrWriter(t *testing.T, name string, h Handle) { + var ew testErrWriter + w := bufio.NewWriterSize(&ew, 4) + enc := NewEncoder(w, h) + for i := 0; i < 4; i++ { + err := enc.Encode("ugorji") + if ev, ok := err.(encodeError); ok { + err = ev.Cause() + } + if err != testErrWriterErr { + logT(t, "%s: expecting err: %v, received: %v", name, testErrWriterErr, err) + failT(t) + } + } +} + +func doTestJsonLargeInteger(t *testing.T, v interface{}, ias uint8) { + testOnce.Do(testInitAll) + logT(t, "Running doTestJsonLargeInteger: v: %#v, ias: %c", v, ias) + oldIAS := testJsonH.IntegerAsString + defer func() { testJsonH.IntegerAsString = oldIAS }() + testJsonH.IntegerAsString = ias + + var vu uint + var vi int + var vb bool + var b []byte + e := NewEncoderBytes(&b, testJsonH) + e.MustEncode(v) + e.MustEncode(true) + d := NewDecoderBytes(b, testJsonH) + // below, we validate that the json string or number was encoded, + // then decode, and validate that the correct value was decoded. + fnStrChk := func() { + // check that output started with ", and ended with "true + if !(b[0] == '"' && string(b[len(b)-5:]) == `"true`) { + logT(t, "Expecting a JSON string, got: %s", b) + failT(t) + } + } + + switch ias { + case 'L': + switch v2 := v.(type) { + case int: + v2n := int64(v2) // done to work with 32-bit OS + if v2n > 1<<53 || (v2n < 0 && -v2n > 1<<53) { + fnStrChk() + } + case uint: + v2n := uint64(v2) // done to work with 32-bit OS + if v2n > 1<<53 { + fnStrChk() + } + } + case 'A': + fnStrChk() + default: + // check that output doesn't contain " at all + for _, i := range b { + if i == '"' { + logT(t, "Expecting a JSON Number without quotation: got: %s", b) + failT(t) + } + } + } + switch v2 := v.(type) { + case int: + d.MustDecode(&vi) + d.MustDecode(&vb) + // check that vb = true, and vi == v2 + if !(vb && vi == v2) { + logT(t, "Expecting equal values from %s: got golden: %v, decoded: %v", b, v2, vi) + failT(t) + } + case uint: + d.MustDecode(&vu) + d.MustDecode(&vb) + // check that vb = true, and vi == v2 + if !(vb && vu == v2) { + logT(t, "Expecting equal values from %s: got golden: %v, decoded: %v", b, v2, vu) + failT(t) + } + } +} + +func doTestRawValue(t *testing.T, name string, h Handle) { + testOnce.Do(testInitAll) + bh := basicHandle(h) + if !bh.Raw { + bh.Raw = true + defer func() { bh.Raw = false }() + } + + var i, i2 int + var v, v2 TestRawValue + var bs, bs2 []byte + + i = 1234 //1234567890 + v = TestRawValue{I: i} + e := NewEncoderBytes(&bs, h) + e.MustEncode(v.I) + logT(t, ">>> raw: %v\n", bs) + + v.R = Raw(bs) + e.ResetBytes(&bs2) + e.MustEncode(v) + + logT(t, ">>> bs2: %v\n", bs2) + d := NewDecoderBytes(bs2, h) + d.MustDecode(&v2) + d.ResetBytes(v2.R) + logT(t, ">>> v2.R: %v\n", ([]byte)(v2.R)) + d.MustDecode(&i2) + + logT(t, ">>> Encoded %v, decoded %v\n", i, i2) + // logT(t, "Encoded %v, decoded %v", i, i2) + if i != i2 { + logT(t, "Error: encoded %v, decoded %v", i, i2) + failT(t) + } +} + +// Comprehensive testing that generates data encoded from python handle (cbor, msgpack), +// and validates that our code can read and write it out accordingly. +// We keep this unexported here, and put actual test in ext_dep_test.go. +// This way, it can be excluded by excluding file completely. +func doTestPythonGenStreams(t *testing.T, name string, h Handle) { + testOnce.Do(testInitAll) + logT(t, "TestPythonGenStreams-%v", name) + tmpdir, err := ioutil.TempDir("", "golang-"+name+"-test") + if err != nil { + logT(t, "-------- Unable to create temp directory\n") + failT(t) + } + defer os.RemoveAll(tmpdir) + logT(t, "tmpdir: %v", tmpdir) + cmd := exec.Command("python", "test.py", "testdata", tmpdir) + //cmd.Stdin = strings.NewReader("some input") + //cmd.Stdout = &out + var cmdout []byte + if cmdout, err = cmd.CombinedOutput(); err != nil { + logT(t, "-------- Error running test.py testdata. Err: %v", err) + logT(t, " %v", string(cmdout)) + failT(t) + } + + bh := basicHandle(h) + + oldMapType := bh.MapType + tablePythonVerify := testTableVerify(testVerifyForPython|testVerifyTimeAsInteger|testVerifyMapTypeStrIntf, h) + for i, v := range tablePythonVerify { + // if v == uint64(0) && h == testMsgpackH { + // v = int64(0) + // } + bh.MapType = oldMapType + //load up the golden file based on number + //decode it + //compare to in-mem object + //encode it again + //compare to output stream + logT(t, "..............................................") + logT(t, " Testing: #%d: %T, %#v\n", i, v, v) + var bss []byte + bss, err = ioutil.ReadFile(filepath.Join(tmpdir, strconv.Itoa(i)+"."+name+".golden")) + if err != nil { + logT(t, "-------- Error reading golden file: %d. Err: %v", i, err) + failT(t) + continue + } + bh.MapType = testMapStrIntfTyp + + var v1 interface{} + if err = testUnmarshal(&v1, bss, h); err != nil { + logT(t, "-------- Error decoding stream: %d: Err: %v", i, err) + failT(t) + continue + } + if v == skipVerifyVal { + continue + } + //no need to indirect, because we pass a nil ptr, so we already have the value + //if v1 != nil { v1 = reflect.Indirect(reflect.ValueOf(v1)).Interface() } + if err = deepEqual(v, v1); err == nil { + logT(t, "++++++++ Objects match: %T, %v", v, v) + } else { + logT(t, "-------- FAIL: Objects do not match: %v. Source: %T. Decoded: %T", err, v, v1) + logT(t, "-------- GOLDEN: %#v", v) + // logT(t, "-------- DECODED: %#v <====> %#v", v1, reflect.Indirect(reflect.ValueOf(v1)).Interface()) + logT(t, "-------- DECODED: %#v <====> %#v", v1, reflect.Indirect(reflect.ValueOf(v1)).Interface()) + failT(t) + } + bsb, err := testMarshal(v1, h) + if err != nil { + logT(t, "Error encoding to stream: %d: Err: %v", i, err) + failT(t) + continue + } + if err = deepEqual(bsb, bss); err == nil { + logT(t, "++++++++ Bytes match") + } else { + logT(t, "???????? FAIL: Bytes do not match. %v.", err) + xs := "--------" + if reflect.ValueOf(v).Kind() == reflect.Map { + xs = " " + logT(t, "%s It's a map. Ok that they don't match (dependent on ordering).", xs) + } else { + logT(t, "%s It's not a map. They should match.", xs) + failT(t) + } + logT(t, "%s FROM_FILE: %4d] %v", xs, len(bss), bss) + logT(t, "%s ENCODED: %4d] %v", xs, len(bsb), bsb) + } + } + bh.MapType = oldMapType +} + +// To test MsgpackSpecRpc, we test 3 scenarios: +// - Go Client to Go RPC Service (contained within TestMsgpackRpcSpec) +// - Go client to Python RPC Service (contained within doTestMsgpackRpcSpecGoClientToPythonSvc) +// - Python Client to Go RPC Service (contained within doTestMsgpackRpcSpecPythonClientToGoSvc) +// +// This allows us test the different calling conventions +// - Go Service requires only one argument +// - Python Service allows multiple arguments + +func doTestMsgpackRpcSpecGoClientToPythonSvc(t *testing.T) { + if testSkipRPCTests { + return + } + testOnce.Do(testInitAll) + // openPorts are between 6700 and 6800 + r := rand.New(rand.NewSource(time.Now().UnixNano())) + openPort := strconv.FormatInt(6700+r.Int63n(99), 10) + // openPort := "6792" + cmd := exec.Command("python", "test.py", "rpc-server", openPort, "4") + checkErrT(t, cmd.Start()) + bs, err2 := net.Dial("tcp", ":"+openPort) + for i := 0; i < 10 && err2 != nil; i++ { + time.Sleep(50 * time.Millisecond) // time for python rpc server to start + bs, err2 = net.Dial("tcp", ":"+openPort) + } + checkErrT(t, err2) + cc := MsgpackSpecRpc.ClientCodec(testReadWriteCloser(bs), testMsgpackH) + cl := rpc.NewClientWithCodec(cc) + defer cl.Close() + var rstr string + checkErrT(t, cl.Call("EchoStruct", TestRpcABC{"Aa", "Bb", "Cc"}, &rstr)) + //checkEqualT(t, rstr, "{'A': 'Aa', 'B': 'Bb', 'C': 'Cc'}") + var mArgs MsgpackSpecRpcMultiArgs = []interface{}{"A1", "B2", "C3"} + checkErrT(t, cl.Call("Echo123", mArgs, &rstr)) + checkEqualT(t, rstr, "1:A1 2:B2 3:C3", "rstr=") + cmd.Process.Kill() +} + +func doTestMsgpackRpcSpecPythonClientToGoSvc(t *testing.T) { + if testSkipRPCTests { + return + } + testOnce.Do(testInitAll) + port := testCodecRpcOne(t, MsgpackSpecRpc, testMsgpackH, false, 1*time.Second) + //time.Sleep(1000 * time.Millisecond) + cmd := exec.Command("python", "test.py", "rpc-client-go-service", strconv.Itoa(port)) + var cmdout []byte + var err error + if cmdout, err = cmd.CombinedOutput(); err != nil { + logT(t, "-------- Error running test.py rpc-client-go-service. Err: %v", err) + logT(t, " %v", string(cmdout)) + failT(t) + } + checkEqualT(t, string(cmdout), + fmt.Sprintf("%#v\n%#v\n", []string{"A1", "B2", "C3"}, TestRpcABC{"Aa", "Bb", "Cc"}), "cmdout=") +} + +func doTestSwallowAndZero(t *testing.T, h Handle) { + testOnce.Do(testInitAll) + v1 := newTestStrucFlex(testDepth, testNumRepeatString, false, false, false) + var b1 []byte + + e1 := NewEncoderBytes(&b1, h) + e1.MustEncode(v1) + d1 := NewDecoderBytes(b1, h) + d1.swallow() + if d1.r.numread() != uint(len(b1)) { + logT(t, "swallow didn't consume all encoded bytes: %v out of %v", d1.r.numread(), len(b1)) + failT(t) + } + setZero(v1) + testDeepEqualErr(v1, &TestStrucFlex{}, t, "filled-and-zeroed") +} + +func doTestRawExt(t *testing.T, h Handle) { + testOnce.Do(testInitAll) + var b []byte + var v RawExt // interface{} + _, isJson := h.(*JsonHandle) + _, isCbor := h.(*CborHandle) + bh := basicHandle(h) + // isValuer := isJson || isCbor + // _ = isValuer + for _, r := range []RawExt{ + {Tag: 99, Value: "9999", Data: []byte("9999")}, + } { + e := NewEncoderBytes(&b, h) + e.MustEncode(&r) + // fmt.Printf(">>>> rawext: isnil? %v, %d - %v\n", b == nil, len(b), b) + d := NewDecoderBytes(b, h) + d.MustDecode(&v) + var r2 = r + switch { + case isJson: + r2.Tag = 0 + r2.Data = nil + case isCbor: + r2.Data = nil + default: + r2.Value = nil + } + testDeepEqualErr(v, r2, t, "rawext-default") + // switch h.(type) { + // case *JsonHandle: + // testDeepEqualErr(r.Value, v, t, "rawext-json") + // default: + // var r2 = r + // if isValuer { + // r2.Data = nil + // } else { + // r2.Value = nil + // } + // testDeepEqualErr(v, r2, t, "rawext-default") + // } + } + + // Add testing for Raw also + if b != nil { + b = b[:0] + } + oldRawMode := bh.Raw + defer func() { bh.Raw = oldRawMode }() + bh.Raw = true + + var v2 Raw + for _, s := range []string{ + "goodbye", + "hello", + } { + e := NewEncoderBytes(&b, h) + e.MustEncode(&s) + // fmt.Printf(">>>> rawext: isnil? %v, %d - %v\n", b == nil, len(b), b) + var r Raw = make([]byte, len(b)) + copy(r, b) + d := NewDecoderBytes(b, h) + d.MustDecode(&v2) + testDeepEqualErr(v2, r, t, "raw-default") + } + +} + +// func doTestTimeExt(t *testing.T, h Handle) { +// var t = time.Now() +// // add time ext to the handle +// } + +func doTestMapStructKey(t *testing.T, h Handle) { + testOnce.Do(testInitAll) + var b []byte + var v interface{} // map[stringUint64T]wrapUint64Slice // interface{} + bh := basicHandle(h) + m := map[stringUint64T]wrapUint64Slice{ + {"55555", 55555}: []wrapUint64{12345}, + {"333", 333}: []wrapUint64{123}, + } + oldCanonical := bh.Canonical + oldMapType := bh.MapType + defer func() { + bh.Canonical = oldCanonical + bh.MapType = oldMapType + }() + + bh.MapType = reflect.TypeOf((*map[stringUint64T]wrapUint64Slice)(nil)).Elem() + for _, bv := range [2]bool{true, false} { + b, v = nil, nil + bh.Canonical = bv + e := NewEncoderBytes(&b, h) + e.MustEncode(m) + d := NewDecoderBytes(b, h) + d.MustDecode(&v) + testDeepEqualErr(v, m, t, "map-structkey") + } +} + +func doTestDecodeNilMapValue(t *testing.T, h Handle) { + testOnce.Do(testInitAll) + type Struct struct { + Field map[uint16]map[uint32]struct{} + } + + bh := basicHandle(h) + oldMapType := bh.MapType + oldDeleteOnNilMapValue := bh.DeleteOnNilMapValue + defer func() { + bh.MapType = oldMapType + bh.DeleteOnNilMapValue = oldDeleteOnNilMapValue + }() + bh.MapType = reflect.TypeOf(map[interface{}]interface{}(nil)) + bh.DeleteOnNilMapValue = false + + _, isJsonHandle := h.(*JsonHandle) + + toEncode := Struct{Field: map[uint16]map[uint32]struct{}{ + 1: nil, + }} + + bs, err := testMarshal(toEncode, h) + if err != nil { + logT(t, "Error encoding: %v, Err: %v", toEncode, err) + failT(t) + } + if isJsonHandle { + logT(t, "json encoded: %s\n", bs) + } + + var decoded Struct + err = testUnmarshal(&decoded, bs, h) + if err != nil { + logT(t, "Error decoding: %v", err) + failT(t) + } + if !reflect.DeepEqual(decoded, toEncode) { + logT(t, "Decoded value %#v != %#v", decoded, toEncode) + failT(t) + } +} + +func doTestEmbeddedFieldPrecedence(t *testing.T, h Handle) { + testOnce.Do(testInitAll) + type Embedded struct { + Field byte + } + type Struct struct { + Field byte + Embedded + } + toEncode := Struct{ + Field: 1, + Embedded: Embedded{Field: 2}, + } + _, isJsonHandle := h.(*JsonHandle) + handle := basicHandle(h) + oldMapType := handle.MapType + defer func() { handle.MapType = oldMapType }() + + handle.MapType = reflect.TypeOf(map[interface{}]interface{}(nil)) + + bs, err := testMarshal(toEncode, h) + if err != nil { + logT(t, "Error encoding: %v, Err: %v", toEncode, err) + failT(t) + } + + var decoded Struct + err = testUnmarshal(&decoded, bs, h) + if err != nil { + logT(t, "Error decoding: %v", err) + failT(t) + } + + if decoded.Field != toEncode.Field { + logT(t, "Decoded result %v != %v", decoded.Field, toEncode.Field) // hex to look at what was encoded + if isJsonHandle { + logT(t, "JSON encoded as: %s", bs) // hex to look at what was encoded + } + failT(t) + } +} + +func doTestLargeContainerLen(t *testing.T, h Handle) { + testOnce.Do(testInitAll) + m := make(map[int][]struct{}) + for i := range []int{ + 0, 1, + math.MaxInt8, math.MaxInt8 + 4, math.MaxInt8 - 4, + math.MaxInt16, math.MaxInt16 + 4, math.MaxInt16 - 4, + math.MaxInt32, math.MaxInt32 - 4, + // math.MaxInt32 + 4, // bombs on 32-bit + // math.MaxInt64, math.MaxInt64 - 4, // bombs on 32-bit + + math.MaxUint8, math.MaxUint8 + 4, math.MaxUint8 - 4, + math.MaxUint16, math.MaxUint16 + 4, math.MaxUint16 - 4, + // math.MaxUint32, math.MaxUint32 + 4, math.MaxUint32 - 4, // bombs on 32-bit + } { + m[i] = make([]struct{}, i) + } + bs := testMarshalErr(m, h, t, "-") + var m2 = make(map[int][]struct{}) + testUnmarshalErr(m2, bs, h, t, "-") + testDeepEqualErr(m, m2, t, "-") + + // do same tests for large strings (encoded as symbols or not) + // skip if 32-bit or not using unsafe mode + if safeMode || (32<<(^uint(0)>>63)) < 64 { + return + } + + // now, want to do tests for large strings, which + // could be encoded as symbols. + // to do this, we create a simple one-field struct, + // use use flags to switch from symbols to non-symbols + + hbinc, okbinc := h.(*BincHandle) + if okbinc { + oldAsSymbols := hbinc.AsSymbols + defer func() { hbinc.AsSymbols = oldAsSymbols }() + } + var out []byte = make([]byte, 0, math.MaxUint16*3/2) + var in []byte = make([]byte, math.MaxUint16*3/2) + for i := range in { + in[i] = 'A' + } + e := NewEncoder(nil, h) + for _, i := range []int{ + 0, 1, 4, 8, 12, 16, 28, 32, 36, + math.MaxInt8, math.MaxInt8 + 4, math.MaxInt8 - 4, + math.MaxInt16, math.MaxInt16 + 4, math.MaxInt16 - 4, + + math.MaxUint8, math.MaxUint8 + 4, math.MaxUint8 - 4, + math.MaxUint16, math.MaxUint16 + 4, math.MaxUint16 - 4, + } { + var m1, m2 map[string]bool + m1 = make(map[string]bool, 1) + var s1 = stringView(in[:i]) + // fmt.Printf("testcontainerlen: large string: i: %v, |%s|\n", i, s1) + m1[s1] = true + + if okbinc { + hbinc.AsSymbols = 2 + } + out = out[:0] + e.ResetBytes(&out) + e.MustEncode(m1) + // bs, _ = testMarshalErr(m1, h, t, "-") + m2 = make(map[string]bool, 1) + testUnmarshalErr(m2, out, h, t, "no-symbols") + testDeepEqualErr(m1, m2, t, "no-symbols") + + if okbinc { + // now, do as symbols + hbinc.AsSymbols = 1 + out = out[:0] + e.ResetBytes(&out) + e.MustEncode(m1) + // bs, _ = testMarshalErr(m1, h, t, "-") + m2 = make(map[string]bool, 1) + testUnmarshalErr(m2, out, h, t, "symbols") + testDeepEqualErr(m1, m2, t, "symbols") + } + } + +} + +func testRandomFillRV(v reflect.Value) { + testOnce.Do(testInitAll) + fneg := func() int64 { + i := rand.Intn(1) + if i == 1 { + return 1 + } + return -1 + } + + switch v.Kind() { + case reflect.Invalid: + case reflect.Ptr: + if v.IsNil() { + v.Set(reflect.New(v.Type().Elem())) + } + testRandomFillRV(v.Elem()) + case reflect.Interface: + if v.IsNil() { + v.Set(reflect.ValueOf("nothing")) + } else { + testRandomFillRV(v.Elem()) + } + case reflect.Struct: + for i, n := 0, v.NumField(); i < n; i++ { + testRandomFillRV(v.Field(i)) + } + case reflect.Slice: + if v.IsNil() { + v.Set(reflect.MakeSlice(v.Type(), 4, 4)) + } + fallthrough + case reflect.Array: + for i, n := 0, v.Len(); i < n; i++ { + testRandomFillRV(v.Index(i)) + } + case reflect.Map: + if v.IsNil() { + v.Set(reflect.MakeMap(v.Type())) + } + if v.Len() == 0 { + kt, vt := v.Type().Key(), v.Type().Elem() + for i := 0; i < 4; i++ { + k0 := reflect.New(kt).Elem() + v0 := reflect.New(vt).Elem() + testRandomFillRV(k0) + testRandomFillRV(v0) + v.SetMapIndex(k0, v0) + } + } else { + for _, k := range v.MapKeys() { + testRandomFillRV(v.MapIndex(k)) + } + } + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + v.SetInt(fneg() * rand.Int63n(127)) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + v.SetUint(uint64(rand.Int63n(255))) + case reflect.Bool: + v.SetBool(fneg() == 1) + case reflect.Float32, reflect.Float64: + v.SetFloat(float64(fneg()) * float64(rand.Float32())) + case reflect.String: + // ensure this string can test the extent of json string decoding + v.SetString(strings.Repeat(strconv.FormatInt(rand.Int63n(99), 10), rand.Intn(8)) + + "- ABC \x41=\x42 \u2318 - \r \b \f - \u2028 and \u2029 .") + default: + panic(fmt.Errorf("testRandomFillRV: unsupported type: %v", v.Kind())) + } +} + +func testMammoth(t *testing.T, name string, h Handle) { + testOnce.Do(testInitAll) + var b []byte + + var m, m2 TestMammoth + testRandomFillRV(reflect.ValueOf(&m).Elem()) + b = testMarshalErr(&m, h, t, "mammoth-"+name) + testUnmarshalErr(&m2, b, h, t, "mammoth-"+name) + testDeepEqualErr(&m, &m2, t, "mammoth-"+name) + + var mm, mm2 TestMammoth2Wrapper + testRandomFillRV(reflect.ValueOf(&mm).Elem()) + b = testMarshalErr(&mm, h, t, "mammoth2-"+name) + testUnmarshalErr(&mm2, b, h, t, "mammoth2-"+name) + testDeepEqualErr(&mm, &mm2, t, "mammoth2-"+name) + // testMammoth2(t, name, h) +} + +func testTime(t *testing.T, name string, h Handle) { + testOnce.Do(testInitAll) + // test time which uses the time.go implementation (ie Binc) + var tt, tt2 time.Time + // time in 1990 + tt = time.Unix(20*366*24*60*60, 1000*900).In(time.FixedZone("UGO", -5*60*60)) + // fmt.Printf("time tt: %v\n", tt) + b := testMarshalErr(tt, h, t, "time-"+name) + testUnmarshalErr(&tt2, b, h, t, "time-"+name) + // per go documentation, test time with .Equal not == + if !tt2.Equal(tt) { + logT(t, "%s: values not equal: 1: %v, 2: %v", name, tt2, tt) + failT(t) + } + // testDeepEqualErr(tt.UTC(), tt2, t, "time-"+name) +} + +func testUintToInt(t *testing.T, name string, h Handle) { + testOnce.Do(testInitAll) + var golden = [...]int64{ + 0, 1, 22, 333, 4444, 55555, 666666, + // msgpack ones + 24, 128, + // standard ones + math.MaxUint8, math.MaxUint8 + 4, math.MaxUint8 - 4, + math.MaxUint16, math.MaxUint16 + 4, math.MaxUint16 - 4, + math.MaxUint32, math.MaxUint32 + 4, math.MaxUint32 - 4, + math.MaxInt8, math.MaxInt8 + 4, math.MaxInt8 - 4, + math.MaxInt16, math.MaxInt16 + 4, math.MaxInt16 - 4, + math.MaxInt32, math.MaxInt32 + 4, math.MaxInt32 - 4, + math.MaxInt64, math.MaxInt64 - 4, + } + var ui uint64 + var fi float64 + var b []byte + for _, i := range golden { + ui = 0 + b = testMarshalErr(i, h, t, "int2uint-"+name) + testUnmarshalErr(&ui, b, h, t, "int2uint-"+name) + if ui != uint64(i) { + logT(t, "%s: values not equal: %v, %v", name, ui, uint64(i)) + failT(t) + } + i = 0 + b = testMarshalErr(ui, h, t, "uint2int-"+name) + testUnmarshalErr(&i, b, h, t, "uint2int-"+name) + if i != int64(ui) { + logT(t, "%s: values not equal: %v, %v", name, i, int64(ui)) + failT(t) + } + fi = 0 + b = testMarshalErr(i, h, t, "int2float-"+name) + testUnmarshalErr(&fi, b, h, t, "int2float-"+name) + if fi != float64(i) { + logT(t, "%s: values not equal: %v, %v", name, fi, float64(i)) + failT(t) + } + } +} + +func doTestDifferentMapOrSliceType(t *testing.T, name string, h Handle) { + testOnce.Do(testInitAll) + + // - maptype, slicetype: diff from map[string]intf, map[intf]intf or []intf, etc + // include map[interface{}]string where some keys are []byte. + // To test, take a sequence of []byte and string, and decode into []string and []interface. + // Also, decode into map[string]string, map[string]interface{}, map[interface{}]string + + bh := basicHandle(h) + oldM, oldS := bh.MapType, bh.SliceType + defer func() { bh.MapType, bh.SliceType = oldM, oldS }() + + var b []byte + + var vi = []interface{}{ + "hello 1", + []byte("hello 2"), + "hello 3", + []byte("hello 4"), + "hello 5", + } + var vs []string + var v2i, v2s testMbsT + var v2ss testMbsCustStrT + // encode it as a map or as a slice + for i, v := range vi { + vv, ok := v.(string) + if !ok { + vv = string(v.([]byte)) + } + vs = append(vs, vv) + v2i = append(v2i, v, strconv.FormatInt(int64(i+1), 10)) + v2s = append(v2s, vv, strconv.FormatInt(int64(i+1), 10)) + v2ss = append(v2ss, testCustomStringT(vv), testCustomStringT(strconv.FormatInt(int64(i+1), 10))) + } + + var v2d interface{} + + // encode vs as a list, and decode into a list and compare + var goldSliceS = []string{"hello 1", "hello 2", "hello 3", "hello 4", "hello 5"} + var goldSliceI = []interface{}{"hello 1", "hello 2", "hello 3", "hello 4", "hello 5"} + var goldSlice = []interface{}{goldSliceS, goldSliceI} + for j, g := range goldSlice { + bh.SliceType = reflect.TypeOf(g) + name := fmt.Sprintf("slice-%s-%v", name, j+1) + b = testMarshalErr(vs, h, t, name) + v2d = nil + // v2d = reflect.New(bh.SliceType).Elem().Interface() + testUnmarshalErr(&v2d, b, h, t, name) + testDeepEqualErr(v2d, goldSlice[j], t, name) + } + + // to ensure that we do not use fast-path for map[intf]string, use a custom string type (for goldMapIS). + // this will allow us to test out the path that sees a []byte where a map has an interface{} type, + // and convert it to a string for the decoded map key. + + // encode v2i as a map, and decode into a map and compare + var goldMapSS = map[string]string{"hello 1": "1", "hello 2": "2", "hello 3": "3", "hello 4": "4", "hello 5": "5"} + var goldMapSI = map[string]interface{}{"hello 1": "1", "hello 2": "2", "hello 3": "3", "hello 4": "4", "hello 5": "5"} + var goldMapIS = map[interface{}]testCustomStringT{"hello 1": "1", "hello 2": "2", "hello 3": "3", "hello 4": "4", "hello 5": "5"} + var goldMap = []interface{}{goldMapSS, goldMapSI, goldMapIS} + for j, g := range goldMap { + bh.MapType = reflect.TypeOf(g) + name := fmt.Sprintf("map-%s-%v", name, j+1) + // for formats that clearly differentiate binary from string, use v2i + // else use the v2s (with all strings, no []byte) + v2d = nil + // v2d = reflect.New(bh.MapType).Elem().Interface() + switch h.(type) { + case *MsgpackHandle, *BincHandle, *CborHandle: + b = testMarshalErr(v2i, h, t, name) + testUnmarshalErr(&v2d, b, h, t, name) + testDeepEqualErr(v2d, goldMap[j], t, name) + default: + b = testMarshalErr(v2s, h, t, name) + testUnmarshalErr(&v2d, b, h, t, name) + testDeepEqualErr(v2d, goldMap[j], t, name) + b = testMarshalErr(v2ss, h, t, name) + v2d = nil + testUnmarshalErr(&v2d, b, h, t, name) + testDeepEqualErr(v2d, goldMap[j], t, name) + } + } + +} + +func doTestScalars(t *testing.T, name string, h Handle) { + testOnce.Do(testInitAll) + + // for each scalar: + // - encode its ptr + // - encode it (non-ptr) + // - check that bytes are same + // - make a copy (using reflect) + // - check that same + // - set zero on it + // - check that its equal to 0 value + // - decode into new + // - compare to original + + bh := basicHandle(h) + if !bh.Canonical { + bh.Canonical = true + defer func() { bh.Canonical = false }() + } + + vi := []interface{}{ + int(0), + int8(0), + int16(0), + int32(0), + int64(0), + uint(0), + uint8(0), + uint16(0), + uint32(0), + uint64(0), + uintptr(0), + float32(0), + float64(0), + bool(false), + string(""), + []byte(nil), + } + for _, v := range fastpathAV { + vi = append(vi, reflect.Zero(v.rt).Interface()) + } + for _, v := range vi { + rv := reflect.New(reflect.TypeOf(v)).Elem() + testRandomFillRV(rv) + v = rv.Interface() + + rv2 := reflect.New(rv.Type()) + rv2.Elem().Set(rv) + vp := rv2.Interface() + + var tname string + switch rv.Kind() { + case reflect.Map: + tname = "map[" + rv.Type().Key().Name() + "]" + rv.Type().Elem().Name() + case reflect.Slice: + tname = "[]" + rv.Type().Elem().Name() + default: + tname = rv.Type().Name() + } + + var b, b1, b2 []byte + b1 = testMarshalErr(v, h, t, tname+"-enc") + // store b1 into b, as b1 slice is reused for next marshal + b = make([]byte, len(b1)) + copy(b, b1) + b2 = testMarshalErr(vp, h, t, tname+"-enc-ptr") + testDeepEqualErr(b1, b2, t, tname+"-enc-eq") + setZero(vp) + testDeepEqualErr(rv2.Elem().Interface(), reflect.Zero(rv.Type()).Interface(), t, tname+"-enc-eq-zero-ref") + + vp = rv2.Interface() + testUnmarshalErr(vp, b, h, t, tname+"-dec") + testDeepEqualErr(rv2.Elem().Interface(), v, t, tname+"-dec-eq") + } +} + +func doTestIntfMapping(t *testing.T, name string, h Handle) { + testOnce.Do(testInitAll) + rti := reflect.TypeOf((*testIntfMapI)(nil)).Elem() + defer func() { basicHandle(h).Intf2Impl(rti, nil) }() + + type T9 struct { + I testIntfMapI + } + + for i, v := range []testIntfMapI{ + // Use a valid string to test some extents of json string decoding + &testIntfMapT1{"ABC \x41=\x42 \u2318 - \r \b \f - \u2028 and \u2029 ."}, + testIntfMapT2{"DEF"}, + } { + if err := basicHandle(h).Intf2Impl(rti, reflect.TypeOf(v)); err != nil { + failT(t, "Error mapping %v to %T", rti, v) + } + var v1, v2 T9 + v1 = T9{v} + b := testMarshalErr(v1, h, t, name+"-enc-"+strconv.Itoa(i)) + testUnmarshalErr(&v2, b, h, t, name+"-dec-"+strconv.Itoa(i)) + testDeepEqualErr(v1, v2, t, name+"-dec-eq-"+strconv.Itoa(i)) + } +} + +func doTestOmitempty(t *testing.T, name string, h Handle) { + testOnce.Do(testInitAll) + if basicHandle(h).StructToArray { + t.Skipf("Skipping OmitEmpty test when StructToArray=true") + } + type T1 struct { + A int `codec:"a"` + B *int `codec:"b,omitempty"` + C int `codec:"c,omitempty"` + } + type T2 struct { + A int `codec:"a"` + } + var v1 T1 + var v2 T2 + b1 := testMarshalErr(v1, h, t, name+"-omitempty") + b2 := testMarshalErr(v2, h, t, name+"-no-omitempty-trunc") + testDeepEqualErr(b1, b2, t, name+"-omitempty-cmp") +} + +func doTestMissingFields(t *testing.T, name string, h Handle) { + testOnce.Do(testInitAll) + if codecgen { + t.Skipf("Skipping Missing Fields tests as it is not honored by codecgen") + } + if basicHandle(h).StructToArray { + t.Skipf("Skipping Missing Fields test when StructToArray=true") + } + // encode missingFielderT2, decode into missingFielderT1, encode it out again, decode into new missingFielderT2, compare + v1 := missingFielderT2{S: "true seven eight", B: true, F: 777.0, I: -888} + b1 := testMarshalErr(v1, h, t, name+"-missing-enc-2") + // xdebugf("marshal into b1: %s", b1) + var v2 missingFielderT1 + testUnmarshalErr(&v2, b1, h, t, name+"-missing-dec-1") + // xdebugf("unmarshal into v2: %v", v2) + b2 := testMarshalErr(&v2, h, t, name+"-missing-enc-1") + // xdebugf("marshal into b2: %s", b2) + var v3 missingFielderT2 + testUnmarshalErr(&v3, b2, h, t, name+"-missing-dec-2") + // xdebugf("unmarshal into v3: %v", v3) + testDeepEqualErr(v1, v3, t, name+"-missing-cmp-2") +} + +func doTestMaxDepth(t *testing.T, name string, h Handle) { + testOnce.Do(testInitAll) + type T struct { + I interface{} // value to encode + M int16 // maxdepth + S bool // use swallow (decode into typed struct with only A1) + E interface{} // error to find + } + type T1 struct { + A1 *T1 + } + var table []T + var sfunc = func(n int) (s [1]interface{}, s1 *[1]interface{}) { + s1 = &s + for i := 0; i < n; i++ { + var s0 [1]interface{} + s1[0] = &s0 + s1 = &s0 + } + // xdebugf("sfunc s: %v", s) + return + // var s []interface{} + // s = append(s, []interface{}) + // s[0] = append(s[0], []interface{}) + // s[0][0] = append(s[0][0], []interface{}) + // s[0][0][0] = append(s[0][0][0], []interface{}) + // s[0][0][0][0] = append(s[0][0][0][0], []interface{}) + // return s + } + var mfunc = func(n int) (m map[string]interface{}, mlast map[string]interface{}) { + m = make(map[string]interface{}) + mlast = make(map[string]interface{}) + m["A0"] = mlast + for i := 1; i < n; i++ { + m0 := make(map[string]interface{}) + mlast["A"+strconv.FormatInt(int64(i), 10)] = m0 + mlast = m0 + } + // xdebugf("mfunc m: %v", m) + return + } + s, s1 := sfunc(5) + m, _ := mfunc(5) + m99, _ := mfunc(99) + + s1[0] = m + + table = append(table, T{s, 0, false, nil}) + table = append(table, T{s, 256, false, nil}) + table = append(table, T{s, 7, false, errMaxDepthExceeded}) + table = append(table, T{s, 15, false, nil}) + table = append(table, T{m99, 15, true, errMaxDepthExceeded}) + table = append(table, T{m99, 215, true, nil}) + + defer func(n int16, b bool) { + basicHandle(h).MaxDepth = n + testUseMust = b + }(basicHandle(h).MaxDepth, testUseMust) + + testUseMust = false + for i, v := range table { + basicHandle(h).MaxDepth = v.M + b1 := testMarshalErr(v.I, h, t, name+"-maxdepth-enc"+strconv.FormatInt(int64(i), 10)) + // xdebugf("b1: %s", b1) + var err error + if v.S { + var v2 T1 + err = testUnmarshal(&v2, b1, h) + } else { + var v2 interface{} + err = testUnmarshal(&v2, b1, h) + } + if err1, ok := err.(decodeError); ok { + err = err1.codecError + } + var err0 interface{} = err + if err1, ok := err.(codecError); ok { + err0 = err1.err + } + if err0 != v.E { + failT(t, "Unexpected error testing max depth for depth %d: expected %v, received %v", v.M, v.E, err) + } + + // decode into something that just triggers swallow + } +} + +func doTestMultipleEncDec(t *testing.T, name string, h Handle) { + testOnce.Do(testInitAll) + // encode a string multiple times. + // decode it multiple times. + // ensure we get the value each time + var s1 = "ugorji" + var s2 = "nwoke" + var s11, s21 string + var buf bytes.Buffer + e := NewEncoder(&buf, h) + e.MustEncode(s1) + e.MustEncode(s2) + d := NewDecoder(&buf, h) + d.MustDecode(&s11) + d.MustDecode(&s21) + testDeepEqualErr(s1, s11, t, name+"-multiple-encode") + testDeepEqualErr(s2, s21, t, name+"-multiple-encode") +} + +// ----------------- + +func TestJsonDecodeNonStringScalarInStringContext(t *testing.T) { + testOnce.Do(testInitAll) + var b = `{"s.true": "true", "b.true": true, "s.false": "false", "b.false": false, "s.10": "10", "i.10": 10, "i.-10": -10}` + var golden = map[string]string{"s.true": "true", "b.true": "true", "s.false": "false", "b.false": "false", "s.10": "10", "i.10": "10", "i.-10": "-10"} + + var m map[string]string + d := NewDecoderBytes([]byte(b), testJsonH) + d.MustDecode(&m) + if err := deepEqual(golden, m); err == nil { + logT(t, "++++ match: decoded: %#v", m) + } else { + logT(t, "---- mismatch: %v ==> golden: %#v, decoded: %#v", err, golden, m) + failT(t) + } +} + +func TestJsonEncodeIndent(t *testing.T) { + testOnce.Do(testInitAll) + v := TestSimplish{ + Ii: -794, + Ss: `A Man is +after the new line + after new line and tab +`, + } + v2 := v + v.Mm = make(map[string]*TestSimplish) + for i := 0; i < len(v.Ar); i++ { + v3 := v2 + v3.Ii += (i * 4) + v3.Ss = fmt.Sprintf("%d - %s", v3.Ii, v3.Ss) + if i%2 == 0 { + v.Ar[i] = &v3 + } + // v3 = v2 + v.Sl = append(v.Sl, &v3) + v.Mm[strconv.FormatInt(int64(i), 10)] = &v3 + } + oldcan := testJsonH.Canonical + oldIndent := testJsonH.Indent + oldS2A := testJsonH.StructToArray + defer func() { + testJsonH.Canonical = oldcan + testJsonH.Indent = oldIndent + testJsonH.StructToArray = oldS2A + }() + testJsonH.Canonical = true + testJsonH.Indent = -1 + testJsonH.StructToArray = false + var bs []byte + NewEncoderBytes(&bs, testJsonH).MustEncode(&v) + txt1Tab := string(bs) + bs = nil + testJsonH.Indent = 120 + NewEncoderBytes(&bs, testJsonH).MustEncode(&v) + txtSpaces := string(bs) + // fmt.Printf("\n-----------\n%s\n------------\n%s\n-------------\n", txt1Tab, txtSpaces) + + goldenResultTab := `{ + "Ar": [ + { + "Ar": [ + null, + null + ], + "Ii": -794, + "Mm": null, + "Sl": null, + "Ss": "-794 - A Man is\nafter the new line\n\tafter new line and tab\n" + }, + null + ], + "Ii": -794, + "Mm": { + "0": { + "Ar": [ + null, + null + ], + "Ii": -794, + "Mm": null, + "Sl": null, + "Ss": "-794 - A Man is\nafter the new line\n\tafter new line and tab\n" + }, + "1": { + "Ar": [ + null, + null + ], + "Ii": -790, + "Mm": null, + "Sl": null, + "Ss": "-790 - A Man is\nafter the new line\n\tafter new line and tab\n" + } + }, + "Sl": [ + { + "Ar": [ + null, + null + ], + "Ii": -794, + "Mm": null, + "Sl": null, + "Ss": "-794 - A Man is\nafter the new line\n\tafter new line and tab\n" + }, + { + "Ar": [ + null, + null + ], + "Ii": -790, + "Mm": null, + "Sl": null, + "Ss": "-790 - A Man is\nafter the new line\n\tafter new line and tab\n" + } + ], + "Ss": "A Man is\nafter the new line\n\tafter new line and tab\n" +}` + + if txt1Tab != goldenResultTab { + logT(t, "decoded indented with tabs != expected: \nexpected: %s\nencoded: %s", goldenResultTab, txt1Tab) + failT(t) + } + if txtSpaces != strings.Replace(goldenResultTab, "\t", strings.Repeat(" ", 120), -1) { + logT(t, "decoded indented with spaces != expected: \nexpected: %s\nencoded: %s", goldenResultTab, txtSpaces) + failT(t) + } +} + +func TestBufioDecReader(t *testing.T) { + testOnce.Do(testInitAll) + // try to read 85 bytes in chunks of 7 at a time. + var s = strings.Repeat("01234'56789 ", 5) + // fmt.Printf("s: %s\n", s) + var r = strings.NewReader(s) + var br = &bufioDecReader{buf: make([]byte, 0, 13)} + br.r = r + b, err := ioutil.ReadAll(br.r) + if err != nil { + panic(err) + } + var s2 = string(b) + // fmt.Printf("s==s2: %v, len(s): %v, len(b): %v, len(s2): %v\n", s == s2, len(s), len(b), len(s2)) + if s != s2 { + logT(t, "not equal: \ns: %s\ns2: %s", s, s2) + failT(t) + } + // Now, test search functions for skip, readTo and readUntil + // readUntil ', readTo ', skip whitespace. 3 times in a loop, each time compare the token and/or outs + // readUntil: see: 56789 + var out []byte + var token byte + br = &bufioDecReader{buf: make([]byte, 0, 7)} + br.r = strings.NewReader(s) + // println() + for _, v2 := range [...]string{ + `01234'`, + `56789 01234'`, + `56789 01234'`, + `56789 01234'`, + } { + out = br.readUntil(nil, '\'') + testDeepEqualErr(string(out), v2, t, "-") + // fmt.Printf("readUntil: out: `%s`\n", out) + } + br = &bufioDecReader{buf: make([]byte, 0, 7)} + br.r = strings.NewReader(s) + // println() + for range [4]struct{}{} { + out = br.readTo(nil, &jsonNumSet) + testDeepEqualErr(string(out), `01234`, t, "-") + // fmt.Printf("readTo: out: `%s`\n", out) + out = br.readUntil(nil, '\'') + testDeepEqualErr(string(out), "'", t, "-") + // fmt.Printf("readUntil: out: `%s`\n", out) + out = br.readTo(nil, &jsonNumSet) + testDeepEqualErr(string(out), `56789`, t, "-") + // fmt.Printf("readTo: out: `%s`\n", out) + out = br.readUntil(nil, '0') + testDeepEqualErr(string(out), ` 0`, t, "-") + // fmt.Printf("readUntil: out: `%s`\n", out) + br.unreadn1() + } + br = &bufioDecReader{buf: make([]byte, 0, 7)} + br.r = strings.NewReader(s) + // println() + for range [4]struct{}{} { + out = br.readUntil(nil, ' ') + testDeepEqualErr(string(out), `01234'56789 `, t, "-") + // fmt.Printf("readUntil: out: |%s|\n", out) + token = br.skip(&jsonCharWhitespaceSet) + testDeepEqualErr(token, byte('0'), t, "-") + // fmt.Printf("skip: token: '%c'\n", token) + br.unreadn1() + } + // println() +} + +func TestAtomic(t *testing.T) { + testOnce.Do(testInitAll) + // load, store, load, confirm + if true { + var a atomicTypeInfoSlice + l := a.load() + if l != nil { + failT(t, "atomic fail: %T, expected load return nil, received: %v", a, l) + } + l = append(l, rtid2ti{}) + a.store(l) + l = a.load() + if len(l) != 1 { + failT(t, "atomic fail: %T, expected load to have length 1, received: %d", a, len(l)) + } + } + if true { + var a atomicRtidFnSlice + l := a.load() + if l != nil { + failT(t, "atomic fail: %T, expected load return nil, received: %v", a, l) + } + l = append(l, codecRtidFn{}) + a.store(l) + l = a.load() + if len(l) != 1 { + failT(t, "atomic fail: %T, expected load to have length 1, received: %d", a, len(l)) + } + } + if true { + var a atomicClsErr + l := a.load() + if l.errClosed != nil { + failT(t, "atomic fail: %T, expected load return clsErr = nil, received: %v", a, l.errClosed) + } + l.errClosed = io.EOF + a.store(l) + l = a.load() + if l.errClosed != io.EOF { + failT(t, "atomic fail: %T, expected clsErr = io.EOF, received: %v", a, l.errClosed) + } + } +} + +// ----------- + +func TestJsonLargeInteger(t *testing.T) { + testOnce.Do(testInitAll) + for _, i := range []uint8{'L', 'A', 0} { + for _, j := range []interface{}{ + int64(1 << 60), + -int64(1 << 60), + 0, + 1 << 20, + -(1 << 20), + uint64(1 << 60), + uint(0), + uint(1 << 20), + } { + doTestJsonLargeInteger(t, j, i) + } + } +} + +func TestJsonInvalidUnicode(t *testing.T) { + testOnce.Do(testInitAll) + var m = map[string]string{ + `"\udc49\u0430abc"`: "\uFFFDabc", + `"\udc49\u0430"`: "\uFFFD", + `"\udc49abc"`: "\uFFFDabc", + `"\udc49"`: "\uFFFD", + `"\udZ49\u0430abc"`: "\uFFFD\u0430abc", + `"\udcG9\u0430"`: "\uFFFD\u0430", + `"\uHc49abc"`: "\uFFFDabc", + `"\uKc49"`: "\uFFFD", + // ``: "", + } + for k, v := range m { + // println("k = ", k) + var s string + testUnmarshalErr(&s, []byte(k), testJsonH, t, "-") + if s != v { + logT(t, "not equal: %q, %q", v, s) + failT(t) + } + } +} + +func TestMsgpackDecodeMapAndExtSizeMismatch(t *testing.T) { + fn := func(t *testing.T, b []byte, v interface{}) { + if err := NewDecoderBytes(b, testMsgpackH).Decode(v); err != io.EOF && err != io.ErrUnexpectedEOF { + t.Fatalf("expected EOF or ErrUnexpectedEOF, got %v", err) + } + } + + // a map claiming to have 0x10eeeeee KV pairs, but only has 1. + var b = []byte{0xdf, 0x10, 0xee, 0xee, 0xee, 0x1, 0xa1, 0x1} + var m1 map[int]string + var m2 map[int][]byte + fn(t, b, &m1) + fn(t, b, &m2) + + // an extension claiming to have 0x7fffffff bytes, but only has 1. + b = []byte{0xc9, 0x7f, 0xff, 0xff, 0xff, 0xda, 0x1} + var a interface{} + fn(t, b, &a) + + // b = []byte{0x00} + // var s testSelferRecur + // fn(t, b, &s) +} + +// ---------- + +func TestBincCodecsTable(t *testing.T) { + testCodecTableOne(t, testBincH) +} + +func TestBincCodecsMisc(t *testing.T) { + testCodecMiscOne(t, testBincH) +} + +func TestBincCodecsEmbeddedPointer(t *testing.T) { + testCodecEmbeddedPointer(t, testBincH) +} + +func TestBincStdEncIntf(t *testing.T) { + doTestStdEncIntf(t, "binc", testBincH) +} + +func TestBincMammoth(t *testing.T) { + testMammoth(t, "binc", testBincH) +} + +func TestSimpleCodecsTable(t *testing.T) { + testCodecTableOne(t, testSimpleH) +} + +func TestSimpleCodecsMisc(t *testing.T) { + testCodecMiscOne(t, testSimpleH) +} + +func TestSimpleCodecsEmbeddedPointer(t *testing.T) { + testCodecEmbeddedPointer(t, testSimpleH) +} + +func TestSimpleStdEncIntf(t *testing.T) { + doTestStdEncIntf(t, "simple", testSimpleH) +} + +func TestSimpleMammoth(t *testing.T) { + testMammoth(t, "simple", testSimpleH) +} + +func TestMsgpackCodecsTable(t *testing.T) { + testCodecTableOne(t, testMsgpackH) +} + +func TestMsgpackCodecsMisc(t *testing.T) { + testCodecMiscOne(t, testMsgpackH) +} + +func TestMsgpackCodecsEmbeddedPointer(t *testing.T) { + testCodecEmbeddedPointer(t, testMsgpackH) +} + +func TestMsgpackStdEncIntf(t *testing.T) { + doTestStdEncIntf(t, "msgpack", testMsgpackH) +} + +func TestMsgpackMammoth(t *testing.T) { + testMammoth(t, "msgpack", testMsgpackH) +} + +func TestCborCodecsTable(t *testing.T) { + testCodecTableOne(t, testCborH) +} + +func TestCborCodecsMisc(t *testing.T) { + testCodecMiscOne(t, testCborH) +} + +func TestCborCodecsEmbeddedPointer(t *testing.T) { + testCodecEmbeddedPointer(t, testCborH) +} + +func TestCborMapEncodeForCanonical(t *testing.T) { + doTestMapEncodeForCanonical(t, "cbor", testCborH) +} + +func TestCborCodecChan(t *testing.T) { + testCodecChan(t, testCborH) +} + +func TestCborStdEncIntf(t *testing.T) { + doTestStdEncIntf(t, "cbor", testCborH) +} + +func TestCborMammoth(t *testing.T) { + testMammoth(t, "cbor", testCborH) +} + +func TestJsonCodecsTable(t *testing.T) { + testCodecTableOne(t, testJsonH) +} + +func TestJsonCodecsMisc(t *testing.T) { + testCodecMiscOne(t, testJsonH) +} + +func TestJsonCodecsEmbeddedPointer(t *testing.T) { + testCodecEmbeddedPointer(t, testJsonH) +} + +func TestJsonCodecChan(t *testing.T) { + testCodecChan(t, testJsonH) +} + +func TestJsonStdEncIntf(t *testing.T) { + doTestStdEncIntf(t, "json", testJsonH) +} + +func TestJsonMammoth(t *testing.T) { + testMammoth(t, "json", testJsonH) +} + +// ----- Raw --------- +func TestJsonRaw(t *testing.T) { + doTestRawValue(t, "json", testJsonH) +} +func TestBincRaw(t *testing.T) { + doTestRawValue(t, "binc", testBincH) +} +func TestMsgpackRaw(t *testing.T) { + doTestRawValue(t, "msgpack", testMsgpackH) +} +func TestSimpleRaw(t *testing.T) { + doTestRawValue(t, "simple", testSimpleH) +} +func TestCborRaw(t *testing.T) { + doTestRawValue(t, "cbor", testCborH) +} + +// ----- ALL (framework based) ----- + +func TestAllEncCircularRef(t *testing.T) { + doTestEncCircularRef(t, "cbor", testCborH) +} + +func TestAllAnonCycle(t *testing.T) { + doTestAnonCycle(t, "cbor", testCborH) +} + +func TestAllErrWriter(t *testing.T) { + doTestErrWriter(t, "cbor", testCborH) + doTestErrWriter(t, "json", testJsonH) +} + +// ----- RPC ----- + +func TestBincRpcGo(t *testing.T) { + testCodecRpcOne(t, GoRpc, testBincH, true, 0) +} + +func TestSimpleRpcGo(t *testing.T) { + testCodecRpcOne(t, GoRpc, testSimpleH, true, 0) +} + +func TestMsgpackRpcGo(t *testing.T) { + testCodecRpcOne(t, GoRpc, testMsgpackH, true, 0) +} + +func TestCborRpcGo(t *testing.T) { + testCodecRpcOne(t, GoRpc, testCborH, true, 0) +} + +func TestJsonRpcGo(t *testing.T) { + testCodecRpcOne(t, GoRpc, testJsonH, true, 0) +} + +func TestMsgpackRpcSpec(t *testing.T) { + testCodecRpcOne(t, MsgpackSpecRpc, testMsgpackH, true, 0) +} + +func TestBincUnderlyingType(t *testing.T) { + testCodecUnderlyingType(t, testBincH) +} + +func TestJsonSwallowAndZero(t *testing.T) { + doTestSwallowAndZero(t, testJsonH) +} + +func TestCborSwallowAndZero(t *testing.T) { + doTestSwallowAndZero(t, testCborH) +} + +func TestMsgpackSwallowAndZero(t *testing.T) { + doTestSwallowAndZero(t, testMsgpackH) +} + +func TestBincSwallowAndZero(t *testing.T) { + doTestSwallowAndZero(t, testBincH) +} + +func TestSimpleSwallowAndZero(t *testing.T) { + doTestSwallowAndZero(t, testSimpleH) +} + +func TestJsonRawExt(t *testing.T) { + doTestRawExt(t, testJsonH) +} + +func TestCborRawExt(t *testing.T) { + doTestRawExt(t, testCborH) +} + +func TestMsgpackRawExt(t *testing.T) { + doTestRawExt(t, testMsgpackH) +} + +func TestBincRawExt(t *testing.T) { + doTestRawExt(t, testBincH) +} + +func TestSimpleRawExt(t *testing.T) { + doTestRawExt(t, testSimpleH) +} + +func TestJsonMapStructKey(t *testing.T) { + doTestMapStructKey(t, testJsonH) +} + +func TestCborMapStructKey(t *testing.T) { + doTestMapStructKey(t, testCborH) +} + +func TestMsgpackMapStructKey(t *testing.T) { + doTestMapStructKey(t, testMsgpackH) +} + +func TestBincMapStructKey(t *testing.T) { + doTestMapStructKey(t, testBincH) +} + +func TestSimpleMapStructKey(t *testing.T) { + doTestMapStructKey(t, testSimpleH) +} + +func TestJsonDecodeNilMapValue(t *testing.T) { + doTestDecodeNilMapValue(t, testJsonH) +} + +func TestCborDecodeNilMapValue(t *testing.T) { + doTestDecodeNilMapValue(t, testCborH) +} + +func TestMsgpackDecodeNilMapValue(t *testing.T) { + doTestDecodeNilMapValue(t, testMsgpackH) +} + +func TestBincDecodeNilMapValue(t *testing.T) { + doTestDecodeNilMapValue(t, testBincH) +} + +func TestSimpleDecodeNilMapValue(t *testing.T) { + doTestDecodeNilMapValue(t, testSimpleH) +} + +func TestJsonEmbeddedFieldPrecedence(t *testing.T) { + doTestEmbeddedFieldPrecedence(t, testJsonH) +} + +func TestCborEmbeddedFieldPrecedence(t *testing.T) { + doTestEmbeddedFieldPrecedence(t, testCborH) +} + +func TestMsgpackEmbeddedFieldPrecedence(t *testing.T) { + doTestEmbeddedFieldPrecedence(t, testMsgpackH) +} + +func TestBincEmbeddedFieldPrecedence(t *testing.T) { + doTestEmbeddedFieldPrecedence(t, testBincH) +} + +func TestSimpleEmbeddedFieldPrecedence(t *testing.T) { + doTestEmbeddedFieldPrecedence(t, testSimpleH) +} + +func TestJsonLargeContainerLen(t *testing.T) { + doTestLargeContainerLen(t, testJsonH) +} + +func TestCborLargeContainerLen(t *testing.T) { + doTestLargeContainerLen(t, testCborH) +} + +func TestMsgpackLargeContainerLen(t *testing.T) { + doTestLargeContainerLen(t, testMsgpackH) +} + +func TestBincLargeContainerLen(t *testing.T) { + doTestLargeContainerLen(t, testBincH) +} + +func TestSimpleLargeContainerLen(t *testing.T) { + doTestLargeContainerLen(t, testSimpleH) +} + +func TestJsonMammothMapsAndSlices(t *testing.T) { + doTestMammothMapsAndSlices(t, testJsonH) +} + +func TestCborMammothMapsAndSlices(t *testing.T) { + doTestMammothMapsAndSlices(t, testCborH) +} + +func TestMsgpackMammothMapsAndSlices(t *testing.T) { + old1 := testMsgpackH.WriteExt + defer func() { testMsgpackH.WriteExt = old1 }() + testMsgpackH.WriteExt = true + + doTestMammothMapsAndSlices(t, testMsgpackH) +} + +func TestBincMammothMapsAndSlices(t *testing.T) { + doTestMammothMapsAndSlices(t, testBincH) +} + +func TestSimpleMammothMapsAndSlices(t *testing.T) { + doTestMammothMapsAndSlices(t, testSimpleH) +} + +func TestJsonTime(t *testing.T) { + testTime(t, "json", testJsonH) +} + +func TestCborTime(t *testing.T) { + testTime(t, "cbor", testCborH) +} + +func TestMsgpackTime(t *testing.T) { + testTime(t, "msgpack", testMsgpackH) +} + +func TestBincTime(t *testing.T) { + testTime(t, "binc", testBincH) +} + +func TestSimpleTime(t *testing.T) { + testTime(t, "simple", testSimpleH) +} + +func TestJsonUintToInt(t *testing.T) { + testUintToInt(t, "json", testJsonH) +} + +func TestCborUintToInt(t *testing.T) { + testUintToInt(t, "cbor", testCborH) +} + +func TestMsgpackUintToInt(t *testing.T) { + testUintToInt(t, "msgpack", testMsgpackH) +} + +func TestBincUintToInt(t *testing.T) { + testUintToInt(t, "binc", testBincH) +} + +func TestSimpleUintToInt(t *testing.T) { + testUintToInt(t, "simple", testSimpleH) +} + +func TestJsonDifferentMapOrSliceType(t *testing.T) { + doTestDifferentMapOrSliceType(t, "json", testJsonH) +} + +func TestCborDifferentMapOrSliceType(t *testing.T) { + doTestDifferentMapOrSliceType(t, "cbor", testCborH) +} + +func TestMsgpackDifferentMapOrSliceType(t *testing.T) { + doTestDifferentMapOrSliceType(t, "msgpack", testMsgpackH) +} + +func TestBincDifferentMapOrSliceType(t *testing.T) { + doTestDifferentMapOrSliceType(t, "binc", testBincH) +} + +func TestSimpleDifferentMapOrSliceType(t *testing.T) { + doTestDifferentMapOrSliceType(t, "simple", testSimpleH) +} + +func TestJsonScalars(t *testing.T) { + doTestScalars(t, "json", testJsonH) +} + +func TestCborScalars(t *testing.T) { + doTestScalars(t, "cbor", testCborH) +} + +func TestMsgpackScalars(t *testing.T) { + doTestScalars(t, "msgpack", testMsgpackH) +} + +func TestBincScalars(t *testing.T) { + doTestScalars(t, "binc", testBincH) +} + +func TestSimpleScalars(t *testing.T) { + doTestScalars(t, "simple", testSimpleH) +} + +func TestJsonOmitempty(t *testing.T) { + doTestOmitempty(t, "json", testJsonH) +} + +func TestCborOmitempty(t *testing.T) { + doTestOmitempty(t, "cbor", testCborH) +} + +func TestMsgpackOmitempty(t *testing.T) { + doTestOmitempty(t, "msgpack", testMsgpackH) +} + +func TestBincOmitempty(t *testing.T) { + doTestOmitempty(t, "binc", testBincH) +} + +func TestSimpleOmitempty(t *testing.T) { + doTestOmitempty(t, "simple", testSimpleH) +} + +func TestJsonIntfMapping(t *testing.T) { + doTestIntfMapping(t, "json", testJsonH) +} + +func TestCborIntfMapping(t *testing.T) { + doTestIntfMapping(t, "cbor", testCborH) +} + +func TestMsgpackIntfMapping(t *testing.T) { + doTestIntfMapping(t, "msgpack", testMsgpackH) +} + +func TestBincIntfMapping(t *testing.T) { + doTestIntfMapping(t, "binc", testBincH) +} + +func TestSimpleIntfMapping(t *testing.T) { + doTestIntfMapping(t, "simple", testSimpleH) +} + +func TestJsonMissingFields(t *testing.T) { + doTestMissingFields(t, "json", testJsonH) +} + +func TestCborMissingFields(t *testing.T) { + doTestMissingFields(t, "cbor", testCborH) +} + +func TestMsgpackMissingFields(t *testing.T) { + doTestMissingFields(t, "msgpack", testMsgpackH) +} + +func TestBincMissingFields(t *testing.T) { + doTestMissingFields(t, "binc", testBincH) +} + +func TestSimpleMissingFields(t *testing.T) { + doTestMissingFields(t, "simple", testSimpleH) +} + +func TestJsonMaxDepth(t *testing.T) { + doTestMaxDepth(t, "json", testJsonH) +} + +func TestCborMaxDepth(t *testing.T) { + doTestMaxDepth(t, "cbor", testCborH) +} + +func TestMsgpackMaxDepth(t *testing.T) { + doTestMaxDepth(t, "msgpack", testMsgpackH) +} + +func TestBincMaxDepth(t *testing.T) { + doTestMaxDepth(t, "binc", testBincH) +} + +func TestSimpleMaxDepth(t *testing.T) { + doTestMaxDepth(t, "simple", testSimpleH) +} + +func TestMultipleEncDec(t *testing.T) { + doTestMultipleEncDec(t, "json", testJsonH) +} + +// TODO: +// +// Add Tests for the following: +// - struct tags: on anonymous fields, _struct (all fields), etc +// - chan to encode and decode (with support for codecgen also) +// +// Add negative tests for failure conditions: +// - bad input with large array length prefix +// +// Add tests for decode.go (standalone) +// - UnreadByte: only 2 states (z.ls = 2 and z.ls = 1) (0 --> 2 --> 1) +// - track: z.trb: track, stop track, check +// - PreferArrayOverSlice??? +// - InterfaceReset +// - (chan byte) to decode []byte (with mapbyslice track) +// - decode slice of len 6, 16 into slice of (len 4, cap 8) and (len ) with maxinitlen=6, 8, 16 +// - DeleteOnNilMapValue +// - decnaked: n.l == nil +// - ensureDecodeable (try to decode into a non-decodeable thing e.g. a nil interface{}, +// +// Add tests for encode.go (standalone) +// - nil and 0-len slices and maps for non-fastpath things diff --git a/vendor/github.com/ugorji/go/codec/codecgen.go b/vendor/github.com/ugorji/go/codec/codecgen.go new file mode 100644 index 000000000..cc5ecec6d --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/codecgen.go @@ -0,0 +1,13 @@ +// +build codecgen generated + +package codec + +// this file is here, to set the codecgen variable to true +// when the build tag codecgen is set. +// +// this allows us do specific things e.g. skip missing fields tests, +// when running in codecgen mode. + +func init() { + codecgen = true +} diff --git a/vendor/github.com/ugorji/go/codec/codecgen/README.md b/vendor/github.com/ugorji/go/codec/codecgen/README.md new file mode 100644 index 000000000..854b64bfc --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/codecgen/README.md @@ -0,0 +1,37 @@ +# codecgen tool + +Generate is given a list of *.go files to parse, and an output file (fout), +codecgen will create an output file __file.go__ which +contains `codec.Selfer` implementations for the named types found +in the files parsed. + +Using codecgen is very straightforward. + +**Download and install the tool** + +`go get -u github.com/ugorji/go/codec/codecgen` + +**Run the tool on your files** + +The command line format is: + +`codecgen [options] (-o outfile) (infile ...)` + +```sh +% codecgen -? +Usage of codecgen: + -c="github.com/ugorji/go/codec": codec path + -o="": out file + -r=".*": regex for type name to match + -nr="": regex for type name to exclude + -rt="": tags for go run + -t="": build tag to put in file + -u=false: Use unsafe, e.g. to avoid unnecessary allocation on []byte->string + -x=false: keep temp file + +% codecgen -o values_codecgen.go values.go values2.go moretypedefs.go +``` + +Please see the [blog article](http://ugorji.net/blog/go-codecgen) +for more information on how to use the tool. + diff --git a/vendor/github.com/ugorji/go/codec/codecgen/gen.go b/vendor/github.com/ugorji/go/codec/codecgen/gen.go new file mode 100644 index 000000000..cda3b7d5b --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/codecgen/gen.go @@ -0,0 +1,378 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +// codecgen generates static implementations of the encoder and decoder functions +// for a given type, bypassing reflection, and giving some performance benefits in terms of +// wall and cpu time, and memory usage. +// +// Benchmarks (as of Dec 2018) show that codecgen gives about +// +// - for binary formats (cbor, etc): 25% on encoding and 30% on decoding to/from []byte +// - for text formats (json, etc): 15% on encoding and 25% on decoding to/from []byte +// +// Note that (as of Dec 2018) codecgen completely ignores +// +// - MissingFielder interface +// (if you types implements it, codecgen ignores that) +// - decode option PreferArrayOverSlice +// (we cannot dynamically create non-static arrays without reflection) +// +// In explicit package terms: codecgen generates codec.Selfer implementations for a set of types. +package main + +import ( + "bufio" + "bytes" + "errors" + "flag" + "fmt" + "go/ast" + "go/parser" + "go/token" + "math/rand" + "os" + "os/exec" + "path/filepath" + "regexp" + "strconv" + "strings" + "text/template" + "time" +) + +const genCodecPkg = "codec1978" // keep this in sync with codec.genCodecPkg + +const genFrunMainTmpl = `//+build ignore + +// Code generated - temporary main package for codecgen - DO NOT EDIT. + +package main +{{ if .Types }}import "{{ .ImportPath }}"{{ end }} +func main() { + {{ $.PackageName }}.CodecGenTempWrite{{ .RandString }}() +} +` + +// const genFrunPkgTmpl = `//+build codecgen +const genFrunPkgTmpl = ` + +// Code generated - temporary package for codecgen - DO NOT EDIT. + +package {{ $.PackageName }} + +import ( + {{ if not .CodecPkgFiles }}{{ .CodecPkgName }} "{{ .CodecImportPath }}"{{ end }} + "os" + "reflect" + "bytes" + "strings" + "go/format" +) + +func CodecGenTempWrite{{ .RandString }}() { + os.Remove("{{ .OutFile }}") + fout, err := os.Create("{{ .OutFile }}") + if err != nil { + panic(err) + } + defer fout.Close() + + var typs []reflect.Type + var typ reflect.Type + var numfields int +{{ range $index, $element := .Types }} + var t{{ $index }} {{ . }} +typ = reflect.TypeOf(t{{ $index }}) + typs = append(typs, typ) + if typ.Kind() == reflect.Struct { numfields += typ.NumField() } else { numfields += 1 } +{{ end }} + + // println("initializing {{ .OutFile }}, buf size: {{ .AllFilesSize }}*16", + // {{ .AllFilesSize }}*16, "num fields: ", numfields) + var out = bytes.NewBuffer(make([]byte, 0, numfields*1024)) // {{ .AllFilesSize }}*16 + {{ if not .CodecPkgFiles }}{{ .CodecPkgName }}.{{ end }}Gen(out, + "{{ .BuildTag }}", "{{ .PackageName }}", "{{ .RandString }}", {{ .NoExtensions }}, + {{ if not .CodecPkgFiles }}{{ .CodecPkgName }}.{{ end }}NewTypeInfos(strings.Split("{{ .StructTags }}", ",")), + typs...) + + bout, err := format.Source(out.Bytes()) + // println("... lengths: before formatting: ", len(out.Bytes()), ", after formatting", len(bout)) + if err != nil { + fout.Write(out.Bytes()) + panic(err) + } + fout.Write(bout) +} + +` + +// Generate is given a list of *.go files to parse, and an output file (fout). +// +// It finds all types T in the files, and it creates 2 tmp files (frun). +// - main package file passed to 'go run' +// - package level file which calls *genRunner.Selfer to write Selfer impls for each T. +// We use a package level file so that it can reference unexported types in the package being worked on. +// Tool then executes: "go run __frun__" which creates fout. +// fout contains Codec(En|De)codeSelf implementations for every type T. +// +func Generate(outfile, buildTag, codecPkgPath string, + uid int64, + goRunTag string, st string, + regexName, notRegexName *regexp.Regexp, + deleteTempFile, noExtensions bool, + infiles ...string) (err error) { + // For each file, grab AST, find each type, and write a call to it. + if len(infiles) == 0 { + return + } + if codecPkgPath == "" { + return errors.New("codec package path cannot be blank") + } + if outfile == "" { + return errors.New("outfile cannot be blank") + } + if uid < 0 { + uid = -uid + } else if uid == 0 { + rr := rand.New(rand.NewSource(time.Now().UnixNano())) + uid = 101 + rr.Int63n(9777) + } + // We have to parse dir for package, before opening the temp file for writing (else ImportDir fails). + // Also, ImportDir(...) must take an absolute path. + lastdir := filepath.Dir(outfile) + absdir, err := filepath.Abs(lastdir) + if err != nil { + return + } + importPath, err := pkgPath(absdir) + if err != nil { + return + } + type tmplT struct { + CodecPkgName string + CodecImportPath string + ImportPath string + OutFile string + PackageName string + RandString string + BuildTag string + StructTags string + Types []string + AllFilesSize int64 + CodecPkgFiles bool + NoExtensions bool + } + tv := tmplT{ + CodecPkgName: genCodecPkg, + OutFile: outfile, + CodecImportPath: codecPkgPath, + BuildTag: buildTag, + RandString: strconv.FormatInt(uid, 10), + StructTags: st, + NoExtensions: noExtensions, + } + tv.ImportPath = importPath + if tv.ImportPath == tv.CodecImportPath { + tv.CodecPkgFiles = true + tv.CodecPkgName = "codec" + } else { + // HACK: always handle vendoring. It should be typically on in go 1.6, 1.7 + tv.ImportPath = stripVendor(tv.ImportPath) + } + astfiles := make([]*ast.File, len(infiles)) + var fi os.FileInfo + for i, infile := range infiles { + if filepath.Dir(infile) != lastdir { + err = errors.New("all input files must all be in same directory as output file") + return + } + if fi, err = os.Stat(infile); err != nil { + return + } + tv.AllFilesSize += fi.Size() + + fset := token.NewFileSet() + astfiles[i], err = parser.ParseFile(fset, infile, nil, 0) + if err != nil { + return + } + if i == 0 { + tv.PackageName = astfiles[i].Name.Name + if tv.PackageName == "main" { + // codecgen cannot be run on types in the 'main' package. + // A temporary 'main' package must be created, and should reference the fully built + // package containing the types. + // Also, the temporary main package will conflict with the main package which already has a main method. + err = errors.New("codecgen cannot be run on types in the 'main' package") + return + } + } + } + + // keep track of types with selfer methods + // selferMethods := []string{"CodecEncodeSelf", "CodecDecodeSelf"} + selferEncTyps := make(map[string]bool) + selferDecTyps := make(map[string]bool) + for _, f := range astfiles { + for _, d := range f.Decls { + // if fd, ok := d.(*ast.FuncDecl); ok && fd.Recv != nil && fd.Recv.NumFields() == 1 { + if fd, ok := d.(*ast.FuncDecl); ok && fd.Recv != nil && len(fd.Recv.List) == 1 { + recvType := fd.Recv.List[0].Type + if ptr, ok := recvType.(*ast.StarExpr); ok { + recvType = ptr.X + } + if id, ok := recvType.(*ast.Ident); ok { + switch fd.Name.Name { + case "CodecEncodeSelf": + selferEncTyps[id.Name] = true + case "CodecDecodeSelf": + selferDecTyps[id.Name] = true + } + } + } + } + } + + // now find types + for _, f := range astfiles { + for _, d := range f.Decls { + if gd, ok := d.(*ast.GenDecl); ok { + for _, dd := range gd.Specs { + if td, ok := dd.(*ast.TypeSpec); ok { + // if len(td.Name.Name) == 0 || td.Name.Name[0] > 'Z' || td.Name.Name[0] < 'A' { + if len(td.Name.Name) == 0 { + continue + } + + // only generate for: + // struct: StructType + // primitives (numbers, bool, string): Ident + // map: MapType + // slice, array: ArrayType + // chan: ChanType + // do not generate: + // FuncType, InterfaceType, StarExpr (ptr), etc + // + // We generate for all these types (not just structs), because they may be a field + // in another struct which doesn't have codecgen run on it, and it will be nice + // to take advantage of the fact that the type is a Selfer. + switch td.Type.(type) { + case *ast.StructType, *ast.Ident, *ast.MapType, *ast.ArrayType, *ast.ChanType: + // only add to tv.Types iff + // - it matches per the -r parameter + // - it doesn't match per the -nr parameter + // - it doesn't have any of the Selfer methods in the file + if regexName.FindStringIndex(td.Name.Name) != nil && + notRegexName.FindStringIndex(td.Name.Name) == nil && + !selferEncTyps[td.Name.Name] && + !selferDecTyps[td.Name.Name] { + tv.Types = append(tv.Types, td.Name.Name) + } + } + } + } + } + } + } + + if len(tv.Types) == 0 { + return + } + + // we cannot use ioutil.TempFile, because we cannot guarantee the file suffix (.go). + // Also, we cannot create file in temp directory, + // because go run will not work (as it needs to see the types here). + // Consequently, create the temp file in the current directory, and remove when done. + + // frun, err = ioutil.TempFile("", "codecgen-") + // frunName := filepath.Join(os.TempDir(), "codecgen-"+strconv.FormatInt(time.Now().UnixNano(), 10)+".go") + + frunMainName := filepath.Join(lastdir, "codecgen-main-"+tv.RandString+".generated.go") + frunPkgName := filepath.Join(lastdir, "codecgen-pkg-"+tv.RandString+".generated.go") + if deleteTempFile { + defer os.Remove(frunMainName) + defer os.Remove(frunPkgName) + } + // var frunMain, frunPkg *os.File + if _, err = gen1(frunMainName, genFrunMainTmpl, &tv); err != nil { + return + } + if _, err = gen1(frunPkgName, genFrunPkgTmpl, &tv); err != nil { + return + } + + // remove outfile, so "go run ..." will not think that types in outfile already exist. + os.Remove(outfile) + + // execute go run frun + cmd := exec.Command("go", "run", "-tags", "codecgen.exec safe "+goRunTag, frunMainName) //, frunPkg.Name()) + cmd.Dir = lastdir + var buf bytes.Buffer + cmd.Stdout = &buf + cmd.Stderr = &buf + if err = cmd.Run(); err != nil { + err = fmt.Errorf("error running 'go run %s': %v, console: %s", + frunMainName, err, buf.Bytes()) + return + } + os.Stdout.Write(buf.Bytes()) + return +} + +func gen1(frunName, tmplStr string, tv interface{}) (frun *os.File, err error) { + os.Remove(frunName) + if frun, err = os.Create(frunName); err != nil { + return + } + defer frun.Close() + + t := template.New("") + if t, err = t.Parse(tmplStr); err != nil { + return + } + bw := bufio.NewWriter(frun) + if err = t.Execute(bw, tv); err != nil { + bw.Flush() + return + } + if err = bw.Flush(); err != nil { + return + } + return +} + +// copied from ../gen.go (keep in sync). +func stripVendor(s string) string { + // HACK: Misbehaviour occurs in go 1.5. May have to re-visit this later. + // if s contains /vendor/ OR startsWith vendor/, then return everything after it. + const vendorStart = "vendor/" + const vendorInline = "/vendor/" + if i := strings.LastIndex(s, vendorInline); i >= 0 { + s = s[i+len(vendorInline):] + } else if strings.HasPrefix(s, vendorStart) { + s = s[len(vendorStart):] + } + return s +} + +func main() { + o := flag.String("o", "", "out file") + c := flag.String("c", genCodecPath, "codec path") + t := flag.String("t", "", "build tag to put in file") + r := flag.String("r", ".*", "regex for type name to match") + nr := flag.String("nr", "^$", "regex for type name to exclude") + rt := flag.String("rt", "", "tags for go run") + st := flag.String("st", "codec,json", "struct tag keys to introspect") + x := flag.Bool("x", false, "keep temp file") + _ = flag.Bool("u", false, "Allow unsafe use. ***IGNORED*** - kept for backwards compatibility: ") + d := flag.Int64("d", 0, "random identifier for use in generated code") + nx := flag.Bool("nx", false, "do not support extensions - support of extensions may cause extra allocation") + + flag.Parse() + err := Generate(*o, *t, *c, *d, *rt, *st, + regexp.MustCompile(*r), regexp.MustCompile(*nr), !*x, *nx, flag.Args()...) + if err != nil { + fmt.Fprintf(os.Stderr, "codecgen error: %v\n", err) + os.Exit(1) + } +} diff --git a/vendor/github.com/ugorji/go/codec/codecgen/goversion_pkgpath_gte_go111.go b/vendor/github.com/ugorji/go/codec/codecgen/goversion_pkgpath_gte_go111.go new file mode 100644 index 000000000..3f1e7cc9d --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/codecgen/goversion_pkgpath_gte_go111.go @@ -0,0 +1,24 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +// +build go1.11 + +package main + +import ( + "fmt" + + "golang.org/x/tools/go/packages" +) + +func pkgPath(dir string) (string, error) { + pkgs, err := packages.Load(&packages.Config{Dir: dir}, ".") + if err != nil { + return "", err + } + if len(pkgs) != 1 { + return "", fmt.Errorf("Could not read package (%d package found)", len(pkgs)) + } + pkg := pkgs[0] + return pkg.PkgPath, nil +} diff --git a/vendor/github.com/ugorji/go/codec/codecgen/goversion_pkgpath_lt_go111.go b/vendor/github.com/ugorji/go/codec/codecgen/goversion_pkgpath_lt_go111.go new file mode 100644 index 000000000..be50035cb --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/codecgen/goversion_pkgpath_lt_go111.go @@ -0,0 +1,18 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +// +build !go1.11 + +package main + +import ( + "go/build" +) + +func pkgPath(dir string) (string, error) { + pkg, err := build.Default.ImportDir(dir, build.AllowBinary) + if err != nil { + return "", err + } + return pkg.ImportPath, nil +} diff --git a/vendor/github.com/ugorji/go/codec/codecgen/z.go b/vendor/github.com/ugorji/go/codec/codecgen/z.go new file mode 100644 index 000000000..e120a4eb9 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/codecgen/z.go @@ -0,0 +1,3 @@ +package main + +const genCodecPath = "github.com/ugorji/go/codec" diff --git a/vendor/github.com/ugorji/go/codec/codecs_test.go b/vendor/github.com/ugorji/go/codec/codecs_test.go deleted file mode 100644 index cb184491f..000000000 --- a/vendor/github.com/ugorji/go/codec/codecs_test.go +++ /dev/null @@ -1,1002 +0,0 @@ -// Copyright (c) 2012, 2013 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. - -package codec - -// Test works by using a slice of interfaces. -// It can test for encoding/decoding into/from a nil interface{} -// or passing the object to encode/decode into. -// -// There are basically 2 main tests here. -// First test internally encodes and decodes things and verifies that -// the artifact was as expected. -// Second test will use python msgpack to create a bunch of golden files, -// read those files, and compare them to what it should be. It then -// writes those files back out and compares the byte streams. -// -// Taken together, the tests are pretty extensive. - -import ( - "bytes" - "encoding/gob" - "flag" - "fmt" - "io/ioutil" - "math" - "net" - "net/rpc" - "os" - "os/exec" - "path/filepath" - "reflect" - "runtime" - "strconv" - "sync/atomic" - "testing" - "time" -) - -type testVerifyArg int - -const ( - testVerifyMapTypeSame testVerifyArg = iota - testVerifyMapTypeStrIntf - testVerifyMapTypeIntfIntf - // testVerifySliceIntf - testVerifyForPython -) - -var ( - testInitDebug bool - testUseIoEncDec bool - testStructToArray bool - testWriteNoSymbols bool - - _ = fmt.Printf - skipVerifyVal interface{} = &(struct{}{}) - - // For Go Time, do not use a descriptive timezone. - // It's unnecessary, and makes it harder to do a reflect.DeepEqual. - // The Offset already tells what the offset should be, if not on UTC and unknown zone name. - timeLoc = time.FixedZone("", -8*60*60) // UTC-08:00 //time.UTC-8 - timeToCompare1 = time.Date(2012, 2, 2, 2, 2, 2, 2000, timeLoc) - timeToCompare2 = time.Date(1900, 2, 2, 2, 2, 2, 2000, timeLoc) - timeToCompare3 = time.Unix(0, 0).UTC() - timeToCompare4 = time.Time{}.UTC() - - table []interface{} // main items we encode - tableVerify []interface{} // we verify encoded things against this after decode - tableTestNilVerify []interface{} // for nil interface, use this to verify (rules are different) - tablePythonVerify []interface{} // for verifying for python, since Python sometimes - // will encode a float32 as float64, or large int as uint - testRpcInt = new(TestRpcInt) - testMsgpackH = &MsgpackHandle{} - testBincH = &BincHandle{} - testSimpleH = &SimpleHandle{} -) - -func testInitFlags() { - // delete(testDecOpts.ExtFuncs, timeTyp) - flag.BoolVar(&testInitDebug, "tg", false, "Test Debug") - flag.BoolVar(&testUseIoEncDec, "ti", false, "Use IO Reader/Writer for Marshal/Unmarshal") - flag.BoolVar(&testStructToArray, "ts", false, "Set StructToArray option") - flag.BoolVar(&testWriteNoSymbols, "tn", false, "Set NoSymbols option") -} - -type AnonInTestStruc struct { - AS string - AI64 int64 - AI16 int16 - AUi64 uint64 - ASslice []string - AI64slice []int64 -} - -type TestStruc struct { - S string - I64 int64 - I16 int16 - Ui64 uint64 - Ui8 uint8 - B bool - By byte - - Sslice []string - I64slice []int64 - I16slice []int16 - Ui64slice []uint64 - Ui8slice []uint8 - Bslice []bool - Byslice []byte - - Islice []interface{} - Iptrslice []*int64 - - AnonInTestStruc - - //M map[interface{}]interface{} `json:"-",bson:"-"` - Ms map[string]interface{} - Msi64 map[string]int64 - - Nintf interface{} //don't set this, so we can test for nil - T time.Time - Nmap map[string]bool //don't set this, so we can test for nil - Nslice []byte //don't set this, so we can test for nil - Nint64 *int64 //don't set this, so we can test for nil - Mtsptr map[string]*TestStruc - Mts map[string]TestStruc - Its []*TestStruc - Nteststruc *TestStruc -} - -type TestABC struct { - A, B, C string -} - -type TestRpcInt struct { - i int -} - -func (r *TestRpcInt) Update(n int, res *int) error { r.i = n; *res = r.i; return nil } -func (r *TestRpcInt) Square(ignore int, res *int) error { *res = r.i * r.i; return nil } -func (r *TestRpcInt) Mult(n int, res *int) error { *res = r.i * n; return nil } -func (r *TestRpcInt) EchoStruct(arg TestABC, res *string) error { - *res = fmt.Sprintf("%#v", arg) - return nil -} -func (r *TestRpcInt) Echo123(args []string, res *string) error { - *res = fmt.Sprintf("%#v", args) - return nil -} - -func testVerifyVal(v interface{}, arg testVerifyArg) (v2 interface{}) { - //for python msgpack, - // - all positive integers are unsigned 64-bit ints - // - all floats are float64 - switch iv := v.(type) { - case int8: - if iv > 0 { - v2 = uint64(iv) - } else { - v2 = int64(iv) - } - case int16: - if iv > 0 { - v2 = uint64(iv) - } else { - v2 = int64(iv) - } - case int32: - if iv > 0 { - v2 = uint64(iv) - } else { - v2 = int64(iv) - } - case int64: - if iv > 0 { - v2 = uint64(iv) - } else { - v2 = int64(iv) - } - case uint8: - v2 = uint64(iv) - case uint16: - v2 = uint64(iv) - case uint32: - v2 = uint64(iv) - case uint64: - v2 = uint64(iv) - case float32: - v2 = float64(iv) - case float64: - v2 = float64(iv) - case []interface{}: - m2 := make([]interface{}, len(iv)) - for j, vj := range iv { - m2[j] = testVerifyVal(vj, arg) - } - v2 = m2 - case map[string]bool: - switch arg { - case testVerifyMapTypeSame: - m2 := make(map[string]bool) - for kj, kv := range iv { - m2[kj] = kv - } - v2 = m2 - case testVerifyMapTypeStrIntf, testVerifyForPython: - m2 := make(map[string]interface{}) - for kj, kv := range iv { - m2[kj] = kv - } - v2 = m2 - case testVerifyMapTypeIntfIntf: - m2 := make(map[interface{}]interface{}) - for kj, kv := range iv { - m2[kj] = kv - } - v2 = m2 - } - case map[string]interface{}: - switch arg { - case testVerifyMapTypeSame: - m2 := make(map[string]interface{}) - for kj, kv := range iv { - m2[kj] = testVerifyVal(kv, arg) - } - v2 = m2 - case testVerifyMapTypeStrIntf, testVerifyForPython: - m2 := make(map[string]interface{}) - for kj, kv := range iv { - m2[kj] = testVerifyVal(kv, arg) - } - v2 = m2 - case testVerifyMapTypeIntfIntf: - m2 := make(map[interface{}]interface{}) - for kj, kv := range iv { - m2[kj] = testVerifyVal(kv, arg) - } - v2 = m2 - } - case map[interface{}]interface{}: - m2 := make(map[interface{}]interface{}) - for kj, kv := range iv { - m2[testVerifyVal(kj, arg)] = testVerifyVal(kv, arg) - } - v2 = m2 - case time.Time: - switch arg { - case testVerifyForPython: - if iv2 := iv.UnixNano(); iv2 > 0 { - v2 = uint64(iv2) - } else { - v2 = int64(iv2) - } - default: - v2 = v - } - default: - v2 = v - } - return -} - -func testInit() { - gob.Register(new(TestStruc)) - if testInitDebug { - ts0 := newTestStruc(2, false) - fmt.Printf("====> depth: %v, ts: %#v\n", 2, ts0) - } - - testBincH.StructToArray = testStructToArray - if testWriteNoSymbols { - testBincH.AsSymbols = AsSymbolNone - } else { - testBincH.AsSymbols = AsSymbolAll - } - testMsgpackH.StructToArray = testStructToArray - testMsgpackH.RawToString = true - // testMsgpackH.AddExt(byteSliceTyp, 0, testMsgpackH.BinaryEncodeExt, testMsgpackH.BinaryDecodeExt) - // testMsgpackH.AddExt(timeTyp, 1, testMsgpackH.TimeEncodeExt, testMsgpackH.TimeDecodeExt) - timeEncExt := func(rv reflect.Value) ([]byte, error) { - return encodeTime(rv.Interface().(time.Time)), nil - } - timeDecExt := func(rv reflect.Value, bs []byte) error { - tt, err := decodeTime(bs) - if err == nil { - rv.Set(reflect.ValueOf(tt)) - } - return err - } - - // add extensions for msgpack, simple for time.Time, so we can encode/decode same way. - testMsgpackH.AddExt(timeTyp, 1, timeEncExt, timeDecExt) - testSimpleH.AddExt(timeTyp, 1, timeEncExt, timeDecExt) - - primitives := []interface{}{ - int8(-8), - int16(-1616), - int32(-32323232), - int64(-6464646464646464), - uint8(192), - uint16(1616), - uint32(32323232), - uint64(6464646464646464), - byte(192), - float32(-3232.0), - float64(-6464646464.0), - float32(3232.0), - float64(6464646464.0), - false, - true, - nil, - "someday", - "", - "bytestring", - timeToCompare1, - timeToCompare2, - timeToCompare3, - timeToCompare4, - } - mapsAndStrucs := []interface{}{ - map[string]bool{ - "true": true, - "false": false, - }, - map[string]interface{}{ - "true": "True", - "false": false, - "uint16(1616)": uint16(1616), - }, - //add a complex combo map in here. (map has list which has map) - //note that after the first thing, everything else should be generic. - map[string]interface{}{ - "list": []interface{}{ - int16(1616), - int32(32323232), - true, - float32(-3232.0), - map[string]interface{}{ - "TRUE": true, - "FALSE": false, - }, - []interface{}{true, false}, - }, - "int32": int32(32323232), - "bool": true, - "LONG STRING": "123456789012345678901234567890123456789012345678901234567890", - "SHORT STRING": "1234567890", - }, - map[interface{}]interface{}{ - true: "true", - uint8(138): false, - "false": uint8(200), - }, - newTestStruc(0, false), - } - - table = []interface{}{} - table = append(table, primitives...) //0-19 are primitives - table = append(table, primitives) //20 is a list of primitives - table = append(table, mapsAndStrucs...) //21-24 are maps. 25 is a *struct - - tableVerify = make([]interface{}, len(table)) - tableTestNilVerify = make([]interface{}, len(table)) - tablePythonVerify = make([]interface{}, len(table)) - - lp := len(primitives) - av := tableVerify - for i, v := range table { - if i == lp+3 { - av[i] = skipVerifyVal - continue - } - //av[i] = testVerifyVal(v, testVerifyMapTypeSame) - switch v.(type) { - case []interface{}: - av[i] = testVerifyVal(v, testVerifyMapTypeSame) - case map[string]interface{}: - av[i] = testVerifyVal(v, testVerifyMapTypeSame) - case map[interface{}]interface{}: - av[i] = testVerifyVal(v, testVerifyMapTypeSame) - default: - av[i] = v - } - } - - av = tableTestNilVerify - for i, v := range table { - if i > lp+3 { - av[i] = skipVerifyVal - continue - } - av[i] = testVerifyVal(v, testVerifyMapTypeStrIntf) - } - - av = tablePythonVerify - for i, v := range table { - if i > lp+3 { - av[i] = skipVerifyVal - continue - } - av[i] = testVerifyVal(v, testVerifyForPython) - } - - tablePythonVerify = tablePythonVerify[:24] -} - -func testUnmarshal(v interface{}, data []byte, h Handle) error { - if testUseIoEncDec { - return NewDecoder(bytes.NewBuffer(data), h).Decode(v) - } - return NewDecoderBytes(data, h).Decode(v) -} - -func testMarshal(v interface{}, h Handle) (bs []byte, err error) { - if testUseIoEncDec { - var buf bytes.Buffer - err = NewEncoder(&buf, h).Encode(v) - bs = buf.Bytes() - return - } - err = NewEncoderBytes(&bs, h).Encode(v) - return -} - -func testMarshalErr(v interface{}, h Handle, t *testing.T, name string) (bs []byte, err error) { - if bs, err = testMarshal(v, h); err != nil { - logT(t, "Error encoding %s: %v, Err: %v", name, v, err) - t.FailNow() - } - return -} - -func testUnmarshalErr(v interface{}, data []byte, h Handle, t *testing.T, name string) (err error) { - if err = testUnmarshal(v, data, h); err != nil { - logT(t, "Error Decoding into %s: %v, Err: %v", name, v, err) - t.FailNow() - } - return -} - -func newTestStruc(depth int, bench bool) (ts *TestStruc) { - var i64a, i64b, i64c, i64d int64 = 64, 6464, 646464, 64646464 - - ts = &TestStruc{ - S: "some string", - I64: math.MaxInt64 * 2 / 3, // 64, - I16: 16, - Ui64: uint64(int64(math.MaxInt64 * 2 / 3)), // 64, //don't use MaxUint64, as bson can't write it - Ui8: 160, - B: true, - By: 5, - - Sslice: []string{"one", "two", "three"}, - I64slice: []int64{1, 2, 3}, - I16slice: []int16{4, 5, 6}, - Ui64slice: []uint64{137, 138, 139}, - Ui8slice: []uint8{210, 211, 212}, - Bslice: []bool{true, false, true, false}, - Byslice: []byte{13, 14, 15}, - - Islice: []interface{}{"true", true, "no", false, uint64(288), float64(0.4)}, - - Ms: map[string]interface{}{ - "true": "true", - "int64(9)": false, - }, - Msi64: map[string]int64{ - "one": 1, - "two": 2, - }, - T: timeToCompare1, - AnonInTestStruc: AnonInTestStruc{ - AS: "A-String", - AI64: 64, - AI16: 16, - AUi64: 64, - ASslice: []string{"Aone", "Atwo", "Athree"}, - AI64slice: []int64{1, 2, 3}, - }, - } - //For benchmarks, some things will not work. - if !bench { - //json and bson require string keys in maps - //ts.M = map[interface{}]interface{}{ - // true: "true", - // int8(9): false, - //} - //gob cannot encode nil in element in array (encodeArray: nil element) - ts.Iptrslice = []*int64{nil, &i64a, nil, &i64b, nil, &i64c, nil, &i64d, nil} - // ts.Iptrslice = nil - } - if depth > 0 { - depth-- - if ts.Mtsptr == nil { - ts.Mtsptr = make(map[string]*TestStruc) - } - if ts.Mts == nil { - ts.Mts = make(map[string]TestStruc) - } - ts.Mtsptr["0"] = newTestStruc(depth, bench) - ts.Mts["0"] = *(ts.Mtsptr["0"]) - ts.Its = append(ts.Its, ts.Mtsptr["0"]) - } - return -} - -// doTestCodecTableOne allows us test for different variations based on arguments passed. -func doTestCodecTableOne(t *testing.T, testNil bool, h Handle, - vs []interface{}, vsVerify []interface{}) { - //if testNil, then just test for when a pointer to a nil interface{} is passed. It should work. - //Current setup allows us test (at least manually) the nil interface or typed interface. - logT(t, "================ TestNil: %v ================\n", testNil) - for i, v0 := range vs { - logT(t, "..............................................") - logT(t, " Testing: #%d:, %T, %#v\n", i, v0, v0) - b0, err := testMarshalErr(v0, h, t, "v0") - if err != nil { - continue - } - logT(t, " Encoded bytes: len: %v, %v\n", len(b0), b0) - - var v1 interface{} - - if testNil { - err = testUnmarshal(&v1, b0, h) - } else { - if v0 != nil { - v0rt := reflect.TypeOf(v0) // ptr - rv1 := reflect.New(v0rt) - err = testUnmarshal(rv1.Interface(), b0, h) - v1 = rv1.Elem().Interface() - // v1 = reflect.Indirect(reflect.ValueOf(v1)).Interface() - } - } - - logT(t, " v1 returned: %T, %#v", v1, v1) - // if v1 != nil { - // logT(t, " v1 returned: %T, %#v", v1, v1) - // //we always indirect, because ptr to typed value may be passed (if not testNil) - // v1 = reflect.Indirect(reflect.ValueOf(v1)).Interface() - // } - if err != nil { - logT(t, "-------- Error: %v. Partial return: %v", err, v1) - failT(t) - continue - } - v0check := vsVerify[i] - if v0check == skipVerifyVal { - logT(t, " Nil Check skipped: Decoded: %T, %#v\n", v1, v1) - continue - } - - if err = deepEqual(v0check, v1); err == nil { - logT(t, "++++++++ Before and After marshal matched\n") - } else { - logT(t, "-------- Before and After marshal do not match: Error: %v"+ - " ====> GOLDEN: (%T) %#v, DECODED: (%T) %#v\n", err, v0check, v0check, v1, v1) - failT(t) - } - } -} - -func testCodecTableOne(t *testing.T, h Handle) { - // func TestMsgpackAllExperimental(t *testing.T) { - // dopts := testDecOpts(nil, nil, false, true, true), - - switch v := h.(type) { - case *MsgpackHandle: - var oldWriteExt, oldRawToString bool - oldWriteExt, v.WriteExt = v.WriteExt, true - oldRawToString, v.RawToString = v.RawToString, true - doTestCodecTableOne(t, false, h, table, tableVerify) - v.WriteExt, v.RawToString = oldWriteExt, oldRawToString - default: - doTestCodecTableOne(t, false, h, table, tableVerify) - } - // func TestMsgpackAll(t *testing.T) { - idxTime, numPrim, numMap := 19, 23, 4 - - //skip []interface{} containing time.Time - doTestCodecTableOne(t, false, h, table[:numPrim], tableVerify[:numPrim]) - doTestCodecTableOne(t, false, h, table[numPrim+1:], tableVerify[numPrim+1:]) - // func TestMsgpackNilStringMap(t *testing.T) { - var oldMapType reflect.Type - v := h.getBasicHandle() - oldMapType, v.MapType = v.MapType, mapStrIntfTyp - - //skip time.Time, []interface{} containing time.Time, last map, and newStruc - doTestCodecTableOne(t, true, h, table[:idxTime], tableTestNilVerify[:idxTime]) - doTestCodecTableOne(t, true, h, table[numPrim+1:numPrim+numMap], tableTestNilVerify[numPrim+1:numPrim+numMap]) - - v.MapType = oldMapType - - // func TestMsgpackNilIntf(t *testing.T) { - - //do newTestStruc and last element of map - doTestCodecTableOne(t, true, h, table[numPrim+numMap:], tableTestNilVerify[numPrim+numMap:]) - //TODO? What is this one? - //doTestCodecTableOne(t, true, h, table[17:18], tableTestNilVerify[17:18]) -} - -func testCodecMiscOne(t *testing.T, h Handle) { - b, err := testMarshalErr(32, h, t, "32") - // Cannot do this nil one, because faster type assertion decoding will panic - // var i *int32 - // if err = testUnmarshal(b, i, nil); err == nil { - // logT(t, "------- Expecting error because we cannot unmarshal to int32 nil ptr") - // t.FailNow() - // } - var i2 int32 = 0 - err = testUnmarshalErr(&i2, b, h, t, "int32-ptr") - if i2 != int32(32) { - logT(t, "------- didn't unmarshal to 32: Received: %d", i2) - t.FailNow() - } - - // func TestMsgpackDecodePtr(t *testing.T) { - ts := newTestStruc(0, false) - b, err = testMarshalErr(ts, h, t, "pointer-to-struct") - if len(b) < 40 { - logT(t, "------- Size must be > 40. Size: %d", len(b)) - t.FailNow() - } - logT(t, "------- b: %v", b) - ts2 := new(TestStruc) - err = testUnmarshalErr(ts2, b, h, t, "pointer-to-struct") - if ts2.I64 != math.MaxInt64*2/3 { - logT(t, "------- Unmarshal wrong. Expect I64 = 64. Got: %v", ts2.I64) - t.FailNow() - } - - // func TestMsgpackIntfDecode(t *testing.T) { - m := map[string]int{"A": 2, "B": 3} - p := []interface{}{m} - bs, err := testMarshalErr(p, h, t, "p") - - m2 := map[string]int{} - p2 := []interface{}{m2} - err = testUnmarshalErr(&p2, bs, h, t, "&p2") - - if m2["A"] != 2 || m2["B"] != 3 { - logT(t, "m2 not as expected: expecting: %v, got: %v", m, m2) - t.FailNow() - } - // log("m: %v, m2: %v, p: %v, p2: %v", m, m2, p, p2) - checkEqualT(t, p, p2, "p=p2") - checkEqualT(t, m, m2, "m=m2") - if err = deepEqual(p, p2); err == nil { - logT(t, "p and p2 match") - } else { - logT(t, "Not Equal: %v. p: %v, p2: %v", err, p, p2) - t.FailNow() - } - if err = deepEqual(m, m2); err == nil { - logT(t, "m and m2 match") - } else { - logT(t, "Not Equal: %v. m: %v, m2: %v", err, m, m2) - t.FailNow() - } - - // func TestMsgpackDecodeStructSubset(t *testing.T) { - // test that we can decode a subset of the stream - mm := map[string]interface{}{"A": 5, "B": 99, "C": 333} - bs, err = testMarshalErr(mm, h, t, "mm") - type ttt struct { - A uint8 - C int32 - } - var t2 ttt - testUnmarshalErr(&t2, bs, h, t, "t2") - t3 := ttt{5, 333} - checkEqualT(t, t2, t3, "t2=t3") - - // println(">>>>>") - // test simple arrays, non-addressable arrays, slices - type tarr struct { - A int64 - B [3]int64 - C []byte - D [3]byte - } - var tarr0 = tarr{1, [3]int64{2, 3, 4}, []byte{4, 5, 6}, [3]byte{7, 8, 9}} - // test both pointer and non-pointer (value) - for _, tarr1 := range []interface{}{tarr0, &tarr0} { - bs, err = testMarshalErr(tarr1, h, t, "tarr1") - var tarr2 tarr - testUnmarshalErr(&tarr2, bs, h, t, "tarr2") - checkEqualT(t, tarr0, tarr2, "tarr0=tarr2") - // fmt.Printf(">>>> err: %v. tarr1: %v, tarr2: %v\n", err, tarr0, tarr2) - } - - // test byte array, even if empty (msgpack only) - if h == testMsgpackH { - type ystruct struct { - Anarray []byte - } - var ya = ystruct{} - testUnmarshalErr(&ya, []byte{0x91, 0x90}, h, t, "ya") - } -} - -func testCodecEmbeddedPointer(t *testing.T, h Handle) { - type Z int - type A struct { - AnInt int - } - type B struct { - *Z - *A - MoreInt int - } - var z Z = 4 - x1 := &B{&z, &A{5}, 6} - bs, err := testMarshalErr(x1, h, t, "x1") - // fmt.Printf("buf: len(%v): %x\n", buf.Len(), buf.Bytes()) - var x2 = new(B) - err = testUnmarshalErr(x2, bs, h, t, "x2") - err = checkEqualT(t, x1, x2, "x1=x2") - _ = err -} - -func doTestRpcOne(t *testing.T, rr Rpc, h Handle, doRequest bool, exitSleepMs time.Duration, -) (port int) { - // rpc needs EOF, which is sent via a panic, and so must be recovered. - if !recoverPanicToErr { - logT(t, "EXPECTED. set recoverPanicToErr=true, since rpc needs EOF") - t.FailNow() - } - srv := rpc.NewServer() - srv.Register(testRpcInt) - ln, err := net.Listen("tcp", "127.0.0.1:0") - // log("listener: %v", ln.Addr()) - checkErrT(t, err) - port = (ln.Addr().(*net.TCPAddr)).Port - // var opts *DecoderOptions - // opts := testDecOpts - // opts.MapType = mapStrIntfTyp - // opts.RawToString = false - serverExitChan := make(chan bool, 1) - var serverExitFlag uint64 = 0 - serverFn := func() { - for { - conn1, err1 := ln.Accept() - // if err1 != nil { - // //fmt.Printf("accept err1: %v\n", err1) - // continue - // } - if atomic.LoadUint64(&serverExitFlag) == 1 { - serverExitChan <- true - conn1.Close() - return // exit serverFn goroutine - } - if err1 == nil { - var sc rpc.ServerCodec = rr.ServerCodec(conn1, h) - srv.ServeCodec(sc) - } - } - } - - clientFn := func(cc rpc.ClientCodec) { - cl := rpc.NewClientWithCodec(cc) - defer cl.Close() - var up, sq, mult int - var rstr string - // log("Calling client") - checkErrT(t, cl.Call("TestRpcInt.Update", 5, &up)) - // log("Called TestRpcInt.Update") - checkEqualT(t, testRpcInt.i, 5, "testRpcInt.i=5") - checkEqualT(t, up, 5, "up=5") - checkErrT(t, cl.Call("TestRpcInt.Square", 1, &sq)) - checkEqualT(t, sq, 25, "sq=25") - checkErrT(t, cl.Call("TestRpcInt.Mult", 20, &mult)) - checkEqualT(t, mult, 100, "mult=100") - checkErrT(t, cl.Call("TestRpcInt.EchoStruct", TestABC{"Aa", "Bb", "Cc"}, &rstr)) - checkEqualT(t, rstr, fmt.Sprintf("%#v", TestABC{"Aa", "Bb", "Cc"}), "rstr=") - checkErrT(t, cl.Call("TestRpcInt.Echo123", []string{"A1", "B2", "C3"}, &rstr)) - checkEqualT(t, rstr, fmt.Sprintf("%#v", []string{"A1", "B2", "C3"}), "rstr=") - } - - connFn := func() (bs net.Conn) { - // log("calling f1") - bs, err2 := net.Dial(ln.Addr().Network(), ln.Addr().String()) - //fmt.Printf("f1. bs: %v, err2: %v\n", bs, err2) - checkErrT(t, err2) - return - } - - exitFn := func() { - atomic.StoreUint64(&serverExitFlag, 1) - bs := connFn() - <-serverExitChan - bs.Close() - // serverExitChan <- true - } - - go serverFn() - runtime.Gosched() - //time.Sleep(100 * time.Millisecond) - if exitSleepMs == 0 { - defer ln.Close() - defer exitFn() - } - if doRequest { - bs := connFn() - cc := rr.ClientCodec(bs, h) - clientFn(cc) - } - if exitSleepMs != 0 { - go func() { - defer ln.Close() - time.Sleep(exitSleepMs) - exitFn() - }() - } - return -} - -// Comprehensive testing that generates data encoded from python msgpack, -// and validates that our code can read and write it out accordingly. -// We keep this unexported here, and put actual test in ext_dep_test.go. -// This way, it can be excluded by excluding file completely. -func doTestMsgpackPythonGenStreams(t *testing.T) { - logT(t, "TestPythonGenStreams") - tmpdir, err := ioutil.TempDir("", "golang-msgpack-test") - if err != nil { - logT(t, "-------- Unable to create temp directory\n") - t.FailNow() - } - defer os.RemoveAll(tmpdir) - logT(t, "tmpdir: %v", tmpdir) - cmd := exec.Command("python", "msgpack_test.py", "testdata", tmpdir) - //cmd.Stdin = strings.NewReader("some input") - //cmd.Stdout = &out - var cmdout []byte - if cmdout, err = cmd.CombinedOutput(); err != nil { - logT(t, "-------- Error running msgpack_test.py testdata. Err: %v", err) - logT(t, " %v", string(cmdout)) - t.FailNow() - } - - oldMapType := testMsgpackH.MapType - for i, v := range tablePythonVerify { - testMsgpackH.MapType = oldMapType - //load up the golden file based on number - //decode it - //compare to in-mem object - //encode it again - //compare to output stream - logT(t, "..............................................") - logT(t, " Testing: #%d: %T, %#v\n", i, v, v) - var bss []byte - bss, err = ioutil.ReadFile(filepath.Join(tmpdir, strconv.Itoa(i)+".golden")) - if err != nil { - logT(t, "-------- Error reading golden file: %d. Err: %v", i, err) - failT(t) - continue - } - testMsgpackH.MapType = mapStrIntfTyp - - var v1 interface{} - if err = testUnmarshal(&v1, bss, testMsgpackH); err != nil { - logT(t, "-------- Error decoding stream: %d: Err: %v", i, err) - failT(t) - continue - } - if v == skipVerifyVal { - continue - } - //no need to indirect, because we pass a nil ptr, so we already have the value - //if v1 != nil { v1 = reflect.Indirect(reflect.ValueOf(v1)).Interface() } - if err = deepEqual(v, v1); err == nil { - logT(t, "++++++++ Objects match") - } else { - logT(t, "-------- Objects do not match: %v. Source: %T. Decoded: %T", err, v, v1) - logT(t, "-------- AGAINST: %#v", v) - logT(t, "-------- DECODED: %#v <====> %#v", v1, reflect.Indirect(reflect.ValueOf(v1)).Interface()) - failT(t) - } - bsb, err := testMarshal(v1, testMsgpackH) - if err != nil { - logT(t, "Error encoding to stream: %d: Err: %v", i, err) - failT(t) - continue - } - if err = deepEqual(bsb, bss); err == nil { - logT(t, "++++++++ Bytes match") - } else { - logT(t, "???????? Bytes do not match. %v.", err) - xs := "--------" - if reflect.ValueOf(v).Kind() == reflect.Map { - xs = " " - logT(t, "%s It's a map. Ok that they don't match (dependent on ordering).", xs) - } else { - logT(t, "%s It's not a map. They should match.", xs) - failT(t) - } - logT(t, "%s FROM_FILE: %4d] %v", xs, len(bss), bss) - logT(t, "%s ENCODED: %4d] %v", xs, len(bsb), bsb) - } - } - testMsgpackH.MapType = oldMapType -} - -// To test MsgpackSpecRpc, we test 3 scenarios: -// - Go Client to Go RPC Service (contained within TestMsgpackRpcSpec) -// - Go client to Python RPC Service (contained within doTestMsgpackRpcSpecGoClientToPythonSvc) -// - Python Client to Go RPC Service (contained within doTestMsgpackRpcSpecPythonClientToGoSvc) -// -// This allows us test the different calling conventions -// - Go Service requires only one argument -// - Python Service allows multiple arguments - -func doTestMsgpackRpcSpecGoClientToPythonSvc(t *testing.T) { - openPort := "6789" - cmd := exec.Command("python", "msgpack_test.py", "rpc-server", openPort, "2") - checkErrT(t, cmd.Start()) - time.Sleep(100 * time.Millisecond) // time for python rpc server to start - bs, err2 := net.Dial("tcp", ":"+openPort) - checkErrT(t, err2) - cc := MsgpackSpecRpc.ClientCodec(bs, testMsgpackH) - cl := rpc.NewClientWithCodec(cc) - defer cl.Close() - var rstr string - checkErrT(t, cl.Call("EchoStruct", TestABC{"Aa", "Bb", "Cc"}, &rstr)) - //checkEqualT(t, rstr, "{'A': 'Aa', 'B': 'Bb', 'C': 'Cc'}") - var mArgs MsgpackSpecRpcMultiArgs = []interface{}{"A1", "B2", "C3"} - checkErrT(t, cl.Call("Echo123", mArgs, &rstr)) - checkEqualT(t, rstr, "1:A1 2:B2 3:C3", "rstr=") -} - -func doTestMsgpackRpcSpecPythonClientToGoSvc(t *testing.T) { - port := doTestRpcOne(t, MsgpackSpecRpc, testMsgpackH, false, 1*time.Second) - //time.Sleep(1000 * time.Millisecond) - cmd := exec.Command("python", "msgpack_test.py", "rpc-client-go-service", strconv.Itoa(port)) - var cmdout []byte - var err error - if cmdout, err = cmd.CombinedOutput(); err != nil { - logT(t, "-------- Error running msgpack_test.py rpc-client-go-service. Err: %v", err) - logT(t, " %v", string(cmdout)) - t.FailNow() - } - checkEqualT(t, string(cmdout), - fmt.Sprintf("%#v\n%#v\n", []string{"A1", "B2", "C3"}, TestABC{"Aa", "Bb", "Cc"}), "cmdout=") -} - -func TestBincCodecsTable(t *testing.T) { - testCodecTableOne(t, testBincH) -} - -func TestBincCodecsMisc(t *testing.T) { - testCodecMiscOne(t, testBincH) -} - -func TestBincCodecsEmbeddedPointer(t *testing.T) { - testCodecEmbeddedPointer(t, testBincH) -} - -func TestSimpleCodecsTable(t *testing.T) { - testCodecTableOne(t, testSimpleH) -} - -func TestSimpleCodecsMisc(t *testing.T) { - testCodecMiscOne(t, testSimpleH) -} - -func TestSimpleCodecsEmbeddedPointer(t *testing.T) { - testCodecEmbeddedPointer(t, testSimpleH) -} - -func TestMsgpackCodecsTable(t *testing.T) { - testCodecTableOne(t, testMsgpackH) -} - -func TestMsgpackCodecsMisc(t *testing.T) { - testCodecMiscOne(t, testMsgpackH) -} - -func TestMsgpackCodecsEmbeddedPointer(t *testing.T) { - testCodecEmbeddedPointer(t, testMsgpackH) -} - -func TestBincRpcGo(t *testing.T) { - doTestRpcOne(t, GoRpc, testBincH, true, 0) -} - -func _TestSimpleRpcGo(t *testing.T) { - doTestRpcOne(t, GoRpc, testSimpleH, true, 0) -} - -func TestMsgpackRpcGo(t *testing.T) { - doTestRpcOne(t, GoRpc, testMsgpackH, true, 0) -} - -func TestMsgpackRpcSpec(t *testing.T) { - doTestRpcOne(t, MsgpackSpecRpc, testMsgpackH, true, 0) -} - -// TODO: -// Add Tests for: -// - decoding empty list/map in stream into a nil slice/map -// - binary(M|Unm)arsher support for time.Time diff --git a/vendor/github.com/ugorji/go/codec/decode.go b/vendor/github.com/ugorji/go/codec/decode.go index 87bef2b93..1f14e7a51 100644 --- a/vendor/github.com/ugorji/go/codec/decode.go +++ b/vendor/github.com/ugorji/go/codec/decode.go @@ -1,578 +1,2439 @@ -// Copyright (c) 2012, 2013 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. package codec import ( + "encoding" + "errors" + "fmt" "io" "reflect" - // "runtime/debug" + "runtime" + "strconv" + "time" ) // Some tagging information for error messages. const ( - msgTagDec = "codec.decoder" - msgBadDesc = "Unrecognized descriptor byte" - msgDecCannotExpandArr = "cannot expand go array from %v to stream length: %v" + msgBadDesc = "unrecognized descriptor byte" + // msgDecCannotExpandArr = "cannot expand go array from %v to stream length: %v" ) +const ( + decDefMaxDepth = 1024 // maximum depth + decDefSliceCap = 8 + decDefChanCap = 64 // should be large, as cap cannot be expanded + decScratchByteArrayLen = cacheLineSize // + (8 * 2) // - (8 * 1) +) + +var ( + errstrOnlyMapOrArrayCanDecodeIntoStruct = "only encoded map or array can be decoded into a struct" + errstrCannotDecodeIntoNil = "cannot decode into nil" + + errmsgExpandSliceOverflow = "expand slice: slice overflow" + errmsgExpandSliceCannotChange = "expand slice: cannot change" + + errDecoderNotInitialized = errors.New("Decoder not initialized") + + errDecUnreadByteNothingToRead = errors.New("cannot unread - nothing has been read") + errDecUnreadByteLastByteNotRead = errors.New("cannot unread - last byte has not been read") + errDecUnreadByteUnknown = errors.New("cannot unread - reason unknown") + errMaxDepthExceeded = errors.New("maximum decoding depth exceeded") +) + +/* + // decReader abstracts the reading source, allowing implementations that can // read from an io.Reader or directly off a byte slice with zero-copying. +// +// Deprecated: Use decReaderSwitch instead. type decReader interface { - readn(n int) []byte + unreadn1() + // readx will use the implementation scratch buffer if possible i.e. n < len(scratchbuf), OR + // just return a view of the []byte being decoded from. + // Ensure you call detachZeroCopyBytes later if this needs to be sent outside codec control. + readx(n int) []byte readb([]byte) readn1() uint8 - readUint16() uint16 - readUint32() uint32 - readUint64() uint64 + numread() uint // number of bytes read + track() + stopTrack() []byte + + // skip will skip any byte that matches, and return the first non-matching byte + skip(accept *bitset256) (token byte) + // readTo will read any byte that matches, stopping once no-longer matching. + readTo(in []byte, accept *bitset256) (out []byte) + // readUntil will read, only stopping once it matches the 'stop' byte. + readUntil(in []byte, stop byte) (out []byte) } +*/ + type decDriver interface { - initReadNext() - tryDecodeAsNil() bool - currentEncodedType() valueType - isBuiltinType(rt uintptr) bool - decodeBuiltin(rt uintptr, v interface{}) - //decodeNaked: Numbers are decoded as int64, uint64, float64 only (no smaller sized number types). - decodeNaked() (v interface{}, vt valueType, decodeFurther bool) - decodeInt(bitsize uint8) (i int64) - decodeUint(bitsize uint8) (ui uint64) - decodeFloat(chkOverflow32 bool) (f float64) - decodeBool() (b bool) - // decodeString can also decode symbols - decodeString() (s string) - decodeBytes(bs []byte) (bsOut []byte, changed bool) - decodeExt(verifyTag bool, tag byte) (xtag byte, xbs []byte) - readMapLen() int - readArrayLen() int + // this will check if the next token is a break. + CheckBreak() bool + // TryDecodeAsNil tries to decode as nil. + // Note: TryDecodeAsNil should be careful not to share any temporary []byte with + // the rest of the decDriver. This is because sometimes, we optimize by holding onto + // a transient []byte, and ensuring the only other call we make to the decDriver + // during that time is maybe a TryDecodeAsNil() call. + TryDecodeAsNil() bool + // ContainerType returns one of: Bytes, String, Nil, Slice or Map. Return unSet if not known. + ContainerType() (vt valueType) + // IsBuiltinType(rt uintptr) bool + + // DecodeNaked will decode primitives (number, bool, string, []byte) and RawExt. + // For maps and arrays, it will not do the decoding in-band, but will signal + // the decoder, so that is done later, by setting the decNaked.valueType field. + // + // Note: Numbers are decoded as int64, uint64, float64 only (no smaller sized number types). + // for extensions, DecodeNaked must read the tag and the []byte if it exists. + // if the []byte is not read, then kInterfaceNaked will treat it as a Handle + // that stores the subsequent value in-band, and complete reading the RawExt. + // + // extensions should also use readx to decode them, for efficiency. + // kInterface will extract the detached byte slice if it has to pass it outside its realm. + DecodeNaked() + + // Deprecated: use DecodeInt64 and DecodeUint64 instead + // DecodeInt(bitsize uint8) (i int64) + // DecodeUint(bitsize uint8) (ui uint64) + + DecodeInt64() (i int64) + DecodeUint64() (ui uint64) + + DecodeFloat64() (f float64) + DecodeBool() (b bool) + // DecodeString can also decode symbols. + // It looks redundant as DecodeBytes is available. + // However, some codecs (e.g. binc) support symbols and can + // return a pre-stored string value, meaning that it can bypass + // the cost of []byte->string conversion. + DecodeString() (s string) + DecodeStringAsBytes() (v []byte) + + // DecodeBytes may be called directly, without going through reflection. + // Consequently, it must be designed to handle possible nil. + DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) + // DecodeBytes(bs []byte, isstring, zerocopy bool) (bsOut []byte) + + // decodeExt will decode into a *RawExt or into an extension. + DecodeExt(v interface{}, xtag uint64, ext Ext) (realxtag uint64) + // decodeExt(verifyTag bool, tag byte) (xtag byte, xbs []byte) + + DecodeTime() (t time.Time) + + ReadArrayStart() int + ReadArrayElem() + ReadArrayEnd() + ReadMapStart() int + ReadMapElemKey() + ReadMapElemValue() + ReadMapEnd() + + reset() + uncacheRead() +} + +type decodeError struct { + codecError + pos int +} + +func (d decodeError) Error() string { + return fmt.Sprintf("%s decode error [pos %d]: %v", d.name, d.pos, d.err) } +type decDriverNoopContainerReader struct{} + +func (x decDriverNoopContainerReader) ReadArrayStart() (v int) { return } +func (x decDriverNoopContainerReader) ReadArrayElem() {} +func (x decDriverNoopContainerReader) ReadArrayEnd() {} +func (x decDriverNoopContainerReader) ReadMapStart() (v int) { return } +func (x decDriverNoopContainerReader) ReadMapElemKey() {} +func (x decDriverNoopContainerReader) ReadMapElemValue() {} +func (x decDriverNoopContainerReader) ReadMapEnd() {} +func (x decDriverNoopContainerReader) CheckBreak() (v bool) { return } + +// func (x decNoSeparator) uncacheRead() {} + +// DecodeOptions captures configuration options during decode. type DecodeOptions struct { - // An instance of MapType is used during schema-less decoding of a map in the stream. - // If nil, we use map[interface{}]interface{} + // MapType specifies type to use during schema-less decoding of a map in the stream. + // If nil (unset), we default to map[string]interface{} iff json handle and MapStringAsKey=true, + // else map[interface{}]interface{}. MapType reflect.Type - // An instance of SliceType is used during schema-less decoding of an array in the stream. - // If nil, we use []interface{} + + // SliceType specifies type to use during schema-less decoding of an array in the stream. + // If nil (unset), we default to []interface{} for all formats. SliceType reflect.Type - // ErrorIfNoField controls whether an error is returned when decoding a map + + // MaxInitLen defines the maxinum initial length that we "make" a collection + // (string, slice, map, chan). 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 2^64 elements. + // We should not auto-matically provision a slice of that size, to prevent Out-Of-Memory crash. + // Instead, we provision up to MaxInitLen, fill that up, and start appending after that. + MaxInitLen int + + // ReaderBufferSize is the size of the buffer used when reading. + // + // if > 0, we use a smart buffer internally for performance purposes. + ReaderBufferSize int + + // MaxDepth defines the maximum depth when decoding nested + // maps and slices. If 0 or negative, we default to a suitably large number (currently 1024). + MaxDepth int16 + + // 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 + + // If ErrorIfNoArrayExpand, return an error when decoding a slice/array that cannot be expanded. + // For example, the stream contains an array of 8 items, but you are decoding into a [4]T array, + // or you are decoding into a slice of length 4 which is non-addressable (and so cannot be set). + ErrorIfNoArrayExpand bool + + // If SignedInteger, use the int64 during schema-less decoding of unsigned values (not uint64). + SignedInteger bool + + // MapValueReset controls how we decode into a map value. + // + // 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 + + // SliceElementReset: on decoding a slice, reset the element to a zero value first. + // + // concern: if the slice already contained some garbage, we will decode into that garbage. + SliceElementReset 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. + // Every string should not be interned. + // An excellent use-case for interning is struct field names, + // or map keys where key type is string. + InternString bool + + // PreferArrayOverSlice controls whether to decode to an array or a slice. + // + // This only impacts decoding into a nil interface{}. + // Consequently, it has no effect on codecgen. + // + // *Note*: This only applies if using go1.5 and above, + // as it requires reflect.ArrayOf support which was absent before go1.5. + PreferArrayOverSlice bool + + // DeleteOnNilMapValue controls how to decode a nil value in the stream. + // + // If true, we will delete the mapping of the key. + // Else, just set the mapping to the zero value of the type. + DeleteOnNilMapValue bool + + // RawToString controls how raw bytes in a stream are decoded into a nil interface{}. + // By default, they are decoded as []byte, but can be decoded as string (if configured). + RawToString bool } -// ------------------------------------ +// ------------------------------------------------ + +type unreadByteStatus uint8 + +// unreadByteStatus goes from +// undefined (when initialized) -- (read) --> canUnread -- (unread) --> canRead ... +const ( + unreadByteUndefined unreadByteStatus = iota + unreadByteCanRead + unreadByteCanUnread +) + +type ioDecReaderCommon struct { + r io.Reader // the reader passed in + + n uint // num read -// ioDecReader is a decReader that reads off an io.Reader + l byte // last byte + ls unreadByteStatus // last byte status + trb bool // tracking bytes turned on + _ bool + b [4]byte // tiny buffer for reading single bytes + + tr []byte // tracking bytes read +} + +func (z *ioDecReaderCommon) reset(r io.Reader) { + z.r = r + z.ls = unreadByteUndefined + z.l, z.n = 0, 0 + z.trb = false + if z.tr != nil { + z.tr = z.tr[:0] + } +} + +func (z *ioDecReaderCommon) numread() uint { + return z.n +} + +func (z *ioDecReaderCommon) track() { + if z.tr != nil { + z.tr = z.tr[:0] + } + z.trb = true +} + +func (z *ioDecReaderCommon) stopTrack() (bs []byte) { + z.trb = false + return z.tr +} + +// ------------------------------------------ + +// ioDecReader is a decReader that reads off an io.Reader. +// +// It also has a fallback implementation of ByteScanner if needed. type ioDecReader struct { - r io.Reader - br io.ByteReader - x [8]byte //temp byte array re-used internally for efficiency + ioDecReaderCommon + + rr io.Reader + br io.ByteScanner + + x [scratchByteArrayLen]byte // for: get struct field name, swallow valueTypeBytes, etc + _ [1]uint64 // padding } -func (z *ioDecReader) readn(n int) (bs []byte) { - if n <= 0 { +func (z *ioDecReader) reset(r io.Reader) { + z.ioDecReaderCommon.reset(r) + + var ok bool + z.rr = r + z.br, ok = r.(io.ByteScanner) + if !ok { + z.br = z + z.rr = z + } +} + +func (z *ioDecReader) Read(p []byte) (n int, err error) { + if len(p) == 0 { return } - bs = make([]byte, n) - if _, err := io.ReadAtLeast(z.r, bs, n); err != nil { + var firstByte bool + if z.ls == unreadByteCanRead { + z.ls = unreadByteCanUnread + p[0] = z.l + if len(p) == 1 { + n = 1 + return + } + firstByte = true + p = p[1:] + } + n, err = z.r.Read(p) + if n > 0 { + if err == io.EOF && n == len(p) { + err = nil // read was successful, so postpone EOF (till next time) + } + z.l = p[n-1] + z.ls = unreadByteCanUnread + } + if firstByte { + n++ + } + return +} + +func (z *ioDecReader) ReadByte() (c byte, err error) { + n, err := z.Read(z.b[:1]) + if n == 1 { + c = z.b[0] + if err == io.EOF { + err = nil // read was successful, so postpone EOF (till next time) + } + } + return +} + +func (z *ioDecReader) UnreadByte() (err error) { + switch z.ls { + case unreadByteCanUnread: + z.ls = unreadByteCanRead + case unreadByteCanRead: + err = errDecUnreadByteLastByteNotRead + case unreadByteUndefined: + err = errDecUnreadByteNothingToRead + default: + err = errDecUnreadByteUnknown + } + return +} + +func (z *ioDecReader) readx(n uint) (bs []byte) { + if n == 0 { + return + } + if n < uint(len(z.x)) { + bs = z.x[:n] + } else { + bs = make([]byte, n) + } + if _, err := decReadFull(z.rr, bs); err != nil { panic(err) } + z.n += uint(len(bs)) + if z.trb { + z.tr = append(z.tr, bs...) + } return } func (z *ioDecReader) readb(bs []byte) { - if _, err := io.ReadAtLeast(z.r, bs, len(bs)); err != nil { + if len(bs) == 0 { + return + } + if _, err := decReadFull(z.rr, bs); err != nil { panic(err) } + z.n += uint(len(bs)) + if z.trb { + z.tr = append(z.tr, bs...) + } } -func (z *ioDecReader) readn1() uint8 { - if z.br != nil { - b, err := z.br.ReadByte() - if err != nil { - panic(err) +func (z *ioDecReader) readn1eof() (b uint8, eof bool) { + b, err := z.br.ReadByte() + if err == nil { + z.n++ + if z.trb { + z.tr = append(z.tr, b) } - return b + } else if err == io.EOF { + eof = true + } else { + panic(err) } - z.readb(z.x[:1]) - return z.x[0] + return +} + +func (z *ioDecReader) readn1() (b uint8) { + b, err := z.br.ReadByte() + if err == nil { + z.n++ + if z.trb { + z.tr = append(z.tr, b) + } + return + } + panic(err) +} + +func (z *ioDecReader) skip(accept *bitset256) (token byte) { + var eof bool + // for { + // token, eof = z.readn1eof() + // if eof { + // return + // } + // if accept.isset(token) { + // continue + // } + // return + // } +LOOP: + token, eof = z.readn1eof() + if eof { + return + } + if accept.isset(token) { + goto LOOP + } + return } -func (z *ioDecReader) readUint16() uint16 { - z.readb(z.x[:2]) - return bigen.Uint16(z.x[:2]) +func (z *ioDecReader) readTo(in []byte, accept *bitset256) []byte { + // out = in + + // for { + // token, eof := z.readn1eof() + // if eof { + // return + // } + // if accept.isset(token) { + // out = append(out, token) + // } else { + // z.unreadn1() + // return + // } + // } +LOOP: + token, eof := z.readn1eof() + if eof { + return in + } + if accept.isset(token) { + // out = append(out, token) + in = append(in, token) + goto LOOP + } + z.unreadn1() + return in } -func (z *ioDecReader) readUint32() uint32 { - z.readb(z.x[:4]) - return bigen.Uint32(z.x[:4]) +func (z *ioDecReader) readUntil(in []byte, stop byte) (out []byte) { + out = in + // for { + // token, eof := z.readn1eof() + // if eof { + // panic(io.EOF) + // } + // out = append(out, token) + // if token == stop { + // return + // } + // } +LOOP: + token, eof := z.readn1eof() + if eof { + panic(io.EOF) + } + out = append(out, token) + if token == stop { + return + } + goto LOOP } -func (z *ioDecReader) readUint64() uint64 { - z.readb(z.x[:8]) - return bigen.Uint64(z.x[:8]) +//go:noinline +func (z *ioDecReader) unreadn1() { + err := z.br.UnreadByte() + if err != nil { + panic(err) + } + z.n-- + if z.trb { + if l := len(z.tr) - 1; l >= 0 { + z.tr = z.tr[:l] + } + } } // ------------------------------------ -// bytesDecReader is a decReader that reads off a byte slice with zero copying -type bytesDecReader struct { - b []byte // data - c int // cursor - a int // available +type bufioDecReader struct { + ioDecReaderCommon + + c uint // cursor + buf []byte + + bytesBufPooler + + // err error + + // Extensions can call Decode() within a current Decode() call. + // We need to know when the top level Decode() call returns, + // so we can decide whether to Release() or not. + calls uint16 // what depth in mustDecode are we in now. + + _ [6]uint8 // padding + + _ [1]uint64 // padding } -func (z *bytesDecReader) consume(n int) (oldcursor int) { - if z.a == 0 { - panic(io.EOF) +func (z *bufioDecReader) reset(r io.Reader, bufsize int) { + z.ioDecReaderCommon.reset(r) + z.c = 0 + z.calls = 0 + if cap(z.buf) >= bufsize { + z.buf = z.buf[:0] + } else { + z.buf = z.bytesBufPooler.get(bufsize)[:0] + // z.buf = make([]byte, 0, bufsize) } - if n > z.a { - decErr("Trying to read %v bytes. Only %v available", n, z.a) +} + +func (z *bufioDecReader) release() { + z.buf = nil + z.bytesBufPooler.end() +} + +func (z *bufioDecReader) readb(p []byte) { + var n = uint(copy(p, z.buf[z.c:])) + z.n += n + z.c += n + if len(p) == int(n) { + if z.trb { + z.tr = append(z.tr, p...) // cost=9 + } + } else { + z.readbFill(p, n) } - // z.checkAvailable(n) - oldcursor = z.c - z.c = oldcursor + n - z.a = z.a - n - return } -func (z *bytesDecReader) readn(n int) (bs []byte) { - if n <= 0 { +//go:noinline - fallback when z.buf is consumed +func (z *bufioDecReader) readbFill(p0 []byte, n uint) { + // at this point, there's nothing in z.buf to read (z.buf is fully consumed) + p := p0[n:] + var n2 uint + var err error + if len(p) > cap(z.buf) { + n2, err = decReadFull(z.r, p) + if err != nil { + panic(err) + } + n += n2 + z.n += n2 + // always keep last byte in z.buf + z.buf = z.buf[:1] + z.buf[0] = p[len(p)-1] + z.c = 1 + if z.trb { + z.tr = append(z.tr, p0[:n]...) + } return } - c0 := z.consume(n) - bs = z.b[c0:z.c] - return + // z.c is now 0, and len(p) <= cap(z.buf) +LOOP: + // for len(p) > 0 && z.err == nil { + if len(p) > 0 { + z.buf = z.buf[0:cap(z.buf)] + var n1 int + n1, err = z.r.Read(z.buf) + n2 = uint(n1) + if n2 == 0 && err != nil { + panic(err) + } + z.buf = z.buf[:n2] + n2 = uint(copy(p, z.buf)) + z.c = n2 + n += n2 + z.n += n2 + p = p[n2:] + goto LOOP + } + if z.c == 0 { + z.buf = z.buf[:1] + z.buf[0] = p[len(p)-1] + z.c = 1 + } + if z.trb { + z.tr = append(z.tr, p0[:n]...) + } } -func (z *bytesDecReader) readb(bs []byte) { - copy(bs, z.readn(len(bs))) +func (z *bufioDecReader) readn1() (b byte) { + // fast-path, so we elide calling into Read() most of the time + if z.c < uint(len(z.buf)) { + b = z.buf[z.c] + z.c++ + z.n++ + if z.trb { + z.tr = append(z.tr, b) + } + } else { // meaning z.c == len(z.buf) or greater ... so need to fill + z.readbFill(z.b[:1], 0) + b = z.b[0] + } + return } -func (z *bytesDecReader) readn1() uint8 { - c0 := z.consume(1) - return z.b[c0] +func (z *bufioDecReader) unreadn1() { + if z.c == 0 { + panic(errDecUnreadByteNothingToRead) + } + z.c-- + z.n-- + if z.trb { + z.tr = z.tr[:len(z.tr)-1] + } } -// Use binaryEncoding helper for 4 and 8 bits, but inline it for 2 bits -// creating temp slice variable and copying it to helper function is expensive -// for just 2 bits. +func (z *bufioDecReader) readx(n uint) (bs []byte) { + if n == 0 { + // return + } else if z.c+n <= uint(len(z.buf)) { + bs = z.buf[z.c : z.c+n] + z.n += n + z.c += n + if z.trb { + z.tr = append(z.tr, bs...) + } + } else { + bs = make([]byte, n) + // n no longer used - can reuse + n = uint(copy(bs, z.buf[z.c:])) + z.n += n + z.c += n + z.readbFill(bs, n) + } + return +} -func (z *bytesDecReader) readUint16() uint16 { - c0 := z.consume(2) - return uint16(z.b[c0+1]) | uint16(z.b[c0])<<8 +//go:noinline - track called by Decoder.nextValueBytes() (called by jsonUnmarshal,rawBytes) +func (z *bufioDecReader) doTrack(y uint) { + z.tr = append(z.tr, z.buf[z.c:y]...) // cost=14??? } -func (z *bytesDecReader) readUint32() uint32 { - c0 := z.consume(4) - return bigen.Uint32(z.b[c0:z.c]) +func (z *bufioDecReader) skipLoopFn(i uint) { + z.n += (i - z.c) - 1 + i++ + if z.trb { + // z.tr = append(z.tr, z.buf[z.c:i]...) + z.doTrack(i) + } + z.c = i } -func (z *bytesDecReader) readUint64() uint64 { - c0 := z.consume(8) - return bigen.Uint64(z.b[c0:z.c]) +func (z *bufioDecReader) skip(accept *bitset256) (token byte) { + // token, _ = z.search(nil, accept, 0, 1); return + + // for i := z.c; i < len(z.buf); i++ { + // if token = z.buf[i]; !accept.isset(token) { + // z.skipLoopFn(i) + // return + // } + // } + + i := z.c +LOOP: + if i < uint(len(z.buf)) { + // inline z.skipLoopFn(i) and refactor, so cost is within inline budget + token = z.buf[i] + i++ + if accept.isset(token) { + goto LOOP + } + z.n += i - 2 - z.c + if z.trb { + z.doTrack(i) + } + z.c = i + return + } + return z.skipFill(accept) } -// ------------------------------------ +func (z *bufioDecReader) skipFill(accept *bitset256) (token byte) { + z.n += uint(len(z.buf)) - z.c + if z.trb { + z.tr = append(z.tr, z.buf[z.c:]...) + } + var n2 int + var err error + for { + z.c = 0 + z.buf = z.buf[0:cap(z.buf)] + n2, err = z.r.Read(z.buf) + if n2 == 0 && err != nil { + panic(err) + } + z.buf = z.buf[:n2] + var i int + for i, token = range z.buf { + if !accept.isset(token) { + z.skipLoopFn(uint(i)) + return + } + } + // for i := 0; i < n2; i++ { + // if token = z.buf[i]; !accept.isset(token) { + // z.skipLoopFn(i) + // return + // } + // } + z.n += uint(n2) + if z.trb { + z.tr = append(z.tr, z.buf...) + } + } +} -// decFnInfo has methods for registering handling decoding of a specific type -// based on some characteristics (builtin, extension, reflect Kind, etc) -type decFnInfo struct { - ti *typeInfo - d *Decoder - dd decDriver - xfFn func(reflect.Value, []byte) error - xfTag byte - array bool +func (z *bufioDecReader) readToLoopFn(i uint, out0 []byte) (out []byte) { + // out0 is never nil + z.n += (i - z.c) - 1 + out = append(out0, z.buf[z.c:i]...) + if z.trb { + z.doTrack(i) + } + z.c = i + return } -func (f *decFnInfo) builtin(rv reflect.Value) { - f.dd.decodeBuiltin(f.ti.rtid, rv.Addr().Interface()) +func (z *bufioDecReader) readTo(in []byte, accept *bitset256) (out []byte) { + // _, out = z.search(in, accept, 0, 2); return + + // for i := z.c; i < len(z.buf); i++ { + // if !accept.isset(z.buf[i]) { + // return z.readToLoopFn(i, nil) + // } + // } + + i := z.c +LOOP: + if i < uint(len(z.buf)) { + if !accept.isset(z.buf[i]) { + // return z.readToLoopFn(i, nil) + // inline readToLoopFn here (for performance) + z.n += (i - z.c) - 1 + out = z.buf[z.c:i] + if z.trb { + z.doTrack(i) + } + z.c = i + return + } + i++ + goto LOOP + } + return z.readToFill(in, accept) } -func (f *decFnInfo) rawExt(rv reflect.Value) { - xtag, xbs := f.dd.decodeExt(false, 0) - rv.Field(0).SetUint(uint64(xtag)) - rv.Field(1).SetBytes(xbs) +func (z *bufioDecReader) readToFill(in []byte, accept *bitset256) (out []byte) { + z.n += uint(len(z.buf)) - z.c + out = append(in, z.buf[z.c:]...) + if z.trb { + z.tr = append(z.tr, z.buf[z.c:]...) + } + var n2 int + var err error + for { + z.c = 0 + z.buf = z.buf[0:cap(z.buf)] + n2, err = z.r.Read(z.buf) + if n2 == 0 && err != nil { + if err == io.EOF { + return // readTo should read until it matches or end is reached + } + panic(err) + } + z.buf = z.buf[:n2] + for i, token := range z.buf { + if !accept.isset(token) { + return z.readToLoopFn(uint(i), out) + } + } + // for i := 0; i < n2; i++ { + // if !accept.isset(z.buf[i]) { + // return z.readToLoopFn(i, out) + // } + // } + out = append(out, z.buf...) + z.n += uint(n2) + if z.trb { + z.tr = append(z.tr, z.buf...) + } + } } -func (f *decFnInfo) ext(rv reflect.Value) { - _, xbs := f.dd.decodeExt(true, f.xfTag) - if fnerr := f.xfFn(rv, xbs); fnerr != nil { - panic(fnerr) +func (z *bufioDecReader) readUntilLoopFn(i uint, out0 []byte) (out []byte) { + z.n += (i - z.c) - 1 + i++ + out = append(out0, z.buf[z.c:i]...) + if z.trb { + // z.tr = append(z.tr, z.buf[z.c:i]...) + z.doTrack(i) } + z.c = i + return } -func (f *decFnInfo) binaryMarshal(rv reflect.Value) { - var bm binaryUnmarshaler - if f.ti.unmIndir == -1 { - bm = rv.Addr().Interface().(binaryUnmarshaler) - } else if f.ti.unmIndir == 0 { - bm = rv.Interface().(binaryUnmarshaler) - } else { - for j, k := int8(0), f.ti.unmIndir; j < k; j++ { - if rv.IsNil() { - rv.Set(reflect.New(rv.Type().Elem())) +func (z *bufioDecReader) readUntil(in []byte, stop byte) (out []byte) { + // _, out = z.search(in, nil, stop, 4); return + + // for i := z.c; i < len(z.buf); i++ { + // if z.buf[i] == stop { + // return z.readUntilLoopFn(i, nil) + // } + // } + + i := z.c +LOOP: + if i < uint(len(z.buf)) { + if z.buf[i] == stop { + // inline readUntilLoopFn + // return z.readUntilLoopFn(i, nil) + z.n += (i - z.c) - 1 + i++ + out = z.buf[z.c:i] + if z.trb { + z.doTrack(i) } - rv = rv.Elem() + z.c = i + return } - bm = rv.Interface().(binaryUnmarshaler) - } - xbs, _ := f.dd.decodeBytes(nil) - if fnerr := bm.UnmarshalBinary(xbs); fnerr != nil { - panic(fnerr) + i++ + goto LOOP } + return z.readUntilFill(in, stop) } -func (f *decFnInfo) kErr(rv reflect.Value) { - decErr("Unhandled value for kind: %v: %s", rv.Kind(), msgBadDesc) +func (z *bufioDecReader) readUntilFill(in []byte, stop byte) (out []byte) { + z.n += uint(len(z.buf)) - z.c + out = append(in, z.buf[z.c:]...) + if z.trb { + z.tr = append(z.tr, z.buf[z.c:]...) + } + var n1 int + var n2 uint + var err error + for { + z.c = 0 + z.buf = z.buf[0:cap(z.buf)] + n1, err = z.r.Read(z.buf) + n2 = uint(n1) + if n2 == 0 && err != nil { + panic(err) + } + z.buf = z.buf[:n2] + for i, token := range z.buf { + if token == stop { + return z.readUntilLoopFn(uint(i), out) + } + } + // for i := 0; i < n2; i++ { + // if z.buf[i] == stop { + // return z.readUntilLoopFn(i, out) + // } + // } + out = append(out, z.buf...) + z.n += n2 + if z.trb { + z.tr = append(z.tr, z.buf...) + } + } } -func (f *decFnInfo) kString(rv reflect.Value) { - rv.SetString(f.dd.decodeString()) +// ------------------------------------ + +var errBytesDecReaderCannotUnread = errors.New("cannot unread last byte read") + +// bytesDecReader is a decReader that reads off a byte slice with zero copying +type bytesDecReader struct { + b []byte // data + c uint // cursor + t uint // track start + // a int // available } -func (f *decFnInfo) kBool(rv reflect.Value) { - rv.SetBool(f.dd.decodeBool()) +func (z *bytesDecReader) reset(in []byte) { + z.b = in + // z.a = len(in) + z.c = 0 + z.t = 0 } -func (f *decFnInfo) kInt(rv reflect.Value) { - rv.SetInt(f.dd.decodeInt(intBitsize)) +func (z *bytesDecReader) numread() uint { + return z.c } -func (f *decFnInfo) kInt64(rv reflect.Value) { - rv.SetInt(f.dd.decodeInt(64)) +func (z *bytesDecReader) unreadn1() { + if z.c == 0 || len(z.b) == 0 { + panic(errBytesDecReaderCannotUnread) + } + z.c-- + // z.a++ } -func (f *decFnInfo) kInt32(rv reflect.Value) { - rv.SetInt(f.dd.decodeInt(32)) +func (z *bytesDecReader) readx(n uint) (bs []byte) { + // slicing from a non-constant start position is more expensive, + // as more computation is required to decipher the pointer start position. + // However, we do it only once, and it's better than reslicing both z.b and return value. + + // if n <= 0 { + // } else if z.a == 0 { + // panic(io.EOF) + // } else if n > z.a { + // panic(io.ErrUnexpectedEOF) + // } else { + // c0 := z.c + // z.c = c0 + n + // z.a = z.a - n + // bs = z.b[c0:z.c] + // } + // return + + if n != 0 { + z.c += n + if z.c > uint(len(z.b)) { + z.c = uint(len(z.b)) + panic(io.EOF) + } + bs = z.b[z.c-n : z.c] + } + return + + // if n == 0 { + // } else if z.c+n > uint(len(z.b)) { + // z.c = uint(len(z.b)) + // panic(io.EOF) + // } else { + // z.c += n + // bs = z.b[z.c-n : z.c] + // } + // return + + // if n == 0 { + // return + // } + // if z.c == uint(len(z.b)) { + // panic(io.EOF) + // } + // if z.c+n > uint(len(z.b)) { + // panic(io.ErrUnexpectedEOF) + // } + // // z.a -= n + // z.c += n + // return z.b[z.c-n : z.c] } -func (f *decFnInfo) kInt8(rv reflect.Value) { - rv.SetInt(f.dd.decodeInt(8)) +func (z *bytesDecReader) readb(bs []byte) { + copy(bs, z.readx(uint(len(bs)))) } -func (f *decFnInfo) kInt16(rv reflect.Value) { - rv.SetInt(f.dd.decodeInt(16)) +func (z *bytesDecReader) readn1() (v uint8) { + if z.c == uint(len(z.b)) { + panic(io.EOF) + } + v = z.b[z.c] + z.c++ + // z.a-- + return } -func (f *decFnInfo) kFloat32(rv reflect.Value) { - rv.SetFloat(f.dd.decodeFloat(true)) +// func (z *bytesDecReader) readn1eof() (v uint8, eof bool) { +// if z.a == 0 { +// eof = true +// return +// } +// v = z.b[z.c] +// z.c++ +// z.a-- +// return +// } + +func (z *bytesDecReader) skip(accept *bitset256) (token byte) { + i := z.c + // if i == len(z.b) { + // goto END + // // panic(io.EOF) + // } + + // Replace loop with goto construct, so that this can be inlined + // for i := z.c; i < blen; i++ { + // if !accept.isset(z.b[i]) { + // token = z.b[i] + // i++ + // z.a -= (i - z.c) + // z.c = i + // return + // } + // } + + // i := z.c +LOOP: + if i < uint(len(z.b)) { + token = z.b[i] + i++ + if accept.isset(token) { + goto LOOP + } + // z.a -= (i - z.c) + z.c = i + return + } + // END: + panic(io.EOF) + // // z.a = 0 + // z.c = blen + // return } -func (f *decFnInfo) kFloat64(rv reflect.Value) { - rv.SetFloat(f.dd.decodeFloat(false)) +func (z *bytesDecReader) readTo(_ []byte, accept *bitset256) (out []byte) { + return z.readToNoInput(accept) } -func (f *decFnInfo) kUint8(rv reflect.Value) { - rv.SetUint(f.dd.decodeUint(8)) +func (z *bytesDecReader) readToNoInput(accept *bitset256) (out []byte) { + i := z.c + if i == uint(len(z.b)) { + panic(io.EOF) + } + + // Replace loop with goto construct, so that this can be inlined + // for i := z.c; i < blen; i++ { + // if !accept.isset(z.b[i]) { + // out = z.b[z.c:i] + // z.a -= (i - z.c) + // z.c = i + // return + // } + // } + // out = z.b[z.c:] + // z.a, z.c = 0, blen + // return + + // i := z.c + // LOOP: + // if i < blen { + // if accept.isset(z.b[i]) { + // i++ + // goto LOOP + // } + // out = z.b[z.c:i] + // z.a -= (i - z.c) + // z.c = i + // return + // } + // out = z.b[z.c:] + // // z.a, z.c = 0, blen + // z.a = 0 + // z.c = blen + // return + + // c := i +LOOP: + if i < uint(len(z.b)) { + if accept.isset(z.b[i]) { + i++ + goto LOOP + } + } + + out = z.b[z.c:i] + // z.a -= (i - z.c) + z.c = i + return // z.b[c:i] + // z.c, i = i, z.c + // return z.b[i:z.c] } -func (f *decFnInfo) kUint64(rv reflect.Value) { - rv.SetUint(f.dd.decodeUint(64)) +func (z *bytesDecReader) readUntil(_ []byte, stop byte) (out []byte) { + return z.readUntilNoInput(stop) } -func (f *decFnInfo) kUint(rv reflect.Value) { - rv.SetUint(f.dd.decodeUint(uintBitsize)) +func (z *bytesDecReader) readUntilNoInput(stop byte) (out []byte) { + i := z.c + // if i == len(z.b) { + // panic(io.EOF) + // } + + // Replace loop with goto construct, so that this can be inlined + // for i := z.c; i < blen; i++ { + // if z.b[i] == stop { + // i++ + // out = z.b[z.c:i] + // z.a -= (i - z.c) + // z.c = i + // return + // } + // } +LOOP: + if i < uint(len(z.b)) { + if z.b[i] == stop { + i++ + out = z.b[z.c:i] + // z.a -= (i - z.c) + z.c = i + return + } + i++ + goto LOOP + } + // z.a = 0 + // z.c = blen + panic(io.EOF) } -func (f *decFnInfo) kUint32(rv reflect.Value) { - rv.SetUint(f.dd.decodeUint(32)) +func (z *bytesDecReader) track() { + z.t = z.c } -func (f *decFnInfo) kUint16(rv reflect.Value) { - rv.SetUint(f.dd.decodeUint(16)) +func (z *bytesDecReader) stopTrack() (bs []byte) { + return z.b[z.t:z.c] } -// func (f *decFnInfo) kPtr(rv reflect.Value) { -// debugf(">>>>>>> ??? decode kPtr called - shouldn't get called") -// if rv.IsNil() { -// rv.Set(reflect.New(rv.Type().Elem())) -// } -// f.d.decodeValue(rv.Elem()) +// ---------------------------------------- + +// func (d *Decoder) builtin(f *codecFnInfo, rv reflect.Value) { +// d.d.DecodeBuiltin(f.ti.rtid, rv2i(rv)) // } -func (f *decFnInfo) kInterface(rv reflect.Value) { - // debugf("\t===> kInterface") - if !rv.IsNil() { - f.d.decodeValue(rv.Elem()) - return +func (d *Decoder) rawExt(f *codecFnInfo, rv reflect.Value) { + d.d.DecodeExt(rv2i(rv), 0, nil) +} + +func (d *Decoder) ext(f *codecFnInfo, rv reflect.Value) { + d.d.DecodeExt(rv2i(rv), f.xfTag, f.xfFn) +} + +func (d *Decoder) selferUnmarshal(f *codecFnInfo, rv reflect.Value) { + rv2i(rv).(Selfer).CodecDecodeSelf(d) +} + +func (d *Decoder) binaryUnmarshal(f *codecFnInfo, rv reflect.Value) { + bm := rv2i(rv).(encoding.BinaryUnmarshaler) + xbs := d.d.DecodeBytes(nil, true) + if fnerr := bm.UnmarshalBinary(xbs); fnerr != nil { + panic(fnerr) } +} + +func (d *Decoder) textUnmarshal(f *codecFnInfo, rv reflect.Value) { + tm := rv2i(rv).(encoding.TextUnmarshaler) + fnerr := tm.UnmarshalText(d.d.DecodeStringAsBytes()) + if fnerr != nil { + panic(fnerr) + } +} + +func (d *Decoder) jsonUnmarshal(f *codecFnInfo, rv reflect.Value) { + tm := rv2i(rv).(jsonUnmarshaler) + // bs := d.d.DecodeBytes(d.b[:], true, true) + // grab the bytes to be read, as UnmarshalJSON needs the full JSON so as to unmarshal it itself. + fnerr := tm.UnmarshalJSON(d.nextValueBytes()) + if fnerr != nil { + panic(fnerr) + } +} + +func (d *Decoder) kErr(f *codecFnInfo, rv reflect.Value) { + d.errorf("no decoding function defined for kind %v", rv.Kind()) +} + +// var kIntfCtr uint64 + +func (d *Decoder) kInterfaceNaked(f *codecFnInfo) (rvn reflect.Value) { // nil interface: - // use some hieristics to set the nil interface to an - // appropriate value based on the first byte read (byte descriptor bd) - v, vt, decodeFurther := f.dd.decodeNaked() - if vt == valueTypeNil { + // use some hieristics to decode it appropriately + // based on the detected next value in the stream. + n := d.naked() + d.d.DecodeNaked() + if n.v == valueTypeNil { return } - // Cannot decode into nil interface with methods (e.g. error, io.Reader, etc) - // if non-nil value in stream. - if num := f.ti.rt.NumMethod(); num > 0 { - decErr("decodeValue: Cannot decode non-nil codec value into nil %v (%v methods)", - f.ti.rt, num) + // We cannot decode non-nil stream value into nil interface with methods (e.g. io.Reader). + if f.ti.numMeth > 0 { + d.errorf("cannot decode non-nil codec value into nil %v (%v methods)", f.ti.rt, f.ti.numMeth) + return } - var rvn reflect.Value - var useRvn bool - switch vt { + // var useRvn bool + switch n.v { case valueTypeMap: - if f.d.h.MapType == nil { - var m2 map[interface{}]interface{} - v = &m2 + // if json, default to a map type with string keys + mtid := d.mtid + if mtid == 0 { + if d.jsms { + mtid = mapStrIntfTypId + } else { + mtid = mapIntfIntfTypId + } + } + if mtid == mapIntfIntfTypId { + var v2 map[interface{}]interface{} + d.decode(&v2) + rvn = reflect.ValueOf(&v2).Elem() + } else if mtid == mapStrIntfTypId { // for json performance + var v2 map[string]interface{} + d.decode(&v2) + rvn = reflect.ValueOf(&v2).Elem() } else { - rvn = reflect.New(f.d.h.MapType).Elem() - useRvn = true + if d.mtr { + rvn = reflect.New(d.h.MapType) + d.decode(rv2i(rvn)) + rvn = rvn.Elem() + } else { + rvn = reflect.New(d.h.MapType).Elem() + d.decodeValue(rvn, nil, true) + } } case valueTypeArray: - if f.d.h.SliceType == nil { - var m2 []interface{} - v = &m2 + if d.stid == 0 || d.stid == intfSliceTypId { + var v2 []interface{} + d.decode(&v2) + rvn = reflect.ValueOf(&v2).Elem() + if reflectArrayOfSupported && d.stid == 0 && d.h.PreferArrayOverSlice { + rvn2 := reflect.New(reflectArrayOf(rvn.Len(), intfTyp)).Elem() + reflect.Copy(rvn2, rvn) + rvn = rvn2 + } } else { - rvn = reflect.New(f.d.h.SliceType).Elem() - useRvn = true + if d.str { + rvn = reflect.New(d.h.SliceType) + d.decode(rv2i(rvn)) + rvn = rvn.Elem() + } else { + rvn = reflect.New(d.h.SliceType).Elem() + d.decodeValue(rvn, nil, true) + } } case valueTypeExt: - re := v.(*RawExt) - var bfn func(reflect.Value, []byte) error - rvn, bfn = f.d.h.getDecodeExtForTag(re.Tag) + var v interface{} + tag, bytes := n.u, n.l // calling decode below might taint the values + if bytes == nil { + d.decode(&v) + } + bfn := d.h.getExtForTag(tag) if bfn == nil { - rvn = reflect.ValueOf(*re) - } else if fnerr := bfn(rvn, re.Data); fnerr != nil { - panic(fnerr) + var re RawExt + re.Tag = tag + re.Data = detachZeroCopyBytes(d.bytes, nil, bytes) + re.Value = v + rvn = reflect.ValueOf(&re).Elem() + } else { + rvnA := reflect.New(bfn.rt) + if bytes != nil { + bfn.ext.ReadExt(rv2i(rvnA), bytes) + } else { + bfn.ext.UpdateExt(rv2i(rvnA), v) + } + rvn = rvnA.Elem() } - rv.Set(rvn) - return + case valueTypeNil: + // no-op + case valueTypeInt: + rvn = n.ri() + case valueTypeUint: + rvn = n.ru() + case valueTypeFloat: + rvn = n.rf() + case valueTypeBool: + rvn = n.rb() + case valueTypeString, valueTypeSymbol: + rvn = n.rs() + case valueTypeBytes: + rvn = n.rl() + case valueTypeTime: + rvn = n.rt() + default: + panicv.errorf("kInterfaceNaked: unexpected valueType: %d", n.v) } - if decodeFurther { - if useRvn { - f.d.decodeValue(rvn) - } else if v != nil { - // this v is a pointer, so we need to dereference it when done - f.d.decode(v) - rvn = reflect.ValueOf(v).Elem() - useRvn = true + return +} + +func (d *Decoder) kInterface(f *codecFnInfo, rv reflect.Value) { + // Note: + // A consequence of how kInterface works, is that + // if an interface already contains something, we try + // to decode into what was there before. + // We do not replace with a generic value (as got from decodeNaked). + + // every interface passed here MUST be settable. + var rvn reflect.Value + if rv.IsNil() || d.h.InterfaceReset { + // check if mapping to a type: if so, initialize it and move on + rvn = d.h.intf2impl(f.ti.rtid) + if rvn.IsValid() { + rv.Set(rvn) + } else { + rvn = d.kInterfaceNaked(f) + if rvn.IsValid() { + rv.Set(rvn) + } else if d.h.InterfaceReset { + // reset to zero value based on current type in there. + rv.Set(reflect.Zero(rv.Elem().Type())) + } + return } + } else { + // now we have a non-nil interface value, meaning it contains a type + rvn = rv.Elem() } - if useRvn { - rv.Set(rvn) - } else if v != nil { - rv.Set(reflect.ValueOf(v)) + if d.d.TryDecodeAsNil() { + rv.Set(reflect.Zero(rvn.Type())) + return + } + + // Note: interface{} is settable, but underlying type may not be. + // Consequently, we MAY have to create a decodable value out of the underlying value, + // decode into it, and reset the interface itself. + // fmt.Printf(">>>> kInterface: rvn type: %v, rv type: %v\n", rvn.Type(), rv.Type()) + + rvn2, canDecode := isDecodeable(rvn) + if canDecode { + d.decodeValue(rvn2, nil, true) + return + } + + rvn2 = reflect.New(rvn.Type()).Elem() + rvn2.Set(rvn) + d.decodeValue(rvn2, nil, true) + rv.Set(rvn2) +} + +func decStructFieldKey(dd decDriver, keyType valueType, b *[decScratchByteArrayLen]byte) (rvkencname []byte) { + // use if-else-if, not switch (which compiles to binary-search) + // since keyType is typically valueTypeString, branch prediction is pretty good. + + if keyType == valueTypeString { + rvkencname = dd.DecodeStringAsBytes() + } else if keyType == valueTypeInt { + rvkencname = strconv.AppendInt(b[:0], dd.DecodeInt64(), 10) + } else if keyType == valueTypeUint { + rvkencname = strconv.AppendUint(b[:0], dd.DecodeUint64(), 10) + } else if keyType == valueTypeFloat { + rvkencname = strconv.AppendFloat(b[:0], dd.DecodeFloat64(), 'f', -1, 64) + } else { + rvkencname = dd.DecodeStringAsBytes() } + return rvkencname } -func (f *decFnInfo) kStruct(rv reflect.Value) { +func (d *Decoder) kStruct(f *codecFnInfo, rv reflect.Value) { fti := f.ti - if currEncodedType := f.dd.currentEncodedType(); currEncodedType == valueTypeMap { - containerLen := f.dd.readMapLen() + dd := d.d + elemsep := d.esep + sfn := structFieldNode{v: rv, update: true} + ctyp := dd.ContainerType() + var mf MissingFielder + if fti.mf { + mf = rv2i(rv).(MissingFielder) + } else if fti.mfp { + mf = rv2i(rv.Addr()).(MissingFielder) + } + if ctyp == valueTypeMap { + containerLen := dd.ReadMapStart() if containerLen == 0 { + dd.ReadMapEnd() return } - tisfi := fti.sfi - for j := 0; j < containerLen; j++ { - // var rvkencname string - // ddecode(&rvkencname) - f.dd.initReadNext() - rvkencname := f.dd.decodeString() - // rvksi := ti.getForEncName(rvkencname) + d.depthIncr() + tisfi := fti.sfiSort + hasLen := containerLen >= 0 + + var rvkencname []byte + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if elemsep { + dd.ReadMapElemKey() + } + rvkencname = decStructFieldKey(dd, fti.keyType, &d.b) + if elemsep { + dd.ReadMapElemValue() + } if k := fti.indexForEncName(rvkencname); k > -1 { - sfik := tisfi[k] - if sfik.i != -1 { - f.d.decodeValue(rv.Field(int(sfik.i))) + si := tisfi[k] + if dd.TryDecodeAsNil() { + si.setToZeroValue(rv) } else { - f.d.decEmbeddedField(rv, sfik.is) + d.decodeValue(sfn.field(si), nil, true) } - // f.d.decodeValue(ti.field(k, rv)) - } else { - if f.d.h.ErrorIfNoField { - decErr("No matching struct field found when decoding stream map with key: %v", - rvkencname) - } else { - var nilintf0 interface{} - f.d.decodeValue(reflect.ValueOf(&nilintf0).Elem()) + } else if mf != nil { + // store rvkencname in new []byte, as it previously shares Decoder.b, which is used in decode + name2 := rvkencname + rvkencname = make([]byte, len(rvkencname)) + copy(rvkencname, name2) + + var f interface{} + // xdebugf("kStruct: mf != nil: before decode: rvkencname: %s", rvkencname) + d.decode(&f) + // xdebugf("kStruct: mf != nil: after decode: rvkencname: %s", rvkencname) + if !mf.CodecMissingField(rvkencname, f) && d.h.ErrorIfNoField { + d.errorf("no matching struct field found when decoding stream map with key: %s ", + stringView(rvkencname)) } + } else { + d.structFieldNotFound(-1, stringView(rvkencname)) } + // keepAlive4StringView(rvkencnameB) // not needed, as reference is outside loop } - } else if currEncodedType == valueTypeArray { - containerLen := f.dd.readArrayLen() + dd.ReadMapEnd() + d.depthDecr() + } else if ctyp == valueTypeArray { + containerLen := dd.ReadArrayStart() if containerLen == 0 { + dd.ReadArrayEnd() return } - for j, si := range fti.sfip { - if j == containerLen { + d.depthIncr() + // Not much gain from doing it two ways for array. + // Arrays are not used as much for structs. + hasLen := containerLen >= 0 + var checkbreak bool + for j, si := range fti.sfiSrc { + if hasLen && j == containerLen { break } - if si.i != -1 { - f.d.decodeValue(rv.Field(int(si.i))) + if !hasLen && dd.CheckBreak() { + checkbreak = true + break + } + if elemsep { + dd.ReadArrayElem() + } + if dd.TryDecodeAsNil() { + si.setToZeroValue(rv) } else { - f.d.decEmbeddedField(rv, si.is) + d.decodeValue(sfn.field(si), nil, true) } } - if containerLen > len(fti.sfip) { + if (hasLen && containerLen > len(fti.sfiSrc)) || (!hasLen && !checkbreak) { // read remaining values and throw away - for j := len(fti.sfip); j < containerLen; j++ { - var nilintf0 interface{} - f.d.decodeValue(reflect.ValueOf(&nilintf0).Elem()) + for j := len(fti.sfiSrc); ; j++ { + if (hasLen && j == containerLen) || (!hasLen && dd.CheckBreak()) { + break + } + if elemsep { + dd.ReadArrayElem() + } + d.structFieldNotFound(j, "") } } + dd.ReadArrayEnd() + d.depthDecr() } else { - decErr("Only encoded map or array can be decoded into a struct. (valueType: %x)", - currEncodedType) + d.errorstr(errstrOnlyMapOrArrayCanDecodeIntoStruct) + return } } -func (f *decFnInfo) kSlice(rv reflect.Value) { +func (d *Decoder) kSlice(f *codecFnInfo, rv reflect.Value) { // A slice can be set from a map or array in stream. - currEncodedType := f.dd.currentEncodedType() + // This way, the order can be kept (as order is lost with map). + ti := f.ti + if f.seq == seqTypeChan && ti.chandir&uint8(reflect.SendDir) == 0 { + d.errorf("receive-only channel cannot be decoded") + } + dd := d.d + rtelem0 := ti.elem + ctyp := dd.ContainerType() + if ctyp == valueTypeBytes || ctyp == valueTypeString { + // you can only decode bytes or string in the stream into a slice or array of bytes + if !(ti.rtid == uint8SliceTypId || rtelem0.Kind() == reflect.Uint8) { + d.errorf("bytes/string in stream must decode into slice/array of bytes, not %v", ti.rt) + } + if f.seq == seqTypeChan { + bs2 := dd.DecodeBytes(nil, true) + irv := rv2i(rv) + ch, ok := irv.(chan<- byte) + if !ok { + ch = irv.(chan byte) + } + for _, b := range bs2 { + ch <- b + } + } else { + rvbs := rv.Bytes() + bs2 := dd.DecodeBytes(rvbs, false) + // if rvbs == nil && bs2 != nil || rvbs != nil && bs2 == nil || len(bs2) != len(rvbs) { + if !(len(bs2) > 0 && len(bs2) == len(rvbs) && &bs2[0] == &rvbs[0]) { + if rv.CanSet() { + rv.SetBytes(bs2) + } else if len(rvbs) > 0 && len(bs2) > 0 { + copy(rvbs, bs2) + } + } + } + return + } - switch currEncodedType { - case valueTypeBytes, valueTypeString: - if f.ti.rtid == uint8SliceTypId || f.ti.rt.Elem().Kind() == reflect.Uint8 { - if bs2, changed2 := f.dd.decodeBytes(rv.Bytes()); changed2 { - rv.SetBytes(bs2) + // array := f.seq == seqTypeChan + + slh, containerLenS := d.decSliceHelperStart() // only expects valueType(Array|Map) + + // an array can never return a nil slice. so no need to check f.array here. + if containerLenS == 0 { + if rv.CanSet() { + if f.seq == seqTypeSlice { + if rv.IsNil() { + rv.Set(reflect.MakeSlice(ti.rt, 0, 0)) + } else { + rv.SetLen(0) + } + } else if f.seq == seqTypeChan { + if rv.IsNil() { + rv.Set(reflect.MakeChan(ti.rt, 0)) + } } - return } + slh.End() + return } - if shortCircuitReflectToFastPath && rv.CanAddr() { - switch f.ti.rtid { - case intfSliceTypId: - f.d.decSliceIntf(rv.Addr().Interface().(*[]interface{}), currEncodedType, f.array) - return - case uint64SliceTypId: - f.d.decSliceUint64(rv.Addr().Interface().(*[]uint64), currEncodedType, f.array) - return - case int64SliceTypId: - f.d.decSliceInt64(rv.Addr().Interface().(*[]int64), currEncodedType, f.array) - return - case strSliceTypId: - f.d.decSliceStr(rv.Addr().Interface().(*[]string), currEncodedType, f.array) - return + d.depthIncr() + + rtelem0Size := int(rtelem0.Size()) + rtElem0Kind := rtelem0.Kind() + rtelem0Mut := !isImmutableKind(rtElem0Kind) + rtelem := rtelem0 + rtelemkind := rtelem.Kind() + for rtelemkind == reflect.Ptr { + rtelem = rtelem.Elem() + rtelemkind = rtelem.Kind() + } + + var fn *codecFn + + var rvCanset = rv.CanSet() + var rvChanged bool + var rv0 = rv + var rv9 reflect.Value + + rvlen := rv.Len() + rvcap := rv.Cap() + hasLen := containerLenS > 0 + if hasLen && f.seq == seqTypeSlice { + if containerLenS > rvcap { + oldRvlenGtZero := rvlen > 0 + rvlen = decInferLen(containerLenS, d.h.MaxInitLen, int(rtelem0.Size())) + if rvlen <= rvcap { + if rvCanset { + rv.SetLen(rvlen) + } + } else if rvCanset { + rv = reflect.MakeSlice(ti.rt, rvlen, rvlen) + rvcap = rvlen + rvChanged = true + } else { + d.errorf("cannot decode into non-settable slice") + } + if rvChanged && oldRvlenGtZero && !isImmutableKind(rtelem0.Kind()) { + reflect.Copy(rv, rv0) // only copy up to length NOT cap i.e. rv0.Slice(0, rvcap) + } + } else if containerLenS != rvlen { + rvlen = containerLenS + if rvCanset { + rv.SetLen(rvlen) + } + // else { + // rv = rv.Slice(0, rvlen) + // rvChanged = true + // d.errorf("cannot decode into non-settable slice") + // } } } - containerLen, containerLenS := decContLens(f.dd, currEncodedType) + // consider creating new element once, and just decoding into it. + var rtelem0Zero reflect.Value + var rtelem0ZeroValid bool + var decodeAsNil bool + var j int + + for ; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { + if j == 0 && (f.seq == seqTypeSlice || f.seq == seqTypeChan) && rv.IsNil() { + if hasLen { + rvlen = decInferLen(containerLenS, d.h.MaxInitLen, rtelem0Size) + } else if f.seq == seqTypeSlice { + rvlen = decDefSliceCap + } else { + rvlen = decDefChanCap + } + if rvCanset { + if f.seq == seqTypeSlice { + rv = reflect.MakeSlice(ti.rt, rvlen, rvlen) + rvChanged = true + } else { // chan + rv = reflect.MakeChan(ti.rt, rvlen) + rvChanged = true + } + } else { + d.errorf("cannot decode into non-settable slice") + } + } + slh.ElemContainerState(j) + decodeAsNil = dd.TryDecodeAsNil() + if f.seq == seqTypeChan { + if decodeAsNil { + rv.Send(reflect.Zero(rtelem0)) + continue + } + if rtelem0Mut || !rv9.IsValid() { // || (rtElem0Kind == reflect.Ptr && rv9.IsNil()) { + rv9 = reflect.New(rtelem0).Elem() + } + if fn == nil { + fn = d.h.fn(rtelem, true, true) + } + d.decodeValue(rv9, fn, true) + rv.Send(rv9) + } else { + // if indefinite, etc, then expand the slice if necessary + var decodeIntoBlank bool + if j >= rvlen { + if f.seq == seqTypeArray { + d.arrayCannotExpand(rvlen, j+1) + decodeIntoBlank = true + } else { // if f.seq == seqTypeSlice + // rv = reflect.Append(rv, reflect.Zero(rtelem0)) // append logic + varargs + var rvcap2 int + var rvErrmsg2 string + rv9, rvcap2, rvChanged, rvErrmsg2 = + expandSliceRV(rv, ti.rt, rvCanset, rtelem0Size, 1, rvlen, rvcap) + if rvErrmsg2 != "" { + d.errorf(rvErrmsg2) + } + rvlen++ + if rvChanged { + rv = rv9 + rvcap = rvcap2 + } + } + } + if decodeIntoBlank { + if !decodeAsNil { + d.swallow() + } + } else { + rv9 = rv.Index(j) + if d.h.SliceElementReset || decodeAsNil { + if !rtelem0ZeroValid { + rtelem0ZeroValid = true + rtelem0Zero = reflect.Zero(rtelem0) + } + rv9.Set(rtelem0Zero) + if decodeAsNil { + continue + } + } - // an array can never return a nil slice. so no need to check f.array here. + if fn == nil { + fn = d.h.fn(rtelem, true, true) + } + d.decodeValue(rv9, fn, true) + } + } + } + if f.seq == seqTypeSlice { + if j < rvlen { + if rv.CanSet() { + rv.SetLen(j) + } else if rvCanset { + rv = rv.Slice(0, j) + rvChanged = true + } // else { d.errorf("kSlice: cannot change non-settable slice") } + rvlen = j + } else if j == 0 && rv.IsNil() { + if rvCanset { + rv = reflect.MakeSlice(ti.rt, 0, 0) + rvChanged = true + } // else { d.errorf("kSlice: cannot change non-settable slice") } + } + } + slh.End() + + if rvChanged { // infers rvCanset=true, so it can be reset + rv0.Set(rv) + } + + d.depthDecr() +} +// func (d *Decoder) kArray(f *codecFnInfo, rv reflect.Value) { +// // d.decodeValueFn(rv.Slice(0, rv.Len())) +// f.kSlice(rv.Slice(0, rv.Len())) +// } + +func (d *Decoder) kMap(f *codecFnInfo, rv reflect.Value) { + dd := d.d + containerLen := dd.ReadMapStart() + elemsep := d.esep + ti := f.ti if rv.IsNil() { - rv.Set(reflect.MakeSlice(f.ti.rt, containerLenS, containerLenS)) + rvlen := decInferLen(containerLen, d.h.MaxInitLen, int(ti.key.Size()+ti.elem.Size())) + rv.Set(makeMapReflect(ti.rt, rvlen)) + } + + if containerLen == 0 { + dd.ReadMapEnd() + return + } + + d.depthIncr() + + ktype, vtype := ti.key, ti.elem + ktypeId := rt2id(ktype) + vtypeKind := vtype.Kind() + + var keyFn, valFn *codecFn + var ktypeLo, vtypeLo reflect.Type + + for ktypeLo = ktype; ktypeLo.Kind() == reflect.Ptr; ktypeLo = ktypeLo.Elem() { + } + + for vtypeLo = vtype; vtypeLo.Kind() == reflect.Ptr; vtypeLo = vtypeLo.Elem() { + } + + var mapGet, mapSet bool + rvvImmut := isImmutableKind(vtypeKind) + if !d.h.MapValueReset { + // if pointer, mapGet = true + // if interface, mapGet = true if !DecodeNakedAlways (else false) + // if builtin, mapGet = false + // else mapGet = true + if vtypeKind == reflect.Ptr { + mapGet = true + } else if vtypeKind == reflect.Interface { + if !d.h.InterfaceReset { + mapGet = true + } + } else if !rvvImmut { + mapGet = true + } + } + + var rvk, rvkp, rvv, rvz reflect.Value + rvkMut := !isImmutableKind(ktype.Kind()) // if ktype is immutable, then re-use the same rvk. + ktypeIsString := ktypeId == stringTypId + ktypeIsIntf := ktypeId == intfTypId + hasLen := containerLen > 0 + var kstrbs []byte + + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if rvkMut || !rvkp.IsValid() { + rvkp = reflect.New(ktype) + rvk = rvkp.Elem() + } + if elemsep { + dd.ReadMapElemKey() + } + // if false && dd.TryDecodeAsNil() { // nil cannot be a map key, so disregard this block + // // Previously, if a nil key, we just ignored the mapped value and continued. + // // However, that makes the result of encoding and then decoding map[intf]intf{nil:nil} + // // to be an empty map. + // // Instead, we treat a nil key as the zero value of the type. + // rvk.Set(reflect.Zero(ktype)) + // } else if ktypeIsString { + if ktypeIsString { + kstrbs = dd.DecodeStringAsBytes() + rvk.SetString(stringView(kstrbs)) + // NOTE: if doing an insert, you MUST use a real string (not stringview) + } else { + if keyFn == nil { + keyFn = d.h.fn(ktypeLo, true, true) + } + d.decodeValue(rvk, keyFn, true) + } + // special case if a byte array. + if ktypeIsIntf { + if rvk2 := rvk.Elem(); rvk2.IsValid() { + if rvk2.Type() == uint8SliceTyp { + rvk = reflect.ValueOf(d.string(rvk2.Bytes())) + } else { + rvk = rvk2 + } + } + } + + if elemsep { + dd.ReadMapElemValue() + } + + // Brittle, but OK per TryDecodeAsNil() contract. + // i.e. TryDecodeAsNil never shares slices with other decDriver procedures + if dd.TryDecodeAsNil() { + if ktypeIsString { + rvk.SetString(d.string(kstrbs)) + } + if d.h.DeleteOnNilMapValue { + rv.SetMapIndex(rvk, reflect.Value{}) + } else { + rv.SetMapIndex(rvk, reflect.Zero(vtype)) + } + continue + } + + mapSet = true // set to false if u do a get, and its a non-nil pointer + if mapGet { + // mapGet true only in case where kind=Ptr|Interface or kind is otherwise mutable. + rvv = rv.MapIndex(rvk) + if !rvv.IsValid() { + rvv = reflect.New(vtype).Elem() + } else if vtypeKind == reflect.Ptr { + if rvv.IsNil() { + rvv = reflect.New(vtype).Elem() + } else { + mapSet = false + } + } else if vtypeKind == reflect.Interface { + // not addressable, and thus not settable. + // e MUST create a settable/addressable variant + rvv2 := reflect.New(rvv.Type()).Elem() + if !rvv.IsNil() { + rvv2.Set(rvv) + } + rvv = rvv2 + } + // else it is ~mutable, and we can just decode into it directly + } else if rvvImmut { + if !rvz.IsValid() { + rvz = reflect.New(vtype).Elem() + } + rvv = rvz + } else { + rvv = reflect.New(vtype).Elem() + } + + // We MUST be done with the stringview of the key, before decoding the value + // so that we don't bastardize the reused byte array. + if mapSet && ktypeIsString { + rvk.SetString(d.string(kstrbs)) + } + if valFn == nil { + valFn = d.h.fn(vtypeLo, true, true) + } + d.decodeValue(rvv, valFn, true) + // d.decodeValueFn(rvv, valFn) + if mapSet { + rv.SetMapIndex(rvk, rvv) + } + // if ktypeIsString { + // // keepAlive4StringView(kstrbs) // not needed, as reference is outside loop + // } + } + + dd.ReadMapEnd() + + d.depthDecr() +} + +// decNaked is used to keep track of the primitives decoded. +// Without it, we would have to decode each primitive and wrap it +// in an interface{}, causing an allocation. +// In this model, the primitives are decoded in a "pseudo-atomic" fashion, +// so we can rest assured that no other decoding happens while these +// primitives are being decoded. +// +// maps and arrays are not handled by this mechanism. +// However, RawExt is, and we accommodate for extensions that decode +// RawExt from DecodeNaked, but need to decode the value subsequently. +// kInterfaceNaked and swallow, which call DecodeNaked, handle this caveat. +// +// However, decNaked also keeps some arrays of default maps and slices +// used in DecodeNaked. This way, we can get a pointer to it +// without causing a new heap allocation. +// +// kInterfaceNaked will ensure that there is no allocation for the common +// uses. + +type decNaked struct { + // r RawExt // used for RawExt, uint, []byte. + + // primitives below + u uint64 + i int64 + f float64 + l []byte + s string + + // ---- cpu cache line boundary? + t time.Time + b bool + + // state + v valueType + _ [6]bool // padding + + // ru, ri, rf, rl, rs, rb, rt reflect.Value // mapping to the primitives above + // + // _ [3]uint64 // padding +} + +// func (n *decNaked) init() { +// n.ru = reflect.ValueOf(&n.u).Elem() +// n.ri = reflect.ValueOf(&n.i).Elem() +// n.rf = reflect.ValueOf(&n.f).Elem() +// n.rl = reflect.ValueOf(&n.l).Elem() +// n.rs = reflect.ValueOf(&n.s).Elem() +// n.rt = reflect.ValueOf(&n.t).Elem() +// n.rb = reflect.ValueOf(&n.b).Elem() +// // n.rr[] = reflect.ValueOf(&n.) +// } + +// type decNakedPooler struct { +// n *decNaked +// nsp *sync.Pool +// } + +// // naked must be called before each call to .DecodeNaked, as they will use it. +// func (d *decNakedPooler) naked() *decNaked { +// if d.n == nil { +// // consider one of: +// // - get from sync.Pool (if GC is frequent, there's no value here) +// // - new alloc (safest. only init'ed if it a naked decode will be done) +// // - field in Decoder (makes the Decoder struct very big) +// // To support using a decoder where a DecodeNaked is not needed, +// // we prefer #1 or #2. +// // d.n = new(decNaked) // &d.nv // new(decNaked) // grab from a sync.Pool +// // d.n.init() +// var v interface{} +// d.nsp, v = pool.decNaked() +// d.n = v.(*decNaked) +// } +// return d.n +// } + +// func (d *decNakedPooler) end() { +// if d.n != nil { +// // if n != nil, then nsp != nil (they are always set together) +// d.nsp.Put(d.n) +// d.n, d.nsp = nil, nil +// } +// } + +// type rtid2rv struct { +// rtid uintptr +// rv reflect.Value +// } + +// -------------- + +type decReaderSwitch struct { + rb bytesDecReader + // ---- cpu cache line boundary? + ri *ioDecReader + bi *bufioDecReader + + mtr, str bool // whether maptype or slicetype are known types + + be bool // is binary encoding + js bool // is json handle + jsms bool // is json handle, and MapKeyAsString + esep bool // has elem separators + + // typ entryType + bytes bool // is bytes reader + bufio bool // is this a bufioDecReader? +} + +// numread, track and stopTrack are always inlined, as they just check int fields, etc. + +/* +func (z *decReaderSwitch) numread() int { + switch z.typ { + case entryTypeBytes: + return z.rb.numread() + case entryTypeIo: + return z.ri.numread() + default: + return z.bi.numread() + } +} +func (z *decReaderSwitch) track() { + switch z.typ { + case entryTypeBytes: + z.rb.track() + case entryTypeIo: + z.ri.track() + default: + z.bi.track() + } +} +func (z *decReaderSwitch) stopTrack() []byte { + switch z.typ { + case entryTypeBytes: + return z.rb.stopTrack() + case entryTypeIo: + return z.ri.stopTrack() + default: + return z.bi.stopTrack() + } +} + +func (z *decReaderSwitch) unreadn1() { + switch z.typ { + case entryTypeBytes: + z.rb.unreadn1() + case entryTypeIo: + z.ri.unreadn1() + default: + z.bi.unreadn1() + } +} +func (z *decReaderSwitch) readx(n int) []byte { + switch z.typ { + case entryTypeBytes: + return z.rb.readx(n) + case entryTypeIo: + return z.ri.readx(n) + default: + return z.bi.readx(n) + } +} +func (z *decReaderSwitch) readb(s []byte) { + switch z.typ { + case entryTypeBytes: + z.rb.readb(s) + case entryTypeIo: + z.ri.readb(s) + default: + z.bi.readb(s) + } +} +func (z *decReaderSwitch) readn1() uint8 { + switch z.typ { + case entryTypeBytes: + return z.rb.readn1() + case entryTypeIo: + return z.ri.readn1() + default: + return z.bi.readn1() + } +} +func (z *decReaderSwitch) skip(accept *bitset256) (token byte) { + switch z.typ { + case entryTypeBytes: + return z.rb.skip(accept) + case entryTypeIo: + return z.ri.skip(accept) + default: + return z.bi.skip(accept) + } +} +func (z *decReaderSwitch) readTo(in []byte, accept *bitset256) (out []byte) { + switch z.typ { + case entryTypeBytes: + return z.rb.readTo(in, accept) + case entryTypeIo: + return z.ri.readTo(in, accept) + default: + return z.bi.readTo(in, accept) + } +} +func (z *decReaderSwitch) readUntil(in []byte, stop byte) (out []byte) { + switch z.typ { + case entryTypeBytes: + return z.rb.readUntil(in, stop) + case entryTypeIo: + return z.ri.readUntil(in, stop) + default: + return z.bi.readUntil(in, stop) + } +} + +*/ + +// the if/else-if/else block is expensive to inline. +// Each node of this construct costs a lot and dominates the budget. +// Best to only do an if fast-path else block (so fast-path is inlined). +// This is irrespective of inlineExtraCallCost set in $GOROOT/src/cmd/compile/internal/gc/inl.go +// +// In decReaderSwitch methods below, we delegate all IO functions into their own methods. +// This allows for the inlining of the common path when z.bytes=true. +// Go 1.12+ supports inlining methods with up to 1 inlined function (or 2 if no other constructs). + +func (z *decReaderSwitch) numread() uint { + if z.bytes { + return z.rb.numread() + } else if z.bufio { + return z.bi.numread() + } else { + return z.ri.numread() + } +} +func (z *decReaderSwitch) track() { + if z.bytes { + z.rb.track() + } else if z.bufio { + z.bi.track() + } else { + z.ri.track() + } +} +func (z *decReaderSwitch) stopTrack() []byte { + if z.bytes { + return z.rb.stopTrack() + } else if z.bufio { + return z.bi.stopTrack() + } else { + return z.ri.stopTrack() + } +} + +// func (z *decReaderSwitch) unreadn1() { +// if z.bytes { +// z.rb.unreadn1() +// } else { +// z.unreadn1IO() +// } +// } +// func (z *decReaderSwitch) unreadn1IO() { +// if z.bufio { +// z.bi.unreadn1() +// } else { +// z.ri.unreadn1() +// } +// } + +func (z *decReaderSwitch) unreadn1() { + if z.bytes { + z.rb.unreadn1() + } else if z.bufio { + z.bi.unreadn1() + } else { + z.ri.unreadn1() // not inlined + } +} + +func (z *decReaderSwitch) readx(n uint) []byte { + if z.bytes { + return z.rb.readx(n) + } + return z.readxIO(n) +} +func (z *decReaderSwitch) readxIO(n uint) []byte { + if z.bufio { + return z.bi.readx(n) + } + return z.ri.readx(n) +} + +func (z *decReaderSwitch) readb(s []byte) { + if z.bytes { + z.rb.readb(s) + } else { + z.readbIO(s) + } +} + +//go:noinline - fallback for io, ensures z.bytes path is inlined +func (z *decReaderSwitch) readbIO(s []byte) { + if z.bufio { + z.bi.readb(s) + } else { + z.ri.readb(s) + } +} + +func (z *decReaderSwitch) readn1() uint8 { + if z.bytes { + return z.rb.readn1() + } + return z.readn1IO() +} +func (z *decReaderSwitch) readn1IO() uint8 { + if z.bufio { + return z.bi.readn1() } + return z.ri.readn1() +} - if containerLen == 0 { - return +func (z *decReaderSwitch) skip(accept *bitset256) (token byte) { + if z.bytes { + return z.rb.skip(accept) } - - if rvcap, rvlen := rv.Len(), rv.Cap(); containerLenS > rvcap { - if f.array { // !rv.CanSet() - decErr(msgDecCannotExpandArr, rvcap, containerLenS) - } - rvn := reflect.MakeSlice(f.ti.rt, containerLenS, containerLenS) - if rvlen > 0 { - reflect.Copy(rvn, rv) - } - rv.Set(rvn) - } else if containerLenS > rvlen { - rv.SetLen(containerLenS) + return z.skipIO(accept) +} +func (z *decReaderSwitch) skipIO(accept *bitset256) (token byte) { + if z.bufio { + return z.bi.skip(accept) } + return z.ri.skip(accept) +} - for j := 0; j < containerLenS; j++ { - f.d.decodeValue(rv.Index(j)) +func (z *decReaderSwitch) readTo(in []byte, accept *bitset256) (out []byte) { + if z.bytes { + return z.rb.readToNoInput(accept) // z.rb.readTo(in, accept) } + return z.readToIO(in, accept) } -func (f *decFnInfo) kArray(rv reflect.Value) { - // f.d.decodeValue(rv.Slice(0, rv.Len())) - f.kSlice(rv.Slice(0, rv.Len())) +//go:noinline - fallback for io, ensures z.bytes path is inlined +func (z *decReaderSwitch) readToIO(in []byte, accept *bitset256) (out []byte) { + if z.bufio { + return z.bi.readTo(in, accept) + } + return z.ri.readTo(in, accept) +} +func (z *decReaderSwitch) readUntil(in []byte, stop byte) (out []byte) { + if z.bytes { + return z.rb.readUntilNoInput(stop) + } + return z.readUntilIO(in, stop) } -func (f *decFnInfo) kMap(rv reflect.Value) { - if shortCircuitReflectToFastPath && rv.CanAddr() { - switch f.ti.rtid { - case mapStrIntfTypId: - f.d.decMapStrIntf(rv.Addr().Interface().(*map[string]interface{})) - return - case mapIntfIntfTypId: - f.d.decMapIntfIntf(rv.Addr().Interface().(*map[interface{}]interface{})) - return - case mapInt64IntfTypId: - f.d.decMapInt64Intf(rv.Addr().Interface().(*map[int64]interface{})) - return - case mapUint64IntfTypId: - f.d.decMapUint64Intf(rv.Addr().Interface().(*map[uint64]interface{})) - return - } +func (z *decReaderSwitch) readUntilIO(in []byte, stop byte) (out []byte) { + if z.bufio { + return z.bi.readUntil(in, stop) } + return z.ri.readUntil(in, stop) +} - containerLen := f.dd.readMapLen() +// Decoder reads and decodes an object from an input stream in a supported format. +// +// Decoder is NOT safe for concurrent use i.e. a Decoder cannot be used +// concurrently in multiple goroutines. +// +// However, as Decoder could be allocation heavy to initialize, a Reset method is provided +// so its state can be reused to decode new input streams repeatedly. +// This is the idiomatic way to use. +type Decoder struct { + panicHdl + // hopefully, reduce derefencing cost by laying the decReader inside the Decoder. + // Try to put things that go together to fit within a cache line (8 words). - if rv.IsNil() { - rv.Set(reflect.MakeMap(f.ti.rt)) - } + d decDriver - if containerLen == 0 { - return - } + // NOTE: Decoder shouldn't call it's read methods, + // as the handler MAY need to do some coordination. + r *decReaderSwitch - ktype, vtype := f.ti.rt.Key(), f.ti.rt.Elem() - ktypeId := reflect.ValueOf(ktype).Pointer() - for j := 0; j < containerLen; j++ { - rvk := reflect.New(ktype).Elem() - f.d.decodeValue(rvk) + // bi *bufioDecReader + // cache the mapTypeId and sliceTypeId for faster comparisons + mtid uintptr + stid uintptr - // special case if a byte array. - // if ktype == intfTyp { - if ktypeId == intfTypId { - rvk = rvk.Elem() - if rvk.Type() == uint8SliceTyp { - rvk = reflect.ValueOf(string(rvk.Bytes())) - } - } - rvv := rv.MapIndex(rvk) - if !rvv.IsValid() { - rvv = reflect.New(vtype).Elem() - } + hh Handle + h *BasicHandle - f.d.decodeValue(rvv) - rv.SetMapIndex(rvk, rvv) - } -} + // ---- cpu cache line boundary? + decReaderSwitch -// ---------------------------------------- + // ---- cpu cache line boundary? + n decNaked -type decFn struct { - i *decFnInfo - f func(*decFnInfo, reflect.Value) -} + // cr containerStateRecv + err error -// A Decoder reads and decodes an object from an input stream in the codec format. -type Decoder struct { - r decReader - d decDriver - h *BasicHandle - f map[uintptr]decFn - x []uintptr - s []decFn + depth int16 + maxdepth int16 + + _ [4]uint8 // padding + + is map[string]string // used for interning strings + + // ---- cpu cache line boundary? + b [decScratchByteArrayLen]byte // scratch buffer, used by Decoder and xxxEncDrivers + + // padding - false sharing help // modify 232 if Decoder struct changes. + // _ [cacheLineSize - 232%cacheLineSize]byte } // NewDecoder returns a Decoder for decoding a stream of bytes from an io.Reader. // -// For efficiency, Users are encouraged to pass in a memory buffered writer -// (eg bufio.Reader, bytes.Buffer). +// For efficiency, Users are encouraged to configure ReaderBufferSize on the handle +// OR pass in a memory buffered reader (eg bufio.Reader, bytes.Buffer). func NewDecoder(r io.Reader, h Handle) *Decoder { - z := ioDecReader{ - r: r, - } - z.br, _ = r.(io.ByteReader) - return &Decoder{r: &z, d: h.newDecDriver(&z), h: h.getBasicHandle()} + d := newDecoder(h) + d.Reset(r) + return d } // NewDecoderBytes returns a Decoder which efficiently decodes directly // from a byte slice with zero copying. func NewDecoderBytes(in []byte, h Handle) *Decoder { - z := bytesDecReader{ - b: in, - a: len(in), + d := newDecoder(h) + d.ResetBytes(in) + return d +} + +// var defaultDecNaked decNaked + +func newDecoder(h Handle) *Decoder { + d := &Decoder{h: basicHandle(h), err: errDecoderNotInitialized} + d.bytes = true + if useFinalizers { + runtime.SetFinalizer(d, (*Decoder).finalize) + // xdebugf(">>>> new(Decoder) with finalizer") + } + d.r = &d.decReaderSwitch + d.hh = h + d.be = h.isBinary() + // NOTE: do not initialize d.n here. It is lazily initialized in d.naked() + var jh *JsonHandle + jh, d.js = h.(*JsonHandle) + if d.js { + d.jsms = jh.MapKeyAsString + } + d.esep = d.hh.hasElemSeparators() + if d.h.InternString { + d.is = make(map[string]string, 32) + } + d.d = h.newDecDriver(d) + // d.cr, _ = d.d.(containerStateRecv) + return d +} + +func (d *Decoder) resetCommon() { + // d.r = &d.decReaderSwitch + d.d.reset() + d.err = nil + d.depth = 0 + d.maxdepth = d.h.MaxDepth + if d.maxdepth <= 0 { + d.maxdepth = decDefMaxDepth + } + // reset all things which were cached from the Handle, but could change + d.mtid, d.stid = 0, 0 + d.mtr, d.str = false, false + if d.h.MapType != nil { + d.mtid = rt2id(d.h.MapType) + d.mtr = fastpathAV.index(d.mtid) != -1 + } + if d.h.SliceType != nil { + d.stid = rt2id(d.h.SliceType) + d.str = fastpathAV.index(d.stid) != -1 + } +} + +// Reset the Decoder with a new Reader to decode from, +// clearing all state from last run(s). +func (d *Decoder) Reset(r io.Reader) { + if r == nil { + return + } + d.bytes = false + // d.typ = entryTypeUnset + if d.h.ReaderBufferSize > 0 { + if d.bi == nil { + d.bi = new(bufioDecReader) + } + d.bi.reset(r, d.h.ReaderBufferSize) + // d.r = d.bi + // d.typ = entryTypeBufio + d.bufio = true + } else { + // d.ri.x = &d.b + // d.s = d.sa[:0] + if d.ri == nil { + d.ri = new(ioDecReader) + } + d.ri.reset(r) + // d.r = d.ri + // d.typ = entryTypeIo + d.bufio = false + } + d.resetCommon() +} + +// ResetBytes resets the Decoder with a new []byte to decode from, +// clearing all state from last run(s). +func (d *Decoder) ResetBytes(in []byte) { + if in == nil { + return } - return &Decoder{r: &z, d: h.newDecDriver(&z), h: h.getBasicHandle()} + d.bytes = true + d.bufio = false + // d.typ = entryTypeBytes + d.rb.reset(in) + // d.r = &d.rb + d.resetCommon() +} + +func (d *Decoder) naked() *decNaked { + return &d.n } // Decode decodes the stream from reader and stores the result in the @@ -609,7 +2470,8 @@ func NewDecoderBytes(in []byte, h Handle) *Decoder { // - Else decode it based on its reflect.Kind // // There are some special rules when decoding into containers (slice/array/map/struct). -// Decode will typically use the stream contents to UPDATE the container. +// Decode will typically use the stream contents to UPDATE the container i.e. the values +// in these containers will not be zero'ed before decoding. // - A map can be decoded from a stream map, by updating matching keys. // - A slice can be decoded from a stream array, // by updating the first n elements, where n is length of the stream. @@ -619,430 +2481,629 @@ func NewDecoderBytes(in []byte, h Handle) *Decoder { // - A struct can be decoded from a stream array, // by updating fields as they occur in the struct (by index). // -// When decoding a stream map or array with length of 0 into a nil map or slice, +// This in-place update maintains consistency in the decoding philosophy (i.e. we ALWAYS update +// in place by default). However, the consequence of this is that values in slices or maps +// which are not zero'ed before hand, will have part of the prior values in place after decode +// if the stream doesn't contain an update for those parts. +// +// This in-place update can be disabled by configuring the MapValueReset and SliceElementReset +// decode options available on every handle. +// +// Furthermore, when decoding a stream map or array with length of 0 into a nil map or slice, // we reset the destination map or slice to a zero-length value. // // However, when decoding a stream nil, we reset the destination container // to its "zero" value (e.g. nil for slice/map, etc). // +// Note: we allow nil values in the stream anywhere except for map keys. +// A nil value in the encoded stream where a map key is expected is treated as an error. func (d *Decoder) Decode(v interface{}) (err error) { - defer panicToErr(&err) - d.decode(v) + // tried to use closure, as runtime optimizes defer with no params. + // This seemed to be causing weird issues (like circular reference found, unexpected panic, etc). + // Also, see https://github.com/golang/go/issues/14939#issuecomment-417836139 + // defer func() { d.deferred(&err) }() + // { x, y := d, &err; defer func() { x.deferred(y) }() } + if d.err != nil { + return d.err + } + if recoverPanicToErr { + defer func() { + if x := recover(); x != nil { + panicValToErr(d, x, &d.err) + err = d.err + } + }() + } + + // defer d.deferred(&err) + d.mustDecode(v) return } -func (d *Decoder) decode(iv interface{}) { - d.d.initReadNext() +// MustDecode is like Decode, but panics if unable to Decode. +// This provides insight to the code location that triggered the error. +func (d *Decoder) MustDecode(v interface{}) { + if d.err != nil { + panic(d.err) + } + d.mustDecode(v) +} - switch v := iv.(type) { - case nil: - decErr("Cannot decode into nil.") +// MustDecode is like Decode, but panics if unable to Decode. +// This provides insight to the code location that triggered the error. +func (d *Decoder) mustDecode(v interface{}) { + // TODO: Top-level: ensure that v is a pointer and not nil. + if d.d.TryDecodeAsNil() { + setZero(v) + return + } + if d.bi == nil { + d.decode(v) + return + } - case reflect.Value: - d.chkPtrValue(v) - d.decodeValue(v.Elem()) + d.bi.calls++ + d.decode(v) + // xprintf(">>>>>>>> >>>>>>>> num decFns: %v\n", d.cf.sn) + d.bi.calls-- + if !d.h.ExplicitRelease && d.bi.calls == 0 { + d.bi.release() + } +} + +// func (d *Decoder) deferred(err1 *error) { +// if recoverPanicToErr { +// if x := recover(); x != nil { +// panicValToErr(d, x, err1) +// panicValToErr(d, x, &d.err) +// } +// } +// } + +//go:noinline -- as it is run by finalizer +func (d *Decoder) finalize() { + // xdebugf("finalizing Decoder") + d.Release() +} + +// Release releases shared (pooled) resources. +// +// It is important to call Release() when done with a Decoder, so those resources +// are released instantly for use by subsequently created Decoders. +// +// By default, Release() is automatically called unless the option ExplicitRelease is set. +func (d *Decoder) Release() { + if d.bi != nil { + d.bi.release() + } + // d.decNakedPooler.end() +} + +// // this is not a smart swallow, as it allocates objects and does unnecessary work. +// func (d *Decoder) swallowViaHammer() { +// var blank interface{} +// d.decodeValueNoFn(reflect.ValueOf(&blank).Elem()) +// } + +func (d *Decoder) swallow() { + // smarter decode that just swallows the content + dd := d.d + if dd.TryDecodeAsNil() { + return + } + elemsep := d.esep + switch dd.ContainerType() { + case valueTypeMap: + containerLen := dd.ReadMapStart() + d.depthIncr() + hasLen := containerLen >= 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + // if clenGtEqualZero {if j >= containerLen {break} } else if dd.CheckBreak() {break} + if elemsep { + dd.ReadMapElemKey() + } + d.swallow() + if elemsep { + dd.ReadMapElemValue() + } + d.swallow() + } + dd.ReadMapEnd() + d.depthDecr() + case valueTypeArray: + containerLen := dd.ReadArrayStart() + d.depthIncr() + hasLen := containerLen >= 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if elemsep { + dd.ReadArrayElem() + } + d.swallow() + } + dd.ReadArrayEnd() + d.depthDecr() + case valueTypeBytes: + dd.DecodeBytes(d.b[:], true) + case valueTypeString: + dd.DecodeStringAsBytes() + default: + // these are all primitives, which we can get from decodeNaked + // if RawExt using Value, complete the processing. + n := d.naked() + dd.DecodeNaked() + if n.v == valueTypeExt && n.l == nil { + var v2 interface{} + d.decode(&v2) + } + } +} +func setZero(iv interface{}) { + if iv == nil || definitelyNil(iv) { + return + } + var canDecode bool + switch v := iv.(type) { case *string: - *v = d.d.decodeString() + *v = "" case *bool: - *v = d.d.decodeBool() + *v = false case *int: - *v = int(d.d.decodeInt(intBitsize)) + *v = 0 case *int8: - *v = int8(d.d.decodeInt(8)) + *v = 0 case *int16: - *v = int16(d.d.decodeInt(16)) + *v = 0 case *int32: - *v = int32(d.d.decodeInt(32)) + *v = 0 case *int64: - *v = d.d.decodeInt(64) + *v = 0 case *uint: - *v = uint(d.d.decodeUint(uintBitsize)) + *v = 0 case *uint8: - *v = uint8(d.d.decodeUint(8)) + *v = 0 case *uint16: - *v = uint16(d.d.decodeUint(16)) + *v = 0 case *uint32: - *v = uint32(d.d.decodeUint(32)) + *v = 0 case *uint64: - *v = d.d.decodeUint(64) + *v = 0 case *float32: - *v = float32(d.d.decodeFloat(true)) + *v = 0 case *float64: - *v = d.d.decodeFloat(false) - case *[]byte: - *v, _ = d.d.decodeBytes(*v) - - case *[]interface{}: - d.decSliceIntf(v, valueTypeInvalid, false) - case *[]uint64: - d.decSliceUint64(v, valueTypeInvalid, false) - case *[]int64: - d.decSliceInt64(v, valueTypeInvalid, false) - case *[]string: - d.decSliceStr(v, valueTypeInvalid, false) - case *map[string]interface{}: - d.decMapStrIntf(v) - case *map[interface{}]interface{}: - d.decMapIntfIntf(v) - case *map[uint64]interface{}: - d.decMapUint64Intf(v) - case *map[int64]interface{}: - d.decMapInt64Intf(v) - - case *interface{}: - d.decodeValue(reflect.ValueOf(iv).Elem()) - + *v = 0 + case *[]uint8: + *v = nil + case *Raw: + *v = nil + case *time.Time: + *v = time.Time{} + case reflect.Value: + if v, canDecode = isDecodeable(v); canDecode && v.CanSet() { + v.Set(reflect.Zero(v.Type())) + } // TODO: else drain if chan, clear if map, set all to nil if slice??? default: - rv := reflect.ValueOf(iv) - d.chkPtrValue(rv) - d.decodeValue(rv.Elem()) + if !fastpathDecodeSetZeroTypeSwitch(iv) { + v := reflect.ValueOf(iv) + if v, canDecode = isDecodeable(v); canDecode && v.CanSet() { + v.Set(reflect.Zero(v.Type())) + } // TODO: else drain if chan, clear if map, set all to nil if slice??? + } } } -func (d *Decoder) decodeValue(rv reflect.Value) { - d.d.initReadNext() +func (d *Decoder) decode(iv interface{}) { + // a switch with only concrete types can be optimized. + // consequently, we deal with nil and interfaces outside the switch. - if d.d.tryDecodeAsNil() { - // If value in stream is nil, set the dereferenced value to its "zero" value (if settable) - if rv.Kind() == reflect.Ptr { - if !rv.IsNil() { - rv.Set(reflect.Zero(rv.Type())) - } - return - } - // for rv.Kind() == reflect.Ptr { - // rv = rv.Elem() - // } - if rv.IsValid() { // rv.CanSet() // always settable, except it's invalid - rv.Set(reflect.Zero(rv.Type())) - } + if iv == nil { + d.errorstr(errstrCannotDecodeIntoNil) return } - // If stream is not containing a nil value, then we can deref to the base - // non-pointer value, and decode into that. - for rv.Kind() == reflect.Ptr { - if rv.IsNil() { - rv.Set(reflect.New(rv.Type().Elem())) + switch v := iv.(type) { + // case nil: + // case Selfer: + case reflect.Value: + v = d.ensureDecodeable(v) + d.decodeValue(v, nil, true) + + case *string: + *v = d.d.DecodeString() + case *bool: + *v = d.d.DecodeBool() + case *int: + *v = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize)) + case *int8: + *v = int8(chkOvf.IntV(d.d.DecodeInt64(), 8)) + case *int16: + *v = int16(chkOvf.IntV(d.d.DecodeInt64(), 16)) + case *int32: + *v = int32(chkOvf.IntV(d.d.DecodeInt64(), 32)) + case *int64: + *v = d.d.DecodeInt64() + case *uint: + *v = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize)) + case *uint8: + *v = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8)) + case *uint16: + *v = uint16(chkOvf.UintV(d.d.DecodeUint64(), 16)) + case *uint32: + *v = uint32(chkOvf.UintV(d.d.DecodeUint64(), 32)) + case *uint64: + *v = d.d.DecodeUint64() + case *float32: + f64 := d.d.DecodeFloat64() + if chkOvf.Float32(f64) { + d.errorf("float32 overflow: %v", f64) } - rv = rv.Elem() - } + *v = float32(f64) + case *float64: + *v = d.d.DecodeFloat64() + case *[]uint8: + *v = d.d.DecodeBytes(*v, false) + case []uint8: + b := d.d.DecodeBytes(v, false) + if !(len(b) > 0 && len(b) == len(v) && &b[0] == &v[0]) { + copy(v, b) + } + case *time.Time: + *v = d.d.DecodeTime() + case *Raw: + *v = d.rawBytes() - rt := rv.Type() - rtid := reflect.ValueOf(rt).Pointer() + case *interface{}: + d.decodeValue(reflect.ValueOf(iv).Elem(), nil, true) + // d.decodeValueNotNil(reflect.ValueOf(iv).Elem()) - // retrieve or register a focus'ed function for this type - // to eliminate need to do the retrieval multiple times + default: + if v, ok := iv.(Selfer); ok { + v.CodecDecodeSelf(d) + } else if !fastpathDecodeTypeSwitch(iv, d) { + v := reflect.ValueOf(iv) + v = d.ensureDecodeable(v) + d.decodeValue(v, nil, false) + // d.decodeValueFallback(v) + } + } +} - // if d.f == nil && d.s == nil { debugf("---->Creating new dec f map for type: %v\n", rt) } - var fn decFn - var ok bool - if useMapForCodecCache { - fn, ok = d.f[rtid] - } else { - for i, v := range d.x { - if v == rtid { - fn, ok = d.s[i], true +func (d *Decoder) decodeValue(rv reflect.Value, fn *codecFn, chkAll bool) { + // If stream is not containing a nil value, then we can deref to the base + // non-pointer value, and decode into that. + var rvp reflect.Value + var rvpValid bool + if rv.Kind() == reflect.Ptr { + rvpValid = true + for { + if rv.IsNil() { + rv.Set(reflect.New(rv.Type().Elem())) + } + rvp = rv + rv = rv.Elem() + if rv.Kind() != reflect.Ptr { break } } } - if !ok { - // debugf("\tCreating new dec fn for type: %v\n", rt) - fi := decFnInfo{ti: getTypeInfo(rtid, rt), d: d, dd: d.d} - fn.i = &fi - // An extension can be registered for any type, regardless of the Kind - // (e.g. type BitSet int64, type MyStruct { / * unexported fields * / }, type X []int, etc. - // - // We can't check if it's an extension byte here first, because the user may have - // registered a pointer or non-pointer type, meaning we may have to recurse first - // before matching a mapped type, even though the extension byte is already detected. - // - // NOTE: if decoding into a nil interface{}, we return a non-nil - // value except even if the container registers a length of 0. - if rtid == rawExtTypId { - fn.f = (*decFnInfo).rawExt - } else if d.d.isBuiltinType(rtid) { - fn.f = (*decFnInfo).builtin - } else if xfTag, xfFn := d.h.getDecodeExt(rtid); xfFn != nil { - fi.xfTag, fi.xfFn = xfTag, xfFn - fn.f = (*decFnInfo).ext - } else if supportBinaryMarshal && fi.ti.unm { - fn.f = (*decFnInfo).binaryMarshal + + if fn == nil { + // always pass checkCodecSelfer=true, in case T or ****T is passed, where *T is a Selfer + fn = d.h.fn(rv.Type(), chkAll, true) // chkAll, chkAll) + } + if fn.i.addrD { + if rvpValid { + fn.fd(d, &fn.i, rvp) + } else if rv.CanAddr() { + fn.fd(d, &fn.i, rv.Addr()) + } else if !fn.i.addrF { + fn.fd(d, &fn.i, rv) } else { - switch rk := rt.Kind(); rk { - case reflect.String: - fn.f = (*decFnInfo).kString - case reflect.Bool: - fn.f = (*decFnInfo).kBool - case reflect.Int: - fn.f = (*decFnInfo).kInt - case reflect.Int64: - fn.f = (*decFnInfo).kInt64 - case reflect.Int32: - fn.f = (*decFnInfo).kInt32 - case reflect.Int8: - fn.f = (*decFnInfo).kInt8 - case reflect.Int16: - fn.f = (*decFnInfo).kInt16 - case reflect.Float32: - fn.f = (*decFnInfo).kFloat32 - case reflect.Float64: - fn.f = (*decFnInfo).kFloat64 - case reflect.Uint8: - fn.f = (*decFnInfo).kUint8 - case reflect.Uint64: - fn.f = (*decFnInfo).kUint64 - case reflect.Uint: - fn.f = (*decFnInfo).kUint - case reflect.Uint32: - fn.f = (*decFnInfo).kUint32 - case reflect.Uint16: - fn.f = (*decFnInfo).kUint16 - // case reflect.Ptr: - // fn.f = (*decFnInfo).kPtr - case reflect.Interface: - fn.f = (*decFnInfo).kInterface - case reflect.Struct: - fn.f = (*decFnInfo).kStruct - case reflect.Slice: - fn.f = (*decFnInfo).kSlice - case reflect.Array: - fi.array = true - fn.f = (*decFnInfo).kArray - case reflect.Map: - fn.f = (*decFnInfo).kMap - default: - fn.f = (*decFnInfo).kErr - } + d.errorf("cannot decode into a non-pointer value") } - if useMapForCodecCache { - if d.f == nil { - d.f = make(map[uintptr]decFn, 16) - } - d.f[rtid] = fn - } else { - d.s = append(d.s, fn) - d.x = append(d.x, rtid) + } else { + fn.fd(d, &fn.i, rv) + } + // return rv +} + +func (d *Decoder) structFieldNotFound(index int, rvkencname string) { + // NOTE: rvkencname may be a stringView, so don't pass it to another function. + if d.h.ErrorIfNoField { + if index >= 0 { + d.errorf("no matching struct field found when decoding stream array at index %v", index) + return + } else if rvkencname != "" { + d.errorf("no matching struct field found when decoding stream map with key " + rvkencname) + return } } + d.swallow() +} - fn.f(fn.i, rv) +func (d *Decoder) arrayCannotExpand(sliceLen, streamLen int) { + if d.h.ErrorIfNoArrayExpand { + d.errorf("cannot expand array len during decode from %v to %v", sliceLen, streamLen) + } +} +func isDecodeable(rv reflect.Value) (rv2 reflect.Value, canDecode bool) { + switch rv.Kind() { + case reflect.Array: + return rv, rv.CanAddr() + case reflect.Ptr: + if !rv.IsNil() { + return rv.Elem(), true + } + case reflect.Slice, reflect.Chan, reflect.Map: + if !rv.IsNil() { + return rv, true + } + } return } -func (d *Decoder) chkPtrValue(rv reflect.Value) { - // We can only decode into a non-nil pointer - if rv.Kind() == reflect.Ptr && !rv.IsNil() { +func (d *Decoder) ensureDecodeable(rv reflect.Value) (rv2 reflect.Value) { + // decode can take any reflect.Value that is a inherently addressable i.e. + // - array + // - non-nil chan (we will SEND to it) + // - non-nil slice (we will set its elements) + // - non-nil map (we will put into it) + // - non-nil pointer (we can "update" it) + rv2, canDecode := isDecodeable(rv) + if canDecode { return } if !rv.IsValid() { - decErr("Cannot decode into a zero (ie invalid) reflect.Value") + d.errorstr(errstrCannotDecodeIntoNil) + return } if !rv.CanInterface() { - decErr("Cannot decode into a value without an interface: %v", rv) + d.errorf("cannot decode into a value without an interface: %v", rv) + return } - rvi := rv.Interface() - decErr("Cannot decode into non-pointer or nil pointer. Got: %v, %T, %v", - rv.Kind(), rvi, rvi) + rvi := rv2i(rv) + rvk := rv.Kind() + d.errorf("cannot decode into value of kind: %v, type: %T, %v", rvk, rvi, rvi) + return } -func (d *Decoder) decEmbeddedField(rv reflect.Value, index []int) { - // d.decodeValue(rv.FieldByIndex(index)) - // nil pointers may be here; so reproduce FieldByIndex logic + enhancements - for _, j := range index { - if rv.Kind() == reflect.Ptr { - if rv.IsNil() { - rv.Set(reflect.New(rv.Type().Elem())) - } - // If a pointer, it must be a pointer to struct (based on typeInfo contract) - rv = rv.Elem() - } - rv = rv.Field(j) +func (d *Decoder) depthIncr() { + d.depth++ + if d.depth >= d.maxdepth { + panic(errMaxDepthExceeded) + } +} + +func (d *Decoder) depthDecr() { + d.depth-- +} + +// Possibly get an interned version of a string +// +// This should mostly be used for map keys, where the key type is string. +// This is because keys of a map/struct are typically reused across many objects. +func (d *Decoder) string(v []byte) (s string) { + if d.is == nil { + return string(v) // don't return stringView, as we need a real string here. + } + s, ok := d.is[string(v)] // no allocation here, per go implementation + if !ok { + s = string(v) // new allocation here + d.is[s] = s } - d.decodeValue(rv) + return s +} + +// nextValueBytes returns the next value in the stream as a set of bytes. +func (d *Decoder) nextValueBytes() (bs []byte) { + d.d.uncacheRead() + d.r.track() + d.swallow() + bs = d.r.stopTrack() + return +} + +func (d *Decoder) rawBytes() []byte { + // ensure that this is not a view into the bytes + // i.e. make new copy always. + bs := d.nextValueBytes() + bs2 := make([]byte, len(bs)) + copy(bs2, bs) + return bs2 +} + +func (d *Decoder) wrapErr(v interface{}, err *error) { + *err = decodeError{codecError: codecError{name: d.hh.Name(), err: v}, pos: int(d.r.numread())} +} + +// NumBytesRead returns the number of bytes read +func (d *Decoder) NumBytesRead() int { + return int(d.r.numread()) } // -------------------------------------------------- -// short circuit functions for common maps and slices - -func (d *Decoder) decSliceIntf(v *[]interface{}, currEncodedType valueType, doNotReset bool) { - _, containerLenS := decContLens(d.d, currEncodedType) - s := *v - if s == nil { - s = make([]interface{}, containerLenS, containerLenS) - } else if containerLenS > cap(s) { - if doNotReset { - decErr(msgDecCannotExpandArr, cap(s), containerLenS) - } - s = make([]interface{}, containerLenS, containerLenS) - copy(s, *v) - } else if containerLenS > len(s) { - s = s[:containerLenS] - } - for j := 0; j < containerLenS; j++ { - d.decode(&s[j]) - } - *v = s -} - -func (d *Decoder) decSliceInt64(v *[]int64, currEncodedType valueType, doNotReset bool) { - _, containerLenS := decContLens(d.d, currEncodedType) - s := *v - if s == nil { - s = make([]int64, containerLenS, containerLenS) - } else if containerLenS > cap(s) { - if doNotReset { - decErr(msgDecCannotExpandArr, cap(s), containerLenS) - } - s = make([]int64, containerLenS, containerLenS) - copy(s, *v) - } else if containerLenS > len(s) { - s = s[:containerLenS] - } - for j := 0; j < containerLenS; j++ { - // d.decode(&s[j]) - d.d.initReadNext() - s[j] = d.d.decodeInt(intBitsize) - } - *v = s -} - -func (d *Decoder) decSliceUint64(v *[]uint64, currEncodedType valueType, doNotReset bool) { - _, containerLenS := decContLens(d.d, currEncodedType) - s := *v - if s == nil { - s = make([]uint64, containerLenS, containerLenS) - } else if containerLenS > cap(s) { - if doNotReset { - decErr(msgDecCannotExpandArr, cap(s), containerLenS) - } - s = make([]uint64, containerLenS, containerLenS) - copy(s, *v) - } else if containerLenS > len(s) { - s = s[:containerLenS] - } - for j := 0; j < containerLenS; j++ { - // d.decode(&s[j]) - d.d.initReadNext() - s[j] = d.d.decodeUint(intBitsize) - } - *v = s -} - -func (d *Decoder) decSliceStr(v *[]string, currEncodedType valueType, doNotReset bool) { - _, containerLenS := decContLens(d.d, currEncodedType) - s := *v - if s == nil { - s = make([]string, containerLenS, containerLenS) - } else if containerLenS > cap(s) { - if doNotReset { - decErr(msgDecCannotExpandArr, cap(s), containerLenS) - } - s = make([]string, containerLenS, containerLenS) - copy(s, *v) - } else if containerLenS > len(s) { - s = s[:containerLenS] - } - for j := 0; j < containerLenS; j++ { - // d.decode(&s[j]) - d.d.initReadNext() - s[j] = d.d.decodeString() - } - *v = s -} - -func (d *Decoder) decMapIntfIntf(v *map[interface{}]interface{}) { - containerLen := d.d.readMapLen() - m := *v - if m == nil { - m = make(map[interface{}]interface{}, containerLen) - *v = m - } - for j := 0; j < containerLen; j++ { - var mk interface{} - d.decode(&mk) - // special case if a byte array. - if bv, bok := mk.([]byte); bok { - mk = string(bv) - } - mv := m[mk] - d.decode(&mv) - m[mk] = mv +// decSliceHelper assists when decoding into a slice, from a map or an array in the stream. +// A slice can be set from a map or array in stream. This supports the MapBySlice interface. +type decSliceHelper struct { + d *Decoder + // ct valueType + array bool +} + +func (d *Decoder) decSliceHelperStart() (x decSliceHelper, clen int) { + dd := d.d + ctyp := dd.ContainerType() + switch ctyp { + case valueTypeArray: + x.array = true + clen = dd.ReadArrayStart() + case valueTypeMap: + clen = dd.ReadMapStart() * 2 + default: + d.errorf("only encoded map or array can be decoded into a slice (%d)", ctyp) } + // x.ct = ctyp + x.d = d + return } -func (d *Decoder) decMapInt64Intf(v *map[int64]interface{}) { - containerLen := d.d.readMapLen() - m := *v - if m == nil { - m = make(map[int64]interface{}, containerLen) - *v = m +func (x decSliceHelper) End() { + if x.array { + x.d.d.ReadArrayEnd() + } else { + x.d.d.ReadMapEnd() } - for j := 0; j < containerLen; j++ { - d.d.initReadNext() - mk := d.d.decodeInt(intBitsize) - mv := m[mk] - d.decode(&mv) - m[mk] = mv +} + +func (x decSliceHelper) ElemContainerState(index int) { + if x.array { + x.d.d.ReadArrayElem() + } else if index%2 == 0 { + x.d.d.ReadMapElemKey() + } else { + x.d.d.ReadMapElemValue() } } -func (d *Decoder) decMapUint64Intf(v *map[uint64]interface{}) { - containerLen := d.d.readMapLen() - m := *v - if m == nil { - m = make(map[uint64]interface{}, containerLen) - *v = m +func decByteSlice(r *decReaderSwitch, clen, maxInitLen int, bs []byte) (bsOut []byte) { + if clen == 0 { + return zeroByteSlice } - for j := 0; j < containerLen; j++ { - d.d.initReadNext() - mk := d.d.decodeUint(intBitsize) - mv := m[mk] - d.decode(&mv) - m[mk] = mv + if len(bs) == clen { + bsOut = bs + r.readb(bsOut) + } else if cap(bs) >= clen { + bsOut = bs[:clen] + r.readb(bsOut) + } else { + // bsOut = make([]byte, clen) + len2 := decInferLen(clen, maxInitLen, 1) + bsOut = make([]byte, len2) + r.readb(bsOut) + for len2 < clen { + len3 := decInferLen(clen-len2, maxInitLen, 1) + bs3 := bsOut + bsOut = make([]byte, len2+len3) + copy(bsOut, bs3) + r.readb(bsOut[len2:]) + len2 += len3 + } } + return } -func (d *Decoder) decMapStrIntf(v *map[string]interface{}) { - containerLen := d.d.readMapLen() - m := *v - if m == nil { - m = make(map[string]interface{}, containerLen) - *v = m - } - for j := 0; j < containerLen; j++ { - d.d.initReadNext() - mk := d.d.decodeString() - mv := m[mk] - d.decode(&mv) - m[mk] = mv +// func decByteSliceZeroCopy(r decReader, clen, maxInitLen int, bs []byte) (bsOut []byte) { +// if _, ok := r.(*bytesDecReader); ok && clen <= maxInitLen { +// return r.readx(clen) +// } +// return decByteSlice(r, clen, maxInitLen, bs) +// } + +func detachZeroCopyBytes(isBytesReader bool, dest []byte, in []byte) (out []byte) { + if xlen := len(in); xlen > 0 { + if isBytesReader || xlen <= scratchByteArrayLen { + if cap(dest) >= xlen { + out = dest[:xlen] + } else { + out = make([]byte, xlen) + } + copy(out, in) + return + } } + return in } -// ---------------------------------------- +// decInferLen will infer a sensible length, given the following: +// - clen: length wanted. +// - maxlen: max length to be returned. +// if <= 0, it is unset, and we infer it based on the unit size +// - unit: number of bytes for each element of the collection +func decInferLen(clen, maxlen, unit int) (rvlen int) { + // handle when maxlen is not set i.e. <= 0 + if clen <= 0 { + return + } + if unit == 0 { + return clen + } + if maxlen <= 0 { + // no maxlen defined. Use maximum of 256K memory, with a floor of 4K items. + // maxlen = 256 * 1024 / unit + // if maxlen < (4 * 1024) { + // maxlen = 4 * 1024 + // } + if unit < (256 / 4) { + maxlen = 256 * 1024 / unit + } else { + maxlen = 4 * 1024 + } + } + if clen > maxlen { + rvlen = maxlen + } else { + rvlen = clen + } + return +} -func decContLens(dd decDriver, currEncodedType valueType) (containerLen, containerLenS int) { - if currEncodedType == valueTypeInvalid { - currEncodedType = dd.currentEncodedType() +func expandSliceRV(s reflect.Value, st reflect.Type, canChange bool, stElemSize, num, slen, scap int) ( + s2 reflect.Value, scap2 int, changed bool, err string) { + l1 := slen + num // new slice length + if l1 < slen { + err = errmsgExpandSliceOverflow + return } - switch currEncodedType { - case valueTypeArray: - containerLen = dd.readArrayLen() - containerLenS = containerLen - case valueTypeMap: - containerLen = dd.readMapLen() - containerLenS = containerLen * 2 - default: - decErr("Only encoded map or array can be decoded into a slice. (valueType: %0x)", - currEncodedType) + if l1 <= scap { + if s.CanSet() { + s.SetLen(l1) + } else if canChange { + s2 = s.Slice(0, l1) + scap2 = scap + changed = true + } else { + err = errmsgExpandSliceCannotChange + return + } + return + } + if !canChange { + err = errmsgExpandSliceCannotChange + return } + scap2 = growCap(scap, stElemSize, num) + s2 = reflect.MakeSlice(st, l1, scap2) + changed = true + reflect.Copy(s2, s) return } -func decErr(format string, params ...interface{}) { - doPanic(msgTagDec, format, params...) +func decReadFull(r io.Reader, bs []byte) (n uint, err error) { + var nn int + for n < uint(len(bs)) && err == nil { + nn, err = r.Read(bs[n:]) + if nn > 0 { + if err == io.EOF { + // leave EOF for next time + err = nil + } + n += uint(nn) + } + } + // xdebugf("decReadFull: len(bs): %v, n: %v, err: %v", len(bs), n, err) + // do not do this - it serves no purpose + // if n != len(bs) && err == io.EOF { err = io.ErrUnexpectedEOF } + return +} + +func decNakedReadRawBytes(dr decDriver, d *Decoder, n *decNaked, rawToString bool) { + if rawToString { + n.v = valueTypeString + n.s = string(dr.DecodeBytes(d.b[:], true)) + } else { + n.v = valueTypeBytes + n.l = dr.DecodeBytes(nil, false) + } } diff --git a/vendor/github.com/ugorji/go/codec/encode.go b/vendor/github.com/ugorji/go/codec/encode.go index 4914be0c7..8462440c3 100644 --- a/vendor/github.com/ugorji/go/codec/encode.go +++ b/vendor/github.com/ugorji/go/codec/encode.go @@ -1,626 +1,1267 @@ -// Copyright (c) 2012, 2013 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. package codec import ( + "encoding" + "errors" + "fmt" "io" "reflect" + "runtime" + "sort" + "strconv" + "time" ) -const ( - // Some tagging information for error messages. - msgTagEnc = "codec.encoder" - defEncByteBufSize = 1 << 6 // 4:16, 6:64, 8:256, 10:1024 - // maxTimeSecs32 = math.MaxInt32 / 60 / 24 / 366 -) - -// AsSymbolFlag defines what should be encoded as symbols. -type AsSymbolFlag uint8 - -const ( - // AsSymbolDefault is default. - // Currently, this means only encode struct field names as symbols. - // The default is subject to change. - AsSymbolDefault AsSymbolFlag = iota - - // AsSymbolAll means encode anything which could be a symbol as a symbol. - AsSymbolAll = 0xfe +// defEncByteBufSize is the default size of []byte used +// for bufio buffer or []byte (when nil passed) +const defEncByteBufSize = 1 << 10 // 4:16, 6:64, 8:256, 10:1024 - // AsSymbolNone means do not encode anything as a symbol. - AsSymbolNone = 1 << iota +var errEncoderNotInitialized = errors.New("Encoder not initialized") - // AsSymbolMapStringKeys means encode keys in map[string]XXX as symbols. - AsSymbolMapStringKeysFlag +/* - // AsSymbolStructFieldName means encode struct field names as symbols. - AsSymbolStructFieldNameFlag -) - -// encWriter abstracting writing to a byte array or to an io.Writer. +// encWriter abstracts writing to a byte array or to an io.Writer. +// +// +// Deprecated: Use encWriterSwitch instead. type encWriter interface { - writeUint16(uint16) - writeUint32(uint32) - writeUint64(uint64) writeb([]byte) writestr(string) writen1(byte) writen2(byte, byte) - atEndOfEncode() + end() } +*/ + // encDriver abstracts the actual codec (binc vs msgpack, etc) type encDriver interface { - isBuiltinType(rt uintptr) bool - encodeBuiltin(rt uintptr, v interface{}) - encodeNil() - encodeInt(i int64) - encodeUint(i uint64) - encodeBool(b bool) - encodeFloat32(f float32) - encodeFloat64(f float64) - encodeExtPreamble(xtag byte, length int) - encodeArrayPreamble(length int) - encodeMapPreamble(length int) - encodeString(c charEncoding, v string) - encodeSymbol(v string) - encodeStringBytes(c charEncoding, v []byte) - //TODO + EncodeNil() + EncodeInt(i int64) + EncodeUint(i uint64) + EncodeBool(b bool) + EncodeFloat32(f float32) + EncodeFloat64(f float64) + // encodeExtPreamble(xtag byte, length int) + EncodeRawExt(re *RawExt, e *Encoder) + EncodeExt(v interface{}, xtag uint64, ext Ext, e *Encoder) + // Deprecated: use EncodeStringEnc instead + EncodeString(c charEncoding, v string) + // Deprecated: use EncodeStringBytesRaw instead + EncodeStringBytes(c charEncoding, v []byte) + EncodeStringEnc(c charEncoding, v string) // c cannot be cRAW + // EncodeSymbol(v string) + EncodeStringBytesRaw(v []byte) + EncodeTime(time.Time) //encBignum(f *big.Int) //encStringRunes(c charEncoding, v []rune) + WriteArrayStart(length int) + WriteArrayElem() + WriteArrayEnd() + WriteMapStart(length int) + WriteMapElemKey() + WriteMapElemValue() + WriteMapEnd() + + reset() + atEndOfEncode() } -type ioEncWriterWriter interface { - WriteByte(c byte) error - WriteString(s string) (n int, err error) - Write(p []byte) (n int, err error) +type encDriverAsis interface { + EncodeAsis(v []byte) } -type ioEncStringWriter interface { - WriteString(s string) (n int, err error) +type encodeError struct { + codecError } +func (e encodeError) Error() string { + return fmt.Sprintf("%s encode error: %v", e.name, e.err) +} + +type encDriverNoopContainerWriter struct{} + +func (encDriverNoopContainerWriter) WriteArrayStart(length int) {} +func (encDriverNoopContainerWriter) WriteArrayElem() {} +func (encDriverNoopContainerWriter) WriteArrayEnd() {} +func (encDriverNoopContainerWriter) WriteMapStart(length int) {} +func (encDriverNoopContainerWriter) WriteMapElemKey() {} +func (encDriverNoopContainerWriter) WriteMapElemValue() {} +func (encDriverNoopContainerWriter) WriteMapEnd() {} +func (encDriverNoopContainerWriter) atEndOfEncode() {} + +type encDriverTrackContainerWriter struct { + c containerState +} + +func (e *encDriverTrackContainerWriter) WriteArrayStart(length int) { e.c = containerArrayStart } +func (e *encDriverTrackContainerWriter) WriteArrayElem() { e.c = containerArrayElem } +func (e *encDriverTrackContainerWriter) WriteArrayEnd() { e.c = containerArrayEnd } +func (e *encDriverTrackContainerWriter) WriteMapStart(length int) { e.c = containerMapStart } +func (e *encDriverTrackContainerWriter) WriteMapElemKey() { e.c = containerMapKey } +func (e *encDriverTrackContainerWriter) WriteMapElemValue() { e.c = containerMapValue } +func (e *encDriverTrackContainerWriter) WriteMapEnd() { e.c = containerMapEnd } +func (e *encDriverTrackContainerWriter) atEndOfEncode() {} + +// type ioEncWriterWriter interface { +// WriteByte(c byte) error +// WriteString(s string) (n int, err error) +// Write(p []byte) (n int, err error) +// } + +// EncodeOptions captures configuration options during encode. type EncodeOptions struct { - // Encode a struct as an array, and not as a map. + // WriterBufferSize is the size of the buffer used when writing. + // + // if > 0, we use a smart buffer internally for performance purposes. + WriterBufferSize int + + // ChanRecvTimeout is the timeout used when selecting from a chan. + // + // Configuring this controls how we receive from a chan during the encoding process. + // - If ==0, we only consume the elements currently available in the chan. + // - if <0, we consume until the chan is closed. + // - If >0, we consume until this timeout. + ChanRecvTimeout time.Duration + + // StructToArray specifies to encode a struct as an array, and not as a map StructToArray bool - // AsSymbols defines what should be encoded as symbols. + // Canonical representation means that encoding a value will always result in the same + // sequence of bytes. // - // Encoding as symbols can reduce the encoded size significantly. + // This only affects maps, as the iteration order for maps is random. // - // However, during decoding, each string to be encoded as a symbol must - // be checked to see if it has been seen before. Consequently, encoding time - // will increase if using symbols, because string comparisons has a clear cost. + // The implementation MAY use the natural sort order for the map keys if possible: // - // Sample values: - // AsSymbolNone - // AsSymbolAll - // AsSymbolMapStringKeys - // AsSymbolMapStringKeysFlag | AsSymbolStructFieldNameFlag - AsSymbols AsSymbolFlag -} + // - 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 -// --------------------------------------------- + // CheckCircularRef controls whether we check for circular references + // and error fast during an encode. + // + // If enabled, an error is received if a pointer to a struct + // references itself either directly or through one of its fields (iteratively). + // + // This is opt-in, as there may be a performance hit to checking circular references. + CheckCircularRef bool -type simpleIoEncWriterWriter struct { - w io.Writer - bw io.ByteWriter - sw ioEncStringWriter -} + // RecursiveEmptyCheck controls whether we descend into interfaces, structs and pointers + // when checking if a value is empty. + // + // Note that this may make OmitEmpty more expensive, as it incurs a lot more reflect calls. + RecursiveEmptyCheck bool -func (o *simpleIoEncWriterWriter) WriteByte(c byte) (err error) { - if o.bw != nil { - return o.bw.WriteByte(c) - } - _, err = o.w.Write([]byte{c}) - return -} + // Raw controls whether we encode Raw values. + // This is a "dangerous" option and must be explicitly set. + // If set, we blindly encode Raw values as-is, without checking + // if they are a correct representation of a value in that format. + // If unset, we error out. + Raw bool -func (o *simpleIoEncWriterWriter) WriteString(s string) (n int, err error) { - if o.sw != nil { - return o.sw.WriteString(s) - } - return o.w.Write([]byte(s)) + // StringToRaw controls how strings are encoded. + // + // As a go string is just an (immutable) sequence of bytes, + // it can be encoded either as raw bytes or as a UTF string. + // + // By default, strings are encoded as UTF-8. + // but can be treated as []byte during an encode. + // + // Note that things which we know (by definition) to be UTF-8 + // are ALWAYS encoded as UTF-8 strings. + // These include encoding.TextMarshaler, time.Format calls, struct field names, etc. + StringToRaw bool + + // // AsSymbols defines what should be encoded as symbols. + // // + // // Encoding as symbols can reduce the encoded size significantly. + // // + // // However, during decoding, each string to be encoded as a symbol must + // // be checked to see if it has been seen before. Consequently, encoding time + // // will increase if using symbols, because string comparisons has a clear cost. + // // + // // Sample values: + // // AsSymbolNone + // // AsSymbolAll + // // AsSymbolMapStringKeys + // // AsSymbolMapStringKeysFlag | AsSymbolStructFieldNameFlag + // AsSymbols AsSymbolFlag } -func (o *simpleIoEncWriterWriter) Write(p []byte) (n int, err error) { - return o.w.Write(p) -} +// --------------------------------------------- + +/* -// ---------------------------------------- +type ioEncStringWriter interface { + WriteString(s string) (n int, err error) +} // ioEncWriter implements encWriter and can write to an io.Writer implementation type ioEncWriter struct { - w ioEncWriterWriter - x [8]byte // temp byte array re-used internally for efficiency + w io.Writer + ww io.Writer + bw io.ByteWriter + sw ioEncStringWriter + fw ioFlusher + b [8]byte } -func (z *ioEncWriter) writeUint16(v uint16) { - bigen.PutUint16(z.x[:2], v) - z.writeb(z.x[:2]) +func (z *ioEncWriter) reset(w io.Writer) { + z.w = w + var ok bool + if z.bw, ok = w.(io.ByteWriter); !ok { + z.bw = z + } + if z.sw, ok = w.(ioEncStringWriter); !ok { + z.sw = z + } + z.fw, _ = w.(ioFlusher) + z.ww = w } -func (z *ioEncWriter) writeUint32(v uint32) { - bigen.PutUint32(z.x[:4], v) - z.writeb(z.x[:4]) +func (z *ioEncWriter) WriteByte(b byte) (err error) { + z.b[0] = b + _, err = z.w.Write(z.b[:1]) + return } -func (z *ioEncWriter) writeUint64(v uint64) { - bigen.PutUint64(z.x[:8], v) - z.writeb(z.x[:8]) +func (z *ioEncWriter) WriteString(s string) (n int, err error) { + return z.w.Write(bytesView(s)) } func (z *ioEncWriter) writeb(bs []byte) { - if len(bs) == 0 { - return - } - n, err := z.w.Write(bs) - if err != nil { + if _, err := z.ww.Write(bs); err != nil { panic(err) } - if n != len(bs) { - encErr("write: Incorrect num bytes written. Expecting: %v, Wrote: %v", len(bs), n) - } } func (z *ioEncWriter) writestr(s string) { - n, err := z.w.WriteString(s) - if err != nil { + if _, err := z.sw.WriteString(s); err != nil { panic(err) } - if n != len(s) { - encErr("write: Incorrect num bytes written. Expecting: %v, Wrote: %v", len(s), n) - } } func (z *ioEncWriter) writen1(b byte) { - if err := z.w.WriteByte(b); err != nil { + if err := z.bw.WriteByte(b); err != nil { panic(err) } } -func (z *ioEncWriter) writen2(b1 byte, b2 byte) { - z.writen1(b1) - z.writen1(b2) +func (z *ioEncWriter) writen2(b1, b2 byte) { + var err error + if err = z.bw.WriteByte(b1); err == nil { + if err = z.bw.WriteByte(b2); err == nil { + return + } + } + panic(err) } -func (z *ioEncWriter) atEndOfEncode() {} +// func (z *ioEncWriter) writen5(b1, b2, b3, b4, b5 byte) { +// z.b[0], z.b[1], z.b[2], z.b[3], z.b[4] = b1, b2, b3, b4, b5 +// if _, err := z.ww.Write(z.b[:5]); err != nil { +// panic(err) +// } +// } -// ---------------------------------------- +//go:noinline - so *encWriterSwitch.XXX has the bytesEncAppender.XXX inlined +func (z *ioEncWriter) end() { + if z.fw != nil { + if err := z.fw.Flush(); err != nil { + panic(err) + } + } +} -// bytesEncWriter implements encWriter and can write to an byte slice. -// It is used by Marshal function. -type bytesEncWriter struct { - b []byte - c int // cursor - out *[]byte // write out on atEndOfEncode +*/ + +// --------------------------------------------- + +// bufioEncWriter +type bufioEncWriter struct { + buf []byte + w io.Writer + n int + sz int // buf size + + // Extensions can call Encode() within a current Encode() call. + // We need to know when the top level Encode() call returns, + // so we can decide whether to Release() or not. + calls uint16 // what depth in mustDecode are we in now. + + _ [6]uint8 // padding + + bytesBufPooler + + _ [1]uint64 // padding + // a int + // b [4]byte + // err } -func (z *bytesEncWriter) writeUint16(v uint16) { - c := z.grow(2) - z.b[c] = byte(v >> 8) - z.b[c+1] = byte(v) +func (z *bufioEncWriter) reset(w io.Writer, bufsize int) { + z.w = w + z.n = 0 + z.calls = 0 + if bufsize <= 0 { + bufsize = defEncByteBufSize + } + z.sz = bufsize + if cap(z.buf) >= bufsize { + z.buf = z.buf[:cap(z.buf)] + } else { + z.buf = z.bytesBufPooler.get(bufsize) + // z.buf = make([]byte, bufsize) + } } -func (z *bytesEncWriter) writeUint32(v uint32) { - c := z.grow(4) - z.b[c] = byte(v >> 24) - z.b[c+1] = byte(v >> 16) - z.b[c+2] = byte(v >> 8) - z.b[c+3] = byte(v) +func (z *bufioEncWriter) release() { + z.buf = nil + z.bytesBufPooler.end() } -func (z *bytesEncWriter) writeUint64(v uint64) { - c := z.grow(8) - z.b[c] = byte(v >> 56) - z.b[c+1] = byte(v >> 48) - z.b[c+2] = byte(v >> 40) - z.b[c+3] = byte(v >> 32) - z.b[c+4] = byte(v >> 24) - z.b[c+5] = byte(v >> 16) - z.b[c+6] = byte(v >> 8) - z.b[c+7] = byte(v) +//go:noinline - flush only called intermittently +func (z *bufioEncWriter) flushErr() (err error) { + n, err := z.w.Write(z.buf[:z.n]) + z.n -= n + if z.n > 0 && err == nil { + err = io.ErrShortWrite + } + if n > 0 && z.n > 0 { + copy(z.buf, z.buf[n:z.n+n]) + } + return err } -func (z *bytesEncWriter) writeb(s []byte) { - if len(s) == 0 { - return +func (z *bufioEncWriter) flush() { + if err := z.flushErr(); err != nil { + panic(err) } - c := z.grow(len(s)) - copy(z.b[c:], s) } -func (z *bytesEncWriter) writestr(s string) { - c := z.grow(len(s)) - copy(z.b[c:], s) +func (z *bufioEncWriter) writeb(s []byte) { +LOOP: + a := len(z.buf) - z.n + if len(s) > a { + z.n += copy(z.buf[z.n:], s[:a]) + s = s[a:] + z.flush() + goto LOOP + } + z.n += copy(z.buf[z.n:], s) } -func (z *bytesEncWriter) writen1(b1 byte) { - c := z.grow(1) - z.b[c] = b1 +func (z *bufioEncWriter) writestr(s string) { + // z.writeb(bytesView(s)) // inlined below +LOOP: + a := len(z.buf) - z.n + if len(s) > a { + z.n += copy(z.buf[z.n:], s[:a]) + s = s[a:] + z.flush() + goto LOOP + } + z.n += copy(z.buf[z.n:], s) } -func (z *bytesEncWriter) writen2(b1 byte, b2 byte) { - c := z.grow(2) - z.b[c] = b1 - z.b[c+1] = b2 +func (z *bufioEncWriter) writen1(b1 byte) { + if 1 > len(z.buf)-z.n { + z.flush() + } + z.buf[z.n] = b1 + z.n++ } -func (z *bytesEncWriter) atEndOfEncode() { - *(z.out) = z.b[:z.c] +func (z *bufioEncWriter) writen2(b1, b2 byte) { + if 2 > len(z.buf)-z.n { + z.flush() + } + z.buf[z.n+1] = b2 + z.buf[z.n] = b1 + z.n += 2 } -func (z *bytesEncWriter) grow(n int) (oldcursor int) { - oldcursor = z.c - z.c = oldcursor + n - if z.c > cap(z.b) { - // Tried using appendslice logic: (if cap < 1024, *2, else *1.25). - // However, it was too expensive, causing too many iterations of copy. - // Using bytes.Buffer model was much better (2*cap + n) - bs := make([]byte, 2*cap(z.b)+n) - copy(bs, z.b[:oldcursor]) - z.b = bs - } else if z.c > len(z.b) { - z.b = z.b[:cap(z.b)] +func (z *bufioEncWriter) endErr() (err error) { + if z.n > 0 { + err = z.flushErr() } return } // --------------------------------------------- -type encFnInfo struct { - ti *typeInfo - e *Encoder - ee encDriver - xfFn func(reflect.Value) ([]byte, error) - xfTag byte +// bytesEncAppender implements encWriter and can write to an byte slice. +type bytesEncAppender struct { + b []byte + out *[]byte } -func (f *encFnInfo) builtin(rv reflect.Value) { - f.ee.encodeBuiltin(f.ti.rtid, rv.Interface()) +func (z *bytesEncAppender) writeb(s []byte) { + z.b = append(z.b, s...) } - -func (f *encFnInfo) rawExt(rv reflect.Value) { - f.e.encRawExt(rv.Interface().(RawExt)) +func (z *bytesEncAppender) writestr(s string) { + z.b = append(z.b, s...) } - -func (f *encFnInfo) ext(rv reflect.Value) { - bs, fnerr := f.xfFn(rv) - if fnerr != nil { - panic(fnerr) - } - if bs == nil { - f.ee.encodeNil() - return - } - if f.e.hh.writeExt() { - f.ee.encodeExtPreamble(f.xfTag, len(bs)) - f.e.w.writeb(bs) - } else { - f.ee.encodeStringBytes(c_RAW, bs) - } - +func (z *bytesEncAppender) writen1(b1 byte) { + z.b = append(z.b, b1) } - -func (f *encFnInfo) binaryMarshal(rv reflect.Value) { - var bm binaryMarshaler - if f.ti.mIndir == 0 { - bm = rv.Interface().(binaryMarshaler) - } else if f.ti.mIndir == -1 { - bm = rv.Addr().Interface().(binaryMarshaler) - } else { - for j, k := int8(0), f.ti.mIndir; j < k; j++ { - if rv.IsNil() { - f.ee.encodeNil() - return - } - rv = rv.Elem() - } - bm = rv.Interface().(binaryMarshaler) - } - // debugf(">>>> binaryMarshaler: %T", rv.Interface()) - bs, fnerr := bm.MarshalBinary() - if fnerr != nil { - panic(fnerr) - } - if bs == nil { - f.ee.encodeNil() - } else { - f.ee.encodeStringBytes(c_RAW, bs) - } +func (z *bytesEncAppender) writen2(b1, b2 byte) { + z.b = append(z.b, b1, b2) } +func (z *bytesEncAppender) endErr() error { + *(z.out) = z.b + return nil +} +func (z *bytesEncAppender) reset(in []byte, out *[]byte) { + z.b = in[:0] + z.out = out +} + +// --------------------------------------------- -func (f *encFnInfo) kBool(rv reflect.Value) { - f.ee.encodeBool(rv.Bool()) +func (e *Encoder) rawExt(f *codecFnInfo, rv reflect.Value) { + e.e.EncodeRawExt(rv2i(rv).(*RawExt), e) } -func (f *encFnInfo) kString(rv reflect.Value) { - f.ee.encodeString(c_UTF8, rv.String()) +func (e *Encoder) ext(f *codecFnInfo, rv reflect.Value) { + e.e.EncodeExt(rv2i(rv), f.xfTag, f.xfFn, e) } -func (f *encFnInfo) kFloat64(rv reflect.Value) { - f.ee.encodeFloat64(rv.Float()) +func (e *Encoder) selferMarshal(f *codecFnInfo, rv reflect.Value) { + rv2i(rv).(Selfer).CodecEncodeSelf(e) } -func (f *encFnInfo) kFloat32(rv reflect.Value) { - f.ee.encodeFloat32(float32(rv.Float())) +func (e *Encoder) binaryMarshal(f *codecFnInfo, rv reflect.Value) { + bs, fnerr := rv2i(rv).(encoding.BinaryMarshaler).MarshalBinary() + e.marshalRaw(bs, fnerr) } -func (f *encFnInfo) kInt(rv reflect.Value) { - f.ee.encodeInt(rv.Int()) +func (e *Encoder) textMarshal(f *codecFnInfo, rv reflect.Value) { + bs, fnerr := rv2i(rv).(encoding.TextMarshaler).MarshalText() + e.marshalUtf8(bs, fnerr) } -func (f *encFnInfo) kUint(rv reflect.Value) { - f.ee.encodeUint(rv.Uint()) +func (e *Encoder) jsonMarshal(f *codecFnInfo, rv reflect.Value) { + bs, fnerr := rv2i(rv).(jsonMarshaler).MarshalJSON() + e.marshalAsis(bs, fnerr) } -func (f *encFnInfo) kInvalid(rv reflect.Value) { - f.ee.encodeNil() +func (e *Encoder) raw(f *codecFnInfo, rv reflect.Value) { + e.rawBytes(rv2i(rv).(Raw)) } -func (f *encFnInfo) kErr(rv reflect.Value) { - encErr("Unsupported kind: %s, for: %#v", rv.Kind(), rv) +func (e *Encoder) kInvalid(f *codecFnInfo, rv reflect.Value) { + e.e.EncodeNil() } -func (f *encFnInfo) kSlice(rv reflect.Value) { - if rv.IsNil() { - f.ee.encodeNil() - return - } +func (e *Encoder) kErr(f *codecFnInfo, rv reflect.Value) { + e.errorf("unsupported kind %s, for %#v", rv.Kind(), rv) +} - if shortCircuitReflectToFastPath { - switch f.ti.rtid { - case intfSliceTypId: - f.e.encSliceIntf(rv.Interface().([]interface{})) - return - case strSliceTypId: - f.e.encSliceStr(rv.Interface().([]string)) - return - case uint64SliceTypId: - f.e.encSliceUint64(rv.Interface().([]uint64)) +func (e *Encoder) kSlice(f *codecFnInfo, rv reflect.Value) { + ti := f.ti + ee := e.e + // array may be non-addressable, so we have to manage with care + // (don't call rv.Bytes, rv.Slice, etc). + // E.g. type struct S{B [2]byte}; + // Encode(S{}) will bomb on "panic: slice of unaddressable array". + if f.seq != seqTypeArray { + if rv.IsNil() { + ee.EncodeNil() return - case int64SliceTypId: - f.e.encSliceInt64(rv.Interface().([]int64)) + } + // If in this method, then there was no extension function defined. + // So it's okay to treat as []byte. + if ti.rtid == uint8SliceTypId { + ee.EncodeStringBytesRaw(rv.Bytes()) return } } + if f.seq == seqTypeChan && ti.chandir&uint8(reflect.RecvDir) == 0 { + e.errorf("send-only channel cannot be encoded") + } + elemsep := e.esep + rtelem := ti.elem + rtelemIsByte := uint8TypId == rt2id(rtelem) // NOT rtelem.Kind() == reflect.Uint8 + var l int + // if a slice, array or chan of bytes, treat specially + if rtelemIsByte { + switch f.seq { + case seqTypeSlice: + ee.EncodeStringBytesRaw(rv.Bytes()) + case seqTypeArray: + l = rv.Len() + if rv.CanAddr() { + ee.EncodeStringBytesRaw(rv.Slice(0, l).Bytes()) + } else { + var bs []byte + if l <= cap(e.b) { + bs = e.b[:l] + } else { + bs = make([]byte, l) + } + reflect.Copy(reflect.ValueOf(bs), rv) + ee.EncodeStringBytesRaw(bs) + } + case seqTypeChan: + // do not use range, so that the number of elements encoded + // does not change, and encoding does not hang waiting on someone to close chan. + // for b := range rv2i(rv).(<-chan byte) { bs = append(bs, b) } + // ch := rv2i(rv).(<-chan byte) // fix error - that this is a chan byte, not a <-chan byte. + + if rv.IsNil() { + ee.EncodeNil() + break + } + bs := e.b[:0] + irv := rv2i(rv) + ch, ok := irv.(<-chan byte) + if !ok { + ch = irv.(chan byte) + } + + L1: + switch timeout := e.h.ChanRecvTimeout; { + case timeout == 0: // only consume available + for { + select { + case b := <-ch: + bs = append(bs, b) + default: + break L1 + } + } + case timeout > 0: // consume until timeout + tt := time.NewTimer(timeout) + for { + select { + case b := <-ch: + bs = append(bs, b) + case <-tt.C: + // close(tt.C) + break L1 + } + } + default: // consume until close + for b := range ch { + bs = append(bs, b) + } + } - // If in this method, then there was no extension function defined. - // So it's okay to treat as []byte. - if f.ti.rtid == uint8SliceTypId || f.ti.rt.Elem().Kind() == reflect.Uint8 { - f.ee.encodeStringBytes(c_RAW, rv.Bytes()) + ee.EncodeStringBytesRaw(bs) + } return } - l := rv.Len() - if f.ti.mbs { + // if chan, consume chan into a slice, and work off that slice. + if f.seq == seqTypeChan { + rvcs := reflect.Zero(reflect.SliceOf(rtelem)) + timeout := e.h.ChanRecvTimeout + if timeout < 0 { // consume until close + for { + recv, recvOk := rv.Recv() + if !recvOk { + break + } + rvcs = reflect.Append(rvcs, recv) + } + } else { + cases := make([]reflect.SelectCase, 2) + cases[0] = reflect.SelectCase{Dir: reflect.SelectRecv, Chan: rv} + if timeout == 0 { + cases[1] = reflect.SelectCase{Dir: reflect.SelectDefault} + } else { + tt := time.NewTimer(timeout) + cases[1] = reflect.SelectCase{Dir: reflect.SelectRecv, Chan: reflect.ValueOf(tt.C)} + } + for { + chosen, recv, recvOk := reflect.Select(cases) + if chosen == 1 || !recvOk { + break + } + rvcs = reflect.Append(rvcs, recv) + } + } + rv = rvcs // TODO: ensure this doesn't mess up anywhere that rv of kind chan is expected + } + + l = rv.Len() + if ti.mbs { if l%2 == 1 { - encErr("mapBySlice: invalid length (must be divisible by 2): %v", l) + e.errorf("mapBySlice requires even slice length, but got %v", l) + return } - f.ee.encodeMapPreamble(l / 2) + ee.WriteMapStart(l / 2) } else { - f.ee.encodeArrayPreamble(l) + ee.WriteArrayStart(l) } - if l == 0 { - return + + if l > 0 { + var fn *codecFn + for rtelem.Kind() == reflect.Ptr { + rtelem = rtelem.Elem() + } + // if kind is reflect.Interface, do not pre-determine the + // encoding type, because preEncodeValue may break it down to + // a concrete type and kInterface will bomb. + if rtelem.Kind() != reflect.Interface { + fn = e.h.fn(rtelem, true, true) + } + for j := 0; j < l; j++ { + if elemsep { + if ti.mbs { + if j%2 == 0 { + ee.WriteMapElemKey() + } else { + ee.WriteMapElemValue() + } + } else { + ee.WriteArrayElem() + } + } + e.encodeValue(rv.Index(j), fn, true) + } } - for j := 0; j < l; j++ { - // TODO: Consider perf implication of encoding odd index values as symbols if type is string - f.e.encodeValue(rv.Index(j)) + + if ti.mbs { + ee.WriteMapEnd() + } else { + ee.WriteArrayEnd() } } -func (f *encFnInfo) kArray(rv reflect.Value) { - // We cannot share kSlice method, because the array may be non-addressable. - // E.g. type struct S{B [2]byte}; Encode(S{}) will bomb on "panic: slice of unaddressable array". - // So we have to duplicate the functionality here. - // f.e.encodeValue(rv.Slice(0, rv.Len())) - // f.kSlice(rv.Slice(0, rv.Len())) +func (e *Encoder) kStructNoOmitempty(f *codecFnInfo, rv reflect.Value) { + fti := f.ti + tisfi := fti.sfiSrc + toMap := !(fti.toArray || e.h.StructToArray) + if toMap { + tisfi = fti.sfiSort + } - l := rv.Len() - // Handle an array of bytes specially (in line with what is done for slices) - if f.ti.rt.Elem().Kind() == reflect.Uint8 { - if l == 0 { - f.ee.encodeStringBytes(c_RAW, nil) - return + ee := e.e + + sfn := structFieldNode{v: rv, update: false} + if toMap { + ee.WriteMapStart(len(tisfi)) + if e.esep { + for _, si := range tisfi { + ee.WriteMapElemKey() + e.kStructFieldKey(fti.keyType, si.encNameAsciiAlphaNum, si.encName) + ee.WriteMapElemValue() + e.encodeValue(sfn.field(si), nil, true) + } + } else { + for _, si := range tisfi { + e.kStructFieldKey(fti.keyType, si.encNameAsciiAlphaNum, si.encName) + e.encodeValue(sfn.field(si), nil, true) + } } - var bs []byte - if rv.CanAddr() { - bs = rv.Slice(0, l).Bytes() + ee.WriteMapEnd() + } else { + ee.WriteArrayStart(len(tisfi)) + if e.esep { + for _, si := range tisfi { + ee.WriteArrayElem() + e.encodeValue(sfn.field(si), nil, true) + } } else { - bs = make([]byte, l) - for i := 0; i < l; i++ { - bs[i] = byte(rv.Index(i).Uint()) + for _, si := range tisfi { + e.encodeValue(sfn.field(si), nil, true) } } - f.ee.encodeStringBytes(c_RAW, bs) - return + ee.WriteArrayEnd() } +} - if f.ti.mbs { - if l%2 == 1 { - encErr("mapBySlice: invalid length (must be divisible by 2): %v", l) - } - f.ee.encodeMapPreamble(l / 2) - } else { - f.ee.encodeArrayPreamble(l) - } - if l == 0 { - return - } - for j := 0; j < l; j++ { - // TODO: Consider perf implication of encoding odd index values as symbols if type is string - f.e.encodeValue(rv.Index(j)) - } +func (e *Encoder) kStructFieldKey(keyType valueType, encNameAsciiAlphaNum bool, encName string) { + encStructFieldKey(encName, e.e, e.w, keyType, encNameAsciiAlphaNum, e.js) } -func (f *encFnInfo) kStruct(rv reflect.Value) { +func (e *Encoder) kStruct(f *codecFnInfo, rv reflect.Value) { fti := f.ti - newlen := len(fti.sfi) - rvals := make([]reflect.Value, newlen) - var encnames []string - e := f.e - tisfi := fti.sfip + elemsep := e.esep + tisfi := fti.sfiSrc + var newlen int toMap := !(fti.toArray || e.h.StructToArray) + var mf map[string]interface{} + if f.ti.mf { + mf = rv2i(rv).(MissingFielder).CodecMissingFields() + toMap = true + newlen += len(mf) + } else if f.ti.mfp { + if rv.CanAddr() { + mf = rv2i(rv.Addr()).(MissingFielder).CodecMissingFields() + } else { + // make a new addressable value of same one, and use it + rv2 := reflect.New(rv.Type()) + rv2.Elem().Set(rv) + mf = rv2i(rv2).(MissingFielder).CodecMissingFields() + } + toMap = true + newlen += len(mf) + } // if toMap, use the sorted array. If toArray, use unsorted array (to match sequence in struct) if toMap { - tisfi = fti.sfi - encnames = make([]string, newlen) + tisfi = fti.sfiSort } + newlen += len(tisfi) + ee := e.e + + // Use sync.Pool to reduce allocating slices unnecessarily. + // The cost of sync.Pool is less than the cost of new allocation. + // + // Each element of the array pools one of encStructPool(8|16|32|64). + // It allows the re-use of slices up to 64 in length. + // A performance cost of encoding structs was collecting + // which values were empty and should be omitted. + // We needed slices of reflect.Value and string to collect them. + // This shared pool reduces the amount of unnecessary creation we do. + // The cost is that of locking sometimes, but sync.Pool is efficient + // enough to reduce thread contention. + + // fmt.Printf(">>>>>>>>>>>>>> encode.kStruct: newlen: %d\n", newlen) + var spool sfiRvPooler + var fkvs = spool.get(newlen) + + var kv sfiRv + recur := e.h.RecursiveEmptyCheck + sfn := structFieldNode{v: rv, update: false} newlen = 0 for _, si := range tisfi { - if si.i != -1 { - rvals[newlen] = rv.Field(int(si.i)) - } else { - rvals[newlen] = rv.FieldByIndex(si.is) - } + // kv.r = si.field(rv, false) + kv.r = sfn.field(si) if toMap { - if si.omitEmpty && isEmptyValue(rvals[newlen]) { + if si.omitEmpty() && isEmptyValue(kv.r, e.h.TypeInfos, recur, recur) { continue } - encnames[newlen] = si.encName + kv.v = si // si.encName } else { - if si.omitEmpty && isEmptyValue(rvals[newlen]) { - rvals[newlen] = reflect.Value{} //encode as nil + // use the zero value. + // if a reference or struct, set to nil (so you do not output too much) + if si.omitEmpty() && isEmptyValue(kv.r, e.h.TypeInfos, recur, recur) { + switch kv.r.Kind() { + case reflect.Struct, reflect.Interface, reflect.Ptr, + reflect.Array, reflect.Map, reflect.Slice: + kv.r = reflect.Value{} //encode as nil + } } } + fkvs[newlen] = kv newlen++ } + fkvs = fkvs[:newlen] + + var mflen int + for k, v := range mf { + if k == "" { + delete(mf, k) + continue + } + if fti.infoFieldOmitempty && isEmptyValue(reflect.ValueOf(v), e.h.TypeInfos, recur, recur) { + delete(mf, k) + continue + } + mflen++ + } - // debugf(">>>> kStruct: newlen: %v", newlen) + var j int if toMap { - ee := f.ee //don't dereference everytime - ee.encodeMapPreamble(newlen) - // asSymbols := e.h.AsSymbols&AsSymbolStructFieldNameFlag != 0 - asSymbols := e.h.AsSymbols == AsSymbolDefault || e.h.AsSymbols&AsSymbolStructFieldNameFlag != 0 - for j := 0; j < newlen; j++ { - if asSymbols { - ee.encodeSymbol(encnames[j]) - } else { - ee.encodeString(c_UTF8, encnames[j]) + ee.WriteMapStart(newlen + mflen) + if elemsep { + for j = 0; j < len(fkvs); j++ { + kv = fkvs[j] + ee.WriteMapElemKey() + e.kStructFieldKey(fti.keyType, kv.v.encNameAsciiAlphaNum, kv.v.encName) + ee.WriteMapElemValue() + e.encodeValue(kv.r, nil, true) } - e.encodeValue(rvals[j]) + } else { + for j = 0; j < len(fkvs); j++ { + kv = fkvs[j] + e.kStructFieldKey(fti.keyType, kv.v.encNameAsciiAlphaNum, kv.v.encName) + e.encodeValue(kv.r, nil, true) + } + } + // now, add the others + for k, v := range mf { + ee.WriteMapElemKey() + e.kStructFieldKey(fti.keyType, false, k) + ee.WriteMapElemValue() + e.encode(v) } + ee.WriteMapEnd() } else { - f.ee.encodeArrayPreamble(newlen) - for j := 0; j < newlen; j++ { - e.encodeValue(rvals[j]) + ee.WriteArrayStart(newlen) + if elemsep { + for j = 0; j < len(fkvs); j++ { + ee.WriteArrayElem() + e.encodeValue(fkvs[j].r, nil, true) + } + } else { + for j = 0; j < len(fkvs); j++ { + e.encodeValue(fkvs[j].r, nil, true) + } } + ee.WriteArrayEnd() } -} -// func (f *encFnInfo) kPtr(rv reflect.Value) { -// debugf(">>>>>>> ??? encode kPtr called - shouldn't get called") -// if rv.IsNil() { -// f.ee.encodeNil() -// return -// } -// f.e.encodeValue(rv.Elem()) -// } - -func (f *encFnInfo) kInterface(rv reflect.Value) { - if rv.IsNil() { - f.ee.encodeNil() - return - } - f.e.encodeValue(rv.Elem()) + // do not use defer. Instead, use explicit pool return at end of function. + // defer has a cost we are trying to avoid. + // If there is a panic and these slices are not returned, it is ok. + spool.end() } -func (f *encFnInfo) kMap(rv reflect.Value) { +func (e *Encoder) kMap(f *codecFnInfo, rv reflect.Value) { + ee := e.e if rv.IsNil() { - f.ee.encodeNil() + ee.EncodeNil() return } - if shortCircuitReflectToFastPath { - switch f.ti.rtid { - case mapIntfIntfTypId: - f.e.encMapIntfIntf(rv.Interface().(map[interface{}]interface{})) - return - case mapStrIntfTypId: - f.e.encMapStrIntf(rv.Interface().(map[string]interface{})) - return - case mapStrStrTypId: - f.e.encMapStrStr(rv.Interface().(map[string]string)) - return - case mapInt64IntfTypId: - f.e.encMapInt64Intf(rv.Interface().(map[int64]interface{})) - return - case mapUint64IntfTypId: - f.e.encMapUint64Intf(rv.Interface().(map[uint64]interface{})) - return - } - } - l := rv.Len() - f.ee.encodeMapPreamble(l) + ee.WriteMapStart(l) if l == 0 { + ee.WriteMapEnd() return } - // keyTypeIsString := f.ti.rt.Key().Kind() == reflect.String - keyTypeIsString := f.ti.rt.Key() == stringTyp - var asSymbols bool - if keyTypeIsString { - asSymbols = f.e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 + // var asSymbols bool + // determine the underlying key and val encFn's for the map. + // This eliminates some work which is done for each loop iteration i.e. + // rv.Type(), ref.ValueOf(rt).Pointer(), then check map/list for fn. + // + // However, if kind is reflect.Interface, do not pre-determine the + // encoding type, because preEncodeValue may break it down to + // a concrete type and kInterface will bomb. + var keyFn, valFn *codecFn + ti := f.ti + rtkey0 := ti.key + rtkey := rtkey0 + rtval0 := ti.elem + rtval := rtval0 + // rtkeyid := rt2id(rtkey0) + for rtval.Kind() == reflect.Ptr { + rtval = rtval.Elem() + } + if rtval.Kind() != reflect.Interface { + valFn = e.h.fn(rtval, true, true) } mks := rv.MapKeys() + + if e.h.Canonical { + e.kMapCanonical(rtkey, rv, mks, valFn) + ee.WriteMapEnd() + return + } + + var keyTypeIsString = stringTypId == rt2id(rtkey0) // rtkeyid + if !keyTypeIsString { + for rtkey.Kind() == reflect.Ptr { + rtkey = rtkey.Elem() + } + if rtkey.Kind() != reflect.Interface { + // rtkeyid = rt2id(rtkey) + keyFn = e.h.fn(rtkey, true, true) + } + } + // for j, lmks := 0, len(mks); j < lmks; j++ { for j := range mks { + if e.esep { + ee.WriteMapElemKey() + } if keyTypeIsString { - if asSymbols { - f.ee.encodeSymbol(mks[j].String()) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(mks[j].String())) } else { - f.ee.encodeString(c_UTF8, mks[j].String()) + ee.EncodeStringEnc(cUTF8, mks[j].String()) } } else { - f.e.encodeValue(mks[j]) + e.encodeValue(mks[j], keyFn, true) + } + if e.esep { + ee.WriteMapElemValue() + } + e.encodeValue(rv.MapIndex(mks[j]), valFn, true) + + } + ee.WriteMapEnd() +} + +func (e *Encoder) kMapCanonical(rtkey reflect.Type, rv reflect.Value, mks []reflect.Value, valFn *codecFn) { + ee := e.e + elemsep := e.esep + // we previously did out-of-band if an extension was registered. + // This is not necessary, as the natural kind is sufficient for ordering. + + 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 { + if elemsep { + ee.WriteMapElemKey() + } + ee.EncodeBool(mksv[i].v) + if elemsep { + ee.WriteMapElemValue() + } + e.encodeValue(rv.MapIndex(mksv[i].r), valFn, true) + } + 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 elemsep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(mksv[i].v)) + } else { + ee.EncodeStringEnc(cUTF8, mksv[i].v) + } + if elemsep { + ee.WriteMapElemValue() + } + e.encodeValue(rv.MapIndex(mksv[i].r), valFn, true) + } + 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 { + if elemsep { + ee.WriteMapElemKey() + } + ee.EncodeUint(mksv[i].v) + if elemsep { + ee.WriteMapElemValue() + } + e.encodeValue(rv.MapIndex(mksv[i].r), valFn, true) + } + 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 { + if elemsep { + ee.WriteMapElemKey() + } + ee.EncodeInt(mksv[i].v) + if elemsep { + ee.WriteMapElemValue() + } + e.encodeValue(rv.MapIndex(mksv[i].r), valFn, true) + } + 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 { + if elemsep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(float32(mksv[i].v)) + if elemsep { + ee.WriteMapElemValue() + } + e.encodeValue(rv.MapIndex(mksv[i].r), valFn, true) } - f.e.encodeValue(rv.MapIndex(mks[j])) + 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 { + if elemsep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(mksv[i].v) + if elemsep { + ee.WriteMapElemValue() + } + e.encodeValue(rv.MapIndex(mksv[i].r), valFn, true) + } + case reflect.Struct: + if rv.Type() == timeTyp { + mksv := make([]timeRv, len(mks)) + for i, k := range mks { + v := &mksv[i] + v.r = k + v.v = rv2i(k).(time.Time) + } + sort.Sort(timeRvSlice(mksv)) + for i := range mksv { + if elemsep { + ee.WriteMapElemKey() + } + ee.EncodeTime(mksv[i].v) + if elemsep { + ee.WriteMapElemValue() + } + e.encodeValue(rv.MapIndex(mksv[i].r), valFn, true) + } + break + } + fallthrough + 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:] + } + sort.Sort(bytesRvSlice(mksbv)) + for j := range mksbv { + if elemsep { + ee.WriteMapElemKey() + } + e.asis(mksbv[j].v) + if elemsep { + ee.WriteMapElemValue() + } + e.encodeValue(rv.MapIndex(mksbv[j].r), valFn, true) + } + } +} + +// // -------------------------------------------------- + +type encWriterSwitch struct { + // wi *ioEncWriter + wb bytesEncAppender + wf *bufioEncWriter + // typ entryType + bytes bool // encoding to []byte + esep bool // whether it has elem separators + isas bool // whether e.as != nil + js bool // is json encoder? + be bool // is binary encoder? + _ [2]byte // padding + // _ [2]uint64 // padding + // _ uint64 // padding +} + +func (z *encWriterSwitch) writeb(s []byte) { + if z.bytes { + z.wb.writeb(s) + } else { + z.wf.writeb(s) + } +} +func (z *encWriterSwitch) writestr(s string) { + if z.bytes { + z.wb.writestr(s) + } else { + z.wf.writestr(s) + } +} +func (z *encWriterSwitch) writen1(b1 byte) { + if z.bytes { + z.wb.writen1(b1) + } else { + z.wf.writen1(b1) + } +} +func (z *encWriterSwitch) writen2(b1, b2 byte) { + if z.bytes { + z.wb.writen2(b1, b2) + } else { + z.wf.writen2(b1, b2) } +} +func (z *encWriterSwitch) endErr() error { + if z.bytes { + return z.wb.endErr() + } + return z.wf.endErr() +} +func (z *encWriterSwitch) end() { + if err := z.endErr(); err != nil { + panic(err) + } } -// -------------------------------------------------- +/* -// encFn encapsulates the captured variables and the encode function. -// This way, we only do some calculations one times, and pass to the -// code block that should be called (encapsulated in a function) -// instead of executing the checks every time. -type encFn struct { - i *encFnInfo - f func(*encFnInfo, reflect.Value) +// ------------------------------------------ +func (z *encWriterSwitch) writeb(s []byte) { + switch z.typ { + case entryTypeBytes: + z.wb.writeb(s) + case entryTypeIo: + z.wi.writeb(s) + default: + z.wf.writeb(s) + } +} +func (z *encWriterSwitch) writestr(s string) { + switch z.typ { + case entryTypeBytes: + z.wb.writestr(s) + case entryTypeIo: + z.wi.writestr(s) + default: + z.wf.writestr(s) + } +} +func (z *encWriterSwitch) writen1(b1 byte) { + switch z.typ { + case entryTypeBytes: + z.wb.writen1(b1) + case entryTypeIo: + z.wi.writen1(b1) + default: + z.wf.writen1(b1) + } +} +func (z *encWriterSwitch) writen2(b1, b2 byte) { + switch z.typ { + case entryTypeBytes: + z.wb.writen2(b1, b2) + case entryTypeIo: + z.wi.writen2(b1, b2) + default: + z.wf.writen2(b1, b2) + } +} +func (z *encWriterSwitch) end() { + switch z.typ { + case entryTypeBytes: + z.wb.end() + case entryTypeIo: + z.wi.end() + default: + z.wf.end() + } } -// -------------------------------------------------- +// ------------------------------------------ +func (z *encWriterSwitch) writeb(s []byte) { + if z.bytes { + z.wb.writeb(s) + } else { + z.wi.writeb(s) + } +} +func (z *encWriterSwitch) writestr(s string) { + if z.bytes { + z.wb.writestr(s) + } else { + z.wi.writestr(s) + } +} +func (z *encWriterSwitch) writen1(b1 byte) { + if z.bytes { + z.wb.writen1(b1) + } else { + z.wi.writen1(b1) + } +} +func (z *encWriterSwitch) writen2(b1, b2 byte) { + if z.bytes { + z.wb.writen2(b1, b2) + } else { + z.wi.writen2(b1, b2) + } +} +func (z *encWriterSwitch) end() { + if z.bytes { + z.wb.end() + } else { + z.wi.end() + } +} + +*/ -// An Encoder writes an object to an output stream in the codec format. +// Encoder writes an object to an output stream in a supported format. +// +// Encoder is NOT safe for concurrent use i.e. a Encoder cannot be used +// concurrently in multiple goroutines. +// +// However, as Encoder could be allocation heavy to initialize, a Reset method is provided +// so its state can be reused to decode new input streams repeatedly. +// This is the idiomatic way to use. type Encoder struct { - w encWriter - e encDriver + panicHdl + // hopefully, reduce derefencing cost by laying the encWriter inside the Encoder + e encDriver + + // NOTE: Encoder shouldn't call it's write methods, + // as the handler MAY need to do some coordination. + w *encWriterSwitch + + // bw *bufio.Writer + as encDriverAsis + + err error + h *BasicHandle hh Handle - f map[uintptr]encFn - x []uintptr - s []encFn + // ---- cpu cache line boundary? + 3 + encWriterSwitch + + ci set + + b [(5 * 8)]byte // for encoding chan or (non-addressable) [N]byte + + // ---- writable fields during execution --- *try* to keep in sep cache line + + // ---- cpu cache line boundary? + // b [scratchByteArrayLen]byte + // _ [cacheLineSize - scratchByteArrayLen]byte // padding + // b [cacheLineSize - (8 * 0)]byte // used for encoding a chan or (non-addressable) array of bytes } // NewEncoder returns an Encoder for encoding into an io.Writer. // -// For efficiency, Users are encouraged to pass in a memory buffered writer -// (eg bufio.Writer, bytes.Buffer). +// For efficiency, Users are encouraged to configure WriterBufferSize on the handle +// OR pass in a memory buffered writer (eg bufio.Writer, bytes.Buffer). func NewEncoder(w io.Writer, h Handle) *Encoder { - ww, ok := w.(ioEncWriterWriter) - if !ok { - sww := simpleIoEncWriterWriter{w: w} - sww.bw, _ = w.(io.ByteWriter) - sww.sw, _ = w.(ioEncStringWriter) - ww = &sww - //ww = bufio.NewWriterSize(w, defEncByteBufSize) - } - z := ioEncWriter{ - w: ww, - } - return &Encoder{w: &z, hh: h, h: h.getBasicHandle(), e: h.newEncDriver(&z)} + e := newEncoder(h) + e.Reset(w) + return e } // NewEncoderBytes returns an encoder for encoding directly and efficiently @@ -629,373 +1270,539 @@ func NewEncoder(w io.Writer, h Handle) *Encoder { // It will potentially replace the output byte slice pointed to. // After encoding, the out parameter contains the encoded contents. func NewEncoderBytes(out *[]byte, h Handle) *Encoder { - in := *out + e := newEncoder(h) + e.ResetBytes(out) + return e +} + +func newEncoder(h Handle) *Encoder { + e := &Encoder{h: basicHandle(h), err: errEncoderNotInitialized} + e.bytes = true + if useFinalizers { + runtime.SetFinalizer(e, (*Encoder).finalize) + // xdebugf(">>>> new(Encoder) with finalizer") + } + e.w = &e.encWriterSwitch + e.hh = h + e.esep = h.hasElemSeparators() + + return e +} + +func (e *Encoder) resetCommon() { + // e.w = &e.encWriterSwitch + if e.e == nil || e.hh.recreateEncDriver(e.e) { + e.e = e.hh.newEncDriver(e) + e.as, e.isas = e.e.(encDriverAsis) + // e.cr, _ = e.e.(containerStateRecv) + } + e.be = e.hh.isBinary() + _, e.js = e.hh.(*JsonHandle) + e.e.reset() + e.err = nil +} + +// Reset resets the Encoder with a new output stream. +// +// This accommodates using the state of the Encoder, +// where it has "cached" information about sub-engines. +func (e *Encoder) Reset(w io.Writer) { + if w == nil { + return + } + // var ok bool + e.bytes = false + if e.wf == nil { + e.wf = new(bufioEncWriter) + } + // e.typ = entryTypeUnset + // if e.h.WriterBufferSize > 0 { + // // bw := bufio.NewWriterSize(w, e.h.WriterBufferSize) + // // e.wi.bw = bw + // // e.wi.sw = bw + // // e.wi.fw = bw + // // e.wi.ww = bw + // if e.wf == nil { + // e.wf = new(bufioEncWriter) + // } + // e.wf.reset(w, e.h.WriterBufferSize) + // e.typ = entryTypeBufio + // } else { + // if e.wi == nil { + // e.wi = new(ioEncWriter) + // } + // e.wi.reset(w) + // e.typ = entryTypeIo + // } + e.wf.reset(w, e.h.WriterBufferSize) + // e.typ = entryTypeBufio + + // e.w = e.wi + e.resetCommon() +} + +// ResetBytes resets the Encoder with a new destination output []byte. +func (e *Encoder) ResetBytes(out *[]byte) { + if out == nil { + return + } + var in []byte = *out if in == nil { in = make([]byte, defEncByteBufSize) } - z := bytesEncWriter{ - b: in, - out: out, - } - return &Encoder{w: &z, hh: h, h: h.getBasicHandle(), e: h.newEncDriver(&z)} + e.bytes = true + // e.typ = entryTypeBytes + e.wb.reset(in, out) + // e.w = &e.wb + e.resetCommon() } -// Encode writes an object into a stream in the codec format. +// Encode writes an object into a stream. // -// Encoding can be configured via the "codec" struct tag for the fields. +// Encoding can be configured via the struct tag for the fields. +// The key (in the struct tags) that we look at is configurable. // -// The "codec" key in struct field's tag value is the key name, +// By default, we look up the "codec" key in the struct field's tags, +// and fall bak to the "json" key if "codec" is absent. +// That key in struct field's tag value is the key name, // followed by an optional comma and options. // // To set an option on all fields (e.g. omitempty on all fields), you -// can create a field called _struct, and set flags on it. +// can create a field called _struct, and set flags on it. The options +// which can be set on _struct are: +// - omitempty: so all fields are omitted if empty +// - toarray: so struct is encoded as an array +// - int: so struct key names are encoded as signed integers (instead of strings) +// - uint: so struct key names are encoded as unsigned integers (instead of strings) +// - float: so struct key names are encoded as floats (instead of strings) +// More details on these below. // // Struct values "usually" encode as maps. Each exported struct field is encoded unless: -// - the field's codec tag is "-", OR -// - the field is empty and its codec tag specifies the "omitempty" option. +// - the field's tag is "-", OR +// - the field is empty (empty or the zero value) and its tag specifies the "omitempty" option. // // When encoding as a map, the first string in the tag (before the comma) // is the map key string to use when encoding. +// ... +// This key is typically encoded as a string. +// However, there are instances where the encoded stream has mapping keys encoded as numbers. +// For example, some cbor streams have keys as integer codes in the stream, but they should map +// to fields in a structured object. Consequently, a struct is the natural representation in code. +// For these, configure the struct to encode/decode the keys as numbers (instead of string). +// This is done with the int,uint or float option on the _struct field (see above). // // However, struct values may encode as arrays. This happens when: // - StructToArray Encode option is set, OR -// - the codec tag on the _struct field sets the "toarray" option +// - the tag on the _struct field sets the "toarray" option +// Note that omitempty is ignored when encoding struct values as arrays, +// as an entry must be encoded for each field, to maintain its position. // // Values with types that implement MapBySlice are encoded as stream maps. // // The empty values (for omitempty option) are false, 0, any nil pointer // or interface value, and any array, slice, map, or string of length zero. // -// Anonymous fields are encoded inline if no struct tag is present. -// Else they are encoded as regular fields. +// Anonymous fields are encoded inline except: +// - the struct tag specifies a replacement name (first value) +// - the field is of an interface type // // Examples: // +// // NOTE: 'json:' can be used as struct tag key, in place 'codec:' below. // type MyStruct struct { // _struct bool `codec:",omitempty"` //set omitempty for every field // Field1 string `codec:"-"` //skip this field // Field2 int `codec:"myName"` //Use key "myName" in encode stream // Field3 int32 `codec:",omitempty"` //use key "Field3". Omit if empty. // Field4 bool `codec:"f4,omitempty"` //use key "f4". Omit if empty. +// io.Reader //use key "Reader". +// MyStruct `codec:"my1" //use key "my1". +// MyStruct //inline it // ... // } // // type MyStruct struct { -// _struct bool `codec:",omitempty,toarray"` //set omitempty for every field -// //and encode struct as an array +// _struct bool `codec:",toarray"` //encode struct as an array +// } +// +// type MyStruct struct { +// _struct bool `codec:",uint"` //encode struct with "unsigned integer" keys +// Field1 string `codec:"1"` //encode Field1 key using: EncodeInt(1) +// Field2 string `codec:"2"` //encode Field2 key using: EncodeInt(2) // } // // The mode of encoding is based on the type of the value. When a value is seen: +// - If a Selfer, call its CodecEncodeSelf method // - If an extension is registered for it, call that extension function -// - If it implements BinaryMarshaler, call its MarshalBinary() (data []byte, err error) +// - If implements encoding.(Binary|Text|JSON)Marshaler, call Marshal(Binary|Text|JSON) method // - Else encode it based on its reflect.Kind // // Note that struct field names and keys in map[string]XXX will be treated as symbols. // Some formats support symbols (e.g. binc) and will properly encode the string // only once in the stream, and use a tag to refer to it thereafter. func (e *Encoder) Encode(v interface{}) (err error) { - defer panicToErr(&err) - e.encode(v) - e.w.atEndOfEncode() + // tried to use closure, as runtime optimizes defer with no params. + // This seemed to be causing weird issues (like circular reference found, unexpected panic, etc). + // Also, see https://github.com/golang/go/issues/14939#issuecomment-417836139 + // defer func() { e.deferred(&err) }() } + // { x, y := e, &err; defer func() { x.deferred(y) }() } + if e.err != nil { + return e.err + } + if recoverPanicToErr { + defer func() { + // if error occurred during encoding, return that error; + // else if error occurred on end'ing (i.e. during flush), return that error. + err = e.w.endErr() + x := recover() + if x == nil { + e.err = err + } else { + panicValToErr(e, x, &e.err) + err = e.err + } + }() + } + + // defer e.deferred(&err) + e.mustEncode(v) return } +// MustEncode is like Encode, but panics if unable to Encode. +// This provides insight to the code location that triggered the error. +func (e *Encoder) MustEncode(v interface{}) { + if e.err != nil { + panic(e.err) + } + e.mustEncode(v) +} + +func (e *Encoder) mustEncode(v interface{}) { + if e.wf == nil { + e.encode(v) + e.e.atEndOfEncode() + e.w.end() + return + } + + if e.wf.buf == nil { + e.wf.buf = e.wf.bytesBufPooler.get(e.wf.sz) + } + e.wf.calls++ + + e.encode(v) + e.e.atEndOfEncode() + e.w.end() + + e.wf.calls-- + + if !e.h.ExplicitRelease && e.wf.calls == 0 { + e.wf.release() + } +} + +// func (e *Encoder) deferred(err1 *error) { +// e.w.end() +// if recoverPanicToErr { +// if x := recover(); x != nil { +// panicValToErr(e, x, err1) +// panicValToErr(e, x, &e.err) +// } +// } +// } + +//go:noinline -- as it is run by finalizer +func (e *Encoder) finalize() { + // xdebugf("finalizing Encoder") + e.Release() +} + +// Release releases shared (pooled) resources. +// +// It is important to call Release() when done with an Encoder, so those resources +// are released instantly for use by subsequently created Encoders. +func (e *Encoder) Release() { + if e.wf != nil { + e.wf.release() + } +} + func (e *Encoder) encode(iv interface{}) { - switch v := iv.(type) { - case nil: - e.e.encodeNil() + // a switch with only concrete types can be optimized. + // consequently, we deal with nil and interfaces outside the switch. + + if iv == nil || definitelyNil(iv) { + e.e.EncodeNil() + return + } + switch v := iv.(type) { + // case nil: + // case Selfer: + case Raw: + e.rawBytes(v) case reflect.Value: - e.encodeValue(v) + e.encodeValue(v, nil, true) case string: - e.e.encodeString(c_UTF8, v) + if e.h.StringToRaw { + e.e.EncodeStringBytesRaw(bytesView(v)) + } else { + e.e.EncodeStringEnc(cUTF8, v) + } case bool: - e.e.encodeBool(v) + e.e.EncodeBool(v) case int: - e.e.encodeInt(int64(v)) + e.e.EncodeInt(int64(v)) case int8: - e.e.encodeInt(int64(v)) + e.e.EncodeInt(int64(v)) case int16: - e.e.encodeInt(int64(v)) + e.e.EncodeInt(int64(v)) case int32: - e.e.encodeInt(int64(v)) + e.e.EncodeInt(int64(v)) case int64: - e.e.encodeInt(v) + e.e.EncodeInt(v) case uint: - e.e.encodeUint(uint64(v)) + e.e.EncodeUint(uint64(v)) case uint8: - e.e.encodeUint(uint64(v)) + e.e.EncodeUint(uint64(v)) case uint16: - e.e.encodeUint(uint64(v)) + e.e.EncodeUint(uint64(v)) case uint32: - e.e.encodeUint(uint64(v)) + e.e.EncodeUint(uint64(v)) case uint64: - e.e.encodeUint(v) + e.e.EncodeUint(v) + case uintptr: + e.e.EncodeUint(uint64(v)) case float32: - e.e.encodeFloat32(v) + e.e.EncodeFloat32(v) case float64: - e.e.encodeFloat64(v) - - case []interface{}: - e.encSliceIntf(v) - case []string: - e.encSliceStr(v) - case []int64: - e.encSliceInt64(v) - case []uint64: - e.encSliceUint64(v) + e.e.EncodeFloat64(v) + case time.Time: + e.e.EncodeTime(v) case []uint8: - e.e.encodeStringBytes(c_RAW, v) - - case map[interface{}]interface{}: - e.encMapIntfIntf(v) - case map[string]interface{}: - e.encMapStrIntf(v) - case map[string]string: - e.encMapStrStr(v) - case map[int64]interface{}: - e.encMapInt64Intf(v) - case map[uint64]interface{}: - e.encMapUint64Intf(v) + e.e.EncodeStringBytesRaw(v) + + case *Raw: + e.rawBytes(*v) case *string: - e.e.encodeString(c_UTF8, *v) + if e.h.StringToRaw { + e.e.EncodeStringBytesRaw(bytesView(*v)) + } else { + e.e.EncodeStringEnc(cUTF8, *v) + } case *bool: - e.e.encodeBool(*v) + e.e.EncodeBool(*v) case *int: - e.e.encodeInt(int64(*v)) + e.e.EncodeInt(int64(*v)) case *int8: - e.e.encodeInt(int64(*v)) + e.e.EncodeInt(int64(*v)) case *int16: - e.e.encodeInt(int64(*v)) + e.e.EncodeInt(int64(*v)) case *int32: - e.e.encodeInt(int64(*v)) + e.e.EncodeInt(int64(*v)) case *int64: - e.e.encodeInt(*v) + e.e.EncodeInt(*v) case *uint: - e.e.encodeUint(uint64(*v)) + e.e.EncodeUint(uint64(*v)) case *uint8: - e.e.encodeUint(uint64(*v)) + e.e.EncodeUint(uint64(*v)) case *uint16: - e.e.encodeUint(uint64(*v)) + e.e.EncodeUint(uint64(*v)) case *uint32: - e.e.encodeUint(uint64(*v)) + e.e.EncodeUint(uint64(*v)) case *uint64: - e.e.encodeUint(*v) + e.e.EncodeUint(*v) + case *uintptr: + e.e.EncodeUint(uint64(*v)) case *float32: - e.e.encodeFloat32(*v) + e.e.EncodeFloat32(*v) case *float64: - e.e.encodeFloat64(*v) - - case *[]interface{}: - e.encSliceIntf(*v) - case *[]string: - e.encSliceStr(*v) - case *[]int64: - e.encSliceInt64(*v) - case *[]uint64: - e.encSliceUint64(*v) + e.e.EncodeFloat64(*v) + case *time.Time: + e.e.EncodeTime(*v) + case *[]uint8: - e.e.encodeStringBytes(c_RAW, *v) - - case *map[interface{}]interface{}: - e.encMapIntfIntf(*v) - case *map[string]interface{}: - e.encMapStrIntf(*v) - case *map[string]string: - e.encMapStrStr(*v) - case *map[int64]interface{}: - e.encMapInt64Intf(*v) - case *map[uint64]interface{}: - e.encMapUint64Intf(*v) + e.e.EncodeStringBytesRaw(*v) default: - e.encodeValue(reflect.ValueOf(iv)) + if v, ok := iv.(Selfer); ok { + v.CodecEncodeSelf(e) + } else if !fastpathEncodeTypeSwitch(iv, e) { + // checkfastpath=true (not false), as underlying slice/map type may be fast-path + e.encodeValue(reflect.ValueOf(iv), nil, true) + } } } -func (e *Encoder) encodeValue(rv reflect.Value) { - for rv.Kind() == reflect.Ptr { +func (e *Encoder) encodeValue(rv reflect.Value, fn *codecFn, checkFastpath bool) { + // if a valid fn is passed, it MUST BE for the dereferenced type of rv + var sptr uintptr + var rvp reflect.Value + var rvpValid bool +TOP: + switch rv.Kind() { + case reflect.Ptr: if rv.IsNil() { - e.e.encodeNil() + e.e.EncodeNil() return } + rvpValid = true + rvp = rv rv = rv.Elem() - } - - rt := rv.Type() - rtid := reflect.ValueOf(rt).Pointer() - - // if e.f == nil && e.s == nil { debugf("---->Creating new enc f map for type: %v\n", rt) } - var fn encFn - var ok bool - if useMapForCodecCache { - fn, ok = e.f[rtid] - } else { - for i, v := range e.x { - if v == rtid { - fn, ok = e.s[i], true - break - } + if e.h.CheckCircularRef && rv.Kind() == reflect.Struct { + // TODO: Movable pointers will be an issue here. Future problem. + sptr = rv.UnsafeAddr() + break TOP } - } - if !ok { - // debugf("\tCreating new enc fn for type: %v\n", rt) - fi := encFnInfo{ti: getTypeInfo(rtid, rt), e: e, ee: e.e} - fn.i = &fi - if rtid == rawExtTypId { - fn.f = (*encFnInfo).rawExt - } else if e.e.isBuiltinType(rtid) { - fn.f = (*encFnInfo).builtin - } else if xfTag, xfFn := e.h.getEncodeExt(rtid); xfFn != nil { - fi.xfTag, fi.xfFn = xfTag, xfFn - fn.f = (*encFnInfo).ext - } else if supportBinaryMarshal && fi.ti.m { - fn.f = (*encFnInfo).binaryMarshal - } else { - switch rk := rt.Kind(); rk { - case reflect.Bool: - fn.f = (*encFnInfo).kBool - case reflect.String: - fn.f = (*encFnInfo).kString - case reflect.Float64: - fn.f = (*encFnInfo).kFloat64 - case reflect.Float32: - fn.f = (*encFnInfo).kFloat32 - case reflect.Int, reflect.Int8, reflect.Int64, reflect.Int32, reflect.Int16: - fn.f = (*encFnInfo).kInt - case reflect.Uint8, reflect.Uint64, reflect.Uint, reflect.Uint32, reflect.Uint16: - fn.f = (*encFnInfo).kUint - case reflect.Invalid: - fn.f = (*encFnInfo).kInvalid - case reflect.Slice: - fn.f = (*encFnInfo).kSlice - case reflect.Array: - fn.f = (*encFnInfo).kArray - case reflect.Struct: - fn.f = (*encFnInfo).kStruct - // case reflect.Ptr: - // fn.f = (*encFnInfo).kPtr - case reflect.Interface: - fn.f = (*encFnInfo).kInterface - case reflect.Map: - fn.f = (*encFnInfo).kMap - default: - fn.f = (*encFnInfo).kErr - } - } - if useMapForCodecCache { - if e.f == nil { - e.f = make(map[uintptr]encFn, 16) - } - e.f[rtid] = fn - } else { - e.s = append(e.s, fn) - e.x = append(e.x, rtid) + goto TOP + case reflect.Interface: + if rv.IsNil() { + e.e.EncodeNil() + return + } + rv = rv.Elem() + goto TOP + case reflect.Slice, reflect.Map: + if rv.IsNil() { + e.e.EncodeNil() + return } + case reflect.Invalid, reflect.Func: + e.e.EncodeNil() + return } - fn.f(fn.i, rv) - -} + if sptr != 0 && (&e.ci).add(sptr) { + e.errorf("circular reference found: # %d", sptr) + } -func (e *Encoder) encRawExt(re RawExt) { - if re.Data == nil { - e.e.encodeNil() - return + if fn == nil { + rt := rv.Type() + // always pass checkCodecSelfer=true, in case T or ****T is passed, where *T is a Selfer + fn = e.h.fn(rt, checkFastpath, true) } - if e.hh.writeExt() { - e.e.encodeExtPreamble(re.Tag, len(re.Data)) - e.w.writeb(re.Data) + if fn.i.addrE { + if rvpValid { + fn.fe(e, &fn.i, rvp) + } else if rv.CanAddr() { + fn.fe(e, &fn.i, rv.Addr()) + } else { + rv2 := reflect.New(rv.Type()) + rv2.Elem().Set(rv) + fn.fe(e, &fn.i, rv2) + } } else { - e.e.encodeStringBytes(c_RAW, re.Data) + fn.fe(e, &fn.i, rv) + } + if sptr != 0 { + (&e.ci).remove(sptr) } } -// --------------------------------------------- -// short circuit functions for common maps and slices +// func (e *Encoder) marshal(bs []byte, fnerr error, asis bool, c charEncoding) { +// if fnerr != nil { +// panic(fnerr) +// } +// if bs == nil { +// e.e.EncodeNil() +// } else if asis { +// e.asis(bs) +// } else { +// e.e.EncodeStringBytesRaw(bs) +// } +// } -func (e *Encoder) encSliceIntf(v []interface{}) { - e.e.encodeArrayPreamble(len(v)) - for _, v2 := range v { - e.encode(v2) +func (e *Encoder) marshalUtf8(bs []byte, fnerr error) { + if fnerr != nil { + panic(fnerr) } -} - -func (e *Encoder) encSliceStr(v []string) { - e.e.encodeArrayPreamble(len(v)) - for _, v2 := range v { - e.e.encodeString(c_UTF8, v2) + if bs == nil { + e.e.EncodeNil() + } else { + e.e.EncodeStringEnc(cUTF8, stringView(bs)) } } -func (e *Encoder) encSliceInt64(v []int64) { - e.e.encodeArrayPreamble(len(v)) - for _, v2 := range v { - e.e.encodeInt(v2) +func (e *Encoder) marshalAsis(bs []byte, fnerr error) { + if fnerr != nil { + panic(fnerr) } -} - -func (e *Encoder) encSliceUint64(v []uint64) { - e.e.encodeArrayPreamble(len(v)) - for _, v2 := range v { - e.e.encodeUint(v2) + if bs == nil { + e.e.EncodeNil() + } else { + e.asis(bs) } } -func (e *Encoder) encMapStrStr(v map[string]string) { - e.e.encodeMapPreamble(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - for k2, v2 := range v { - if asSymbols { - e.e.encodeSymbol(k2) - } else { - e.e.encodeString(c_UTF8, k2) - } - e.e.encodeString(c_UTF8, v2) +func (e *Encoder) marshalRaw(bs []byte, fnerr error) { + if fnerr != nil { + panic(fnerr) + } + if bs == nil { + e.e.EncodeNil() + } else { + e.e.EncodeStringBytesRaw(bs) } } -func (e *Encoder) encMapStrIntf(v map[string]interface{}) { - e.e.encodeMapPreamble(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - for k2, v2 := range v { - if asSymbols { - e.e.encodeSymbol(k2) - } else { - e.e.encodeString(c_UTF8, k2) - } - e.encode(v2) +func (e *Encoder) asis(v []byte) { + if e.isas { + e.as.EncodeAsis(v) + } else { + e.w.writeb(v) } } -func (e *Encoder) encMapInt64Intf(v map[int64]interface{}) { - e.e.encodeMapPreamble(len(v)) - for k2, v2 := range v { - e.e.encodeInt(k2) - e.encode(v2) +func (e *Encoder) rawBytes(vv Raw) { + v := []byte(vv) + if !e.h.Raw { + e.errorf("Raw values cannot be encoded: %v", v) } + e.asis(v) } -func (e *Encoder) encMapUint64Intf(v map[uint64]interface{}) { - e.e.encodeMapPreamble(len(v)) - for k2, v2 := range v { - e.e.encodeUint(uint64(k2)) - e.encode(v2) - } +func (e *Encoder) wrapErr(v interface{}, err *error) { + *err = encodeError{codecError{name: e.hh.Name(), err: v}} } -func (e *Encoder) encMapIntfIntf(v map[interface{}]interface{}) { - e.e.encodeMapPreamble(len(v)) - for k2, v2 := range v { - e.encode(k2) - e.encode(v2) +func encStructFieldKey(encName string, ee encDriver, w *encWriterSwitch, + keyType valueType, encNameAsciiAlphaNum bool, js bool) { + var m must + // use if-else-if, not switch (which compiles to binary-search) + // since keyType is typically valueTypeString, branch prediction is pretty good. + if keyType == valueTypeString { + if js && encNameAsciiAlphaNum { // keyType == valueTypeString + // w.writen1('"') + // w.writestr(encName) + // w.writen1('"') + // ---- + // w.writestr(`"` + encName + `"`) + // ---- + // do concat myself, so it is faster than the generic string concat + b := make([]byte, len(encName)+2) + copy(b[1:], encName) + b[0] = '"' + b[len(b)-1] = '"' + w.writeb(b) + } else { // keyType == valueTypeString + ee.EncodeStringEnc(cUTF8, encName) + } + } else if keyType == valueTypeInt { + ee.EncodeInt(m.Int(strconv.ParseInt(encName, 10, 64))) + } else if keyType == valueTypeUint { + ee.EncodeUint(m.Uint(strconv.ParseUint(encName, 10, 64))) + } else if keyType == valueTypeFloat { + ee.EncodeFloat64(m.Float(strconv.ParseFloat(encName, 64))) } } -// ---------------------------------------- - -func encErr(format string, params ...interface{}) { - doPanic(msgTagEnc, format, params...) -} +// func encStringAsRawBytesMaybe(ee encDriver, s string, stringToRaw bool) { +// if stringToRaw { +// ee.EncodeStringBytesRaw(bytesView(s)) +// } else { +// ee.EncodeStringEnc(cUTF8, s) +// } +// } diff --git a/vendor/github.com/ugorji/go/codec/ext_dep_test.go b/vendor/github.com/ugorji/go/codec/ext_dep_test.go deleted file mode 100644 index eb28459f8..000000000 --- a/vendor/github.com/ugorji/go/codec/ext_dep_test.go +++ /dev/null @@ -1,75 +0,0 @@ -// //+build ignore - -// Copyright (c) 2012, 2013 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. - -package codec - -// This file includes benchmarks which have dependencies on 3rdparty -// packages (bson and vmihailenco/msgpack) which must be installed locally. -// -// To run the benchmarks including these 3rdparty packages, first -// - Uncomment first line in this file (put // // in front of it) -// - Get those packages: -// go get github.com/vmihailenco/msgpack -// go get labix.org/v2/mgo/bson -// - Run: -// go test -bi -bench=. - -import ( - "testing" - - vmsgpack "github.com/vmihailenco/msgpack" - "labix.org/v2/mgo/bson" -) - -func init() { - benchCheckers = append(benchCheckers, - benchChecker{"v-msgpack", fnVMsgpackEncodeFn, fnVMsgpackDecodeFn}, - benchChecker{"bson", fnBsonEncodeFn, fnBsonDecodeFn}, - ) -} - -func fnVMsgpackEncodeFn(ts interface{}) ([]byte, error) { - return vmsgpack.Marshal(ts) -} - -func fnVMsgpackDecodeFn(buf []byte, ts interface{}) error { - return vmsgpack.Unmarshal(buf, ts) -} - -func fnBsonEncodeFn(ts interface{}) ([]byte, error) { - return bson.Marshal(ts) -} - -func fnBsonDecodeFn(buf []byte, ts interface{}) error { - return bson.Unmarshal(buf, ts) -} - -func Benchmark__Bson_______Encode(b *testing.B) { - fnBenchmarkEncode(b, "bson", benchTs, fnBsonEncodeFn) -} - -func Benchmark__Bson_______Decode(b *testing.B) { - fnBenchmarkDecode(b, "bson", benchTs, fnBsonEncodeFn, fnBsonDecodeFn, fnBenchNewTs) -} - -func Benchmark__VMsgpack___Encode(b *testing.B) { - fnBenchmarkEncode(b, "v-msgpack", benchTs, fnVMsgpackEncodeFn) -} - -func Benchmark__VMsgpack___Decode(b *testing.B) { - fnBenchmarkDecode(b, "v-msgpack", benchTs, fnVMsgpackEncodeFn, fnVMsgpackDecodeFn, fnBenchNewTs) -} - -func TestMsgpackPythonGenStreams(t *testing.T) { - doTestMsgpackPythonGenStreams(t) -} - -func TestMsgpackRpcSpecGoClientToPythonSvc(t *testing.T) { - doTestMsgpackRpcSpecGoClientToPythonSvc(t) -} - -func TestMsgpackRpcSpecPythonClientToGoSvc(t *testing.T) { - doTestMsgpackRpcSpecPythonClientToGoSvc(t) -} diff --git a/vendor/github.com/ugorji/go/codec/fast-path.generated.go b/vendor/github.com/ugorji/go/codec/fast-path.generated.go new file mode 100644 index 000000000..9bc14bd63 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/fast-path.generated.go @@ -0,0 +1,33668 @@ +// +build !notfastpath + +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +// Code generated from fast-path.go.tmpl - DO NOT EDIT. + +package codec + +// Fast path functions try to create a fast path encode or decode implementation +// for common maps and slices. +// +// We define the functions and register then in this single file +// so as not to pollute the encode.go and decode.go, and create a dependency in there. +// This file can be omitted without causing a build failure. +// +// The advantage of fast paths is: +// - Many calls bypass reflection altogether +// +// Currently support +// - slice of all builtin types, +// - map of all builtin types to string or interface value +// - symmetrical maps of all builtin types (e.g. str-str, uint8-uint8) +// This should provide adequate "typical" implementations. +// +// Note that fast track decode functions must handle values for which an address cannot be obtained. +// For example: +// m2 := map[string]int{} +// p2 := []interface{}{m2} +// // decoding into p2 will bomb if fast track functions do not treat like unaddressable. +// + +import ( + "reflect" + "sort" +) + +const fastpathEnabled = true + +const fastpathMapBySliceErrMsg = "mapBySlice requires even slice length, but got %v" + +type fastpathT struct{} + +var fastpathTV fastpathT + +type fastpathE struct { + rtid uintptr + rt reflect.Type + encfn func(*Encoder, *codecFnInfo, reflect.Value) + decfn func(*Decoder, *codecFnInfo, reflect.Value) +} + +type fastpathA [271]fastpathE + +func (x *fastpathA) index(rtid uintptr) int { + // use binary search to grab the index (adapted from sort/search.go) + // Note: we use goto (instead of for loop) so this can be inlined. + // h, i, j := 0, 0, len(x) + var h, i uint + var j = uint(len(x)) +LOOP: + if i < j { + h = i + (j-i)/2 + if x[h].rtid < rtid { + i = h + 1 + } else { + j = h + } + goto LOOP + } + if i < uint(len(x)) && x[i].rtid == rtid { + return int(i) + } + return -1 +} + +type fastpathAslice []fastpathE + +func (x fastpathAslice) Len() int { return len(x) } +func (x fastpathAslice) Less(i, j int) bool { return x[uint(i)].rtid < x[uint(j)].rtid } +func (x fastpathAslice) Swap(i, j int) { x[uint(i)], x[uint(j)] = x[uint(j)], x[uint(i)] } + +var fastpathAV fastpathA + +// due to possible initialization loop error, make fastpath in an init() +func init() { + var i uint = 0 + fn := func(v interface{}, + fe func(*Encoder, *codecFnInfo, reflect.Value), + fd func(*Decoder, *codecFnInfo, reflect.Value)) { + xrt := reflect.TypeOf(v) + xptr := rt2id(xrt) + fastpathAV[i] = fastpathE{xptr, xrt, fe, fd} + i++ + } + + fn([]interface{}(nil), (*Encoder).fastpathEncSliceIntfR, (*Decoder).fastpathDecSliceIntfR) + fn([]string(nil), (*Encoder).fastpathEncSliceStringR, (*Decoder).fastpathDecSliceStringR) + fn([]float32(nil), (*Encoder).fastpathEncSliceFloat32R, (*Decoder).fastpathDecSliceFloat32R) + fn([]float64(nil), (*Encoder).fastpathEncSliceFloat64R, (*Decoder).fastpathDecSliceFloat64R) + fn([]uint(nil), (*Encoder).fastpathEncSliceUintR, (*Decoder).fastpathDecSliceUintR) + fn([]uint16(nil), (*Encoder).fastpathEncSliceUint16R, (*Decoder).fastpathDecSliceUint16R) + fn([]uint32(nil), (*Encoder).fastpathEncSliceUint32R, (*Decoder).fastpathDecSliceUint32R) + fn([]uint64(nil), (*Encoder).fastpathEncSliceUint64R, (*Decoder).fastpathDecSliceUint64R) + fn([]uintptr(nil), (*Encoder).fastpathEncSliceUintptrR, (*Decoder).fastpathDecSliceUintptrR) + fn([]int(nil), (*Encoder).fastpathEncSliceIntR, (*Decoder).fastpathDecSliceIntR) + fn([]int8(nil), (*Encoder).fastpathEncSliceInt8R, (*Decoder).fastpathDecSliceInt8R) + fn([]int16(nil), (*Encoder).fastpathEncSliceInt16R, (*Decoder).fastpathDecSliceInt16R) + fn([]int32(nil), (*Encoder).fastpathEncSliceInt32R, (*Decoder).fastpathDecSliceInt32R) + fn([]int64(nil), (*Encoder).fastpathEncSliceInt64R, (*Decoder).fastpathDecSliceInt64R) + fn([]bool(nil), (*Encoder).fastpathEncSliceBoolR, (*Decoder).fastpathDecSliceBoolR) + + fn(map[interface{}]interface{}(nil), (*Encoder).fastpathEncMapIntfIntfR, (*Decoder).fastpathDecMapIntfIntfR) + fn(map[interface{}]string(nil), (*Encoder).fastpathEncMapIntfStringR, (*Decoder).fastpathDecMapIntfStringR) + fn(map[interface{}]uint(nil), (*Encoder).fastpathEncMapIntfUintR, (*Decoder).fastpathDecMapIntfUintR) + fn(map[interface{}]uint8(nil), (*Encoder).fastpathEncMapIntfUint8R, (*Decoder).fastpathDecMapIntfUint8R) + fn(map[interface{}]uint16(nil), (*Encoder).fastpathEncMapIntfUint16R, (*Decoder).fastpathDecMapIntfUint16R) + fn(map[interface{}]uint32(nil), (*Encoder).fastpathEncMapIntfUint32R, (*Decoder).fastpathDecMapIntfUint32R) + fn(map[interface{}]uint64(nil), (*Encoder).fastpathEncMapIntfUint64R, (*Decoder).fastpathDecMapIntfUint64R) + fn(map[interface{}]uintptr(nil), (*Encoder).fastpathEncMapIntfUintptrR, (*Decoder).fastpathDecMapIntfUintptrR) + fn(map[interface{}]int(nil), (*Encoder).fastpathEncMapIntfIntR, (*Decoder).fastpathDecMapIntfIntR) + fn(map[interface{}]int8(nil), (*Encoder).fastpathEncMapIntfInt8R, (*Decoder).fastpathDecMapIntfInt8R) + fn(map[interface{}]int16(nil), (*Encoder).fastpathEncMapIntfInt16R, (*Decoder).fastpathDecMapIntfInt16R) + fn(map[interface{}]int32(nil), (*Encoder).fastpathEncMapIntfInt32R, (*Decoder).fastpathDecMapIntfInt32R) + fn(map[interface{}]int64(nil), (*Encoder).fastpathEncMapIntfInt64R, (*Decoder).fastpathDecMapIntfInt64R) + fn(map[interface{}]float32(nil), (*Encoder).fastpathEncMapIntfFloat32R, (*Decoder).fastpathDecMapIntfFloat32R) + fn(map[interface{}]float64(nil), (*Encoder).fastpathEncMapIntfFloat64R, (*Decoder).fastpathDecMapIntfFloat64R) + fn(map[interface{}]bool(nil), (*Encoder).fastpathEncMapIntfBoolR, (*Decoder).fastpathDecMapIntfBoolR) + fn(map[string]interface{}(nil), (*Encoder).fastpathEncMapStringIntfR, (*Decoder).fastpathDecMapStringIntfR) + fn(map[string]string(nil), (*Encoder).fastpathEncMapStringStringR, (*Decoder).fastpathDecMapStringStringR) + fn(map[string]uint(nil), (*Encoder).fastpathEncMapStringUintR, (*Decoder).fastpathDecMapStringUintR) + fn(map[string]uint8(nil), (*Encoder).fastpathEncMapStringUint8R, (*Decoder).fastpathDecMapStringUint8R) + fn(map[string]uint16(nil), (*Encoder).fastpathEncMapStringUint16R, (*Decoder).fastpathDecMapStringUint16R) + fn(map[string]uint32(nil), (*Encoder).fastpathEncMapStringUint32R, (*Decoder).fastpathDecMapStringUint32R) + fn(map[string]uint64(nil), (*Encoder).fastpathEncMapStringUint64R, (*Decoder).fastpathDecMapStringUint64R) + fn(map[string]uintptr(nil), (*Encoder).fastpathEncMapStringUintptrR, (*Decoder).fastpathDecMapStringUintptrR) + fn(map[string]int(nil), (*Encoder).fastpathEncMapStringIntR, (*Decoder).fastpathDecMapStringIntR) + fn(map[string]int8(nil), (*Encoder).fastpathEncMapStringInt8R, (*Decoder).fastpathDecMapStringInt8R) + fn(map[string]int16(nil), (*Encoder).fastpathEncMapStringInt16R, (*Decoder).fastpathDecMapStringInt16R) + fn(map[string]int32(nil), (*Encoder).fastpathEncMapStringInt32R, (*Decoder).fastpathDecMapStringInt32R) + fn(map[string]int64(nil), (*Encoder).fastpathEncMapStringInt64R, (*Decoder).fastpathDecMapStringInt64R) + fn(map[string]float32(nil), (*Encoder).fastpathEncMapStringFloat32R, (*Decoder).fastpathDecMapStringFloat32R) + fn(map[string]float64(nil), (*Encoder).fastpathEncMapStringFloat64R, (*Decoder).fastpathDecMapStringFloat64R) + fn(map[string]bool(nil), (*Encoder).fastpathEncMapStringBoolR, (*Decoder).fastpathDecMapStringBoolR) + fn(map[float32]interface{}(nil), (*Encoder).fastpathEncMapFloat32IntfR, (*Decoder).fastpathDecMapFloat32IntfR) + fn(map[float32]string(nil), (*Encoder).fastpathEncMapFloat32StringR, (*Decoder).fastpathDecMapFloat32StringR) + fn(map[float32]uint(nil), (*Encoder).fastpathEncMapFloat32UintR, (*Decoder).fastpathDecMapFloat32UintR) + fn(map[float32]uint8(nil), (*Encoder).fastpathEncMapFloat32Uint8R, (*Decoder).fastpathDecMapFloat32Uint8R) + fn(map[float32]uint16(nil), (*Encoder).fastpathEncMapFloat32Uint16R, (*Decoder).fastpathDecMapFloat32Uint16R) + fn(map[float32]uint32(nil), (*Encoder).fastpathEncMapFloat32Uint32R, (*Decoder).fastpathDecMapFloat32Uint32R) + fn(map[float32]uint64(nil), (*Encoder).fastpathEncMapFloat32Uint64R, (*Decoder).fastpathDecMapFloat32Uint64R) + fn(map[float32]uintptr(nil), (*Encoder).fastpathEncMapFloat32UintptrR, (*Decoder).fastpathDecMapFloat32UintptrR) + fn(map[float32]int(nil), (*Encoder).fastpathEncMapFloat32IntR, (*Decoder).fastpathDecMapFloat32IntR) + fn(map[float32]int8(nil), (*Encoder).fastpathEncMapFloat32Int8R, (*Decoder).fastpathDecMapFloat32Int8R) + fn(map[float32]int16(nil), (*Encoder).fastpathEncMapFloat32Int16R, (*Decoder).fastpathDecMapFloat32Int16R) + fn(map[float32]int32(nil), (*Encoder).fastpathEncMapFloat32Int32R, (*Decoder).fastpathDecMapFloat32Int32R) + fn(map[float32]int64(nil), (*Encoder).fastpathEncMapFloat32Int64R, (*Decoder).fastpathDecMapFloat32Int64R) + fn(map[float32]float32(nil), (*Encoder).fastpathEncMapFloat32Float32R, (*Decoder).fastpathDecMapFloat32Float32R) + fn(map[float32]float64(nil), (*Encoder).fastpathEncMapFloat32Float64R, (*Decoder).fastpathDecMapFloat32Float64R) + fn(map[float32]bool(nil), (*Encoder).fastpathEncMapFloat32BoolR, (*Decoder).fastpathDecMapFloat32BoolR) + fn(map[float64]interface{}(nil), (*Encoder).fastpathEncMapFloat64IntfR, (*Decoder).fastpathDecMapFloat64IntfR) + fn(map[float64]string(nil), (*Encoder).fastpathEncMapFloat64StringR, (*Decoder).fastpathDecMapFloat64StringR) + fn(map[float64]uint(nil), (*Encoder).fastpathEncMapFloat64UintR, (*Decoder).fastpathDecMapFloat64UintR) + fn(map[float64]uint8(nil), (*Encoder).fastpathEncMapFloat64Uint8R, (*Decoder).fastpathDecMapFloat64Uint8R) + fn(map[float64]uint16(nil), (*Encoder).fastpathEncMapFloat64Uint16R, (*Decoder).fastpathDecMapFloat64Uint16R) + fn(map[float64]uint32(nil), (*Encoder).fastpathEncMapFloat64Uint32R, (*Decoder).fastpathDecMapFloat64Uint32R) + fn(map[float64]uint64(nil), (*Encoder).fastpathEncMapFloat64Uint64R, (*Decoder).fastpathDecMapFloat64Uint64R) + fn(map[float64]uintptr(nil), (*Encoder).fastpathEncMapFloat64UintptrR, (*Decoder).fastpathDecMapFloat64UintptrR) + fn(map[float64]int(nil), (*Encoder).fastpathEncMapFloat64IntR, (*Decoder).fastpathDecMapFloat64IntR) + fn(map[float64]int8(nil), (*Encoder).fastpathEncMapFloat64Int8R, (*Decoder).fastpathDecMapFloat64Int8R) + fn(map[float64]int16(nil), (*Encoder).fastpathEncMapFloat64Int16R, (*Decoder).fastpathDecMapFloat64Int16R) + fn(map[float64]int32(nil), (*Encoder).fastpathEncMapFloat64Int32R, (*Decoder).fastpathDecMapFloat64Int32R) + fn(map[float64]int64(nil), (*Encoder).fastpathEncMapFloat64Int64R, (*Decoder).fastpathDecMapFloat64Int64R) + fn(map[float64]float32(nil), (*Encoder).fastpathEncMapFloat64Float32R, (*Decoder).fastpathDecMapFloat64Float32R) + fn(map[float64]float64(nil), (*Encoder).fastpathEncMapFloat64Float64R, (*Decoder).fastpathDecMapFloat64Float64R) + fn(map[float64]bool(nil), (*Encoder).fastpathEncMapFloat64BoolR, (*Decoder).fastpathDecMapFloat64BoolR) + fn(map[uint]interface{}(nil), (*Encoder).fastpathEncMapUintIntfR, (*Decoder).fastpathDecMapUintIntfR) + fn(map[uint]string(nil), (*Encoder).fastpathEncMapUintStringR, (*Decoder).fastpathDecMapUintStringR) + fn(map[uint]uint(nil), (*Encoder).fastpathEncMapUintUintR, (*Decoder).fastpathDecMapUintUintR) + fn(map[uint]uint8(nil), (*Encoder).fastpathEncMapUintUint8R, (*Decoder).fastpathDecMapUintUint8R) + fn(map[uint]uint16(nil), (*Encoder).fastpathEncMapUintUint16R, (*Decoder).fastpathDecMapUintUint16R) + fn(map[uint]uint32(nil), (*Encoder).fastpathEncMapUintUint32R, (*Decoder).fastpathDecMapUintUint32R) + fn(map[uint]uint64(nil), (*Encoder).fastpathEncMapUintUint64R, (*Decoder).fastpathDecMapUintUint64R) + fn(map[uint]uintptr(nil), (*Encoder).fastpathEncMapUintUintptrR, (*Decoder).fastpathDecMapUintUintptrR) + fn(map[uint]int(nil), (*Encoder).fastpathEncMapUintIntR, (*Decoder).fastpathDecMapUintIntR) + fn(map[uint]int8(nil), (*Encoder).fastpathEncMapUintInt8R, (*Decoder).fastpathDecMapUintInt8R) + fn(map[uint]int16(nil), (*Encoder).fastpathEncMapUintInt16R, (*Decoder).fastpathDecMapUintInt16R) + fn(map[uint]int32(nil), (*Encoder).fastpathEncMapUintInt32R, (*Decoder).fastpathDecMapUintInt32R) + fn(map[uint]int64(nil), (*Encoder).fastpathEncMapUintInt64R, (*Decoder).fastpathDecMapUintInt64R) + fn(map[uint]float32(nil), (*Encoder).fastpathEncMapUintFloat32R, (*Decoder).fastpathDecMapUintFloat32R) + fn(map[uint]float64(nil), (*Encoder).fastpathEncMapUintFloat64R, (*Decoder).fastpathDecMapUintFloat64R) + fn(map[uint]bool(nil), (*Encoder).fastpathEncMapUintBoolR, (*Decoder).fastpathDecMapUintBoolR) + fn(map[uint8]interface{}(nil), (*Encoder).fastpathEncMapUint8IntfR, (*Decoder).fastpathDecMapUint8IntfR) + fn(map[uint8]string(nil), (*Encoder).fastpathEncMapUint8StringR, (*Decoder).fastpathDecMapUint8StringR) + fn(map[uint8]uint(nil), (*Encoder).fastpathEncMapUint8UintR, (*Decoder).fastpathDecMapUint8UintR) + fn(map[uint8]uint8(nil), (*Encoder).fastpathEncMapUint8Uint8R, (*Decoder).fastpathDecMapUint8Uint8R) + fn(map[uint8]uint16(nil), (*Encoder).fastpathEncMapUint8Uint16R, (*Decoder).fastpathDecMapUint8Uint16R) + fn(map[uint8]uint32(nil), (*Encoder).fastpathEncMapUint8Uint32R, (*Decoder).fastpathDecMapUint8Uint32R) + fn(map[uint8]uint64(nil), (*Encoder).fastpathEncMapUint8Uint64R, (*Decoder).fastpathDecMapUint8Uint64R) + fn(map[uint8]uintptr(nil), (*Encoder).fastpathEncMapUint8UintptrR, (*Decoder).fastpathDecMapUint8UintptrR) + fn(map[uint8]int(nil), (*Encoder).fastpathEncMapUint8IntR, (*Decoder).fastpathDecMapUint8IntR) + fn(map[uint8]int8(nil), (*Encoder).fastpathEncMapUint8Int8R, (*Decoder).fastpathDecMapUint8Int8R) + fn(map[uint8]int16(nil), (*Encoder).fastpathEncMapUint8Int16R, (*Decoder).fastpathDecMapUint8Int16R) + fn(map[uint8]int32(nil), (*Encoder).fastpathEncMapUint8Int32R, (*Decoder).fastpathDecMapUint8Int32R) + fn(map[uint8]int64(nil), (*Encoder).fastpathEncMapUint8Int64R, (*Decoder).fastpathDecMapUint8Int64R) + fn(map[uint8]float32(nil), (*Encoder).fastpathEncMapUint8Float32R, (*Decoder).fastpathDecMapUint8Float32R) + fn(map[uint8]float64(nil), (*Encoder).fastpathEncMapUint8Float64R, (*Decoder).fastpathDecMapUint8Float64R) + fn(map[uint8]bool(nil), (*Encoder).fastpathEncMapUint8BoolR, (*Decoder).fastpathDecMapUint8BoolR) + fn(map[uint16]interface{}(nil), (*Encoder).fastpathEncMapUint16IntfR, (*Decoder).fastpathDecMapUint16IntfR) + fn(map[uint16]string(nil), (*Encoder).fastpathEncMapUint16StringR, (*Decoder).fastpathDecMapUint16StringR) + fn(map[uint16]uint(nil), (*Encoder).fastpathEncMapUint16UintR, (*Decoder).fastpathDecMapUint16UintR) + fn(map[uint16]uint8(nil), (*Encoder).fastpathEncMapUint16Uint8R, (*Decoder).fastpathDecMapUint16Uint8R) + fn(map[uint16]uint16(nil), (*Encoder).fastpathEncMapUint16Uint16R, (*Decoder).fastpathDecMapUint16Uint16R) + fn(map[uint16]uint32(nil), (*Encoder).fastpathEncMapUint16Uint32R, (*Decoder).fastpathDecMapUint16Uint32R) + fn(map[uint16]uint64(nil), (*Encoder).fastpathEncMapUint16Uint64R, (*Decoder).fastpathDecMapUint16Uint64R) + fn(map[uint16]uintptr(nil), (*Encoder).fastpathEncMapUint16UintptrR, (*Decoder).fastpathDecMapUint16UintptrR) + fn(map[uint16]int(nil), (*Encoder).fastpathEncMapUint16IntR, (*Decoder).fastpathDecMapUint16IntR) + fn(map[uint16]int8(nil), (*Encoder).fastpathEncMapUint16Int8R, (*Decoder).fastpathDecMapUint16Int8R) + fn(map[uint16]int16(nil), (*Encoder).fastpathEncMapUint16Int16R, (*Decoder).fastpathDecMapUint16Int16R) + fn(map[uint16]int32(nil), (*Encoder).fastpathEncMapUint16Int32R, (*Decoder).fastpathDecMapUint16Int32R) + fn(map[uint16]int64(nil), (*Encoder).fastpathEncMapUint16Int64R, (*Decoder).fastpathDecMapUint16Int64R) + fn(map[uint16]float32(nil), (*Encoder).fastpathEncMapUint16Float32R, (*Decoder).fastpathDecMapUint16Float32R) + fn(map[uint16]float64(nil), (*Encoder).fastpathEncMapUint16Float64R, (*Decoder).fastpathDecMapUint16Float64R) + fn(map[uint16]bool(nil), (*Encoder).fastpathEncMapUint16BoolR, (*Decoder).fastpathDecMapUint16BoolR) + fn(map[uint32]interface{}(nil), (*Encoder).fastpathEncMapUint32IntfR, (*Decoder).fastpathDecMapUint32IntfR) + fn(map[uint32]string(nil), (*Encoder).fastpathEncMapUint32StringR, (*Decoder).fastpathDecMapUint32StringR) + fn(map[uint32]uint(nil), (*Encoder).fastpathEncMapUint32UintR, (*Decoder).fastpathDecMapUint32UintR) + fn(map[uint32]uint8(nil), (*Encoder).fastpathEncMapUint32Uint8R, (*Decoder).fastpathDecMapUint32Uint8R) + fn(map[uint32]uint16(nil), (*Encoder).fastpathEncMapUint32Uint16R, (*Decoder).fastpathDecMapUint32Uint16R) + fn(map[uint32]uint32(nil), (*Encoder).fastpathEncMapUint32Uint32R, (*Decoder).fastpathDecMapUint32Uint32R) + fn(map[uint32]uint64(nil), (*Encoder).fastpathEncMapUint32Uint64R, (*Decoder).fastpathDecMapUint32Uint64R) + fn(map[uint32]uintptr(nil), (*Encoder).fastpathEncMapUint32UintptrR, (*Decoder).fastpathDecMapUint32UintptrR) + fn(map[uint32]int(nil), (*Encoder).fastpathEncMapUint32IntR, (*Decoder).fastpathDecMapUint32IntR) + fn(map[uint32]int8(nil), (*Encoder).fastpathEncMapUint32Int8R, (*Decoder).fastpathDecMapUint32Int8R) + fn(map[uint32]int16(nil), (*Encoder).fastpathEncMapUint32Int16R, (*Decoder).fastpathDecMapUint32Int16R) + fn(map[uint32]int32(nil), (*Encoder).fastpathEncMapUint32Int32R, (*Decoder).fastpathDecMapUint32Int32R) + fn(map[uint32]int64(nil), (*Encoder).fastpathEncMapUint32Int64R, (*Decoder).fastpathDecMapUint32Int64R) + fn(map[uint32]float32(nil), (*Encoder).fastpathEncMapUint32Float32R, (*Decoder).fastpathDecMapUint32Float32R) + fn(map[uint32]float64(nil), (*Encoder).fastpathEncMapUint32Float64R, (*Decoder).fastpathDecMapUint32Float64R) + fn(map[uint32]bool(nil), (*Encoder).fastpathEncMapUint32BoolR, (*Decoder).fastpathDecMapUint32BoolR) + fn(map[uint64]interface{}(nil), (*Encoder).fastpathEncMapUint64IntfR, (*Decoder).fastpathDecMapUint64IntfR) + fn(map[uint64]string(nil), (*Encoder).fastpathEncMapUint64StringR, (*Decoder).fastpathDecMapUint64StringR) + fn(map[uint64]uint(nil), (*Encoder).fastpathEncMapUint64UintR, (*Decoder).fastpathDecMapUint64UintR) + fn(map[uint64]uint8(nil), (*Encoder).fastpathEncMapUint64Uint8R, (*Decoder).fastpathDecMapUint64Uint8R) + fn(map[uint64]uint16(nil), (*Encoder).fastpathEncMapUint64Uint16R, (*Decoder).fastpathDecMapUint64Uint16R) + fn(map[uint64]uint32(nil), (*Encoder).fastpathEncMapUint64Uint32R, (*Decoder).fastpathDecMapUint64Uint32R) + fn(map[uint64]uint64(nil), (*Encoder).fastpathEncMapUint64Uint64R, (*Decoder).fastpathDecMapUint64Uint64R) + fn(map[uint64]uintptr(nil), (*Encoder).fastpathEncMapUint64UintptrR, (*Decoder).fastpathDecMapUint64UintptrR) + fn(map[uint64]int(nil), (*Encoder).fastpathEncMapUint64IntR, (*Decoder).fastpathDecMapUint64IntR) + fn(map[uint64]int8(nil), (*Encoder).fastpathEncMapUint64Int8R, (*Decoder).fastpathDecMapUint64Int8R) + fn(map[uint64]int16(nil), (*Encoder).fastpathEncMapUint64Int16R, (*Decoder).fastpathDecMapUint64Int16R) + fn(map[uint64]int32(nil), (*Encoder).fastpathEncMapUint64Int32R, (*Decoder).fastpathDecMapUint64Int32R) + fn(map[uint64]int64(nil), (*Encoder).fastpathEncMapUint64Int64R, (*Decoder).fastpathDecMapUint64Int64R) + fn(map[uint64]float32(nil), (*Encoder).fastpathEncMapUint64Float32R, (*Decoder).fastpathDecMapUint64Float32R) + fn(map[uint64]float64(nil), (*Encoder).fastpathEncMapUint64Float64R, (*Decoder).fastpathDecMapUint64Float64R) + fn(map[uint64]bool(nil), (*Encoder).fastpathEncMapUint64BoolR, (*Decoder).fastpathDecMapUint64BoolR) + fn(map[uintptr]interface{}(nil), (*Encoder).fastpathEncMapUintptrIntfR, (*Decoder).fastpathDecMapUintptrIntfR) + fn(map[uintptr]string(nil), (*Encoder).fastpathEncMapUintptrStringR, (*Decoder).fastpathDecMapUintptrStringR) + fn(map[uintptr]uint(nil), (*Encoder).fastpathEncMapUintptrUintR, (*Decoder).fastpathDecMapUintptrUintR) + fn(map[uintptr]uint8(nil), (*Encoder).fastpathEncMapUintptrUint8R, (*Decoder).fastpathDecMapUintptrUint8R) + fn(map[uintptr]uint16(nil), (*Encoder).fastpathEncMapUintptrUint16R, (*Decoder).fastpathDecMapUintptrUint16R) + fn(map[uintptr]uint32(nil), (*Encoder).fastpathEncMapUintptrUint32R, (*Decoder).fastpathDecMapUintptrUint32R) + fn(map[uintptr]uint64(nil), (*Encoder).fastpathEncMapUintptrUint64R, (*Decoder).fastpathDecMapUintptrUint64R) + fn(map[uintptr]uintptr(nil), (*Encoder).fastpathEncMapUintptrUintptrR, (*Decoder).fastpathDecMapUintptrUintptrR) + fn(map[uintptr]int(nil), (*Encoder).fastpathEncMapUintptrIntR, (*Decoder).fastpathDecMapUintptrIntR) + fn(map[uintptr]int8(nil), (*Encoder).fastpathEncMapUintptrInt8R, (*Decoder).fastpathDecMapUintptrInt8R) + fn(map[uintptr]int16(nil), (*Encoder).fastpathEncMapUintptrInt16R, (*Decoder).fastpathDecMapUintptrInt16R) + fn(map[uintptr]int32(nil), (*Encoder).fastpathEncMapUintptrInt32R, (*Decoder).fastpathDecMapUintptrInt32R) + fn(map[uintptr]int64(nil), (*Encoder).fastpathEncMapUintptrInt64R, (*Decoder).fastpathDecMapUintptrInt64R) + fn(map[uintptr]float32(nil), (*Encoder).fastpathEncMapUintptrFloat32R, (*Decoder).fastpathDecMapUintptrFloat32R) + fn(map[uintptr]float64(nil), (*Encoder).fastpathEncMapUintptrFloat64R, (*Decoder).fastpathDecMapUintptrFloat64R) + fn(map[uintptr]bool(nil), (*Encoder).fastpathEncMapUintptrBoolR, (*Decoder).fastpathDecMapUintptrBoolR) + fn(map[int]interface{}(nil), (*Encoder).fastpathEncMapIntIntfR, (*Decoder).fastpathDecMapIntIntfR) + fn(map[int]string(nil), (*Encoder).fastpathEncMapIntStringR, (*Decoder).fastpathDecMapIntStringR) + fn(map[int]uint(nil), (*Encoder).fastpathEncMapIntUintR, (*Decoder).fastpathDecMapIntUintR) + fn(map[int]uint8(nil), (*Encoder).fastpathEncMapIntUint8R, (*Decoder).fastpathDecMapIntUint8R) + fn(map[int]uint16(nil), (*Encoder).fastpathEncMapIntUint16R, (*Decoder).fastpathDecMapIntUint16R) + fn(map[int]uint32(nil), (*Encoder).fastpathEncMapIntUint32R, (*Decoder).fastpathDecMapIntUint32R) + fn(map[int]uint64(nil), (*Encoder).fastpathEncMapIntUint64R, (*Decoder).fastpathDecMapIntUint64R) + fn(map[int]uintptr(nil), (*Encoder).fastpathEncMapIntUintptrR, (*Decoder).fastpathDecMapIntUintptrR) + fn(map[int]int(nil), (*Encoder).fastpathEncMapIntIntR, (*Decoder).fastpathDecMapIntIntR) + fn(map[int]int8(nil), (*Encoder).fastpathEncMapIntInt8R, (*Decoder).fastpathDecMapIntInt8R) + fn(map[int]int16(nil), (*Encoder).fastpathEncMapIntInt16R, (*Decoder).fastpathDecMapIntInt16R) + fn(map[int]int32(nil), (*Encoder).fastpathEncMapIntInt32R, (*Decoder).fastpathDecMapIntInt32R) + fn(map[int]int64(nil), (*Encoder).fastpathEncMapIntInt64R, (*Decoder).fastpathDecMapIntInt64R) + fn(map[int]float32(nil), (*Encoder).fastpathEncMapIntFloat32R, (*Decoder).fastpathDecMapIntFloat32R) + fn(map[int]float64(nil), (*Encoder).fastpathEncMapIntFloat64R, (*Decoder).fastpathDecMapIntFloat64R) + fn(map[int]bool(nil), (*Encoder).fastpathEncMapIntBoolR, (*Decoder).fastpathDecMapIntBoolR) + fn(map[int8]interface{}(nil), (*Encoder).fastpathEncMapInt8IntfR, (*Decoder).fastpathDecMapInt8IntfR) + fn(map[int8]string(nil), (*Encoder).fastpathEncMapInt8StringR, (*Decoder).fastpathDecMapInt8StringR) + fn(map[int8]uint(nil), (*Encoder).fastpathEncMapInt8UintR, (*Decoder).fastpathDecMapInt8UintR) + fn(map[int8]uint8(nil), (*Encoder).fastpathEncMapInt8Uint8R, (*Decoder).fastpathDecMapInt8Uint8R) + fn(map[int8]uint16(nil), (*Encoder).fastpathEncMapInt8Uint16R, (*Decoder).fastpathDecMapInt8Uint16R) + fn(map[int8]uint32(nil), (*Encoder).fastpathEncMapInt8Uint32R, (*Decoder).fastpathDecMapInt8Uint32R) + fn(map[int8]uint64(nil), (*Encoder).fastpathEncMapInt8Uint64R, (*Decoder).fastpathDecMapInt8Uint64R) + fn(map[int8]uintptr(nil), (*Encoder).fastpathEncMapInt8UintptrR, (*Decoder).fastpathDecMapInt8UintptrR) + fn(map[int8]int(nil), (*Encoder).fastpathEncMapInt8IntR, (*Decoder).fastpathDecMapInt8IntR) + fn(map[int8]int8(nil), (*Encoder).fastpathEncMapInt8Int8R, (*Decoder).fastpathDecMapInt8Int8R) + fn(map[int8]int16(nil), (*Encoder).fastpathEncMapInt8Int16R, (*Decoder).fastpathDecMapInt8Int16R) + fn(map[int8]int32(nil), (*Encoder).fastpathEncMapInt8Int32R, (*Decoder).fastpathDecMapInt8Int32R) + fn(map[int8]int64(nil), (*Encoder).fastpathEncMapInt8Int64R, (*Decoder).fastpathDecMapInt8Int64R) + fn(map[int8]float32(nil), (*Encoder).fastpathEncMapInt8Float32R, (*Decoder).fastpathDecMapInt8Float32R) + fn(map[int8]float64(nil), (*Encoder).fastpathEncMapInt8Float64R, (*Decoder).fastpathDecMapInt8Float64R) + fn(map[int8]bool(nil), (*Encoder).fastpathEncMapInt8BoolR, (*Decoder).fastpathDecMapInt8BoolR) + fn(map[int16]interface{}(nil), (*Encoder).fastpathEncMapInt16IntfR, (*Decoder).fastpathDecMapInt16IntfR) + fn(map[int16]string(nil), (*Encoder).fastpathEncMapInt16StringR, (*Decoder).fastpathDecMapInt16StringR) + fn(map[int16]uint(nil), (*Encoder).fastpathEncMapInt16UintR, (*Decoder).fastpathDecMapInt16UintR) + fn(map[int16]uint8(nil), (*Encoder).fastpathEncMapInt16Uint8R, (*Decoder).fastpathDecMapInt16Uint8R) + fn(map[int16]uint16(nil), (*Encoder).fastpathEncMapInt16Uint16R, (*Decoder).fastpathDecMapInt16Uint16R) + fn(map[int16]uint32(nil), (*Encoder).fastpathEncMapInt16Uint32R, (*Decoder).fastpathDecMapInt16Uint32R) + fn(map[int16]uint64(nil), (*Encoder).fastpathEncMapInt16Uint64R, (*Decoder).fastpathDecMapInt16Uint64R) + fn(map[int16]uintptr(nil), (*Encoder).fastpathEncMapInt16UintptrR, (*Decoder).fastpathDecMapInt16UintptrR) + fn(map[int16]int(nil), (*Encoder).fastpathEncMapInt16IntR, (*Decoder).fastpathDecMapInt16IntR) + fn(map[int16]int8(nil), (*Encoder).fastpathEncMapInt16Int8R, (*Decoder).fastpathDecMapInt16Int8R) + fn(map[int16]int16(nil), (*Encoder).fastpathEncMapInt16Int16R, (*Decoder).fastpathDecMapInt16Int16R) + fn(map[int16]int32(nil), (*Encoder).fastpathEncMapInt16Int32R, (*Decoder).fastpathDecMapInt16Int32R) + fn(map[int16]int64(nil), (*Encoder).fastpathEncMapInt16Int64R, (*Decoder).fastpathDecMapInt16Int64R) + fn(map[int16]float32(nil), (*Encoder).fastpathEncMapInt16Float32R, (*Decoder).fastpathDecMapInt16Float32R) + fn(map[int16]float64(nil), (*Encoder).fastpathEncMapInt16Float64R, (*Decoder).fastpathDecMapInt16Float64R) + fn(map[int16]bool(nil), (*Encoder).fastpathEncMapInt16BoolR, (*Decoder).fastpathDecMapInt16BoolR) + fn(map[int32]interface{}(nil), (*Encoder).fastpathEncMapInt32IntfR, (*Decoder).fastpathDecMapInt32IntfR) + fn(map[int32]string(nil), (*Encoder).fastpathEncMapInt32StringR, (*Decoder).fastpathDecMapInt32StringR) + fn(map[int32]uint(nil), (*Encoder).fastpathEncMapInt32UintR, (*Decoder).fastpathDecMapInt32UintR) + fn(map[int32]uint8(nil), (*Encoder).fastpathEncMapInt32Uint8R, (*Decoder).fastpathDecMapInt32Uint8R) + fn(map[int32]uint16(nil), (*Encoder).fastpathEncMapInt32Uint16R, (*Decoder).fastpathDecMapInt32Uint16R) + fn(map[int32]uint32(nil), (*Encoder).fastpathEncMapInt32Uint32R, (*Decoder).fastpathDecMapInt32Uint32R) + fn(map[int32]uint64(nil), (*Encoder).fastpathEncMapInt32Uint64R, (*Decoder).fastpathDecMapInt32Uint64R) + fn(map[int32]uintptr(nil), (*Encoder).fastpathEncMapInt32UintptrR, (*Decoder).fastpathDecMapInt32UintptrR) + fn(map[int32]int(nil), (*Encoder).fastpathEncMapInt32IntR, (*Decoder).fastpathDecMapInt32IntR) + fn(map[int32]int8(nil), (*Encoder).fastpathEncMapInt32Int8R, (*Decoder).fastpathDecMapInt32Int8R) + fn(map[int32]int16(nil), (*Encoder).fastpathEncMapInt32Int16R, (*Decoder).fastpathDecMapInt32Int16R) + fn(map[int32]int32(nil), (*Encoder).fastpathEncMapInt32Int32R, (*Decoder).fastpathDecMapInt32Int32R) + fn(map[int32]int64(nil), (*Encoder).fastpathEncMapInt32Int64R, (*Decoder).fastpathDecMapInt32Int64R) + fn(map[int32]float32(nil), (*Encoder).fastpathEncMapInt32Float32R, (*Decoder).fastpathDecMapInt32Float32R) + fn(map[int32]float64(nil), (*Encoder).fastpathEncMapInt32Float64R, (*Decoder).fastpathDecMapInt32Float64R) + fn(map[int32]bool(nil), (*Encoder).fastpathEncMapInt32BoolR, (*Decoder).fastpathDecMapInt32BoolR) + fn(map[int64]interface{}(nil), (*Encoder).fastpathEncMapInt64IntfR, (*Decoder).fastpathDecMapInt64IntfR) + fn(map[int64]string(nil), (*Encoder).fastpathEncMapInt64StringR, (*Decoder).fastpathDecMapInt64StringR) + fn(map[int64]uint(nil), (*Encoder).fastpathEncMapInt64UintR, (*Decoder).fastpathDecMapInt64UintR) + fn(map[int64]uint8(nil), (*Encoder).fastpathEncMapInt64Uint8R, (*Decoder).fastpathDecMapInt64Uint8R) + fn(map[int64]uint16(nil), (*Encoder).fastpathEncMapInt64Uint16R, (*Decoder).fastpathDecMapInt64Uint16R) + fn(map[int64]uint32(nil), (*Encoder).fastpathEncMapInt64Uint32R, (*Decoder).fastpathDecMapInt64Uint32R) + fn(map[int64]uint64(nil), (*Encoder).fastpathEncMapInt64Uint64R, (*Decoder).fastpathDecMapInt64Uint64R) + fn(map[int64]uintptr(nil), (*Encoder).fastpathEncMapInt64UintptrR, (*Decoder).fastpathDecMapInt64UintptrR) + fn(map[int64]int(nil), (*Encoder).fastpathEncMapInt64IntR, (*Decoder).fastpathDecMapInt64IntR) + fn(map[int64]int8(nil), (*Encoder).fastpathEncMapInt64Int8R, (*Decoder).fastpathDecMapInt64Int8R) + fn(map[int64]int16(nil), (*Encoder).fastpathEncMapInt64Int16R, (*Decoder).fastpathDecMapInt64Int16R) + fn(map[int64]int32(nil), (*Encoder).fastpathEncMapInt64Int32R, (*Decoder).fastpathDecMapInt64Int32R) + fn(map[int64]int64(nil), (*Encoder).fastpathEncMapInt64Int64R, (*Decoder).fastpathDecMapInt64Int64R) + fn(map[int64]float32(nil), (*Encoder).fastpathEncMapInt64Float32R, (*Decoder).fastpathDecMapInt64Float32R) + fn(map[int64]float64(nil), (*Encoder).fastpathEncMapInt64Float64R, (*Decoder).fastpathDecMapInt64Float64R) + fn(map[int64]bool(nil), (*Encoder).fastpathEncMapInt64BoolR, (*Decoder).fastpathDecMapInt64BoolR) + fn(map[bool]interface{}(nil), (*Encoder).fastpathEncMapBoolIntfR, (*Decoder).fastpathDecMapBoolIntfR) + fn(map[bool]string(nil), (*Encoder).fastpathEncMapBoolStringR, (*Decoder).fastpathDecMapBoolStringR) + fn(map[bool]uint(nil), (*Encoder).fastpathEncMapBoolUintR, (*Decoder).fastpathDecMapBoolUintR) + fn(map[bool]uint8(nil), (*Encoder).fastpathEncMapBoolUint8R, (*Decoder).fastpathDecMapBoolUint8R) + fn(map[bool]uint16(nil), (*Encoder).fastpathEncMapBoolUint16R, (*Decoder).fastpathDecMapBoolUint16R) + fn(map[bool]uint32(nil), (*Encoder).fastpathEncMapBoolUint32R, (*Decoder).fastpathDecMapBoolUint32R) + fn(map[bool]uint64(nil), (*Encoder).fastpathEncMapBoolUint64R, (*Decoder).fastpathDecMapBoolUint64R) + fn(map[bool]uintptr(nil), (*Encoder).fastpathEncMapBoolUintptrR, (*Decoder).fastpathDecMapBoolUintptrR) + fn(map[bool]int(nil), (*Encoder).fastpathEncMapBoolIntR, (*Decoder).fastpathDecMapBoolIntR) + fn(map[bool]int8(nil), (*Encoder).fastpathEncMapBoolInt8R, (*Decoder).fastpathDecMapBoolInt8R) + fn(map[bool]int16(nil), (*Encoder).fastpathEncMapBoolInt16R, (*Decoder).fastpathDecMapBoolInt16R) + fn(map[bool]int32(nil), (*Encoder).fastpathEncMapBoolInt32R, (*Decoder).fastpathDecMapBoolInt32R) + fn(map[bool]int64(nil), (*Encoder).fastpathEncMapBoolInt64R, (*Decoder).fastpathDecMapBoolInt64R) + fn(map[bool]float32(nil), (*Encoder).fastpathEncMapBoolFloat32R, (*Decoder).fastpathDecMapBoolFloat32R) + fn(map[bool]float64(nil), (*Encoder).fastpathEncMapBoolFloat64R, (*Decoder).fastpathDecMapBoolFloat64R) + fn(map[bool]bool(nil), (*Encoder).fastpathEncMapBoolBoolR, (*Decoder).fastpathDecMapBoolBoolR) + + sort.Sort(fastpathAslice(fastpathAV[:])) +} + +// -- encode + +// -- -- fast path type switch +func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { + switch v := iv.(type) { + + case []interface{}: + fastpathTV.EncSliceIntfV(v, e) + case *[]interface{}: + fastpathTV.EncSliceIntfV(*v, e) + case []string: + fastpathTV.EncSliceStringV(v, e) + case *[]string: + fastpathTV.EncSliceStringV(*v, e) + case []float32: + fastpathTV.EncSliceFloat32V(v, e) + case *[]float32: + fastpathTV.EncSliceFloat32V(*v, e) + case []float64: + fastpathTV.EncSliceFloat64V(v, e) + case *[]float64: + fastpathTV.EncSliceFloat64V(*v, e) + case []uint: + fastpathTV.EncSliceUintV(v, e) + case *[]uint: + fastpathTV.EncSliceUintV(*v, e) + case []uint16: + fastpathTV.EncSliceUint16V(v, e) + case *[]uint16: + fastpathTV.EncSliceUint16V(*v, e) + case []uint32: + fastpathTV.EncSliceUint32V(v, e) + case *[]uint32: + fastpathTV.EncSliceUint32V(*v, e) + case []uint64: + fastpathTV.EncSliceUint64V(v, e) + case *[]uint64: + fastpathTV.EncSliceUint64V(*v, e) + case []uintptr: + fastpathTV.EncSliceUintptrV(v, e) + case *[]uintptr: + fastpathTV.EncSliceUintptrV(*v, e) + case []int: + fastpathTV.EncSliceIntV(v, e) + case *[]int: + fastpathTV.EncSliceIntV(*v, e) + case []int8: + fastpathTV.EncSliceInt8V(v, e) + case *[]int8: + fastpathTV.EncSliceInt8V(*v, e) + case []int16: + fastpathTV.EncSliceInt16V(v, e) + case *[]int16: + fastpathTV.EncSliceInt16V(*v, e) + case []int32: + fastpathTV.EncSliceInt32V(v, e) + case *[]int32: + fastpathTV.EncSliceInt32V(*v, e) + case []int64: + fastpathTV.EncSliceInt64V(v, e) + case *[]int64: + fastpathTV.EncSliceInt64V(*v, e) + case []bool: + fastpathTV.EncSliceBoolV(v, e) + case *[]bool: + fastpathTV.EncSliceBoolV(*v, e) + + case map[interface{}]interface{}: + fastpathTV.EncMapIntfIntfV(v, e) + case *map[interface{}]interface{}: + fastpathTV.EncMapIntfIntfV(*v, e) + case map[interface{}]string: + fastpathTV.EncMapIntfStringV(v, e) + case *map[interface{}]string: + fastpathTV.EncMapIntfStringV(*v, e) + case map[interface{}]uint: + fastpathTV.EncMapIntfUintV(v, e) + case *map[interface{}]uint: + fastpathTV.EncMapIntfUintV(*v, e) + case map[interface{}]uint8: + fastpathTV.EncMapIntfUint8V(v, e) + case *map[interface{}]uint8: + fastpathTV.EncMapIntfUint8V(*v, e) + case map[interface{}]uint16: + fastpathTV.EncMapIntfUint16V(v, e) + case *map[interface{}]uint16: + fastpathTV.EncMapIntfUint16V(*v, e) + case map[interface{}]uint32: + fastpathTV.EncMapIntfUint32V(v, e) + case *map[interface{}]uint32: + fastpathTV.EncMapIntfUint32V(*v, e) + case map[interface{}]uint64: + fastpathTV.EncMapIntfUint64V(v, e) + case *map[interface{}]uint64: + fastpathTV.EncMapIntfUint64V(*v, e) + case map[interface{}]uintptr: + fastpathTV.EncMapIntfUintptrV(v, e) + case *map[interface{}]uintptr: + fastpathTV.EncMapIntfUintptrV(*v, e) + case map[interface{}]int: + fastpathTV.EncMapIntfIntV(v, e) + case *map[interface{}]int: + fastpathTV.EncMapIntfIntV(*v, e) + case map[interface{}]int8: + fastpathTV.EncMapIntfInt8V(v, e) + case *map[interface{}]int8: + fastpathTV.EncMapIntfInt8V(*v, e) + case map[interface{}]int16: + fastpathTV.EncMapIntfInt16V(v, e) + case *map[interface{}]int16: + fastpathTV.EncMapIntfInt16V(*v, e) + case map[interface{}]int32: + fastpathTV.EncMapIntfInt32V(v, e) + case *map[interface{}]int32: + fastpathTV.EncMapIntfInt32V(*v, e) + case map[interface{}]int64: + fastpathTV.EncMapIntfInt64V(v, e) + case *map[interface{}]int64: + fastpathTV.EncMapIntfInt64V(*v, e) + case map[interface{}]float32: + fastpathTV.EncMapIntfFloat32V(v, e) + case *map[interface{}]float32: + fastpathTV.EncMapIntfFloat32V(*v, e) + case map[interface{}]float64: + fastpathTV.EncMapIntfFloat64V(v, e) + case *map[interface{}]float64: + fastpathTV.EncMapIntfFloat64V(*v, e) + case map[interface{}]bool: + fastpathTV.EncMapIntfBoolV(v, e) + case *map[interface{}]bool: + fastpathTV.EncMapIntfBoolV(*v, e) + case map[string]interface{}: + fastpathTV.EncMapStringIntfV(v, e) + case *map[string]interface{}: + fastpathTV.EncMapStringIntfV(*v, e) + case map[string]string: + fastpathTV.EncMapStringStringV(v, e) + case *map[string]string: + fastpathTV.EncMapStringStringV(*v, e) + case map[string]uint: + fastpathTV.EncMapStringUintV(v, e) + case *map[string]uint: + fastpathTV.EncMapStringUintV(*v, e) + case map[string]uint8: + fastpathTV.EncMapStringUint8V(v, e) + case *map[string]uint8: + fastpathTV.EncMapStringUint8V(*v, e) + case map[string]uint16: + fastpathTV.EncMapStringUint16V(v, e) + case *map[string]uint16: + fastpathTV.EncMapStringUint16V(*v, e) + case map[string]uint32: + fastpathTV.EncMapStringUint32V(v, e) + case *map[string]uint32: + fastpathTV.EncMapStringUint32V(*v, e) + case map[string]uint64: + fastpathTV.EncMapStringUint64V(v, e) + case *map[string]uint64: + fastpathTV.EncMapStringUint64V(*v, e) + case map[string]uintptr: + fastpathTV.EncMapStringUintptrV(v, e) + case *map[string]uintptr: + fastpathTV.EncMapStringUintptrV(*v, e) + case map[string]int: + fastpathTV.EncMapStringIntV(v, e) + case *map[string]int: + fastpathTV.EncMapStringIntV(*v, e) + case map[string]int8: + fastpathTV.EncMapStringInt8V(v, e) + case *map[string]int8: + fastpathTV.EncMapStringInt8V(*v, e) + case map[string]int16: + fastpathTV.EncMapStringInt16V(v, e) + case *map[string]int16: + fastpathTV.EncMapStringInt16V(*v, e) + case map[string]int32: + fastpathTV.EncMapStringInt32V(v, e) + case *map[string]int32: + fastpathTV.EncMapStringInt32V(*v, e) + case map[string]int64: + fastpathTV.EncMapStringInt64V(v, e) + case *map[string]int64: + fastpathTV.EncMapStringInt64V(*v, e) + case map[string]float32: + fastpathTV.EncMapStringFloat32V(v, e) + case *map[string]float32: + fastpathTV.EncMapStringFloat32V(*v, e) + case map[string]float64: + fastpathTV.EncMapStringFloat64V(v, e) + case *map[string]float64: + fastpathTV.EncMapStringFloat64V(*v, e) + case map[string]bool: + fastpathTV.EncMapStringBoolV(v, e) + case *map[string]bool: + fastpathTV.EncMapStringBoolV(*v, e) + case map[float32]interface{}: + fastpathTV.EncMapFloat32IntfV(v, e) + case *map[float32]interface{}: + fastpathTV.EncMapFloat32IntfV(*v, e) + case map[float32]string: + fastpathTV.EncMapFloat32StringV(v, e) + case *map[float32]string: + fastpathTV.EncMapFloat32StringV(*v, e) + case map[float32]uint: + fastpathTV.EncMapFloat32UintV(v, e) + case *map[float32]uint: + fastpathTV.EncMapFloat32UintV(*v, e) + case map[float32]uint8: + fastpathTV.EncMapFloat32Uint8V(v, e) + case *map[float32]uint8: + fastpathTV.EncMapFloat32Uint8V(*v, e) + case map[float32]uint16: + fastpathTV.EncMapFloat32Uint16V(v, e) + case *map[float32]uint16: + fastpathTV.EncMapFloat32Uint16V(*v, e) + case map[float32]uint32: + fastpathTV.EncMapFloat32Uint32V(v, e) + case *map[float32]uint32: + fastpathTV.EncMapFloat32Uint32V(*v, e) + case map[float32]uint64: + fastpathTV.EncMapFloat32Uint64V(v, e) + case *map[float32]uint64: + fastpathTV.EncMapFloat32Uint64V(*v, e) + case map[float32]uintptr: + fastpathTV.EncMapFloat32UintptrV(v, e) + case *map[float32]uintptr: + fastpathTV.EncMapFloat32UintptrV(*v, e) + case map[float32]int: + fastpathTV.EncMapFloat32IntV(v, e) + case *map[float32]int: + fastpathTV.EncMapFloat32IntV(*v, e) + case map[float32]int8: + fastpathTV.EncMapFloat32Int8V(v, e) + case *map[float32]int8: + fastpathTV.EncMapFloat32Int8V(*v, e) + case map[float32]int16: + fastpathTV.EncMapFloat32Int16V(v, e) + case *map[float32]int16: + fastpathTV.EncMapFloat32Int16V(*v, e) + case map[float32]int32: + fastpathTV.EncMapFloat32Int32V(v, e) + case *map[float32]int32: + fastpathTV.EncMapFloat32Int32V(*v, e) + case map[float32]int64: + fastpathTV.EncMapFloat32Int64V(v, e) + case *map[float32]int64: + fastpathTV.EncMapFloat32Int64V(*v, e) + case map[float32]float32: + fastpathTV.EncMapFloat32Float32V(v, e) + case *map[float32]float32: + fastpathTV.EncMapFloat32Float32V(*v, e) + case map[float32]float64: + fastpathTV.EncMapFloat32Float64V(v, e) + case *map[float32]float64: + fastpathTV.EncMapFloat32Float64V(*v, e) + case map[float32]bool: + fastpathTV.EncMapFloat32BoolV(v, e) + case *map[float32]bool: + fastpathTV.EncMapFloat32BoolV(*v, e) + case map[float64]interface{}: + fastpathTV.EncMapFloat64IntfV(v, e) + case *map[float64]interface{}: + fastpathTV.EncMapFloat64IntfV(*v, e) + case map[float64]string: + fastpathTV.EncMapFloat64StringV(v, e) + case *map[float64]string: + fastpathTV.EncMapFloat64StringV(*v, e) + case map[float64]uint: + fastpathTV.EncMapFloat64UintV(v, e) + case *map[float64]uint: + fastpathTV.EncMapFloat64UintV(*v, e) + case map[float64]uint8: + fastpathTV.EncMapFloat64Uint8V(v, e) + case *map[float64]uint8: + fastpathTV.EncMapFloat64Uint8V(*v, e) + case map[float64]uint16: + fastpathTV.EncMapFloat64Uint16V(v, e) + case *map[float64]uint16: + fastpathTV.EncMapFloat64Uint16V(*v, e) + case map[float64]uint32: + fastpathTV.EncMapFloat64Uint32V(v, e) + case *map[float64]uint32: + fastpathTV.EncMapFloat64Uint32V(*v, e) + case map[float64]uint64: + fastpathTV.EncMapFloat64Uint64V(v, e) + case *map[float64]uint64: + fastpathTV.EncMapFloat64Uint64V(*v, e) + case map[float64]uintptr: + fastpathTV.EncMapFloat64UintptrV(v, e) + case *map[float64]uintptr: + fastpathTV.EncMapFloat64UintptrV(*v, e) + case map[float64]int: + fastpathTV.EncMapFloat64IntV(v, e) + case *map[float64]int: + fastpathTV.EncMapFloat64IntV(*v, e) + case map[float64]int8: + fastpathTV.EncMapFloat64Int8V(v, e) + case *map[float64]int8: + fastpathTV.EncMapFloat64Int8V(*v, e) + case map[float64]int16: + fastpathTV.EncMapFloat64Int16V(v, e) + case *map[float64]int16: + fastpathTV.EncMapFloat64Int16V(*v, e) + case map[float64]int32: + fastpathTV.EncMapFloat64Int32V(v, e) + case *map[float64]int32: + fastpathTV.EncMapFloat64Int32V(*v, e) + case map[float64]int64: + fastpathTV.EncMapFloat64Int64V(v, e) + case *map[float64]int64: + fastpathTV.EncMapFloat64Int64V(*v, e) + case map[float64]float32: + fastpathTV.EncMapFloat64Float32V(v, e) + case *map[float64]float32: + fastpathTV.EncMapFloat64Float32V(*v, e) + case map[float64]float64: + fastpathTV.EncMapFloat64Float64V(v, e) + case *map[float64]float64: + fastpathTV.EncMapFloat64Float64V(*v, e) + case map[float64]bool: + fastpathTV.EncMapFloat64BoolV(v, e) + case *map[float64]bool: + fastpathTV.EncMapFloat64BoolV(*v, e) + case map[uint]interface{}: + fastpathTV.EncMapUintIntfV(v, e) + case *map[uint]interface{}: + fastpathTV.EncMapUintIntfV(*v, e) + case map[uint]string: + fastpathTV.EncMapUintStringV(v, e) + case *map[uint]string: + fastpathTV.EncMapUintStringV(*v, e) + case map[uint]uint: + fastpathTV.EncMapUintUintV(v, e) + case *map[uint]uint: + fastpathTV.EncMapUintUintV(*v, e) + case map[uint]uint8: + fastpathTV.EncMapUintUint8V(v, e) + case *map[uint]uint8: + fastpathTV.EncMapUintUint8V(*v, e) + case map[uint]uint16: + fastpathTV.EncMapUintUint16V(v, e) + case *map[uint]uint16: + fastpathTV.EncMapUintUint16V(*v, e) + case map[uint]uint32: + fastpathTV.EncMapUintUint32V(v, e) + case *map[uint]uint32: + fastpathTV.EncMapUintUint32V(*v, e) + case map[uint]uint64: + fastpathTV.EncMapUintUint64V(v, e) + case *map[uint]uint64: + fastpathTV.EncMapUintUint64V(*v, e) + case map[uint]uintptr: + fastpathTV.EncMapUintUintptrV(v, e) + case *map[uint]uintptr: + fastpathTV.EncMapUintUintptrV(*v, e) + case map[uint]int: + fastpathTV.EncMapUintIntV(v, e) + case *map[uint]int: + fastpathTV.EncMapUintIntV(*v, e) + case map[uint]int8: + fastpathTV.EncMapUintInt8V(v, e) + case *map[uint]int8: + fastpathTV.EncMapUintInt8V(*v, e) + case map[uint]int16: + fastpathTV.EncMapUintInt16V(v, e) + case *map[uint]int16: + fastpathTV.EncMapUintInt16V(*v, e) + case map[uint]int32: + fastpathTV.EncMapUintInt32V(v, e) + case *map[uint]int32: + fastpathTV.EncMapUintInt32V(*v, e) + case map[uint]int64: + fastpathTV.EncMapUintInt64V(v, e) + case *map[uint]int64: + fastpathTV.EncMapUintInt64V(*v, e) + case map[uint]float32: + fastpathTV.EncMapUintFloat32V(v, e) + case *map[uint]float32: + fastpathTV.EncMapUintFloat32V(*v, e) + case map[uint]float64: + fastpathTV.EncMapUintFloat64V(v, e) + case *map[uint]float64: + fastpathTV.EncMapUintFloat64V(*v, e) + case map[uint]bool: + fastpathTV.EncMapUintBoolV(v, e) + case *map[uint]bool: + fastpathTV.EncMapUintBoolV(*v, e) + case map[uint8]interface{}: + fastpathTV.EncMapUint8IntfV(v, e) + case *map[uint8]interface{}: + fastpathTV.EncMapUint8IntfV(*v, e) + case map[uint8]string: + fastpathTV.EncMapUint8StringV(v, e) + case *map[uint8]string: + fastpathTV.EncMapUint8StringV(*v, e) + case map[uint8]uint: + fastpathTV.EncMapUint8UintV(v, e) + case *map[uint8]uint: + fastpathTV.EncMapUint8UintV(*v, e) + case map[uint8]uint8: + fastpathTV.EncMapUint8Uint8V(v, e) + case *map[uint8]uint8: + fastpathTV.EncMapUint8Uint8V(*v, e) + case map[uint8]uint16: + fastpathTV.EncMapUint8Uint16V(v, e) + case *map[uint8]uint16: + fastpathTV.EncMapUint8Uint16V(*v, e) + case map[uint8]uint32: + fastpathTV.EncMapUint8Uint32V(v, e) + case *map[uint8]uint32: + fastpathTV.EncMapUint8Uint32V(*v, e) + case map[uint8]uint64: + fastpathTV.EncMapUint8Uint64V(v, e) + case *map[uint8]uint64: + fastpathTV.EncMapUint8Uint64V(*v, e) + case map[uint8]uintptr: + fastpathTV.EncMapUint8UintptrV(v, e) + case *map[uint8]uintptr: + fastpathTV.EncMapUint8UintptrV(*v, e) + case map[uint8]int: + fastpathTV.EncMapUint8IntV(v, e) + case *map[uint8]int: + fastpathTV.EncMapUint8IntV(*v, e) + case map[uint8]int8: + fastpathTV.EncMapUint8Int8V(v, e) + case *map[uint8]int8: + fastpathTV.EncMapUint8Int8V(*v, e) + case map[uint8]int16: + fastpathTV.EncMapUint8Int16V(v, e) + case *map[uint8]int16: + fastpathTV.EncMapUint8Int16V(*v, e) + case map[uint8]int32: + fastpathTV.EncMapUint8Int32V(v, e) + case *map[uint8]int32: + fastpathTV.EncMapUint8Int32V(*v, e) + case map[uint8]int64: + fastpathTV.EncMapUint8Int64V(v, e) + case *map[uint8]int64: + fastpathTV.EncMapUint8Int64V(*v, e) + case map[uint8]float32: + fastpathTV.EncMapUint8Float32V(v, e) + case *map[uint8]float32: + fastpathTV.EncMapUint8Float32V(*v, e) + case map[uint8]float64: + fastpathTV.EncMapUint8Float64V(v, e) + case *map[uint8]float64: + fastpathTV.EncMapUint8Float64V(*v, e) + case map[uint8]bool: + fastpathTV.EncMapUint8BoolV(v, e) + case *map[uint8]bool: + fastpathTV.EncMapUint8BoolV(*v, e) + case map[uint16]interface{}: + fastpathTV.EncMapUint16IntfV(v, e) + case *map[uint16]interface{}: + fastpathTV.EncMapUint16IntfV(*v, e) + case map[uint16]string: + fastpathTV.EncMapUint16StringV(v, e) + case *map[uint16]string: + fastpathTV.EncMapUint16StringV(*v, e) + case map[uint16]uint: + fastpathTV.EncMapUint16UintV(v, e) + case *map[uint16]uint: + fastpathTV.EncMapUint16UintV(*v, e) + case map[uint16]uint8: + fastpathTV.EncMapUint16Uint8V(v, e) + case *map[uint16]uint8: + fastpathTV.EncMapUint16Uint8V(*v, e) + case map[uint16]uint16: + fastpathTV.EncMapUint16Uint16V(v, e) + case *map[uint16]uint16: + fastpathTV.EncMapUint16Uint16V(*v, e) + case map[uint16]uint32: + fastpathTV.EncMapUint16Uint32V(v, e) + case *map[uint16]uint32: + fastpathTV.EncMapUint16Uint32V(*v, e) + case map[uint16]uint64: + fastpathTV.EncMapUint16Uint64V(v, e) + case *map[uint16]uint64: + fastpathTV.EncMapUint16Uint64V(*v, e) + case map[uint16]uintptr: + fastpathTV.EncMapUint16UintptrV(v, e) + case *map[uint16]uintptr: + fastpathTV.EncMapUint16UintptrV(*v, e) + case map[uint16]int: + fastpathTV.EncMapUint16IntV(v, e) + case *map[uint16]int: + fastpathTV.EncMapUint16IntV(*v, e) + case map[uint16]int8: + fastpathTV.EncMapUint16Int8V(v, e) + case *map[uint16]int8: + fastpathTV.EncMapUint16Int8V(*v, e) + case map[uint16]int16: + fastpathTV.EncMapUint16Int16V(v, e) + case *map[uint16]int16: + fastpathTV.EncMapUint16Int16V(*v, e) + case map[uint16]int32: + fastpathTV.EncMapUint16Int32V(v, e) + case *map[uint16]int32: + fastpathTV.EncMapUint16Int32V(*v, e) + case map[uint16]int64: + fastpathTV.EncMapUint16Int64V(v, e) + case *map[uint16]int64: + fastpathTV.EncMapUint16Int64V(*v, e) + case map[uint16]float32: + fastpathTV.EncMapUint16Float32V(v, e) + case *map[uint16]float32: + fastpathTV.EncMapUint16Float32V(*v, e) + case map[uint16]float64: + fastpathTV.EncMapUint16Float64V(v, e) + case *map[uint16]float64: + fastpathTV.EncMapUint16Float64V(*v, e) + case map[uint16]bool: + fastpathTV.EncMapUint16BoolV(v, e) + case *map[uint16]bool: + fastpathTV.EncMapUint16BoolV(*v, e) + case map[uint32]interface{}: + fastpathTV.EncMapUint32IntfV(v, e) + case *map[uint32]interface{}: + fastpathTV.EncMapUint32IntfV(*v, e) + case map[uint32]string: + fastpathTV.EncMapUint32StringV(v, e) + case *map[uint32]string: + fastpathTV.EncMapUint32StringV(*v, e) + case map[uint32]uint: + fastpathTV.EncMapUint32UintV(v, e) + case *map[uint32]uint: + fastpathTV.EncMapUint32UintV(*v, e) + case map[uint32]uint8: + fastpathTV.EncMapUint32Uint8V(v, e) + case *map[uint32]uint8: + fastpathTV.EncMapUint32Uint8V(*v, e) + case map[uint32]uint16: + fastpathTV.EncMapUint32Uint16V(v, e) + case *map[uint32]uint16: + fastpathTV.EncMapUint32Uint16V(*v, e) + case map[uint32]uint32: + fastpathTV.EncMapUint32Uint32V(v, e) + case *map[uint32]uint32: + fastpathTV.EncMapUint32Uint32V(*v, e) + case map[uint32]uint64: + fastpathTV.EncMapUint32Uint64V(v, e) + case *map[uint32]uint64: + fastpathTV.EncMapUint32Uint64V(*v, e) + case map[uint32]uintptr: + fastpathTV.EncMapUint32UintptrV(v, e) + case *map[uint32]uintptr: + fastpathTV.EncMapUint32UintptrV(*v, e) + case map[uint32]int: + fastpathTV.EncMapUint32IntV(v, e) + case *map[uint32]int: + fastpathTV.EncMapUint32IntV(*v, e) + case map[uint32]int8: + fastpathTV.EncMapUint32Int8V(v, e) + case *map[uint32]int8: + fastpathTV.EncMapUint32Int8V(*v, e) + case map[uint32]int16: + fastpathTV.EncMapUint32Int16V(v, e) + case *map[uint32]int16: + fastpathTV.EncMapUint32Int16V(*v, e) + case map[uint32]int32: + fastpathTV.EncMapUint32Int32V(v, e) + case *map[uint32]int32: + fastpathTV.EncMapUint32Int32V(*v, e) + case map[uint32]int64: + fastpathTV.EncMapUint32Int64V(v, e) + case *map[uint32]int64: + fastpathTV.EncMapUint32Int64V(*v, e) + case map[uint32]float32: + fastpathTV.EncMapUint32Float32V(v, e) + case *map[uint32]float32: + fastpathTV.EncMapUint32Float32V(*v, e) + case map[uint32]float64: + fastpathTV.EncMapUint32Float64V(v, e) + case *map[uint32]float64: + fastpathTV.EncMapUint32Float64V(*v, e) + case map[uint32]bool: + fastpathTV.EncMapUint32BoolV(v, e) + case *map[uint32]bool: + fastpathTV.EncMapUint32BoolV(*v, e) + case map[uint64]interface{}: + fastpathTV.EncMapUint64IntfV(v, e) + case *map[uint64]interface{}: + fastpathTV.EncMapUint64IntfV(*v, e) + case map[uint64]string: + fastpathTV.EncMapUint64StringV(v, e) + case *map[uint64]string: + fastpathTV.EncMapUint64StringV(*v, e) + case map[uint64]uint: + fastpathTV.EncMapUint64UintV(v, e) + case *map[uint64]uint: + fastpathTV.EncMapUint64UintV(*v, e) + case map[uint64]uint8: + fastpathTV.EncMapUint64Uint8V(v, e) + case *map[uint64]uint8: + fastpathTV.EncMapUint64Uint8V(*v, e) + case map[uint64]uint16: + fastpathTV.EncMapUint64Uint16V(v, e) + case *map[uint64]uint16: + fastpathTV.EncMapUint64Uint16V(*v, e) + case map[uint64]uint32: + fastpathTV.EncMapUint64Uint32V(v, e) + case *map[uint64]uint32: + fastpathTV.EncMapUint64Uint32V(*v, e) + case map[uint64]uint64: + fastpathTV.EncMapUint64Uint64V(v, e) + case *map[uint64]uint64: + fastpathTV.EncMapUint64Uint64V(*v, e) + case map[uint64]uintptr: + fastpathTV.EncMapUint64UintptrV(v, e) + case *map[uint64]uintptr: + fastpathTV.EncMapUint64UintptrV(*v, e) + case map[uint64]int: + fastpathTV.EncMapUint64IntV(v, e) + case *map[uint64]int: + fastpathTV.EncMapUint64IntV(*v, e) + case map[uint64]int8: + fastpathTV.EncMapUint64Int8V(v, e) + case *map[uint64]int8: + fastpathTV.EncMapUint64Int8V(*v, e) + case map[uint64]int16: + fastpathTV.EncMapUint64Int16V(v, e) + case *map[uint64]int16: + fastpathTV.EncMapUint64Int16V(*v, e) + case map[uint64]int32: + fastpathTV.EncMapUint64Int32V(v, e) + case *map[uint64]int32: + fastpathTV.EncMapUint64Int32V(*v, e) + case map[uint64]int64: + fastpathTV.EncMapUint64Int64V(v, e) + case *map[uint64]int64: + fastpathTV.EncMapUint64Int64V(*v, e) + case map[uint64]float32: + fastpathTV.EncMapUint64Float32V(v, e) + case *map[uint64]float32: + fastpathTV.EncMapUint64Float32V(*v, e) + case map[uint64]float64: + fastpathTV.EncMapUint64Float64V(v, e) + case *map[uint64]float64: + fastpathTV.EncMapUint64Float64V(*v, e) + case map[uint64]bool: + fastpathTV.EncMapUint64BoolV(v, e) + case *map[uint64]bool: + fastpathTV.EncMapUint64BoolV(*v, e) + case map[uintptr]interface{}: + fastpathTV.EncMapUintptrIntfV(v, e) + case *map[uintptr]interface{}: + fastpathTV.EncMapUintptrIntfV(*v, e) + case map[uintptr]string: + fastpathTV.EncMapUintptrStringV(v, e) + case *map[uintptr]string: + fastpathTV.EncMapUintptrStringV(*v, e) + case map[uintptr]uint: + fastpathTV.EncMapUintptrUintV(v, e) + case *map[uintptr]uint: + fastpathTV.EncMapUintptrUintV(*v, e) + case map[uintptr]uint8: + fastpathTV.EncMapUintptrUint8V(v, e) + case *map[uintptr]uint8: + fastpathTV.EncMapUintptrUint8V(*v, e) + case map[uintptr]uint16: + fastpathTV.EncMapUintptrUint16V(v, e) + case *map[uintptr]uint16: + fastpathTV.EncMapUintptrUint16V(*v, e) + case map[uintptr]uint32: + fastpathTV.EncMapUintptrUint32V(v, e) + case *map[uintptr]uint32: + fastpathTV.EncMapUintptrUint32V(*v, e) + case map[uintptr]uint64: + fastpathTV.EncMapUintptrUint64V(v, e) + case *map[uintptr]uint64: + fastpathTV.EncMapUintptrUint64V(*v, e) + case map[uintptr]uintptr: + fastpathTV.EncMapUintptrUintptrV(v, e) + case *map[uintptr]uintptr: + fastpathTV.EncMapUintptrUintptrV(*v, e) + case map[uintptr]int: + fastpathTV.EncMapUintptrIntV(v, e) + case *map[uintptr]int: + fastpathTV.EncMapUintptrIntV(*v, e) + case map[uintptr]int8: + fastpathTV.EncMapUintptrInt8V(v, e) + case *map[uintptr]int8: + fastpathTV.EncMapUintptrInt8V(*v, e) + case map[uintptr]int16: + fastpathTV.EncMapUintptrInt16V(v, e) + case *map[uintptr]int16: + fastpathTV.EncMapUintptrInt16V(*v, e) + case map[uintptr]int32: + fastpathTV.EncMapUintptrInt32V(v, e) + case *map[uintptr]int32: + fastpathTV.EncMapUintptrInt32V(*v, e) + case map[uintptr]int64: + fastpathTV.EncMapUintptrInt64V(v, e) + case *map[uintptr]int64: + fastpathTV.EncMapUintptrInt64V(*v, e) + case map[uintptr]float32: + fastpathTV.EncMapUintptrFloat32V(v, e) + case *map[uintptr]float32: + fastpathTV.EncMapUintptrFloat32V(*v, e) + case map[uintptr]float64: + fastpathTV.EncMapUintptrFloat64V(v, e) + case *map[uintptr]float64: + fastpathTV.EncMapUintptrFloat64V(*v, e) + case map[uintptr]bool: + fastpathTV.EncMapUintptrBoolV(v, e) + case *map[uintptr]bool: + fastpathTV.EncMapUintptrBoolV(*v, e) + case map[int]interface{}: + fastpathTV.EncMapIntIntfV(v, e) + case *map[int]interface{}: + fastpathTV.EncMapIntIntfV(*v, e) + case map[int]string: + fastpathTV.EncMapIntStringV(v, e) + case *map[int]string: + fastpathTV.EncMapIntStringV(*v, e) + case map[int]uint: + fastpathTV.EncMapIntUintV(v, e) + case *map[int]uint: + fastpathTV.EncMapIntUintV(*v, e) + case map[int]uint8: + fastpathTV.EncMapIntUint8V(v, e) + case *map[int]uint8: + fastpathTV.EncMapIntUint8V(*v, e) + case map[int]uint16: + fastpathTV.EncMapIntUint16V(v, e) + case *map[int]uint16: + fastpathTV.EncMapIntUint16V(*v, e) + case map[int]uint32: + fastpathTV.EncMapIntUint32V(v, e) + case *map[int]uint32: + fastpathTV.EncMapIntUint32V(*v, e) + case map[int]uint64: + fastpathTV.EncMapIntUint64V(v, e) + case *map[int]uint64: + fastpathTV.EncMapIntUint64V(*v, e) + case map[int]uintptr: + fastpathTV.EncMapIntUintptrV(v, e) + case *map[int]uintptr: + fastpathTV.EncMapIntUintptrV(*v, e) + case map[int]int: + fastpathTV.EncMapIntIntV(v, e) + case *map[int]int: + fastpathTV.EncMapIntIntV(*v, e) + case map[int]int8: + fastpathTV.EncMapIntInt8V(v, e) + case *map[int]int8: + fastpathTV.EncMapIntInt8V(*v, e) + case map[int]int16: + fastpathTV.EncMapIntInt16V(v, e) + case *map[int]int16: + fastpathTV.EncMapIntInt16V(*v, e) + case map[int]int32: + fastpathTV.EncMapIntInt32V(v, e) + case *map[int]int32: + fastpathTV.EncMapIntInt32V(*v, e) + case map[int]int64: + fastpathTV.EncMapIntInt64V(v, e) + case *map[int]int64: + fastpathTV.EncMapIntInt64V(*v, e) + case map[int]float32: + fastpathTV.EncMapIntFloat32V(v, e) + case *map[int]float32: + fastpathTV.EncMapIntFloat32V(*v, e) + case map[int]float64: + fastpathTV.EncMapIntFloat64V(v, e) + case *map[int]float64: + fastpathTV.EncMapIntFloat64V(*v, e) + case map[int]bool: + fastpathTV.EncMapIntBoolV(v, e) + case *map[int]bool: + fastpathTV.EncMapIntBoolV(*v, e) + case map[int8]interface{}: + fastpathTV.EncMapInt8IntfV(v, e) + case *map[int8]interface{}: + fastpathTV.EncMapInt8IntfV(*v, e) + case map[int8]string: + fastpathTV.EncMapInt8StringV(v, e) + case *map[int8]string: + fastpathTV.EncMapInt8StringV(*v, e) + case map[int8]uint: + fastpathTV.EncMapInt8UintV(v, e) + case *map[int8]uint: + fastpathTV.EncMapInt8UintV(*v, e) + case map[int8]uint8: + fastpathTV.EncMapInt8Uint8V(v, e) + case *map[int8]uint8: + fastpathTV.EncMapInt8Uint8V(*v, e) + case map[int8]uint16: + fastpathTV.EncMapInt8Uint16V(v, e) + case *map[int8]uint16: + fastpathTV.EncMapInt8Uint16V(*v, e) + case map[int8]uint32: + fastpathTV.EncMapInt8Uint32V(v, e) + case *map[int8]uint32: + fastpathTV.EncMapInt8Uint32V(*v, e) + case map[int8]uint64: + fastpathTV.EncMapInt8Uint64V(v, e) + case *map[int8]uint64: + fastpathTV.EncMapInt8Uint64V(*v, e) + case map[int8]uintptr: + fastpathTV.EncMapInt8UintptrV(v, e) + case *map[int8]uintptr: + fastpathTV.EncMapInt8UintptrV(*v, e) + case map[int8]int: + fastpathTV.EncMapInt8IntV(v, e) + case *map[int8]int: + fastpathTV.EncMapInt8IntV(*v, e) + case map[int8]int8: + fastpathTV.EncMapInt8Int8V(v, e) + case *map[int8]int8: + fastpathTV.EncMapInt8Int8V(*v, e) + case map[int8]int16: + fastpathTV.EncMapInt8Int16V(v, e) + case *map[int8]int16: + fastpathTV.EncMapInt8Int16V(*v, e) + case map[int8]int32: + fastpathTV.EncMapInt8Int32V(v, e) + case *map[int8]int32: + fastpathTV.EncMapInt8Int32V(*v, e) + case map[int8]int64: + fastpathTV.EncMapInt8Int64V(v, e) + case *map[int8]int64: + fastpathTV.EncMapInt8Int64V(*v, e) + case map[int8]float32: + fastpathTV.EncMapInt8Float32V(v, e) + case *map[int8]float32: + fastpathTV.EncMapInt8Float32V(*v, e) + case map[int8]float64: + fastpathTV.EncMapInt8Float64V(v, e) + case *map[int8]float64: + fastpathTV.EncMapInt8Float64V(*v, e) + case map[int8]bool: + fastpathTV.EncMapInt8BoolV(v, e) + case *map[int8]bool: + fastpathTV.EncMapInt8BoolV(*v, e) + case map[int16]interface{}: + fastpathTV.EncMapInt16IntfV(v, e) + case *map[int16]interface{}: + fastpathTV.EncMapInt16IntfV(*v, e) + case map[int16]string: + fastpathTV.EncMapInt16StringV(v, e) + case *map[int16]string: + fastpathTV.EncMapInt16StringV(*v, e) + case map[int16]uint: + fastpathTV.EncMapInt16UintV(v, e) + case *map[int16]uint: + fastpathTV.EncMapInt16UintV(*v, e) + case map[int16]uint8: + fastpathTV.EncMapInt16Uint8V(v, e) + case *map[int16]uint8: + fastpathTV.EncMapInt16Uint8V(*v, e) + case map[int16]uint16: + fastpathTV.EncMapInt16Uint16V(v, e) + case *map[int16]uint16: + fastpathTV.EncMapInt16Uint16V(*v, e) + case map[int16]uint32: + fastpathTV.EncMapInt16Uint32V(v, e) + case *map[int16]uint32: + fastpathTV.EncMapInt16Uint32V(*v, e) + case map[int16]uint64: + fastpathTV.EncMapInt16Uint64V(v, e) + case *map[int16]uint64: + fastpathTV.EncMapInt16Uint64V(*v, e) + case map[int16]uintptr: + fastpathTV.EncMapInt16UintptrV(v, e) + case *map[int16]uintptr: + fastpathTV.EncMapInt16UintptrV(*v, e) + case map[int16]int: + fastpathTV.EncMapInt16IntV(v, e) + case *map[int16]int: + fastpathTV.EncMapInt16IntV(*v, e) + case map[int16]int8: + fastpathTV.EncMapInt16Int8V(v, e) + case *map[int16]int8: + fastpathTV.EncMapInt16Int8V(*v, e) + case map[int16]int16: + fastpathTV.EncMapInt16Int16V(v, e) + case *map[int16]int16: + fastpathTV.EncMapInt16Int16V(*v, e) + case map[int16]int32: + fastpathTV.EncMapInt16Int32V(v, e) + case *map[int16]int32: + fastpathTV.EncMapInt16Int32V(*v, e) + case map[int16]int64: + fastpathTV.EncMapInt16Int64V(v, e) + case *map[int16]int64: + fastpathTV.EncMapInt16Int64V(*v, e) + case map[int16]float32: + fastpathTV.EncMapInt16Float32V(v, e) + case *map[int16]float32: + fastpathTV.EncMapInt16Float32V(*v, e) + case map[int16]float64: + fastpathTV.EncMapInt16Float64V(v, e) + case *map[int16]float64: + fastpathTV.EncMapInt16Float64V(*v, e) + case map[int16]bool: + fastpathTV.EncMapInt16BoolV(v, e) + case *map[int16]bool: + fastpathTV.EncMapInt16BoolV(*v, e) + case map[int32]interface{}: + fastpathTV.EncMapInt32IntfV(v, e) + case *map[int32]interface{}: + fastpathTV.EncMapInt32IntfV(*v, e) + case map[int32]string: + fastpathTV.EncMapInt32StringV(v, e) + case *map[int32]string: + fastpathTV.EncMapInt32StringV(*v, e) + case map[int32]uint: + fastpathTV.EncMapInt32UintV(v, e) + case *map[int32]uint: + fastpathTV.EncMapInt32UintV(*v, e) + case map[int32]uint8: + fastpathTV.EncMapInt32Uint8V(v, e) + case *map[int32]uint8: + fastpathTV.EncMapInt32Uint8V(*v, e) + case map[int32]uint16: + fastpathTV.EncMapInt32Uint16V(v, e) + case *map[int32]uint16: + fastpathTV.EncMapInt32Uint16V(*v, e) + case map[int32]uint32: + fastpathTV.EncMapInt32Uint32V(v, e) + case *map[int32]uint32: + fastpathTV.EncMapInt32Uint32V(*v, e) + case map[int32]uint64: + fastpathTV.EncMapInt32Uint64V(v, e) + case *map[int32]uint64: + fastpathTV.EncMapInt32Uint64V(*v, e) + case map[int32]uintptr: + fastpathTV.EncMapInt32UintptrV(v, e) + case *map[int32]uintptr: + fastpathTV.EncMapInt32UintptrV(*v, e) + case map[int32]int: + fastpathTV.EncMapInt32IntV(v, e) + case *map[int32]int: + fastpathTV.EncMapInt32IntV(*v, e) + case map[int32]int8: + fastpathTV.EncMapInt32Int8V(v, e) + case *map[int32]int8: + fastpathTV.EncMapInt32Int8V(*v, e) + case map[int32]int16: + fastpathTV.EncMapInt32Int16V(v, e) + case *map[int32]int16: + fastpathTV.EncMapInt32Int16V(*v, e) + case map[int32]int32: + fastpathTV.EncMapInt32Int32V(v, e) + case *map[int32]int32: + fastpathTV.EncMapInt32Int32V(*v, e) + case map[int32]int64: + fastpathTV.EncMapInt32Int64V(v, e) + case *map[int32]int64: + fastpathTV.EncMapInt32Int64V(*v, e) + case map[int32]float32: + fastpathTV.EncMapInt32Float32V(v, e) + case *map[int32]float32: + fastpathTV.EncMapInt32Float32V(*v, e) + case map[int32]float64: + fastpathTV.EncMapInt32Float64V(v, e) + case *map[int32]float64: + fastpathTV.EncMapInt32Float64V(*v, e) + case map[int32]bool: + fastpathTV.EncMapInt32BoolV(v, e) + case *map[int32]bool: + fastpathTV.EncMapInt32BoolV(*v, e) + case map[int64]interface{}: + fastpathTV.EncMapInt64IntfV(v, e) + case *map[int64]interface{}: + fastpathTV.EncMapInt64IntfV(*v, e) + case map[int64]string: + fastpathTV.EncMapInt64StringV(v, e) + case *map[int64]string: + fastpathTV.EncMapInt64StringV(*v, e) + case map[int64]uint: + fastpathTV.EncMapInt64UintV(v, e) + case *map[int64]uint: + fastpathTV.EncMapInt64UintV(*v, e) + case map[int64]uint8: + fastpathTV.EncMapInt64Uint8V(v, e) + case *map[int64]uint8: + fastpathTV.EncMapInt64Uint8V(*v, e) + case map[int64]uint16: + fastpathTV.EncMapInt64Uint16V(v, e) + case *map[int64]uint16: + fastpathTV.EncMapInt64Uint16V(*v, e) + case map[int64]uint32: + fastpathTV.EncMapInt64Uint32V(v, e) + case *map[int64]uint32: + fastpathTV.EncMapInt64Uint32V(*v, e) + case map[int64]uint64: + fastpathTV.EncMapInt64Uint64V(v, e) + case *map[int64]uint64: + fastpathTV.EncMapInt64Uint64V(*v, e) + case map[int64]uintptr: + fastpathTV.EncMapInt64UintptrV(v, e) + case *map[int64]uintptr: + fastpathTV.EncMapInt64UintptrV(*v, e) + case map[int64]int: + fastpathTV.EncMapInt64IntV(v, e) + case *map[int64]int: + fastpathTV.EncMapInt64IntV(*v, e) + case map[int64]int8: + fastpathTV.EncMapInt64Int8V(v, e) + case *map[int64]int8: + fastpathTV.EncMapInt64Int8V(*v, e) + case map[int64]int16: + fastpathTV.EncMapInt64Int16V(v, e) + case *map[int64]int16: + fastpathTV.EncMapInt64Int16V(*v, e) + case map[int64]int32: + fastpathTV.EncMapInt64Int32V(v, e) + case *map[int64]int32: + fastpathTV.EncMapInt64Int32V(*v, e) + case map[int64]int64: + fastpathTV.EncMapInt64Int64V(v, e) + case *map[int64]int64: + fastpathTV.EncMapInt64Int64V(*v, e) + case map[int64]float32: + fastpathTV.EncMapInt64Float32V(v, e) + case *map[int64]float32: + fastpathTV.EncMapInt64Float32V(*v, e) + case map[int64]float64: + fastpathTV.EncMapInt64Float64V(v, e) + case *map[int64]float64: + fastpathTV.EncMapInt64Float64V(*v, e) + case map[int64]bool: + fastpathTV.EncMapInt64BoolV(v, e) + case *map[int64]bool: + fastpathTV.EncMapInt64BoolV(*v, e) + case map[bool]interface{}: + fastpathTV.EncMapBoolIntfV(v, e) + case *map[bool]interface{}: + fastpathTV.EncMapBoolIntfV(*v, e) + case map[bool]string: + fastpathTV.EncMapBoolStringV(v, e) + case *map[bool]string: + fastpathTV.EncMapBoolStringV(*v, e) + case map[bool]uint: + fastpathTV.EncMapBoolUintV(v, e) + case *map[bool]uint: + fastpathTV.EncMapBoolUintV(*v, e) + case map[bool]uint8: + fastpathTV.EncMapBoolUint8V(v, e) + case *map[bool]uint8: + fastpathTV.EncMapBoolUint8V(*v, e) + case map[bool]uint16: + fastpathTV.EncMapBoolUint16V(v, e) + case *map[bool]uint16: + fastpathTV.EncMapBoolUint16V(*v, e) + case map[bool]uint32: + fastpathTV.EncMapBoolUint32V(v, e) + case *map[bool]uint32: + fastpathTV.EncMapBoolUint32V(*v, e) + case map[bool]uint64: + fastpathTV.EncMapBoolUint64V(v, e) + case *map[bool]uint64: + fastpathTV.EncMapBoolUint64V(*v, e) + case map[bool]uintptr: + fastpathTV.EncMapBoolUintptrV(v, e) + case *map[bool]uintptr: + fastpathTV.EncMapBoolUintptrV(*v, e) + case map[bool]int: + fastpathTV.EncMapBoolIntV(v, e) + case *map[bool]int: + fastpathTV.EncMapBoolIntV(*v, e) + case map[bool]int8: + fastpathTV.EncMapBoolInt8V(v, e) + case *map[bool]int8: + fastpathTV.EncMapBoolInt8V(*v, e) + case map[bool]int16: + fastpathTV.EncMapBoolInt16V(v, e) + case *map[bool]int16: + fastpathTV.EncMapBoolInt16V(*v, e) + case map[bool]int32: + fastpathTV.EncMapBoolInt32V(v, e) + case *map[bool]int32: + fastpathTV.EncMapBoolInt32V(*v, e) + case map[bool]int64: + fastpathTV.EncMapBoolInt64V(v, e) + case *map[bool]int64: + fastpathTV.EncMapBoolInt64V(*v, e) + case map[bool]float32: + fastpathTV.EncMapBoolFloat32V(v, e) + case *map[bool]float32: + fastpathTV.EncMapBoolFloat32V(*v, e) + case map[bool]float64: + fastpathTV.EncMapBoolFloat64V(v, e) + case *map[bool]float64: + fastpathTV.EncMapBoolFloat64V(*v, e) + case map[bool]bool: + fastpathTV.EncMapBoolBoolV(v, e) + case *map[bool]bool: + fastpathTV.EncMapBoolBoolV(*v, e) + + default: + _ = v // workaround https://github.com/golang/go/issues/12927 seen in go1.4 + return false + } + return true +} + +// -- -- fast path functions + +func (e *Encoder) fastpathEncSliceIntfR(f *codecFnInfo, rv reflect.Value) { + if f.ti.mbs { + fastpathTV.EncAsMapSliceIntfV(rv2i(rv).([]interface{}), e) + } else { + fastpathTV.EncSliceIntfV(rv2i(rv).([]interface{}), e) + } +} +func (_ fastpathT) EncSliceIntfV(v []interface{}, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteArrayStart(len(v)) + for _, v2 := range v { + if esep { + ee.WriteArrayElem() + } + e.encode(v2) + } + ee.WriteArrayEnd() +} +func (_ fastpathT) EncAsMapSliceIntfV(v []interface{}, e *Encoder) { + ee, esep := e.e, e.hh.hasElemSeparators() + if len(v)%2 == 1 { + e.errorf(fastpathMapBySliceErrMsg, len(v)) + return + } + ee.WriteMapStart(len(v) / 2) + for j, v2 := range v { + if esep { + if j%2 == 0 { + ee.WriteMapElemKey() + } else { + ee.WriteMapElemValue() + } + } + e.encode(v2) + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncSliceStringR(f *codecFnInfo, rv reflect.Value) { + if f.ti.mbs { + fastpathTV.EncAsMapSliceStringV(rv2i(rv).([]string), e) + } else { + fastpathTV.EncSliceStringV(rv2i(rv).([]string), e) + } +} +func (_ fastpathT) EncSliceStringV(v []string, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteArrayStart(len(v)) + for _, v2 := range v { + if esep { + ee.WriteArrayElem() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { + ee.EncodeStringEnc(cUTF8, v2) + } + } + ee.WriteArrayEnd() +} +func (_ fastpathT) EncAsMapSliceStringV(v []string, e *Encoder) { + ee, esep := e.e, e.hh.hasElemSeparators() + if len(v)%2 == 1 { + e.errorf(fastpathMapBySliceErrMsg, len(v)) + return + } + ee.WriteMapStart(len(v) / 2) + for j, v2 := range v { + if esep { + if j%2 == 0 { + ee.WriteMapElemKey() + } else { + ee.WriteMapElemValue() + } + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { + ee.EncodeStringEnc(cUTF8, v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncSliceFloat32R(f *codecFnInfo, rv reflect.Value) { + if f.ti.mbs { + fastpathTV.EncAsMapSliceFloat32V(rv2i(rv).([]float32), e) + } else { + fastpathTV.EncSliceFloat32V(rv2i(rv).([]float32), e) + } +} +func (_ fastpathT) EncSliceFloat32V(v []float32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteArrayStart(len(v)) + for _, v2 := range v { + if esep { + ee.WriteArrayElem() + } + ee.EncodeFloat32(v2) + } + ee.WriteArrayEnd() +} +func (_ fastpathT) EncAsMapSliceFloat32V(v []float32, e *Encoder) { + ee, esep := e.e, e.hh.hasElemSeparators() + if len(v)%2 == 1 { + e.errorf(fastpathMapBySliceErrMsg, len(v)) + return + } + ee.WriteMapStart(len(v) / 2) + for j, v2 := range v { + if esep { + if j%2 == 0 { + ee.WriteMapElemKey() + } else { + ee.WriteMapElemValue() + } + } + ee.EncodeFloat32(v2) + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncSliceFloat64R(f *codecFnInfo, rv reflect.Value) { + if f.ti.mbs { + fastpathTV.EncAsMapSliceFloat64V(rv2i(rv).([]float64), e) + } else { + fastpathTV.EncSliceFloat64V(rv2i(rv).([]float64), e) + } +} +func (_ fastpathT) EncSliceFloat64V(v []float64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteArrayStart(len(v)) + for _, v2 := range v { + if esep { + ee.WriteArrayElem() + } + ee.EncodeFloat64(v2) + } + ee.WriteArrayEnd() +} +func (_ fastpathT) EncAsMapSliceFloat64V(v []float64, e *Encoder) { + ee, esep := e.e, e.hh.hasElemSeparators() + if len(v)%2 == 1 { + e.errorf(fastpathMapBySliceErrMsg, len(v)) + return + } + ee.WriteMapStart(len(v) / 2) + for j, v2 := range v { + if esep { + if j%2 == 0 { + ee.WriteMapElemKey() + } else { + ee.WriteMapElemValue() + } + } + ee.EncodeFloat64(v2) + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncSliceUintR(f *codecFnInfo, rv reflect.Value) { + if f.ti.mbs { + fastpathTV.EncAsMapSliceUintV(rv2i(rv).([]uint), e) + } else { + fastpathTV.EncSliceUintV(rv2i(rv).([]uint), e) + } +} +func (_ fastpathT) EncSliceUintV(v []uint, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteArrayStart(len(v)) + for _, v2 := range v { + if esep { + ee.WriteArrayElem() + } + ee.EncodeUint(uint64(v2)) + } + ee.WriteArrayEnd() +} +func (_ fastpathT) EncAsMapSliceUintV(v []uint, e *Encoder) { + ee, esep := e.e, e.hh.hasElemSeparators() + if len(v)%2 == 1 { + e.errorf(fastpathMapBySliceErrMsg, len(v)) + return + } + ee.WriteMapStart(len(v) / 2) + for j, v2 := range v { + if esep { + if j%2 == 0 { + ee.WriteMapElemKey() + } else { + ee.WriteMapElemValue() + } + } + ee.EncodeUint(uint64(v2)) + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncSliceUint8R(f *codecFnInfo, rv reflect.Value) { + if f.ti.mbs { + fastpathTV.EncAsMapSliceUint8V(rv2i(rv).([]uint8), e) + } else { + fastpathTV.EncSliceUint8V(rv2i(rv).([]uint8), e) + } +} +func (_ fastpathT) EncSliceUint8V(v []uint8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteArrayStart(len(v)) + for _, v2 := range v { + if esep { + ee.WriteArrayElem() + } + ee.EncodeUint(uint64(v2)) + } + ee.WriteArrayEnd() +} +func (_ fastpathT) EncAsMapSliceUint8V(v []uint8, e *Encoder) { + ee, esep := e.e, e.hh.hasElemSeparators() + if len(v)%2 == 1 { + e.errorf(fastpathMapBySliceErrMsg, len(v)) + return + } + ee.WriteMapStart(len(v) / 2) + for j, v2 := range v { + if esep { + if j%2 == 0 { + ee.WriteMapElemKey() + } else { + ee.WriteMapElemValue() + } + } + ee.EncodeUint(uint64(v2)) + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncSliceUint16R(f *codecFnInfo, rv reflect.Value) { + if f.ti.mbs { + fastpathTV.EncAsMapSliceUint16V(rv2i(rv).([]uint16), e) + } else { + fastpathTV.EncSliceUint16V(rv2i(rv).([]uint16), e) + } +} +func (_ fastpathT) EncSliceUint16V(v []uint16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteArrayStart(len(v)) + for _, v2 := range v { + if esep { + ee.WriteArrayElem() + } + ee.EncodeUint(uint64(v2)) + } + ee.WriteArrayEnd() +} +func (_ fastpathT) EncAsMapSliceUint16V(v []uint16, e *Encoder) { + ee, esep := e.e, e.hh.hasElemSeparators() + if len(v)%2 == 1 { + e.errorf(fastpathMapBySliceErrMsg, len(v)) + return + } + ee.WriteMapStart(len(v) / 2) + for j, v2 := range v { + if esep { + if j%2 == 0 { + ee.WriteMapElemKey() + } else { + ee.WriteMapElemValue() + } + } + ee.EncodeUint(uint64(v2)) + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncSliceUint32R(f *codecFnInfo, rv reflect.Value) { + if f.ti.mbs { + fastpathTV.EncAsMapSliceUint32V(rv2i(rv).([]uint32), e) + } else { + fastpathTV.EncSliceUint32V(rv2i(rv).([]uint32), e) + } +} +func (_ fastpathT) EncSliceUint32V(v []uint32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteArrayStart(len(v)) + for _, v2 := range v { + if esep { + ee.WriteArrayElem() + } + ee.EncodeUint(uint64(v2)) + } + ee.WriteArrayEnd() +} +func (_ fastpathT) EncAsMapSliceUint32V(v []uint32, e *Encoder) { + ee, esep := e.e, e.hh.hasElemSeparators() + if len(v)%2 == 1 { + e.errorf(fastpathMapBySliceErrMsg, len(v)) + return + } + ee.WriteMapStart(len(v) / 2) + for j, v2 := range v { + if esep { + if j%2 == 0 { + ee.WriteMapElemKey() + } else { + ee.WriteMapElemValue() + } + } + ee.EncodeUint(uint64(v2)) + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncSliceUint64R(f *codecFnInfo, rv reflect.Value) { + if f.ti.mbs { + fastpathTV.EncAsMapSliceUint64V(rv2i(rv).([]uint64), e) + } else { + fastpathTV.EncSliceUint64V(rv2i(rv).([]uint64), e) + } +} +func (_ fastpathT) EncSliceUint64V(v []uint64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteArrayStart(len(v)) + for _, v2 := range v { + if esep { + ee.WriteArrayElem() + } + ee.EncodeUint(uint64(v2)) + } + ee.WriteArrayEnd() +} +func (_ fastpathT) EncAsMapSliceUint64V(v []uint64, e *Encoder) { + ee, esep := e.e, e.hh.hasElemSeparators() + if len(v)%2 == 1 { + e.errorf(fastpathMapBySliceErrMsg, len(v)) + return + } + ee.WriteMapStart(len(v) / 2) + for j, v2 := range v { + if esep { + if j%2 == 0 { + ee.WriteMapElemKey() + } else { + ee.WriteMapElemValue() + } + } + ee.EncodeUint(uint64(v2)) + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncSliceUintptrR(f *codecFnInfo, rv reflect.Value) { + if f.ti.mbs { + fastpathTV.EncAsMapSliceUintptrV(rv2i(rv).([]uintptr), e) + } else { + fastpathTV.EncSliceUintptrV(rv2i(rv).([]uintptr), e) + } +} +func (_ fastpathT) EncSliceUintptrV(v []uintptr, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteArrayStart(len(v)) + for _, v2 := range v { + if esep { + ee.WriteArrayElem() + } + e.encode(v2) + } + ee.WriteArrayEnd() +} +func (_ fastpathT) EncAsMapSliceUintptrV(v []uintptr, e *Encoder) { + ee, esep := e.e, e.hh.hasElemSeparators() + if len(v)%2 == 1 { + e.errorf(fastpathMapBySliceErrMsg, len(v)) + return + } + ee.WriteMapStart(len(v) / 2) + for j, v2 := range v { + if esep { + if j%2 == 0 { + ee.WriteMapElemKey() + } else { + ee.WriteMapElemValue() + } + } + e.encode(v2) + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncSliceIntR(f *codecFnInfo, rv reflect.Value) { + if f.ti.mbs { + fastpathTV.EncAsMapSliceIntV(rv2i(rv).([]int), e) + } else { + fastpathTV.EncSliceIntV(rv2i(rv).([]int), e) + } +} +func (_ fastpathT) EncSliceIntV(v []int, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteArrayStart(len(v)) + for _, v2 := range v { + if esep { + ee.WriteArrayElem() + } + ee.EncodeInt(int64(v2)) + } + ee.WriteArrayEnd() +} +func (_ fastpathT) EncAsMapSliceIntV(v []int, e *Encoder) { + ee, esep := e.e, e.hh.hasElemSeparators() + if len(v)%2 == 1 { + e.errorf(fastpathMapBySliceErrMsg, len(v)) + return + } + ee.WriteMapStart(len(v) / 2) + for j, v2 := range v { + if esep { + if j%2 == 0 { + ee.WriteMapElemKey() + } else { + ee.WriteMapElemValue() + } + } + ee.EncodeInt(int64(v2)) + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncSliceInt8R(f *codecFnInfo, rv reflect.Value) { + if f.ti.mbs { + fastpathTV.EncAsMapSliceInt8V(rv2i(rv).([]int8), e) + } else { + fastpathTV.EncSliceInt8V(rv2i(rv).([]int8), e) + } +} +func (_ fastpathT) EncSliceInt8V(v []int8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteArrayStart(len(v)) + for _, v2 := range v { + if esep { + ee.WriteArrayElem() + } + ee.EncodeInt(int64(v2)) + } + ee.WriteArrayEnd() +} +func (_ fastpathT) EncAsMapSliceInt8V(v []int8, e *Encoder) { + ee, esep := e.e, e.hh.hasElemSeparators() + if len(v)%2 == 1 { + e.errorf(fastpathMapBySliceErrMsg, len(v)) + return + } + ee.WriteMapStart(len(v) / 2) + for j, v2 := range v { + if esep { + if j%2 == 0 { + ee.WriteMapElemKey() + } else { + ee.WriteMapElemValue() + } + } + ee.EncodeInt(int64(v2)) + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncSliceInt16R(f *codecFnInfo, rv reflect.Value) { + if f.ti.mbs { + fastpathTV.EncAsMapSliceInt16V(rv2i(rv).([]int16), e) + } else { + fastpathTV.EncSliceInt16V(rv2i(rv).([]int16), e) + } +} +func (_ fastpathT) EncSliceInt16V(v []int16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteArrayStart(len(v)) + for _, v2 := range v { + if esep { + ee.WriteArrayElem() + } + ee.EncodeInt(int64(v2)) + } + ee.WriteArrayEnd() +} +func (_ fastpathT) EncAsMapSliceInt16V(v []int16, e *Encoder) { + ee, esep := e.e, e.hh.hasElemSeparators() + if len(v)%2 == 1 { + e.errorf(fastpathMapBySliceErrMsg, len(v)) + return + } + ee.WriteMapStart(len(v) / 2) + for j, v2 := range v { + if esep { + if j%2 == 0 { + ee.WriteMapElemKey() + } else { + ee.WriteMapElemValue() + } + } + ee.EncodeInt(int64(v2)) + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncSliceInt32R(f *codecFnInfo, rv reflect.Value) { + if f.ti.mbs { + fastpathTV.EncAsMapSliceInt32V(rv2i(rv).([]int32), e) + } else { + fastpathTV.EncSliceInt32V(rv2i(rv).([]int32), e) + } +} +func (_ fastpathT) EncSliceInt32V(v []int32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteArrayStart(len(v)) + for _, v2 := range v { + if esep { + ee.WriteArrayElem() + } + ee.EncodeInt(int64(v2)) + } + ee.WriteArrayEnd() +} +func (_ fastpathT) EncAsMapSliceInt32V(v []int32, e *Encoder) { + ee, esep := e.e, e.hh.hasElemSeparators() + if len(v)%2 == 1 { + e.errorf(fastpathMapBySliceErrMsg, len(v)) + return + } + ee.WriteMapStart(len(v) / 2) + for j, v2 := range v { + if esep { + if j%2 == 0 { + ee.WriteMapElemKey() + } else { + ee.WriteMapElemValue() + } + } + ee.EncodeInt(int64(v2)) + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncSliceInt64R(f *codecFnInfo, rv reflect.Value) { + if f.ti.mbs { + fastpathTV.EncAsMapSliceInt64V(rv2i(rv).([]int64), e) + } else { + fastpathTV.EncSliceInt64V(rv2i(rv).([]int64), e) + } +} +func (_ fastpathT) EncSliceInt64V(v []int64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteArrayStart(len(v)) + for _, v2 := range v { + if esep { + ee.WriteArrayElem() + } + ee.EncodeInt(int64(v2)) + } + ee.WriteArrayEnd() +} +func (_ fastpathT) EncAsMapSliceInt64V(v []int64, e *Encoder) { + ee, esep := e.e, e.hh.hasElemSeparators() + if len(v)%2 == 1 { + e.errorf(fastpathMapBySliceErrMsg, len(v)) + return + } + ee.WriteMapStart(len(v) / 2) + for j, v2 := range v { + if esep { + if j%2 == 0 { + ee.WriteMapElemKey() + } else { + ee.WriteMapElemValue() + } + } + ee.EncodeInt(int64(v2)) + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncSliceBoolR(f *codecFnInfo, rv reflect.Value) { + if f.ti.mbs { + fastpathTV.EncAsMapSliceBoolV(rv2i(rv).([]bool), e) + } else { + fastpathTV.EncSliceBoolV(rv2i(rv).([]bool), e) + } +} +func (_ fastpathT) EncSliceBoolV(v []bool, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteArrayStart(len(v)) + for _, v2 := range v { + if esep { + ee.WriteArrayElem() + } + ee.EncodeBool(v2) + } + ee.WriteArrayEnd() +} +func (_ fastpathT) EncAsMapSliceBoolV(v []bool, e *Encoder) { + ee, esep := e.e, e.hh.hasElemSeparators() + if len(v)%2 == 1 { + e.errorf(fastpathMapBySliceErrMsg, len(v)) + return + } + ee.WriteMapStart(len(v) / 2) + for j, v2 := range v { + if esep { + if j%2 == 0 { + ee.WriteMapElemKey() + } else { + ee.WriteMapElemValue() + } + } + ee.EncodeBool(v2) + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntfIntfR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntfIntfV(rv2i(rv).(map[interface{}]interface{}), e) +} +func (_ fastpathT) EncMapIntfIntfV(v map[interface{}]interface{}, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(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 uint + var vp *bytesI + for k2 := range v { + l = uint(len(mksv)) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntfStringR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntfStringV(rv2i(rv).(map[interface{}]string), e) +} +func (_ fastpathT) EncMapIntfStringV(v map[interface{}]string, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(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 uint + var vp *bytesI + for k2 := range v { + l = uint(len(mksv)) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { + ee.EncodeStringEnc(cUTF8, v2) + } + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntfUintR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntfUintV(rv2i(rv).(map[interface{}]uint), e) +} +func (_ fastpathT) EncMapIntfUintV(v map[interface{}]uint, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(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 uint + var vp *bytesI + for k2 := range v { + l = uint(len(mksv)) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntfUint8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntfUint8V(rv2i(rv).(map[interface{}]uint8), e) +} +func (_ fastpathT) EncMapIntfUint8V(v map[interface{}]uint8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(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 uint + var vp *bytesI + for k2 := range v { + l = uint(len(mksv)) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntfUint16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntfUint16V(rv2i(rv).(map[interface{}]uint16), e) +} +func (_ fastpathT) EncMapIntfUint16V(v map[interface{}]uint16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(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 uint + var vp *bytesI + for k2 := range v { + l = uint(len(mksv)) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntfUint32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntfUint32V(rv2i(rv).(map[interface{}]uint32), e) +} +func (_ fastpathT) EncMapIntfUint32V(v map[interface{}]uint32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(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 uint + var vp *bytesI + for k2 := range v { + l = uint(len(mksv)) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntfUint64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntfUint64V(rv2i(rv).(map[interface{}]uint64), e) +} +func (_ fastpathT) EncMapIntfUint64V(v map[interface{}]uint64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(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 uint + var vp *bytesI + for k2 := range v { + l = uint(len(mksv)) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntfUintptrR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntfUintptrV(rv2i(rv).(map[interface{}]uintptr), e) +} +func (_ fastpathT) EncMapIntfUintptrV(v map[interface{}]uintptr, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(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 uint + var vp *bytesI + for k2 := range v { + l = uint(len(mksv)) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntfIntR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntfIntV(rv2i(rv).(map[interface{}]int), e) +} +func (_ fastpathT) EncMapIntfIntV(v map[interface{}]int, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(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 uint + var vp *bytesI + for k2 := range v { + l = uint(len(mksv)) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntfInt8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntfInt8V(rv2i(rv).(map[interface{}]int8), e) +} +func (_ fastpathT) EncMapIntfInt8V(v map[interface{}]int8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(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 uint + var vp *bytesI + for k2 := range v { + l = uint(len(mksv)) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntfInt16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntfInt16V(rv2i(rv).(map[interface{}]int16), e) +} +func (_ fastpathT) EncMapIntfInt16V(v map[interface{}]int16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(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 uint + var vp *bytesI + for k2 := range v { + l = uint(len(mksv)) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntfInt32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntfInt32V(rv2i(rv).(map[interface{}]int32), e) +} +func (_ fastpathT) EncMapIntfInt32V(v map[interface{}]int32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(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 uint + var vp *bytesI + for k2 := range v { + l = uint(len(mksv)) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntfInt64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntfInt64V(rv2i(rv).(map[interface{}]int64), e) +} +func (_ fastpathT) EncMapIntfInt64V(v map[interface{}]int64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(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 uint + var vp *bytesI + for k2 := range v { + l = uint(len(mksv)) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntfFloat32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntfFloat32V(rv2i(rv).(map[interface{}]float32), e) +} +func (_ fastpathT) EncMapIntfFloat32V(v map[interface{}]float32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(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 uint + var vp *bytesI + for k2 := range v { + l = uint(len(mksv)) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntfFloat64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntfFloat64V(rv2i(rv).(map[interface{}]float64), e) +} +func (_ fastpathT) EncMapIntfFloat64V(v map[interface{}]float64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(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 uint + var vp *bytesI + for k2 := range v { + l = uint(len(mksv)) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntfBoolR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntfBoolV(rv2i(rv).(map[interface{}]bool), e) +} +func (_ fastpathT) EncMapIntfBoolV(v map[interface{}]bool, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(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 uint + var vp *bytesI + for k2 := range v { + l = uint(len(mksv)) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[v2[j].i]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapStringIntfR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapStringIntfV(rv2i(rv).(map[string]interface{}), e) +} +func (_ fastpathT) EncMapStringIntfV(v map[string]interface{}, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i uint + for k := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + e.encode(v[string(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapStringStringR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapStringStringV(rv2i(rv).(map[string]string), e) +} +func (_ fastpathT) EncMapStringStringV(v map[string]string, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i uint + for k := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[string(k2)])) + } else { + ee.EncodeStringEnc(cUTF8, v[string(k2)]) + } + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { + ee.EncodeStringEnc(cUTF8, v2) + } + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapStringUintR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapStringUintV(rv2i(rv).(map[string]uint), e) +} +func (_ fastpathT) EncMapStringUintV(v map[string]uint, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i uint + for k := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapStringUint8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapStringUint8V(rv2i(rv).(map[string]uint8), e) +} +func (_ fastpathT) EncMapStringUint8V(v map[string]uint8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i uint + for k := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapStringUint16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapStringUint16V(rv2i(rv).(map[string]uint16), e) +} +func (_ fastpathT) EncMapStringUint16V(v map[string]uint16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i uint + for k := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapStringUint32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapStringUint32V(rv2i(rv).(map[string]uint32), e) +} +func (_ fastpathT) EncMapStringUint32V(v map[string]uint32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i uint + for k := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapStringUint64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapStringUint64V(rv2i(rv).(map[string]uint64), e) +} +func (_ fastpathT) EncMapStringUint64V(v map[string]uint64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i uint + for k := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapStringUintptrR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapStringUintptrV(rv2i(rv).(map[string]uintptr), e) +} +func (_ fastpathT) EncMapStringUintptrV(v map[string]uintptr, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i uint + for k := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + e.encode(v[string(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapStringIntR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapStringIntV(rv2i(rv).(map[string]int), e) +} +func (_ fastpathT) EncMapStringIntV(v map[string]int, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i uint + for k := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapStringInt8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapStringInt8V(rv2i(rv).(map[string]int8), e) +} +func (_ fastpathT) EncMapStringInt8V(v map[string]int8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i uint + for k := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapStringInt16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapStringInt16V(rv2i(rv).(map[string]int16), e) +} +func (_ fastpathT) EncMapStringInt16V(v map[string]int16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i uint + for k := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapStringInt32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapStringInt32V(rv2i(rv).(map[string]int32), e) +} +func (_ fastpathT) EncMapStringInt32V(v map[string]int32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i uint + for k := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapStringInt64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapStringInt64V(rv2i(rv).(map[string]int64), e) +} +func (_ fastpathT) EncMapStringInt64V(v map[string]int64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i uint + for k := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapStringFloat32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapStringFloat32V(rv2i(rv).(map[string]float32), e) +} +func (_ fastpathT) EncMapStringFloat32V(v map[string]float32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i uint + for k := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v[string(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapStringFloat64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapStringFloat64V(rv2i(rv).(map[string]float64), e) +} +func (_ fastpathT) EncMapStringFloat64V(v map[string]float64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i uint + for k := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v[string(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapStringBoolR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapStringBoolV(rv2i(rv).(map[string]bool), e) +} +func (_ fastpathT) EncMapStringBoolV(v map[string]bool, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]string, len(v)) + var i uint + for k := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v[string(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { + ee.EncodeStringEnc(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat32IntfR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat32IntfV(rv2i(rv).(map[float32]interface{}), e) +} +func (_ fastpathT) EncMapFloat32IntfV(v map[float32]interface{}, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[float32(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat32StringR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat32StringV(rv2i(rv).(map[float32]string), e) +} +func (_ fastpathT) EncMapFloat32StringV(v map[float32]string, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[float32(k2)])) + } else { + ee.EncodeStringEnc(cUTF8, v[float32(k2)]) + } + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { + ee.EncodeStringEnc(cUTF8, v2) + } + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat32UintR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat32UintV(rv2i(rv).(map[float32]uint), e) +} +func (_ fastpathT) EncMapFloat32UintV(v map[float32]uint, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[float32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat32Uint8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat32Uint8V(rv2i(rv).(map[float32]uint8), e) +} +func (_ fastpathT) EncMapFloat32Uint8V(v map[float32]uint8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[float32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat32Uint16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat32Uint16V(rv2i(rv).(map[float32]uint16), e) +} +func (_ fastpathT) EncMapFloat32Uint16V(v map[float32]uint16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[float32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat32Uint32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat32Uint32V(rv2i(rv).(map[float32]uint32), e) +} +func (_ fastpathT) EncMapFloat32Uint32V(v map[float32]uint32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[float32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat32Uint64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat32Uint64V(rv2i(rv).(map[float32]uint64), e) +} +func (_ fastpathT) EncMapFloat32Uint64V(v map[float32]uint64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[float32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat32UintptrR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat32UintptrV(rv2i(rv).(map[float32]uintptr), e) +} +func (_ fastpathT) EncMapFloat32UintptrV(v map[float32]uintptr, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[float32(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat32IntR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat32IntV(rv2i(rv).(map[float32]int), e) +} +func (_ fastpathT) EncMapFloat32IntV(v map[float32]int, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[float32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat32Int8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat32Int8V(rv2i(rv).(map[float32]int8), e) +} +func (_ fastpathT) EncMapFloat32Int8V(v map[float32]int8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[float32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat32Int16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat32Int16V(rv2i(rv).(map[float32]int16), e) +} +func (_ fastpathT) EncMapFloat32Int16V(v map[float32]int16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[float32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat32Int32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat32Int32V(rv2i(rv).(map[float32]int32), e) +} +func (_ fastpathT) EncMapFloat32Int32V(v map[float32]int32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[float32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat32Int64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat32Int64V(rv2i(rv).(map[float32]int64), e) +} +func (_ fastpathT) EncMapFloat32Int64V(v map[float32]int64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[float32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat32Float32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat32Float32V(rv2i(rv).(map[float32]float32), e) +} +func (_ fastpathT) EncMapFloat32Float32V(v map[float32]float32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v[float32(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat32Float64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat32Float64V(rv2i(rv).(map[float32]float64), e) +} +func (_ fastpathT) EncMapFloat32Float64V(v map[float32]float64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v[float32(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat32BoolR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat32BoolV(rv2i(rv).(map[float32]bool), e) +} +func (_ fastpathT) EncMapFloat32BoolV(v map[float32]bool, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v[float32(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat64IntfR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat64IntfV(rv2i(rv).(map[float64]interface{}), e) +} +func (_ fastpathT) EncMapFloat64IntfV(v map[float64]interface{}, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[float64(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat64StringR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat64StringV(rv2i(rv).(map[float64]string), e) +} +func (_ fastpathT) EncMapFloat64StringV(v map[float64]string, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[float64(k2)])) + } else { + ee.EncodeStringEnc(cUTF8, v[float64(k2)]) + } + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { + ee.EncodeStringEnc(cUTF8, v2) + } + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat64UintR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat64UintV(rv2i(rv).(map[float64]uint), e) +} +func (_ fastpathT) EncMapFloat64UintV(v map[float64]uint, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[float64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat64Uint8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat64Uint8V(rv2i(rv).(map[float64]uint8), e) +} +func (_ fastpathT) EncMapFloat64Uint8V(v map[float64]uint8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[float64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat64Uint16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat64Uint16V(rv2i(rv).(map[float64]uint16), e) +} +func (_ fastpathT) EncMapFloat64Uint16V(v map[float64]uint16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[float64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat64Uint32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat64Uint32V(rv2i(rv).(map[float64]uint32), e) +} +func (_ fastpathT) EncMapFloat64Uint32V(v map[float64]uint32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[float64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat64Uint64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat64Uint64V(rv2i(rv).(map[float64]uint64), e) +} +func (_ fastpathT) EncMapFloat64Uint64V(v map[float64]uint64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[float64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat64UintptrR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat64UintptrV(rv2i(rv).(map[float64]uintptr), e) +} +func (_ fastpathT) EncMapFloat64UintptrV(v map[float64]uintptr, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[float64(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat64IntR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat64IntV(rv2i(rv).(map[float64]int), e) +} +func (_ fastpathT) EncMapFloat64IntV(v map[float64]int, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[float64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat64Int8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat64Int8V(rv2i(rv).(map[float64]int8), e) +} +func (_ fastpathT) EncMapFloat64Int8V(v map[float64]int8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[float64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat64Int16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat64Int16V(rv2i(rv).(map[float64]int16), e) +} +func (_ fastpathT) EncMapFloat64Int16V(v map[float64]int16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[float64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat64Int32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat64Int32V(rv2i(rv).(map[float64]int32), e) +} +func (_ fastpathT) EncMapFloat64Int32V(v map[float64]int32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[float64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat64Int64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat64Int64V(rv2i(rv).(map[float64]int64), e) +} +func (_ fastpathT) EncMapFloat64Int64V(v map[float64]int64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[float64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat64Float32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat64Float32V(rv2i(rv).(map[float64]float32), e) +} +func (_ fastpathT) EncMapFloat64Float32V(v map[float64]float32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v[float64(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat64Float64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat64Float64V(rv2i(rv).(map[float64]float64), e) +} +func (_ fastpathT) EncMapFloat64Float64V(v map[float64]float64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v[float64(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapFloat64BoolR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapFloat64BoolV(rv2i(rv).(map[float64]bool), e) +} +func (_ fastpathT) EncMapFloat64BoolV(v map[float64]bool, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]float64, len(v)) + var i uint + for k := range v { + v2[i] = float64(k) + i++ + } + sort.Sort(floatSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v[float64(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintIntfR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintIntfV(rv2i(rv).(map[uint]interface{}), e) +} +func (_ fastpathT) EncMapUintIntfV(v map[uint]interface{}, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[uint(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintStringR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintStringV(rv2i(rv).(map[uint]string), e) +} +func (_ fastpathT) EncMapUintStringV(v map[uint]string, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[uint(k2)])) + } else { + ee.EncodeStringEnc(cUTF8, v[uint(k2)]) + } + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { + ee.EncodeStringEnc(cUTF8, v2) + } + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintUintR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintUintV(rv2i(rv).(map[uint]uint), e) +} +func (_ fastpathT) EncMapUintUintV(v map[uint]uint, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uint(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintUint8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintUint8V(rv2i(rv).(map[uint]uint8), e) +} +func (_ fastpathT) EncMapUintUint8V(v map[uint]uint8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uint(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintUint16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintUint16V(rv2i(rv).(map[uint]uint16), e) +} +func (_ fastpathT) EncMapUintUint16V(v map[uint]uint16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uint(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintUint32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintUint32V(rv2i(rv).(map[uint]uint32), e) +} +func (_ fastpathT) EncMapUintUint32V(v map[uint]uint32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uint(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintUint64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintUint64V(rv2i(rv).(map[uint]uint64), e) +} +func (_ fastpathT) EncMapUintUint64V(v map[uint]uint64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uint(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintUintptrR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintUintptrV(rv2i(rv).(map[uint]uintptr), e) +} +func (_ fastpathT) EncMapUintUintptrV(v map[uint]uintptr, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[uint(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintIntR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintIntV(rv2i(rv).(map[uint]int), e) +} +func (_ fastpathT) EncMapUintIntV(v map[uint]int, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uint(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintInt8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintInt8V(rv2i(rv).(map[uint]int8), e) +} +func (_ fastpathT) EncMapUintInt8V(v map[uint]int8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uint(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintInt16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintInt16V(rv2i(rv).(map[uint]int16), e) +} +func (_ fastpathT) EncMapUintInt16V(v map[uint]int16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uint(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintInt32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintInt32V(rv2i(rv).(map[uint]int32), e) +} +func (_ fastpathT) EncMapUintInt32V(v map[uint]int32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uint(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintInt64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintInt64V(rv2i(rv).(map[uint]int64), e) +} +func (_ fastpathT) EncMapUintInt64V(v map[uint]int64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uint(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintFloat32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintFloat32V(rv2i(rv).(map[uint]float32), e) +} +func (_ fastpathT) EncMapUintFloat32V(v map[uint]float32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v[uint(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintFloat64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintFloat64V(rv2i(rv).(map[uint]float64), e) +} +func (_ fastpathT) EncMapUintFloat64V(v map[uint]float64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v[uint(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintBoolR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintBoolV(rv2i(rv).(map[uint]bool), e) +} +func (_ fastpathT) EncMapUintBoolV(v map[uint]bool, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v[uint(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint8IntfR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint8IntfV(rv2i(rv).(map[uint8]interface{}), e) +} +func (_ fastpathT) EncMapUint8IntfV(v map[uint8]interface{}, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[uint8(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint8StringR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint8StringV(rv2i(rv).(map[uint8]string), e) +} +func (_ fastpathT) EncMapUint8StringV(v map[uint8]string, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[uint8(k2)])) + } else { + ee.EncodeStringEnc(cUTF8, v[uint8(k2)]) + } + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { + ee.EncodeStringEnc(cUTF8, v2) + } + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint8UintR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint8UintV(rv2i(rv).(map[uint8]uint), e) +} +func (_ fastpathT) EncMapUint8UintV(v map[uint8]uint, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uint8(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint8Uint8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint8Uint8V(rv2i(rv).(map[uint8]uint8), e) +} +func (_ fastpathT) EncMapUint8Uint8V(v map[uint8]uint8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uint8(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint8Uint16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint8Uint16V(rv2i(rv).(map[uint8]uint16), e) +} +func (_ fastpathT) EncMapUint8Uint16V(v map[uint8]uint16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uint8(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint8Uint32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint8Uint32V(rv2i(rv).(map[uint8]uint32), e) +} +func (_ fastpathT) EncMapUint8Uint32V(v map[uint8]uint32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uint8(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint8Uint64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint8Uint64V(rv2i(rv).(map[uint8]uint64), e) +} +func (_ fastpathT) EncMapUint8Uint64V(v map[uint8]uint64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uint8(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint8UintptrR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint8UintptrV(rv2i(rv).(map[uint8]uintptr), e) +} +func (_ fastpathT) EncMapUint8UintptrV(v map[uint8]uintptr, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[uint8(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint8IntR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint8IntV(rv2i(rv).(map[uint8]int), e) +} +func (_ fastpathT) EncMapUint8IntV(v map[uint8]int, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uint8(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint8Int8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint8Int8V(rv2i(rv).(map[uint8]int8), e) +} +func (_ fastpathT) EncMapUint8Int8V(v map[uint8]int8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uint8(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint8Int16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint8Int16V(rv2i(rv).(map[uint8]int16), e) +} +func (_ fastpathT) EncMapUint8Int16V(v map[uint8]int16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uint8(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint8Int32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint8Int32V(rv2i(rv).(map[uint8]int32), e) +} +func (_ fastpathT) EncMapUint8Int32V(v map[uint8]int32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uint8(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint8Int64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint8Int64V(rv2i(rv).(map[uint8]int64), e) +} +func (_ fastpathT) EncMapUint8Int64V(v map[uint8]int64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uint8(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint8Float32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint8Float32V(rv2i(rv).(map[uint8]float32), e) +} +func (_ fastpathT) EncMapUint8Float32V(v map[uint8]float32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v[uint8(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint8Float64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint8Float64V(rv2i(rv).(map[uint8]float64), e) +} +func (_ fastpathT) EncMapUint8Float64V(v map[uint8]float64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v[uint8(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint8BoolR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint8BoolV(rv2i(rv).(map[uint8]bool), e) +} +func (_ fastpathT) EncMapUint8BoolV(v map[uint8]bool, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v[uint8(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint16IntfR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint16IntfV(rv2i(rv).(map[uint16]interface{}), e) +} +func (_ fastpathT) EncMapUint16IntfV(v map[uint16]interface{}, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[uint16(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint16StringR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint16StringV(rv2i(rv).(map[uint16]string), e) +} +func (_ fastpathT) EncMapUint16StringV(v map[uint16]string, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[uint16(k2)])) + } else { + ee.EncodeStringEnc(cUTF8, v[uint16(k2)]) + } + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { + ee.EncodeStringEnc(cUTF8, v2) + } + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint16UintR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint16UintV(rv2i(rv).(map[uint16]uint), e) +} +func (_ fastpathT) EncMapUint16UintV(v map[uint16]uint, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uint16(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint16Uint8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint16Uint8V(rv2i(rv).(map[uint16]uint8), e) +} +func (_ fastpathT) EncMapUint16Uint8V(v map[uint16]uint8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uint16(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint16Uint16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint16Uint16V(rv2i(rv).(map[uint16]uint16), e) +} +func (_ fastpathT) EncMapUint16Uint16V(v map[uint16]uint16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uint16(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint16Uint32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint16Uint32V(rv2i(rv).(map[uint16]uint32), e) +} +func (_ fastpathT) EncMapUint16Uint32V(v map[uint16]uint32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uint16(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint16Uint64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint16Uint64V(rv2i(rv).(map[uint16]uint64), e) +} +func (_ fastpathT) EncMapUint16Uint64V(v map[uint16]uint64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uint16(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint16UintptrR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint16UintptrV(rv2i(rv).(map[uint16]uintptr), e) +} +func (_ fastpathT) EncMapUint16UintptrV(v map[uint16]uintptr, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[uint16(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint16IntR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint16IntV(rv2i(rv).(map[uint16]int), e) +} +func (_ fastpathT) EncMapUint16IntV(v map[uint16]int, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uint16(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint16Int8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint16Int8V(rv2i(rv).(map[uint16]int8), e) +} +func (_ fastpathT) EncMapUint16Int8V(v map[uint16]int8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uint16(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint16Int16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint16Int16V(rv2i(rv).(map[uint16]int16), e) +} +func (_ fastpathT) EncMapUint16Int16V(v map[uint16]int16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uint16(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint16Int32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint16Int32V(rv2i(rv).(map[uint16]int32), e) +} +func (_ fastpathT) EncMapUint16Int32V(v map[uint16]int32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uint16(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint16Int64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint16Int64V(rv2i(rv).(map[uint16]int64), e) +} +func (_ fastpathT) EncMapUint16Int64V(v map[uint16]int64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uint16(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint16Float32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint16Float32V(rv2i(rv).(map[uint16]float32), e) +} +func (_ fastpathT) EncMapUint16Float32V(v map[uint16]float32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v[uint16(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint16Float64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint16Float64V(rv2i(rv).(map[uint16]float64), e) +} +func (_ fastpathT) EncMapUint16Float64V(v map[uint16]float64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v[uint16(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint16BoolR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint16BoolV(rv2i(rv).(map[uint16]bool), e) +} +func (_ fastpathT) EncMapUint16BoolV(v map[uint16]bool, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v[uint16(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint32IntfR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint32IntfV(rv2i(rv).(map[uint32]interface{}), e) +} +func (_ fastpathT) EncMapUint32IntfV(v map[uint32]interface{}, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[uint32(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint32StringR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint32StringV(rv2i(rv).(map[uint32]string), e) +} +func (_ fastpathT) EncMapUint32StringV(v map[uint32]string, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[uint32(k2)])) + } else { + ee.EncodeStringEnc(cUTF8, v[uint32(k2)]) + } + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { + ee.EncodeStringEnc(cUTF8, v2) + } + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint32UintR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint32UintV(rv2i(rv).(map[uint32]uint), e) +} +func (_ fastpathT) EncMapUint32UintV(v map[uint32]uint, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uint32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint32Uint8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint32Uint8V(rv2i(rv).(map[uint32]uint8), e) +} +func (_ fastpathT) EncMapUint32Uint8V(v map[uint32]uint8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uint32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint32Uint16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint32Uint16V(rv2i(rv).(map[uint32]uint16), e) +} +func (_ fastpathT) EncMapUint32Uint16V(v map[uint32]uint16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uint32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint32Uint32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint32Uint32V(rv2i(rv).(map[uint32]uint32), e) +} +func (_ fastpathT) EncMapUint32Uint32V(v map[uint32]uint32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uint32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint32Uint64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint32Uint64V(rv2i(rv).(map[uint32]uint64), e) +} +func (_ fastpathT) EncMapUint32Uint64V(v map[uint32]uint64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uint32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint32UintptrR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint32UintptrV(rv2i(rv).(map[uint32]uintptr), e) +} +func (_ fastpathT) EncMapUint32UintptrV(v map[uint32]uintptr, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[uint32(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint32IntR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint32IntV(rv2i(rv).(map[uint32]int), e) +} +func (_ fastpathT) EncMapUint32IntV(v map[uint32]int, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uint32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint32Int8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint32Int8V(rv2i(rv).(map[uint32]int8), e) +} +func (_ fastpathT) EncMapUint32Int8V(v map[uint32]int8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uint32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint32Int16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint32Int16V(rv2i(rv).(map[uint32]int16), e) +} +func (_ fastpathT) EncMapUint32Int16V(v map[uint32]int16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uint32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint32Int32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint32Int32V(rv2i(rv).(map[uint32]int32), e) +} +func (_ fastpathT) EncMapUint32Int32V(v map[uint32]int32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uint32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint32Int64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint32Int64V(rv2i(rv).(map[uint32]int64), e) +} +func (_ fastpathT) EncMapUint32Int64V(v map[uint32]int64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uint32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint32Float32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint32Float32V(rv2i(rv).(map[uint32]float32), e) +} +func (_ fastpathT) EncMapUint32Float32V(v map[uint32]float32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v[uint32(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint32Float64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint32Float64V(rv2i(rv).(map[uint32]float64), e) +} +func (_ fastpathT) EncMapUint32Float64V(v map[uint32]float64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v[uint32(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint32BoolR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint32BoolV(rv2i(rv).(map[uint32]bool), e) +} +func (_ fastpathT) EncMapUint32BoolV(v map[uint32]bool, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v[uint32(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint64IntfR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint64IntfV(rv2i(rv).(map[uint64]interface{}), e) +} +func (_ fastpathT) EncMapUint64IntfV(v map[uint64]interface{}, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[uint64(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint64StringR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint64StringV(rv2i(rv).(map[uint64]string), e) +} +func (_ fastpathT) EncMapUint64StringV(v map[uint64]string, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[uint64(k2)])) + } else { + ee.EncodeStringEnc(cUTF8, v[uint64(k2)]) + } + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { + ee.EncodeStringEnc(cUTF8, v2) + } + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint64UintR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint64UintV(rv2i(rv).(map[uint64]uint), e) +} +func (_ fastpathT) EncMapUint64UintV(v map[uint64]uint, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uint64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint64Uint8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint64Uint8V(rv2i(rv).(map[uint64]uint8), e) +} +func (_ fastpathT) EncMapUint64Uint8V(v map[uint64]uint8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uint64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint64Uint16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint64Uint16V(rv2i(rv).(map[uint64]uint16), e) +} +func (_ fastpathT) EncMapUint64Uint16V(v map[uint64]uint16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uint64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint64Uint32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint64Uint32V(rv2i(rv).(map[uint64]uint32), e) +} +func (_ fastpathT) EncMapUint64Uint32V(v map[uint64]uint32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uint64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint64Uint64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint64Uint64V(rv2i(rv).(map[uint64]uint64), e) +} +func (_ fastpathT) EncMapUint64Uint64V(v map[uint64]uint64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uint64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint64UintptrR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint64UintptrV(rv2i(rv).(map[uint64]uintptr), e) +} +func (_ fastpathT) EncMapUint64UintptrV(v map[uint64]uintptr, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[uint64(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint64IntR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint64IntV(rv2i(rv).(map[uint64]int), e) +} +func (_ fastpathT) EncMapUint64IntV(v map[uint64]int, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uint64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint64Int8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint64Int8V(rv2i(rv).(map[uint64]int8), e) +} +func (_ fastpathT) EncMapUint64Int8V(v map[uint64]int8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uint64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint64Int16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint64Int16V(rv2i(rv).(map[uint64]int16), e) +} +func (_ fastpathT) EncMapUint64Int16V(v map[uint64]int16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uint64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint64Int32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint64Int32V(rv2i(rv).(map[uint64]int32), e) +} +func (_ fastpathT) EncMapUint64Int32V(v map[uint64]int32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uint64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint64Int64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint64Int64V(rv2i(rv).(map[uint64]int64), e) +} +func (_ fastpathT) EncMapUint64Int64V(v map[uint64]int64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uint64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint64Float32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint64Float32V(rv2i(rv).(map[uint64]float32), e) +} +func (_ fastpathT) EncMapUint64Float32V(v map[uint64]float32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v[uint64(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint64Float64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint64Float64V(rv2i(rv).(map[uint64]float64), e) +} +func (_ fastpathT) EncMapUint64Float64V(v map[uint64]float64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v[uint64(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUint64BoolR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUint64BoolV(rv2i(rv).(map[uint64]bool), e) +} +func (_ fastpathT) EncMapUint64BoolV(v map[uint64]bool, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v[uint64(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintptrIntfR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintptrIntfV(rv2i(rv).(map[uintptr]interface{}), e) +} +func (_ fastpathT) EncMapUintptrIntfV(v map[uintptr]interface{}, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[uintptr(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintptrStringR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintptrStringV(rv2i(rv).(map[uintptr]string), e) +} +func (_ fastpathT) EncMapUintptrStringV(v map[uintptr]string, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[uintptr(k2)])) + } else { + ee.EncodeStringEnc(cUTF8, v[uintptr(k2)]) + } + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { + ee.EncodeStringEnc(cUTF8, v2) + } + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintptrUintR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintptrUintV(rv2i(rv).(map[uintptr]uint), e) +} +func (_ fastpathT) EncMapUintptrUintV(v map[uintptr]uint, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uintptr(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintptrUint8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintptrUint8V(rv2i(rv).(map[uintptr]uint8), e) +} +func (_ fastpathT) EncMapUintptrUint8V(v map[uintptr]uint8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uintptr(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintptrUint16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintptrUint16V(rv2i(rv).(map[uintptr]uint16), e) +} +func (_ fastpathT) EncMapUintptrUint16V(v map[uintptr]uint16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uintptr(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintptrUint32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintptrUint32V(rv2i(rv).(map[uintptr]uint32), e) +} +func (_ fastpathT) EncMapUintptrUint32V(v map[uintptr]uint32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uintptr(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintptrUint64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintptrUint64V(rv2i(rv).(map[uintptr]uint64), e) +} +func (_ fastpathT) EncMapUintptrUint64V(v map[uintptr]uint64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[uintptr(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintptrUintptrR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintptrUintptrV(rv2i(rv).(map[uintptr]uintptr), e) +} +func (_ fastpathT) EncMapUintptrUintptrV(v map[uintptr]uintptr, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[uintptr(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintptrIntR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintptrIntV(rv2i(rv).(map[uintptr]int), e) +} +func (_ fastpathT) EncMapUintptrIntV(v map[uintptr]int, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uintptr(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintptrInt8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintptrInt8V(rv2i(rv).(map[uintptr]int8), e) +} +func (_ fastpathT) EncMapUintptrInt8V(v map[uintptr]int8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uintptr(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintptrInt16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintptrInt16V(rv2i(rv).(map[uintptr]int16), e) +} +func (_ fastpathT) EncMapUintptrInt16V(v map[uintptr]int16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uintptr(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintptrInt32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintptrInt32V(rv2i(rv).(map[uintptr]int32), e) +} +func (_ fastpathT) EncMapUintptrInt32V(v map[uintptr]int32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uintptr(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintptrInt64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintptrInt64V(rv2i(rv).(map[uintptr]int64), e) +} +func (_ fastpathT) EncMapUintptrInt64V(v map[uintptr]int64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[uintptr(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintptrFloat32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintptrFloat32V(rv2i(rv).(map[uintptr]float32), e) +} +func (_ fastpathT) EncMapUintptrFloat32V(v map[uintptr]float32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v[uintptr(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintptrFloat64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintptrFloat64V(rv2i(rv).(map[uintptr]float64), e) +} +func (_ fastpathT) EncMapUintptrFloat64V(v map[uintptr]float64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v[uintptr(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapUintptrBoolR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapUintptrBoolV(rv2i(rv).(map[uintptr]bool), e) +} +func (_ fastpathT) EncMapUintptrBoolV(v map[uintptr]bool, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]uint64, len(v)) + var i uint + for k := range v { + v2[i] = uint64(k) + i++ + } + sort.Sort(uintSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v[uintptr(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntIntfR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntIntfV(rv2i(rv).(map[int]interface{}), e) +} +func (_ fastpathT) EncMapIntIntfV(v map[int]interface{}, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[int(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntStringR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntStringV(rv2i(rv).(map[int]string), e) +} +func (_ fastpathT) EncMapIntStringV(v map[int]string, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[int(k2)])) + } else { + ee.EncodeStringEnc(cUTF8, v[int(k2)]) + } + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { + ee.EncodeStringEnc(cUTF8, v2) + } + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntUintR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntUintV(rv2i(rv).(map[int]uint), e) +} +func (_ fastpathT) EncMapIntUintV(v map[int]uint, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[int(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntUint8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntUint8V(rv2i(rv).(map[int]uint8), e) +} +func (_ fastpathT) EncMapIntUint8V(v map[int]uint8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[int(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntUint16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntUint16V(rv2i(rv).(map[int]uint16), e) +} +func (_ fastpathT) EncMapIntUint16V(v map[int]uint16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[int(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntUint32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntUint32V(rv2i(rv).(map[int]uint32), e) +} +func (_ fastpathT) EncMapIntUint32V(v map[int]uint32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[int(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntUint64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntUint64V(rv2i(rv).(map[int]uint64), e) +} +func (_ fastpathT) EncMapIntUint64V(v map[int]uint64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[int(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntUintptrR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntUintptrV(rv2i(rv).(map[int]uintptr), e) +} +func (_ fastpathT) EncMapIntUintptrV(v map[int]uintptr, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[int(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntIntR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntIntV(rv2i(rv).(map[int]int), e) +} +func (_ fastpathT) EncMapIntIntV(v map[int]int, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[int(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntInt8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntInt8V(rv2i(rv).(map[int]int8), e) +} +func (_ fastpathT) EncMapIntInt8V(v map[int]int8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[int(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntInt16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntInt16V(rv2i(rv).(map[int]int16), e) +} +func (_ fastpathT) EncMapIntInt16V(v map[int]int16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[int(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntInt32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntInt32V(rv2i(rv).(map[int]int32), e) +} +func (_ fastpathT) EncMapIntInt32V(v map[int]int32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[int(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntInt64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntInt64V(rv2i(rv).(map[int]int64), e) +} +func (_ fastpathT) EncMapIntInt64V(v map[int]int64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[int(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntFloat32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntFloat32V(rv2i(rv).(map[int]float32), e) +} +func (_ fastpathT) EncMapIntFloat32V(v map[int]float32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v[int(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntFloat64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntFloat64V(rv2i(rv).(map[int]float64), e) +} +func (_ fastpathT) EncMapIntFloat64V(v map[int]float64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v[int(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapIntBoolR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapIntBoolV(rv2i(rv).(map[int]bool), e) +} +func (_ fastpathT) EncMapIntBoolV(v map[int]bool, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v[int(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt8IntfR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt8IntfV(rv2i(rv).(map[int8]interface{}), e) +} +func (_ fastpathT) EncMapInt8IntfV(v map[int8]interface{}, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[int8(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt8StringR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt8StringV(rv2i(rv).(map[int8]string), e) +} +func (_ fastpathT) EncMapInt8StringV(v map[int8]string, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[int8(k2)])) + } else { + ee.EncodeStringEnc(cUTF8, v[int8(k2)]) + } + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { + ee.EncodeStringEnc(cUTF8, v2) + } + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt8UintR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt8UintV(rv2i(rv).(map[int8]uint), e) +} +func (_ fastpathT) EncMapInt8UintV(v map[int8]uint, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[int8(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt8Uint8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt8Uint8V(rv2i(rv).(map[int8]uint8), e) +} +func (_ fastpathT) EncMapInt8Uint8V(v map[int8]uint8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[int8(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt8Uint16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt8Uint16V(rv2i(rv).(map[int8]uint16), e) +} +func (_ fastpathT) EncMapInt8Uint16V(v map[int8]uint16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[int8(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt8Uint32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt8Uint32V(rv2i(rv).(map[int8]uint32), e) +} +func (_ fastpathT) EncMapInt8Uint32V(v map[int8]uint32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[int8(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt8Uint64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt8Uint64V(rv2i(rv).(map[int8]uint64), e) +} +func (_ fastpathT) EncMapInt8Uint64V(v map[int8]uint64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[int8(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt8UintptrR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt8UintptrV(rv2i(rv).(map[int8]uintptr), e) +} +func (_ fastpathT) EncMapInt8UintptrV(v map[int8]uintptr, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[int8(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt8IntR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt8IntV(rv2i(rv).(map[int8]int), e) +} +func (_ fastpathT) EncMapInt8IntV(v map[int8]int, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[int8(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt8Int8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt8Int8V(rv2i(rv).(map[int8]int8), e) +} +func (_ fastpathT) EncMapInt8Int8V(v map[int8]int8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[int8(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt8Int16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt8Int16V(rv2i(rv).(map[int8]int16), e) +} +func (_ fastpathT) EncMapInt8Int16V(v map[int8]int16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[int8(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt8Int32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt8Int32V(rv2i(rv).(map[int8]int32), e) +} +func (_ fastpathT) EncMapInt8Int32V(v map[int8]int32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[int8(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt8Int64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt8Int64V(rv2i(rv).(map[int8]int64), e) +} +func (_ fastpathT) EncMapInt8Int64V(v map[int8]int64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[int8(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt8Float32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt8Float32V(rv2i(rv).(map[int8]float32), e) +} +func (_ fastpathT) EncMapInt8Float32V(v map[int8]float32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v[int8(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt8Float64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt8Float64V(rv2i(rv).(map[int8]float64), e) +} +func (_ fastpathT) EncMapInt8Float64V(v map[int8]float64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v[int8(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt8BoolR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt8BoolV(rv2i(rv).(map[int8]bool), e) +} +func (_ fastpathT) EncMapInt8BoolV(v map[int8]bool, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v[int8(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt16IntfR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt16IntfV(rv2i(rv).(map[int16]interface{}), e) +} +func (_ fastpathT) EncMapInt16IntfV(v map[int16]interface{}, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[int16(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt16StringR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt16StringV(rv2i(rv).(map[int16]string), e) +} +func (_ fastpathT) EncMapInt16StringV(v map[int16]string, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[int16(k2)])) + } else { + ee.EncodeStringEnc(cUTF8, v[int16(k2)]) + } + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { + ee.EncodeStringEnc(cUTF8, v2) + } + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt16UintR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt16UintV(rv2i(rv).(map[int16]uint), e) +} +func (_ fastpathT) EncMapInt16UintV(v map[int16]uint, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[int16(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt16Uint8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt16Uint8V(rv2i(rv).(map[int16]uint8), e) +} +func (_ fastpathT) EncMapInt16Uint8V(v map[int16]uint8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[int16(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt16Uint16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt16Uint16V(rv2i(rv).(map[int16]uint16), e) +} +func (_ fastpathT) EncMapInt16Uint16V(v map[int16]uint16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[int16(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt16Uint32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt16Uint32V(rv2i(rv).(map[int16]uint32), e) +} +func (_ fastpathT) EncMapInt16Uint32V(v map[int16]uint32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[int16(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt16Uint64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt16Uint64V(rv2i(rv).(map[int16]uint64), e) +} +func (_ fastpathT) EncMapInt16Uint64V(v map[int16]uint64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[int16(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt16UintptrR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt16UintptrV(rv2i(rv).(map[int16]uintptr), e) +} +func (_ fastpathT) EncMapInt16UintptrV(v map[int16]uintptr, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[int16(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt16IntR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt16IntV(rv2i(rv).(map[int16]int), e) +} +func (_ fastpathT) EncMapInt16IntV(v map[int16]int, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[int16(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt16Int8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt16Int8V(rv2i(rv).(map[int16]int8), e) +} +func (_ fastpathT) EncMapInt16Int8V(v map[int16]int8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[int16(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt16Int16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt16Int16V(rv2i(rv).(map[int16]int16), e) +} +func (_ fastpathT) EncMapInt16Int16V(v map[int16]int16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[int16(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt16Int32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt16Int32V(rv2i(rv).(map[int16]int32), e) +} +func (_ fastpathT) EncMapInt16Int32V(v map[int16]int32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[int16(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt16Int64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt16Int64V(rv2i(rv).(map[int16]int64), e) +} +func (_ fastpathT) EncMapInt16Int64V(v map[int16]int64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[int16(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt16Float32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt16Float32V(rv2i(rv).(map[int16]float32), e) +} +func (_ fastpathT) EncMapInt16Float32V(v map[int16]float32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v[int16(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt16Float64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt16Float64V(rv2i(rv).(map[int16]float64), e) +} +func (_ fastpathT) EncMapInt16Float64V(v map[int16]float64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v[int16(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt16BoolR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt16BoolV(rv2i(rv).(map[int16]bool), e) +} +func (_ fastpathT) EncMapInt16BoolV(v map[int16]bool, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v[int16(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt32IntfR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt32IntfV(rv2i(rv).(map[int32]interface{}), e) +} +func (_ fastpathT) EncMapInt32IntfV(v map[int32]interface{}, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[int32(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt32StringR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt32StringV(rv2i(rv).(map[int32]string), e) +} +func (_ fastpathT) EncMapInt32StringV(v map[int32]string, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[int32(k2)])) + } else { + ee.EncodeStringEnc(cUTF8, v[int32(k2)]) + } + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { + ee.EncodeStringEnc(cUTF8, v2) + } + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt32UintR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt32UintV(rv2i(rv).(map[int32]uint), e) +} +func (_ fastpathT) EncMapInt32UintV(v map[int32]uint, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[int32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt32Uint8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt32Uint8V(rv2i(rv).(map[int32]uint8), e) +} +func (_ fastpathT) EncMapInt32Uint8V(v map[int32]uint8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[int32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt32Uint16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt32Uint16V(rv2i(rv).(map[int32]uint16), e) +} +func (_ fastpathT) EncMapInt32Uint16V(v map[int32]uint16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[int32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt32Uint32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt32Uint32V(rv2i(rv).(map[int32]uint32), e) +} +func (_ fastpathT) EncMapInt32Uint32V(v map[int32]uint32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[int32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt32Uint64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt32Uint64V(rv2i(rv).(map[int32]uint64), e) +} +func (_ fastpathT) EncMapInt32Uint64V(v map[int32]uint64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[int32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt32UintptrR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt32UintptrV(rv2i(rv).(map[int32]uintptr), e) +} +func (_ fastpathT) EncMapInt32UintptrV(v map[int32]uintptr, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[int32(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt32IntR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt32IntV(rv2i(rv).(map[int32]int), e) +} +func (_ fastpathT) EncMapInt32IntV(v map[int32]int, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[int32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt32Int8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt32Int8V(rv2i(rv).(map[int32]int8), e) +} +func (_ fastpathT) EncMapInt32Int8V(v map[int32]int8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[int32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt32Int16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt32Int16V(rv2i(rv).(map[int32]int16), e) +} +func (_ fastpathT) EncMapInt32Int16V(v map[int32]int16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[int32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt32Int32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt32Int32V(rv2i(rv).(map[int32]int32), e) +} +func (_ fastpathT) EncMapInt32Int32V(v map[int32]int32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[int32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt32Int64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt32Int64V(rv2i(rv).(map[int32]int64), e) +} +func (_ fastpathT) EncMapInt32Int64V(v map[int32]int64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[int32(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt32Float32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt32Float32V(rv2i(rv).(map[int32]float32), e) +} +func (_ fastpathT) EncMapInt32Float32V(v map[int32]float32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v[int32(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt32Float64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt32Float64V(rv2i(rv).(map[int32]float64), e) +} +func (_ fastpathT) EncMapInt32Float64V(v map[int32]float64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v[int32(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt32BoolR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt32BoolV(rv2i(rv).(map[int32]bool), e) +} +func (_ fastpathT) EncMapInt32BoolV(v map[int32]bool, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v[int32(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt64IntfR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt64IntfV(rv2i(rv).(map[int64]interface{}), e) +} +func (_ fastpathT) EncMapInt64IntfV(v map[int64]interface{}, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[int64(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt64StringR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt64StringV(rv2i(rv).(map[int64]string), e) +} +func (_ fastpathT) EncMapInt64StringV(v map[int64]string, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[int64(k2)])) + } else { + ee.EncodeStringEnc(cUTF8, v[int64(k2)]) + } + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { + ee.EncodeStringEnc(cUTF8, v2) + } + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt64UintR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt64UintV(rv2i(rv).(map[int64]uint), e) +} +func (_ fastpathT) EncMapInt64UintV(v map[int64]uint, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[int64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt64Uint8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt64Uint8V(rv2i(rv).(map[int64]uint8), e) +} +func (_ fastpathT) EncMapInt64Uint8V(v map[int64]uint8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[int64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt64Uint16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt64Uint16V(rv2i(rv).(map[int64]uint16), e) +} +func (_ fastpathT) EncMapInt64Uint16V(v map[int64]uint16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[int64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt64Uint32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt64Uint32V(rv2i(rv).(map[int64]uint32), e) +} +func (_ fastpathT) EncMapInt64Uint32V(v map[int64]uint32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[int64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt64Uint64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt64Uint64V(rv2i(rv).(map[int64]uint64), e) +} +func (_ fastpathT) EncMapInt64Uint64V(v map[int64]uint64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[int64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt64UintptrR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt64UintptrV(rv2i(rv).(map[int64]uintptr), e) +} +func (_ fastpathT) EncMapInt64UintptrV(v map[int64]uintptr, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[int64(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt64IntR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt64IntV(rv2i(rv).(map[int64]int), e) +} +func (_ fastpathT) EncMapInt64IntV(v map[int64]int, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[int64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt64Int8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt64Int8V(rv2i(rv).(map[int64]int8), e) +} +func (_ fastpathT) EncMapInt64Int8V(v map[int64]int8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[int64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt64Int16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt64Int16V(rv2i(rv).(map[int64]int16), e) +} +func (_ fastpathT) EncMapInt64Int16V(v map[int64]int16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[int64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt64Int32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt64Int32V(rv2i(rv).(map[int64]int32), e) +} +func (_ fastpathT) EncMapInt64Int32V(v map[int64]int32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[int64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt64Int64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt64Int64V(rv2i(rv).(map[int64]int64), e) +} +func (_ fastpathT) EncMapInt64Int64V(v map[int64]int64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[int64(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt64Float32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt64Float32V(rv2i(rv).(map[int64]float32), e) +} +func (_ fastpathT) EncMapInt64Float32V(v map[int64]float32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v[int64(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt64Float64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt64Float64V(rv2i(rv).(map[int64]float64), e) +} +func (_ fastpathT) EncMapInt64Float64V(v map[int64]float64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v[int64(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapInt64BoolR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapInt64BoolV(rv2i(rv).(map[int64]bool), e) +} +func (_ fastpathT) EncMapInt64BoolV(v map[int64]bool, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]int64, len(v)) + var i uint + for k := range v { + v2[i] = int64(k) + i++ + } + sort.Sort(intSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v[int64(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapBoolIntfR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapBoolIntfV(rv2i(rv).(map[bool]interface{}), e) +} +func (_ fastpathT) EncMapBoolIntfV(v map[bool]interface{}, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i uint + for k := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[bool(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapBoolStringR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapBoolStringV(rv2i(rv).(map[bool]string), e) +} +func (_ fastpathT) EncMapBoolStringV(v map[bool]string, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i uint + for k := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[bool(k2)])) + } else { + ee.EncodeStringEnc(cUTF8, v[bool(k2)]) + } + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { + ee.EncodeStringEnc(cUTF8, v2) + } + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapBoolUintR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapBoolUintV(rv2i(rv).(map[bool]uint), e) +} +func (_ fastpathT) EncMapBoolUintV(v map[bool]uint, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i uint + for k := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[bool(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapBoolUint8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapBoolUint8V(rv2i(rv).(map[bool]uint8), e) +} +func (_ fastpathT) EncMapBoolUint8V(v map[bool]uint8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i uint + for k := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[bool(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapBoolUint16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapBoolUint16V(rv2i(rv).(map[bool]uint16), e) +} +func (_ fastpathT) EncMapBoolUint16V(v map[bool]uint16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i uint + for k := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[bool(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapBoolUint32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapBoolUint32V(rv2i(rv).(map[bool]uint32), e) +} +func (_ fastpathT) EncMapBoolUint32V(v map[bool]uint32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i uint + for k := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[bool(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapBoolUint64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapBoolUint64V(rv2i(rv).(map[bool]uint64), e) +} +func (_ fastpathT) EncMapBoolUint64V(v map[bool]uint64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i uint + for k := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[bool(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapBoolUintptrR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapBoolUintptrV(rv2i(rv).(map[bool]uintptr), e) +} +func (_ fastpathT) EncMapBoolUintptrV(v map[bool]uintptr, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i uint + for k := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() + } + e.encode(v[bool(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapBoolIntR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapBoolIntV(rv2i(rv).(map[bool]int), e) +} +func (_ fastpathT) EncMapBoolIntV(v map[bool]int, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i uint + for k := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[bool(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapBoolInt8R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapBoolInt8V(rv2i(rv).(map[bool]int8), e) +} +func (_ fastpathT) EncMapBoolInt8V(v map[bool]int8, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i uint + for k := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[bool(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapBoolInt16R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapBoolInt16V(rv2i(rv).(map[bool]int16), e) +} +func (_ fastpathT) EncMapBoolInt16V(v map[bool]int16, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i uint + for k := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[bool(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapBoolInt32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapBoolInt32V(rv2i(rv).(map[bool]int32), e) +} +func (_ fastpathT) EncMapBoolInt32V(v map[bool]int32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i uint + for k := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[bool(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapBoolInt64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapBoolInt64V(rv2i(rv).(map[bool]int64), e) +} +func (_ fastpathT) EncMapBoolInt64V(v map[bool]int64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i uint + for k := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[bool(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapBoolFloat32R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapBoolFloat32V(rv2i(rv).(map[bool]float32), e) +} +func (_ fastpathT) EncMapBoolFloat32V(v map[bool]float32, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i uint + for k := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v[bool(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapBoolFloat64R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapBoolFloat64V(rv2i(rv).(map[bool]float64), e) +} +func (_ fastpathT) EncMapBoolFloat64V(v map[bool]float64, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i uint + for k := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v[bool(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v2) + } + } + ee.WriteMapEnd() +} + +func (e *Encoder) fastpathEncMapBoolBoolR(f *codecFnInfo, rv reflect.Value) { + fastpathTV.EncMapBoolBoolV(rv2i(rv).(map[bool]bool), e) +} +func (_ fastpathT) EncMapBoolBoolV(v map[bool]bool, e *Encoder) { + if v == nil { + e.e.EncodeNil() + return + } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + if e.h.Canonical { + v2 := make([]bool, len(v)) + var i uint + for k := range v { + v2[i] = bool(k) + i++ + } + sort.Sort(boolSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v[bool(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v2) + } + } + ee.WriteMapEnd() +} + +// -- decode + +// -- -- fast path type switch +func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { + var changed bool + switch v := iv.(type) { + + case []interface{}: + var v2 []interface{} + v2, changed = fastpathTV.DecSliceIntfV(v, false, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + case *[]interface{}: + var v2 []interface{} + v2, changed = fastpathTV.DecSliceIntfV(*v, true, d) + if changed { + *v = v2 + } + case []string: + var v2 []string + v2, changed = fastpathTV.DecSliceStringV(v, false, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + case *[]string: + var v2 []string + v2, changed = fastpathTV.DecSliceStringV(*v, true, d) + if changed { + *v = v2 + } + case []float32: + var v2 []float32 + v2, changed = fastpathTV.DecSliceFloat32V(v, false, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + case *[]float32: + var v2 []float32 + v2, changed = fastpathTV.DecSliceFloat32V(*v, true, d) + if changed { + *v = v2 + } + case []float64: + var v2 []float64 + v2, changed = fastpathTV.DecSliceFloat64V(v, false, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + case *[]float64: + var v2 []float64 + v2, changed = fastpathTV.DecSliceFloat64V(*v, true, d) + if changed { + *v = v2 + } + case []uint: + var v2 []uint + v2, changed = fastpathTV.DecSliceUintV(v, false, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + case *[]uint: + var v2 []uint + v2, changed = fastpathTV.DecSliceUintV(*v, true, d) + if changed { + *v = v2 + } + case []uint16: + var v2 []uint16 + v2, changed = fastpathTV.DecSliceUint16V(v, false, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + case *[]uint16: + var v2 []uint16 + v2, changed = fastpathTV.DecSliceUint16V(*v, true, d) + if changed { + *v = v2 + } + case []uint32: + var v2 []uint32 + v2, changed = fastpathTV.DecSliceUint32V(v, false, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + case *[]uint32: + var v2 []uint32 + v2, changed = fastpathTV.DecSliceUint32V(*v, true, d) + if changed { + *v = v2 + } + case []uint64: + var v2 []uint64 + v2, changed = fastpathTV.DecSliceUint64V(v, false, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + case *[]uint64: + var v2 []uint64 + v2, changed = fastpathTV.DecSliceUint64V(*v, true, d) + if changed { + *v = v2 + } + case []uintptr: + var v2 []uintptr + v2, changed = fastpathTV.DecSliceUintptrV(v, false, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + case *[]uintptr: + var v2 []uintptr + v2, changed = fastpathTV.DecSliceUintptrV(*v, true, d) + if changed { + *v = v2 + } + case []int: + var v2 []int + v2, changed = fastpathTV.DecSliceIntV(v, false, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + case *[]int: + var v2 []int + v2, changed = fastpathTV.DecSliceIntV(*v, true, d) + if changed { + *v = v2 + } + case []int8: + var v2 []int8 + v2, changed = fastpathTV.DecSliceInt8V(v, false, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + case *[]int8: + var v2 []int8 + v2, changed = fastpathTV.DecSliceInt8V(*v, true, d) + if changed { + *v = v2 + } + case []int16: + var v2 []int16 + v2, changed = fastpathTV.DecSliceInt16V(v, false, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + case *[]int16: + var v2 []int16 + v2, changed = fastpathTV.DecSliceInt16V(*v, true, d) + if changed { + *v = v2 + } + case []int32: + var v2 []int32 + v2, changed = fastpathTV.DecSliceInt32V(v, false, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + case *[]int32: + var v2 []int32 + v2, changed = fastpathTV.DecSliceInt32V(*v, true, d) + if changed { + *v = v2 + } + case []int64: + var v2 []int64 + v2, changed = fastpathTV.DecSliceInt64V(v, false, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + case *[]int64: + var v2 []int64 + v2, changed = fastpathTV.DecSliceInt64V(*v, true, d) + if changed { + *v = v2 + } + case []bool: + var v2 []bool + v2, changed = fastpathTV.DecSliceBoolV(v, false, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + case *[]bool: + var v2 []bool + v2, changed = fastpathTV.DecSliceBoolV(*v, true, d) + if changed { + *v = v2 + } + + case map[interface{}]interface{}: + fastpathTV.DecMapIntfIntfV(v, false, d) + case *map[interface{}]interface{}: + var v2 map[interface{}]interface{} + v2, changed = fastpathTV.DecMapIntfIntfV(*v, true, d) + if changed { + *v = v2 + } + case map[interface{}]string: + fastpathTV.DecMapIntfStringV(v, false, d) + case *map[interface{}]string: + var v2 map[interface{}]string + v2, changed = fastpathTV.DecMapIntfStringV(*v, true, d) + if changed { + *v = v2 + } + case map[interface{}]uint: + fastpathTV.DecMapIntfUintV(v, false, d) + case *map[interface{}]uint: + var v2 map[interface{}]uint + v2, changed = fastpathTV.DecMapIntfUintV(*v, true, d) + if changed { + *v = v2 + } + case map[interface{}]uint8: + fastpathTV.DecMapIntfUint8V(v, false, d) + case *map[interface{}]uint8: + var v2 map[interface{}]uint8 + v2, changed = fastpathTV.DecMapIntfUint8V(*v, true, d) + if changed { + *v = v2 + } + case map[interface{}]uint16: + fastpathTV.DecMapIntfUint16V(v, false, d) + case *map[interface{}]uint16: + var v2 map[interface{}]uint16 + v2, changed = fastpathTV.DecMapIntfUint16V(*v, true, d) + if changed { + *v = v2 + } + case map[interface{}]uint32: + fastpathTV.DecMapIntfUint32V(v, false, d) + case *map[interface{}]uint32: + var v2 map[interface{}]uint32 + v2, changed = fastpathTV.DecMapIntfUint32V(*v, true, d) + if changed { + *v = v2 + } + case map[interface{}]uint64: + fastpathTV.DecMapIntfUint64V(v, false, d) + case *map[interface{}]uint64: + var v2 map[interface{}]uint64 + v2, changed = fastpathTV.DecMapIntfUint64V(*v, true, d) + if changed { + *v = v2 + } + case map[interface{}]uintptr: + fastpathTV.DecMapIntfUintptrV(v, false, d) + case *map[interface{}]uintptr: + var v2 map[interface{}]uintptr + v2, changed = fastpathTV.DecMapIntfUintptrV(*v, true, d) + if changed { + *v = v2 + } + case map[interface{}]int: + fastpathTV.DecMapIntfIntV(v, false, d) + case *map[interface{}]int: + var v2 map[interface{}]int + v2, changed = fastpathTV.DecMapIntfIntV(*v, true, d) + if changed { + *v = v2 + } + case map[interface{}]int8: + fastpathTV.DecMapIntfInt8V(v, false, d) + case *map[interface{}]int8: + var v2 map[interface{}]int8 + v2, changed = fastpathTV.DecMapIntfInt8V(*v, true, d) + if changed { + *v = v2 + } + case map[interface{}]int16: + fastpathTV.DecMapIntfInt16V(v, false, d) + case *map[interface{}]int16: + var v2 map[interface{}]int16 + v2, changed = fastpathTV.DecMapIntfInt16V(*v, true, d) + if changed { + *v = v2 + } + case map[interface{}]int32: + fastpathTV.DecMapIntfInt32V(v, false, d) + case *map[interface{}]int32: + var v2 map[interface{}]int32 + v2, changed = fastpathTV.DecMapIntfInt32V(*v, true, d) + if changed { + *v = v2 + } + case map[interface{}]int64: + fastpathTV.DecMapIntfInt64V(v, false, d) + case *map[interface{}]int64: + var v2 map[interface{}]int64 + v2, changed = fastpathTV.DecMapIntfInt64V(*v, true, d) + if changed { + *v = v2 + } + case map[interface{}]float32: + fastpathTV.DecMapIntfFloat32V(v, false, d) + case *map[interface{}]float32: + var v2 map[interface{}]float32 + v2, changed = fastpathTV.DecMapIntfFloat32V(*v, true, d) + if changed { + *v = v2 + } + case map[interface{}]float64: + fastpathTV.DecMapIntfFloat64V(v, false, d) + case *map[interface{}]float64: + var v2 map[interface{}]float64 + v2, changed = fastpathTV.DecMapIntfFloat64V(*v, true, d) + if changed { + *v = v2 + } + case map[interface{}]bool: + fastpathTV.DecMapIntfBoolV(v, false, d) + case *map[interface{}]bool: + var v2 map[interface{}]bool + v2, changed = fastpathTV.DecMapIntfBoolV(*v, true, d) + if changed { + *v = v2 + } + case map[string]interface{}: + fastpathTV.DecMapStringIntfV(v, false, d) + case *map[string]interface{}: + var v2 map[string]interface{} + v2, changed = fastpathTV.DecMapStringIntfV(*v, true, d) + if changed { + *v = v2 + } + case map[string]string: + fastpathTV.DecMapStringStringV(v, false, d) + case *map[string]string: + var v2 map[string]string + v2, changed = fastpathTV.DecMapStringStringV(*v, true, d) + if changed { + *v = v2 + } + case map[string]uint: + fastpathTV.DecMapStringUintV(v, false, d) + case *map[string]uint: + var v2 map[string]uint + v2, changed = fastpathTV.DecMapStringUintV(*v, true, d) + if changed { + *v = v2 + } + case map[string]uint8: + fastpathTV.DecMapStringUint8V(v, false, d) + case *map[string]uint8: + var v2 map[string]uint8 + v2, changed = fastpathTV.DecMapStringUint8V(*v, true, d) + if changed { + *v = v2 + } + case map[string]uint16: + fastpathTV.DecMapStringUint16V(v, false, d) + case *map[string]uint16: + var v2 map[string]uint16 + v2, changed = fastpathTV.DecMapStringUint16V(*v, true, d) + if changed { + *v = v2 + } + case map[string]uint32: + fastpathTV.DecMapStringUint32V(v, false, d) + case *map[string]uint32: + var v2 map[string]uint32 + v2, changed = fastpathTV.DecMapStringUint32V(*v, true, d) + if changed { + *v = v2 + } + case map[string]uint64: + fastpathTV.DecMapStringUint64V(v, false, d) + case *map[string]uint64: + var v2 map[string]uint64 + v2, changed = fastpathTV.DecMapStringUint64V(*v, true, d) + if changed { + *v = v2 + } + case map[string]uintptr: + fastpathTV.DecMapStringUintptrV(v, false, d) + case *map[string]uintptr: + var v2 map[string]uintptr + v2, changed = fastpathTV.DecMapStringUintptrV(*v, true, d) + if changed { + *v = v2 + } + case map[string]int: + fastpathTV.DecMapStringIntV(v, false, d) + case *map[string]int: + var v2 map[string]int + v2, changed = fastpathTV.DecMapStringIntV(*v, true, d) + if changed { + *v = v2 + } + case map[string]int8: + fastpathTV.DecMapStringInt8V(v, false, d) + case *map[string]int8: + var v2 map[string]int8 + v2, changed = fastpathTV.DecMapStringInt8V(*v, true, d) + if changed { + *v = v2 + } + case map[string]int16: + fastpathTV.DecMapStringInt16V(v, false, d) + case *map[string]int16: + var v2 map[string]int16 + v2, changed = fastpathTV.DecMapStringInt16V(*v, true, d) + if changed { + *v = v2 + } + case map[string]int32: + fastpathTV.DecMapStringInt32V(v, false, d) + case *map[string]int32: + var v2 map[string]int32 + v2, changed = fastpathTV.DecMapStringInt32V(*v, true, d) + if changed { + *v = v2 + } + case map[string]int64: + fastpathTV.DecMapStringInt64V(v, false, d) + case *map[string]int64: + var v2 map[string]int64 + v2, changed = fastpathTV.DecMapStringInt64V(*v, true, d) + if changed { + *v = v2 + } + case map[string]float32: + fastpathTV.DecMapStringFloat32V(v, false, d) + case *map[string]float32: + var v2 map[string]float32 + v2, changed = fastpathTV.DecMapStringFloat32V(*v, true, d) + if changed { + *v = v2 + } + case map[string]float64: + fastpathTV.DecMapStringFloat64V(v, false, d) + case *map[string]float64: + var v2 map[string]float64 + v2, changed = fastpathTV.DecMapStringFloat64V(*v, true, d) + if changed { + *v = v2 + } + case map[string]bool: + fastpathTV.DecMapStringBoolV(v, false, d) + case *map[string]bool: + var v2 map[string]bool + v2, changed = fastpathTV.DecMapStringBoolV(*v, true, d) + if changed { + *v = v2 + } + case map[float32]interface{}: + fastpathTV.DecMapFloat32IntfV(v, false, d) + case *map[float32]interface{}: + var v2 map[float32]interface{} + v2, changed = fastpathTV.DecMapFloat32IntfV(*v, true, d) + if changed { + *v = v2 + } + case map[float32]string: + fastpathTV.DecMapFloat32StringV(v, false, d) + case *map[float32]string: + var v2 map[float32]string + v2, changed = fastpathTV.DecMapFloat32StringV(*v, true, d) + if changed { + *v = v2 + } + case map[float32]uint: + fastpathTV.DecMapFloat32UintV(v, false, d) + case *map[float32]uint: + var v2 map[float32]uint + v2, changed = fastpathTV.DecMapFloat32UintV(*v, true, d) + if changed { + *v = v2 + } + case map[float32]uint8: + fastpathTV.DecMapFloat32Uint8V(v, false, d) + case *map[float32]uint8: + var v2 map[float32]uint8 + v2, changed = fastpathTV.DecMapFloat32Uint8V(*v, true, d) + if changed { + *v = v2 + } + case map[float32]uint16: + fastpathTV.DecMapFloat32Uint16V(v, false, d) + case *map[float32]uint16: + var v2 map[float32]uint16 + v2, changed = fastpathTV.DecMapFloat32Uint16V(*v, true, d) + if changed { + *v = v2 + } + case map[float32]uint32: + fastpathTV.DecMapFloat32Uint32V(v, false, d) + case *map[float32]uint32: + var v2 map[float32]uint32 + v2, changed = fastpathTV.DecMapFloat32Uint32V(*v, true, d) + if changed { + *v = v2 + } + case map[float32]uint64: + fastpathTV.DecMapFloat32Uint64V(v, false, d) + case *map[float32]uint64: + var v2 map[float32]uint64 + v2, changed = fastpathTV.DecMapFloat32Uint64V(*v, true, d) + if changed { + *v = v2 + } + case map[float32]uintptr: + fastpathTV.DecMapFloat32UintptrV(v, false, d) + case *map[float32]uintptr: + var v2 map[float32]uintptr + v2, changed = fastpathTV.DecMapFloat32UintptrV(*v, true, d) + if changed { + *v = v2 + } + case map[float32]int: + fastpathTV.DecMapFloat32IntV(v, false, d) + case *map[float32]int: + var v2 map[float32]int + v2, changed = fastpathTV.DecMapFloat32IntV(*v, true, d) + if changed { + *v = v2 + } + case map[float32]int8: + fastpathTV.DecMapFloat32Int8V(v, false, d) + case *map[float32]int8: + var v2 map[float32]int8 + v2, changed = fastpathTV.DecMapFloat32Int8V(*v, true, d) + if changed { + *v = v2 + } + case map[float32]int16: + fastpathTV.DecMapFloat32Int16V(v, false, d) + case *map[float32]int16: + var v2 map[float32]int16 + v2, changed = fastpathTV.DecMapFloat32Int16V(*v, true, d) + if changed { + *v = v2 + } + case map[float32]int32: + fastpathTV.DecMapFloat32Int32V(v, false, d) + case *map[float32]int32: + var v2 map[float32]int32 + v2, changed = fastpathTV.DecMapFloat32Int32V(*v, true, d) + if changed { + *v = v2 + } + case map[float32]int64: + fastpathTV.DecMapFloat32Int64V(v, false, d) + case *map[float32]int64: + var v2 map[float32]int64 + v2, changed = fastpathTV.DecMapFloat32Int64V(*v, true, d) + if changed { + *v = v2 + } + case map[float32]float32: + fastpathTV.DecMapFloat32Float32V(v, false, d) + case *map[float32]float32: + var v2 map[float32]float32 + v2, changed = fastpathTV.DecMapFloat32Float32V(*v, true, d) + if changed { + *v = v2 + } + case map[float32]float64: + fastpathTV.DecMapFloat32Float64V(v, false, d) + case *map[float32]float64: + var v2 map[float32]float64 + v2, changed = fastpathTV.DecMapFloat32Float64V(*v, true, d) + if changed { + *v = v2 + } + case map[float32]bool: + fastpathTV.DecMapFloat32BoolV(v, false, d) + case *map[float32]bool: + var v2 map[float32]bool + v2, changed = fastpathTV.DecMapFloat32BoolV(*v, true, d) + if changed { + *v = v2 + } + case map[float64]interface{}: + fastpathTV.DecMapFloat64IntfV(v, false, d) + case *map[float64]interface{}: + var v2 map[float64]interface{} + v2, changed = fastpathTV.DecMapFloat64IntfV(*v, true, d) + if changed { + *v = v2 + } + case map[float64]string: + fastpathTV.DecMapFloat64StringV(v, false, d) + case *map[float64]string: + var v2 map[float64]string + v2, changed = fastpathTV.DecMapFloat64StringV(*v, true, d) + if changed { + *v = v2 + } + case map[float64]uint: + fastpathTV.DecMapFloat64UintV(v, false, d) + case *map[float64]uint: + var v2 map[float64]uint + v2, changed = fastpathTV.DecMapFloat64UintV(*v, true, d) + if changed { + *v = v2 + } + case map[float64]uint8: + fastpathTV.DecMapFloat64Uint8V(v, false, d) + case *map[float64]uint8: + var v2 map[float64]uint8 + v2, changed = fastpathTV.DecMapFloat64Uint8V(*v, true, d) + if changed { + *v = v2 + } + case map[float64]uint16: + fastpathTV.DecMapFloat64Uint16V(v, false, d) + case *map[float64]uint16: + var v2 map[float64]uint16 + v2, changed = fastpathTV.DecMapFloat64Uint16V(*v, true, d) + if changed { + *v = v2 + } + case map[float64]uint32: + fastpathTV.DecMapFloat64Uint32V(v, false, d) + case *map[float64]uint32: + var v2 map[float64]uint32 + v2, changed = fastpathTV.DecMapFloat64Uint32V(*v, true, d) + if changed { + *v = v2 + } + case map[float64]uint64: + fastpathTV.DecMapFloat64Uint64V(v, false, d) + case *map[float64]uint64: + var v2 map[float64]uint64 + v2, changed = fastpathTV.DecMapFloat64Uint64V(*v, true, d) + if changed { + *v = v2 + } + case map[float64]uintptr: + fastpathTV.DecMapFloat64UintptrV(v, false, d) + case *map[float64]uintptr: + var v2 map[float64]uintptr + v2, changed = fastpathTV.DecMapFloat64UintptrV(*v, true, d) + if changed { + *v = v2 + } + case map[float64]int: + fastpathTV.DecMapFloat64IntV(v, false, d) + case *map[float64]int: + var v2 map[float64]int + v2, changed = fastpathTV.DecMapFloat64IntV(*v, true, d) + if changed { + *v = v2 + } + case map[float64]int8: + fastpathTV.DecMapFloat64Int8V(v, false, d) + case *map[float64]int8: + var v2 map[float64]int8 + v2, changed = fastpathTV.DecMapFloat64Int8V(*v, true, d) + if changed { + *v = v2 + } + case map[float64]int16: + fastpathTV.DecMapFloat64Int16V(v, false, d) + case *map[float64]int16: + var v2 map[float64]int16 + v2, changed = fastpathTV.DecMapFloat64Int16V(*v, true, d) + if changed { + *v = v2 + } + case map[float64]int32: + fastpathTV.DecMapFloat64Int32V(v, false, d) + case *map[float64]int32: + var v2 map[float64]int32 + v2, changed = fastpathTV.DecMapFloat64Int32V(*v, true, d) + if changed { + *v = v2 + } + case map[float64]int64: + fastpathTV.DecMapFloat64Int64V(v, false, d) + case *map[float64]int64: + var v2 map[float64]int64 + v2, changed = fastpathTV.DecMapFloat64Int64V(*v, true, d) + if changed { + *v = v2 + } + case map[float64]float32: + fastpathTV.DecMapFloat64Float32V(v, false, d) + case *map[float64]float32: + var v2 map[float64]float32 + v2, changed = fastpathTV.DecMapFloat64Float32V(*v, true, d) + if changed { + *v = v2 + } + case map[float64]float64: + fastpathTV.DecMapFloat64Float64V(v, false, d) + case *map[float64]float64: + var v2 map[float64]float64 + v2, changed = fastpathTV.DecMapFloat64Float64V(*v, true, d) + if changed { + *v = v2 + } + case map[float64]bool: + fastpathTV.DecMapFloat64BoolV(v, false, d) + case *map[float64]bool: + var v2 map[float64]bool + v2, changed = fastpathTV.DecMapFloat64BoolV(*v, true, d) + if changed { + *v = v2 + } + case map[uint]interface{}: + fastpathTV.DecMapUintIntfV(v, false, d) + case *map[uint]interface{}: + var v2 map[uint]interface{} + v2, changed = fastpathTV.DecMapUintIntfV(*v, true, d) + if changed { + *v = v2 + } + case map[uint]string: + fastpathTV.DecMapUintStringV(v, false, d) + case *map[uint]string: + var v2 map[uint]string + v2, changed = fastpathTV.DecMapUintStringV(*v, true, d) + if changed { + *v = v2 + } + case map[uint]uint: + fastpathTV.DecMapUintUintV(v, false, d) + case *map[uint]uint: + var v2 map[uint]uint + v2, changed = fastpathTV.DecMapUintUintV(*v, true, d) + if changed { + *v = v2 + } + case map[uint]uint8: + fastpathTV.DecMapUintUint8V(v, false, d) + case *map[uint]uint8: + var v2 map[uint]uint8 + v2, changed = fastpathTV.DecMapUintUint8V(*v, true, d) + if changed { + *v = v2 + } + case map[uint]uint16: + fastpathTV.DecMapUintUint16V(v, false, d) + case *map[uint]uint16: + var v2 map[uint]uint16 + v2, changed = fastpathTV.DecMapUintUint16V(*v, true, d) + if changed { + *v = v2 + } + case map[uint]uint32: + fastpathTV.DecMapUintUint32V(v, false, d) + case *map[uint]uint32: + var v2 map[uint]uint32 + v2, changed = fastpathTV.DecMapUintUint32V(*v, true, d) + if changed { + *v = v2 + } + case map[uint]uint64: + fastpathTV.DecMapUintUint64V(v, false, d) + case *map[uint]uint64: + var v2 map[uint]uint64 + v2, changed = fastpathTV.DecMapUintUint64V(*v, true, d) + if changed { + *v = v2 + } + case map[uint]uintptr: + fastpathTV.DecMapUintUintptrV(v, false, d) + case *map[uint]uintptr: + var v2 map[uint]uintptr + v2, changed = fastpathTV.DecMapUintUintptrV(*v, true, d) + if changed { + *v = v2 + } + case map[uint]int: + fastpathTV.DecMapUintIntV(v, false, d) + case *map[uint]int: + var v2 map[uint]int + v2, changed = fastpathTV.DecMapUintIntV(*v, true, d) + if changed { + *v = v2 + } + case map[uint]int8: + fastpathTV.DecMapUintInt8V(v, false, d) + case *map[uint]int8: + var v2 map[uint]int8 + v2, changed = fastpathTV.DecMapUintInt8V(*v, true, d) + if changed { + *v = v2 + } + case map[uint]int16: + fastpathTV.DecMapUintInt16V(v, false, d) + case *map[uint]int16: + var v2 map[uint]int16 + v2, changed = fastpathTV.DecMapUintInt16V(*v, true, d) + if changed { + *v = v2 + } + case map[uint]int32: + fastpathTV.DecMapUintInt32V(v, false, d) + case *map[uint]int32: + var v2 map[uint]int32 + v2, changed = fastpathTV.DecMapUintInt32V(*v, true, d) + if changed { + *v = v2 + } + case map[uint]int64: + fastpathTV.DecMapUintInt64V(v, false, d) + case *map[uint]int64: + var v2 map[uint]int64 + v2, changed = fastpathTV.DecMapUintInt64V(*v, true, d) + if changed { + *v = v2 + } + case map[uint]float32: + fastpathTV.DecMapUintFloat32V(v, false, d) + case *map[uint]float32: + var v2 map[uint]float32 + v2, changed = fastpathTV.DecMapUintFloat32V(*v, true, d) + if changed { + *v = v2 + } + case map[uint]float64: + fastpathTV.DecMapUintFloat64V(v, false, d) + case *map[uint]float64: + var v2 map[uint]float64 + v2, changed = fastpathTV.DecMapUintFloat64V(*v, true, d) + if changed { + *v = v2 + } + case map[uint]bool: + fastpathTV.DecMapUintBoolV(v, false, d) + case *map[uint]bool: + var v2 map[uint]bool + v2, changed = fastpathTV.DecMapUintBoolV(*v, true, d) + if changed { + *v = v2 + } + case map[uint8]interface{}: + fastpathTV.DecMapUint8IntfV(v, false, d) + case *map[uint8]interface{}: + var v2 map[uint8]interface{} + v2, changed = fastpathTV.DecMapUint8IntfV(*v, true, d) + if changed { + *v = v2 + } + case map[uint8]string: + fastpathTV.DecMapUint8StringV(v, false, d) + case *map[uint8]string: + var v2 map[uint8]string + v2, changed = fastpathTV.DecMapUint8StringV(*v, true, d) + if changed { + *v = v2 + } + case map[uint8]uint: + fastpathTV.DecMapUint8UintV(v, false, d) + case *map[uint8]uint: + var v2 map[uint8]uint + v2, changed = fastpathTV.DecMapUint8UintV(*v, true, d) + if changed { + *v = v2 + } + case map[uint8]uint8: + fastpathTV.DecMapUint8Uint8V(v, false, d) + case *map[uint8]uint8: + var v2 map[uint8]uint8 + v2, changed = fastpathTV.DecMapUint8Uint8V(*v, true, d) + if changed { + *v = v2 + } + case map[uint8]uint16: + fastpathTV.DecMapUint8Uint16V(v, false, d) + case *map[uint8]uint16: + var v2 map[uint8]uint16 + v2, changed = fastpathTV.DecMapUint8Uint16V(*v, true, d) + if changed { + *v = v2 + } + case map[uint8]uint32: + fastpathTV.DecMapUint8Uint32V(v, false, d) + case *map[uint8]uint32: + var v2 map[uint8]uint32 + v2, changed = fastpathTV.DecMapUint8Uint32V(*v, true, d) + if changed { + *v = v2 + } + case map[uint8]uint64: + fastpathTV.DecMapUint8Uint64V(v, false, d) + case *map[uint8]uint64: + var v2 map[uint8]uint64 + v2, changed = fastpathTV.DecMapUint8Uint64V(*v, true, d) + if changed { + *v = v2 + } + case map[uint8]uintptr: + fastpathTV.DecMapUint8UintptrV(v, false, d) + case *map[uint8]uintptr: + var v2 map[uint8]uintptr + v2, changed = fastpathTV.DecMapUint8UintptrV(*v, true, d) + if changed { + *v = v2 + } + case map[uint8]int: + fastpathTV.DecMapUint8IntV(v, false, d) + case *map[uint8]int: + var v2 map[uint8]int + v2, changed = fastpathTV.DecMapUint8IntV(*v, true, d) + if changed { + *v = v2 + } + case map[uint8]int8: + fastpathTV.DecMapUint8Int8V(v, false, d) + case *map[uint8]int8: + var v2 map[uint8]int8 + v2, changed = fastpathTV.DecMapUint8Int8V(*v, true, d) + if changed { + *v = v2 + } + case map[uint8]int16: + fastpathTV.DecMapUint8Int16V(v, false, d) + case *map[uint8]int16: + var v2 map[uint8]int16 + v2, changed = fastpathTV.DecMapUint8Int16V(*v, true, d) + if changed { + *v = v2 + } + case map[uint8]int32: + fastpathTV.DecMapUint8Int32V(v, false, d) + case *map[uint8]int32: + var v2 map[uint8]int32 + v2, changed = fastpathTV.DecMapUint8Int32V(*v, true, d) + if changed { + *v = v2 + } + case map[uint8]int64: + fastpathTV.DecMapUint8Int64V(v, false, d) + case *map[uint8]int64: + var v2 map[uint8]int64 + v2, changed = fastpathTV.DecMapUint8Int64V(*v, true, d) + if changed { + *v = v2 + } + case map[uint8]float32: + fastpathTV.DecMapUint8Float32V(v, false, d) + case *map[uint8]float32: + var v2 map[uint8]float32 + v2, changed = fastpathTV.DecMapUint8Float32V(*v, true, d) + if changed { + *v = v2 + } + case map[uint8]float64: + fastpathTV.DecMapUint8Float64V(v, false, d) + case *map[uint8]float64: + var v2 map[uint8]float64 + v2, changed = fastpathTV.DecMapUint8Float64V(*v, true, d) + if changed { + *v = v2 + } + case map[uint8]bool: + fastpathTV.DecMapUint8BoolV(v, false, d) + case *map[uint8]bool: + var v2 map[uint8]bool + v2, changed = fastpathTV.DecMapUint8BoolV(*v, true, d) + if changed { + *v = v2 + } + case map[uint16]interface{}: + fastpathTV.DecMapUint16IntfV(v, false, d) + case *map[uint16]interface{}: + var v2 map[uint16]interface{} + v2, changed = fastpathTV.DecMapUint16IntfV(*v, true, d) + if changed { + *v = v2 + } + case map[uint16]string: + fastpathTV.DecMapUint16StringV(v, false, d) + case *map[uint16]string: + var v2 map[uint16]string + v2, changed = fastpathTV.DecMapUint16StringV(*v, true, d) + if changed { + *v = v2 + } + case map[uint16]uint: + fastpathTV.DecMapUint16UintV(v, false, d) + case *map[uint16]uint: + var v2 map[uint16]uint + v2, changed = fastpathTV.DecMapUint16UintV(*v, true, d) + if changed { + *v = v2 + } + case map[uint16]uint8: + fastpathTV.DecMapUint16Uint8V(v, false, d) + case *map[uint16]uint8: + var v2 map[uint16]uint8 + v2, changed = fastpathTV.DecMapUint16Uint8V(*v, true, d) + if changed { + *v = v2 + } + case map[uint16]uint16: + fastpathTV.DecMapUint16Uint16V(v, false, d) + case *map[uint16]uint16: + var v2 map[uint16]uint16 + v2, changed = fastpathTV.DecMapUint16Uint16V(*v, true, d) + if changed { + *v = v2 + } + case map[uint16]uint32: + fastpathTV.DecMapUint16Uint32V(v, false, d) + case *map[uint16]uint32: + var v2 map[uint16]uint32 + v2, changed = fastpathTV.DecMapUint16Uint32V(*v, true, d) + if changed { + *v = v2 + } + case map[uint16]uint64: + fastpathTV.DecMapUint16Uint64V(v, false, d) + case *map[uint16]uint64: + var v2 map[uint16]uint64 + v2, changed = fastpathTV.DecMapUint16Uint64V(*v, true, d) + if changed { + *v = v2 + } + case map[uint16]uintptr: + fastpathTV.DecMapUint16UintptrV(v, false, d) + case *map[uint16]uintptr: + var v2 map[uint16]uintptr + v2, changed = fastpathTV.DecMapUint16UintptrV(*v, true, d) + if changed { + *v = v2 + } + case map[uint16]int: + fastpathTV.DecMapUint16IntV(v, false, d) + case *map[uint16]int: + var v2 map[uint16]int + v2, changed = fastpathTV.DecMapUint16IntV(*v, true, d) + if changed { + *v = v2 + } + case map[uint16]int8: + fastpathTV.DecMapUint16Int8V(v, false, d) + case *map[uint16]int8: + var v2 map[uint16]int8 + v2, changed = fastpathTV.DecMapUint16Int8V(*v, true, d) + if changed { + *v = v2 + } + case map[uint16]int16: + fastpathTV.DecMapUint16Int16V(v, false, d) + case *map[uint16]int16: + var v2 map[uint16]int16 + v2, changed = fastpathTV.DecMapUint16Int16V(*v, true, d) + if changed { + *v = v2 + } + case map[uint16]int32: + fastpathTV.DecMapUint16Int32V(v, false, d) + case *map[uint16]int32: + var v2 map[uint16]int32 + v2, changed = fastpathTV.DecMapUint16Int32V(*v, true, d) + if changed { + *v = v2 + } + case map[uint16]int64: + fastpathTV.DecMapUint16Int64V(v, false, d) + case *map[uint16]int64: + var v2 map[uint16]int64 + v2, changed = fastpathTV.DecMapUint16Int64V(*v, true, d) + if changed { + *v = v2 + } + case map[uint16]float32: + fastpathTV.DecMapUint16Float32V(v, false, d) + case *map[uint16]float32: + var v2 map[uint16]float32 + v2, changed = fastpathTV.DecMapUint16Float32V(*v, true, d) + if changed { + *v = v2 + } + case map[uint16]float64: + fastpathTV.DecMapUint16Float64V(v, false, d) + case *map[uint16]float64: + var v2 map[uint16]float64 + v2, changed = fastpathTV.DecMapUint16Float64V(*v, true, d) + if changed { + *v = v2 + } + case map[uint16]bool: + fastpathTV.DecMapUint16BoolV(v, false, d) + case *map[uint16]bool: + var v2 map[uint16]bool + v2, changed = fastpathTV.DecMapUint16BoolV(*v, true, d) + if changed { + *v = v2 + } + case map[uint32]interface{}: + fastpathTV.DecMapUint32IntfV(v, false, d) + case *map[uint32]interface{}: + var v2 map[uint32]interface{} + v2, changed = fastpathTV.DecMapUint32IntfV(*v, true, d) + if changed { + *v = v2 + } + case map[uint32]string: + fastpathTV.DecMapUint32StringV(v, false, d) + case *map[uint32]string: + var v2 map[uint32]string + v2, changed = fastpathTV.DecMapUint32StringV(*v, true, d) + if changed { + *v = v2 + } + case map[uint32]uint: + fastpathTV.DecMapUint32UintV(v, false, d) + case *map[uint32]uint: + var v2 map[uint32]uint + v2, changed = fastpathTV.DecMapUint32UintV(*v, true, d) + if changed { + *v = v2 + } + case map[uint32]uint8: + fastpathTV.DecMapUint32Uint8V(v, false, d) + case *map[uint32]uint8: + var v2 map[uint32]uint8 + v2, changed = fastpathTV.DecMapUint32Uint8V(*v, true, d) + if changed { + *v = v2 + } + case map[uint32]uint16: + fastpathTV.DecMapUint32Uint16V(v, false, d) + case *map[uint32]uint16: + var v2 map[uint32]uint16 + v2, changed = fastpathTV.DecMapUint32Uint16V(*v, true, d) + if changed { + *v = v2 + } + case map[uint32]uint32: + fastpathTV.DecMapUint32Uint32V(v, false, d) + case *map[uint32]uint32: + var v2 map[uint32]uint32 + v2, changed = fastpathTV.DecMapUint32Uint32V(*v, true, d) + if changed { + *v = v2 + } + case map[uint32]uint64: + fastpathTV.DecMapUint32Uint64V(v, false, d) + case *map[uint32]uint64: + var v2 map[uint32]uint64 + v2, changed = fastpathTV.DecMapUint32Uint64V(*v, true, d) + if changed { + *v = v2 + } + case map[uint32]uintptr: + fastpathTV.DecMapUint32UintptrV(v, false, d) + case *map[uint32]uintptr: + var v2 map[uint32]uintptr + v2, changed = fastpathTV.DecMapUint32UintptrV(*v, true, d) + if changed { + *v = v2 + } + case map[uint32]int: + fastpathTV.DecMapUint32IntV(v, false, d) + case *map[uint32]int: + var v2 map[uint32]int + v2, changed = fastpathTV.DecMapUint32IntV(*v, true, d) + if changed { + *v = v2 + } + case map[uint32]int8: + fastpathTV.DecMapUint32Int8V(v, false, d) + case *map[uint32]int8: + var v2 map[uint32]int8 + v2, changed = fastpathTV.DecMapUint32Int8V(*v, true, d) + if changed { + *v = v2 + } + case map[uint32]int16: + fastpathTV.DecMapUint32Int16V(v, false, d) + case *map[uint32]int16: + var v2 map[uint32]int16 + v2, changed = fastpathTV.DecMapUint32Int16V(*v, true, d) + if changed { + *v = v2 + } + case map[uint32]int32: + fastpathTV.DecMapUint32Int32V(v, false, d) + case *map[uint32]int32: + var v2 map[uint32]int32 + v2, changed = fastpathTV.DecMapUint32Int32V(*v, true, d) + if changed { + *v = v2 + } + case map[uint32]int64: + fastpathTV.DecMapUint32Int64V(v, false, d) + case *map[uint32]int64: + var v2 map[uint32]int64 + v2, changed = fastpathTV.DecMapUint32Int64V(*v, true, d) + if changed { + *v = v2 + } + case map[uint32]float32: + fastpathTV.DecMapUint32Float32V(v, false, d) + case *map[uint32]float32: + var v2 map[uint32]float32 + v2, changed = fastpathTV.DecMapUint32Float32V(*v, true, d) + if changed { + *v = v2 + } + case map[uint32]float64: + fastpathTV.DecMapUint32Float64V(v, false, d) + case *map[uint32]float64: + var v2 map[uint32]float64 + v2, changed = fastpathTV.DecMapUint32Float64V(*v, true, d) + if changed { + *v = v2 + } + case map[uint32]bool: + fastpathTV.DecMapUint32BoolV(v, false, d) + case *map[uint32]bool: + var v2 map[uint32]bool + v2, changed = fastpathTV.DecMapUint32BoolV(*v, true, d) + if changed { + *v = v2 + } + case map[uint64]interface{}: + fastpathTV.DecMapUint64IntfV(v, false, d) + case *map[uint64]interface{}: + var v2 map[uint64]interface{} + v2, changed = fastpathTV.DecMapUint64IntfV(*v, true, d) + if changed { + *v = v2 + } + case map[uint64]string: + fastpathTV.DecMapUint64StringV(v, false, d) + case *map[uint64]string: + var v2 map[uint64]string + v2, changed = fastpathTV.DecMapUint64StringV(*v, true, d) + if changed { + *v = v2 + } + case map[uint64]uint: + fastpathTV.DecMapUint64UintV(v, false, d) + case *map[uint64]uint: + var v2 map[uint64]uint + v2, changed = fastpathTV.DecMapUint64UintV(*v, true, d) + if changed { + *v = v2 + } + case map[uint64]uint8: + fastpathTV.DecMapUint64Uint8V(v, false, d) + case *map[uint64]uint8: + var v2 map[uint64]uint8 + v2, changed = fastpathTV.DecMapUint64Uint8V(*v, true, d) + if changed { + *v = v2 + } + case map[uint64]uint16: + fastpathTV.DecMapUint64Uint16V(v, false, d) + case *map[uint64]uint16: + var v2 map[uint64]uint16 + v2, changed = fastpathTV.DecMapUint64Uint16V(*v, true, d) + if changed { + *v = v2 + } + case map[uint64]uint32: + fastpathTV.DecMapUint64Uint32V(v, false, d) + case *map[uint64]uint32: + var v2 map[uint64]uint32 + v2, changed = fastpathTV.DecMapUint64Uint32V(*v, true, d) + if changed { + *v = v2 + } + case map[uint64]uint64: + fastpathTV.DecMapUint64Uint64V(v, false, d) + case *map[uint64]uint64: + var v2 map[uint64]uint64 + v2, changed = fastpathTV.DecMapUint64Uint64V(*v, true, d) + if changed { + *v = v2 + } + case map[uint64]uintptr: + fastpathTV.DecMapUint64UintptrV(v, false, d) + case *map[uint64]uintptr: + var v2 map[uint64]uintptr + v2, changed = fastpathTV.DecMapUint64UintptrV(*v, true, d) + if changed { + *v = v2 + } + case map[uint64]int: + fastpathTV.DecMapUint64IntV(v, false, d) + case *map[uint64]int: + var v2 map[uint64]int + v2, changed = fastpathTV.DecMapUint64IntV(*v, true, d) + if changed { + *v = v2 + } + case map[uint64]int8: + fastpathTV.DecMapUint64Int8V(v, false, d) + case *map[uint64]int8: + var v2 map[uint64]int8 + v2, changed = fastpathTV.DecMapUint64Int8V(*v, true, d) + if changed { + *v = v2 + } + case map[uint64]int16: + fastpathTV.DecMapUint64Int16V(v, false, d) + case *map[uint64]int16: + var v2 map[uint64]int16 + v2, changed = fastpathTV.DecMapUint64Int16V(*v, true, d) + if changed { + *v = v2 + } + case map[uint64]int32: + fastpathTV.DecMapUint64Int32V(v, false, d) + case *map[uint64]int32: + var v2 map[uint64]int32 + v2, changed = fastpathTV.DecMapUint64Int32V(*v, true, d) + if changed { + *v = v2 + } + case map[uint64]int64: + fastpathTV.DecMapUint64Int64V(v, false, d) + case *map[uint64]int64: + var v2 map[uint64]int64 + v2, changed = fastpathTV.DecMapUint64Int64V(*v, true, d) + if changed { + *v = v2 + } + case map[uint64]float32: + fastpathTV.DecMapUint64Float32V(v, false, d) + case *map[uint64]float32: + var v2 map[uint64]float32 + v2, changed = fastpathTV.DecMapUint64Float32V(*v, true, d) + if changed { + *v = v2 + } + case map[uint64]float64: + fastpathTV.DecMapUint64Float64V(v, false, d) + case *map[uint64]float64: + var v2 map[uint64]float64 + v2, changed = fastpathTV.DecMapUint64Float64V(*v, true, d) + if changed { + *v = v2 + } + case map[uint64]bool: + fastpathTV.DecMapUint64BoolV(v, false, d) + case *map[uint64]bool: + var v2 map[uint64]bool + v2, changed = fastpathTV.DecMapUint64BoolV(*v, true, d) + if changed { + *v = v2 + } + case map[uintptr]interface{}: + fastpathTV.DecMapUintptrIntfV(v, false, d) + case *map[uintptr]interface{}: + var v2 map[uintptr]interface{} + v2, changed = fastpathTV.DecMapUintptrIntfV(*v, true, d) + if changed { + *v = v2 + } + case map[uintptr]string: + fastpathTV.DecMapUintptrStringV(v, false, d) + case *map[uintptr]string: + var v2 map[uintptr]string + v2, changed = fastpathTV.DecMapUintptrStringV(*v, true, d) + if changed { + *v = v2 + } + case map[uintptr]uint: + fastpathTV.DecMapUintptrUintV(v, false, d) + case *map[uintptr]uint: + var v2 map[uintptr]uint + v2, changed = fastpathTV.DecMapUintptrUintV(*v, true, d) + if changed { + *v = v2 + } + case map[uintptr]uint8: + fastpathTV.DecMapUintptrUint8V(v, false, d) + case *map[uintptr]uint8: + var v2 map[uintptr]uint8 + v2, changed = fastpathTV.DecMapUintptrUint8V(*v, true, d) + if changed { + *v = v2 + } + case map[uintptr]uint16: + fastpathTV.DecMapUintptrUint16V(v, false, d) + case *map[uintptr]uint16: + var v2 map[uintptr]uint16 + v2, changed = fastpathTV.DecMapUintptrUint16V(*v, true, d) + if changed { + *v = v2 + } + case map[uintptr]uint32: + fastpathTV.DecMapUintptrUint32V(v, false, d) + case *map[uintptr]uint32: + var v2 map[uintptr]uint32 + v2, changed = fastpathTV.DecMapUintptrUint32V(*v, true, d) + if changed { + *v = v2 + } + case map[uintptr]uint64: + fastpathTV.DecMapUintptrUint64V(v, false, d) + case *map[uintptr]uint64: + var v2 map[uintptr]uint64 + v2, changed = fastpathTV.DecMapUintptrUint64V(*v, true, d) + if changed { + *v = v2 + } + case map[uintptr]uintptr: + fastpathTV.DecMapUintptrUintptrV(v, false, d) + case *map[uintptr]uintptr: + var v2 map[uintptr]uintptr + v2, changed = fastpathTV.DecMapUintptrUintptrV(*v, true, d) + if changed { + *v = v2 + } + case map[uintptr]int: + fastpathTV.DecMapUintptrIntV(v, false, d) + case *map[uintptr]int: + var v2 map[uintptr]int + v2, changed = fastpathTV.DecMapUintptrIntV(*v, true, d) + if changed { + *v = v2 + } + case map[uintptr]int8: + fastpathTV.DecMapUintptrInt8V(v, false, d) + case *map[uintptr]int8: + var v2 map[uintptr]int8 + v2, changed = fastpathTV.DecMapUintptrInt8V(*v, true, d) + if changed { + *v = v2 + } + case map[uintptr]int16: + fastpathTV.DecMapUintptrInt16V(v, false, d) + case *map[uintptr]int16: + var v2 map[uintptr]int16 + v2, changed = fastpathTV.DecMapUintptrInt16V(*v, true, d) + if changed { + *v = v2 + } + case map[uintptr]int32: + fastpathTV.DecMapUintptrInt32V(v, false, d) + case *map[uintptr]int32: + var v2 map[uintptr]int32 + v2, changed = fastpathTV.DecMapUintptrInt32V(*v, true, d) + if changed { + *v = v2 + } + case map[uintptr]int64: + fastpathTV.DecMapUintptrInt64V(v, false, d) + case *map[uintptr]int64: + var v2 map[uintptr]int64 + v2, changed = fastpathTV.DecMapUintptrInt64V(*v, true, d) + if changed { + *v = v2 + } + case map[uintptr]float32: + fastpathTV.DecMapUintptrFloat32V(v, false, d) + case *map[uintptr]float32: + var v2 map[uintptr]float32 + v2, changed = fastpathTV.DecMapUintptrFloat32V(*v, true, d) + if changed { + *v = v2 + } + case map[uintptr]float64: + fastpathTV.DecMapUintptrFloat64V(v, false, d) + case *map[uintptr]float64: + var v2 map[uintptr]float64 + v2, changed = fastpathTV.DecMapUintptrFloat64V(*v, true, d) + if changed { + *v = v2 + } + case map[uintptr]bool: + fastpathTV.DecMapUintptrBoolV(v, false, d) + case *map[uintptr]bool: + var v2 map[uintptr]bool + v2, changed = fastpathTV.DecMapUintptrBoolV(*v, true, d) + if changed { + *v = v2 + } + case map[int]interface{}: + fastpathTV.DecMapIntIntfV(v, false, d) + case *map[int]interface{}: + var v2 map[int]interface{} + v2, changed = fastpathTV.DecMapIntIntfV(*v, true, d) + if changed { + *v = v2 + } + case map[int]string: + fastpathTV.DecMapIntStringV(v, false, d) + case *map[int]string: + var v2 map[int]string + v2, changed = fastpathTV.DecMapIntStringV(*v, true, d) + if changed { + *v = v2 + } + case map[int]uint: + fastpathTV.DecMapIntUintV(v, false, d) + case *map[int]uint: + var v2 map[int]uint + v2, changed = fastpathTV.DecMapIntUintV(*v, true, d) + if changed { + *v = v2 + } + case map[int]uint8: + fastpathTV.DecMapIntUint8V(v, false, d) + case *map[int]uint8: + var v2 map[int]uint8 + v2, changed = fastpathTV.DecMapIntUint8V(*v, true, d) + if changed { + *v = v2 + } + case map[int]uint16: + fastpathTV.DecMapIntUint16V(v, false, d) + case *map[int]uint16: + var v2 map[int]uint16 + v2, changed = fastpathTV.DecMapIntUint16V(*v, true, d) + if changed { + *v = v2 + } + case map[int]uint32: + fastpathTV.DecMapIntUint32V(v, false, d) + case *map[int]uint32: + var v2 map[int]uint32 + v2, changed = fastpathTV.DecMapIntUint32V(*v, true, d) + if changed { + *v = v2 + } + case map[int]uint64: + fastpathTV.DecMapIntUint64V(v, false, d) + case *map[int]uint64: + var v2 map[int]uint64 + v2, changed = fastpathTV.DecMapIntUint64V(*v, true, d) + if changed { + *v = v2 + } + case map[int]uintptr: + fastpathTV.DecMapIntUintptrV(v, false, d) + case *map[int]uintptr: + var v2 map[int]uintptr + v2, changed = fastpathTV.DecMapIntUintptrV(*v, true, d) + if changed { + *v = v2 + } + case map[int]int: + fastpathTV.DecMapIntIntV(v, false, d) + case *map[int]int: + var v2 map[int]int + v2, changed = fastpathTV.DecMapIntIntV(*v, true, d) + if changed { + *v = v2 + } + case map[int]int8: + fastpathTV.DecMapIntInt8V(v, false, d) + case *map[int]int8: + var v2 map[int]int8 + v2, changed = fastpathTV.DecMapIntInt8V(*v, true, d) + if changed { + *v = v2 + } + case map[int]int16: + fastpathTV.DecMapIntInt16V(v, false, d) + case *map[int]int16: + var v2 map[int]int16 + v2, changed = fastpathTV.DecMapIntInt16V(*v, true, d) + if changed { + *v = v2 + } + case map[int]int32: + fastpathTV.DecMapIntInt32V(v, false, d) + case *map[int]int32: + var v2 map[int]int32 + v2, changed = fastpathTV.DecMapIntInt32V(*v, true, d) + if changed { + *v = v2 + } + case map[int]int64: + fastpathTV.DecMapIntInt64V(v, false, d) + case *map[int]int64: + var v2 map[int]int64 + v2, changed = fastpathTV.DecMapIntInt64V(*v, true, d) + if changed { + *v = v2 + } + case map[int]float32: + fastpathTV.DecMapIntFloat32V(v, false, d) + case *map[int]float32: + var v2 map[int]float32 + v2, changed = fastpathTV.DecMapIntFloat32V(*v, true, d) + if changed { + *v = v2 + } + case map[int]float64: + fastpathTV.DecMapIntFloat64V(v, false, d) + case *map[int]float64: + var v2 map[int]float64 + v2, changed = fastpathTV.DecMapIntFloat64V(*v, true, d) + if changed { + *v = v2 + } + case map[int]bool: + fastpathTV.DecMapIntBoolV(v, false, d) + case *map[int]bool: + var v2 map[int]bool + v2, changed = fastpathTV.DecMapIntBoolV(*v, true, d) + if changed { + *v = v2 + } + case map[int8]interface{}: + fastpathTV.DecMapInt8IntfV(v, false, d) + case *map[int8]interface{}: + var v2 map[int8]interface{} + v2, changed = fastpathTV.DecMapInt8IntfV(*v, true, d) + if changed { + *v = v2 + } + case map[int8]string: + fastpathTV.DecMapInt8StringV(v, false, d) + case *map[int8]string: + var v2 map[int8]string + v2, changed = fastpathTV.DecMapInt8StringV(*v, true, d) + if changed { + *v = v2 + } + case map[int8]uint: + fastpathTV.DecMapInt8UintV(v, false, d) + case *map[int8]uint: + var v2 map[int8]uint + v2, changed = fastpathTV.DecMapInt8UintV(*v, true, d) + if changed { + *v = v2 + } + case map[int8]uint8: + fastpathTV.DecMapInt8Uint8V(v, false, d) + case *map[int8]uint8: + var v2 map[int8]uint8 + v2, changed = fastpathTV.DecMapInt8Uint8V(*v, true, d) + if changed { + *v = v2 + } + case map[int8]uint16: + fastpathTV.DecMapInt8Uint16V(v, false, d) + case *map[int8]uint16: + var v2 map[int8]uint16 + v2, changed = fastpathTV.DecMapInt8Uint16V(*v, true, d) + if changed { + *v = v2 + } + case map[int8]uint32: + fastpathTV.DecMapInt8Uint32V(v, false, d) + case *map[int8]uint32: + var v2 map[int8]uint32 + v2, changed = fastpathTV.DecMapInt8Uint32V(*v, true, d) + if changed { + *v = v2 + } + case map[int8]uint64: + fastpathTV.DecMapInt8Uint64V(v, false, d) + case *map[int8]uint64: + var v2 map[int8]uint64 + v2, changed = fastpathTV.DecMapInt8Uint64V(*v, true, d) + if changed { + *v = v2 + } + case map[int8]uintptr: + fastpathTV.DecMapInt8UintptrV(v, false, d) + case *map[int8]uintptr: + var v2 map[int8]uintptr + v2, changed = fastpathTV.DecMapInt8UintptrV(*v, true, d) + if changed { + *v = v2 + } + case map[int8]int: + fastpathTV.DecMapInt8IntV(v, false, d) + case *map[int8]int: + var v2 map[int8]int + v2, changed = fastpathTV.DecMapInt8IntV(*v, true, d) + if changed { + *v = v2 + } + case map[int8]int8: + fastpathTV.DecMapInt8Int8V(v, false, d) + case *map[int8]int8: + var v2 map[int8]int8 + v2, changed = fastpathTV.DecMapInt8Int8V(*v, true, d) + if changed { + *v = v2 + } + case map[int8]int16: + fastpathTV.DecMapInt8Int16V(v, false, d) + case *map[int8]int16: + var v2 map[int8]int16 + v2, changed = fastpathTV.DecMapInt8Int16V(*v, true, d) + if changed { + *v = v2 + } + case map[int8]int32: + fastpathTV.DecMapInt8Int32V(v, false, d) + case *map[int8]int32: + var v2 map[int8]int32 + v2, changed = fastpathTV.DecMapInt8Int32V(*v, true, d) + if changed { + *v = v2 + } + case map[int8]int64: + fastpathTV.DecMapInt8Int64V(v, false, d) + case *map[int8]int64: + var v2 map[int8]int64 + v2, changed = fastpathTV.DecMapInt8Int64V(*v, true, d) + if changed { + *v = v2 + } + case map[int8]float32: + fastpathTV.DecMapInt8Float32V(v, false, d) + case *map[int8]float32: + var v2 map[int8]float32 + v2, changed = fastpathTV.DecMapInt8Float32V(*v, true, d) + if changed { + *v = v2 + } + case map[int8]float64: + fastpathTV.DecMapInt8Float64V(v, false, d) + case *map[int8]float64: + var v2 map[int8]float64 + v2, changed = fastpathTV.DecMapInt8Float64V(*v, true, d) + if changed { + *v = v2 + } + case map[int8]bool: + fastpathTV.DecMapInt8BoolV(v, false, d) + case *map[int8]bool: + var v2 map[int8]bool + v2, changed = fastpathTV.DecMapInt8BoolV(*v, true, d) + if changed { + *v = v2 + } + case map[int16]interface{}: + fastpathTV.DecMapInt16IntfV(v, false, d) + case *map[int16]interface{}: + var v2 map[int16]interface{} + v2, changed = fastpathTV.DecMapInt16IntfV(*v, true, d) + if changed { + *v = v2 + } + case map[int16]string: + fastpathTV.DecMapInt16StringV(v, false, d) + case *map[int16]string: + var v2 map[int16]string + v2, changed = fastpathTV.DecMapInt16StringV(*v, true, d) + if changed { + *v = v2 + } + case map[int16]uint: + fastpathTV.DecMapInt16UintV(v, false, d) + case *map[int16]uint: + var v2 map[int16]uint + v2, changed = fastpathTV.DecMapInt16UintV(*v, true, d) + if changed { + *v = v2 + } + case map[int16]uint8: + fastpathTV.DecMapInt16Uint8V(v, false, d) + case *map[int16]uint8: + var v2 map[int16]uint8 + v2, changed = fastpathTV.DecMapInt16Uint8V(*v, true, d) + if changed { + *v = v2 + } + case map[int16]uint16: + fastpathTV.DecMapInt16Uint16V(v, false, d) + case *map[int16]uint16: + var v2 map[int16]uint16 + v2, changed = fastpathTV.DecMapInt16Uint16V(*v, true, d) + if changed { + *v = v2 + } + case map[int16]uint32: + fastpathTV.DecMapInt16Uint32V(v, false, d) + case *map[int16]uint32: + var v2 map[int16]uint32 + v2, changed = fastpathTV.DecMapInt16Uint32V(*v, true, d) + if changed { + *v = v2 + } + case map[int16]uint64: + fastpathTV.DecMapInt16Uint64V(v, false, d) + case *map[int16]uint64: + var v2 map[int16]uint64 + v2, changed = fastpathTV.DecMapInt16Uint64V(*v, true, d) + if changed { + *v = v2 + } + case map[int16]uintptr: + fastpathTV.DecMapInt16UintptrV(v, false, d) + case *map[int16]uintptr: + var v2 map[int16]uintptr + v2, changed = fastpathTV.DecMapInt16UintptrV(*v, true, d) + if changed { + *v = v2 + } + case map[int16]int: + fastpathTV.DecMapInt16IntV(v, false, d) + case *map[int16]int: + var v2 map[int16]int + v2, changed = fastpathTV.DecMapInt16IntV(*v, true, d) + if changed { + *v = v2 + } + case map[int16]int8: + fastpathTV.DecMapInt16Int8V(v, false, d) + case *map[int16]int8: + var v2 map[int16]int8 + v2, changed = fastpathTV.DecMapInt16Int8V(*v, true, d) + if changed { + *v = v2 + } + case map[int16]int16: + fastpathTV.DecMapInt16Int16V(v, false, d) + case *map[int16]int16: + var v2 map[int16]int16 + v2, changed = fastpathTV.DecMapInt16Int16V(*v, true, d) + if changed { + *v = v2 + } + case map[int16]int32: + fastpathTV.DecMapInt16Int32V(v, false, d) + case *map[int16]int32: + var v2 map[int16]int32 + v2, changed = fastpathTV.DecMapInt16Int32V(*v, true, d) + if changed { + *v = v2 + } + case map[int16]int64: + fastpathTV.DecMapInt16Int64V(v, false, d) + case *map[int16]int64: + var v2 map[int16]int64 + v2, changed = fastpathTV.DecMapInt16Int64V(*v, true, d) + if changed { + *v = v2 + } + case map[int16]float32: + fastpathTV.DecMapInt16Float32V(v, false, d) + case *map[int16]float32: + var v2 map[int16]float32 + v2, changed = fastpathTV.DecMapInt16Float32V(*v, true, d) + if changed { + *v = v2 + } + case map[int16]float64: + fastpathTV.DecMapInt16Float64V(v, false, d) + case *map[int16]float64: + var v2 map[int16]float64 + v2, changed = fastpathTV.DecMapInt16Float64V(*v, true, d) + if changed { + *v = v2 + } + case map[int16]bool: + fastpathTV.DecMapInt16BoolV(v, false, d) + case *map[int16]bool: + var v2 map[int16]bool + v2, changed = fastpathTV.DecMapInt16BoolV(*v, true, d) + if changed { + *v = v2 + } + case map[int32]interface{}: + fastpathTV.DecMapInt32IntfV(v, false, d) + case *map[int32]interface{}: + var v2 map[int32]interface{} + v2, changed = fastpathTV.DecMapInt32IntfV(*v, true, d) + if changed { + *v = v2 + } + case map[int32]string: + fastpathTV.DecMapInt32StringV(v, false, d) + case *map[int32]string: + var v2 map[int32]string + v2, changed = fastpathTV.DecMapInt32StringV(*v, true, d) + if changed { + *v = v2 + } + case map[int32]uint: + fastpathTV.DecMapInt32UintV(v, false, d) + case *map[int32]uint: + var v2 map[int32]uint + v2, changed = fastpathTV.DecMapInt32UintV(*v, true, d) + if changed { + *v = v2 + } + case map[int32]uint8: + fastpathTV.DecMapInt32Uint8V(v, false, d) + case *map[int32]uint8: + var v2 map[int32]uint8 + v2, changed = fastpathTV.DecMapInt32Uint8V(*v, true, d) + if changed { + *v = v2 + } + case map[int32]uint16: + fastpathTV.DecMapInt32Uint16V(v, false, d) + case *map[int32]uint16: + var v2 map[int32]uint16 + v2, changed = fastpathTV.DecMapInt32Uint16V(*v, true, d) + if changed { + *v = v2 + } + case map[int32]uint32: + fastpathTV.DecMapInt32Uint32V(v, false, d) + case *map[int32]uint32: + var v2 map[int32]uint32 + v2, changed = fastpathTV.DecMapInt32Uint32V(*v, true, d) + if changed { + *v = v2 + } + case map[int32]uint64: + fastpathTV.DecMapInt32Uint64V(v, false, d) + case *map[int32]uint64: + var v2 map[int32]uint64 + v2, changed = fastpathTV.DecMapInt32Uint64V(*v, true, d) + if changed { + *v = v2 + } + case map[int32]uintptr: + fastpathTV.DecMapInt32UintptrV(v, false, d) + case *map[int32]uintptr: + var v2 map[int32]uintptr + v2, changed = fastpathTV.DecMapInt32UintptrV(*v, true, d) + if changed { + *v = v2 + } + case map[int32]int: + fastpathTV.DecMapInt32IntV(v, false, d) + case *map[int32]int: + var v2 map[int32]int + v2, changed = fastpathTV.DecMapInt32IntV(*v, true, d) + if changed { + *v = v2 + } + case map[int32]int8: + fastpathTV.DecMapInt32Int8V(v, false, d) + case *map[int32]int8: + var v2 map[int32]int8 + v2, changed = fastpathTV.DecMapInt32Int8V(*v, true, d) + if changed { + *v = v2 + } + case map[int32]int16: + fastpathTV.DecMapInt32Int16V(v, false, d) + case *map[int32]int16: + var v2 map[int32]int16 + v2, changed = fastpathTV.DecMapInt32Int16V(*v, true, d) + if changed { + *v = v2 + } + case map[int32]int32: + fastpathTV.DecMapInt32Int32V(v, false, d) + case *map[int32]int32: + var v2 map[int32]int32 + v2, changed = fastpathTV.DecMapInt32Int32V(*v, true, d) + if changed { + *v = v2 + } + case map[int32]int64: + fastpathTV.DecMapInt32Int64V(v, false, d) + case *map[int32]int64: + var v2 map[int32]int64 + v2, changed = fastpathTV.DecMapInt32Int64V(*v, true, d) + if changed { + *v = v2 + } + case map[int32]float32: + fastpathTV.DecMapInt32Float32V(v, false, d) + case *map[int32]float32: + var v2 map[int32]float32 + v2, changed = fastpathTV.DecMapInt32Float32V(*v, true, d) + if changed { + *v = v2 + } + case map[int32]float64: + fastpathTV.DecMapInt32Float64V(v, false, d) + case *map[int32]float64: + var v2 map[int32]float64 + v2, changed = fastpathTV.DecMapInt32Float64V(*v, true, d) + if changed { + *v = v2 + } + case map[int32]bool: + fastpathTV.DecMapInt32BoolV(v, false, d) + case *map[int32]bool: + var v2 map[int32]bool + v2, changed = fastpathTV.DecMapInt32BoolV(*v, true, d) + if changed { + *v = v2 + } + case map[int64]interface{}: + fastpathTV.DecMapInt64IntfV(v, false, d) + case *map[int64]interface{}: + var v2 map[int64]interface{} + v2, changed = fastpathTV.DecMapInt64IntfV(*v, true, d) + if changed { + *v = v2 + } + case map[int64]string: + fastpathTV.DecMapInt64StringV(v, false, d) + case *map[int64]string: + var v2 map[int64]string + v2, changed = fastpathTV.DecMapInt64StringV(*v, true, d) + if changed { + *v = v2 + } + case map[int64]uint: + fastpathTV.DecMapInt64UintV(v, false, d) + case *map[int64]uint: + var v2 map[int64]uint + v2, changed = fastpathTV.DecMapInt64UintV(*v, true, d) + if changed { + *v = v2 + } + case map[int64]uint8: + fastpathTV.DecMapInt64Uint8V(v, false, d) + case *map[int64]uint8: + var v2 map[int64]uint8 + v2, changed = fastpathTV.DecMapInt64Uint8V(*v, true, d) + if changed { + *v = v2 + } + case map[int64]uint16: + fastpathTV.DecMapInt64Uint16V(v, false, d) + case *map[int64]uint16: + var v2 map[int64]uint16 + v2, changed = fastpathTV.DecMapInt64Uint16V(*v, true, d) + if changed { + *v = v2 + } + case map[int64]uint32: + fastpathTV.DecMapInt64Uint32V(v, false, d) + case *map[int64]uint32: + var v2 map[int64]uint32 + v2, changed = fastpathTV.DecMapInt64Uint32V(*v, true, d) + if changed { + *v = v2 + } + case map[int64]uint64: + fastpathTV.DecMapInt64Uint64V(v, false, d) + case *map[int64]uint64: + var v2 map[int64]uint64 + v2, changed = fastpathTV.DecMapInt64Uint64V(*v, true, d) + if changed { + *v = v2 + } + case map[int64]uintptr: + fastpathTV.DecMapInt64UintptrV(v, false, d) + case *map[int64]uintptr: + var v2 map[int64]uintptr + v2, changed = fastpathTV.DecMapInt64UintptrV(*v, true, d) + if changed { + *v = v2 + } + case map[int64]int: + fastpathTV.DecMapInt64IntV(v, false, d) + case *map[int64]int: + var v2 map[int64]int + v2, changed = fastpathTV.DecMapInt64IntV(*v, true, d) + if changed { + *v = v2 + } + case map[int64]int8: + fastpathTV.DecMapInt64Int8V(v, false, d) + case *map[int64]int8: + var v2 map[int64]int8 + v2, changed = fastpathTV.DecMapInt64Int8V(*v, true, d) + if changed { + *v = v2 + } + case map[int64]int16: + fastpathTV.DecMapInt64Int16V(v, false, d) + case *map[int64]int16: + var v2 map[int64]int16 + v2, changed = fastpathTV.DecMapInt64Int16V(*v, true, d) + if changed { + *v = v2 + } + case map[int64]int32: + fastpathTV.DecMapInt64Int32V(v, false, d) + case *map[int64]int32: + var v2 map[int64]int32 + v2, changed = fastpathTV.DecMapInt64Int32V(*v, true, d) + if changed { + *v = v2 + } + case map[int64]int64: + fastpathTV.DecMapInt64Int64V(v, false, d) + case *map[int64]int64: + var v2 map[int64]int64 + v2, changed = fastpathTV.DecMapInt64Int64V(*v, true, d) + if changed { + *v = v2 + } + case map[int64]float32: + fastpathTV.DecMapInt64Float32V(v, false, d) + case *map[int64]float32: + var v2 map[int64]float32 + v2, changed = fastpathTV.DecMapInt64Float32V(*v, true, d) + if changed { + *v = v2 + } + case map[int64]float64: + fastpathTV.DecMapInt64Float64V(v, false, d) + case *map[int64]float64: + var v2 map[int64]float64 + v2, changed = fastpathTV.DecMapInt64Float64V(*v, true, d) + if changed { + *v = v2 + } + case map[int64]bool: + fastpathTV.DecMapInt64BoolV(v, false, d) + case *map[int64]bool: + var v2 map[int64]bool + v2, changed = fastpathTV.DecMapInt64BoolV(*v, true, d) + if changed { + *v = v2 + } + case map[bool]interface{}: + fastpathTV.DecMapBoolIntfV(v, false, d) + case *map[bool]interface{}: + var v2 map[bool]interface{} + v2, changed = fastpathTV.DecMapBoolIntfV(*v, true, d) + if changed { + *v = v2 + } + case map[bool]string: + fastpathTV.DecMapBoolStringV(v, false, d) + case *map[bool]string: + var v2 map[bool]string + v2, changed = fastpathTV.DecMapBoolStringV(*v, true, d) + if changed { + *v = v2 + } + case map[bool]uint: + fastpathTV.DecMapBoolUintV(v, false, d) + case *map[bool]uint: + var v2 map[bool]uint + v2, changed = fastpathTV.DecMapBoolUintV(*v, true, d) + if changed { + *v = v2 + } + case map[bool]uint8: + fastpathTV.DecMapBoolUint8V(v, false, d) + case *map[bool]uint8: + var v2 map[bool]uint8 + v2, changed = fastpathTV.DecMapBoolUint8V(*v, true, d) + if changed { + *v = v2 + } + case map[bool]uint16: + fastpathTV.DecMapBoolUint16V(v, false, d) + case *map[bool]uint16: + var v2 map[bool]uint16 + v2, changed = fastpathTV.DecMapBoolUint16V(*v, true, d) + if changed { + *v = v2 + } + case map[bool]uint32: + fastpathTV.DecMapBoolUint32V(v, false, d) + case *map[bool]uint32: + var v2 map[bool]uint32 + v2, changed = fastpathTV.DecMapBoolUint32V(*v, true, d) + if changed { + *v = v2 + } + case map[bool]uint64: + fastpathTV.DecMapBoolUint64V(v, false, d) + case *map[bool]uint64: + var v2 map[bool]uint64 + v2, changed = fastpathTV.DecMapBoolUint64V(*v, true, d) + if changed { + *v = v2 + } + case map[bool]uintptr: + fastpathTV.DecMapBoolUintptrV(v, false, d) + case *map[bool]uintptr: + var v2 map[bool]uintptr + v2, changed = fastpathTV.DecMapBoolUintptrV(*v, true, d) + if changed { + *v = v2 + } + case map[bool]int: + fastpathTV.DecMapBoolIntV(v, false, d) + case *map[bool]int: + var v2 map[bool]int + v2, changed = fastpathTV.DecMapBoolIntV(*v, true, d) + if changed { + *v = v2 + } + case map[bool]int8: + fastpathTV.DecMapBoolInt8V(v, false, d) + case *map[bool]int8: + var v2 map[bool]int8 + v2, changed = fastpathTV.DecMapBoolInt8V(*v, true, d) + if changed { + *v = v2 + } + case map[bool]int16: + fastpathTV.DecMapBoolInt16V(v, false, d) + case *map[bool]int16: + var v2 map[bool]int16 + v2, changed = fastpathTV.DecMapBoolInt16V(*v, true, d) + if changed { + *v = v2 + } + case map[bool]int32: + fastpathTV.DecMapBoolInt32V(v, false, d) + case *map[bool]int32: + var v2 map[bool]int32 + v2, changed = fastpathTV.DecMapBoolInt32V(*v, true, d) + if changed { + *v = v2 + } + case map[bool]int64: + fastpathTV.DecMapBoolInt64V(v, false, d) + case *map[bool]int64: + var v2 map[bool]int64 + v2, changed = fastpathTV.DecMapBoolInt64V(*v, true, d) + if changed { + *v = v2 + } + case map[bool]float32: + fastpathTV.DecMapBoolFloat32V(v, false, d) + case *map[bool]float32: + var v2 map[bool]float32 + v2, changed = fastpathTV.DecMapBoolFloat32V(*v, true, d) + if changed { + *v = v2 + } + case map[bool]float64: + fastpathTV.DecMapBoolFloat64V(v, false, d) + case *map[bool]float64: + var v2 map[bool]float64 + v2, changed = fastpathTV.DecMapBoolFloat64V(*v, true, d) + if changed { + *v = v2 + } + case map[bool]bool: + fastpathTV.DecMapBoolBoolV(v, false, d) + case *map[bool]bool: + var v2 map[bool]bool + v2, changed = fastpathTV.DecMapBoolBoolV(*v, true, d) + if changed { + *v = v2 + } + default: + _ = v // workaround https://github.com/golang/go/issues/12927 seen in go1.4 + return false + } + return true +} + +func fastpathDecodeSetZeroTypeSwitch(iv interface{}) bool { + switch v := iv.(type) { + + case *[]interface{}: + *v = nil + case *[]string: + *v = nil + case *[]float32: + *v = nil + case *[]float64: + *v = nil + case *[]uint: + *v = nil + case *[]uint8: + *v = nil + case *[]uint16: + *v = nil + case *[]uint32: + *v = nil + case *[]uint64: + *v = nil + case *[]uintptr: + *v = nil + case *[]int: + *v = nil + case *[]int8: + *v = nil + case *[]int16: + *v = nil + case *[]int32: + *v = nil + case *[]int64: + *v = nil + case *[]bool: + *v = nil + + case *map[interface{}]interface{}: + *v = nil + case *map[interface{}]string: + *v = nil + case *map[interface{}]uint: + *v = nil + case *map[interface{}]uint8: + *v = nil + case *map[interface{}]uint16: + *v = nil + case *map[interface{}]uint32: + *v = nil + case *map[interface{}]uint64: + *v = nil + case *map[interface{}]uintptr: + *v = nil + case *map[interface{}]int: + *v = nil + case *map[interface{}]int8: + *v = nil + case *map[interface{}]int16: + *v = nil + case *map[interface{}]int32: + *v = nil + case *map[interface{}]int64: + *v = nil + case *map[interface{}]float32: + *v = nil + case *map[interface{}]float64: + *v = nil + case *map[interface{}]bool: + *v = nil + case *map[string]interface{}: + *v = nil + case *map[string]string: + *v = nil + case *map[string]uint: + *v = nil + case *map[string]uint8: + *v = nil + case *map[string]uint16: + *v = nil + case *map[string]uint32: + *v = nil + case *map[string]uint64: + *v = nil + case *map[string]uintptr: + *v = nil + case *map[string]int: + *v = nil + case *map[string]int8: + *v = nil + case *map[string]int16: + *v = nil + case *map[string]int32: + *v = nil + case *map[string]int64: + *v = nil + case *map[string]float32: + *v = nil + case *map[string]float64: + *v = nil + case *map[string]bool: + *v = nil + case *map[float32]interface{}: + *v = nil + case *map[float32]string: + *v = nil + case *map[float32]uint: + *v = nil + case *map[float32]uint8: + *v = nil + case *map[float32]uint16: + *v = nil + case *map[float32]uint32: + *v = nil + case *map[float32]uint64: + *v = nil + case *map[float32]uintptr: + *v = nil + case *map[float32]int: + *v = nil + case *map[float32]int8: + *v = nil + case *map[float32]int16: + *v = nil + case *map[float32]int32: + *v = nil + case *map[float32]int64: + *v = nil + case *map[float32]float32: + *v = nil + case *map[float32]float64: + *v = nil + case *map[float32]bool: + *v = nil + case *map[float64]interface{}: + *v = nil + case *map[float64]string: + *v = nil + case *map[float64]uint: + *v = nil + case *map[float64]uint8: + *v = nil + case *map[float64]uint16: + *v = nil + case *map[float64]uint32: + *v = nil + case *map[float64]uint64: + *v = nil + case *map[float64]uintptr: + *v = nil + case *map[float64]int: + *v = nil + case *map[float64]int8: + *v = nil + case *map[float64]int16: + *v = nil + case *map[float64]int32: + *v = nil + case *map[float64]int64: + *v = nil + case *map[float64]float32: + *v = nil + case *map[float64]float64: + *v = nil + case *map[float64]bool: + *v = nil + case *map[uint]interface{}: + *v = nil + case *map[uint]string: + *v = nil + case *map[uint]uint: + *v = nil + case *map[uint]uint8: + *v = nil + case *map[uint]uint16: + *v = nil + case *map[uint]uint32: + *v = nil + case *map[uint]uint64: + *v = nil + case *map[uint]uintptr: + *v = nil + case *map[uint]int: + *v = nil + case *map[uint]int8: + *v = nil + case *map[uint]int16: + *v = nil + case *map[uint]int32: + *v = nil + case *map[uint]int64: + *v = nil + case *map[uint]float32: + *v = nil + case *map[uint]float64: + *v = nil + case *map[uint]bool: + *v = nil + case *map[uint8]interface{}: + *v = nil + case *map[uint8]string: + *v = nil + case *map[uint8]uint: + *v = nil + case *map[uint8]uint8: + *v = nil + case *map[uint8]uint16: + *v = nil + case *map[uint8]uint32: + *v = nil + case *map[uint8]uint64: + *v = nil + case *map[uint8]uintptr: + *v = nil + case *map[uint8]int: + *v = nil + case *map[uint8]int8: + *v = nil + case *map[uint8]int16: + *v = nil + case *map[uint8]int32: + *v = nil + case *map[uint8]int64: + *v = nil + case *map[uint8]float32: + *v = nil + case *map[uint8]float64: + *v = nil + case *map[uint8]bool: + *v = nil + case *map[uint16]interface{}: + *v = nil + case *map[uint16]string: + *v = nil + case *map[uint16]uint: + *v = nil + case *map[uint16]uint8: + *v = nil + case *map[uint16]uint16: + *v = nil + case *map[uint16]uint32: + *v = nil + case *map[uint16]uint64: + *v = nil + case *map[uint16]uintptr: + *v = nil + case *map[uint16]int: + *v = nil + case *map[uint16]int8: + *v = nil + case *map[uint16]int16: + *v = nil + case *map[uint16]int32: + *v = nil + case *map[uint16]int64: + *v = nil + case *map[uint16]float32: + *v = nil + case *map[uint16]float64: + *v = nil + case *map[uint16]bool: + *v = nil + case *map[uint32]interface{}: + *v = nil + case *map[uint32]string: + *v = nil + case *map[uint32]uint: + *v = nil + case *map[uint32]uint8: + *v = nil + case *map[uint32]uint16: + *v = nil + case *map[uint32]uint32: + *v = nil + case *map[uint32]uint64: + *v = nil + case *map[uint32]uintptr: + *v = nil + case *map[uint32]int: + *v = nil + case *map[uint32]int8: + *v = nil + case *map[uint32]int16: + *v = nil + case *map[uint32]int32: + *v = nil + case *map[uint32]int64: + *v = nil + case *map[uint32]float32: + *v = nil + case *map[uint32]float64: + *v = nil + case *map[uint32]bool: + *v = nil + case *map[uint64]interface{}: + *v = nil + case *map[uint64]string: + *v = nil + case *map[uint64]uint: + *v = nil + case *map[uint64]uint8: + *v = nil + case *map[uint64]uint16: + *v = nil + case *map[uint64]uint32: + *v = nil + case *map[uint64]uint64: + *v = nil + case *map[uint64]uintptr: + *v = nil + case *map[uint64]int: + *v = nil + case *map[uint64]int8: + *v = nil + case *map[uint64]int16: + *v = nil + case *map[uint64]int32: + *v = nil + case *map[uint64]int64: + *v = nil + case *map[uint64]float32: + *v = nil + case *map[uint64]float64: + *v = nil + case *map[uint64]bool: + *v = nil + case *map[uintptr]interface{}: + *v = nil + case *map[uintptr]string: + *v = nil + case *map[uintptr]uint: + *v = nil + case *map[uintptr]uint8: + *v = nil + case *map[uintptr]uint16: + *v = nil + case *map[uintptr]uint32: + *v = nil + case *map[uintptr]uint64: + *v = nil + case *map[uintptr]uintptr: + *v = nil + case *map[uintptr]int: + *v = nil + case *map[uintptr]int8: + *v = nil + case *map[uintptr]int16: + *v = nil + case *map[uintptr]int32: + *v = nil + case *map[uintptr]int64: + *v = nil + case *map[uintptr]float32: + *v = nil + case *map[uintptr]float64: + *v = nil + case *map[uintptr]bool: + *v = nil + case *map[int]interface{}: + *v = nil + case *map[int]string: + *v = nil + case *map[int]uint: + *v = nil + case *map[int]uint8: + *v = nil + case *map[int]uint16: + *v = nil + case *map[int]uint32: + *v = nil + case *map[int]uint64: + *v = nil + case *map[int]uintptr: + *v = nil + case *map[int]int: + *v = nil + case *map[int]int8: + *v = nil + case *map[int]int16: + *v = nil + case *map[int]int32: + *v = nil + case *map[int]int64: + *v = nil + case *map[int]float32: + *v = nil + case *map[int]float64: + *v = nil + case *map[int]bool: + *v = nil + case *map[int8]interface{}: + *v = nil + case *map[int8]string: + *v = nil + case *map[int8]uint: + *v = nil + case *map[int8]uint8: + *v = nil + case *map[int8]uint16: + *v = nil + case *map[int8]uint32: + *v = nil + case *map[int8]uint64: + *v = nil + case *map[int8]uintptr: + *v = nil + case *map[int8]int: + *v = nil + case *map[int8]int8: + *v = nil + case *map[int8]int16: + *v = nil + case *map[int8]int32: + *v = nil + case *map[int8]int64: + *v = nil + case *map[int8]float32: + *v = nil + case *map[int8]float64: + *v = nil + case *map[int8]bool: + *v = nil + case *map[int16]interface{}: + *v = nil + case *map[int16]string: + *v = nil + case *map[int16]uint: + *v = nil + case *map[int16]uint8: + *v = nil + case *map[int16]uint16: + *v = nil + case *map[int16]uint32: + *v = nil + case *map[int16]uint64: + *v = nil + case *map[int16]uintptr: + *v = nil + case *map[int16]int: + *v = nil + case *map[int16]int8: + *v = nil + case *map[int16]int16: + *v = nil + case *map[int16]int32: + *v = nil + case *map[int16]int64: + *v = nil + case *map[int16]float32: + *v = nil + case *map[int16]float64: + *v = nil + case *map[int16]bool: + *v = nil + case *map[int32]interface{}: + *v = nil + case *map[int32]string: + *v = nil + case *map[int32]uint: + *v = nil + case *map[int32]uint8: + *v = nil + case *map[int32]uint16: + *v = nil + case *map[int32]uint32: + *v = nil + case *map[int32]uint64: + *v = nil + case *map[int32]uintptr: + *v = nil + case *map[int32]int: + *v = nil + case *map[int32]int8: + *v = nil + case *map[int32]int16: + *v = nil + case *map[int32]int32: + *v = nil + case *map[int32]int64: + *v = nil + case *map[int32]float32: + *v = nil + case *map[int32]float64: + *v = nil + case *map[int32]bool: + *v = nil + case *map[int64]interface{}: + *v = nil + case *map[int64]string: + *v = nil + case *map[int64]uint: + *v = nil + case *map[int64]uint8: + *v = nil + case *map[int64]uint16: + *v = nil + case *map[int64]uint32: + *v = nil + case *map[int64]uint64: + *v = nil + case *map[int64]uintptr: + *v = nil + case *map[int64]int: + *v = nil + case *map[int64]int8: + *v = nil + case *map[int64]int16: + *v = nil + case *map[int64]int32: + *v = nil + case *map[int64]int64: + *v = nil + case *map[int64]float32: + *v = nil + case *map[int64]float64: + *v = nil + case *map[int64]bool: + *v = nil + case *map[bool]interface{}: + *v = nil + case *map[bool]string: + *v = nil + case *map[bool]uint: + *v = nil + case *map[bool]uint8: + *v = nil + case *map[bool]uint16: + *v = nil + case *map[bool]uint32: + *v = nil + case *map[bool]uint64: + *v = nil + case *map[bool]uintptr: + *v = nil + case *map[bool]int: + *v = nil + case *map[bool]int8: + *v = nil + case *map[bool]int16: + *v = nil + case *map[bool]int32: + *v = nil + case *map[bool]int64: + *v = nil + case *map[bool]float32: + *v = nil + case *map[bool]float64: + *v = nil + case *map[bool]bool: + *v = nil + default: + _ = v // workaround https://github.com/golang/go/issues/12927 seen in go1.4 + return false + } + return true +} + +// -- -- fast path functions + +func (d *Decoder) fastpathDecSliceIntfR(f *codecFnInfo, rv reflect.Value) { + if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*[]interface{}) + v, changed := fastpathTV.DecSliceIntfV(*vp, !array, d) + if changed { + *vp = v + } + } else { + v := rv2i(rv).([]interface{}) + v2, changed := fastpathTV.DecSliceIntfV(v, !array, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + } +} +func (f fastpathT) DecSliceIntfX(vp *[]interface{}, d *Decoder) { + v, changed := f.DecSliceIntfV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecSliceIntfV(v []interface{}, canChange bool, d *Decoder) (_ []interface{}, changed bool) { + dd := d.d + slh, containerLenS := d.decSliceHelperStart() + if containerLenS == 0 { + if canChange { + if v == nil { + v = []interface{}{} + } else if len(v) != 0 { + v = v[:0] + } + changed = true + } + slh.End() + return v, changed + } + d.depthIncr() + hasLen := containerLenS > 0 + var xlen int + if hasLen && canChange { + if containerLenS > cap(v) { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16) + if xlen <= cap(v) { + v = v[:uint(xlen)] + } else { + v = make([]interface{}, uint(xlen)) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + var j int + for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { + if j == 0 && len(v) == 0 && canChange { + if hasLen { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16) + } else { + xlen = 8 + } + v = make([]interface{}, uint(xlen)) + changed = true + } + // if indefinite, etc, then expand the slice if necessary + var decodeIntoBlank bool + if j >= len(v) { + if canChange { + v = append(v, nil) + changed = true + } else { + d.arrayCannotExpand(len(v), j+1) + decodeIntoBlank = true + } + } + slh.ElemContainerState(j) + if decodeIntoBlank { + d.swallow() + } else if dd.TryDecodeAsNil() { + v[uint(j)] = nil + } else { + d.decode(&v[uint(j)]) + } + } + if canChange { + if j < len(v) { + v = v[:uint(j)] + changed = true + } else if j == 0 && v == nil { + v = make([]interface{}, 0) + changed = true + } + } + slh.End() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecSliceStringR(f *codecFnInfo, rv reflect.Value) { + if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*[]string) + v, changed := fastpathTV.DecSliceStringV(*vp, !array, d) + if changed { + *vp = v + } + } else { + v := rv2i(rv).([]string) + v2, changed := fastpathTV.DecSliceStringV(v, !array, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + } +} +func (f fastpathT) DecSliceStringX(vp *[]string, d *Decoder) { + v, changed := f.DecSliceStringV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecSliceStringV(v []string, canChange bool, d *Decoder) (_ []string, changed bool) { + dd := d.d + slh, containerLenS := d.decSliceHelperStart() + if containerLenS == 0 { + if canChange { + if v == nil { + v = []string{} + } else if len(v) != 0 { + v = v[:0] + } + changed = true + } + slh.End() + return v, changed + } + d.depthIncr() + hasLen := containerLenS > 0 + var xlen int + if hasLen && canChange { + if containerLenS > cap(v) { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16) + if xlen <= cap(v) { + v = v[:uint(xlen)] + } else { + v = make([]string, uint(xlen)) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + var j int + for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { + if j == 0 && len(v) == 0 && canChange { + if hasLen { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 16) + } else { + xlen = 8 + } + v = make([]string, uint(xlen)) + changed = true + } + // if indefinite, etc, then expand the slice if necessary + var decodeIntoBlank bool + if j >= len(v) { + if canChange { + v = append(v, "") + changed = true + } else { + d.arrayCannotExpand(len(v), j+1) + decodeIntoBlank = true + } + } + slh.ElemContainerState(j) + if decodeIntoBlank { + d.swallow() + } else if dd.TryDecodeAsNil() { + v[uint(j)] = "" + } else { + v[uint(j)] = dd.DecodeString() + } + } + if canChange { + if j < len(v) { + v = v[:uint(j)] + changed = true + } else if j == 0 && v == nil { + v = make([]string, 0) + changed = true + } + } + slh.End() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecSliceFloat32R(f *codecFnInfo, rv reflect.Value) { + if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*[]float32) + v, changed := fastpathTV.DecSliceFloat32V(*vp, !array, d) + if changed { + *vp = v + } + } else { + v := rv2i(rv).([]float32) + v2, changed := fastpathTV.DecSliceFloat32V(v, !array, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + } +} +func (f fastpathT) DecSliceFloat32X(vp *[]float32, d *Decoder) { + v, changed := f.DecSliceFloat32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecSliceFloat32V(v []float32, canChange bool, d *Decoder) (_ []float32, changed bool) { + dd := d.d + slh, containerLenS := d.decSliceHelperStart() + if containerLenS == 0 { + if canChange { + if v == nil { + v = []float32{} + } else if len(v) != 0 { + v = v[:0] + } + changed = true + } + slh.End() + return v, changed + } + d.depthIncr() + hasLen := containerLenS > 0 + var xlen int + if hasLen && canChange { + if containerLenS > cap(v) { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4) + if xlen <= cap(v) { + v = v[:uint(xlen)] + } else { + v = make([]float32, uint(xlen)) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + var j int + for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { + if j == 0 && len(v) == 0 && canChange { + if hasLen { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4) + } else { + xlen = 8 + } + v = make([]float32, uint(xlen)) + changed = true + } + // if indefinite, etc, then expand the slice if necessary + var decodeIntoBlank bool + if j >= len(v) { + if canChange { + v = append(v, 0) + changed = true + } else { + d.arrayCannotExpand(len(v), j+1) + decodeIntoBlank = true + } + } + slh.ElemContainerState(j) + if decodeIntoBlank { + d.swallow() + } else if dd.TryDecodeAsNil() { + v[uint(j)] = 0 + } else { + v[uint(j)] = float32(chkOvf.Float32V(dd.DecodeFloat64())) + } + } + if canChange { + if j < len(v) { + v = v[:uint(j)] + changed = true + } else if j == 0 && v == nil { + v = make([]float32, 0) + changed = true + } + } + slh.End() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecSliceFloat64R(f *codecFnInfo, rv reflect.Value) { + if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*[]float64) + v, changed := fastpathTV.DecSliceFloat64V(*vp, !array, d) + if changed { + *vp = v + } + } else { + v := rv2i(rv).([]float64) + v2, changed := fastpathTV.DecSliceFloat64V(v, !array, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + } +} +func (f fastpathT) DecSliceFloat64X(vp *[]float64, d *Decoder) { + v, changed := f.DecSliceFloat64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecSliceFloat64V(v []float64, canChange bool, d *Decoder) (_ []float64, changed bool) { + dd := d.d + slh, containerLenS := d.decSliceHelperStart() + if containerLenS == 0 { + if canChange { + if v == nil { + v = []float64{} + } else if len(v) != 0 { + v = v[:0] + } + changed = true + } + slh.End() + return v, changed + } + d.depthIncr() + hasLen := containerLenS > 0 + var xlen int + if hasLen && canChange { + if containerLenS > cap(v) { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8) + if xlen <= cap(v) { + v = v[:uint(xlen)] + } else { + v = make([]float64, uint(xlen)) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + var j int + for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { + if j == 0 && len(v) == 0 && canChange { + if hasLen { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8) + } else { + xlen = 8 + } + v = make([]float64, uint(xlen)) + changed = true + } + // if indefinite, etc, then expand the slice if necessary + var decodeIntoBlank bool + if j >= len(v) { + if canChange { + v = append(v, 0) + changed = true + } else { + d.arrayCannotExpand(len(v), j+1) + decodeIntoBlank = true + } + } + slh.ElemContainerState(j) + if decodeIntoBlank { + d.swallow() + } else if dd.TryDecodeAsNil() { + v[uint(j)] = 0 + } else { + v[uint(j)] = dd.DecodeFloat64() + } + } + if canChange { + if j < len(v) { + v = v[:uint(j)] + changed = true + } else if j == 0 && v == nil { + v = make([]float64, 0) + changed = true + } + } + slh.End() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecSliceUintR(f *codecFnInfo, rv reflect.Value) { + if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*[]uint) + v, changed := fastpathTV.DecSliceUintV(*vp, !array, d) + if changed { + *vp = v + } + } else { + v := rv2i(rv).([]uint) + v2, changed := fastpathTV.DecSliceUintV(v, !array, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + } +} +func (f fastpathT) DecSliceUintX(vp *[]uint, d *Decoder) { + v, changed := f.DecSliceUintV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecSliceUintV(v []uint, canChange bool, d *Decoder) (_ []uint, changed bool) { + dd := d.d + slh, containerLenS := d.decSliceHelperStart() + if containerLenS == 0 { + if canChange { + if v == nil { + v = []uint{} + } else if len(v) != 0 { + v = v[:0] + } + changed = true + } + slh.End() + return v, changed + } + d.depthIncr() + hasLen := containerLenS > 0 + var xlen int + if hasLen && canChange { + if containerLenS > cap(v) { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8) + if xlen <= cap(v) { + v = v[:uint(xlen)] + } else { + v = make([]uint, uint(xlen)) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + var j int + for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { + if j == 0 && len(v) == 0 && canChange { + if hasLen { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8) + } else { + xlen = 8 + } + v = make([]uint, uint(xlen)) + changed = true + } + // if indefinite, etc, then expand the slice if necessary + var decodeIntoBlank bool + if j >= len(v) { + if canChange { + v = append(v, 0) + changed = true + } else { + d.arrayCannotExpand(len(v), j+1) + decodeIntoBlank = true + } + } + slh.ElemContainerState(j) + if decodeIntoBlank { + d.swallow() + } else if dd.TryDecodeAsNil() { + v[uint(j)] = 0 + } else { + v[uint(j)] = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + } + } + if canChange { + if j < len(v) { + v = v[:uint(j)] + changed = true + } else if j == 0 && v == nil { + v = make([]uint, 0) + changed = true + } + } + slh.End() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecSliceUint8R(f *codecFnInfo, rv reflect.Value) { + if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*[]uint8) + v, changed := fastpathTV.DecSliceUint8V(*vp, !array, d) + if changed { + *vp = v + } + } else { + v := rv2i(rv).([]uint8) + v2, changed := fastpathTV.DecSliceUint8V(v, !array, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + } +} +func (f fastpathT) DecSliceUint8X(vp *[]uint8, d *Decoder) { + v, changed := f.DecSliceUint8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecSliceUint8V(v []uint8, canChange bool, d *Decoder) (_ []uint8, changed bool) { + dd := d.d + slh, containerLenS := d.decSliceHelperStart() + if containerLenS == 0 { + if canChange { + if v == nil { + v = []uint8{} + } else if len(v) != 0 { + v = v[:0] + } + changed = true + } + slh.End() + return v, changed + } + d.depthIncr() + hasLen := containerLenS > 0 + var xlen int + if hasLen && canChange { + if containerLenS > cap(v) { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1) + if xlen <= cap(v) { + v = v[:uint(xlen)] + } else { + v = make([]uint8, uint(xlen)) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + var j int + for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { + if j == 0 && len(v) == 0 && canChange { + if hasLen { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1) + } else { + xlen = 8 + } + v = make([]uint8, uint(xlen)) + changed = true + } + // if indefinite, etc, then expand the slice if necessary + var decodeIntoBlank bool + if j >= len(v) { + if canChange { + v = append(v, 0) + changed = true + } else { + d.arrayCannotExpand(len(v), j+1) + decodeIntoBlank = true + } + } + slh.ElemContainerState(j) + if decodeIntoBlank { + d.swallow() + } else if dd.TryDecodeAsNil() { + v[uint(j)] = 0 + } else { + v[uint(j)] = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + } + } + if canChange { + if j < len(v) { + v = v[:uint(j)] + changed = true + } else if j == 0 && v == nil { + v = make([]uint8, 0) + changed = true + } + } + slh.End() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecSliceUint16R(f *codecFnInfo, rv reflect.Value) { + if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*[]uint16) + v, changed := fastpathTV.DecSliceUint16V(*vp, !array, d) + if changed { + *vp = v + } + } else { + v := rv2i(rv).([]uint16) + v2, changed := fastpathTV.DecSliceUint16V(v, !array, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + } +} +func (f fastpathT) DecSliceUint16X(vp *[]uint16, d *Decoder) { + v, changed := f.DecSliceUint16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecSliceUint16V(v []uint16, canChange bool, d *Decoder) (_ []uint16, changed bool) { + dd := d.d + slh, containerLenS := d.decSliceHelperStart() + if containerLenS == 0 { + if canChange { + if v == nil { + v = []uint16{} + } else if len(v) != 0 { + v = v[:0] + } + changed = true + } + slh.End() + return v, changed + } + d.depthIncr() + hasLen := containerLenS > 0 + var xlen int + if hasLen && canChange { + if containerLenS > cap(v) { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2) + if xlen <= cap(v) { + v = v[:uint(xlen)] + } else { + v = make([]uint16, uint(xlen)) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + var j int + for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { + if j == 0 && len(v) == 0 && canChange { + if hasLen { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2) + } else { + xlen = 8 + } + v = make([]uint16, uint(xlen)) + changed = true + } + // if indefinite, etc, then expand the slice if necessary + var decodeIntoBlank bool + if j >= len(v) { + if canChange { + v = append(v, 0) + changed = true + } else { + d.arrayCannotExpand(len(v), j+1) + decodeIntoBlank = true + } + } + slh.ElemContainerState(j) + if decodeIntoBlank { + d.swallow() + } else if dd.TryDecodeAsNil() { + v[uint(j)] = 0 + } else { + v[uint(j)] = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + } + } + if canChange { + if j < len(v) { + v = v[:uint(j)] + changed = true + } else if j == 0 && v == nil { + v = make([]uint16, 0) + changed = true + } + } + slh.End() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecSliceUint32R(f *codecFnInfo, rv reflect.Value) { + if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*[]uint32) + v, changed := fastpathTV.DecSliceUint32V(*vp, !array, d) + if changed { + *vp = v + } + } else { + v := rv2i(rv).([]uint32) + v2, changed := fastpathTV.DecSliceUint32V(v, !array, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + } +} +func (f fastpathT) DecSliceUint32X(vp *[]uint32, d *Decoder) { + v, changed := f.DecSliceUint32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecSliceUint32V(v []uint32, canChange bool, d *Decoder) (_ []uint32, changed bool) { + dd := d.d + slh, containerLenS := d.decSliceHelperStart() + if containerLenS == 0 { + if canChange { + if v == nil { + v = []uint32{} + } else if len(v) != 0 { + v = v[:0] + } + changed = true + } + slh.End() + return v, changed + } + d.depthIncr() + hasLen := containerLenS > 0 + var xlen int + if hasLen && canChange { + if containerLenS > cap(v) { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4) + if xlen <= cap(v) { + v = v[:uint(xlen)] + } else { + v = make([]uint32, uint(xlen)) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + var j int + for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { + if j == 0 && len(v) == 0 && canChange { + if hasLen { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4) + } else { + xlen = 8 + } + v = make([]uint32, uint(xlen)) + changed = true + } + // if indefinite, etc, then expand the slice if necessary + var decodeIntoBlank bool + if j >= len(v) { + if canChange { + v = append(v, 0) + changed = true + } else { + d.arrayCannotExpand(len(v), j+1) + decodeIntoBlank = true + } + } + slh.ElemContainerState(j) + if decodeIntoBlank { + d.swallow() + } else if dd.TryDecodeAsNil() { + v[uint(j)] = 0 + } else { + v[uint(j)] = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + } + } + if canChange { + if j < len(v) { + v = v[:uint(j)] + changed = true + } else if j == 0 && v == nil { + v = make([]uint32, 0) + changed = true + } + } + slh.End() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecSliceUint64R(f *codecFnInfo, rv reflect.Value) { + if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*[]uint64) + v, changed := fastpathTV.DecSliceUint64V(*vp, !array, d) + if changed { + *vp = v + } + } else { + v := rv2i(rv).([]uint64) + v2, changed := fastpathTV.DecSliceUint64V(v, !array, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + } +} +func (f fastpathT) DecSliceUint64X(vp *[]uint64, d *Decoder) { + v, changed := f.DecSliceUint64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecSliceUint64V(v []uint64, canChange bool, d *Decoder) (_ []uint64, changed bool) { + dd := d.d + slh, containerLenS := d.decSliceHelperStart() + if containerLenS == 0 { + if canChange { + if v == nil { + v = []uint64{} + } else if len(v) != 0 { + v = v[:0] + } + changed = true + } + slh.End() + return v, changed + } + d.depthIncr() + hasLen := containerLenS > 0 + var xlen int + if hasLen && canChange { + if containerLenS > cap(v) { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8) + if xlen <= cap(v) { + v = v[:uint(xlen)] + } else { + v = make([]uint64, uint(xlen)) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + var j int + for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { + if j == 0 && len(v) == 0 && canChange { + if hasLen { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8) + } else { + xlen = 8 + } + v = make([]uint64, uint(xlen)) + changed = true + } + // if indefinite, etc, then expand the slice if necessary + var decodeIntoBlank bool + if j >= len(v) { + if canChange { + v = append(v, 0) + changed = true + } else { + d.arrayCannotExpand(len(v), j+1) + decodeIntoBlank = true + } + } + slh.ElemContainerState(j) + if decodeIntoBlank { + d.swallow() + } else if dd.TryDecodeAsNil() { + v[uint(j)] = 0 + } else { + v[uint(j)] = dd.DecodeUint64() + } + } + if canChange { + if j < len(v) { + v = v[:uint(j)] + changed = true + } else if j == 0 && v == nil { + v = make([]uint64, 0) + changed = true + } + } + slh.End() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecSliceUintptrR(f *codecFnInfo, rv reflect.Value) { + if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*[]uintptr) + v, changed := fastpathTV.DecSliceUintptrV(*vp, !array, d) + if changed { + *vp = v + } + } else { + v := rv2i(rv).([]uintptr) + v2, changed := fastpathTV.DecSliceUintptrV(v, !array, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + } +} +func (f fastpathT) DecSliceUintptrX(vp *[]uintptr, d *Decoder) { + v, changed := f.DecSliceUintptrV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecSliceUintptrV(v []uintptr, canChange bool, d *Decoder) (_ []uintptr, changed bool) { + dd := d.d + slh, containerLenS := d.decSliceHelperStart() + if containerLenS == 0 { + if canChange { + if v == nil { + v = []uintptr{} + } else if len(v) != 0 { + v = v[:0] + } + changed = true + } + slh.End() + return v, changed + } + d.depthIncr() + hasLen := containerLenS > 0 + var xlen int + if hasLen && canChange { + if containerLenS > cap(v) { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8) + if xlen <= cap(v) { + v = v[:uint(xlen)] + } else { + v = make([]uintptr, uint(xlen)) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + var j int + for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { + if j == 0 && len(v) == 0 && canChange { + if hasLen { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8) + } else { + xlen = 8 + } + v = make([]uintptr, uint(xlen)) + changed = true + } + // if indefinite, etc, then expand the slice if necessary + var decodeIntoBlank bool + if j >= len(v) { + if canChange { + v = append(v, 0) + changed = true + } else { + d.arrayCannotExpand(len(v), j+1) + decodeIntoBlank = true + } + } + slh.ElemContainerState(j) + if decodeIntoBlank { + d.swallow() + } else if dd.TryDecodeAsNil() { + v[uint(j)] = 0 + } else { + v[uint(j)] = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + } + } + if canChange { + if j < len(v) { + v = v[:uint(j)] + changed = true + } else if j == 0 && v == nil { + v = make([]uintptr, 0) + changed = true + } + } + slh.End() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecSliceIntR(f *codecFnInfo, rv reflect.Value) { + if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*[]int) + v, changed := fastpathTV.DecSliceIntV(*vp, !array, d) + if changed { + *vp = v + } + } else { + v := rv2i(rv).([]int) + v2, changed := fastpathTV.DecSliceIntV(v, !array, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + } +} +func (f fastpathT) DecSliceIntX(vp *[]int, d *Decoder) { + v, changed := f.DecSliceIntV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecSliceIntV(v []int, canChange bool, d *Decoder) (_ []int, changed bool) { + dd := d.d + slh, containerLenS := d.decSliceHelperStart() + if containerLenS == 0 { + if canChange { + if v == nil { + v = []int{} + } else if len(v) != 0 { + v = v[:0] + } + changed = true + } + slh.End() + return v, changed + } + d.depthIncr() + hasLen := containerLenS > 0 + var xlen int + if hasLen && canChange { + if containerLenS > cap(v) { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8) + if xlen <= cap(v) { + v = v[:uint(xlen)] + } else { + v = make([]int, uint(xlen)) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + var j int + for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { + if j == 0 && len(v) == 0 && canChange { + if hasLen { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8) + } else { + xlen = 8 + } + v = make([]int, uint(xlen)) + changed = true + } + // if indefinite, etc, then expand the slice if necessary + var decodeIntoBlank bool + if j >= len(v) { + if canChange { + v = append(v, 0) + changed = true + } else { + d.arrayCannotExpand(len(v), j+1) + decodeIntoBlank = true + } + } + slh.ElemContainerState(j) + if decodeIntoBlank { + d.swallow() + } else if dd.TryDecodeAsNil() { + v[uint(j)] = 0 + } else { + v[uint(j)] = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + } + } + if canChange { + if j < len(v) { + v = v[:uint(j)] + changed = true + } else if j == 0 && v == nil { + v = make([]int, 0) + changed = true + } + } + slh.End() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecSliceInt8R(f *codecFnInfo, rv reflect.Value) { + if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*[]int8) + v, changed := fastpathTV.DecSliceInt8V(*vp, !array, d) + if changed { + *vp = v + } + } else { + v := rv2i(rv).([]int8) + v2, changed := fastpathTV.DecSliceInt8V(v, !array, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + } +} +func (f fastpathT) DecSliceInt8X(vp *[]int8, d *Decoder) { + v, changed := f.DecSliceInt8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecSliceInt8V(v []int8, canChange bool, d *Decoder) (_ []int8, changed bool) { + dd := d.d + slh, containerLenS := d.decSliceHelperStart() + if containerLenS == 0 { + if canChange { + if v == nil { + v = []int8{} + } else if len(v) != 0 { + v = v[:0] + } + changed = true + } + slh.End() + return v, changed + } + d.depthIncr() + hasLen := containerLenS > 0 + var xlen int + if hasLen && canChange { + if containerLenS > cap(v) { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1) + if xlen <= cap(v) { + v = v[:uint(xlen)] + } else { + v = make([]int8, uint(xlen)) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + var j int + for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { + if j == 0 && len(v) == 0 && canChange { + if hasLen { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1) + } else { + xlen = 8 + } + v = make([]int8, uint(xlen)) + changed = true + } + // if indefinite, etc, then expand the slice if necessary + var decodeIntoBlank bool + if j >= len(v) { + if canChange { + v = append(v, 0) + changed = true + } else { + d.arrayCannotExpand(len(v), j+1) + decodeIntoBlank = true + } + } + slh.ElemContainerState(j) + if decodeIntoBlank { + d.swallow() + } else if dd.TryDecodeAsNil() { + v[uint(j)] = 0 + } else { + v[uint(j)] = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + } + } + if canChange { + if j < len(v) { + v = v[:uint(j)] + changed = true + } else if j == 0 && v == nil { + v = make([]int8, 0) + changed = true + } + } + slh.End() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecSliceInt16R(f *codecFnInfo, rv reflect.Value) { + if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*[]int16) + v, changed := fastpathTV.DecSliceInt16V(*vp, !array, d) + if changed { + *vp = v + } + } else { + v := rv2i(rv).([]int16) + v2, changed := fastpathTV.DecSliceInt16V(v, !array, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + } +} +func (f fastpathT) DecSliceInt16X(vp *[]int16, d *Decoder) { + v, changed := f.DecSliceInt16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecSliceInt16V(v []int16, canChange bool, d *Decoder) (_ []int16, changed bool) { + dd := d.d + slh, containerLenS := d.decSliceHelperStart() + if containerLenS == 0 { + if canChange { + if v == nil { + v = []int16{} + } else if len(v) != 0 { + v = v[:0] + } + changed = true + } + slh.End() + return v, changed + } + d.depthIncr() + hasLen := containerLenS > 0 + var xlen int + if hasLen && canChange { + if containerLenS > cap(v) { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2) + if xlen <= cap(v) { + v = v[:uint(xlen)] + } else { + v = make([]int16, uint(xlen)) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + var j int + for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { + if j == 0 && len(v) == 0 && canChange { + if hasLen { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 2) + } else { + xlen = 8 + } + v = make([]int16, uint(xlen)) + changed = true + } + // if indefinite, etc, then expand the slice if necessary + var decodeIntoBlank bool + if j >= len(v) { + if canChange { + v = append(v, 0) + changed = true + } else { + d.arrayCannotExpand(len(v), j+1) + decodeIntoBlank = true + } + } + slh.ElemContainerState(j) + if decodeIntoBlank { + d.swallow() + } else if dd.TryDecodeAsNil() { + v[uint(j)] = 0 + } else { + v[uint(j)] = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + } + } + if canChange { + if j < len(v) { + v = v[:uint(j)] + changed = true + } else if j == 0 && v == nil { + v = make([]int16, 0) + changed = true + } + } + slh.End() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecSliceInt32R(f *codecFnInfo, rv reflect.Value) { + if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*[]int32) + v, changed := fastpathTV.DecSliceInt32V(*vp, !array, d) + if changed { + *vp = v + } + } else { + v := rv2i(rv).([]int32) + v2, changed := fastpathTV.DecSliceInt32V(v, !array, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + } +} +func (f fastpathT) DecSliceInt32X(vp *[]int32, d *Decoder) { + v, changed := f.DecSliceInt32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecSliceInt32V(v []int32, canChange bool, d *Decoder) (_ []int32, changed bool) { + dd := d.d + slh, containerLenS := d.decSliceHelperStart() + if containerLenS == 0 { + if canChange { + if v == nil { + v = []int32{} + } else if len(v) != 0 { + v = v[:0] + } + changed = true + } + slh.End() + return v, changed + } + d.depthIncr() + hasLen := containerLenS > 0 + var xlen int + if hasLen && canChange { + if containerLenS > cap(v) { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4) + if xlen <= cap(v) { + v = v[:uint(xlen)] + } else { + v = make([]int32, uint(xlen)) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + var j int + for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { + if j == 0 && len(v) == 0 && canChange { + if hasLen { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 4) + } else { + xlen = 8 + } + v = make([]int32, uint(xlen)) + changed = true + } + // if indefinite, etc, then expand the slice if necessary + var decodeIntoBlank bool + if j >= len(v) { + if canChange { + v = append(v, 0) + changed = true + } else { + d.arrayCannotExpand(len(v), j+1) + decodeIntoBlank = true + } + } + slh.ElemContainerState(j) + if decodeIntoBlank { + d.swallow() + } else if dd.TryDecodeAsNil() { + v[uint(j)] = 0 + } else { + v[uint(j)] = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + } + } + if canChange { + if j < len(v) { + v = v[:uint(j)] + changed = true + } else if j == 0 && v == nil { + v = make([]int32, 0) + changed = true + } + } + slh.End() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecSliceInt64R(f *codecFnInfo, rv reflect.Value) { + if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*[]int64) + v, changed := fastpathTV.DecSliceInt64V(*vp, !array, d) + if changed { + *vp = v + } + } else { + v := rv2i(rv).([]int64) + v2, changed := fastpathTV.DecSliceInt64V(v, !array, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + } +} +func (f fastpathT) DecSliceInt64X(vp *[]int64, d *Decoder) { + v, changed := f.DecSliceInt64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecSliceInt64V(v []int64, canChange bool, d *Decoder) (_ []int64, changed bool) { + dd := d.d + slh, containerLenS := d.decSliceHelperStart() + if containerLenS == 0 { + if canChange { + if v == nil { + v = []int64{} + } else if len(v) != 0 { + v = v[:0] + } + changed = true + } + slh.End() + return v, changed + } + d.depthIncr() + hasLen := containerLenS > 0 + var xlen int + if hasLen && canChange { + if containerLenS > cap(v) { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8) + if xlen <= cap(v) { + v = v[:uint(xlen)] + } else { + v = make([]int64, uint(xlen)) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + var j int + for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { + if j == 0 && len(v) == 0 && canChange { + if hasLen { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 8) + } else { + xlen = 8 + } + v = make([]int64, uint(xlen)) + changed = true + } + // if indefinite, etc, then expand the slice if necessary + var decodeIntoBlank bool + if j >= len(v) { + if canChange { + v = append(v, 0) + changed = true + } else { + d.arrayCannotExpand(len(v), j+1) + decodeIntoBlank = true + } + } + slh.ElemContainerState(j) + if decodeIntoBlank { + d.swallow() + } else if dd.TryDecodeAsNil() { + v[uint(j)] = 0 + } else { + v[uint(j)] = dd.DecodeInt64() + } + } + if canChange { + if j < len(v) { + v = v[:uint(j)] + changed = true + } else if j == 0 && v == nil { + v = make([]int64, 0) + changed = true + } + } + slh.End() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecSliceBoolR(f *codecFnInfo, rv reflect.Value) { + if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*[]bool) + v, changed := fastpathTV.DecSliceBoolV(*vp, !array, d) + if changed { + *vp = v + } + } else { + v := rv2i(rv).([]bool) + v2, changed := fastpathTV.DecSliceBoolV(v, !array, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + } +} +func (f fastpathT) DecSliceBoolX(vp *[]bool, d *Decoder) { + v, changed := f.DecSliceBoolV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecSliceBoolV(v []bool, canChange bool, d *Decoder) (_ []bool, changed bool) { + dd := d.d + slh, containerLenS := d.decSliceHelperStart() + if containerLenS == 0 { + if canChange { + if v == nil { + v = []bool{} + } else if len(v) != 0 { + v = v[:0] + } + changed = true + } + slh.End() + return v, changed + } + d.depthIncr() + hasLen := containerLenS > 0 + var xlen int + if hasLen && canChange { + if containerLenS > cap(v) { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1) + if xlen <= cap(v) { + v = v[:uint(xlen)] + } else { + v = make([]bool, uint(xlen)) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + var j int + for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { + if j == 0 && len(v) == 0 && canChange { + if hasLen { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, 1) + } else { + xlen = 8 + } + v = make([]bool, uint(xlen)) + changed = true + } + // if indefinite, etc, then expand the slice if necessary + var decodeIntoBlank bool + if j >= len(v) { + if canChange { + v = append(v, false) + changed = true + } else { + d.arrayCannotExpand(len(v), j+1) + decodeIntoBlank = true + } + } + slh.ElemContainerState(j) + if decodeIntoBlank { + d.swallow() + } else if dd.TryDecodeAsNil() { + v[uint(j)] = false + } else { + v[uint(j)] = dd.DecodeBool() + } + } + if canChange { + if j < len(v) { + v = v[:uint(j)] + changed = true + } else if j == 0 && v == nil { + v = make([]bool, 0) + changed = true + } + } + slh.End() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntfIntfR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[interface{}]interface{}) + v, changed := fastpathTV.DecMapIntfIntfV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntfIntfV(rv2i(rv).(map[interface{}]interface{}), false, d) + } +} +func (f fastpathT) DecMapIntfIntfX(vp *map[interface{}]interface{}, d *Decoder) { + v, changed := f.DecMapIntfIntfV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntfIntfV(v map[interface{}]interface{}, canChange bool, + d *Decoder) (_ map[interface{}]interface{}, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 32) + v = make(map[interface{}]interface{}, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset + var mk interface{} + var mv interface{} + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = nil + d.decode(&mk) + if bv, bok := mk.([]byte); bok { + mk = d.string(bv) + } + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = nil + } + continue + } + if mapGet { + mv = v[mk] + } else { + mv = nil + } + d.decode(&mv) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntfStringR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[interface{}]string) + v, changed := fastpathTV.DecMapIntfStringV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntfStringV(rv2i(rv).(map[interface{}]string), false, d) + } +} +func (f fastpathT) DecMapIntfStringX(vp *map[interface{}]string, d *Decoder) { + v, changed := f.DecMapIntfStringV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntfStringV(v map[interface{}]string, canChange bool, + d *Decoder) (_ map[interface{}]string, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 32) + v = make(map[interface{}]string, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk interface{} + var mv string + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = nil + d.decode(&mk) + if bv, bok := mk.([]byte); bok { + mk = d.string(bv) + } + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = "" + } + continue + } + mv = dd.DecodeString() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntfUintR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[interface{}]uint) + v, changed := fastpathTV.DecMapIntfUintV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntfUintV(rv2i(rv).(map[interface{}]uint), false, d) + } +} +func (f fastpathT) DecMapIntfUintX(vp *map[interface{}]uint, d *Decoder) { + v, changed := f.DecMapIntfUintV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntfUintV(v map[interface{}]uint, canChange bool, + d *Decoder) (_ map[interface{}]uint, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[interface{}]uint, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk interface{} + var mv uint + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = nil + d.decode(&mk) + if bv, bok := mk.([]byte); bok { + mk = d.string(bv) + } + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntfUint8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[interface{}]uint8) + v, changed := fastpathTV.DecMapIntfUint8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntfUint8V(rv2i(rv).(map[interface{}]uint8), false, d) + } +} +func (f fastpathT) DecMapIntfUint8X(vp *map[interface{}]uint8, d *Decoder) { + v, changed := f.DecMapIntfUint8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntfUint8V(v map[interface{}]uint8, canChange bool, + d *Decoder) (_ map[interface{}]uint8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 17) + v = make(map[interface{}]uint8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk interface{} + var mv uint8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = nil + d.decode(&mk) + if bv, bok := mk.([]byte); bok { + mk = d.string(bv) + } + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntfUint16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[interface{}]uint16) + v, changed := fastpathTV.DecMapIntfUint16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntfUint16V(rv2i(rv).(map[interface{}]uint16), false, d) + } +} +func (f fastpathT) DecMapIntfUint16X(vp *map[interface{}]uint16, d *Decoder) { + v, changed := f.DecMapIntfUint16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntfUint16V(v map[interface{}]uint16, canChange bool, + d *Decoder) (_ map[interface{}]uint16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 18) + v = make(map[interface{}]uint16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk interface{} + var mv uint16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = nil + d.decode(&mk) + if bv, bok := mk.([]byte); bok { + mk = d.string(bv) + } + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntfUint32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[interface{}]uint32) + v, changed := fastpathTV.DecMapIntfUint32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntfUint32V(rv2i(rv).(map[interface{}]uint32), false, d) + } +} +func (f fastpathT) DecMapIntfUint32X(vp *map[interface{}]uint32, d *Decoder) { + v, changed := f.DecMapIntfUint32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntfUint32V(v map[interface{}]uint32, canChange bool, + d *Decoder) (_ map[interface{}]uint32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 20) + v = make(map[interface{}]uint32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk interface{} + var mv uint32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = nil + d.decode(&mk) + if bv, bok := mk.([]byte); bok { + mk = d.string(bv) + } + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntfUint64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[interface{}]uint64) + v, changed := fastpathTV.DecMapIntfUint64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntfUint64V(rv2i(rv).(map[interface{}]uint64), false, d) + } +} +func (f fastpathT) DecMapIntfUint64X(vp *map[interface{}]uint64, d *Decoder) { + v, changed := f.DecMapIntfUint64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntfUint64V(v map[interface{}]uint64, canChange bool, + d *Decoder) (_ map[interface{}]uint64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[interface{}]uint64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk interface{} + var mv uint64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = nil + d.decode(&mk) + if bv, bok := mk.([]byte); bok { + mk = d.string(bv) + } + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeUint64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntfUintptrR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[interface{}]uintptr) + v, changed := fastpathTV.DecMapIntfUintptrV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntfUintptrV(rv2i(rv).(map[interface{}]uintptr), false, d) + } +} +func (f fastpathT) DecMapIntfUintptrX(vp *map[interface{}]uintptr, d *Decoder) { + v, changed := f.DecMapIntfUintptrV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntfUintptrV(v map[interface{}]uintptr, canChange bool, + d *Decoder) (_ map[interface{}]uintptr, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[interface{}]uintptr, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk interface{} + var mv uintptr + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = nil + d.decode(&mk) + if bv, bok := mk.([]byte); bok { + mk = d.string(bv) + } + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntfIntR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[interface{}]int) + v, changed := fastpathTV.DecMapIntfIntV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntfIntV(rv2i(rv).(map[interface{}]int), false, d) + } +} +func (f fastpathT) DecMapIntfIntX(vp *map[interface{}]int, d *Decoder) { + v, changed := f.DecMapIntfIntV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntfIntV(v map[interface{}]int, canChange bool, + d *Decoder) (_ map[interface{}]int, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[interface{}]int, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk interface{} + var mv int + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = nil + d.decode(&mk) + if bv, bok := mk.([]byte); bok { + mk = d.string(bv) + } + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntfInt8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[interface{}]int8) + v, changed := fastpathTV.DecMapIntfInt8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntfInt8V(rv2i(rv).(map[interface{}]int8), false, d) + } +} +func (f fastpathT) DecMapIntfInt8X(vp *map[interface{}]int8, d *Decoder) { + v, changed := f.DecMapIntfInt8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntfInt8V(v map[interface{}]int8, canChange bool, + d *Decoder) (_ map[interface{}]int8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 17) + v = make(map[interface{}]int8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk interface{} + var mv int8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = nil + d.decode(&mk) + if bv, bok := mk.([]byte); bok { + mk = d.string(bv) + } + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntfInt16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[interface{}]int16) + v, changed := fastpathTV.DecMapIntfInt16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntfInt16V(rv2i(rv).(map[interface{}]int16), false, d) + } +} +func (f fastpathT) DecMapIntfInt16X(vp *map[interface{}]int16, d *Decoder) { + v, changed := f.DecMapIntfInt16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntfInt16V(v map[interface{}]int16, canChange bool, + d *Decoder) (_ map[interface{}]int16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 18) + v = make(map[interface{}]int16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk interface{} + var mv int16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = nil + d.decode(&mk) + if bv, bok := mk.([]byte); bok { + mk = d.string(bv) + } + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntfInt32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[interface{}]int32) + v, changed := fastpathTV.DecMapIntfInt32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntfInt32V(rv2i(rv).(map[interface{}]int32), false, d) + } +} +func (f fastpathT) DecMapIntfInt32X(vp *map[interface{}]int32, d *Decoder) { + v, changed := f.DecMapIntfInt32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntfInt32V(v map[interface{}]int32, canChange bool, + d *Decoder) (_ map[interface{}]int32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 20) + v = make(map[interface{}]int32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk interface{} + var mv int32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = nil + d.decode(&mk) + if bv, bok := mk.([]byte); bok { + mk = d.string(bv) + } + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntfInt64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[interface{}]int64) + v, changed := fastpathTV.DecMapIntfInt64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntfInt64V(rv2i(rv).(map[interface{}]int64), false, d) + } +} +func (f fastpathT) DecMapIntfInt64X(vp *map[interface{}]int64, d *Decoder) { + v, changed := f.DecMapIntfInt64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntfInt64V(v map[interface{}]int64, canChange bool, + d *Decoder) (_ map[interface{}]int64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[interface{}]int64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk interface{} + var mv int64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = nil + d.decode(&mk) + if bv, bok := mk.([]byte); bok { + mk = d.string(bv) + } + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeInt64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntfFloat32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[interface{}]float32) + v, changed := fastpathTV.DecMapIntfFloat32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntfFloat32V(rv2i(rv).(map[interface{}]float32), false, d) + } +} +func (f fastpathT) DecMapIntfFloat32X(vp *map[interface{}]float32, d *Decoder) { + v, changed := f.DecMapIntfFloat32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntfFloat32V(v map[interface{}]float32, canChange bool, + d *Decoder) (_ map[interface{}]float32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 20) + v = make(map[interface{}]float32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk interface{} + var mv float32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = nil + d.decode(&mk) + if bv, bok := mk.([]byte); bok { + mk = d.string(bv) + } + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntfFloat64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[interface{}]float64) + v, changed := fastpathTV.DecMapIntfFloat64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntfFloat64V(rv2i(rv).(map[interface{}]float64), false, d) + } +} +func (f fastpathT) DecMapIntfFloat64X(vp *map[interface{}]float64, d *Decoder) { + v, changed := f.DecMapIntfFloat64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntfFloat64V(v map[interface{}]float64, canChange bool, + d *Decoder) (_ map[interface{}]float64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[interface{}]float64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk interface{} + var mv float64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = nil + d.decode(&mk) + if bv, bok := mk.([]byte); bok { + mk = d.string(bv) + } + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeFloat64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntfBoolR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[interface{}]bool) + v, changed := fastpathTV.DecMapIntfBoolV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntfBoolV(rv2i(rv).(map[interface{}]bool), false, d) + } +} +func (f fastpathT) DecMapIntfBoolX(vp *map[interface{}]bool, d *Decoder) { + v, changed := f.DecMapIntfBoolV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntfBoolV(v map[interface{}]bool, canChange bool, + d *Decoder) (_ map[interface{}]bool, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 17) + v = make(map[interface{}]bool, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk interface{} + var mv bool + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = nil + d.decode(&mk) + if bv, bok := mk.([]byte); bok { + mk = d.string(bv) + } + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = false + } + continue + } + mv = dd.DecodeBool() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapStringIntfR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[string]interface{}) + v, changed := fastpathTV.DecMapStringIntfV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapStringIntfV(rv2i(rv).(map[string]interface{}), false, d) + } +} +func (f fastpathT) DecMapStringIntfX(vp *map[string]interface{}, d *Decoder) { + v, changed := f.DecMapStringIntfV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapStringIntfV(v map[string]interface{}, canChange bool, + d *Decoder) (_ map[string]interface{}, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 32) + v = make(map[string]interface{}, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset + var mk string + var mv interface{} + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeString() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = nil + } + continue + } + if mapGet { + mv = v[mk] + } else { + mv = nil + } + d.decode(&mv) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapStringStringR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[string]string) + v, changed := fastpathTV.DecMapStringStringV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapStringStringV(rv2i(rv).(map[string]string), false, d) + } +} +func (f fastpathT) DecMapStringStringX(vp *map[string]string, d *Decoder) { + v, changed := f.DecMapStringStringV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapStringStringV(v map[string]string, canChange bool, + d *Decoder) (_ map[string]string, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 32) + v = make(map[string]string, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk string + var mv string + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeString() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = "" + } + continue + } + mv = dd.DecodeString() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapStringUintR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[string]uint) + v, changed := fastpathTV.DecMapStringUintV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapStringUintV(rv2i(rv).(map[string]uint), false, d) + } +} +func (f fastpathT) DecMapStringUintX(vp *map[string]uint, d *Decoder) { + v, changed := f.DecMapStringUintV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapStringUintV(v map[string]uint, canChange bool, + d *Decoder) (_ map[string]uint, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[string]uint, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk string + var mv uint + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeString() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapStringUint8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[string]uint8) + v, changed := fastpathTV.DecMapStringUint8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapStringUint8V(rv2i(rv).(map[string]uint8), false, d) + } +} +func (f fastpathT) DecMapStringUint8X(vp *map[string]uint8, d *Decoder) { + v, changed := f.DecMapStringUint8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapStringUint8V(v map[string]uint8, canChange bool, + d *Decoder) (_ map[string]uint8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 17) + v = make(map[string]uint8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk string + var mv uint8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeString() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapStringUint16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[string]uint16) + v, changed := fastpathTV.DecMapStringUint16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapStringUint16V(rv2i(rv).(map[string]uint16), false, d) + } +} +func (f fastpathT) DecMapStringUint16X(vp *map[string]uint16, d *Decoder) { + v, changed := f.DecMapStringUint16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapStringUint16V(v map[string]uint16, canChange bool, + d *Decoder) (_ map[string]uint16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 18) + v = make(map[string]uint16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk string + var mv uint16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeString() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapStringUint32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[string]uint32) + v, changed := fastpathTV.DecMapStringUint32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapStringUint32V(rv2i(rv).(map[string]uint32), false, d) + } +} +func (f fastpathT) DecMapStringUint32X(vp *map[string]uint32, d *Decoder) { + v, changed := f.DecMapStringUint32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapStringUint32V(v map[string]uint32, canChange bool, + d *Decoder) (_ map[string]uint32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 20) + v = make(map[string]uint32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk string + var mv uint32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeString() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapStringUint64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[string]uint64) + v, changed := fastpathTV.DecMapStringUint64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapStringUint64V(rv2i(rv).(map[string]uint64), false, d) + } +} +func (f fastpathT) DecMapStringUint64X(vp *map[string]uint64, d *Decoder) { + v, changed := f.DecMapStringUint64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapStringUint64V(v map[string]uint64, canChange bool, + d *Decoder) (_ map[string]uint64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[string]uint64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk string + var mv uint64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeString() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeUint64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapStringUintptrR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[string]uintptr) + v, changed := fastpathTV.DecMapStringUintptrV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapStringUintptrV(rv2i(rv).(map[string]uintptr), false, d) + } +} +func (f fastpathT) DecMapStringUintptrX(vp *map[string]uintptr, d *Decoder) { + v, changed := f.DecMapStringUintptrV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapStringUintptrV(v map[string]uintptr, canChange bool, + d *Decoder) (_ map[string]uintptr, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[string]uintptr, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk string + var mv uintptr + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeString() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapStringIntR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[string]int) + v, changed := fastpathTV.DecMapStringIntV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapStringIntV(rv2i(rv).(map[string]int), false, d) + } +} +func (f fastpathT) DecMapStringIntX(vp *map[string]int, d *Decoder) { + v, changed := f.DecMapStringIntV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapStringIntV(v map[string]int, canChange bool, + d *Decoder) (_ map[string]int, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[string]int, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk string + var mv int + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeString() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapStringInt8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[string]int8) + v, changed := fastpathTV.DecMapStringInt8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapStringInt8V(rv2i(rv).(map[string]int8), false, d) + } +} +func (f fastpathT) DecMapStringInt8X(vp *map[string]int8, d *Decoder) { + v, changed := f.DecMapStringInt8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapStringInt8V(v map[string]int8, canChange bool, + d *Decoder) (_ map[string]int8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 17) + v = make(map[string]int8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk string + var mv int8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeString() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapStringInt16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[string]int16) + v, changed := fastpathTV.DecMapStringInt16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapStringInt16V(rv2i(rv).(map[string]int16), false, d) + } +} +func (f fastpathT) DecMapStringInt16X(vp *map[string]int16, d *Decoder) { + v, changed := f.DecMapStringInt16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapStringInt16V(v map[string]int16, canChange bool, + d *Decoder) (_ map[string]int16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 18) + v = make(map[string]int16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk string + var mv int16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeString() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapStringInt32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[string]int32) + v, changed := fastpathTV.DecMapStringInt32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapStringInt32V(rv2i(rv).(map[string]int32), false, d) + } +} +func (f fastpathT) DecMapStringInt32X(vp *map[string]int32, d *Decoder) { + v, changed := f.DecMapStringInt32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapStringInt32V(v map[string]int32, canChange bool, + d *Decoder) (_ map[string]int32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 20) + v = make(map[string]int32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk string + var mv int32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeString() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapStringInt64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[string]int64) + v, changed := fastpathTV.DecMapStringInt64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapStringInt64V(rv2i(rv).(map[string]int64), false, d) + } +} +func (f fastpathT) DecMapStringInt64X(vp *map[string]int64, d *Decoder) { + v, changed := f.DecMapStringInt64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapStringInt64V(v map[string]int64, canChange bool, + d *Decoder) (_ map[string]int64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[string]int64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk string + var mv int64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeString() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeInt64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapStringFloat32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[string]float32) + v, changed := fastpathTV.DecMapStringFloat32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapStringFloat32V(rv2i(rv).(map[string]float32), false, d) + } +} +func (f fastpathT) DecMapStringFloat32X(vp *map[string]float32, d *Decoder) { + v, changed := f.DecMapStringFloat32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapStringFloat32V(v map[string]float32, canChange bool, + d *Decoder) (_ map[string]float32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 20) + v = make(map[string]float32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk string + var mv float32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeString() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapStringFloat64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[string]float64) + v, changed := fastpathTV.DecMapStringFloat64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapStringFloat64V(rv2i(rv).(map[string]float64), false, d) + } +} +func (f fastpathT) DecMapStringFloat64X(vp *map[string]float64, d *Decoder) { + v, changed := f.DecMapStringFloat64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapStringFloat64V(v map[string]float64, canChange bool, + d *Decoder) (_ map[string]float64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[string]float64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk string + var mv float64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeString() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeFloat64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapStringBoolR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[string]bool) + v, changed := fastpathTV.DecMapStringBoolV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapStringBoolV(rv2i(rv).(map[string]bool), false, d) + } +} +func (f fastpathT) DecMapStringBoolX(vp *map[string]bool, d *Decoder) { + v, changed := f.DecMapStringBoolV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapStringBoolV(v map[string]bool, canChange bool, + d *Decoder) (_ map[string]bool, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 17) + v = make(map[string]bool, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk string + var mv bool + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeString() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = false + } + continue + } + mv = dd.DecodeBool() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat32IntfR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float32]interface{}) + v, changed := fastpathTV.DecMapFloat32IntfV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat32IntfV(rv2i(rv).(map[float32]interface{}), false, d) + } +} +func (f fastpathT) DecMapFloat32IntfX(vp *map[float32]interface{}, d *Decoder) { + v, changed := f.DecMapFloat32IntfV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat32IntfV(v map[float32]interface{}, canChange bool, + d *Decoder) (_ map[float32]interface{}, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 20) + v = make(map[float32]interface{}, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset + var mk float32 + var mv interface{} + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = nil + } + continue + } + if mapGet { + mv = v[mk] + } else { + mv = nil + } + d.decode(&mv) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat32StringR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float32]string) + v, changed := fastpathTV.DecMapFloat32StringV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat32StringV(rv2i(rv).(map[float32]string), false, d) + } +} +func (f fastpathT) DecMapFloat32StringX(vp *map[float32]string, d *Decoder) { + v, changed := f.DecMapFloat32StringV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat32StringV(v map[float32]string, canChange bool, + d *Decoder) (_ map[float32]string, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 20) + v = make(map[float32]string, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float32 + var mv string + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = "" + } + continue + } + mv = dd.DecodeString() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat32UintR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float32]uint) + v, changed := fastpathTV.DecMapFloat32UintV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat32UintV(rv2i(rv).(map[float32]uint), false, d) + } +} +func (f fastpathT) DecMapFloat32UintX(vp *map[float32]uint, d *Decoder) { + v, changed := f.DecMapFloat32UintV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat32UintV(v map[float32]uint, canChange bool, + d *Decoder) (_ map[float32]uint, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[float32]uint, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float32 + var mv uint + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat32Uint8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float32]uint8) + v, changed := fastpathTV.DecMapFloat32Uint8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat32Uint8V(rv2i(rv).(map[float32]uint8), false, d) + } +} +func (f fastpathT) DecMapFloat32Uint8X(vp *map[float32]uint8, d *Decoder) { + v, changed := f.DecMapFloat32Uint8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat32Uint8V(v map[float32]uint8, canChange bool, + d *Decoder) (_ map[float32]uint8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[float32]uint8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float32 + var mv uint8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat32Uint16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float32]uint16) + v, changed := fastpathTV.DecMapFloat32Uint16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat32Uint16V(rv2i(rv).(map[float32]uint16), false, d) + } +} +func (f fastpathT) DecMapFloat32Uint16X(vp *map[float32]uint16, d *Decoder) { + v, changed := f.DecMapFloat32Uint16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat32Uint16V(v map[float32]uint16, canChange bool, + d *Decoder) (_ map[float32]uint16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 6) + v = make(map[float32]uint16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float32 + var mv uint16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat32Uint32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float32]uint32) + v, changed := fastpathTV.DecMapFloat32Uint32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat32Uint32V(rv2i(rv).(map[float32]uint32), false, d) + } +} +func (f fastpathT) DecMapFloat32Uint32X(vp *map[float32]uint32, d *Decoder) { + v, changed := f.DecMapFloat32Uint32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat32Uint32V(v map[float32]uint32, canChange bool, + d *Decoder) (_ map[float32]uint32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 8) + v = make(map[float32]uint32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float32 + var mv uint32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat32Uint64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float32]uint64) + v, changed := fastpathTV.DecMapFloat32Uint64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat32Uint64V(rv2i(rv).(map[float32]uint64), false, d) + } +} +func (f fastpathT) DecMapFloat32Uint64X(vp *map[float32]uint64, d *Decoder) { + v, changed := f.DecMapFloat32Uint64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat32Uint64V(v map[float32]uint64, canChange bool, + d *Decoder) (_ map[float32]uint64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[float32]uint64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float32 + var mv uint64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeUint64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat32UintptrR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float32]uintptr) + v, changed := fastpathTV.DecMapFloat32UintptrV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat32UintptrV(rv2i(rv).(map[float32]uintptr), false, d) + } +} +func (f fastpathT) DecMapFloat32UintptrX(vp *map[float32]uintptr, d *Decoder) { + v, changed := f.DecMapFloat32UintptrV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat32UintptrV(v map[float32]uintptr, canChange bool, + d *Decoder) (_ map[float32]uintptr, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[float32]uintptr, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float32 + var mv uintptr + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat32IntR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float32]int) + v, changed := fastpathTV.DecMapFloat32IntV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat32IntV(rv2i(rv).(map[float32]int), false, d) + } +} +func (f fastpathT) DecMapFloat32IntX(vp *map[float32]int, d *Decoder) { + v, changed := f.DecMapFloat32IntV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat32IntV(v map[float32]int, canChange bool, + d *Decoder) (_ map[float32]int, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[float32]int, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float32 + var mv int + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat32Int8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float32]int8) + v, changed := fastpathTV.DecMapFloat32Int8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat32Int8V(rv2i(rv).(map[float32]int8), false, d) + } +} +func (f fastpathT) DecMapFloat32Int8X(vp *map[float32]int8, d *Decoder) { + v, changed := f.DecMapFloat32Int8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat32Int8V(v map[float32]int8, canChange bool, + d *Decoder) (_ map[float32]int8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[float32]int8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float32 + var mv int8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat32Int16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float32]int16) + v, changed := fastpathTV.DecMapFloat32Int16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat32Int16V(rv2i(rv).(map[float32]int16), false, d) + } +} +func (f fastpathT) DecMapFloat32Int16X(vp *map[float32]int16, d *Decoder) { + v, changed := f.DecMapFloat32Int16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat32Int16V(v map[float32]int16, canChange bool, + d *Decoder) (_ map[float32]int16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 6) + v = make(map[float32]int16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float32 + var mv int16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat32Int32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float32]int32) + v, changed := fastpathTV.DecMapFloat32Int32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat32Int32V(rv2i(rv).(map[float32]int32), false, d) + } +} +func (f fastpathT) DecMapFloat32Int32X(vp *map[float32]int32, d *Decoder) { + v, changed := f.DecMapFloat32Int32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat32Int32V(v map[float32]int32, canChange bool, + d *Decoder) (_ map[float32]int32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 8) + v = make(map[float32]int32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float32 + var mv int32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat32Int64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float32]int64) + v, changed := fastpathTV.DecMapFloat32Int64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat32Int64V(rv2i(rv).(map[float32]int64), false, d) + } +} +func (f fastpathT) DecMapFloat32Int64X(vp *map[float32]int64, d *Decoder) { + v, changed := f.DecMapFloat32Int64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat32Int64V(v map[float32]int64, canChange bool, + d *Decoder) (_ map[float32]int64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[float32]int64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float32 + var mv int64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeInt64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat32Float32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float32]float32) + v, changed := fastpathTV.DecMapFloat32Float32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat32Float32V(rv2i(rv).(map[float32]float32), false, d) + } +} +func (f fastpathT) DecMapFloat32Float32X(vp *map[float32]float32, d *Decoder) { + v, changed := f.DecMapFloat32Float32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat32Float32V(v map[float32]float32, canChange bool, + d *Decoder) (_ map[float32]float32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 8) + v = make(map[float32]float32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float32 + var mv float32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat32Float64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float32]float64) + v, changed := fastpathTV.DecMapFloat32Float64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat32Float64V(rv2i(rv).(map[float32]float64), false, d) + } +} +func (f fastpathT) DecMapFloat32Float64X(vp *map[float32]float64, d *Decoder) { + v, changed := f.DecMapFloat32Float64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat32Float64V(v map[float32]float64, canChange bool, + d *Decoder) (_ map[float32]float64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[float32]float64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float32 + var mv float64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeFloat64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat32BoolR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float32]bool) + v, changed := fastpathTV.DecMapFloat32BoolV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat32BoolV(rv2i(rv).(map[float32]bool), false, d) + } +} +func (f fastpathT) DecMapFloat32BoolX(vp *map[float32]bool, d *Decoder) { + v, changed := f.DecMapFloat32BoolV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat32BoolV(v map[float32]bool, canChange bool, + d *Decoder) (_ map[float32]bool, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[float32]bool, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float32 + var mv bool + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = false + } + continue + } + mv = dd.DecodeBool() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat64IntfR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float64]interface{}) + v, changed := fastpathTV.DecMapFloat64IntfV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat64IntfV(rv2i(rv).(map[float64]interface{}), false, d) + } +} +func (f fastpathT) DecMapFloat64IntfX(vp *map[float64]interface{}, d *Decoder) { + v, changed := f.DecMapFloat64IntfV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat64IntfV(v map[float64]interface{}, canChange bool, + d *Decoder) (_ map[float64]interface{}, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[float64]interface{}, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset + var mk float64 + var mv interface{} + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeFloat64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = nil + } + continue + } + if mapGet { + mv = v[mk] + } else { + mv = nil + } + d.decode(&mv) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat64StringR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float64]string) + v, changed := fastpathTV.DecMapFloat64StringV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat64StringV(rv2i(rv).(map[float64]string), false, d) + } +} +func (f fastpathT) DecMapFloat64StringX(vp *map[float64]string, d *Decoder) { + v, changed := f.DecMapFloat64StringV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat64StringV(v map[float64]string, canChange bool, + d *Decoder) (_ map[float64]string, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[float64]string, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float64 + var mv string + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeFloat64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = "" + } + continue + } + mv = dd.DecodeString() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat64UintR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float64]uint) + v, changed := fastpathTV.DecMapFloat64UintV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat64UintV(rv2i(rv).(map[float64]uint), false, d) + } +} +func (f fastpathT) DecMapFloat64UintX(vp *map[float64]uint, d *Decoder) { + v, changed := f.DecMapFloat64UintV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat64UintV(v map[float64]uint, canChange bool, + d *Decoder) (_ map[float64]uint, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[float64]uint, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float64 + var mv uint + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeFloat64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat64Uint8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float64]uint8) + v, changed := fastpathTV.DecMapFloat64Uint8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat64Uint8V(rv2i(rv).(map[float64]uint8), false, d) + } +} +func (f fastpathT) DecMapFloat64Uint8X(vp *map[float64]uint8, d *Decoder) { + v, changed := f.DecMapFloat64Uint8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat64Uint8V(v map[float64]uint8, canChange bool, + d *Decoder) (_ map[float64]uint8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[float64]uint8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float64 + var mv uint8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeFloat64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat64Uint16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float64]uint16) + v, changed := fastpathTV.DecMapFloat64Uint16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat64Uint16V(rv2i(rv).(map[float64]uint16), false, d) + } +} +func (f fastpathT) DecMapFloat64Uint16X(vp *map[float64]uint16, d *Decoder) { + v, changed := f.DecMapFloat64Uint16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat64Uint16V(v map[float64]uint16, canChange bool, + d *Decoder) (_ map[float64]uint16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[float64]uint16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float64 + var mv uint16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeFloat64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat64Uint32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float64]uint32) + v, changed := fastpathTV.DecMapFloat64Uint32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat64Uint32V(rv2i(rv).(map[float64]uint32), false, d) + } +} +func (f fastpathT) DecMapFloat64Uint32X(vp *map[float64]uint32, d *Decoder) { + v, changed := f.DecMapFloat64Uint32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat64Uint32V(v map[float64]uint32, canChange bool, + d *Decoder) (_ map[float64]uint32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[float64]uint32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float64 + var mv uint32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeFloat64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat64Uint64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float64]uint64) + v, changed := fastpathTV.DecMapFloat64Uint64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat64Uint64V(rv2i(rv).(map[float64]uint64), false, d) + } +} +func (f fastpathT) DecMapFloat64Uint64X(vp *map[float64]uint64, d *Decoder) { + v, changed := f.DecMapFloat64Uint64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat64Uint64V(v map[float64]uint64, canChange bool, + d *Decoder) (_ map[float64]uint64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[float64]uint64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float64 + var mv uint64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeFloat64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeUint64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat64UintptrR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float64]uintptr) + v, changed := fastpathTV.DecMapFloat64UintptrV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat64UintptrV(rv2i(rv).(map[float64]uintptr), false, d) + } +} +func (f fastpathT) DecMapFloat64UintptrX(vp *map[float64]uintptr, d *Decoder) { + v, changed := f.DecMapFloat64UintptrV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat64UintptrV(v map[float64]uintptr, canChange bool, + d *Decoder) (_ map[float64]uintptr, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[float64]uintptr, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float64 + var mv uintptr + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeFloat64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat64IntR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float64]int) + v, changed := fastpathTV.DecMapFloat64IntV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat64IntV(rv2i(rv).(map[float64]int), false, d) + } +} +func (f fastpathT) DecMapFloat64IntX(vp *map[float64]int, d *Decoder) { + v, changed := f.DecMapFloat64IntV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat64IntV(v map[float64]int, canChange bool, + d *Decoder) (_ map[float64]int, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[float64]int, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float64 + var mv int + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeFloat64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat64Int8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float64]int8) + v, changed := fastpathTV.DecMapFloat64Int8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat64Int8V(rv2i(rv).(map[float64]int8), false, d) + } +} +func (f fastpathT) DecMapFloat64Int8X(vp *map[float64]int8, d *Decoder) { + v, changed := f.DecMapFloat64Int8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat64Int8V(v map[float64]int8, canChange bool, + d *Decoder) (_ map[float64]int8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[float64]int8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float64 + var mv int8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeFloat64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat64Int16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float64]int16) + v, changed := fastpathTV.DecMapFloat64Int16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat64Int16V(rv2i(rv).(map[float64]int16), false, d) + } +} +func (f fastpathT) DecMapFloat64Int16X(vp *map[float64]int16, d *Decoder) { + v, changed := f.DecMapFloat64Int16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat64Int16V(v map[float64]int16, canChange bool, + d *Decoder) (_ map[float64]int16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[float64]int16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float64 + var mv int16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeFloat64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat64Int32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float64]int32) + v, changed := fastpathTV.DecMapFloat64Int32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat64Int32V(rv2i(rv).(map[float64]int32), false, d) + } +} +func (f fastpathT) DecMapFloat64Int32X(vp *map[float64]int32, d *Decoder) { + v, changed := f.DecMapFloat64Int32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat64Int32V(v map[float64]int32, canChange bool, + d *Decoder) (_ map[float64]int32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[float64]int32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float64 + var mv int32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeFloat64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat64Int64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float64]int64) + v, changed := fastpathTV.DecMapFloat64Int64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat64Int64V(rv2i(rv).(map[float64]int64), false, d) + } +} +func (f fastpathT) DecMapFloat64Int64X(vp *map[float64]int64, d *Decoder) { + v, changed := f.DecMapFloat64Int64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat64Int64V(v map[float64]int64, canChange bool, + d *Decoder) (_ map[float64]int64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[float64]int64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float64 + var mv int64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeFloat64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeInt64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat64Float32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float64]float32) + v, changed := fastpathTV.DecMapFloat64Float32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat64Float32V(rv2i(rv).(map[float64]float32), false, d) + } +} +func (f fastpathT) DecMapFloat64Float32X(vp *map[float64]float32, d *Decoder) { + v, changed := f.DecMapFloat64Float32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat64Float32V(v map[float64]float32, canChange bool, + d *Decoder) (_ map[float64]float32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[float64]float32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float64 + var mv float32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeFloat64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat64Float64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float64]float64) + v, changed := fastpathTV.DecMapFloat64Float64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat64Float64V(rv2i(rv).(map[float64]float64), false, d) + } +} +func (f fastpathT) DecMapFloat64Float64X(vp *map[float64]float64, d *Decoder) { + v, changed := f.DecMapFloat64Float64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat64Float64V(v map[float64]float64, canChange bool, + d *Decoder) (_ map[float64]float64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[float64]float64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float64 + var mv float64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeFloat64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeFloat64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapFloat64BoolR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[float64]bool) + v, changed := fastpathTV.DecMapFloat64BoolV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapFloat64BoolV(rv2i(rv).(map[float64]bool), false, d) + } +} +func (f fastpathT) DecMapFloat64BoolX(vp *map[float64]bool, d *Decoder) { + v, changed := f.DecMapFloat64BoolV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapFloat64BoolV(v map[float64]bool, canChange bool, + d *Decoder) (_ map[float64]bool, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[float64]bool, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk float64 + var mv bool + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeFloat64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = false + } + continue + } + mv = dd.DecodeBool() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintIntfR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint]interface{}) + v, changed := fastpathTV.DecMapUintIntfV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintIntfV(rv2i(rv).(map[uint]interface{}), false, d) + } +} +func (f fastpathT) DecMapUintIntfX(vp *map[uint]interface{}, d *Decoder) { + v, changed := f.DecMapUintIntfV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintIntfV(v map[uint]interface{}, canChange bool, + d *Decoder) (_ map[uint]interface{}, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[uint]interface{}, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset + var mk uint + var mv interface{} + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = nil + } + continue + } + if mapGet { + mv = v[mk] + } else { + mv = nil + } + d.decode(&mv) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintStringR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint]string) + v, changed := fastpathTV.DecMapUintStringV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintStringV(rv2i(rv).(map[uint]string), false, d) + } +} +func (f fastpathT) DecMapUintStringX(vp *map[uint]string, d *Decoder) { + v, changed := f.DecMapUintStringV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintStringV(v map[uint]string, canChange bool, + d *Decoder) (_ map[uint]string, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[uint]string, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint + var mv string + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = "" + } + continue + } + mv = dd.DecodeString() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintUintR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint]uint) + v, changed := fastpathTV.DecMapUintUintV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintUintV(rv2i(rv).(map[uint]uint), false, d) + } +} +func (f fastpathT) DecMapUintUintX(vp *map[uint]uint, d *Decoder) { + v, changed := f.DecMapUintUintV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintUintV(v map[uint]uint, canChange bool, + d *Decoder) (_ map[uint]uint, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uint]uint, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint + var mv uint + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintUint8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint]uint8) + v, changed := fastpathTV.DecMapUintUint8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintUint8V(rv2i(rv).(map[uint]uint8), false, d) + } +} +func (f fastpathT) DecMapUintUint8X(vp *map[uint]uint8, d *Decoder) { + v, changed := f.DecMapUintUint8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintUint8V(v map[uint]uint8, canChange bool, + d *Decoder) (_ map[uint]uint8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uint]uint8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint + var mv uint8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintUint16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint]uint16) + v, changed := fastpathTV.DecMapUintUint16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintUint16V(rv2i(rv).(map[uint]uint16), false, d) + } +} +func (f fastpathT) DecMapUintUint16X(vp *map[uint]uint16, d *Decoder) { + v, changed := f.DecMapUintUint16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintUint16V(v map[uint]uint16, canChange bool, + d *Decoder) (_ map[uint]uint16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[uint]uint16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint + var mv uint16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintUint32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint]uint32) + v, changed := fastpathTV.DecMapUintUint32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintUint32V(rv2i(rv).(map[uint]uint32), false, d) + } +} +func (f fastpathT) DecMapUintUint32X(vp *map[uint]uint32, d *Decoder) { + v, changed := f.DecMapUintUint32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintUint32V(v map[uint]uint32, canChange bool, + d *Decoder) (_ map[uint]uint32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uint]uint32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint + var mv uint32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintUint64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint]uint64) + v, changed := fastpathTV.DecMapUintUint64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintUint64V(rv2i(rv).(map[uint]uint64), false, d) + } +} +func (f fastpathT) DecMapUintUint64X(vp *map[uint]uint64, d *Decoder) { + v, changed := f.DecMapUintUint64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintUint64V(v map[uint]uint64, canChange bool, + d *Decoder) (_ map[uint]uint64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uint]uint64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint + var mv uint64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeUint64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintUintptrR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint]uintptr) + v, changed := fastpathTV.DecMapUintUintptrV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintUintptrV(rv2i(rv).(map[uint]uintptr), false, d) + } +} +func (f fastpathT) DecMapUintUintptrX(vp *map[uint]uintptr, d *Decoder) { + v, changed := f.DecMapUintUintptrV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintUintptrV(v map[uint]uintptr, canChange bool, + d *Decoder) (_ map[uint]uintptr, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uint]uintptr, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint + var mv uintptr + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintIntR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint]int) + v, changed := fastpathTV.DecMapUintIntV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintIntV(rv2i(rv).(map[uint]int), false, d) + } +} +func (f fastpathT) DecMapUintIntX(vp *map[uint]int, d *Decoder) { + v, changed := f.DecMapUintIntV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintIntV(v map[uint]int, canChange bool, + d *Decoder) (_ map[uint]int, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uint]int, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint + var mv int + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintInt8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint]int8) + v, changed := fastpathTV.DecMapUintInt8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintInt8V(rv2i(rv).(map[uint]int8), false, d) + } +} +func (f fastpathT) DecMapUintInt8X(vp *map[uint]int8, d *Decoder) { + v, changed := f.DecMapUintInt8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintInt8V(v map[uint]int8, canChange bool, + d *Decoder) (_ map[uint]int8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uint]int8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint + var mv int8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintInt16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint]int16) + v, changed := fastpathTV.DecMapUintInt16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintInt16V(rv2i(rv).(map[uint]int16), false, d) + } +} +func (f fastpathT) DecMapUintInt16X(vp *map[uint]int16, d *Decoder) { + v, changed := f.DecMapUintInt16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintInt16V(v map[uint]int16, canChange bool, + d *Decoder) (_ map[uint]int16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[uint]int16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint + var mv int16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintInt32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint]int32) + v, changed := fastpathTV.DecMapUintInt32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintInt32V(rv2i(rv).(map[uint]int32), false, d) + } +} +func (f fastpathT) DecMapUintInt32X(vp *map[uint]int32, d *Decoder) { + v, changed := f.DecMapUintInt32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintInt32V(v map[uint]int32, canChange bool, + d *Decoder) (_ map[uint]int32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uint]int32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint + var mv int32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintInt64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint]int64) + v, changed := fastpathTV.DecMapUintInt64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintInt64V(rv2i(rv).(map[uint]int64), false, d) + } +} +func (f fastpathT) DecMapUintInt64X(vp *map[uint]int64, d *Decoder) { + v, changed := f.DecMapUintInt64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintInt64V(v map[uint]int64, canChange bool, + d *Decoder) (_ map[uint]int64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uint]int64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint + var mv int64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeInt64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintFloat32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint]float32) + v, changed := fastpathTV.DecMapUintFloat32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintFloat32V(rv2i(rv).(map[uint]float32), false, d) + } +} +func (f fastpathT) DecMapUintFloat32X(vp *map[uint]float32, d *Decoder) { + v, changed := f.DecMapUintFloat32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintFloat32V(v map[uint]float32, canChange bool, + d *Decoder) (_ map[uint]float32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uint]float32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint + var mv float32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintFloat64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint]float64) + v, changed := fastpathTV.DecMapUintFloat64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintFloat64V(rv2i(rv).(map[uint]float64), false, d) + } +} +func (f fastpathT) DecMapUintFloat64X(vp *map[uint]float64, d *Decoder) { + v, changed := f.DecMapUintFloat64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintFloat64V(v map[uint]float64, canChange bool, + d *Decoder) (_ map[uint]float64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uint]float64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint + var mv float64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeFloat64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintBoolR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint]bool) + v, changed := fastpathTV.DecMapUintBoolV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintBoolV(rv2i(rv).(map[uint]bool), false, d) + } +} +func (f fastpathT) DecMapUintBoolX(vp *map[uint]bool, d *Decoder) { + v, changed := f.DecMapUintBoolV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintBoolV(v map[uint]bool, canChange bool, + d *Decoder) (_ map[uint]bool, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uint]bool, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint + var mv bool + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = false + } + continue + } + mv = dd.DecodeBool() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint8IntfR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint8]interface{}) + v, changed := fastpathTV.DecMapUint8IntfV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint8IntfV(rv2i(rv).(map[uint8]interface{}), false, d) + } +} +func (f fastpathT) DecMapUint8IntfX(vp *map[uint8]interface{}, d *Decoder) { + v, changed := f.DecMapUint8IntfV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint8IntfV(v map[uint8]interface{}, canChange bool, + d *Decoder) (_ map[uint8]interface{}, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 17) + v = make(map[uint8]interface{}, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset + var mk uint8 + var mv interface{} + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = nil + } + continue + } + if mapGet { + mv = v[mk] + } else { + mv = nil + } + d.decode(&mv) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint8StringR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint8]string) + v, changed := fastpathTV.DecMapUint8StringV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint8StringV(rv2i(rv).(map[uint8]string), false, d) + } +} +func (f fastpathT) DecMapUint8StringX(vp *map[uint8]string, d *Decoder) { + v, changed := f.DecMapUint8StringV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint8StringV(v map[uint8]string, canChange bool, + d *Decoder) (_ map[uint8]string, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 17) + v = make(map[uint8]string, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint8 + var mv string + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = "" + } + continue + } + mv = dd.DecodeString() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint8UintR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint8]uint) + v, changed := fastpathTV.DecMapUint8UintV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint8UintV(rv2i(rv).(map[uint8]uint), false, d) + } +} +func (f fastpathT) DecMapUint8UintX(vp *map[uint8]uint, d *Decoder) { + v, changed := f.DecMapUint8UintV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint8UintV(v map[uint8]uint, canChange bool, + d *Decoder) (_ map[uint8]uint, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uint8]uint, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint8 + var mv uint + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint8Uint8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint8]uint8) + v, changed := fastpathTV.DecMapUint8Uint8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint8Uint8V(rv2i(rv).(map[uint8]uint8), false, d) + } +} +func (f fastpathT) DecMapUint8Uint8X(vp *map[uint8]uint8, d *Decoder) { + v, changed := f.DecMapUint8Uint8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint8Uint8V(v map[uint8]uint8, canChange bool, + d *Decoder) (_ map[uint8]uint8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 2) + v = make(map[uint8]uint8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint8 + var mv uint8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint8Uint16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint8]uint16) + v, changed := fastpathTV.DecMapUint8Uint16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint8Uint16V(rv2i(rv).(map[uint8]uint16), false, d) + } +} +func (f fastpathT) DecMapUint8Uint16X(vp *map[uint8]uint16, d *Decoder) { + v, changed := f.DecMapUint8Uint16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint8Uint16V(v map[uint8]uint16, canChange bool, + d *Decoder) (_ map[uint8]uint16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 3) + v = make(map[uint8]uint16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint8 + var mv uint16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint8Uint32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint8]uint32) + v, changed := fastpathTV.DecMapUint8Uint32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint8Uint32V(rv2i(rv).(map[uint8]uint32), false, d) + } +} +func (f fastpathT) DecMapUint8Uint32X(vp *map[uint8]uint32, d *Decoder) { + v, changed := f.DecMapUint8Uint32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint8Uint32V(v map[uint8]uint32, canChange bool, + d *Decoder) (_ map[uint8]uint32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[uint8]uint32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint8 + var mv uint32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint8Uint64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint8]uint64) + v, changed := fastpathTV.DecMapUint8Uint64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint8Uint64V(rv2i(rv).(map[uint8]uint64), false, d) + } +} +func (f fastpathT) DecMapUint8Uint64X(vp *map[uint8]uint64, d *Decoder) { + v, changed := f.DecMapUint8Uint64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint8Uint64V(v map[uint8]uint64, canChange bool, + d *Decoder) (_ map[uint8]uint64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uint8]uint64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint8 + var mv uint64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeUint64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint8UintptrR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint8]uintptr) + v, changed := fastpathTV.DecMapUint8UintptrV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint8UintptrV(rv2i(rv).(map[uint8]uintptr), false, d) + } +} +func (f fastpathT) DecMapUint8UintptrX(vp *map[uint8]uintptr, d *Decoder) { + v, changed := f.DecMapUint8UintptrV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint8UintptrV(v map[uint8]uintptr, canChange bool, + d *Decoder) (_ map[uint8]uintptr, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uint8]uintptr, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint8 + var mv uintptr + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint8IntR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint8]int) + v, changed := fastpathTV.DecMapUint8IntV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint8IntV(rv2i(rv).(map[uint8]int), false, d) + } +} +func (f fastpathT) DecMapUint8IntX(vp *map[uint8]int, d *Decoder) { + v, changed := f.DecMapUint8IntV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint8IntV(v map[uint8]int, canChange bool, + d *Decoder) (_ map[uint8]int, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uint8]int, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint8 + var mv int + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint8Int8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint8]int8) + v, changed := fastpathTV.DecMapUint8Int8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint8Int8V(rv2i(rv).(map[uint8]int8), false, d) + } +} +func (f fastpathT) DecMapUint8Int8X(vp *map[uint8]int8, d *Decoder) { + v, changed := f.DecMapUint8Int8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint8Int8V(v map[uint8]int8, canChange bool, + d *Decoder) (_ map[uint8]int8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 2) + v = make(map[uint8]int8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint8 + var mv int8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint8Int16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint8]int16) + v, changed := fastpathTV.DecMapUint8Int16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint8Int16V(rv2i(rv).(map[uint8]int16), false, d) + } +} +func (f fastpathT) DecMapUint8Int16X(vp *map[uint8]int16, d *Decoder) { + v, changed := f.DecMapUint8Int16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint8Int16V(v map[uint8]int16, canChange bool, + d *Decoder) (_ map[uint8]int16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 3) + v = make(map[uint8]int16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint8 + var mv int16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint8Int32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint8]int32) + v, changed := fastpathTV.DecMapUint8Int32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint8Int32V(rv2i(rv).(map[uint8]int32), false, d) + } +} +func (f fastpathT) DecMapUint8Int32X(vp *map[uint8]int32, d *Decoder) { + v, changed := f.DecMapUint8Int32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint8Int32V(v map[uint8]int32, canChange bool, + d *Decoder) (_ map[uint8]int32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[uint8]int32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint8 + var mv int32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint8Int64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint8]int64) + v, changed := fastpathTV.DecMapUint8Int64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint8Int64V(rv2i(rv).(map[uint8]int64), false, d) + } +} +func (f fastpathT) DecMapUint8Int64X(vp *map[uint8]int64, d *Decoder) { + v, changed := f.DecMapUint8Int64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint8Int64V(v map[uint8]int64, canChange bool, + d *Decoder) (_ map[uint8]int64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uint8]int64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint8 + var mv int64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeInt64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint8Float32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint8]float32) + v, changed := fastpathTV.DecMapUint8Float32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint8Float32V(rv2i(rv).(map[uint8]float32), false, d) + } +} +func (f fastpathT) DecMapUint8Float32X(vp *map[uint8]float32, d *Decoder) { + v, changed := f.DecMapUint8Float32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint8Float32V(v map[uint8]float32, canChange bool, + d *Decoder) (_ map[uint8]float32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[uint8]float32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint8 + var mv float32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint8Float64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint8]float64) + v, changed := fastpathTV.DecMapUint8Float64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint8Float64V(rv2i(rv).(map[uint8]float64), false, d) + } +} +func (f fastpathT) DecMapUint8Float64X(vp *map[uint8]float64, d *Decoder) { + v, changed := f.DecMapUint8Float64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint8Float64V(v map[uint8]float64, canChange bool, + d *Decoder) (_ map[uint8]float64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uint8]float64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint8 + var mv float64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeFloat64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint8BoolR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint8]bool) + v, changed := fastpathTV.DecMapUint8BoolV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint8BoolV(rv2i(rv).(map[uint8]bool), false, d) + } +} +func (f fastpathT) DecMapUint8BoolX(vp *map[uint8]bool, d *Decoder) { + v, changed := f.DecMapUint8BoolV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint8BoolV(v map[uint8]bool, canChange bool, + d *Decoder) (_ map[uint8]bool, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 2) + v = make(map[uint8]bool, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint8 + var mv bool + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = false + } + continue + } + mv = dd.DecodeBool() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint16IntfR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint16]interface{}) + v, changed := fastpathTV.DecMapUint16IntfV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint16IntfV(rv2i(rv).(map[uint16]interface{}), false, d) + } +} +func (f fastpathT) DecMapUint16IntfX(vp *map[uint16]interface{}, d *Decoder) { + v, changed := f.DecMapUint16IntfV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint16IntfV(v map[uint16]interface{}, canChange bool, + d *Decoder) (_ map[uint16]interface{}, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 18) + v = make(map[uint16]interface{}, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset + var mk uint16 + var mv interface{} + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = nil + } + continue + } + if mapGet { + mv = v[mk] + } else { + mv = nil + } + d.decode(&mv) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint16StringR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint16]string) + v, changed := fastpathTV.DecMapUint16StringV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint16StringV(rv2i(rv).(map[uint16]string), false, d) + } +} +func (f fastpathT) DecMapUint16StringX(vp *map[uint16]string, d *Decoder) { + v, changed := f.DecMapUint16StringV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint16StringV(v map[uint16]string, canChange bool, + d *Decoder) (_ map[uint16]string, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 18) + v = make(map[uint16]string, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint16 + var mv string + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = "" + } + continue + } + mv = dd.DecodeString() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint16UintR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint16]uint) + v, changed := fastpathTV.DecMapUint16UintV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint16UintV(rv2i(rv).(map[uint16]uint), false, d) + } +} +func (f fastpathT) DecMapUint16UintX(vp *map[uint16]uint, d *Decoder) { + v, changed := f.DecMapUint16UintV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint16UintV(v map[uint16]uint, canChange bool, + d *Decoder) (_ map[uint16]uint, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[uint16]uint, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint16 + var mv uint + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint16Uint8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint16]uint8) + v, changed := fastpathTV.DecMapUint16Uint8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint16Uint8V(rv2i(rv).(map[uint16]uint8), false, d) + } +} +func (f fastpathT) DecMapUint16Uint8X(vp *map[uint16]uint8, d *Decoder) { + v, changed := f.DecMapUint16Uint8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint16Uint8V(v map[uint16]uint8, canChange bool, + d *Decoder) (_ map[uint16]uint8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 3) + v = make(map[uint16]uint8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint16 + var mv uint8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint16Uint16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint16]uint16) + v, changed := fastpathTV.DecMapUint16Uint16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint16Uint16V(rv2i(rv).(map[uint16]uint16), false, d) + } +} +func (f fastpathT) DecMapUint16Uint16X(vp *map[uint16]uint16, d *Decoder) { + v, changed := f.DecMapUint16Uint16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint16Uint16V(v map[uint16]uint16, canChange bool, + d *Decoder) (_ map[uint16]uint16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 4) + v = make(map[uint16]uint16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint16 + var mv uint16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint16Uint32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint16]uint32) + v, changed := fastpathTV.DecMapUint16Uint32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint16Uint32V(rv2i(rv).(map[uint16]uint32), false, d) + } +} +func (f fastpathT) DecMapUint16Uint32X(vp *map[uint16]uint32, d *Decoder) { + v, changed := f.DecMapUint16Uint32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint16Uint32V(v map[uint16]uint32, canChange bool, + d *Decoder) (_ map[uint16]uint32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 6) + v = make(map[uint16]uint32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint16 + var mv uint32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint16Uint64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint16]uint64) + v, changed := fastpathTV.DecMapUint16Uint64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint16Uint64V(rv2i(rv).(map[uint16]uint64), false, d) + } +} +func (f fastpathT) DecMapUint16Uint64X(vp *map[uint16]uint64, d *Decoder) { + v, changed := f.DecMapUint16Uint64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint16Uint64V(v map[uint16]uint64, canChange bool, + d *Decoder) (_ map[uint16]uint64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[uint16]uint64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint16 + var mv uint64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeUint64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint16UintptrR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint16]uintptr) + v, changed := fastpathTV.DecMapUint16UintptrV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint16UintptrV(rv2i(rv).(map[uint16]uintptr), false, d) + } +} +func (f fastpathT) DecMapUint16UintptrX(vp *map[uint16]uintptr, d *Decoder) { + v, changed := f.DecMapUint16UintptrV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint16UintptrV(v map[uint16]uintptr, canChange bool, + d *Decoder) (_ map[uint16]uintptr, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[uint16]uintptr, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint16 + var mv uintptr + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint16IntR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint16]int) + v, changed := fastpathTV.DecMapUint16IntV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint16IntV(rv2i(rv).(map[uint16]int), false, d) + } +} +func (f fastpathT) DecMapUint16IntX(vp *map[uint16]int, d *Decoder) { + v, changed := f.DecMapUint16IntV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint16IntV(v map[uint16]int, canChange bool, + d *Decoder) (_ map[uint16]int, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[uint16]int, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint16 + var mv int + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint16Int8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint16]int8) + v, changed := fastpathTV.DecMapUint16Int8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint16Int8V(rv2i(rv).(map[uint16]int8), false, d) + } +} +func (f fastpathT) DecMapUint16Int8X(vp *map[uint16]int8, d *Decoder) { + v, changed := f.DecMapUint16Int8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint16Int8V(v map[uint16]int8, canChange bool, + d *Decoder) (_ map[uint16]int8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 3) + v = make(map[uint16]int8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint16 + var mv int8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint16Int16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint16]int16) + v, changed := fastpathTV.DecMapUint16Int16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint16Int16V(rv2i(rv).(map[uint16]int16), false, d) + } +} +func (f fastpathT) DecMapUint16Int16X(vp *map[uint16]int16, d *Decoder) { + v, changed := f.DecMapUint16Int16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint16Int16V(v map[uint16]int16, canChange bool, + d *Decoder) (_ map[uint16]int16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 4) + v = make(map[uint16]int16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint16 + var mv int16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint16Int32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint16]int32) + v, changed := fastpathTV.DecMapUint16Int32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint16Int32V(rv2i(rv).(map[uint16]int32), false, d) + } +} +func (f fastpathT) DecMapUint16Int32X(vp *map[uint16]int32, d *Decoder) { + v, changed := f.DecMapUint16Int32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint16Int32V(v map[uint16]int32, canChange bool, + d *Decoder) (_ map[uint16]int32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 6) + v = make(map[uint16]int32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint16 + var mv int32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint16Int64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint16]int64) + v, changed := fastpathTV.DecMapUint16Int64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint16Int64V(rv2i(rv).(map[uint16]int64), false, d) + } +} +func (f fastpathT) DecMapUint16Int64X(vp *map[uint16]int64, d *Decoder) { + v, changed := f.DecMapUint16Int64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint16Int64V(v map[uint16]int64, canChange bool, + d *Decoder) (_ map[uint16]int64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[uint16]int64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint16 + var mv int64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeInt64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint16Float32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint16]float32) + v, changed := fastpathTV.DecMapUint16Float32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint16Float32V(rv2i(rv).(map[uint16]float32), false, d) + } +} +func (f fastpathT) DecMapUint16Float32X(vp *map[uint16]float32, d *Decoder) { + v, changed := f.DecMapUint16Float32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint16Float32V(v map[uint16]float32, canChange bool, + d *Decoder) (_ map[uint16]float32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 6) + v = make(map[uint16]float32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint16 + var mv float32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint16Float64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint16]float64) + v, changed := fastpathTV.DecMapUint16Float64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint16Float64V(rv2i(rv).(map[uint16]float64), false, d) + } +} +func (f fastpathT) DecMapUint16Float64X(vp *map[uint16]float64, d *Decoder) { + v, changed := f.DecMapUint16Float64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint16Float64V(v map[uint16]float64, canChange bool, + d *Decoder) (_ map[uint16]float64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[uint16]float64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint16 + var mv float64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeFloat64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint16BoolR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint16]bool) + v, changed := fastpathTV.DecMapUint16BoolV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint16BoolV(rv2i(rv).(map[uint16]bool), false, d) + } +} +func (f fastpathT) DecMapUint16BoolX(vp *map[uint16]bool, d *Decoder) { + v, changed := f.DecMapUint16BoolV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint16BoolV(v map[uint16]bool, canChange bool, + d *Decoder) (_ map[uint16]bool, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 3) + v = make(map[uint16]bool, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint16 + var mv bool + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = false + } + continue + } + mv = dd.DecodeBool() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint32IntfR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint32]interface{}) + v, changed := fastpathTV.DecMapUint32IntfV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint32IntfV(rv2i(rv).(map[uint32]interface{}), false, d) + } +} +func (f fastpathT) DecMapUint32IntfX(vp *map[uint32]interface{}, d *Decoder) { + v, changed := f.DecMapUint32IntfV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint32IntfV(v map[uint32]interface{}, canChange bool, + d *Decoder) (_ map[uint32]interface{}, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 20) + v = make(map[uint32]interface{}, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset + var mk uint32 + var mv interface{} + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = nil + } + continue + } + if mapGet { + mv = v[mk] + } else { + mv = nil + } + d.decode(&mv) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint32StringR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint32]string) + v, changed := fastpathTV.DecMapUint32StringV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint32StringV(rv2i(rv).(map[uint32]string), false, d) + } +} +func (f fastpathT) DecMapUint32StringX(vp *map[uint32]string, d *Decoder) { + v, changed := f.DecMapUint32StringV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint32StringV(v map[uint32]string, canChange bool, + d *Decoder) (_ map[uint32]string, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 20) + v = make(map[uint32]string, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint32 + var mv string + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = "" + } + continue + } + mv = dd.DecodeString() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint32UintR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint32]uint) + v, changed := fastpathTV.DecMapUint32UintV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint32UintV(rv2i(rv).(map[uint32]uint), false, d) + } +} +func (f fastpathT) DecMapUint32UintX(vp *map[uint32]uint, d *Decoder) { + v, changed := f.DecMapUint32UintV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint32UintV(v map[uint32]uint, canChange bool, + d *Decoder) (_ map[uint32]uint, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uint32]uint, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint32 + var mv uint + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint32Uint8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint32]uint8) + v, changed := fastpathTV.DecMapUint32Uint8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint32Uint8V(rv2i(rv).(map[uint32]uint8), false, d) + } +} +func (f fastpathT) DecMapUint32Uint8X(vp *map[uint32]uint8, d *Decoder) { + v, changed := f.DecMapUint32Uint8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint32Uint8V(v map[uint32]uint8, canChange bool, + d *Decoder) (_ map[uint32]uint8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[uint32]uint8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint32 + var mv uint8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint32Uint16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint32]uint16) + v, changed := fastpathTV.DecMapUint32Uint16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint32Uint16V(rv2i(rv).(map[uint32]uint16), false, d) + } +} +func (f fastpathT) DecMapUint32Uint16X(vp *map[uint32]uint16, d *Decoder) { + v, changed := f.DecMapUint32Uint16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint32Uint16V(v map[uint32]uint16, canChange bool, + d *Decoder) (_ map[uint32]uint16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 6) + v = make(map[uint32]uint16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint32 + var mv uint16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint32Uint32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint32]uint32) + v, changed := fastpathTV.DecMapUint32Uint32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint32Uint32V(rv2i(rv).(map[uint32]uint32), false, d) + } +} +func (f fastpathT) DecMapUint32Uint32X(vp *map[uint32]uint32, d *Decoder) { + v, changed := f.DecMapUint32Uint32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint32Uint32V(v map[uint32]uint32, canChange bool, + d *Decoder) (_ map[uint32]uint32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 8) + v = make(map[uint32]uint32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint32 + var mv uint32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint32Uint64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint32]uint64) + v, changed := fastpathTV.DecMapUint32Uint64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint32Uint64V(rv2i(rv).(map[uint32]uint64), false, d) + } +} +func (f fastpathT) DecMapUint32Uint64X(vp *map[uint32]uint64, d *Decoder) { + v, changed := f.DecMapUint32Uint64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint32Uint64V(v map[uint32]uint64, canChange bool, + d *Decoder) (_ map[uint32]uint64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uint32]uint64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint32 + var mv uint64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeUint64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint32UintptrR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint32]uintptr) + v, changed := fastpathTV.DecMapUint32UintptrV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint32UintptrV(rv2i(rv).(map[uint32]uintptr), false, d) + } +} +func (f fastpathT) DecMapUint32UintptrX(vp *map[uint32]uintptr, d *Decoder) { + v, changed := f.DecMapUint32UintptrV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint32UintptrV(v map[uint32]uintptr, canChange bool, + d *Decoder) (_ map[uint32]uintptr, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uint32]uintptr, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint32 + var mv uintptr + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint32IntR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint32]int) + v, changed := fastpathTV.DecMapUint32IntV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint32IntV(rv2i(rv).(map[uint32]int), false, d) + } +} +func (f fastpathT) DecMapUint32IntX(vp *map[uint32]int, d *Decoder) { + v, changed := f.DecMapUint32IntV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint32IntV(v map[uint32]int, canChange bool, + d *Decoder) (_ map[uint32]int, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uint32]int, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint32 + var mv int + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint32Int8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint32]int8) + v, changed := fastpathTV.DecMapUint32Int8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint32Int8V(rv2i(rv).(map[uint32]int8), false, d) + } +} +func (f fastpathT) DecMapUint32Int8X(vp *map[uint32]int8, d *Decoder) { + v, changed := f.DecMapUint32Int8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint32Int8V(v map[uint32]int8, canChange bool, + d *Decoder) (_ map[uint32]int8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[uint32]int8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint32 + var mv int8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint32Int16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint32]int16) + v, changed := fastpathTV.DecMapUint32Int16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint32Int16V(rv2i(rv).(map[uint32]int16), false, d) + } +} +func (f fastpathT) DecMapUint32Int16X(vp *map[uint32]int16, d *Decoder) { + v, changed := f.DecMapUint32Int16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint32Int16V(v map[uint32]int16, canChange bool, + d *Decoder) (_ map[uint32]int16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 6) + v = make(map[uint32]int16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint32 + var mv int16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint32Int32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint32]int32) + v, changed := fastpathTV.DecMapUint32Int32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint32Int32V(rv2i(rv).(map[uint32]int32), false, d) + } +} +func (f fastpathT) DecMapUint32Int32X(vp *map[uint32]int32, d *Decoder) { + v, changed := f.DecMapUint32Int32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint32Int32V(v map[uint32]int32, canChange bool, + d *Decoder) (_ map[uint32]int32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 8) + v = make(map[uint32]int32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint32 + var mv int32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint32Int64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint32]int64) + v, changed := fastpathTV.DecMapUint32Int64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint32Int64V(rv2i(rv).(map[uint32]int64), false, d) + } +} +func (f fastpathT) DecMapUint32Int64X(vp *map[uint32]int64, d *Decoder) { + v, changed := f.DecMapUint32Int64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint32Int64V(v map[uint32]int64, canChange bool, + d *Decoder) (_ map[uint32]int64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uint32]int64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint32 + var mv int64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeInt64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint32Float32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint32]float32) + v, changed := fastpathTV.DecMapUint32Float32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint32Float32V(rv2i(rv).(map[uint32]float32), false, d) + } +} +func (f fastpathT) DecMapUint32Float32X(vp *map[uint32]float32, d *Decoder) { + v, changed := f.DecMapUint32Float32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint32Float32V(v map[uint32]float32, canChange bool, + d *Decoder) (_ map[uint32]float32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 8) + v = make(map[uint32]float32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint32 + var mv float32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint32Float64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint32]float64) + v, changed := fastpathTV.DecMapUint32Float64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint32Float64V(rv2i(rv).(map[uint32]float64), false, d) + } +} +func (f fastpathT) DecMapUint32Float64X(vp *map[uint32]float64, d *Decoder) { + v, changed := f.DecMapUint32Float64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint32Float64V(v map[uint32]float64, canChange bool, + d *Decoder) (_ map[uint32]float64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uint32]float64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint32 + var mv float64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeFloat64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint32BoolR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint32]bool) + v, changed := fastpathTV.DecMapUint32BoolV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint32BoolV(rv2i(rv).(map[uint32]bool), false, d) + } +} +func (f fastpathT) DecMapUint32BoolX(vp *map[uint32]bool, d *Decoder) { + v, changed := f.DecMapUint32BoolV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint32BoolV(v map[uint32]bool, canChange bool, + d *Decoder) (_ map[uint32]bool, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[uint32]bool, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint32 + var mv bool + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = false + } + continue + } + mv = dd.DecodeBool() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint64IntfR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint64]interface{}) + v, changed := fastpathTV.DecMapUint64IntfV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint64IntfV(rv2i(rv).(map[uint64]interface{}), false, d) + } +} +func (f fastpathT) DecMapUint64IntfX(vp *map[uint64]interface{}, d *Decoder) { + v, changed := f.DecMapUint64IntfV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint64IntfV(v map[uint64]interface{}, canChange bool, + d *Decoder) (_ map[uint64]interface{}, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[uint64]interface{}, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset + var mk uint64 + var mv interface{} + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeUint64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = nil + } + continue + } + if mapGet { + mv = v[mk] + } else { + mv = nil + } + d.decode(&mv) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint64StringR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint64]string) + v, changed := fastpathTV.DecMapUint64StringV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint64StringV(rv2i(rv).(map[uint64]string), false, d) + } +} +func (f fastpathT) DecMapUint64StringX(vp *map[uint64]string, d *Decoder) { + v, changed := f.DecMapUint64StringV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint64StringV(v map[uint64]string, canChange bool, + d *Decoder) (_ map[uint64]string, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[uint64]string, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint64 + var mv string + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeUint64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = "" + } + continue + } + mv = dd.DecodeString() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint64UintR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint64]uint) + v, changed := fastpathTV.DecMapUint64UintV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint64UintV(rv2i(rv).(map[uint64]uint), false, d) + } +} +func (f fastpathT) DecMapUint64UintX(vp *map[uint64]uint, d *Decoder) { + v, changed := f.DecMapUint64UintV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint64UintV(v map[uint64]uint, canChange bool, + d *Decoder) (_ map[uint64]uint, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uint64]uint, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint64 + var mv uint + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeUint64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint64Uint8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint64]uint8) + v, changed := fastpathTV.DecMapUint64Uint8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint64Uint8V(rv2i(rv).(map[uint64]uint8), false, d) + } +} +func (f fastpathT) DecMapUint64Uint8X(vp *map[uint64]uint8, d *Decoder) { + v, changed := f.DecMapUint64Uint8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint64Uint8V(v map[uint64]uint8, canChange bool, + d *Decoder) (_ map[uint64]uint8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uint64]uint8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint64 + var mv uint8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeUint64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint64Uint16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint64]uint16) + v, changed := fastpathTV.DecMapUint64Uint16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint64Uint16V(rv2i(rv).(map[uint64]uint16), false, d) + } +} +func (f fastpathT) DecMapUint64Uint16X(vp *map[uint64]uint16, d *Decoder) { + v, changed := f.DecMapUint64Uint16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint64Uint16V(v map[uint64]uint16, canChange bool, + d *Decoder) (_ map[uint64]uint16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[uint64]uint16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint64 + var mv uint16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeUint64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint64Uint32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint64]uint32) + v, changed := fastpathTV.DecMapUint64Uint32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint64Uint32V(rv2i(rv).(map[uint64]uint32), false, d) + } +} +func (f fastpathT) DecMapUint64Uint32X(vp *map[uint64]uint32, d *Decoder) { + v, changed := f.DecMapUint64Uint32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint64Uint32V(v map[uint64]uint32, canChange bool, + d *Decoder) (_ map[uint64]uint32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uint64]uint32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint64 + var mv uint32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeUint64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint64Uint64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint64]uint64) + v, changed := fastpathTV.DecMapUint64Uint64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint64Uint64V(rv2i(rv).(map[uint64]uint64), false, d) + } +} +func (f fastpathT) DecMapUint64Uint64X(vp *map[uint64]uint64, d *Decoder) { + v, changed := f.DecMapUint64Uint64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint64Uint64V(v map[uint64]uint64, canChange bool, + d *Decoder) (_ map[uint64]uint64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uint64]uint64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint64 + var mv uint64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeUint64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeUint64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint64UintptrR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint64]uintptr) + v, changed := fastpathTV.DecMapUint64UintptrV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint64UintptrV(rv2i(rv).(map[uint64]uintptr), false, d) + } +} +func (f fastpathT) DecMapUint64UintptrX(vp *map[uint64]uintptr, d *Decoder) { + v, changed := f.DecMapUint64UintptrV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint64UintptrV(v map[uint64]uintptr, canChange bool, + d *Decoder) (_ map[uint64]uintptr, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uint64]uintptr, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint64 + var mv uintptr + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeUint64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint64IntR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint64]int) + v, changed := fastpathTV.DecMapUint64IntV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint64IntV(rv2i(rv).(map[uint64]int), false, d) + } +} +func (f fastpathT) DecMapUint64IntX(vp *map[uint64]int, d *Decoder) { + v, changed := f.DecMapUint64IntV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint64IntV(v map[uint64]int, canChange bool, + d *Decoder) (_ map[uint64]int, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uint64]int, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint64 + var mv int + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeUint64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint64Int8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint64]int8) + v, changed := fastpathTV.DecMapUint64Int8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint64Int8V(rv2i(rv).(map[uint64]int8), false, d) + } +} +func (f fastpathT) DecMapUint64Int8X(vp *map[uint64]int8, d *Decoder) { + v, changed := f.DecMapUint64Int8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint64Int8V(v map[uint64]int8, canChange bool, + d *Decoder) (_ map[uint64]int8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uint64]int8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint64 + var mv int8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeUint64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint64Int16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint64]int16) + v, changed := fastpathTV.DecMapUint64Int16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint64Int16V(rv2i(rv).(map[uint64]int16), false, d) + } +} +func (f fastpathT) DecMapUint64Int16X(vp *map[uint64]int16, d *Decoder) { + v, changed := f.DecMapUint64Int16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint64Int16V(v map[uint64]int16, canChange bool, + d *Decoder) (_ map[uint64]int16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[uint64]int16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint64 + var mv int16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeUint64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint64Int32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint64]int32) + v, changed := fastpathTV.DecMapUint64Int32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint64Int32V(rv2i(rv).(map[uint64]int32), false, d) + } +} +func (f fastpathT) DecMapUint64Int32X(vp *map[uint64]int32, d *Decoder) { + v, changed := f.DecMapUint64Int32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint64Int32V(v map[uint64]int32, canChange bool, + d *Decoder) (_ map[uint64]int32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uint64]int32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint64 + var mv int32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeUint64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint64Int64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint64]int64) + v, changed := fastpathTV.DecMapUint64Int64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint64Int64V(rv2i(rv).(map[uint64]int64), false, d) + } +} +func (f fastpathT) DecMapUint64Int64X(vp *map[uint64]int64, d *Decoder) { + v, changed := f.DecMapUint64Int64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint64Int64V(v map[uint64]int64, canChange bool, + d *Decoder) (_ map[uint64]int64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uint64]int64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint64 + var mv int64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeUint64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeInt64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint64Float32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint64]float32) + v, changed := fastpathTV.DecMapUint64Float32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint64Float32V(rv2i(rv).(map[uint64]float32), false, d) + } +} +func (f fastpathT) DecMapUint64Float32X(vp *map[uint64]float32, d *Decoder) { + v, changed := f.DecMapUint64Float32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint64Float32V(v map[uint64]float32, canChange bool, + d *Decoder) (_ map[uint64]float32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uint64]float32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint64 + var mv float32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeUint64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint64Float64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint64]float64) + v, changed := fastpathTV.DecMapUint64Float64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint64Float64V(rv2i(rv).(map[uint64]float64), false, d) + } +} +func (f fastpathT) DecMapUint64Float64X(vp *map[uint64]float64, d *Decoder) { + v, changed := f.DecMapUint64Float64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint64Float64V(v map[uint64]float64, canChange bool, + d *Decoder) (_ map[uint64]float64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uint64]float64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint64 + var mv float64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeUint64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeFloat64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUint64BoolR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uint64]bool) + v, changed := fastpathTV.DecMapUint64BoolV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUint64BoolV(rv2i(rv).(map[uint64]bool), false, d) + } +} +func (f fastpathT) DecMapUint64BoolX(vp *map[uint64]bool, d *Decoder) { + v, changed := f.DecMapUint64BoolV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUint64BoolV(v map[uint64]bool, canChange bool, + d *Decoder) (_ map[uint64]bool, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uint64]bool, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uint64 + var mv bool + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeUint64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = false + } + continue + } + mv = dd.DecodeBool() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintptrIntfR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uintptr]interface{}) + v, changed := fastpathTV.DecMapUintptrIntfV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintptrIntfV(rv2i(rv).(map[uintptr]interface{}), false, d) + } +} +func (f fastpathT) DecMapUintptrIntfX(vp *map[uintptr]interface{}, d *Decoder) { + v, changed := f.DecMapUintptrIntfV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrIntfV(v map[uintptr]interface{}, canChange bool, + d *Decoder) (_ map[uintptr]interface{}, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[uintptr]interface{}, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset + var mk uintptr + var mv interface{} + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = nil + } + continue + } + if mapGet { + mv = v[mk] + } else { + mv = nil + } + d.decode(&mv) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintptrStringR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uintptr]string) + v, changed := fastpathTV.DecMapUintptrStringV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintptrStringV(rv2i(rv).(map[uintptr]string), false, d) + } +} +func (f fastpathT) DecMapUintptrStringX(vp *map[uintptr]string, d *Decoder) { + v, changed := f.DecMapUintptrStringV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrStringV(v map[uintptr]string, canChange bool, + d *Decoder) (_ map[uintptr]string, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[uintptr]string, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uintptr + var mv string + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = "" + } + continue + } + mv = dd.DecodeString() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintptrUintR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uintptr]uint) + v, changed := fastpathTV.DecMapUintptrUintV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintptrUintV(rv2i(rv).(map[uintptr]uint), false, d) + } +} +func (f fastpathT) DecMapUintptrUintX(vp *map[uintptr]uint, d *Decoder) { + v, changed := f.DecMapUintptrUintV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrUintV(v map[uintptr]uint, canChange bool, + d *Decoder) (_ map[uintptr]uint, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uintptr]uint, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uintptr + var mv uint + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintptrUint8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uintptr]uint8) + v, changed := fastpathTV.DecMapUintptrUint8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintptrUint8V(rv2i(rv).(map[uintptr]uint8), false, d) + } +} +func (f fastpathT) DecMapUintptrUint8X(vp *map[uintptr]uint8, d *Decoder) { + v, changed := f.DecMapUintptrUint8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrUint8V(v map[uintptr]uint8, canChange bool, + d *Decoder) (_ map[uintptr]uint8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uintptr]uint8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uintptr + var mv uint8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintptrUint16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uintptr]uint16) + v, changed := fastpathTV.DecMapUintptrUint16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintptrUint16V(rv2i(rv).(map[uintptr]uint16), false, d) + } +} +func (f fastpathT) DecMapUintptrUint16X(vp *map[uintptr]uint16, d *Decoder) { + v, changed := f.DecMapUintptrUint16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrUint16V(v map[uintptr]uint16, canChange bool, + d *Decoder) (_ map[uintptr]uint16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[uintptr]uint16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uintptr + var mv uint16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintptrUint32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uintptr]uint32) + v, changed := fastpathTV.DecMapUintptrUint32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintptrUint32V(rv2i(rv).(map[uintptr]uint32), false, d) + } +} +func (f fastpathT) DecMapUintptrUint32X(vp *map[uintptr]uint32, d *Decoder) { + v, changed := f.DecMapUintptrUint32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrUint32V(v map[uintptr]uint32, canChange bool, + d *Decoder) (_ map[uintptr]uint32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uintptr]uint32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uintptr + var mv uint32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintptrUint64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uintptr]uint64) + v, changed := fastpathTV.DecMapUintptrUint64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintptrUint64V(rv2i(rv).(map[uintptr]uint64), false, d) + } +} +func (f fastpathT) DecMapUintptrUint64X(vp *map[uintptr]uint64, d *Decoder) { + v, changed := f.DecMapUintptrUint64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrUint64V(v map[uintptr]uint64, canChange bool, + d *Decoder) (_ map[uintptr]uint64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uintptr]uint64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uintptr + var mv uint64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeUint64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintptrUintptrR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uintptr]uintptr) + v, changed := fastpathTV.DecMapUintptrUintptrV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintptrUintptrV(rv2i(rv).(map[uintptr]uintptr), false, d) + } +} +func (f fastpathT) DecMapUintptrUintptrX(vp *map[uintptr]uintptr, d *Decoder) { + v, changed := f.DecMapUintptrUintptrV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrUintptrV(v map[uintptr]uintptr, canChange bool, + d *Decoder) (_ map[uintptr]uintptr, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uintptr]uintptr, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uintptr + var mv uintptr + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintptrIntR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uintptr]int) + v, changed := fastpathTV.DecMapUintptrIntV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintptrIntV(rv2i(rv).(map[uintptr]int), false, d) + } +} +func (f fastpathT) DecMapUintptrIntX(vp *map[uintptr]int, d *Decoder) { + v, changed := f.DecMapUintptrIntV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrIntV(v map[uintptr]int, canChange bool, + d *Decoder) (_ map[uintptr]int, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uintptr]int, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uintptr + var mv int + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintptrInt8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uintptr]int8) + v, changed := fastpathTV.DecMapUintptrInt8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintptrInt8V(rv2i(rv).(map[uintptr]int8), false, d) + } +} +func (f fastpathT) DecMapUintptrInt8X(vp *map[uintptr]int8, d *Decoder) { + v, changed := f.DecMapUintptrInt8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrInt8V(v map[uintptr]int8, canChange bool, + d *Decoder) (_ map[uintptr]int8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uintptr]int8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uintptr + var mv int8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintptrInt16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uintptr]int16) + v, changed := fastpathTV.DecMapUintptrInt16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintptrInt16V(rv2i(rv).(map[uintptr]int16), false, d) + } +} +func (f fastpathT) DecMapUintptrInt16X(vp *map[uintptr]int16, d *Decoder) { + v, changed := f.DecMapUintptrInt16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrInt16V(v map[uintptr]int16, canChange bool, + d *Decoder) (_ map[uintptr]int16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[uintptr]int16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uintptr + var mv int16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintptrInt32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uintptr]int32) + v, changed := fastpathTV.DecMapUintptrInt32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintptrInt32V(rv2i(rv).(map[uintptr]int32), false, d) + } +} +func (f fastpathT) DecMapUintptrInt32X(vp *map[uintptr]int32, d *Decoder) { + v, changed := f.DecMapUintptrInt32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrInt32V(v map[uintptr]int32, canChange bool, + d *Decoder) (_ map[uintptr]int32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uintptr]int32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uintptr + var mv int32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintptrInt64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uintptr]int64) + v, changed := fastpathTV.DecMapUintptrInt64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintptrInt64V(rv2i(rv).(map[uintptr]int64), false, d) + } +} +func (f fastpathT) DecMapUintptrInt64X(vp *map[uintptr]int64, d *Decoder) { + v, changed := f.DecMapUintptrInt64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrInt64V(v map[uintptr]int64, canChange bool, + d *Decoder) (_ map[uintptr]int64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uintptr]int64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uintptr + var mv int64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeInt64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintptrFloat32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uintptr]float32) + v, changed := fastpathTV.DecMapUintptrFloat32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintptrFloat32V(rv2i(rv).(map[uintptr]float32), false, d) + } +} +func (f fastpathT) DecMapUintptrFloat32X(vp *map[uintptr]float32, d *Decoder) { + v, changed := f.DecMapUintptrFloat32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrFloat32V(v map[uintptr]float32, canChange bool, + d *Decoder) (_ map[uintptr]float32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[uintptr]float32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uintptr + var mv float32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintptrFloat64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uintptr]float64) + v, changed := fastpathTV.DecMapUintptrFloat64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintptrFloat64V(rv2i(rv).(map[uintptr]float64), false, d) + } +} +func (f fastpathT) DecMapUintptrFloat64X(vp *map[uintptr]float64, d *Decoder) { + v, changed := f.DecMapUintptrFloat64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrFloat64V(v map[uintptr]float64, canChange bool, + d *Decoder) (_ map[uintptr]float64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[uintptr]float64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uintptr + var mv float64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeFloat64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapUintptrBoolR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[uintptr]bool) + v, changed := fastpathTV.DecMapUintptrBoolV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapUintptrBoolV(rv2i(rv).(map[uintptr]bool), false, d) + } +} +func (f fastpathT) DecMapUintptrBoolX(vp *map[uintptr]bool, d *Decoder) { + v, changed := f.DecMapUintptrBoolV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapUintptrBoolV(v map[uintptr]bool, canChange bool, + d *Decoder) (_ map[uintptr]bool, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[uintptr]bool, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk uintptr + var mv bool + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = false + } + continue + } + mv = dd.DecodeBool() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntIntfR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int]interface{}) + v, changed := fastpathTV.DecMapIntIntfV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntIntfV(rv2i(rv).(map[int]interface{}), false, d) + } +} +func (f fastpathT) DecMapIntIntfX(vp *map[int]interface{}, d *Decoder) { + v, changed := f.DecMapIntIntfV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntIntfV(v map[int]interface{}, canChange bool, + d *Decoder) (_ map[int]interface{}, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[int]interface{}, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset + var mk int + var mv interface{} + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = nil + } + continue + } + if mapGet { + mv = v[mk] + } else { + mv = nil + } + d.decode(&mv) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntStringR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int]string) + v, changed := fastpathTV.DecMapIntStringV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntStringV(rv2i(rv).(map[int]string), false, d) + } +} +func (f fastpathT) DecMapIntStringX(vp *map[int]string, d *Decoder) { + v, changed := f.DecMapIntStringV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntStringV(v map[int]string, canChange bool, + d *Decoder) (_ map[int]string, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[int]string, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int + var mv string + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = "" + } + continue + } + mv = dd.DecodeString() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntUintR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int]uint) + v, changed := fastpathTV.DecMapIntUintV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntUintV(rv2i(rv).(map[int]uint), false, d) + } +} +func (f fastpathT) DecMapIntUintX(vp *map[int]uint, d *Decoder) { + v, changed := f.DecMapIntUintV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntUintV(v map[int]uint, canChange bool, + d *Decoder) (_ map[int]uint, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[int]uint, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int + var mv uint + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntUint8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int]uint8) + v, changed := fastpathTV.DecMapIntUint8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntUint8V(rv2i(rv).(map[int]uint8), false, d) + } +} +func (f fastpathT) DecMapIntUint8X(vp *map[int]uint8, d *Decoder) { + v, changed := f.DecMapIntUint8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntUint8V(v map[int]uint8, canChange bool, + d *Decoder) (_ map[int]uint8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[int]uint8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int + var mv uint8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntUint16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int]uint16) + v, changed := fastpathTV.DecMapIntUint16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntUint16V(rv2i(rv).(map[int]uint16), false, d) + } +} +func (f fastpathT) DecMapIntUint16X(vp *map[int]uint16, d *Decoder) { + v, changed := f.DecMapIntUint16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntUint16V(v map[int]uint16, canChange bool, + d *Decoder) (_ map[int]uint16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[int]uint16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int + var mv uint16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntUint32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int]uint32) + v, changed := fastpathTV.DecMapIntUint32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntUint32V(rv2i(rv).(map[int]uint32), false, d) + } +} +func (f fastpathT) DecMapIntUint32X(vp *map[int]uint32, d *Decoder) { + v, changed := f.DecMapIntUint32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntUint32V(v map[int]uint32, canChange bool, + d *Decoder) (_ map[int]uint32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[int]uint32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int + var mv uint32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntUint64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int]uint64) + v, changed := fastpathTV.DecMapIntUint64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntUint64V(rv2i(rv).(map[int]uint64), false, d) + } +} +func (f fastpathT) DecMapIntUint64X(vp *map[int]uint64, d *Decoder) { + v, changed := f.DecMapIntUint64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntUint64V(v map[int]uint64, canChange bool, + d *Decoder) (_ map[int]uint64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[int]uint64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int + var mv uint64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeUint64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntUintptrR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int]uintptr) + v, changed := fastpathTV.DecMapIntUintptrV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntUintptrV(rv2i(rv).(map[int]uintptr), false, d) + } +} +func (f fastpathT) DecMapIntUintptrX(vp *map[int]uintptr, d *Decoder) { + v, changed := f.DecMapIntUintptrV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntUintptrV(v map[int]uintptr, canChange bool, + d *Decoder) (_ map[int]uintptr, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[int]uintptr, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int + var mv uintptr + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntIntR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int]int) + v, changed := fastpathTV.DecMapIntIntV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntIntV(rv2i(rv).(map[int]int), false, d) + } +} +func (f fastpathT) DecMapIntIntX(vp *map[int]int, d *Decoder) { + v, changed := f.DecMapIntIntV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntIntV(v map[int]int, canChange bool, + d *Decoder) (_ map[int]int, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[int]int, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int + var mv int + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntInt8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int]int8) + v, changed := fastpathTV.DecMapIntInt8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntInt8V(rv2i(rv).(map[int]int8), false, d) + } +} +func (f fastpathT) DecMapIntInt8X(vp *map[int]int8, d *Decoder) { + v, changed := f.DecMapIntInt8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntInt8V(v map[int]int8, canChange bool, + d *Decoder) (_ map[int]int8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[int]int8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int + var mv int8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntInt16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int]int16) + v, changed := fastpathTV.DecMapIntInt16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntInt16V(rv2i(rv).(map[int]int16), false, d) + } +} +func (f fastpathT) DecMapIntInt16X(vp *map[int]int16, d *Decoder) { + v, changed := f.DecMapIntInt16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntInt16V(v map[int]int16, canChange bool, + d *Decoder) (_ map[int]int16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[int]int16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int + var mv int16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntInt32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int]int32) + v, changed := fastpathTV.DecMapIntInt32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntInt32V(rv2i(rv).(map[int]int32), false, d) + } +} +func (f fastpathT) DecMapIntInt32X(vp *map[int]int32, d *Decoder) { + v, changed := f.DecMapIntInt32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntInt32V(v map[int]int32, canChange bool, + d *Decoder) (_ map[int]int32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[int]int32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int + var mv int32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntInt64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int]int64) + v, changed := fastpathTV.DecMapIntInt64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntInt64V(rv2i(rv).(map[int]int64), false, d) + } +} +func (f fastpathT) DecMapIntInt64X(vp *map[int]int64, d *Decoder) { + v, changed := f.DecMapIntInt64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntInt64V(v map[int]int64, canChange bool, + d *Decoder) (_ map[int]int64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[int]int64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int + var mv int64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeInt64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntFloat32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int]float32) + v, changed := fastpathTV.DecMapIntFloat32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntFloat32V(rv2i(rv).(map[int]float32), false, d) + } +} +func (f fastpathT) DecMapIntFloat32X(vp *map[int]float32, d *Decoder) { + v, changed := f.DecMapIntFloat32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntFloat32V(v map[int]float32, canChange bool, + d *Decoder) (_ map[int]float32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[int]float32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int + var mv float32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntFloat64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int]float64) + v, changed := fastpathTV.DecMapIntFloat64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntFloat64V(rv2i(rv).(map[int]float64), false, d) + } +} +func (f fastpathT) DecMapIntFloat64X(vp *map[int]float64, d *Decoder) { + v, changed := f.DecMapIntFloat64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntFloat64V(v map[int]float64, canChange bool, + d *Decoder) (_ map[int]float64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[int]float64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int + var mv float64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeFloat64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapIntBoolR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int]bool) + v, changed := fastpathTV.DecMapIntBoolV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapIntBoolV(rv2i(rv).(map[int]bool), false, d) + } +} +func (f fastpathT) DecMapIntBoolX(vp *map[int]bool, d *Decoder) { + v, changed := f.DecMapIntBoolV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapIntBoolV(v map[int]bool, canChange bool, + d *Decoder) (_ map[int]bool, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[int]bool, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int + var mv bool + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = false + } + continue + } + mv = dd.DecodeBool() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt8IntfR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int8]interface{}) + v, changed := fastpathTV.DecMapInt8IntfV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt8IntfV(rv2i(rv).(map[int8]interface{}), false, d) + } +} +func (f fastpathT) DecMapInt8IntfX(vp *map[int8]interface{}, d *Decoder) { + v, changed := f.DecMapInt8IntfV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt8IntfV(v map[int8]interface{}, canChange bool, + d *Decoder) (_ map[int8]interface{}, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 17) + v = make(map[int8]interface{}, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset + var mk int8 + var mv interface{} + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = nil + } + continue + } + if mapGet { + mv = v[mk] + } else { + mv = nil + } + d.decode(&mv) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt8StringR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int8]string) + v, changed := fastpathTV.DecMapInt8StringV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt8StringV(rv2i(rv).(map[int8]string), false, d) + } +} +func (f fastpathT) DecMapInt8StringX(vp *map[int8]string, d *Decoder) { + v, changed := f.DecMapInt8StringV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt8StringV(v map[int8]string, canChange bool, + d *Decoder) (_ map[int8]string, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 17) + v = make(map[int8]string, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int8 + var mv string + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = "" + } + continue + } + mv = dd.DecodeString() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt8UintR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int8]uint) + v, changed := fastpathTV.DecMapInt8UintV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt8UintV(rv2i(rv).(map[int8]uint), false, d) + } +} +func (f fastpathT) DecMapInt8UintX(vp *map[int8]uint, d *Decoder) { + v, changed := f.DecMapInt8UintV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt8UintV(v map[int8]uint, canChange bool, + d *Decoder) (_ map[int8]uint, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[int8]uint, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int8 + var mv uint + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt8Uint8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int8]uint8) + v, changed := fastpathTV.DecMapInt8Uint8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt8Uint8V(rv2i(rv).(map[int8]uint8), false, d) + } +} +func (f fastpathT) DecMapInt8Uint8X(vp *map[int8]uint8, d *Decoder) { + v, changed := f.DecMapInt8Uint8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt8Uint8V(v map[int8]uint8, canChange bool, + d *Decoder) (_ map[int8]uint8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 2) + v = make(map[int8]uint8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int8 + var mv uint8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt8Uint16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int8]uint16) + v, changed := fastpathTV.DecMapInt8Uint16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt8Uint16V(rv2i(rv).(map[int8]uint16), false, d) + } +} +func (f fastpathT) DecMapInt8Uint16X(vp *map[int8]uint16, d *Decoder) { + v, changed := f.DecMapInt8Uint16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt8Uint16V(v map[int8]uint16, canChange bool, + d *Decoder) (_ map[int8]uint16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 3) + v = make(map[int8]uint16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int8 + var mv uint16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt8Uint32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int8]uint32) + v, changed := fastpathTV.DecMapInt8Uint32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt8Uint32V(rv2i(rv).(map[int8]uint32), false, d) + } +} +func (f fastpathT) DecMapInt8Uint32X(vp *map[int8]uint32, d *Decoder) { + v, changed := f.DecMapInt8Uint32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt8Uint32V(v map[int8]uint32, canChange bool, + d *Decoder) (_ map[int8]uint32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[int8]uint32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int8 + var mv uint32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt8Uint64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int8]uint64) + v, changed := fastpathTV.DecMapInt8Uint64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt8Uint64V(rv2i(rv).(map[int8]uint64), false, d) + } +} +func (f fastpathT) DecMapInt8Uint64X(vp *map[int8]uint64, d *Decoder) { + v, changed := f.DecMapInt8Uint64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt8Uint64V(v map[int8]uint64, canChange bool, + d *Decoder) (_ map[int8]uint64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[int8]uint64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int8 + var mv uint64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeUint64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt8UintptrR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int8]uintptr) + v, changed := fastpathTV.DecMapInt8UintptrV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt8UintptrV(rv2i(rv).(map[int8]uintptr), false, d) + } +} +func (f fastpathT) DecMapInt8UintptrX(vp *map[int8]uintptr, d *Decoder) { + v, changed := f.DecMapInt8UintptrV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt8UintptrV(v map[int8]uintptr, canChange bool, + d *Decoder) (_ map[int8]uintptr, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[int8]uintptr, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int8 + var mv uintptr + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt8IntR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int8]int) + v, changed := fastpathTV.DecMapInt8IntV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt8IntV(rv2i(rv).(map[int8]int), false, d) + } +} +func (f fastpathT) DecMapInt8IntX(vp *map[int8]int, d *Decoder) { + v, changed := f.DecMapInt8IntV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt8IntV(v map[int8]int, canChange bool, + d *Decoder) (_ map[int8]int, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[int8]int, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int8 + var mv int + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt8Int8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int8]int8) + v, changed := fastpathTV.DecMapInt8Int8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt8Int8V(rv2i(rv).(map[int8]int8), false, d) + } +} +func (f fastpathT) DecMapInt8Int8X(vp *map[int8]int8, d *Decoder) { + v, changed := f.DecMapInt8Int8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt8Int8V(v map[int8]int8, canChange bool, + d *Decoder) (_ map[int8]int8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 2) + v = make(map[int8]int8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int8 + var mv int8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt8Int16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int8]int16) + v, changed := fastpathTV.DecMapInt8Int16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt8Int16V(rv2i(rv).(map[int8]int16), false, d) + } +} +func (f fastpathT) DecMapInt8Int16X(vp *map[int8]int16, d *Decoder) { + v, changed := f.DecMapInt8Int16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt8Int16V(v map[int8]int16, canChange bool, + d *Decoder) (_ map[int8]int16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 3) + v = make(map[int8]int16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int8 + var mv int16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt8Int32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int8]int32) + v, changed := fastpathTV.DecMapInt8Int32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt8Int32V(rv2i(rv).(map[int8]int32), false, d) + } +} +func (f fastpathT) DecMapInt8Int32X(vp *map[int8]int32, d *Decoder) { + v, changed := f.DecMapInt8Int32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt8Int32V(v map[int8]int32, canChange bool, + d *Decoder) (_ map[int8]int32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[int8]int32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int8 + var mv int32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt8Int64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int8]int64) + v, changed := fastpathTV.DecMapInt8Int64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt8Int64V(rv2i(rv).(map[int8]int64), false, d) + } +} +func (f fastpathT) DecMapInt8Int64X(vp *map[int8]int64, d *Decoder) { + v, changed := f.DecMapInt8Int64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt8Int64V(v map[int8]int64, canChange bool, + d *Decoder) (_ map[int8]int64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[int8]int64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int8 + var mv int64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeInt64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt8Float32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int8]float32) + v, changed := fastpathTV.DecMapInt8Float32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt8Float32V(rv2i(rv).(map[int8]float32), false, d) + } +} +func (f fastpathT) DecMapInt8Float32X(vp *map[int8]float32, d *Decoder) { + v, changed := f.DecMapInt8Float32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt8Float32V(v map[int8]float32, canChange bool, + d *Decoder) (_ map[int8]float32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[int8]float32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int8 + var mv float32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt8Float64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int8]float64) + v, changed := fastpathTV.DecMapInt8Float64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt8Float64V(rv2i(rv).(map[int8]float64), false, d) + } +} +func (f fastpathT) DecMapInt8Float64X(vp *map[int8]float64, d *Decoder) { + v, changed := f.DecMapInt8Float64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt8Float64V(v map[int8]float64, canChange bool, + d *Decoder) (_ map[int8]float64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[int8]float64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int8 + var mv float64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeFloat64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt8BoolR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int8]bool) + v, changed := fastpathTV.DecMapInt8BoolV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt8BoolV(rv2i(rv).(map[int8]bool), false, d) + } +} +func (f fastpathT) DecMapInt8BoolX(vp *map[int8]bool, d *Decoder) { + v, changed := f.DecMapInt8BoolV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt8BoolV(v map[int8]bool, canChange bool, + d *Decoder) (_ map[int8]bool, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 2) + v = make(map[int8]bool, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int8 + var mv bool + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = false + } + continue + } + mv = dd.DecodeBool() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt16IntfR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int16]interface{}) + v, changed := fastpathTV.DecMapInt16IntfV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt16IntfV(rv2i(rv).(map[int16]interface{}), false, d) + } +} +func (f fastpathT) DecMapInt16IntfX(vp *map[int16]interface{}, d *Decoder) { + v, changed := f.DecMapInt16IntfV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt16IntfV(v map[int16]interface{}, canChange bool, + d *Decoder) (_ map[int16]interface{}, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 18) + v = make(map[int16]interface{}, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset + var mk int16 + var mv interface{} + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = nil + } + continue + } + if mapGet { + mv = v[mk] + } else { + mv = nil + } + d.decode(&mv) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt16StringR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int16]string) + v, changed := fastpathTV.DecMapInt16StringV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt16StringV(rv2i(rv).(map[int16]string), false, d) + } +} +func (f fastpathT) DecMapInt16StringX(vp *map[int16]string, d *Decoder) { + v, changed := f.DecMapInt16StringV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt16StringV(v map[int16]string, canChange bool, + d *Decoder) (_ map[int16]string, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 18) + v = make(map[int16]string, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int16 + var mv string + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = "" + } + continue + } + mv = dd.DecodeString() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt16UintR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int16]uint) + v, changed := fastpathTV.DecMapInt16UintV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt16UintV(rv2i(rv).(map[int16]uint), false, d) + } +} +func (f fastpathT) DecMapInt16UintX(vp *map[int16]uint, d *Decoder) { + v, changed := f.DecMapInt16UintV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt16UintV(v map[int16]uint, canChange bool, + d *Decoder) (_ map[int16]uint, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[int16]uint, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int16 + var mv uint + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt16Uint8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int16]uint8) + v, changed := fastpathTV.DecMapInt16Uint8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt16Uint8V(rv2i(rv).(map[int16]uint8), false, d) + } +} +func (f fastpathT) DecMapInt16Uint8X(vp *map[int16]uint8, d *Decoder) { + v, changed := f.DecMapInt16Uint8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt16Uint8V(v map[int16]uint8, canChange bool, + d *Decoder) (_ map[int16]uint8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 3) + v = make(map[int16]uint8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int16 + var mv uint8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt16Uint16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int16]uint16) + v, changed := fastpathTV.DecMapInt16Uint16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt16Uint16V(rv2i(rv).(map[int16]uint16), false, d) + } +} +func (f fastpathT) DecMapInt16Uint16X(vp *map[int16]uint16, d *Decoder) { + v, changed := f.DecMapInt16Uint16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt16Uint16V(v map[int16]uint16, canChange bool, + d *Decoder) (_ map[int16]uint16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 4) + v = make(map[int16]uint16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int16 + var mv uint16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt16Uint32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int16]uint32) + v, changed := fastpathTV.DecMapInt16Uint32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt16Uint32V(rv2i(rv).(map[int16]uint32), false, d) + } +} +func (f fastpathT) DecMapInt16Uint32X(vp *map[int16]uint32, d *Decoder) { + v, changed := f.DecMapInt16Uint32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt16Uint32V(v map[int16]uint32, canChange bool, + d *Decoder) (_ map[int16]uint32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 6) + v = make(map[int16]uint32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int16 + var mv uint32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt16Uint64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int16]uint64) + v, changed := fastpathTV.DecMapInt16Uint64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt16Uint64V(rv2i(rv).(map[int16]uint64), false, d) + } +} +func (f fastpathT) DecMapInt16Uint64X(vp *map[int16]uint64, d *Decoder) { + v, changed := f.DecMapInt16Uint64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt16Uint64V(v map[int16]uint64, canChange bool, + d *Decoder) (_ map[int16]uint64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[int16]uint64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int16 + var mv uint64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeUint64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt16UintptrR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int16]uintptr) + v, changed := fastpathTV.DecMapInt16UintptrV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt16UintptrV(rv2i(rv).(map[int16]uintptr), false, d) + } +} +func (f fastpathT) DecMapInt16UintptrX(vp *map[int16]uintptr, d *Decoder) { + v, changed := f.DecMapInt16UintptrV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt16UintptrV(v map[int16]uintptr, canChange bool, + d *Decoder) (_ map[int16]uintptr, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[int16]uintptr, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int16 + var mv uintptr + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt16IntR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int16]int) + v, changed := fastpathTV.DecMapInt16IntV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt16IntV(rv2i(rv).(map[int16]int), false, d) + } +} +func (f fastpathT) DecMapInt16IntX(vp *map[int16]int, d *Decoder) { + v, changed := f.DecMapInt16IntV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt16IntV(v map[int16]int, canChange bool, + d *Decoder) (_ map[int16]int, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[int16]int, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int16 + var mv int + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt16Int8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int16]int8) + v, changed := fastpathTV.DecMapInt16Int8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt16Int8V(rv2i(rv).(map[int16]int8), false, d) + } +} +func (f fastpathT) DecMapInt16Int8X(vp *map[int16]int8, d *Decoder) { + v, changed := f.DecMapInt16Int8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt16Int8V(v map[int16]int8, canChange bool, + d *Decoder) (_ map[int16]int8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 3) + v = make(map[int16]int8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int16 + var mv int8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt16Int16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int16]int16) + v, changed := fastpathTV.DecMapInt16Int16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt16Int16V(rv2i(rv).(map[int16]int16), false, d) + } +} +func (f fastpathT) DecMapInt16Int16X(vp *map[int16]int16, d *Decoder) { + v, changed := f.DecMapInt16Int16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt16Int16V(v map[int16]int16, canChange bool, + d *Decoder) (_ map[int16]int16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 4) + v = make(map[int16]int16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int16 + var mv int16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt16Int32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int16]int32) + v, changed := fastpathTV.DecMapInt16Int32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt16Int32V(rv2i(rv).(map[int16]int32), false, d) + } +} +func (f fastpathT) DecMapInt16Int32X(vp *map[int16]int32, d *Decoder) { + v, changed := f.DecMapInt16Int32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt16Int32V(v map[int16]int32, canChange bool, + d *Decoder) (_ map[int16]int32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 6) + v = make(map[int16]int32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int16 + var mv int32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt16Int64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int16]int64) + v, changed := fastpathTV.DecMapInt16Int64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt16Int64V(rv2i(rv).(map[int16]int64), false, d) + } +} +func (f fastpathT) DecMapInt16Int64X(vp *map[int16]int64, d *Decoder) { + v, changed := f.DecMapInt16Int64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt16Int64V(v map[int16]int64, canChange bool, + d *Decoder) (_ map[int16]int64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[int16]int64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int16 + var mv int64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeInt64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt16Float32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int16]float32) + v, changed := fastpathTV.DecMapInt16Float32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt16Float32V(rv2i(rv).(map[int16]float32), false, d) + } +} +func (f fastpathT) DecMapInt16Float32X(vp *map[int16]float32, d *Decoder) { + v, changed := f.DecMapInt16Float32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt16Float32V(v map[int16]float32, canChange bool, + d *Decoder) (_ map[int16]float32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 6) + v = make(map[int16]float32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int16 + var mv float32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt16Float64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int16]float64) + v, changed := fastpathTV.DecMapInt16Float64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt16Float64V(rv2i(rv).(map[int16]float64), false, d) + } +} +func (f fastpathT) DecMapInt16Float64X(vp *map[int16]float64, d *Decoder) { + v, changed := f.DecMapInt16Float64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt16Float64V(v map[int16]float64, canChange bool, + d *Decoder) (_ map[int16]float64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[int16]float64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int16 + var mv float64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeFloat64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt16BoolR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int16]bool) + v, changed := fastpathTV.DecMapInt16BoolV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt16BoolV(rv2i(rv).(map[int16]bool), false, d) + } +} +func (f fastpathT) DecMapInt16BoolX(vp *map[int16]bool, d *Decoder) { + v, changed := f.DecMapInt16BoolV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt16BoolV(v map[int16]bool, canChange bool, + d *Decoder) (_ map[int16]bool, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 3) + v = make(map[int16]bool, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int16 + var mv bool + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = false + } + continue + } + mv = dd.DecodeBool() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt32IntfR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int32]interface{}) + v, changed := fastpathTV.DecMapInt32IntfV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt32IntfV(rv2i(rv).(map[int32]interface{}), false, d) + } +} +func (f fastpathT) DecMapInt32IntfX(vp *map[int32]interface{}, d *Decoder) { + v, changed := f.DecMapInt32IntfV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt32IntfV(v map[int32]interface{}, canChange bool, + d *Decoder) (_ map[int32]interface{}, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 20) + v = make(map[int32]interface{}, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset + var mk int32 + var mv interface{} + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = nil + } + continue + } + if mapGet { + mv = v[mk] + } else { + mv = nil + } + d.decode(&mv) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt32StringR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int32]string) + v, changed := fastpathTV.DecMapInt32StringV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt32StringV(rv2i(rv).(map[int32]string), false, d) + } +} +func (f fastpathT) DecMapInt32StringX(vp *map[int32]string, d *Decoder) { + v, changed := f.DecMapInt32StringV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt32StringV(v map[int32]string, canChange bool, + d *Decoder) (_ map[int32]string, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 20) + v = make(map[int32]string, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int32 + var mv string + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = "" + } + continue + } + mv = dd.DecodeString() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt32UintR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int32]uint) + v, changed := fastpathTV.DecMapInt32UintV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt32UintV(rv2i(rv).(map[int32]uint), false, d) + } +} +func (f fastpathT) DecMapInt32UintX(vp *map[int32]uint, d *Decoder) { + v, changed := f.DecMapInt32UintV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt32UintV(v map[int32]uint, canChange bool, + d *Decoder) (_ map[int32]uint, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[int32]uint, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int32 + var mv uint + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt32Uint8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int32]uint8) + v, changed := fastpathTV.DecMapInt32Uint8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt32Uint8V(rv2i(rv).(map[int32]uint8), false, d) + } +} +func (f fastpathT) DecMapInt32Uint8X(vp *map[int32]uint8, d *Decoder) { + v, changed := f.DecMapInt32Uint8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt32Uint8V(v map[int32]uint8, canChange bool, + d *Decoder) (_ map[int32]uint8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[int32]uint8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int32 + var mv uint8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt32Uint16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int32]uint16) + v, changed := fastpathTV.DecMapInt32Uint16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt32Uint16V(rv2i(rv).(map[int32]uint16), false, d) + } +} +func (f fastpathT) DecMapInt32Uint16X(vp *map[int32]uint16, d *Decoder) { + v, changed := f.DecMapInt32Uint16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt32Uint16V(v map[int32]uint16, canChange bool, + d *Decoder) (_ map[int32]uint16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 6) + v = make(map[int32]uint16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int32 + var mv uint16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt32Uint32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int32]uint32) + v, changed := fastpathTV.DecMapInt32Uint32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt32Uint32V(rv2i(rv).(map[int32]uint32), false, d) + } +} +func (f fastpathT) DecMapInt32Uint32X(vp *map[int32]uint32, d *Decoder) { + v, changed := f.DecMapInt32Uint32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt32Uint32V(v map[int32]uint32, canChange bool, + d *Decoder) (_ map[int32]uint32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 8) + v = make(map[int32]uint32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int32 + var mv uint32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt32Uint64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int32]uint64) + v, changed := fastpathTV.DecMapInt32Uint64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt32Uint64V(rv2i(rv).(map[int32]uint64), false, d) + } +} +func (f fastpathT) DecMapInt32Uint64X(vp *map[int32]uint64, d *Decoder) { + v, changed := f.DecMapInt32Uint64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt32Uint64V(v map[int32]uint64, canChange bool, + d *Decoder) (_ map[int32]uint64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[int32]uint64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int32 + var mv uint64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeUint64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt32UintptrR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int32]uintptr) + v, changed := fastpathTV.DecMapInt32UintptrV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt32UintptrV(rv2i(rv).(map[int32]uintptr), false, d) + } +} +func (f fastpathT) DecMapInt32UintptrX(vp *map[int32]uintptr, d *Decoder) { + v, changed := f.DecMapInt32UintptrV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt32UintptrV(v map[int32]uintptr, canChange bool, + d *Decoder) (_ map[int32]uintptr, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[int32]uintptr, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int32 + var mv uintptr + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt32IntR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int32]int) + v, changed := fastpathTV.DecMapInt32IntV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt32IntV(rv2i(rv).(map[int32]int), false, d) + } +} +func (f fastpathT) DecMapInt32IntX(vp *map[int32]int, d *Decoder) { + v, changed := f.DecMapInt32IntV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt32IntV(v map[int32]int, canChange bool, + d *Decoder) (_ map[int32]int, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[int32]int, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int32 + var mv int + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt32Int8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int32]int8) + v, changed := fastpathTV.DecMapInt32Int8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt32Int8V(rv2i(rv).(map[int32]int8), false, d) + } +} +func (f fastpathT) DecMapInt32Int8X(vp *map[int32]int8, d *Decoder) { + v, changed := f.DecMapInt32Int8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt32Int8V(v map[int32]int8, canChange bool, + d *Decoder) (_ map[int32]int8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[int32]int8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int32 + var mv int8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt32Int16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int32]int16) + v, changed := fastpathTV.DecMapInt32Int16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt32Int16V(rv2i(rv).(map[int32]int16), false, d) + } +} +func (f fastpathT) DecMapInt32Int16X(vp *map[int32]int16, d *Decoder) { + v, changed := f.DecMapInt32Int16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt32Int16V(v map[int32]int16, canChange bool, + d *Decoder) (_ map[int32]int16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 6) + v = make(map[int32]int16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int32 + var mv int16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt32Int32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int32]int32) + v, changed := fastpathTV.DecMapInt32Int32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt32Int32V(rv2i(rv).(map[int32]int32), false, d) + } +} +func (f fastpathT) DecMapInt32Int32X(vp *map[int32]int32, d *Decoder) { + v, changed := f.DecMapInt32Int32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt32Int32V(v map[int32]int32, canChange bool, + d *Decoder) (_ map[int32]int32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 8) + v = make(map[int32]int32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int32 + var mv int32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt32Int64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int32]int64) + v, changed := fastpathTV.DecMapInt32Int64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt32Int64V(rv2i(rv).(map[int32]int64), false, d) + } +} +func (f fastpathT) DecMapInt32Int64X(vp *map[int32]int64, d *Decoder) { + v, changed := f.DecMapInt32Int64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt32Int64V(v map[int32]int64, canChange bool, + d *Decoder) (_ map[int32]int64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[int32]int64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int32 + var mv int64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeInt64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt32Float32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int32]float32) + v, changed := fastpathTV.DecMapInt32Float32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt32Float32V(rv2i(rv).(map[int32]float32), false, d) + } +} +func (f fastpathT) DecMapInt32Float32X(vp *map[int32]float32, d *Decoder) { + v, changed := f.DecMapInt32Float32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt32Float32V(v map[int32]float32, canChange bool, + d *Decoder) (_ map[int32]float32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 8) + v = make(map[int32]float32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int32 + var mv float32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt32Float64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int32]float64) + v, changed := fastpathTV.DecMapInt32Float64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt32Float64V(rv2i(rv).(map[int32]float64), false, d) + } +} +func (f fastpathT) DecMapInt32Float64X(vp *map[int32]float64, d *Decoder) { + v, changed := f.DecMapInt32Float64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt32Float64V(v map[int32]float64, canChange bool, + d *Decoder) (_ map[int32]float64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[int32]float64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int32 + var mv float64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeFloat64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt32BoolR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int32]bool) + v, changed := fastpathTV.DecMapInt32BoolV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt32BoolV(rv2i(rv).(map[int32]bool), false, d) + } +} +func (f fastpathT) DecMapInt32BoolX(vp *map[int32]bool, d *Decoder) { + v, changed := f.DecMapInt32BoolV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt32BoolV(v map[int32]bool, canChange bool, + d *Decoder) (_ map[int32]bool, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[int32]bool, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int32 + var mv bool + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = false + } + continue + } + mv = dd.DecodeBool() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt64IntfR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int64]interface{}) + v, changed := fastpathTV.DecMapInt64IntfV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt64IntfV(rv2i(rv).(map[int64]interface{}), false, d) + } +} +func (f fastpathT) DecMapInt64IntfX(vp *map[int64]interface{}, d *Decoder) { + v, changed := f.DecMapInt64IntfV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt64IntfV(v map[int64]interface{}, canChange bool, + d *Decoder) (_ map[int64]interface{}, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[int64]interface{}, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset + var mk int64 + var mv interface{} + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeInt64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = nil + } + continue + } + if mapGet { + mv = v[mk] + } else { + mv = nil + } + d.decode(&mv) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt64StringR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int64]string) + v, changed := fastpathTV.DecMapInt64StringV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt64StringV(rv2i(rv).(map[int64]string), false, d) + } +} +func (f fastpathT) DecMapInt64StringX(vp *map[int64]string, d *Decoder) { + v, changed := f.DecMapInt64StringV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt64StringV(v map[int64]string, canChange bool, + d *Decoder) (_ map[int64]string, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 24) + v = make(map[int64]string, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int64 + var mv string + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeInt64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = "" + } + continue + } + mv = dd.DecodeString() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt64UintR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int64]uint) + v, changed := fastpathTV.DecMapInt64UintV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt64UintV(rv2i(rv).(map[int64]uint), false, d) + } +} +func (f fastpathT) DecMapInt64UintX(vp *map[int64]uint, d *Decoder) { + v, changed := f.DecMapInt64UintV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt64UintV(v map[int64]uint, canChange bool, + d *Decoder) (_ map[int64]uint, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[int64]uint, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int64 + var mv uint + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeInt64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt64Uint8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int64]uint8) + v, changed := fastpathTV.DecMapInt64Uint8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt64Uint8V(rv2i(rv).(map[int64]uint8), false, d) + } +} +func (f fastpathT) DecMapInt64Uint8X(vp *map[int64]uint8, d *Decoder) { + v, changed := f.DecMapInt64Uint8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt64Uint8V(v map[int64]uint8, canChange bool, + d *Decoder) (_ map[int64]uint8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[int64]uint8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int64 + var mv uint8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeInt64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt64Uint16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int64]uint16) + v, changed := fastpathTV.DecMapInt64Uint16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt64Uint16V(rv2i(rv).(map[int64]uint16), false, d) + } +} +func (f fastpathT) DecMapInt64Uint16X(vp *map[int64]uint16, d *Decoder) { + v, changed := f.DecMapInt64Uint16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt64Uint16V(v map[int64]uint16, canChange bool, + d *Decoder) (_ map[int64]uint16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[int64]uint16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int64 + var mv uint16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeInt64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt64Uint32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int64]uint32) + v, changed := fastpathTV.DecMapInt64Uint32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt64Uint32V(rv2i(rv).(map[int64]uint32), false, d) + } +} +func (f fastpathT) DecMapInt64Uint32X(vp *map[int64]uint32, d *Decoder) { + v, changed := f.DecMapInt64Uint32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt64Uint32V(v map[int64]uint32, canChange bool, + d *Decoder) (_ map[int64]uint32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[int64]uint32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int64 + var mv uint32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeInt64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt64Uint64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int64]uint64) + v, changed := fastpathTV.DecMapInt64Uint64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt64Uint64V(rv2i(rv).(map[int64]uint64), false, d) + } +} +func (f fastpathT) DecMapInt64Uint64X(vp *map[int64]uint64, d *Decoder) { + v, changed := f.DecMapInt64Uint64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt64Uint64V(v map[int64]uint64, canChange bool, + d *Decoder) (_ map[int64]uint64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[int64]uint64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int64 + var mv uint64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeInt64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeUint64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt64UintptrR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int64]uintptr) + v, changed := fastpathTV.DecMapInt64UintptrV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt64UintptrV(rv2i(rv).(map[int64]uintptr), false, d) + } +} +func (f fastpathT) DecMapInt64UintptrX(vp *map[int64]uintptr, d *Decoder) { + v, changed := f.DecMapInt64UintptrV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt64UintptrV(v map[int64]uintptr, canChange bool, + d *Decoder) (_ map[int64]uintptr, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[int64]uintptr, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int64 + var mv uintptr + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeInt64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt64IntR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int64]int) + v, changed := fastpathTV.DecMapInt64IntV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt64IntV(rv2i(rv).(map[int64]int), false, d) + } +} +func (f fastpathT) DecMapInt64IntX(vp *map[int64]int, d *Decoder) { + v, changed := f.DecMapInt64IntV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt64IntV(v map[int64]int, canChange bool, + d *Decoder) (_ map[int64]int, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[int64]int, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int64 + var mv int + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeInt64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt64Int8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int64]int8) + v, changed := fastpathTV.DecMapInt64Int8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt64Int8V(rv2i(rv).(map[int64]int8), false, d) + } +} +func (f fastpathT) DecMapInt64Int8X(vp *map[int64]int8, d *Decoder) { + v, changed := f.DecMapInt64Int8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt64Int8V(v map[int64]int8, canChange bool, + d *Decoder) (_ map[int64]int8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[int64]int8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int64 + var mv int8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeInt64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt64Int16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int64]int16) + v, changed := fastpathTV.DecMapInt64Int16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt64Int16V(rv2i(rv).(map[int64]int16), false, d) + } +} +func (f fastpathT) DecMapInt64Int16X(vp *map[int64]int16, d *Decoder) { + v, changed := f.DecMapInt64Int16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt64Int16V(v map[int64]int16, canChange bool, + d *Decoder) (_ map[int64]int16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 10) + v = make(map[int64]int16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int64 + var mv int16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeInt64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt64Int32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int64]int32) + v, changed := fastpathTV.DecMapInt64Int32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt64Int32V(rv2i(rv).(map[int64]int32), false, d) + } +} +func (f fastpathT) DecMapInt64Int32X(vp *map[int64]int32, d *Decoder) { + v, changed := f.DecMapInt64Int32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt64Int32V(v map[int64]int32, canChange bool, + d *Decoder) (_ map[int64]int32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[int64]int32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int64 + var mv int32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeInt64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt64Int64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int64]int64) + v, changed := fastpathTV.DecMapInt64Int64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt64Int64V(rv2i(rv).(map[int64]int64), false, d) + } +} +func (f fastpathT) DecMapInt64Int64X(vp *map[int64]int64, d *Decoder) { + v, changed := f.DecMapInt64Int64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt64Int64V(v map[int64]int64, canChange bool, + d *Decoder) (_ map[int64]int64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[int64]int64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int64 + var mv int64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeInt64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeInt64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt64Float32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int64]float32) + v, changed := fastpathTV.DecMapInt64Float32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt64Float32V(rv2i(rv).(map[int64]float32), false, d) + } +} +func (f fastpathT) DecMapInt64Float32X(vp *map[int64]float32, d *Decoder) { + v, changed := f.DecMapInt64Float32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt64Float32V(v map[int64]float32, canChange bool, + d *Decoder) (_ map[int64]float32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 12) + v = make(map[int64]float32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int64 + var mv float32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeInt64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt64Float64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int64]float64) + v, changed := fastpathTV.DecMapInt64Float64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt64Float64V(rv2i(rv).(map[int64]float64), false, d) + } +} +func (f fastpathT) DecMapInt64Float64X(vp *map[int64]float64, d *Decoder) { + v, changed := f.DecMapInt64Float64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt64Float64V(v map[int64]float64, canChange bool, + d *Decoder) (_ map[int64]float64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 16) + v = make(map[int64]float64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int64 + var mv float64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeInt64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeFloat64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapInt64BoolR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[int64]bool) + v, changed := fastpathTV.DecMapInt64BoolV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapInt64BoolV(rv2i(rv).(map[int64]bool), false, d) + } +} +func (f fastpathT) DecMapInt64BoolX(vp *map[int64]bool, d *Decoder) { + v, changed := f.DecMapInt64BoolV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapInt64BoolV(v map[int64]bool, canChange bool, + d *Decoder) (_ map[int64]bool, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[int64]bool, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk int64 + var mv bool + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeInt64() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = false + } + continue + } + mv = dd.DecodeBool() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapBoolIntfR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[bool]interface{}) + v, changed := fastpathTV.DecMapBoolIntfV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapBoolIntfV(rv2i(rv).(map[bool]interface{}), false, d) + } +} +func (f fastpathT) DecMapBoolIntfX(vp *map[bool]interface{}, d *Decoder) { + v, changed := f.DecMapBoolIntfV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapBoolIntfV(v map[bool]interface{}, canChange bool, + d *Decoder) (_ map[bool]interface{}, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 17) + v = make(map[bool]interface{}, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset + var mk bool + var mv interface{} + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeBool() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = nil + } + continue + } + if mapGet { + mv = v[mk] + } else { + mv = nil + } + d.decode(&mv) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapBoolStringR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[bool]string) + v, changed := fastpathTV.DecMapBoolStringV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapBoolStringV(rv2i(rv).(map[bool]string), false, d) + } +} +func (f fastpathT) DecMapBoolStringX(vp *map[bool]string, d *Decoder) { + v, changed := f.DecMapBoolStringV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapBoolStringV(v map[bool]string, canChange bool, + d *Decoder) (_ map[bool]string, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 17) + v = make(map[bool]string, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk bool + var mv string + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeBool() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = "" + } + continue + } + mv = dd.DecodeString() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapBoolUintR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[bool]uint) + v, changed := fastpathTV.DecMapBoolUintV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapBoolUintV(rv2i(rv).(map[bool]uint), false, d) + } +} +func (f fastpathT) DecMapBoolUintX(vp *map[bool]uint, d *Decoder) { + v, changed := f.DecMapBoolUintV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapBoolUintV(v map[bool]uint, canChange bool, + d *Decoder) (_ map[bool]uint, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[bool]uint, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk bool + var mv uint + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeBool() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapBoolUint8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[bool]uint8) + v, changed := fastpathTV.DecMapBoolUint8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapBoolUint8V(rv2i(rv).(map[bool]uint8), false, d) + } +} +func (f fastpathT) DecMapBoolUint8X(vp *map[bool]uint8, d *Decoder) { + v, changed := f.DecMapBoolUint8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapBoolUint8V(v map[bool]uint8, canChange bool, + d *Decoder) (_ map[bool]uint8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 2) + v = make(map[bool]uint8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk bool + var mv uint8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeBool() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint8(chkOvf.UintV(dd.DecodeUint64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapBoolUint16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[bool]uint16) + v, changed := fastpathTV.DecMapBoolUint16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapBoolUint16V(rv2i(rv).(map[bool]uint16), false, d) + } +} +func (f fastpathT) DecMapBoolUint16X(vp *map[bool]uint16, d *Decoder) { + v, changed := f.DecMapBoolUint16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapBoolUint16V(v map[bool]uint16, canChange bool, + d *Decoder) (_ map[bool]uint16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 3) + v = make(map[bool]uint16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk bool + var mv uint16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeBool() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint16(chkOvf.UintV(dd.DecodeUint64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapBoolUint32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[bool]uint32) + v, changed := fastpathTV.DecMapBoolUint32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapBoolUint32V(rv2i(rv).(map[bool]uint32), false, d) + } +} +func (f fastpathT) DecMapBoolUint32X(vp *map[bool]uint32, d *Decoder) { + v, changed := f.DecMapBoolUint32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapBoolUint32V(v map[bool]uint32, canChange bool, + d *Decoder) (_ map[bool]uint32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[bool]uint32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk bool + var mv uint32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeBool() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uint32(chkOvf.UintV(dd.DecodeUint64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapBoolUint64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[bool]uint64) + v, changed := fastpathTV.DecMapBoolUint64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapBoolUint64V(rv2i(rv).(map[bool]uint64), false, d) + } +} +func (f fastpathT) DecMapBoolUint64X(vp *map[bool]uint64, d *Decoder) { + v, changed := f.DecMapBoolUint64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapBoolUint64V(v map[bool]uint64, canChange bool, + d *Decoder) (_ map[bool]uint64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[bool]uint64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk bool + var mv uint64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeBool() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeUint64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapBoolUintptrR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[bool]uintptr) + v, changed := fastpathTV.DecMapBoolUintptrV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapBoolUintptrV(rv2i(rv).(map[bool]uintptr), false, d) + } +} +func (f fastpathT) DecMapBoolUintptrX(vp *map[bool]uintptr, d *Decoder) { + v, changed := f.DecMapBoolUintptrV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapBoolUintptrV(v map[bool]uintptr, canChange bool, + d *Decoder) (_ map[bool]uintptr, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[bool]uintptr, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk bool + var mv uintptr + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeBool() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapBoolIntR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[bool]int) + v, changed := fastpathTV.DecMapBoolIntV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapBoolIntV(rv2i(rv).(map[bool]int), false, d) + } +} +func (f fastpathT) DecMapBoolIntX(vp *map[bool]int, d *Decoder) { + v, changed := f.DecMapBoolIntV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapBoolIntV(v map[bool]int, canChange bool, + d *Decoder) (_ map[bool]int, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[bool]int, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk bool + var mv int + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeBool() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int(chkOvf.IntV(dd.DecodeInt64(), intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapBoolInt8R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[bool]int8) + v, changed := fastpathTV.DecMapBoolInt8V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapBoolInt8V(rv2i(rv).(map[bool]int8), false, d) + } +} +func (f fastpathT) DecMapBoolInt8X(vp *map[bool]int8, d *Decoder) { + v, changed := f.DecMapBoolInt8V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapBoolInt8V(v map[bool]int8, canChange bool, + d *Decoder) (_ map[bool]int8, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 2) + v = make(map[bool]int8, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk bool + var mv int8 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeBool() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int8(chkOvf.IntV(dd.DecodeInt64(), 8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapBoolInt16R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[bool]int16) + v, changed := fastpathTV.DecMapBoolInt16V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapBoolInt16V(rv2i(rv).(map[bool]int16), false, d) + } +} +func (f fastpathT) DecMapBoolInt16X(vp *map[bool]int16, d *Decoder) { + v, changed := f.DecMapBoolInt16V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapBoolInt16V(v map[bool]int16, canChange bool, + d *Decoder) (_ map[bool]int16, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 3) + v = make(map[bool]int16, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk bool + var mv int16 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeBool() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int16(chkOvf.IntV(dd.DecodeInt64(), 16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapBoolInt32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[bool]int32) + v, changed := fastpathTV.DecMapBoolInt32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapBoolInt32V(rv2i(rv).(map[bool]int32), false, d) + } +} +func (f fastpathT) DecMapBoolInt32X(vp *map[bool]int32, d *Decoder) { + v, changed := f.DecMapBoolInt32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapBoolInt32V(v map[bool]int32, canChange bool, + d *Decoder) (_ map[bool]int32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[bool]int32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk bool + var mv int32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeBool() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = int32(chkOvf.IntV(dd.DecodeInt64(), 32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapBoolInt64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[bool]int64) + v, changed := fastpathTV.DecMapBoolInt64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapBoolInt64V(rv2i(rv).(map[bool]int64), false, d) + } +} +func (f fastpathT) DecMapBoolInt64X(vp *map[bool]int64, d *Decoder) { + v, changed := f.DecMapBoolInt64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapBoolInt64V(v map[bool]int64, canChange bool, + d *Decoder) (_ map[bool]int64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[bool]int64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk bool + var mv int64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeBool() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeInt64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapBoolFloat32R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[bool]float32) + v, changed := fastpathTV.DecMapBoolFloat32V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapBoolFloat32V(rv2i(rv).(map[bool]float32), false, d) + } +} +func (f fastpathT) DecMapBoolFloat32X(vp *map[bool]float32, d *Decoder) { + v, changed := f.DecMapBoolFloat32V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapBoolFloat32V(v map[bool]float32, canChange bool, + d *Decoder) (_ map[bool]float32, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 5) + v = make(map[bool]float32, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk bool + var mv float32 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeBool() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = float32(chkOvf.Float32V(dd.DecodeFloat64())) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapBoolFloat64R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[bool]float64) + v, changed := fastpathTV.DecMapBoolFloat64V(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapBoolFloat64V(rv2i(rv).(map[bool]float64), false, d) + } +} +func (f fastpathT) DecMapBoolFloat64X(vp *map[bool]float64, d *Decoder) { + v, changed := f.DecMapBoolFloat64V(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapBoolFloat64V(v map[bool]float64, canChange bool, + d *Decoder) (_ map[bool]float64, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 9) + v = make(map[bool]float64, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk bool + var mv float64 + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeBool() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = 0 + } + continue + } + mv = dd.DecodeFloat64() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} + +func (d *Decoder) fastpathDecMapBoolBoolR(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[bool]bool) + v, changed := fastpathTV.DecMapBoolBoolV(*vp, true, d) + if changed { + *vp = v + } + } else { + fastpathTV.DecMapBoolBoolV(rv2i(rv).(map[bool]bool), false, d) + } +} +func (f fastpathT) DecMapBoolBoolX(vp *map[bool]bool, d *Decoder) { + v, changed := f.DecMapBoolBoolV(*vp, true, d) + if changed { + *vp = v + } +} +func (_ fastpathT) DecMapBoolBoolV(v map[bool]bool, canChange bool, + d *Decoder) (_ map[bool]bool, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators() + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, 2) + v = make(map[bool]bool, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + var mk bool + var mv bool + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { + dd.ReadMapElemKey() + } + mk = dd.DecodeBool() + if esep { + dd.ReadMapElemValue() + } + if dd.TryDecodeAsNil() { + if v == nil { + } else if d.h.DeleteOnNilMapValue { + delete(v, mk) + } else { + v[mk] = false + } + continue + } + mv = dd.DecodeBool() + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} diff --git a/vendor/github.com/ugorji/go/codec/fast-path.go.tmpl b/vendor/github.com/ugorji/go/codec/fast-path.go.tmpl new file mode 100644 index 000000000..7617c4350 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/fast-path.go.tmpl @@ -0,0 +1,491 @@ +// +build !notfastpath + +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +// Code generated from fast-path.go.tmpl - DO NOT EDIT. + +package codec + +// Fast path functions try to create a fast path encode or decode implementation +// for common maps and slices. +// +// We define the functions and register then in this single file +// so as not to pollute the encode.go and decode.go, and create a dependency in there. +// This file can be omitted without causing a build failure. +// +// The advantage of fast paths is: +// - Many calls bypass reflection altogether +// +// Currently support +// - slice of all builtin types, +// - map of all builtin types to string or interface value +// - symmetrical maps of all builtin types (e.g. str-str, uint8-uint8) +// This should provide adequate "typical" implementations. +// +// Note that fast track decode functions must handle values for which an address cannot be obtained. +// For example: +// m2 := map[string]int{} +// p2 := []interface{}{m2} +// // decoding into p2 will bomb if fast track functions do not treat like unaddressable. +// + +import ( + "reflect" + "sort" +) + +const fastpathEnabled = true + +const fastpathMapBySliceErrMsg = "mapBySlice requires even slice length, but got %v" + +type fastpathT struct {} + +var fastpathTV fastpathT + +type fastpathE struct { + rtid uintptr + rt reflect.Type + encfn func(*Encoder, *codecFnInfo, reflect.Value) + decfn func(*Decoder, *codecFnInfo, reflect.Value) +} + +type fastpathA [{{ .FastpathLen }}]fastpathE + +func (x *fastpathA) index(rtid uintptr) int { + // use binary search to grab the index (adapted from sort/search.go) + // Note: we use goto (instead of for loop) so this can be inlined. + // h, i, j := 0, 0, len(x) + var h, i uint + var j = uint(len(x)) +LOOP: + if i < j { + h = i + (j-i)/2 + if x[h].rtid < rtid { + i = h + 1 + } else { + j = h + } + goto LOOP + } + if i < uint(len(x)) && x[i].rtid == rtid { + return int(i) + } + return -1 +} + +type fastpathAslice []fastpathE + +func (x fastpathAslice) Len() int { return len(x) } +func (x fastpathAslice) Less(i, j int) bool { return x[uint(i)].rtid < x[uint(j)].rtid } +func (x fastpathAslice) Swap(i, j int) { x[uint(i)], x[uint(j)] = x[uint(j)], x[uint(i)] } + +var fastpathAV fastpathA + +// due to possible initialization loop error, make fastpath in an init() +func init() { + var i uint = 0 + fn := func(v interface{}, + fe func(*Encoder, *codecFnInfo, reflect.Value), + fd func(*Decoder, *codecFnInfo, reflect.Value)) { + xrt := reflect.TypeOf(v) + xptr := rt2id(xrt) + fastpathAV[i] = fastpathE{xptr, xrt, fe, fd} + i++ + } + {{/* do not register []uint8 in fast-path */}} + {{range .Values}}{{if not .Primitive}}{{if not .MapKey }}{{if ne .Elem "uint8"}} + fn([]{{ .Elem }}(nil), (*Encoder).{{ .MethodNamePfx "fastpathEnc" false }}R, (*Decoder).{{ .MethodNamePfx "fastpathDec" false }}R){{end}}{{end}}{{end}}{{end}} + + {{range .Values}}{{if not .Primitive}}{{if .MapKey }} + fn(map[{{ .MapKey }}]{{ .Elem }}(nil), (*Encoder).{{ .MethodNamePfx "fastpathEnc" false }}R, (*Decoder).{{ .MethodNamePfx "fastpathDec" false }}R){{end}}{{end}}{{end}} + + sort.Sort(fastpathAslice(fastpathAV[:])) +} + +// -- encode + +// -- -- fast path type switch +func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { + switch v := iv.(type) { + +{{range .Values}}{{if not .Primitive}}{{if not .MapKey }}{{if ne .Elem "uint8"}} + case []{{ .Elem }}: + fastpathTV.{{ .MethodNamePfx "Enc" false }}V(v, e) + case *[]{{ .Elem }}: + fastpathTV.{{ .MethodNamePfx "Enc" false }}V(*v, e){{/* +*/}}{{end}}{{end}}{{end}}{{end}} + +{{range .Values}}{{if not .Primitive}}{{if .MapKey }} + case map[{{ .MapKey }}]{{ .Elem }}: + fastpathTV.{{ .MethodNamePfx "Enc" false }}V(v, e) + case *map[{{ .MapKey }}]{{ .Elem }}: + fastpathTV.{{ .MethodNamePfx "Enc" false }}V(*v, e){{/* +*/}}{{end}}{{end}}{{end}} + + default: + _ = v // workaround https://github.com/golang/go/issues/12927 seen in go1.4 + return false + } + return true +} + +{{/* +**** removing this block, as they are never called directly **** + + + +**** removing this block, as they are never called directly **** + + + +func fastpathEncodeTypeSwitchSlice(iv interface{}, e *Encoder) bool { + switch v := iv.(type) { +{{range .Values}}{{if not .Primitive}}{{if not .MapKey }} + case []{{ .Elem }}: + fastpathTV.{{ .MethodNamePfx "Enc" false }}V(v, e) + case *[]{{ .Elem }}: + fastpathTV.{{ .MethodNamePfx "Enc" false }}V(*v, e) +{{end}}{{end}}{{end}} + default: + _ = v // workaround https://github.com/golang/go/issues/12927 seen in go1.4 + return false + } + return true +} + +func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { + switch v := iv.(type) { +{{range .Values}}{{if not .Primitive}}{{if .MapKey }} + case map[{{ .MapKey }}]{{ .Elem }}: + fastpathTV.{{ .MethodNamePfx "Enc" false }}V(v, e) + case *map[{{ .MapKey }}]{{ .Elem }}: + fastpathTV.{{ .MethodNamePfx "Enc" false }}V(*v, e) +{{end}}{{end}}{{end}} + default: + _ = v // workaround https://github.com/golang/go/issues/12927 seen in go1.4 + return false + } + return true +} + + + +**** removing this block, as they are never called directly **** + + + +**** removing this block, as they are never called directly **** +*/}} + +// -- -- fast path functions +{{range .Values}}{{if not .Primitive}}{{if not .MapKey }} +func (e *Encoder) {{ .MethodNamePfx "fastpathEnc" false }}R(f *codecFnInfo, rv reflect.Value) { + if f.ti.mbs { + fastpathTV.{{ .MethodNamePfx "EncAsMap" false }}V(rv2i(rv).([]{{ .Elem }}), e) + } else { + fastpathTV.{{ .MethodNamePfx "Enc" false }}V(rv2i(rv).([]{{ .Elem }}), e) + } +} +func (_ fastpathT) {{ .MethodNamePfx "Enc" false }}V(v []{{ .Elem }}, e *Encoder) { + if v == nil { e.e.EncodeNil(); return } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteArrayStart(len(v)) + for _, v2 := range v { + if esep { ee.WriteArrayElem() } + {{ encmd .Elem "v2"}} + } + ee.WriteArrayEnd() +} +func (_ fastpathT) {{ .MethodNamePfx "EncAsMap" false }}V(v []{{ .Elem }}, e *Encoder) { + ee, esep := e.e, e.hh.hasElemSeparators() + if len(v)%2 == 1 { + e.errorf(fastpathMapBySliceErrMsg, len(v)) + return + } + ee.WriteMapStart(len(v) / 2) + for j, v2 := range v { + if esep { + if j%2 == 0 { + ee.WriteMapElemKey() + } else { + ee.WriteMapElemValue() + } + } + {{ encmd .Elem "v2"}} + } + ee.WriteMapEnd() +} +{{end}}{{end}}{{end}} + +{{range .Values}}{{if not .Primitive}}{{if .MapKey }} +func (e *Encoder) {{ .MethodNamePfx "fastpathEnc" false }}R(f *codecFnInfo, rv reflect.Value) { + fastpathTV.{{ .MethodNamePfx "Enc" false }}V(rv2i(rv).(map[{{ .MapKey }}]{{ .Elem }}), e) +} +func (_ fastpathT) {{ .MethodNamePfx "Enc" false }}V(v map[{{ .MapKey }}]{{ .Elem }}, e *Encoder) { + if v == nil { e.e.EncodeNil(); return } + ee, esep := e.e, e.hh.hasElemSeparators() + ee.WriteMapStart(len(v)) + 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 uint + var vp *bytesI {{/* put loop variables outside. seems currently needed for better perf */}} + for k2 := range v { + l = uint(len(mksv)) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + if esep { ee.WriteMapElemKey() } + e.asis(v2[j].v) + if esep { ee.WriteMapElemValue() } + e.encode(v[v2[j].i]) + } {{else}}{{ $x := sorttype .MapKey true}}v2 := make([]{{ $x }}, len(v)) + var i uint + for k := range v { + v2[i] = {{ $x }}(k) + i++ + } + sort.Sort({{ sorttype .MapKey false}}(v2)) + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() } + {{if eq .MapKey "string"}} if e.h.StringToRaw {ee.EncodeStringBytesRaw(bytesView(k2))} else {ee.EncodeStringEnc(cUTF8, k2)} {{else}}{{ $y := printf "%s(k2)" .MapKey }}{{ encmd .MapKey $y }}{{end}} + if esep { ee.WriteMapElemValue() } + {{ $y := printf "v[%s(k2)]" .MapKey }}{{ encmd .Elem $y }} + } {{end}} + } else { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() } + {{if eq .MapKey "string"}} if e.h.StringToRaw {ee.EncodeStringBytesRaw(bytesView(k2))} else {ee.EncodeStringEnc(cUTF8, k2)} {{else}}{{ encmd .MapKey "k2"}}{{end}} + if esep { ee.WriteMapElemValue() } + {{ encmd .Elem "v2"}} + } + } + ee.WriteMapEnd() +} +{{end}}{{end}}{{end}} + +// -- decode + +// -- -- fast path type switch +func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { + var changed bool + switch v := iv.(type) { +{{range .Values}}{{if not .Primitive}}{{if not .MapKey }}{{if ne .Elem "uint8"}} + case []{{ .Elem }}: + var v2 []{{ .Elem }} + v2, changed = fastpathTV.{{ .MethodNamePfx "Dec" false }}V(v, false, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + case *[]{{ .Elem }}: + var v2 []{{ .Elem }} + v2, changed = fastpathTV.{{ .MethodNamePfx "Dec" false }}V(*v, true, d) + if changed { + *v = v2 + }{{/* +*/}}{{end}}{{end}}{{end}}{{end}} +{{range .Values}}{{if not .Primitive}}{{if .MapKey }}{{/* +// maps only change if nil, and in that case, there's no point copying +*/}} + case map[{{ .MapKey }}]{{ .Elem }}: + fastpathTV.{{ .MethodNamePfx "Dec" false }}V(v, false, d) + case *map[{{ .MapKey }}]{{ .Elem }}: + var v2 map[{{ .MapKey }}]{{ .Elem }} + v2, changed = fastpathTV.{{ .MethodNamePfx "Dec" false }}V(*v, true, d) + if changed { + *v = v2 + }{{/* +*/}}{{end}}{{end}}{{end}} + default: + _ = v // workaround https://github.com/golang/go/issues/12927 seen in go1.4 + return false + } + return true +} + +func fastpathDecodeSetZeroTypeSwitch(iv interface{}) bool { + switch v := iv.(type) { +{{range .Values}}{{if not .Primitive}}{{if not .MapKey }} + case *[]{{ .Elem }}: + *v = nil {{/* +*/}}{{end}}{{end}}{{end}} +{{range .Values}}{{if not .Primitive}}{{if .MapKey }} + case *map[{{ .MapKey }}]{{ .Elem }}: + *v = nil {{/* +*/}}{{end}}{{end}}{{end}} + default: + _ = v // workaround https://github.com/golang/go/issues/12927 seen in go1.4 + return false + } + return true +} + +// -- -- fast path functions +{{range .Values}}{{if not .Primitive}}{{if not .MapKey }} +{{/* +Slices can change if they +- did not come from an array +- are addressable (from a ptr) +- are settable (e.g. contained in an interface{}) +*/}} +func (d *Decoder) {{ .MethodNamePfx "fastpathDec" false }}R(f *codecFnInfo, rv reflect.Value) { + if array := f.seq == seqTypeArray; !array && rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*[]{{ .Elem }}) + v, changed := fastpathTV.{{ .MethodNamePfx "Dec" false }}V(*vp, !array, d) + if changed { *vp = v } + } else { + v := rv2i(rv).([]{{ .Elem }}) + v2, changed := fastpathTV.{{ .MethodNamePfx "Dec" false }}V(v, !array, d) + if changed && len(v) > 0 && len(v2) > 0 && !(len(v2) == len(v) && &v2[0] == &v[0]) { + copy(v, v2) + } + } +} +func (f fastpathT) {{ .MethodNamePfx "Dec" false }}X(vp *[]{{ .Elem }}, d *Decoder) { + v, changed := f.{{ .MethodNamePfx "Dec" false }}V(*vp, true, d) + if changed { *vp = v } +} +func (_ fastpathT) {{ .MethodNamePfx "Dec" false }}V(v []{{ .Elem }}, canChange bool, d *Decoder) (_ []{{ .Elem }}, changed bool) { + dd := d.d{{/* + // if dd.isContainerType(valueTypeNil) { dd.TryDecodeAsNil() + */}} + slh, containerLenS := d.decSliceHelperStart() + if containerLenS == 0 { + if canChange { + if v == nil { v = []{{ .Elem }}{} } else if len(v) != 0 { v = v[:0] } + changed = true + } + slh.End() + return v, changed + } + d.depthIncr() + hasLen := containerLenS > 0 + var xlen int + if hasLen && canChange { + if containerLenS > cap(v) { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, {{ .Size }}) + if xlen <= cap(v) { + v = v[:uint(xlen)] + } else { + v = make([]{{ .Elem }}, uint(xlen)) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + var j int + for j = 0; (hasLen && j < containerLenS) || !(hasLen || dd.CheckBreak()); j++ { + if j == 0 && len(v) == 0 && canChange { + if hasLen { + xlen = decInferLen(containerLenS, d.h.MaxInitLen, {{ .Size }}) + } else { + xlen = 8 + } + v = make([]{{ .Elem }}, uint(xlen)) + changed = true + } + // if indefinite, etc, then expand the slice if necessary + var decodeIntoBlank bool + if j >= len(v) { + if canChange { + v = append(v, {{ zerocmd .Elem }}) + changed = true + } else { + d.arrayCannotExpand(len(v), j+1) + decodeIntoBlank = true + } + } + slh.ElemContainerState(j) + if decodeIntoBlank { + d.swallow() + } else if dd.TryDecodeAsNil() { + v[uint(j)] = {{ zerocmd .Elem }} + } else { + {{ if eq .Elem "interface{}" }}d.decode(&v[uint(j)]){{ else }}v[uint(j)] = {{ decmd .Elem }}{{ end }} + } + } + if canChange { + if j < len(v) { + v = v[:uint(j)] + changed = true + } else if j == 0 && v == nil { + v = make([]{{ .Elem }}, 0) + changed = true + } + } + slh.End() + d.depthDecr() + return v, changed +} +{{end}}{{end}}{{end}} + +{{range .Values}}{{if not .Primitive}}{{if .MapKey }} +{{/* +Maps can change if they are +- addressable (from a ptr) +- settable (e.g. contained in an interface{}) +*/}} +func (d *Decoder) {{ .MethodNamePfx "fastpathDec" false }}R(f *codecFnInfo, rv reflect.Value) { + if rv.Kind() == reflect.Ptr { + vp := rv2i(rv).(*map[{{ .MapKey }}]{{ .Elem }}) + v, changed := fastpathTV.{{ .MethodNamePfx "Dec" false }}V(*vp, true, d); + if changed { *vp = v } + } else { + fastpathTV.{{ .MethodNamePfx "Dec" false }}V(rv2i(rv).(map[{{ .MapKey }}]{{ .Elem }}), false, d) + } +} +func (f fastpathT) {{ .MethodNamePfx "Dec" false }}X(vp *map[{{ .MapKey }}]{{ .Elem }}, d *Decoder) { + v, changed := f.{{ .MethodNamePfx "Dec" false }}V(*vp, true, d) + if changed { *vp = v } +} +func (_ fastpathT) {{ .MethodNamePfx "Dec" false }}V(v map[{{ .MapKey }}]{{ .Elem }}, canChange bool, + d *Decoder) (_ map[{{ .MapKey }}]{{ .Elem }}, changed bool) { + dd, esep := d.d, d.hh.hasElemSeparators(){{/* + // if dd.isContainerType(valueTypeNil) {dd.TryDecodeAsNil() + */}} + containerLen := dd.ReadMapStart() + if canChange && v == nil { + xlen := decInferLen(containerLen, d.h.MaxInitLen, {{ .Size }}) + v = make(map[{{ .MapKey }}]{{ .Elem }}, xlen) + changed = true + } + if containerLen == 0 { + dd.ReadMapEnd() + return v, changed + } + d.depthIncr() + {{ if eq .Elem "interface{}" }}mapGet := v != nil && !d.h.MapValueReset && !d.h.InterfaceReset + {{end}}var mk {{ .MapKey }} + var mv {{ .Elem }} + hasLen := containerLen > 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if esep { dd.ReadMapElemKey() } + {{ if eq .MapKey "interface{}" }}mk = nil + d.decode(&mk) + if bv, bok := mk.([]byte); bok { + mk = d.string(bv) {{/* // maps cannot have []byte as key. switch to string. */}} + }{{ else }}mk = {{ decmd .MapKey }}{{ end }} + if esep { dd.ReadMapElemValue() } + if dd.TryDecodeAsNil() { + if v == nil {} else if d.h.DeleteOnNilMapValue { delete(v, mk) } else { v[mk] = {{ zerocmd .Elem }} } + continue + } + {{ 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 } + } + dd.ReadMapEnd() + d.depthDecr() + return v, changed +} +{{end}}{{end}}{{end}} diff --git a/vendor/github.com/ugorji/go/codec/fast-path.not.go b/vendor/github.com/ugorji/go/codec/fast-path.not.go new file mode 100644 index 000000000..cf97db0f2 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/fast-path.not.go @@ -0,0 +1,47 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +// +build notfastpath + +package codec + +import "reflect" + +const fastpathEnabled = false + +// The generated fast-path code is very large, and adds a few seconds to the build time. +// This causes test execution, execution of small tools which use codec, etc +// to take a long time. +// +// To mitigate, we now support the notfastpath tag. +// This tag disables fastpath during build, allowing for faster build, test execution, +// short-program runs, etc. + +func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { return false } +func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool { return false } +func fastpathEncodeTypeSwitchSlice(iv interface{}, e *Encoder) bool { return false } +func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { return false } +func fastpathDecodeSetZeroTypeSwitch(iv interface{}) bool { return false } + +type fastpathT struct{} +type fastpathE struct { + rtid uintptr + rt reflect.Type + encfn func(*Encoder, *codecFnInfo, reflect.Value) + decfn func(*Decoder, *codecFnInfo, reflect.Value) +} +type fastpathA [0]fastpathE + +func (x fastpathA) index(rtid uintptr) int { return -1 } + +func (_ fastpathT) DecSliceUint8V(v []uint8, canChange bool, d *Decoder) (_ []uint8, changed bool) { + fn := d.h.fn(uint8SliceTyp, true, true) + d.kSlice(&fn.i, reflect.ValueOf(&v).Elem()) + return v, true +} + +var fastpathAV fastpathA +var fastpathTV fastpathT + +// ---- +type TestMammoth2Wrapper struct{} // to allow testMammoth work in notfastpath mode diff --git a/vendor/github.com/ugorji/go/codec/gen-dec-array.go.tmpl b/vendor/github.com/ugorji/go/codec/gen-dec-array.go.tmpl new file mode 100644 index 000000000..790e914e1 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/gen-dec-array.go.tmpl @@ -0,0 +1,78 @@ +{{var "v"}} := {{if not isArray}}*{{end}}{{ .Varname }} +{{var "h"}}, {{var "l"}} := z.DecSliceHelperStart() {{/* // helper, containerLenS */}}{{if not isArray}} +var {{var "c"}} bool {{/* // changed */}} +_ = {{var "c"}}{{end}} +if {{var "l"}} == 0 { + {{if isSlice }}if {{var "v"}} == nil { + {{var "v"}} = []{{ .Typ }}{} + {{var "c"}} = true + } else if len({{var "v"}}) != 0 { + {{var "v"}} = {{var "v"}}[:0] + {{var "c"}} = true + } {{else if isChan }}if {{var "v"}} == nil { + {{var "v"}} = make({{ .CTyp }}, 0) + {{var "c"}} = true + } {{end}} +} else { + {{var "hl"}} := {{var "l"}} > 0 + var {{var "rl"}} int + _ = {{var "rl"}} + {{if isSlice }} if {{var "hl"}} { + if {{var "l"}} > cap({{var "v"}}) { + {{var "rl"}} = z.DecInferLen({{var "l"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }}) + if {{var "rl"}} <= cap({{var "v"}}) { + {{var "v"}} = {{var "v"}}[:{{var "rl"}}] + } else { + {{var "v"}} = make([]{{ .Typ }}, {{var "rl"}}) + } + {{var "c"}} = true + } else if {{var "l"}} != len({{var "v"}}) { + {{var "v"}} = {{var "v"}}[:{{var "l"}}] + {{var "c"}} = true + } + } {{end}} + var {{var "j"}} int + // var {{var "dn"}} bool + for {{var "j"}} = 0; ({{var "hl"}} && {{var "j"}} < {{var "l"}}) || !({{var "hl"}} || r.CheckBreak()); {{var "j"}}++ { // bounds-check-elimination + {{if not isArray}} if {{var "j"}} == 0 && {{var "v"}} == nil { + if {{var "hl"}} { + {{var "rl"}} = z.DecInferLen({{var "l"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }}) + } else { + {{var "rl"}} = {{if isSlice}}8{{else if isChan}}64{{end}} + } + {{var "v"}} = make({{if isSlice}}[]{{ .Typ }}{{else if isChan}}{{.CTyp}}{{end}}, {{var "rl"}}) + {{var "c"}} = true + }{{end}} + {{var "h"}}.ElemContainerState({{var "j"}}) + {{/* {{var "dn"}} = r.TryDecodeAsNil() */}}{{/* commented out, as decLineVar handles this already each time */}} + {{if isChan}}{{ $x := printf "%[1]vvcx%[2]v" .TempVar .Rand }}var {{$x}} {{ .Typ }} + {{ decLineVar $x }} + {{var "v"}} <- {{ $x }} + // println(">>>> sending ", {{ $x }}, " into ", {{var "v"}}) // TODO: remove this + {{else}}{{/* // if indefinite, etc, then expand the slice if necessary */}} + var {{var "db"}} bool + if {{var "j"}} >= len({{var "v"}}) { + {{if isSlice }} {{var "v"}} = append({{var "v"}}, {{ zero }}) + {{var "c"}} = true + {{else}} z.DecArrayCannotExpand(len(v), {{var "j"}}+1); {{var "db"}} = true + {{end}} + } + if {{var "db"}} { + z.DecSwallow() + } else { + {{ $x := printf "%[1]vv%[2]v[%[1]vj%[2]v]" .TempVar .Rand }}{{ decLineVar $x }} + } + {{end}} + } + {{if isSlice}} if {{var "j"}} < len({{var "v"}}) { + {{var "v"}} = {{var "v"}}[:{{var "j"}}] + {{var "c"}} = true + } else if {{var "j"}} == 0 && {{var "v"}} == nil { + {{var "v"}} = make([]{{ .Typ }}, 0) + {{var "c"}} = true + } {{end}} +} +{{var "h"}}.End() +{{if not isArray }}if {{var "c"}} { + *{{ .Varname }} = {{var "v"}} +}{{end}} diff --git a/vendor/github.com/ugorji/go/codec/gen-dec-map.go.tmpl b/vendor/github.com/ugorji/go/codec/gen-dec-map.go.tmpl new file mode 100644 index 000000000..8323b5494 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/gen-dec-map.go.tmpl @@ -0,0 +1,42 @@ +{{var "v"}} := *{{ .Varname }} +{{var "l"}} := r.ReadMapStart() +{{var "bh"}} := z.DecBasicHandle() +if {{var "v"}} == nil { + {{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"}}, {{var "mdn"}} {{if decElemKindPtr}}, {{var "ms"}}, {{var "mok"}}{{end}} 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 { +{{var "hl"}} := {{var "l"}} > 0 + for {{var "j"}} := 0; ({{var "hl"}} && {{var "j"}} < {{var "l"}}) || !({{var "hl"}} || r.CheckBreak()); {{var "j"}}++ { + r.ReadMapElemKey() {{/* z.DecSendContainerState(codecSelfer_containerMapKey{{ .Sfx }}) */}} + {{ $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"}} { + {{var "mk"}} = string({{var "bv"}}) + }{{ end }}{{if decElemKindPtr}} + {{var "ms"}} = true{{end}} + if {{var "mg"}} { + {{if decElemKindPtr}}{{var "mv"}}, {{var "mok"}} = {{var "v"}}[{{var "mk"}}] + if {{var "mok"}} { + {{var "ms"}} = false + } {{else}}{{var "mv"}} = {{var "v"}}[{{var "mk"}}] {{end}} + } {{if not decElemKindImmutable}}else { {{var "mv"}} = {{decElemZero}} }{{end}} + r.ReadMapElemValue() {{/* z.DecSendContainerState(codecSelfer_containerMapValue{{ .Sfx }}) */}} + {{var "mdn"}} = false + {{ $x := printf "%vmv%v" .TempVar .Rand }}{{ $y := printf "%vmdn%v" .TempVar .Rand }}{{ decLineVar $x $y }} + if {{var "mdn"}} { + if {{ var "bh" }}.DeleteOnNilMapValue { delete({{var "v"}}, {{var "mk"}}) } else { {{var "v"}}[{{var "mk"}}] = {{decElemZero}} } + } else if {{if decElemKindPtr}} {{var "ms"}} && {{end}} {{var "v"}} != nil { + {{var "v"}}[{{var "mk"}}] = {{var "mv"}} + } +} +} // else len==0: TODO: Should we clear map entries? +r.ReadMapEnd() {{/* z.DecSendContainerState(codecSelfer_containerMapEnd{{ .Sfx }}) */}} diff --git a/vendor/github.com/ugorji/go/codec/gen-enc-chan.go.tmpl b/vendor/github.com/ugorji/go/codec/gen-enc-chan.go.tmpl new file mode 100644 index 000000000..4249588a3 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/gen-enc-chan.go.tmpl @@ -0,0 +1,27 @@ +{{.Label}}: +switch timeout{{.Sfx}} := z.EncBasicHandle().ChanRecvTimeout; { +case timeout{{.Sfx}} == 0: // only consume available + for { + select { + case b{{.Sfx}} := <-{{.Chan}}: + {{ .Slice }} = append({{.Slice}}, b{{.Sfx}}) + default: + break {{.Label}} + } + } +case timeout{{.Sfx}} > 0: // consume until timeout + tt{{.Sfx}} := time.NewTimer(timeout{{.Sfx}}) + for { + select { + case b{{.Sfx}} := <-{{.Chan}}: + {{.Slice}} = append({{.Slice}}, b{{.Sfx}}) + case <-tt{{.Sfx}}.C: + // close(tt.C) + break {{.Label}} + } + } +default: // consume until close + for b{{.Sfx}} := range {{.Chan}} { + {{.Slice}} = append({{.Slice}}, b{{.Sfx}}) + } +} diff --git a/vendor/github.com/ugorji/go/codec/gen-helper.generated.go b/vendor/github.com/ugorji/go/codec/gen-helper.generated.go new file mode 100644 index 000000000..2a7d1aab7 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/gen-helper.generated.go @@ -0,0 +1,343 @@ +// comment this out // + build ignore + +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +// Code generated from gen-helper.go.tmpl - DO NOT EDIT. + +package codec + +import ( + "encoding" + "reflect" +) + +// GenVersion is the current version of codecgen. +const GenVersion = 10 + +// This file is used to generate helper code for codecgen. +// The values here i.e. genHelper(En|De)coder are not to be used directly by +// library users. They WILL change continuously and without notice. +// +// To help enforce this, we create an unexported type with exported members. +// The only way to get the type is via the one exported type that we control (somewhat). +// +// When static codecs are created for types, they will use this value +// to perform encoding or decoding of primitives or known slice or map types. + +// GenHelperEncoder is exported so that it can be used externally by codecgen. +// +// Library users: DO NOT USE IT DIRECTLY. IT WILL CHANGE CONTINOUSLY WITHOUT NOTICE. +func GenHelperEncoder(e *Encoder) (ge genHelperEncoder, ee genHelperEncDriver) { + ge = genHelperEncoder{e: e} + ee = genHelperEncDriver{encDriver: e.e} + return +} + +// GenHelperDecoder is exported so that it can be used externally by codecgen. +// +// Library users: DO NOT USE IT DIRECTLY. IT WILL CHANGE CONTINOUSLY WITHOUT NOTICE. +func GenHelperDecoder(d *Decoder) (gd genHelperDecoder, dd genHelperDecDriver) { + gd = genHelperDecoder{d: d} + dd = genHelperDecDriver{decDriver: d.d} + return +} + +type genHelperEncDriver struct { + encDriver +} + +func (x genHelperEncDriver) EncodeBuiltin(rt uintptr, v interface{}) {} +func (x genHelperEncDriver) EncStructFieldKey(keyType valueType, s string) { + encStructFieldKey(s, x.encDriver, nil, keyType, false, false) +} +func (x genHelperEncDriver) EncodeSymbol(s string) { + x.encDriver.EncodeStringEnc(cUTF8, s) +} + +type genHelperDecDriver struct { + decDriver + C checkOverflow +} + +func (x genHelperDecDriver) DecodeBuiltin(rt uintptr, v interface{}) {} +func (x genHelperDecDriver) DecStructFieldKey(keyType valueType, buf *[decScratchByteArrayLen]byte) []byte { + return decStructFieldKey(x.decDriver, keyType, buf) +} +func (x genHelperDecDriver) DecodeInt(bitsize uint8) (i int64) { + return x.C.IntV(x.decDriver.DecodeInt64(), bitsize) +} +func (x genHelperDecDriver) DecodeUint(bitsize uint8) (ui uint64) { + return x.C.UintV(x.decDriver.DecodeUint64(), bitsize) +} +func (x genHelperDecDriver) DecodeFloat(chkOverflow32 bool) (f float64) { + f = x.DecodeFloat64() + if chkOverflow32 && chkOvf.Float32(f) { + panicv.errorf("float32 overflow: %v", f) + } + return +} +func (x genHelperDecDriver) DecodeFloat32As64() (f float64) { + f = x.DecodeFloat64() + if chkOvf.Float32(f) { + panicv.errorf("float32 overflow: %v", f) + } + return +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +type genHelperEncoder struct { + M must + e *Encoder + F fastpathT +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +type genHelperDecoder struct { + C checkOverflow + d *Decoder + F fastpathT +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) EncBasicHandle() *BasicHandle { + return f.e.h +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) EncBinary() bool { + return f.e.be // f.e.hh.isBinaryEncoding() +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) IsJSONHandle() bool { + return f.e.js +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) EncFallback(iv interface{}) { + // println(">>>>>>>>> EncFallback") + // f.e.encodeI(iv, false, false) + f.e.encodeValue(reflect.ValueOf(iv), nil, false) +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) EncTextMarshal(iv encoding.TextMarshaler) { + bs, fnerr := iv.MarshalText() + f.e.marshalUtf8(bs, fnerr) +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) EncJSONMarshal(iv jsonMarshaler) { + bs, fnerr := iv.MarshalJSON() + f.e.marshalAsis(bs, fnerr) +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) EncBinaryMarshal(iv encoding.BinaryMarshaler) { + bs, fnerr := iv.MarshalBinary() + f.e.marshalRaw(bs, fnerr) +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) EncRaw(iv Raw) { f.e.rawBytes(iv) } + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +// +// Deprecated: builtin no longer supported - so we make this method a no-op, +// but leave in-place so that old generated files continue to work without regeneration. +func (f genHelperEncoder) TimeRtidIfBinc() (v uintptr) { return } + +// func (f genHelperEncoder) TimeRtidIfBinc() uintptr { +// if _, ok := f.e.hh.(*BincHandle); ok { +// return timeTypId +// } +// } + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) I2Rtid(v interface{}) uintptr { + return i2rtid(v) +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) Extension(rtid uintptr) (xfn *extTypeTagFn) { + return f.e.h.getExt(rtid) +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) EncExtension(v interface{}, xfFn *extTypeTagFn) { + f.e.e.EncodeExt(v, xfFn.tag, xfFn.ext, f.e) +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) WriteStr(s string) { + f.e.w.writestr(s) +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) BytesView(v string) []byte { return bytesView(v) } + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +// +// Deprecated: No longer used, +// but leave in-place so that old generated files continue to work without regeneration. +func (f genHelperEncoder) HasExtensions() bool { + return len(f.e.h.extHandle) != 0 +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +// +// Deprecated: No longer used, +// but leave in-place so that old generated files continue to work without regeneration. +func (f genHelperEncoder) EncExt(v interface{}) (r bool) { + if xfFn := f.e.h.getExt(i2rtid(v)); xfFn != nil { + f.e.e.EncodeExt(v, xfFn.tag, xfFn.ext, f.e) + return true + } + return false +} + +// ---------------- DECODER FOLLOWS ----------------- + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecBasicHandle() *BasicHandle { + return f.d.h +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecBinary() bool { + return f.d.be // f.d.hh.isBinaryEncoding() +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecSwallow() { f.d.swallow() } + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecScratchBuffer() []byte { + return f.d.b[:] +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecScratchArrayBuffer() *[decScratchByteArrayLen]byte { + return &f.d.b +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecFallback(iv interface{}, chkPtr bool) { + // println(">>>>>>>>> DecFallback") + rv := reflect.ValueOf(iv) + if chkPtr { + rv = f.d.ensureDecodeable(rv) + } + f.d.decodeValue(rv, nil, false) + // f.d.decodeValueFallback(rv) +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecSliceHelperStart() (decSliceHelper, int) { + return f.d.decSliceHelperStart() +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecStructFieldNotFound(index int, name string) { + f.d.structFieldNotFound(index, name) +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecArrayCannotExpand(sliceLen, streamLen int) { + f.d.arrayCannotExpand(sliceLen, streamLen) +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecTextUnmarshal(tm encoding.TextUnmarshaler) { + fnerr := tm.UnmarshalText(f.d.d.DecodeStringAsBytes()) + if fnerr != nil { + panic(fnerr) + } +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecJSONUnmarshal(tm jsonUnmarshaler) { + // bs := f.dd.DecodeStringAsBytes() + // grab the bytes to be read, as UnmarshalJSON needs the full JSON so as to unmarshal it itself. + fnerr := tm.UnmarshalJSON(f.d.nextValueBytes()) + if fnerr != nil { + panic(fnerr) + } +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecBinaryUnmarshal(bm encoding.BinaryUnmarshaler) { + fnerr := bm.UnmarshalBinary(f.d.d.DecodeBytes(nil, true)) + if fnerr != nil { + panic(fnerr) + } +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecRaw() []byte { return f.d.rawBytes() } + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +// +// Deprecated: builtin no longer supported - so we make this method a no-op, +// but leave in-place so that old generated files continue to work without regeneration. +func (f genHelperDecoder) TimeRtidIfBinc() (v uintptr) { return } + +// func (f genHelperDecoder) TimeRtidIfBinc() uintptr { +// // Note: builtin is no longer supported - so make this a no-op +// if _, ok := f.d.hh.(*BincHandle); ok { +// return timeTypId +// } +// return 0 +// } + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) IsJSONHandle() bool { + return f.d.js +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) I2Rtid(v interface{}) uintptr { + return i2rtid(v) +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) Extension(rtid uintptr) (xfn *extTypeTagFn) { + return f.d.h.getExt(rtid) +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecExtension(v interface{}, xfFn *extTypeTagFn) { + f.d.d.DecodeExt(v, xfFn.tag, xfFn.ext) +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +// +// Deprecated: No longer used, +// but leave in-place so that old generated files continue to work without regeneration. +func (f genHelperDecoder) HasExtensions() bool { + return len(f.d.h.extHandle) != 0 +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +// +// Deprecated: No longer used, +// but leave in-place so that old generated files continue to work without regeneration. +func (f genHelperDecoder) DecExt(v interface{}) (r bool) { + if xfFn := f.d.h.getExt(i2rtid(v)); xfFn != nil { + f.d.d.DecodeExt(v, xfFn.tag, xfFn.ext) + return true + } + return false +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecInferLen(clen, maxlen, unit int) (rvlen int) { + return decInferLen(clen, maxlen, unit) +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +// +// Deprecated: no longer used, +// but leave in-place so that old generated files continue to work without regeneration. +func (f genHelperDecoder) StringView(v []byte) string { return stringView(v) } diff --git a/vendor/github.com/ugorji/go/codec/gen-helper.go.tmpl b/vendor/github.com/ugorji/go/codec/gen-helper.go.tmpl new file mode 100644 index 000000000..f5d0634e6 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/gen-helper.go.tmpl @@ -0,0 +1,308 @@ +// comment this out // + build ignore + +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +// Code generated from gen-helper.go.tmpl - DO NOT EDIT. + +package codec + +import ( + "encoding" + "reflect" +) + +// GenVersion is the current version of codecgen. +const GenVersion = {{ .Version }} + +// This file is used to generate helper code for codecgen. +// The values here i.e. genHelper(En|De)coder are not to be used directly by +// library users. They WILL change continuously and without notice. +// +// To help enforce this, we create an unexported type with exported members. +// The only way to get the type is via the one exported type that we control (somewhat). +// +// When static codecs are created for types, they will use this value +// to perform encoding or decoding of primitives or known slice or map types. + +// GenHelperEncoder is exported so that it can be used externally by codecgen. +// +// Library users: DO NOT USE IT DIRECTLY. IT WILL CHANGE CONTINOUSLY WITHOUT NOTICE. +func GenHelperEncoder(e *Encoder) (ge genHelperEncoder, ee genHelperEncDriver) { + ge = genHelperEncoder{e: e} + ee = genHelperEncDriver{encDriver: e.e} + return +} + +// GenHelperDecoder is exported so that it can be used externally by codecgen. +// +// Library users: DO NOT USE IT DIRECTLY. IT WILL CHANGE CONTINOUSLY WITHOUT NOTICE. +func GenHelperDecoder(d *Decoder) (gd genHelperDecoder, dd genHelperDecDriver) { + gd = genHelperDecoder{d: d} + dd = genHelperDecDriver{decDriver: d.d} + return +} + +type genHelperEncDriver struct { + encDriver +} + +func (x genHelperEncDriver) EncodeBuiltin(rt uintptr, v interface{}) {} +func (x genHelperEncDriver) EncStructFieldKey(keyType valueType, s string) { + encStructFieldKey(s, x.encDriver, nil, keyType, false, false) +} +func (x genHelperEncDriver) EncodeSymbol(s string) { + x.encDriver.EncodeStringEnc(cUTF8, s) +} + +type genHelperDecDriver struct { + decDriver + C checkOverflow +} + +func (x genHelperDecDriver) DecodeBuiltin(rt uintptr, v interface{}) {} +func (x genHelperDecDriver) DecStructFieldKey(keyType valueType, buf *[decScratchByteArrayLen]byte) []byte { + return decStructFieldKey(x.decDriver, keyType, buf) +} +func (x genHelperDecDriver) DecodeInt(bitsize uint8) (i int64) { + return x.C.IntV(x.decDriver.DecodeInt64(), bitsize) +} +func (x genHelperDecDriver) DecodeUint(bitsize uint8) (ui uint64) { + return x.C.UintV(x.decDriver.DecodeUint64(), bitsize) +} +func (x genHelperDecDriver) DecodeFloat(chkOverflow32 bool) (f float64) { + f = x.DecodeFloat64() + if chkOverflow32 && chkOvf.Float32(f) { + panicv.errorf("float32 overflow: %v", f) + } + return +} +func (x genHelperDecDriver) DecodeFloat32As64() (f float64) { + f = x.DecodeFloat64() + if chkOvf.Float32(f) { + panicv.errorf("float32 overflow: %v", f) + } + return +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +type genHelperEncoder struct { + M must + e *Encoder + F fastpathT +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +type genHelperDecoder struct { + C checkOverflow + d *Decoder + F fastpathT +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) EncBasicHandle() *BasicHandle { + return f.e.h +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) EncBinary() bool { + return f.e.be // f.e.hh.isBinaryEncoding() +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) IsJSONHandle() bool { + return f.e.js +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) EncFallback(iv interface{}) { + // println(">>>>>>>>> EncFallback") + // f.e.encodeI(iv, false, false) + f.e.encodeValue(reflect.ValueOf(iv), nil, false) +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) EncTextMarshal(iv encoding.TextMarshaler) { + bs, fnerr := iv.MarshalText() + f.e.marshalUtf8(bs, fnerr) +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) EncJSONMarshal(iv jsonMarshaler) { + bs, fnerr := iv.MarshalJSON() + f.e.marshalAsis(bs, fnerr) +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) EncBinaryMarshal(iv encoding.BinaryMarshaler) { + bs, fnerr := iv.MarshalBinary() + f.e.marshalRaw(bs, fnerr) +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) EncRaw(iv Raw) { f.e.rawBytes(iv) } +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +// +// Deprecated: builtin no longer supported - so we make this method a no-op, +// but leave in-place so that old generated files continue to work without regeneration. +func (f genHelperEncoder) TimeRtidIfBinc() (v uintptr) { return } +// func (f genHelperEncoder) TimeRtidIfBinc() uintptr { +// if _, ok := f.e.hh.(*BincHandle); ok { +// return timeTypId +// } +// } + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) I2Rtid(v interface{}) uintptr { + return i2rtid(v) +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) Extension(rtid uintptr) (xfn *extTypeTagFn) { + return f.e.h.getExt(rtid) +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) EncExtension(v interface{}, xfFn *extTypeTagFn) { + f.e.e.EncodeExt(v, xfFn.tag, xfFn.ext, f.e) +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) WriteStr(s string) { + f.e.w.writestr(s) +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) BytesView(v string) []byte { return bytesView(v) } +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +// +// Deprecated: No longer used, +// but leave in-place so that old generated files continue to work without regeneration. +func (f genHelperEncoder) HasExtensions() bool { + return len(f.e.h.extHandle) != 0 +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +// +// Deprecated: No longer used, +// but leave in-place so that old generated files continue to work without regeneration. +func (f genHelperEncoder) EncExt(v interface{}) (r bool) { + if xfFn := f.e.h.getExt(i2rtid(v)); xfFn != nil { + f.e.e.EncodeExt(v, xfFn.tag, xfFn.ext, f.e) + return true + } + return false +} + +// ---------------- DECODER FOLLOWS ----------------- + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecBasicHandle() *BasicHandle { + return f.d.h +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecBinary() bool { + return f.d.be // f.d.hh.isBinaryEncoding() +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecSwallow() { f.d.swallow() } +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecScratchBuffer() []byte { + return f.d.b[:] +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecScratchArrayBuffer() *[decScratchByteArrayLen]byte { + return &f.d.b +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecFallback(iv interface{}, chkPtr bool) { + // println(">>>>>>>>> DecFallback") + rv := reflect.ValueOf(iv) + if chkPtr { + rv = f.d.ensureDecodeable(rv) + } + f.d.decodeValue(rv, nil, false) + // f.d.decodeValueFallback(rv) +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecSliceHelperStart() (decSliceHelper, int) { + return f.d.decSliceHelperStart() +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecStructFieldNotFound(index int, name string) { + f.d.structFieldNotFound(index, name) +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecArrayCannotExpand(sliceLen, streamLen int) { + f.d.arrayCannotExpand(sliceLen, streamLen) +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecTextUnmarshal(tm encoding.TextUnmarshaler) { + fnerr := tm.UnmarshalText(f.d.d.DecodeStringAsBytes()) + if fnerr != nil { + panic(fnerr) + } +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecJSONUnmarshal(tm jsonUnmarshaler) { + // bs := f.dd.DecodeStringAsBytes() + // grab the bytes to be read, as UnmarshalJSON needs the full JSON so as to unmarshal it itself. + fnerr := tm.UnmarshalJSON(f.d.nextValueBytes()) + if fnerr != nil { + panic(fnerr) + } +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecBinaryUnmarshal(bm encoding.BinaryUnmarshaler) { + fnerr := bm.UnmarshalBinary(f.d.d.DecodeBytes(nil, true)) + if fnerr != nil { + panic(fnerr) + } +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecRaw() []byte { return f.d.rawBytes() } +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +// +// Deprecated: builtin no longer supported - so we make this method a no-op, +// but leave in-place so that old generated files continue to work without regeneration. +func (f genHelperDecoder) TimeRtidIfBinc() (v uintptr) { return } +// func (f genHelperDecoder) TimeRtidIfBinc() uintptr { +// // Note: builtin is no longer supported - so make this a no-op +// if _, ok := f.d.hh.(*BincHandle); ok { +// return timeTypId +// } +// return 0 +// } + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) IsJSONHandle() bool { + return f.d.js +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) I2Rtid(v interface{}) uintptr { + return i2rtid(v) +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) Extension(rtid uintptr) (xfn *extTypeTagFn) { + return f.d.h.getExt(rtid) +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecExtension(v interface{}, xfFn *extTypeTagFn) { + f.d.d.DecodeExt(v, xfFn.tag, xfFn.ext) +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +// +// Deprecated: No longer used, +// but leave in-place so that old generated files continue to work without regeneration. +func (f genHelperDecoder) HasExtensions() bool { + return len(f.d.h.extHandle) != 0 +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +// +// Deprecated: No longer used, +// but leave in-place so that old generated files continue to work without regeneration. +func (f genHelperDecoder) DecExt(v interface{}) (r bool) { + if xfFn := f.d.h.getExt(i2rtid(v)); xfFn != nil { + f.d.d.DecodeExt(v, xfFn.tag, xfFn.ext) + return true + } + return false +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperDecoder) DecInferLen(clen, maxlen, unit int) (rvlen int) { + return decInferLen(clen, maxlen, unit) +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +// +// Deprecated: no longer used, +// but leave in-place so that old generated files continue to work without regeneration. +func (f genHelperDecoder) StringView(v []byte) string { return stringView(v) } + diff --git a/vendor/github.com/ugorji/go/codec/gen.generated.go b/vendor/github.com/ugorji/go/codec/gen.generated.go new file mode 100644 index 000000000..8b00090a8 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/gen.generated.go @@ -0,0 +1,164 @@ +// +build codecgen.exec + +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +package codec + +// DO NOT EDIT. THIS FILE IS AUTO-GENERATED FROM gen-dec-(map|array).go.tmpl + +const genDecMapTmpl = ` +{{var "v"}} := *{{ .Varname }} +{{var "l"}} := r.ReadMapStart() +{{var "bh"}} := z.DecBasicHandle() +if {{var "v"}} == nil { + {{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"}}, {{var "mdn"}} {{if decElemKindPtr}}, {{var "ms"}}, {{var "mok"}}{{end}} 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 { +{{var "hl"}} := {{var "l"}} > 0 + for {{var "j"}} := 0; ({{var "hl"}} && {{var "j"}} < {{var "l"}}) || !({{var "hl"}} || r.CheckBreak()); {{var "j"}}++ { + r.ReadMapElemKey() {{/* z.DecSendContainerState(codecSelfer_containerMapKey{{ .Sfx }}) */}} + {{ $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"}} { + {{var "mk"}} = string({{var "bv"}}) + }{{ end }}{{if decElemKindPtr}} + {{var "ms"}} = true{{end}} + if {{var "mg"}} { + {{if decElemKindPtr}}{{var "mv"}}, {{var "mok"}} = {{var "v"}}[{{var "mk"}}] + if {{var "mok"}} { + {{var "ms"}} = false + } {{else}}{{var "mv"}} = {{var "v"}}[{{var "mk"}}] {{end}} + } {{if not decElemKindImmutable}}else { {{var "mv"}} = {{decElemZero}} }{{end}} + r.ReadMapElemValue() {{/* z.DecSendContainerState(codecSelfer_containerMapValue{{ .Sfx }}) */}} + {{var "mdn"}} = false + {{ $x := printf "%vmv%v" .TempVar .Rand }}{{ $y := printf "%vmdn%v" .TempVar .Rand }}{{ decLineVar $x $y }} + if {{var "mdn"}} { + if {{ var "bh" }}.DeleteOnNilMapValue { delete({{var "v"}}, {{var "mk"}}) } else { {{var "v"}}[{{var "mk"}}] = {{decElemZero}} } + } else if {{if decElemKindPtr}} {{var "ms"}} && {{end}} {{var "v"}} != nil { + {{var "v"}}[{{var "mk"}}] = {{var "mv"}} + } +} +} // else len==0: TODO: Should we clear map entries? +r.ReadMapEnd() {{/* z.DecSendContainerState(codecSelfer_containerMapEnd{{ .Sfx }}) */}} +` + +const genDecListTmpl = ` +{{var "v"}} := {{if not isArray}}*{{end}}{{ .Varname }} +{{var "h"}}, {{var "l"}} := z.DecSliceHelperStart() {{/* // helper, containerLenS */}}{{if not isArray}} +var {{var "c"}} bool {{/* // changed */}} +_ = {{var "c"}}{{end}} +if {{var "l"}} == 0 { + {{if isSlice }}if {{var "v"}} == nil { + {{var "v"}} = []{{ .Typ }}{} + {{var "c"}} = true + } else if len({{var "v"}}) != 0 { + {{var "v"}} = {{var "v"}}[:0] + {{var "c"}} = true + } {{else if isChan }}if {{var "v"}} == nil { + {{var "v"}} = make({{ .CTyp }}, 0) + {{var "c"}} = true + } {{end}} +} else { + {{var "hl"}} := {{var "l"}} > 0 + var {{var "rl"}} int + _ = {{var "rl"}} + {{if isSlice }} if {{var "hl"}} { + if {{var "l"}} > cap({{var "v"}}) { + {{var "rl"}} = z.DecInferLen({{var "l"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }}) + if {{var "rl"}} <= cap({{var "v"}}) { + {{var "v"}} = {{var "v"}}[:{{var "rl"}}] + } else { + {{var "v"}} = make([]{{ .Typ }}, {{var "rl"}}) + } + {{var "c"}} = true + } else if {{var "l"}} != len({{var "v"}}) { + {{var "v"}} = {{var "v"}}[:{{var "l"}}] + {{var "c"}} = true + } + } {{end}} + var {{var "j"}} int + // var {{var "dn"}} bool + for {{var "j"}} = 0; ({{var "hl"}} && {{var "j"}} < {{var "l"}}) || !({{var "hl"}} || r.CheckBreak()); {{var "j"}}++ { // bounds-check-elimination + {{if not isArray}} if {{var "j"}} == 0 && {{var "v"}} == nil { + if {{var "hl"}} { + {{var "rl"}} = z.DecInferLen({{var "l"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }}) + } else { + {{var "rl"}} = {{if isSlice}}8{{else if isChan}}64{{end}} + } + {{var "v"}} = make({{if isSlice}}[]{{ .Typ }}{{else if isChan}}{{.CTyp}}{{end}}, {{var "rl"}}) + {{var "c"}} = true + }{{end}} + {{var "h"}}.ElemContainerState({{var "j"}}) + {{/* {{var "dn"}} = r.TryDecodeAsNil() */}}{{/* commented out, as decLineVar handles this already each time */}} + {{if isChan}}{{ $x := printf "%[1]vvcx%[2]v" .TempVar .Rand }}var {{$x}} {{ .Typ }} + {{ decLineVar $x }} + {{var "v"}} <- {{ $x }} + // println(">>>> sending ", {{ $x }}, " into ", {{var "v"}}) // TODO: remove this + {{else}}{{/* // if indefinite, etc, then expand the slice if necessary */}} + var {{var "db"}} bool + if {{var "j"}} >= len({{var "v"}}) { + {{if isSlice }} {{var "v"}} = append({{var "v"}}, {{ zero }}) + {{var "c"}} = true + {{else}} z.DecArrayCannotExpand(len(v), {{var "j"}}+1); {{var "db"}} = true + {{end}} + } + if {{var "db"}} { + z.DecSwallow() + } else { + {{ $x := printf "%[1]vv%[2]v[%[1]vj%[2]v]" .TempVar .Rand }}{{ decLineVar $x }} + } + {{end}} + } + {{if isSlice}} if {{var "j"}} < len({{var "v"}}) { + {{var "v"}} = {{var "v"}}[:{{var "j"}}] + {{var "c"}} = true + } else if {{var "j"}} == 0 && {{var "v"}} == nil { + {{var "v"}} = make([]{{ .Typ }}, 0) + {{var "c"}} = true + } {{end}} +} +{{var "h"}}.End() +{{if not isArray }}if {{var "c"}} { + *{{ .Varname }} = {{var "v"}} +}{{end}} +` + +const genEncChanTmpl = ` +{{.Label}}: +switch timeout{{.Sfx}} := z.EncBasicHandle().ChanRecvTimeout; { +case timeout{{.Sfx}} == 0: // only consume available + for { + select { + case b{{.Sfx}} := <-{{.Chan}}: + {{ .Slice }} = append({{.Slice}}, b{{.Sfx}}) + default: + break {{.Label}} + } + } +case timeout{{.Sfx}} > 0: // consume until timeout + tt{{.Sfx}} := time.NewTimer(timeout{{.Sfx}}) + for { + select { + case b{{.Sfx}} := <-{{.Chan}}: + {{.Slice}} = append({{.Slice}}, b{{.Sfx}}) + case <-tt{{.Sfx}}.C: + // close(tt.C) + break {{.Label}} + } + } +default: // consume until close + for b{{.Sfx}} := range {{.Chan}} { + {{.Slice}} = append({{.Slice}}, b{{.Sfx}}) + } +} +` diff --git a/vendor/github.com/ugorji/go/codec/gen.go b/vendor/github.com/ugorji/go/codec/gen.go new file mode 100644 index 000000000..74c4aa86a --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/gen.go @@ -0,0 +1,2149 @@ +// +build codecgen.exec + +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +package codec + +import ( + "bytes" + "encoding/base64" + "errors" + "fmt" + "go/format" + "io" + "io/ioutil" + "math/rand" + "reflect" + "regexp" + "sort" + "strconv" + "strings" + "sync" + "text/template" + "time" + "unicode" + "unicode/utf8" +) + +// --------------------------------------------------- +// codecgen supports the full cycle of reflection-based codec: +// - RawExt +// - Raw +// - Extensions +// - (Binary|Text|JSON)(Unm|M)arshal +// - generic by-kind +// +// This means that, for dynamic things, we MUST use reflection to at least get the reflect.Type. +// In those areas, we try to only do reflection or interface-conversion when NECESSARY: +// - Extensions, only if Extensions are configured. +// +// However, codecgen doesn't support the following: +// - Canonical option. (codecgen IGNORES it currently) +// This is just because it has not been implemented. +// - MissingFielder implementation. +// If a type implements MissingFielder, it is completely ignored by codecgen. +// +// During encode/decode, Selfer takes precedence. +// A type implementing Selfer will know how to encode/decode itself statically. +// +// The following field types are supported: +// array: [n]T +// slice: []T +// map: map[K]V +// primitive: [u]int[n], float(32|64), bool, string +// struct +// +// --------------------------------------------------- +// Note that a Selfer cannot call (e|d).(En|De)code on itself, +// as this will cause a circular reference, as (En|De)code will call Selfer methods. +// Any type that implements Selfer must implement completely and not fallback to (En|De)code. +// +// In addition, code in this file manages the generation of fast-path implementations of +// encode/decode of slices/maps of primitive keys/values. +// +// Users MUST re-generate their implementations whenever the code shape changes. +// The generated code will panic if it was generated with a version older than the supporting library. +// --------------------------------------------------- +// +// codec framework is very feature rich. +// When encoding or decoding into an interface, it depends on the runtime type of the interface. +// The type of the interface may be a named type, an extension, etc. +// Consequently, we fallback to runtime codec for encoding/decoding interfaces. +// In addition, we fallback for any value which cannot be guaranteed at runtime. +// This allows us support ANY value, including any named types, specifically those which +// do not implement our interfaces (e.g. Selfer). +// +// This explains some slowness compared to other code generation codecs (e.g. msgp). +// This reduction in speed is only seen when your refers to interfaces, +// e.g. type T struct { A interface{}; B []interface{}; C map[string]interface{} } +// +// codecgen will panic if the file was generated with an old version of the library in use. +// +// Note: +// It was a conscious decision to have gen.go always explicitly call EncodeNil or TryDecodeAsNil. +// This way, there isn't a function call overhead just to see that we should not enter a block of code. +// +// Note: +// codecgen-generated code depends on the variables defined by fast-path.generated.go. +// consequently, you cannot run with tags "codecgen notfastpath". + +// GenVersion is the current version of codecgen. +// +// NOTE: Increment this value each time codecgen changes fundamentally. +// Fundamental changes are: +// - helper methods change (signature change, new ones added, some removed, etc) +// - codecgen command line changes +// +// v1: Initial Version +// v2: +// v3: Changes for Kubernetes: +// changes in signature of some unpublished helper methods and codecgen cmdline arguments. +// v4: Removed separator support from (en|de)cDriver, and refactored codec(gen) +// v5: changes to support faster json decoding. Let encoder/decoder maintain state of collections. +// v6: removed unsafe from gen, and now uses codecgen.exec tag +// v7: +// v8: current - we now maintain compatibility with old generated code. +// v9: skipped +// v10: modified encDriver and decDriver interfaces. Remove deprecated methods after Jan 1, 2019 +const genVersion = 10 + +const ( + genCodecPkg = "codec1978" + genTempVarPfx = "yy" + genTopLevelVarName = "x" + + // ignore canBeNil parameter, and always set to true. + // This is because nil can appear anywhere, so we should always check. + genAnythingCanBeNil = true + + // if genUseOneFunctionForDecStructMap, make a single codecDecodeSelferFromMap function; + // else make codecDecodeSelferFromMap{LenPrefix,CheckBreak} so that conditionals + // are not executed a lot. + // + // From testing, it didn't make much difference in runtime, so keep as true (one function only) + genUseOneFunctionForDecStructMap = true +) + +type genStructMapStyle uint8 + +const ( + genStructMapStyleConsolidated genStructMapStyle = iota + genStructMapStyleLenPrefix + genStructMapStyleCheckBreak +) + +var ( + errGenAllTypesSamePkg = errors.New("All types must be in the same package") + errGenExpectArrayOrMap = errors.New("unexpected type. Expecting array/map/slice") + + genBase64enc = base64.NewEncoding("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789__") + genQNameRegex = regexp.MustCompile(`[A-Za-z_.]+`) +) + +type genBuf struct { + buf []byte +} + +func (x *genBuf) s(s string) *genBuf { x.buf = append(x.buf, s...); return x } +func (x *genBuf) b(s []byte) *genBuf { x.buf = append(x.buf, s...); return x } +func (x *genBuf) v() string { return string(x.buf) } +func (x *genBuf) f(s string, args ...interface{}) { x.s(fmt.Sprintf(s, args...)) } +func (x *genBuf) reset() { + if x.buf != nil { + x.buf = x.buf[:0] + } +} + +// genRunner holds some state used during a Gen run. +type genRunner struct { + w io.Writer // output + c uint64 // counter used for generating varsfx + t []reflect.Type // list of types to run selfer on + + tc reflect.Type // currently running selfer on this type + te map[uintptr]bool // types for which the encoder has been created + td map[uintptr]bool // types for which the decoder has been created + cp string // codec import path + + im map[string]reflect.Type // imports to add + imn map[string]string // package names of imports to add + imc uint64 // counter for import numbers + + is map[reflect.Type]struct{} // types seen during import search + bp string // base PkgPath, for which we are generating for + + cpfx string // codec package prefix + + tm map[reflect.Type]struct{} // types for which enc/dec must be generated + ts []reflect.Type // types for which enc/dec must be generated + + xs string // top level variable/constant suffix + hn string // fn helper type name + + ti *TypeInfos + // rr *rand.Rand // random generator for file-specific types + + nx bool // no extensions +} + +// Gen will write a complete go file containing Selfer implementations for each +// type passed. All the types must be in the same package. +// +// Library users: DO NOT USE IT DIRECTLY. IT WILL CHANGE CONTINUOUSLY WITHOUT NOTICE. +func Gen(w io.Writer, buildTags, pkgName, uid string, noExtensions bool, + ti *TypeInfos, typ ...reflect.Type) { + // All types passed to this method do not have a codec.Selfer method implemented directly. + // codecgen already checks the AST and skips any types that define the codec.Selfer methods. + // Consequently, there's no need to check and trim them if they implement codec.Selfer + + if len(typ) == 0 { + return + } + x := genRunner{ + w: w, + t: typ, + te: make(map[uintptr]bool), + td: make(map[uintptr]bool), + im: make(map[string]reflect.Type), + imn: make(map[string]string), + is: make(map[reflect.Type]struct{}), + tm: make(map[reflect.Type]struct{}), + ts: []reflect.Type{}, + bp: genImportPath(typ[0]), + xs: uid, + ti: ti, + nx: noExtensions, + } + if x.ti == nil { + x.ti = defTypeInfos + } + if x.xs == "" { + rr := rand.New(rand.NewSource(time.Now().UnixNano())) + x.xs = strconv.FormatInt(rr.Int63n(9999), 10) + } + + // gather imports first: + x.cp = genImportPath(reflect.TypeOf(x)) + x.imn[x.cp] = genCodecPkg + for _, t := range typ { + // fmt.Printf("###########: PkgPath: '%v', Name: '%s'\n", genImportPath(t), t.Name()) + if genImportPath(t) != x.bp { + panic(errGenAllTypesSamePkg) + } + x.genRefPkgs(t) + } + if buildTags != "" { + x.line("// +build " + buildTags) + x.line("") + } + x.line(` + +// Code generated by codecgen - DO NOT EDIT. + +`) + x.line("package " + pkgName) + x.line("") + x.line("import (") + if x.cp != x.bp { + x.cpfx = genCodecPkg + "." + x.linef("%s \"%s\"", genCodecPkg, x.cp) + } + // use a sorted set of im keys, so that we can get consistent output + imKeys := make([]string, 0, len(x.im)) + for k := range x.im { + imKeys = append(imKeys, k) + } + sort.Strings(imKeys) + for _, k := range imKeys { // for k, _ := range x.im { + if k == x.imn[k] { + x.linef("\"%s\"", k) + } else { + x.linef("%s \"%s\"", x.imn[k], k) + } + } + // add required packages + for _, k := range [...]string{"runtime", "errors", "strconv"} { // "reflect", "fmt" + if _, ok := x.im[k]; !ok { + x.line("\"" + k + "\"") + } + } + x.line(")") + x.line("") + + x.line("const (") + x.linef("// ----- content types ----") + x.linef("codecSelferCcUTF8%s = %v", x.xs, int64(cUTF8)) + x.linef("codecSelferCcRAW%s = %v", x.xs, int64(cRAW)) + x.linef("// ----- value types used ----") + for _, vt := range [...]valueType{ + valueTypeArray, valueTypeMap, valueTypeString, + valueTypeInt, valueTypeUint, valueTypeFloat} { + x.linef("codecSelferValueType%s%s = %v", vt.String(), x.xs, int64(vt)) + } + + x.linef("codecSelferBitsize%s = uint8(32 << (^uint(0) >> 63))", x.xs) + x.line(")") + x.line("var (") + x.line("errCodecSelferOnlyMapOrArrayEncodeToStruct" + x.xs + " = errors.New(`only encoded map or array can be decoded into a struct`)") + x.line(")") + x.line("") + + x.hn = "codecSelfer" + x.xs + x.line("type " + x.hn + " struct{}") + x.line("") + + x.varsfxreset() + x.line("func init() {") + x.linef("if %sGenVersion != %v {", x.cpfx, genVersion) + x.line("_, file, _, _ := runtime.Caller(0)") + x.outf(`panic("codecgen version mismatch: current: %v, need " + strconv.FormatInt(int64(%sGenVersion), 10) + ". Re-generate file: " + file)`, genVersion, x.cpfx) + // x.out(`panic(fmt.Errorf("codecgen version mismatch: current: %v, need %v. Re-generate file: %v", `) + // x.linef(`%v, %sGenVersion, file))`, genVersion, x.cpfx) + x.linef("}") + x.line("if false { var _ byte = 0; // reference the types, but skip this branch at build/run time") + // x.line("_ = strconv.ParseInt") + var n int + // for k, t := range x.im { + for _, k := range imKeys { + t := x.im[k] + x.linef("var v%v %s.%s", n, x.imn[k], t.Name()) + n++ + } + if n > 0 { + x.out("_") + for i := 1; i < n; i++ { + x.out(", _") + } + x.out(" = v0") + for i := 1; i < n; i++ { + x.outf(", v%v", i) + } + } + x.line("} ") // close if false + x.line("}") // close init + x.line("") + + // generate rest of type info + for _, t := range typ { + x.tc = t + x.selfer(true) + x.selfer(false) + } + + for _, t := range x.ts { + rtid := rt2id(t) + // generate enc functions for all these slice/map types. + x.varsfxreset() + x.linef("func (x %s) enc%s(v %s%s, e *%sEncoder) {", x.hn, x.genMethodNameT(t), x.arr2str(t, "*"), x.genTypeName(t), x.cpfx) + x.genRequiredMethodVars(true) + switch t.Kind() { + case reflect.Array, reflect.Slice, reflect.Chan: + x.encListFallback("v", t) + case reflect.Map: + x.encMapFallback("v", t) + default: + panic(errGenExpectArrayOrMap) + } + x.line("}") + x.line("") + + // generate dec functions for all these slice/map types. + x.varsfxreset() + x.linef("func (x %s) dec%s(v *%s, d *%sDecoder) {", x.hn, x.genMethodNameT(t), x.genTypeName(t), x.cpfx) + x.genRequiredMethodVars(false) + switch t.Kind() { + case reflect.Array, reflect.Slice, reflect.Chan: + x.decListFallback("v", rtid, t) + case reflect.Map: + x.decMapFallback("v", rtid, t) + default: + panic(errGenExpectArrayOrMap) + } + x.line("}") + x.line("") + } + + x.line("") +} + +func (x *genRunner) checkForSelfer(t reflect.Type, varname string) bool { + // return varname != genTopLevelVarName && t != x.tc + // the only time we checkForSelfer is if we are not at the TOP of the generated code. + return varname != genTopLevelVarName +} + +func (x *genRunner) arr2str(t reflect.Type, s string) string { + if t.Kind() == reflect.Array { + return s + } + return "" +} + +func (x *genRunner) genRequiredMethodVars(encode bool) { + x.line("var h " + x.hn) + if encode { + x.line("z, r := " + x.cpfx + "GenHelperEncoder(e)") + } else { + x.line("z, r := " + x.cpfx + "GenHelperDecoder(d)") + } + x.line("_, _, _ = h, z, r") +} + +func (x *genRunner) genRefPkgs(t reflect.Type) { + if _, ok := x.is[t]; ok { + return + } + x.is[t] = struct{}{} + tpkg, tname := genImportPath(t), t.Name() + if tpkg != "" && tpkg != x.bp && tpkg != x.cp && tname != "" && tname[0] >= 'A' && tname[0] <= 'Z' { + if _, ok := x.im[tpkg]; !ok { + x.im[tpkg] = t + if idx := strings.LastIndex(tpkg, "/"); idx < 0 { + x.imn[tpkg] = tpkg + } else { + x.imc++ + x.imn[tpkg] = "pkg" + strconv.FormatUint(x.imc, 10) + "_" + genGoIdentifier(tpkg[idx+1:], false) + } + } + } + switch t.Kind() { + case reflect.Array, reflect.Slice, reflect.Ptr, reflect.Chan: + x.genRefPkgs(t.Elem()) + case reflect.Map: + x.genRefPkgs(t.Elem()) + x.genRefPkgs(t.Key()) + case reflect.Struct: + for i := 0; i < t.NumField(); i++ { + if fname := t.Field(i).Name; fname != "" && fname[0] >= 'A' && fname[0] <= 'Z' { + x.genRefPkgs(t.Field(i).Type) + } + } + } +} + +func (x *genRunner) varsfx() string { + x.c++ + return strconv.FormatUint(x.c, 10) +} + +func (x *genRunner) varsfxreset() { + x.c = 0 +} + +func (x *genRunner) out(s string) { + _, err := io.WriteString(x.w, s) + if err != nil { + panic(err) + } +} + +func (x *genRunner) outf(s string, params ...interface{}) { + _, err := fmt.Fprintf(x.w, s, params...) + if err != nil { + panic(err) + } +} + +func (x *genRunner) line(s string) { + x.out(s) + if len(s) == 0 || s[len(s)-1] != '\n' { + x.out("\n") + } +} + +func (x *genRunner) linef(s string, params ...interface{}) { + x.outf(s, params...) + if len(s) == 0 || s[len(s)-1] != '\n' { + x.out("\n") + } +} + +func (x *genRunner) genTypeName(t reflect.Type) (n string) { + // defer func() { fmt.Printf(">>>> ####: genTypeName: t: %v, name: '%s'\n", t, n) }() + + // if the type has a PkgPath, which doesn't match the current package, + // then include it. + // We cannot depend on t.String() because it includes current package, + // or t.PkgPath because it includes full import path, + // + var ptrPfx string + for t.Kind() == reflect.Ptr { + ptrPfx += "*" + t = t.Elem() + } + if tn := t.Name(); tn != "" { + return ptrPfx + x.genTypeNamePrim(t) + } + switch t.Kind() { + case reflect.Map: + return ptrPfx + "map[" + x.genTypeName(t.Key()) + "]" + x.genTypeName(t.Elem()) + case reflect.Slice: + return ptrPfx + "[]" + x.genTypeName(t.Elem()) + case reflect.Array: + return ptrPfx + "[" + strconv.FormatInt(int64(t.Len()), 10) + "]" + x.genTypeName(t.Elem()) + case reflect.Chan: + return ptrPfx + t.ChanDir().String() + " " + x.genTypeName(t.Elem()) + default: + if t == intfTyp { + return ptrPfx + "interface{}" + } else { + return ptrPfx + x.genTypeNamePrim(t) + } + } +} + +func (x *genRunner) genTypeNamePrim(t reflect.Type) (n string) { + if t.Name() == "" { + return t.String() + } else if genImportPath(t) == "" || genImportPath(t) == genImportPath(x.tc) { + return t.Name() + } else { + return x.imn[genImportPath(t)] + "." + t.Name() + // return t.String() // best way to get the package name inclusive + } +} + +func (x *genRunner) genZeroValueR(t reflect.Type) string { + // if t is a named type, w + switch t.Kind() { + case reflect.Ptr, reflect.Interface, reflect.Chan, reflect.Func, + reflect.Slice, reflect.Map, reflect.Invalid: + return "nil" + case reflect.Bool: + return "false" + case reflect.String: + return `""` + case reflect.Struct, reflect.Array: + return x.genTypeName(t) + "{}" + default: // all numbers + return "0" + } +} + +func (x *genRunner) genMethodNameT(t reflect.Type) (s string) { + return genMethodNameT(t, x.tc) +} + +func (x *genRunner) selfer(encode bool) { + t := x.tc + t0 := t + // always make decode use a pointer receiver, + // and structs/arrays always use a ptr receiver (encode|decode) + isptr := !encode || t.Kind() == reflect.Array || (t.Kind() == reflect.Struct && t != timeTyp) + x.varsfxreset() + + fnSigPfx := "func (" + genTopLevelVarName + " " + if isptr { + fnSigPfx += "*" + } + fnSigPfx += x.genTypeName(t) + x.out(fnSigPfx) + + if isptr { + t = reflect.PtrTo(t) + } + if encode { + x.line(") CodecEncodeSelf(e *" + x.cpfx + "Encoder) {") + x.genRequiredMethodVars(true) + x.encVar(genTopLevelVarName, t) + } else { + x.line(") CodecDecodeSelf(d *" + x.cpfx + "Decoder) {") + x.genRequiredMethodVars(false) + // do not use decVar, as there is no need to check TryDecodeAsNil + // or way to elegantly handle that, and also setting it to a + // non-nil value doesn't affect the pointer passed. + // x.decVar(genTopLevelVarName, t, false) + x.dec(genTopLevelVarName, t0, true) + } + x.line("}") + x.line("") + + if encode || t0.Kind() != reflect.Struct { + return + } + + // write is containerMap + if genUseOneFunctionForDecStructMap { + x.out(fnSigPfx) + x.line(") codecDecodeSelfFromMap(l int, d *" + x.cpfx + "Decoder) {") + x.genRequiredMethodVars(false) + x.decStructMap(genTopLevelVarName, "l", rt2id(t0), t0, genStructMapStyleConsolidated) + x.line("}") + x.line("") + } else { + x.out(fnSigPfx) + x.line(") codecDecodeSelfFromMapLenPrefix(l int, d *" + x.cpfx + "Decoder) {") + x.genRequiredMethodVars(false) + x.decStructMap(genTopLevelVarName, "l", rt2id(t0), t0, genStructMapStyleLenPrefix) + x.line("}") + x.line("") + + x.out(fnSigPfx) + x.line(") codecDecodeSelfFromMapCheckBreak(l int, d *" + x.cpfx + "Decoder) {") + x.genRequiredMethodVars(false) + x.decStructMap(genTopLevelVarName, "l", rt2id(t0), t0, genStructMapStyleCheckBreak) + x.line("}") + x.line("") + } + + // write containerArray + x.out(fnSigPfx) + x.line(") codecDecodeSelfFromArray(l int, d *" + x.cpfx + "Decoder) {") + x.genRequiredMethodVars(false) + x.decStructArray(genTopLevelVarName, "l", "return", rt2id(t0), t0) + x.line("}") + x.line("") + +} + +// used for chan, array, slice, map +func (x *genRunner) xtraSM(varname string, t reflect.Type, encode, isptr bool) { + var ptrPfx, addrPfx string + if isptr { + ptrPfx = "*" + } else { + addrPfx = "&" + } + if encode { + x.linef("h.enc%s((%s%s)(%s), e)", x.genMethodNameT(t), ptrPfx, x.genTypeName(t), varname) + } else { + x.linef("h.dec%s((*%s)(%s%s), d)", x.genMethodNameT(t), x.genTypeName(t), addrPfx, varname) + } + x.registerXtraT(t) +} + +func (x *genRunner) registerXtraT(t reflect.Type) { + // recursively register the types + if _, ok := x.tm[t]; ok { + return + } + var tkey reflect.Type + switch t.Kind() { + case reflect.Chan, reflect.Slice, reflect.Array: + case reflect.Map: + tkey = t.Key() + default: + return + } + x.tm[t] = struct{}{} + x.ts = append(x.ts, t) + // check if this refers to any xtra types eg. a slice of array: add the array + x.registerXtraT(t.Elem()) + if tkey != nil { + x.registerXtraT(tkey) + } +} + +// encVar will encode a variable. +// The parameter, t, is the reflect.Type of the variable itself +func (x *genRunner) encVar(varname string, t reflect.Type) { + // fmt.Printf(">>>>>> varname: %s, t: %v\n", varname, t) + var checkNil bool + switch t.Kind() { + case reflect.Ptr, reflect.Interface, reflect.Slice, reflect.Map, reflect.Chan: + checkNil = true + } + if checkNil { + x.linef("if %s == nil { r.EncodeNil() } else { ", varname) + } + + switch t.Kind() { + case reflect.Ptr: + telem := t.Elem() + tek := telem.Kind() + if tek == reflect.Array || (tek == reflect.Struct && telem != timeTyp) { + x.enc(varname, genNonPtr(t)) + break + } + i := x.varsfx() + x.line(genTempVarPfx + i + " := *" + varname) + x.enc(genTempVarPfx+i, genNonPtr(t)) + case reflect.Struct, reflect.Array: + if t == timeTyp { + x.enc(varname, t) + break + } + i := x.varsfx() + x.line(genTempVarPfx + i + " := &" + varname) + x.enc(genTempVarPfx+i, t) + default: + x.enc(varname, t) + } + + if checkNil { + x.line("}") + } + +} + +// enc will encode a variable (varname) of type t, where t represents T. +// if t is !time.Time and t is of kind reflect.Struct or reflect.Array, varname is of type *T +// (to prevent copying), +// else t is of type T +func (x *genRunner) enc(varname string, t reflect.Type) { + rtid := rt2id(t) + ti2 := x.ti.get(rtid, t) + // We call CodecEncodeSelf if one of the following are honored: + // - the type already implements Selfer, call that + // - the type has a Selfer implementation just created, use that + // - the type is in the list of the ones we will generate for, but it is not currently being generated + + mi := x.varsfx() + // tptr := reflect.PtrTo(t) + tk := t.Kind() + if x.checkForSelfer(t, varname) { + if tk == reflect.Array || (tk == reflect.Struct && rtid != timeTypId) { // varname is of type *T + // if tptr.Implements(selferTyp) || t.Implements(selferTyp) { + if ti2.isFlag(typeInfoFlagIsZeroerPtr) || ti2.isFlag(typeInfoFlagIsZeroer) { + x.line(varname + ".CodecEncodeSelf(e)") + return + } + } else { // varname is of type T + if ti2.cs { // t.Implements(selferTyp) { + x.line(varname + ".CodecEncodeSelf(e)") + return + } else if ti2.csp { // tptr.Implements(selferTyp) { + x.linef("%ssf%s := &%s", genTempVarPfx, mi, varname) + x.linef("%ssf%s.CodecEncodeSelf(e)", genTempVarPfx, mi) + return + } + } + + if _, ok := x.te[rtid]; ok { + x.line(varname + ".CodecEncodeSelf(e)") + return + } + } + + inlist := false + for _, t0 := range x.t { + if t == t0 { + inlist = true + if x.checkForSelfer(t, varname) { + x.line(varname + ".CodecEncodeSelf(e)") + return + } + break + } + } + + var rtidAdded bool + if t == x.tc { + x.te[rtid] = true + rtidAdded = true + } + + // check if + // - type is time.Time, RawExt, Raw + // - the type implements (Text|JSON|Binary)(Unm|M)arshal + + x.line("if false {") //start if block + defer func() { x.line("}") }() //end if block + + if t == timeTyp { + x.linef("} else if !z.EncBasicHandle().TimeNotBuiltin { r.EncodeTime(%s)", varname) + // return + } + if t == rawTyp { + x.linef("} else { z.EncRaw(%s)", varname) + return + } + if t == rawExtTyp { + x.linef("} else { r.EncodeRawExt(%s, e)", varname) + return + } + // only check for extensions if the type is named, and has a packagePath. + var arrayOrStruct = tk == reflect.Array || tk == reflect.Struct // meaning varname if of type *T + if !x.nx && genImportPath(t) != "" && t.Name() != "" { + yy := fmt.Sprintf("%sxt%s", genTempVarPfx, mi) + x.linef("} else if %s := z.Extension(z.I2Rtid(%s)); %s != nil { z.EncExtension(%s, %s) ", yy, varname, yy, varname, yy) + } + if arrayOrStruct { // varname is of type *T + if ti2.bm || ti2.bmp { // t.Implements(binaryMarshalerTyp) || tptr.Implements(binaryMarshalerTyp) { + x.linef("} else if z.EncBinary() { z.EncBinaryMarshal(%v) ", varname) + } + if ti2.jm || ti2.jmp { // t.Implements(jsonMarshalerTyp) || tptr.Implements(jsonMarshalerTyp) { + x.linef("} else if !z.EncBinary() && z.IsJSONHandle() { z.EncJSONMarshal(%v) ", varname) + } else if ti2.tm || ti2.tmp { // t.Implements(textMarshalerTyp) || tptr.Implements(textMarshalerTyp) { + x.linef("} else if !z.EncBinary() { z.EncTextMarshal(%v) ", varname) + } + } else { // varname is of type T + if ti2.bm { // t.Implements(binaryMarshalerTyp) { + x.linef("} else if z.EncBinary() { z.EncBinaryMarshal(%v) ", varname) + } else if ti2.bmp { // tptr.Implements(binaryMarshalerTyp) { + x.linef("} else if z.EncBinary() { z.EncBinaryMarshal(&%v) ", varname) + } + if ti2.jm { // t.Implements(jsonMarshalerTyp) { + x.linef("} else if !z.EncBinary() && z.IsJSONHandle() { z.EncJSONMarshal(%v) ", varname) + } else if ti2.jmp { // tptr.Implements(jsonMarshalerTyp) { + x.linef("} else if !z.EncBinary() && z.IsJSONHandle() { z.EncJSONMarshal(&%v) ", varname) + } else if ti2.tm { // t.Implements(textMarshalerTyp) { + x.linef("} else if !z.EncBinary() { z.EncTextMarshal(%v) ", varname) + } else if ti2.tmp { // tptr.Implements(textMarshalerTyp) { + x.linef("} else if !z.EncBinary() { z.EncTextMarshal(&%v) ", varname) + } + } + x.line("} else {") + + switch t.Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + x.line("r.EncodeInt(int64(" + varname + "))") + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + x.line("r.EncodeUint(uint64(" + varname + "))") + case reflect.Float32: + x.line("r.EncodeFloat32(float32(" + varname + "))") + case reflect.Float64: + x.line("r.EncodeFloat64(float64(" + varname + "))") + case reflect.Bool: + x.line("r.EncodeBool(bool(" + varname + "))") + case reflect.String: + x.linef("if z.EncBasicHandle().StringToRaw { r.EncodeStringBytesRaw(z.BytesView(string(%s))) } else { r.EncodeStringEnc(codecSelferCcUTF8%s, string(%s)) }", varname, x.xs, varname) + case reflect.Chan: + x.xtraSM(varname, t, true, false) + // x.encListFallback(varname, rtid, t) + case reflect.Array: + x.xtraSM(varname, t, true, true) + case reflect.Slice: + // if nil, call dedicated function + // if a []uint8, call dedicated function + // if a known fastpath slice, call dedicated function + // else write encode function in-line. + // - if elements are primitives or Selfers, call dedicated function on each member. + // - else call Encoder.encode(XXX) on it. + if rtid == uint8SliceTypId { + x.line("r.EncodeStringBytesRaw([]byte(" + varname + "))") + } else if fastpathAV.index(rtid) != -1 { + g := x.newGenV(t) + x.line("z.F." + g.MethodNamePfx("Enc", false) + "V(" + varname + ", e)") + } else { + x.xtraSM(varname, t, true, false) + // x.encListFallback(varname, rtid, t) + } + case reflect.Map: + // if nil, call dedicated function + // if a known fastpath map, call dedicated function + // else write encode function in-line. + // - if elements are primitives or Selfers, call dedicated function on each member. + // - else call Encoder.encode(XXX) on it. + // x.line("if " + varname + " == nil { \nr.EncodeNil()\n } else { ") + if fastpathAV.index(rtid) != -1 { + g := x.newGenV(t) + x.line("z.F." + g.MethodNamePfx("Enc", false) + "V(" + varname + ", e)") + } else { + x.xtraSM(varname, t, true, false) + // x.encMapFallback(varname, rtid, t) + } + case reflect.Struct: + if !inlist { + delete(x.te, rtid) + x.line("z.EncFallback(" + varname + ")") + break + } + x.encStruct(varname, rtid, t) + default: + if rtidAdded { + delete(x.te, rtid) + } + x.line("z.EncFallback(" + varname + ")") + } +} + +func (x *genRunner) encZero(t reflect.Type) { + switch t.Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + x.line("r.EncodeInt(0)") + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + x.line("r.EncodeUint(0)") + case reflect.Float32: + x.line("r.EncodeFloat32(0)") + case reflect.Float64: + x.line("r.EncodeFloat64(0)") + case reflect.Bool: + x.line("r.EncodeBool(false)") + case reflect.String: + x.linef(`if z.EncBasicHandle().StringToRaw { r.EncodeStringBytesRaw([]byte{}) } else { r.EncodeStringEnc(codecSelferCcUTF8%s, "") }`, x.xs) + default: + x.line("r.EncodeNil()") + } +} + +func (x *genRunner) encOmitEmptyLine(t2 reflect.StructField, varname string, buf *genBuf) { + // smartly check omitEmpty on a struct type, as it may contain uncomparable map/slice/etc. + // also, for maps/slices/arrays, check if len ! 0 (not if == zero value) + varname2 := varname + "." + t2.Name + switch t2.Type.Kind() { + case reflect.Struct: + rtid2 := rt2id(t2.Type) + ti2 := x.ti.get(rtid2, t2.Type) + // fmt.Printf(">>>> structfield: omitempty: type: %s, field: %s\n", t2.Type.Name(), t2.Name) + if ti2.rtid == timeTypId { + buf.s("!(").s(varname2).s(".IsZero())") + break + } + if ti2.isFlag(typeInfoFlagIsZeroerPtr) || ti2.isFlag(typeInfoFlagIsZeroer) { + buf.s("!(").s(varname2).s(".IsZero())") + break + } + if ti2.isFlag(typeInfoFlagComparable) { + buf.s(varname2).s(" != ").s(x.genZeroValueR(t2.Type)) + break + } + // buf.s("(") + buf.s("false") + for i, n := 0, t2.Type.NumField(); i < n; i++ { + f := t2.Type.Field(i) + if f.PkgPath != "" { // unexported + continue + } + buf.s(" || ") + x.encOmitEmptyLine(f, varname2, buf) + } + //buf.s(")") + case reflect.Bool: + buf.s(varname2) + case reflect.Map, reflect.Slice, reflect.Array, reflect.Chan: + buf.s("len(").s(varname2).s(") != 0") + default: + buf.s(varname2).s(" != ").s(x.genZeroValueR(t2.Type)) + } +} + +func (x *genRunner) encStruct(varname string, rtid uintptr, t reflect.Type) { + // Use knowledge from structfieldinfo (mbs, encodable fields. Ignore omitempty. ) + // replicate code in kStruct i.e. for each field, deref type to non-pointer, and call x.enc on it + + // if t === type currently running selfer on, do for all + ti := x.ti.get(rtid, t) + i := x.varsfx() + sepVarname := genTempVarPfx + "sep" + i + numfieldsvar := genTempVarPfx + "q" + i + ti2arrayvar := genTempVarPfx + "r" + i + struct2arrvar := genTempVarPfx + "2arr" + i + + x.line(sepVarname + " := !z.EncBinary()") + x.linef("%s := z.EncBasicHandle().StructToArray", struct2arrvar) + x.linef("_, _ = %s, %s", sepVarname, struct2arrvar) + x.linef("const %s bool = %v // struct tag has 'toArray'", ti2arrayvar, ti.toArray) + + tisfi := ti.sfiSrc // always use sequence from file. decStruct expects same thing. + + // var nn int + // due to omitEmpty, we need to calculate the + // number of non-empty things we write out first. + // This is required as we need to pre-determine the size of the container, + // to support length-prefixing. + if ti.anyOmitEmpty { + x.linef("var %s = [%v]bool{ // should field at this index be written?", numfieldsvar, len(tisfi)) + + for j, si := range tisfi { + _ = j + if !si.omitEmpty() { + // x.linef("%s[%v] = true // %s", numfieldsvar, j, si.fieldName) + x.linef("true, // %s", si.fieldName) + // nn++ + continue + } + var t2 reflect.StructField + var omitline genBuf + { + t2typ := t + varname3 := varname + // go through the loop, record the t2 field explicitly, + // and gather the omit line if embedded in pointers. + for ij, ix := range si.is { + if uint8(ij) == si.nis { + break + } + for t2typ.Kind() == reflect.Ptr { + t2typ = t2typ.Elem() + } + t2 = t2typ.Field(int(ix)) + t2typ = t2.Type + varname3 = varname3 + "." + t2.Name + // do not include actual field in the omit line. + // that is done subsequently (right after - below). + if uint8(ij+1) < si.nis && t2typ.Kind() == reflect.Ptr { + omitline.s(varname3).s(" != nil && ") + } + } + } + x.encOmitEmptyLine(t2, varname, &omitline) + x.linef("%s, // %s", omitline.v(), si.fieldName) + } + x.line("}") + x.linef("_ = %s", numfieldsvar) + } + // x.linef("var %snn%s int", genTempVarPfx, i) + x.linef("if %s || %s {", ti2arrayvar, struct2arrvar) // if ti.toArray { + x.linef("r.WriteArrayStart(%d)", len(tisfi)) + x.linef("} else {") // if not ti.toArray + if ti.anyOmitEmpty { + // nn = 0 + // x.linef("var %snn%s = %v", genTempVarPfx, i, nn) + x.linef("var %snn%s int", genTempVarPfx, i) + x.linef("for _, b := range %s { if b { %snn%s++ } }", numfieldsvar, genTempVarPfx, i) + x.linef("r.WriteMapStart(%snn%s)", genTempVarPfx, i) + x.linef("%snn%s = %v", genTempVarPfx, i, 0) + } else { + x.linef("r.WriteMapStart(%d)", len(tisfi)) + } + x.line("}") // close if not StructToArray + + for j, si := range tisfi { + i := x.varsfx() + isNilVarName := genTempVarPfx + "n" + i + var labelUsed bool + var t2 reflect.StructField + { + t2typ := t + varname3 := varname + for ij, ix := range si.is { + if uint8(ij) == si.nis { + break + } + for t2typ.Kind() == reflect.Ptr { + t2typ = t2typ.Elem() + } + t2 = t2typ.Field(int(ix)) + t2typ = t2.Type + varname3 = varname3 + "." + t2.Name + if t2typ.Kind() == reflect.Ptr { + if !labelUsed { + x.line("var " + isNilVarName + " bool") + } + x.line("if " + varname3 + " == nil { " + isNilVarName + " = true ") + x.line("goto LABEL" + i) + x.line("}") + labelUsed = true + // "varname3 = new(" + x.genTypeName(t3.Elem()) + ") }") + } + } + // t2 = t.FieldByIndex(si.is) + } + if labelUsed { + x.line("LABEL" + i + ":") + } + // if the type of the field is a Selfer, or one of the ones + + x.linef("if %s || %s {", ti2arrayvar, struct2arrvar) // if ti.toArray + if labelUsed { + x.linef("if %s { r.WriteArrayElem(); r.EncodeNil() } else { ", isNilVarName) + } + x.line("r.WriteArrayElem()") + if si.omitEmpty() { + x.linef("if %s[%v] {", numfieldsvar, j) + } + x.encVar(varname+"."+t2.Name, t2.Type) + if si.omitEmpty() { + x.linef("} else {") + x.encZero(t2.Type) + x.linef("}") + } + if labelUsed { + x.line("}") + } + + x.linef("} else {") // if not ti.toArray + + if si.omitEmpty() { + x.linef("if %s[%v] {", numfieldsvar, j) + } + x.line("r.WriteMapElemKey()") + + // emulate EncStructFieldKey + switch ti.keyType { + case valueTypeInt: + x.linef("r.EncodeInt(z.M.Int(strconv.ParseInt(`%s`, 10, 64)))", si.encName) + case valueTypeUint: + x.linef("r.EncodeUint(z.M.Uint(strconv.ParseUint(`%s`, 10, 64)))", si.encName) + case valueTypeFloat: + x.linef("r.EncodeFloat64(z.M.Float(strconv.ParseFloat(`%s`, 64)))", si.encName) + default: // string + if si.encNameAsciiAlphaNum { + x.linef(`if z.IsJSONHandle() { z.WriteStr("\"%s\"") } else { `, si.encName) + } + x.linef("r.EncodeStringEnc(codecSelferCcUTF8%s, `%s`)", x.xs, si.encName) + if si.encNameAsciiAlphaNum { + x.linef("}") + } + } + // x.linef("r.EncStructFieldKey(codecSelferValueType%s%s, `%s`)", ti.keyType.String(), x.xs, si.encName) + x.line("r.WriteMapElemValue()") + if labelUsed { + x.line("if " + isNilVarName + " { r.EncodeNil() } else { ") + x.encVar(varname+"."+t2.Name, t2.Type) + x.line("}") + } else { + x.encVar(varname+"."+t2.Name, t2.Type) + } + if si.omitEmpty() { + x.line("}") + } + x.linef("} ") // end if/else ti.toArray + } + x.linef("if %s || %s {", ti2arrayvar, struct2arrvar) // if ti.toArray { + x.line("r.WriteArrayEnd()") + x.line("} else {") + x.line("r.WriteMapEnd()") + x.line("}") + +} + +func (x *genRunner) encListFallback(varname string, t reflect.Type) { + elemBytes := t.Elem().Kind() == reflect.Uint8 + if t.AssignableTo(uint8SliceTyp) { + x.linef("r.EncodeStringBytesRaw([]byte(%s))", varname) + return + } + if t.Kind() == reflect.Array && elemBytes { + x.linef("r.EncodeStringBytesRaw(((*[%d]byte)(%s))[:])", t.Len(), varname) + return + } + i := x.varsfx() + if t.Kind() == reflect.Chan { + type ts struct { + Label, Chan, Slice, Sfx string + } + tm, err := template.New("").Parse(genEncChanTmpl) + if err != nil { + panic(err) + } + x.linef("if %s == nil { r.EncodeNil() } else { ", varname) + x.linef("var sch%s []%s", i, x.genTypeName(t.Elem())) + err = tm.Execute(x.w, &ts{"Lsch" + i, varname, "sch" + i, i}) + if err != nil { + panic(err) + } + // x.linef("%s = sch%s", varname, i) + if elemBytes { + x.linef("r.EncodeStringBytesRaw([]byte(%s))", "sch"+i) + x.line("}") + return + } + varname = "sch" + i + } + + x.line("r.WriteArrayStart(len(" + varname + "))") + x.linef("for _, %sv%s := range %s {", genTempVarPfx, i, varname) + x.line("r.WriteArrayElem()") + + x.encVar(genTempVarPfx+"v"+i, t.Elem()) + x.line("}") + x.line("r.WriteArrayEnd()") + if t.Kind() == reflect.Chan { + x.line("}") + } +} + +func (x *genRunner) encMapFallback(varname string, t reflect.Type) { + // TODO: expand this to handle canonical. + i := x.varsfx() + x.line("r.WriteMapStart(len(" + varname + "))") + x.linef("for %sk%s, %sv%s := range %s {", genTempVarPfx, i, genTempVarPfx, i, varname) + x.line("r.WriteMapElemKey()") + x.encVar(genTempVarPfx+"k"+i, t.Key()) + x.line("r.WriteMapElemValue()") + x.encVar(genTempVarPfx+"v"+i, t.Elem()) + x.line("}") + x.line("r.WriteMapEnd()") +} + +func (x *genRunner) decVarInitPtr(varname, nilvar string, t reflect.Type, si *structFieldInfo, + newbuf, nilbuf *genBuf) (t2 reflect.StructField) { + //we must accommodate anonymous fields, where the embedded field is a nil pointer in the value. + // t2 = t.FieldByIndex(si.is) + t2typ := t + varname3 := varname + t2kind := t2typ.Kind() + var nilbufed bool + if si != nil { + for ij, ix := range si.is { + if uint8(ij) == si.nis { + break + } + for t2typ.Kind() == reflect.Ptr { + t2typ = t2typ.Elem() + } + t2 = t2typ.Field(int(ix)) + t2typ = t2.Type + varname3 = varname3 + "." + t2.Name + t2kind = t2typ.Kind() + if t2kind != reflect.Ptr { + continue + } + if newbuf != nil { + newbuf.f("if %s == nil { %s = new(%s) }\n", varname3, varname3, x.genTypeName(t2typ.Elem())) + } + if nilbuf != nil { + if !nilbufed { + nilbuf.s("if true") + nilbufed = true + } + nilbuf.s(" && ").s(varname3).s(" != nil") + } + } + } + // if t2typ.Kind() == reflect.Ptr { + // varname3 = varname3 + t2.Name + // } + if nilbuf != nil { + if nilbufed { + nilbuf.s(" { ") + } + if nilvar != "" { + nilbuf.s(nilvar).s(" = true") + } else if tk := t2typ.Kind(); tk == reflect.Ptr { + if strings.IndexByte(varname3, '.') != -1 || strings.IndexByte(varname3, '[') != -1 { + nilbuf.s(varname3).s(" = nil") + } else { + nilbuf.s("*").s(varname3).s(" = ").s(x.genZeroValueR(t2typ.Elem())) + } + } else { + nilbuf.s(varname3).s(" = ").s(x.genZeroValueR(t2typ)) + } + if nilbufed { + nilbuf.s("}") + } + } + return t2 +} + +// decVar takes a variable called varname, of type t +func (x *genRunner) decVarMain(varname, rand string, t reflect.Type, checkNotNil bool) { + // We only encode as nil if a nillable value. + // This removes some of the wasted checks for TryDecodeAsNil. + // We need to think about this more, to see what happens if omitempty, etc + // cause a nil value to be stored when something is expected. + // This could happen when decoding from a struct encoded as an array. + // For that, decVar should be called with canNil=true, to force true as its value. + var varname2 string + if t.Kind() != reflect.Ptr { + if t.PkgPath() != "" || !x.decTryAssignPrimitive(varname, t, false) { + x.dec(varname, t, false) + } + } else { + if checkNotNil { + x.linef("if %s == nil { %s = new(%s) }", varname, varname, x.genTypeName(t.Elem())) + } + // Ensure we set underlying ptr to a non-nil value (so we can deref to it later). + // There's a chance of a **T in here which is nil. + var ptrPfx string + for t = t.Elem(); t.Kind() == reflect.Ptr; t = t.Elem() { + ptrPfx += "*" + if checkNotNil { + x.linef("if %s%s == nil { %s%s = new(%s)}", + ptrPfx, varname, ptrPfx, varname, x.genTypeName(t)) + } + } + // Should we create temp var if a slice/map indexing? No. dec(...) can now handle it. + + if ptrPfx == "" { + x.dec(varname, t, true) + } else { + varname2 = genTempVarPfx + "z" + rand + x.line(varname2 + " := " + ptrPfx + varname) + x.dec(varname2, t, true) + } + } +} + +// decVar takes a variable called varname, of type t +func (x *genRunner) decVar(varname, nilvar string, t reflect.Type, canBeNil, checkNotNil bool) { + i := x.varsfx() + + // We only encode as nil if a nillable value. + // This removes some of the wasted checks for TryDecodeAsNil. + // We need to think about this more, to see what happens if omitempty, etc + // cause a nil value to be stored when something is expected. + // This could happen when decoding from a struct encoded as an array. + // For that, decVar should be called with canNil=true, to force true as its value. + + if !canBeNil { + canBeNil = genAnythingCanBeNil || !genIsImmutable(t) + } + + if canBeNil { + var buf genBuf + x.decVarInitPtr(varname, nilvar, t, nil, nil, &buf) + x.linef("if r.TryDecodeAsNil() { %s } else {", buf.buf) + } else { + x.line("// cannot be nil") + } + + x.decVarMain(varname, i, t, checkNotNil) + + if canBeNil { + x.line("} ") + } +} + +// dec will decode a variable (varname) of type t or ptrTo(t) if isptr==true. +// t is always a basetype (i.e. not of kind reflect.Ptr). +func (x *genRunner) dec(varname string, t reflect.Type, isptr bool) { + // assumptions: + // - the varname is to a pointer already. No need to take address of it + // - t is always a baseType T (not a *T, etc). + rtid := rt2id(t) + ti2 := x.ti.get(rtid, t) + // tptr := reflect.PtrTo(t) + if x.checkForSelfer(t, varname) { + if ti2.cs || ti2.csp { // t.Implements(selferTyp) || tptr.Implements(selferTyp) { + x.line(varname + ".CodecDecodeSelf(d)") + return + } + if _, ok := x.td[rtid]; ok { + x.line(varname + ".CodecDecodeSelf(d)") + return + } + } + + inlist := false + for _, t0 := range x.t { + if t == t0 { + inlist = true + if x.checkForSelfer(t, varname) { + x.line(varname + ".CodecDecodeSelf(d)") + return + } + break + } + } + + var rtidAdded bool + if t == x.tc { + x.td[rtid] = true + rtidAdded = true + } + + // check if + // - type is time.Time, Raw, RawExt + // - the type implements (Text|JSON|Binary)(Unm|M)arshal + + mi := x.varsfx() + // x.linef("%sm%s := z.DecBinary()", genTempVarPfx, mi) + // x.linef("_ = %sm%s", genTempVarPfx, mi) + x.line("if false {") //start if block + defer func() { x.line("}") }() //end if block + + var ptrPfx, addrPfx string + if isptr { + ptrPfx = "*" + } else { + addrPfx = "&" + } + if t == timeTyp { + x.linef("} else if !z.DecBasicHandle().TimeNotBuiltin { %s%v = r.DecodeTime()", ptrPfx, varname) + // return + } + if t == rawTyp { + x.linef("} else { %s%v = z.DecRaw()", ptrPfx, varname) + return + } + + if t == rawExtTyp { + x.linef("} else { r.DecodeExt(%s%v, 0, nil)", addrPfx, varname) + return + } + + // only check for extensions if the type is named, and has a packagePath. + if !x.nx && genImportPath(t) != "" && t.Name() != "" { + // first check if extensions are configued, before doing the interface conversion + // x.linef("} else if z.HasExtensions() && z.DecExt(%s) {", varname) + yy := fmt.Sprintf("%sxt%s", genTempVarPfx, mi) + x.linef("} else if %s := z.Extension(z.I2Rtid(%s)); %s != nil { z.DecExtension(%s, %s) ", yy, varname, yy, varname, yy) + } + + if ti2.bu || ti2.bup { // t.Implements(binaryUnmarshalerTyp) || tptr.Implements(binaryUnmarshalerTyp) { + x.linef("} else if z.DecBinary() { z.DecBinaryUnmarshal(%s%v) ", addrPfx, varname) + } + if ti2.ju || ti2.jup { // t.Implements(jsonUnmarshalerTyp) || tptr.Implements(jsonUnmarshalerTyp) { + x.linef("} else if !z.DecBinary() && z.IsJSONHandle() { z.DecJSONUnmarshal(%s%v)", addrPfx, varname) + } else if ti2.tu || ti2.tup { // t.Implements(textUnmarshalerTyp) || tptr.Implements(textUnmarshalerTyp) { + x.linef("} else if !z.DecBinary() { z.DecTextUnmarshal(%s%v)", addrPfx, varname) + } + + x.line("} else {") + + if x.decTryAssignPrimitive(varname, t, isptr) { + return + } + + switch t.Kind() { + case reflect.Array, reflect.Chan: + x.xtraSM(varname, t, false, isptr) + case reflect.Slice: + // if a []uint8, call dedicated function + // if a known fastpath slice, call dedicated function + // else write encode function in-line. + // - if elements are primitives or Selfers, call dedicated function on each member. + // - else call Encoder.encode(XXX) on it. + if rtid == uint8SliceTypId { + x.linef("%s%s = r.DecodeBytes(%s(%s[]byte)(%s), false)", + ptrPfx, varname, ptrPfx, ptrPfx, varname) + } else if fastpathAV.index(rtid) != -1 { + g := x.newGenV(t) + x.linef("z.F.%sX(%s%s, d)", g.MethodNamePfx("Dec", false), addrPfx, varname) + } else { + x.xtraSM(varname, t, false, isptr) + // x.decListFallback(varname, rtid, false, t) + } + case reflect.Map: + // if a known fastpath map, call dedicated function + // else write encode function in-line. + // - if elements are primitives or Selfers, call dedicated function on each member. + // - else call Encoder.encode(XXX) on it. + if fastpathAV.index(rtid) != -1 { + g := x.newGenV(t) + x.linef("z.F.%sX(%s%s, d)", g.MethodNamePfx("Dec", false), addrPfx, varname) + } else { + x.xtraSM(varname, t, false, isptr) + // x.decMapFallback(varname, rtid, t) + } + case reflect.Struct: + if inlist { + // no need to create temp variable if isptr, or x.F or x[F] + if isptr || strings.IndexByte(varname, '.') != -1 || strings.IndexByte(varname, '[') != -1 { + x.decStruct(varname, rtid, t) + } else { + varname2 := genTempVarPfx + "j" + mi + x.line(varname2 + " := &" + varname) + x.decStruct(varname2, rtid, t) + } + } else { + // delete(x.td, rtid) + x.line("z.DecFallback(" + addrPfx + varname + ", false)") + } + default: + if rtidAdded { + delete(x.te, rtid) + } + x.line("z.DecFallback(" + addrPfx + varname + ", true)") + } +} + +func (x *genRunner) decTryAssignPrimitive(varname string, t reflect.Type, isptr bool) (done bool) { + // This should only be used for exact primitives (ie un-named types). + // Named types may be implementations of Selfer, Unmarshaler, etc. + // They should be handled by dec(...) + + var ptr string + if isptr { + ptr = "*" + } + switch t.Kind() { + case reflect.Int: + x.linef("%s%s = (%s)(z.C.IntV(r.DecodeInt64(), codecSelferBitsize%s))", ptr, varname, x.genTypeName(t), x.xs) + case reflect.Int8: + x.linef("%s%s = (%s)(z.C.IntV(r.DecodeInt64(), 8))", ptr, varname, x.genTypeName(t)) + case reflect.Int16: + x.linef("%s%s = (%s)(z.C.IntV(r.DecodeInt64(), 16))", ptr, varname, x.genTypeName(t)) + case reflect.Int32: + x.linef("%s%s = (%s)(z.C.IntV(r.DecodeInt64(), 32))", ptr, varname, x.genTypeName(t)) + case reflect.Int64: + x.linef("%s%s = (%s)(r.DecodeInt64())", ptr, varname, x.genTypeName(t)) + + case reflect.Uint: + x.linef("%s%s = (%s)(z.C.UintV(r.DecodeUint64(), codecSelferBitsize%s))", ptr, varname, x.genTypeName(t), x.xs) + case reflect.Uint8: + x.linef("%s%s = (%s)(z.C.UintV(r.DecodeUint64(), 8))", ptr, varname, x.genTypeName(t)) + case reflect.Uint16: + x.linef("%s%s = (%s)(z.C.UintV(r.DecodeUint64(), 16))", ptr, varname, x.genTypeName(t)) + case reflect.Uint32: + x.linef("%s%s = (%s)(z.C.UintV(r.DecodeUint64(), 32))", ptr, varname, x.genTypeName(t)) + case reflect.Uint64: + x.linef("%s%s = (%s)(r.DecodeUint64())", ptr, varname, x.genTypeName(t)) + case reflect.Uintptr: + x.linef("%s%s = (%s)(z.C.UintV(r.DecodeUint64(), codecSelferBitsize%s))", ptr, varname, x.genTypeName(t), x.xs) + + case reflect.Float32: + x.linef("%s%s = (%s)(r.DecodeFloat32As64())", ptr, varname, x.genTypeName(t)) + case reflect.Float64: + x.linef("%s%s = (%s)(r.DecodeFloat64())", ptr, varname, x.genTypeName(t)) + + case reflect.Bool: + x.linef("%s%s = (%s)(r.DecodeBool())", ptr, varname, x.genTypeName(t)) + case reflect.String: + x.linef("%s%s = (%s)(r.DecodeString())", ptr, varname, x.genTypeName(t)) + default: + return false + } + return true +} + +func (x *genRunner) decListFallback(varname string, rtid uintptr, t reflect.Type) { + if t.AssignableTo(uint8SliceTyp) { + x.line("*" + varname + " = r.DecodeBytes(*((*[]byte)(" + varname + ")), false)") + return + } + if t.Kind() == reflect.Array && t.Elem().Kind() == reflect.Uint8 { + x.linef("r.DecodeBytes( ((*[%d]byte)(%s))[:], true)", t.Len(), varname) + return + } + type tstruc struct { + TempVar string + Rand string + Varname string + CTyp string + Typ string + Immutable bool + Size int + } + telem := t.Elem() + ts := tstruc{genTempVarPfx, x.varsfx(), varname, x.genTypeName(t), x.genTypeName(telem), genIsImmutable(telem), int(telem.Size())} + + funcs := make(template.FuncMap) + + funcs["decLineVar"] = func(varname string) string { + x.decVar(varname, "", telem, false, true) + return "" + } + funcs["var"] = func(s string) string { + return ts.TempVar + s + ts.Rand + } + funcs["zero"] = func() string { + return x.genZeroValueR(telem) + } + funcs["isArray"] = func() bool { + return t.Kind() == reflect.Array + } + funcs["isSlice"] = func() bool { + return t.Kind() == reflect.Slice + } + funcs["isChan"] = func() bool { + return t.Kind() == reflect.Chan + } + tm, err := template.New("").Funcs(funcs).Parse(genDecListTmpl) + if err != nil { + panic(err) + } + if err = tm.Execute(x.w, &ts); err != nil { + panic(err) + } +} + +func (x *genRunner) decMapFallback(varname string, rtid uintptr, t reflect.Type) { + type tstruc struct { + TempVar string + Sfx string + Rand string + Varname string + KTyp string + Typ string + Size int + } + telem := t.Elem() + tkey := t.Key() + ts := tstruc{ + genTempVarPfx, x.xs, 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, true) + return "" + } + funcs["decLineVar"] = func(varname, decodedNilVarname string) string { + x.decVar(varname, decodedNilVarname, telem, false, true) + return "" + } + funcs["var"] = func(s string) string { + return ts.TempVar + s + ts.Rand + } + + tm, err := template.New("").Funcs(funcs).Parse(genDecMapTmpl) + if err != nil { + panic(err) + } + if err = tm.Execute(x.w, &ts); err != nil { + panic(err) + } +} + +func (x *genRunner) decStructMapSwitch(kName string, varname string, rtid uintptr, t reflect.Type) { + ti := x.ti.get(rtid, t) + tisfi := ti.sfiSrc // always use sequence from file. decStruct expects same thing. + x.line("switch (" + kName + ") {") + var newbuf, nilbuf genBuf + for _, si := range tisfi { + x.line("case \"" + si.encName + "\":") + newbuf.reset() + nilbuf.reset() + t2 := x.decVarInitPtr(varname, "", t, si, &newbuf, &nilbuf) + x.linef("if r.TryDecodeAsNil() { %s } else { %s", nilbuf.buf, newbuf.buf) + x.decVarMain(varname+"."+t2.Name, x.varsfx(), t2.Type, false) + x.line("}") + } + x.line("default:") + // pass the slice here, so that the string will not escape, and maybe save allocation + x.line("z.DecStructFieldNotFound(-1, " + kName + ")") + x.line("} // end switch " + kName) +} + +func (x *genRunner) decStructMap(varname, lenvarname string, rtid uintptr, t reflect.Type, style genStructMapStyle) { + tpfx := genTempVarPfx + ti := x.ti.get(rtid, t) + i := x.varsfx() + kName := tpfx + "s" + i + + switch style { + case genStructMapStyleLenPrefix: + x.linef("for %sj%s := 0; %sj%s < %s; %sj%s++ {", tpfx, i, tpfx, i, lenvarname, tpfx, i) + case genStructMapStyleCheckBreak: + x.linef("for %sj%s := 0; !r.CheckBreak(); %sj%s++ {", tpfx, i, tpfx, i) + default: // 0, otherwise. + x.linef("var %shl%s bool = %s >= 0", tpfx, i, lenvarname) // has length + x.linef("for %sj%s := 0; ; %sj%s++ {", tpfx, i, tpfx, i) + x.linef("if %shl%s { if %sj%s >= %s { break }", tpfx, i, tpfx, i, lenvarname) + x.line("} else { if r.CheckBreak() { break }; }") + } + x.line("r.ReadMapElemKey()") + + // emulate decstructfieldkey + switch ti.keyType { + case valueTypeInt: + x.linef("%s := z.StringView(strconv.AppendInt(z.DecScratchArrayBuffer()[:0], r.DecodeInt64(), 10))", kName) + case valueTypeUint: + x.linef("%s := z.StringView(strconv.AppendUint(z.DecScratchArrayBuffer()[:0], r.DecodeUint64(), 10))", kName) + case valueTypeFloat: + x.linef("%s := z.StringView(strconv.AppendFloat(z.DecScratchArrayBuffer()[:0], r.DecodeFloat64(), 'f', -1, 64))", kName) + default: // string + x.linef("%s := z.StringView(r.DecodeStringAsBytes())", kName) + } + // x.linef("%s := z.StringView(r.DecStructFieldKey(codecSelferValueType%s%s, z.DecScratchArrayBuffer()))", kName, ti.keyType.String(), x.xs) + + x.line("r.ReadMapElemValue()") + x.decStructMapSwitch(kName, varname, rtid, t) + + x.line("} // end for " + tpfx + "j" + i) + x.line("r.ReadMapEnd()") +} + +func (x *genRunner) decStructArray(varname, lenvarname, breakString string, rtid uintptr, t reflect.Type) { + tpfx := genTempVarPfx + i := x.varsfx() + ti := x.ti.get(rtid, t) + tisfi := ti.sfiSrc // always use sequence from file. decStruct expects same thing. + x.linef("var %sj%s int", tpfx, i) + x.linef("var %sb%s bool", tpfx, i) // break + x.linef("var %shl%s bool = %s >= 0", tpfx, i, lenvarname) // has length + var newbuf, nilbuf genBuf + for _, si := range tisfi { + x.linef("%sj%s++; if %shl%s { %sb%s = %sj%s > %s } else { %sb%s = r.CheckBreak() }", + tpfx, i, tpfx, i, tpfx, i, + tpfx, i, lenvarname, tpfx, i) + x.linef("if %sb%s { r.ReadArrayEnd(); %s }", tpfx, i, breakString) + x.line("r.ReadArrayElem()") + newbuf.reset() + nilbuf.reset() + t2 := x.decVarInitPtr(varname, "", t, si, &newbuf, &nilbuf) + x.linef("if r.TryDecodeAsNil() { %s } else { %s", nilbuf.buf, newbuf.buf) + x.decVarMain(varname+"."+t2.Name, x.varsfx(), t2.Type, false) + x.line("}") + } + // read remaining values and throw away. + x.line("for {") + x.linef("%sj%s++; if %shl%s { %sb%s = %sj%s > %s } else { %sb%s = r.CheckBreak() }", + tpfx, i, tpfx, i, tpfx, i, + tpfx, i, lenvarname, tpfx, i) + x.linef("if %sb%s { break }", tpfx, i) + x.line("r.ReadArrayElem()") + x.linef(`z.DecStructFieldNotFound(%sj%s - 1, "")`, tpfx, i) + x.line("}") + x.line("r.ReadArrayEnd()") +} + +func (x *genRunner) decStruct(varname string, rtid uintptr, t reflect.Type) { + // varname MUST be a ptr, or a struct field or a slice element. + i := x.varsfx() + x.linef("%sct%s := r.ContainerType()", genTempVarPfx, i) + x.linef("if %sct%s == codecSelferValueTypeMap%s {", genTempVarPfx, i, x.xs) + x.line(genTempVarPfx + "l" + i + " := r.ReadMapStart()") + x.linef("if %sl%s == 0 {", genTempVarPfx, i) + x.line("r.ReadMapEnd()") + if genUseOneFunctionForDecStructMap { + x.line("} else { ") + x.linef("%s.codecDecodeSelfFromMap(%sl%s, d)", varname, genTempVarPfx, i) + } else { + x.line("} else if " + genTempVarPfx + "l" + i + " > 0 { ") + x.line(varname + ".codecDecodeSelfFromMapLenPrefix(" + genTempVarPfx + "l" + i + ", d)") + x.line("} else {") + x.line(varname + ".codecDecodeSelfFromMapCheckBreak(" + genTempVarPfx + "l" + i + ", d)") + } + x.line("}") + + // else if container is array + x.linef("} else if %sct%s == codecSelferValueTypeArray%s {", genTempVarPfx, i, x.xs) + x.line(genTempVarPfx + "l" + i + " := r.ReadArrayStart()") + x.linef("if %sl%s == 0 {", genTempVarPfx, i) + x.line("r.ReadArrayEnd()") + x.line("} else { ") + x.linef("%s.codecDecodeSelfFromArray(%sl%s, d)", varname, genTempVarPfx, i) + x.line("}") + // else panic + x.line("} else { ") + x.line("panic(errCodecSelferOnlyMapOrArrayEncodeToStruct" + x.xs + ")") + x.line("} ") +} + +// -------- + +type genV struct { + // genV is either a primitive (Primitive != "") or a map (MapKey != "") or a slice + MapKey string + Elem string + Primitive string + Size int +} + +func (x *genRunner) newGenV(t reflect.Type) (v genV) { + switch t.Kind() { + case reflect.Slice, reflect.Array: + te := t.Elem() + v.Elem = x.genTypeName(te) + v.Size = int(te.Size()) + case reflect.Map: + te, tk := t.Elem(), t.Key() + v.Elem = x.genTypeName(te) + v.MapKey = x.genTypeName(tk) + v.Size = int(te.Size() + tk.Size()) + default: + panic("unexpected type for newGenV. Requires map or slice type") + } + return +} + +func (x *genV) MethodNamePfx(prefix string, prim bool) string { + var name []byte + if prefix != "" { + name = append(name, prefix...) + } + if prim { + name = append(name, genTitleCaseName(x.Primitive)...) + } else { + if x.MapKey == "" { + name = append(name, "Slice"...) + } else { + name = append(name, "Map"...) + name = append(name, genTitleCaseName(x.MapKey)...) + } + name = append(name, genTitleCaseName(x.Elem)...) + } + return string(name) + +} + +// genImportPath returns import path of a non-predeclared named typed, or an empty string otherwise. +// +// This handles the misbehaviour that occurs when 1.5-style vendoring is enabled, +// where PkgPath returns the full path, including the vendoring pre-fix that should have been stripped. +// We strip it here. +func genImportPath(t reflect.Type) (s string) { + s = t.PkgPath() + if genCheckVendor { + // HACK: always handle vendoring. It should be typically on in go 1.6, 1.7 + s = genStripVendor(s) + } + return +} + +// A go identifier is (letter|_)[letter|number|_]* +func genGoIdentifier(s string, checkFirstChar bool) string { + b := make([]byte, 0, len(s)) + t := make([]byte, 4) + var n int + for i, r := range s { + if checkFirstChar && i == 0 && !unicode.IsLetter(r) { + b = append(b, '_') + } + // r must be unicode_letter, unicode_digit or _ + if unicode.IsLetter(r) || unicode.IsDigit(r) { + n = utf8.EncodeRune(t, r) + b = append(b, t[:n]...) + } else { + b = append(b, '_') + } + } + return string(b) +} + +func genNonPtr(t reflect.Type) reflect.Type { + for t.Kind() == reflect.Ptr { + t = t.Elem() + } + return t +} + +func genTitleCaseName(s string) string { + switch s { + case "interface{}", "interface {}": + return "Intf" + default: + return strings.ToUpper(s[0:1]) + s[1:] + } +} + +func genMethodNameT(t reflect.Type, tRef reflect.Type) (n string) { + var ptrPfx string + for t.Kind() == reflect.Ptr { + ptrPfx += "Ptrto" + t = t.Elem() + } + tstr := t.String() + if tn := t.Name(); tn != "" { + if tRef != nil && genImportPath(t) == genImportPath(tRef) { + return ptrPfx + tn + } else { + if genQNameRegex.MatchString(tstr) { + return ptrPfx + strings.Replace(tstr, ".", "_", 1000) + } else { + return ptrPfx + genCustomTypeName(tstr) + } + } + } + switch t.Kind() { + case reflect.Map: + return ptrPfx + "Map" + genMethodNameT(t.Key(), tRef) + genMethodNameT(t.Elem(), tRef) + case reflect.Slice: + return ptrPfx + "Slice" + genMethodNameT(t.Elem(), tRef) + case reflect.Array: + return ptrPfx + "Array" + strconv.FormatInt(int64(t.Len()), 10) + genMethodNameT(t.Elem(), tRef) + case reflect.Chan: + var cx string + switch t.ChanDir() { + case reflect.SendDir: + cx = "ChanSend" + case reflect.RecvDir: + cx = "ChanRecv" + default: + cx = "Chan" + } + return ptrPfx + cx + genMethodNameT(t.Elem(), tRef) + default: + if t == intfTyp { + return ptrPfx + "Interface" + } else { + if tRef != nil && genImportPath(t) == genImportPath(tRef) { + if t.Name() != "" { + return ptrPfx + t.Name() + } else { + return ptrPfx + genCustomTypeName(tstr) + } + } else { + // best way to get the package name inclusive + // return ptrPfx + strings.Replace(tstr, ".", "_", 1000) + // return ptrPfx + genBase64enc.EncodeToString([]byte(tstr)) + if t.Name() != "" && genQNameRegex.MatchString(tstr) { + return ptrPfx + strings.Replace(tstr, ".", "_", 1000) + } else { + return ptrPfx + genCustomTypeName(tstr) + } + } + } + } +} + +// genCustomNameForType base64encodes the t.String() value in such a way +// that it can be used within a function name. +func genCustomTypeName(tstr string) string { + len2 := genBase64enc.EncodedLen(len(tstr)) + bufx := make([]byte, len2) + genBase64enc.Encode(bufx, []byte(tstr)) + for i := len2 - 1; i >= 0; i-- { + if bufx[i] == '=' { + len2-- + } else { + break + } + } + return string(bufx[:len2]) +} + +func genIsImmutable(t reflect.Type) (v bool) { + return isImmutableKind(t.Kind()) +} + +type genInternal struct { + Version int + Values []genV +} + +func (x genInternal) FastpathLen() (l int) { + for _, v := range x.Values { + if v.Primitive == "" && !(v.MapKey == "" && v.Elem == "uint8") { + l++ + } + } + return +} + +func genInternalZeroValue(s string) string { + switch s { + case "interface{}", "interface {}": + return "nil" + case "bool": + return "false" + case "string": + return `""` + default: + return "0" + } +} + +var genInternalNonZeroValueIdx [5]uint64 +var genInternalNonZeroValueStrs = [2][5]string{ + {`"string-is-an-interface"`, "true", `"some-string"`, "11.1", "33"}, + {`"string-is-an-interface-2"`, "true", `"some-string-2"`, "22.2", "44"}, +} + +func genInternalNonZeroValue(s string) string { + switch s { + case "interface{}", "interface {}": + genInternalNonZeroValueIdx[0]++ + return genInternalNonZeroValueStrs[genInternalNonZeroValueIdx[0]%2][0] // return string, to remove ambiguity + case "bool": + genInternalNonZeroValueIdx[1]++ + return genInternalNonZeroValueStrs[genInternalNonZeroValueIdx[1]%2][1] + case "string": + genInternalNonZeroValueIdx[2]++ + return genInternalNonZeroValueStrs[genInternalNonZeroValueIdx[2]%2][2] + case "float32", "float64", "float", "double": + genInternalNonZeroValueIdx[3]++ + return genInternalNonZeroValueStrs[genInternalNonZeroValueIdx[3]%2][3] + default: + genInternalNonZeroValueIdx[4]++ + return genInternalNonZeroValueStrs[genInternalNonZeroValueIdx[4]%2][4] + } +} + +func genInternalEncCommandAsString(s string, vname string) string { + switch s { + case "uint", "uint8", "uint16", "uint32", "uint64": + return "ee.EncodeUint(uint64(" + vname + "))" + case "int", "int8", "int16", "int32", "int64": + return "ee.EncodeInt(int64(" + vname + "))" + case "string": + return "if e.h.StringToRaw { ee.EncodeStringBytesRaw(bytesView(" + vname + ")) " + + "} else { ee.EncodeStringEnc(cUTF8, " + vname + ") }" + case "float32": + return "ee.EncodeFloat32(" + vname + ")" + case "float64": + return "ee.EncodeFloat64(" + vname + ")" + case "bool": + return "ee.EncodeBool(" + vname + ")" + // case "symbol": + // return "ee.EncodeSymbol(" + vname + ")" + default: + return "e.encode(" + vname + ")" + } +} + +func genInternalDecCommandAsString(s string) string { + switch s { + case "uint": + return "uint(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))" + case "uint8": + return "uint8(chkOvf.UintV(dd.DecodeUint64(), 8))" + case "uint16": + return "uint16(chkOvf.UintV(dd.DecodeUint64(), 16))" + case "uint32": + return "uint32(chkOvf.UintV(dd.DecodeUint64(), 32))" + case "uint64": + return "dd.DecodeUint64()" + case "uintptr": + return "uintptr(chkOvf.UintV(dd.DecodeUint64(), uintBitsize))" + case "int": + return "int(chkOvf.IntV(dd.DecodeInt64(), intBitsize))" + case "int8": + return "int8(chkOvf.IntV(dd.DecodeInt64(), 8))" + case "int16": + return "int16(chkOvf.IntV(dd.DecodeInt64(), 16))" + case "int32": + return "int32(chkOvf.IntV(dd.DecodeInt64(), 32))" + case "int64": + return "dd.DecodeInt64()" + + case "string": + return "dd.DecodeString()" + case "float32": + return "float32(chkOvf.Float32V(dd.DecodeFloat64()))" + case "float64": + return "dd.DecodeFloat64()" + case "bool": + return "dd.DecodeBool()" + default: + 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) +} + +func genStripVendor(s string) string { + // HACK: Misbehaviour occurs in go 1.5. May have to re-visit this later. + // if s contains /vendor/ OR startsWith vendor/, then return everything after it. + const vendorStart = "vendor/" + const vendorInline = "/vendor/" + if i := strings.LastIndex(s, vendorInline); i >= 0 { + s = s[i+len(vendorInline):] + } else if strings.HasPrefix(s, vendorStart) { + s = s[len(vendorStart):] + } + return s +} + +// var genInternalMu sync.Mutex +var genInternalV = genInternal{Version: genVersion} +var genInternalTmplFuncs template.FuncMap +var genInternalOnce sync.Once + +func genInternalInit() { + types := [...]string{ + "interface{}", + "string", + "float32", + "float64", + "uint", + "uint8", + "uint16", + "uint32", + "uint64", + "uintptr", + "int", + "int8", + "int16", + "int32", + "int64", + "bool", + } + // keep as slice, so it is in specific iteration order. + // Initial order was uint64, string, interface{}, int, int64 + mapvaltypes := [...]string{ + "interface{}", + "string", + "uint", + "uint8", + "uint16", + "uint32", + "uint64", + "uintptr", + "int", + "int8", + "int16", + "int32", + "int64", + "float32", + "float64", + "bool", + } + wordSizeBytes := int(intBitsize) / 8 + + mapvaltypes2 := map[string]int{ + "interface{}": 2 * wordSizeBytes, + "string": 2 * wordSizeBytes, + "uint": 1 * wordSizeBytes, + "uint8": 1, + "uint16": 2, + "uint32": 4, + "uint64": 8, + "uintptr": 1 * wordSizeBytes, + "int": 1 * wordSizeBytes, + "int8": 1, + "int16": 2, + "int32": 4, + "int64": 8, + "float32": 4, + "float64": 8, + "bool": 1, + } + var gt = genInternal{Version: genVersion} + + // For each slice or map type, there must be a (symmetrical) Encode and Decode fast-path function + for _, s := range types { + gt.Values = append(gt.Values, genV{Primitive: s, Size: mapvaltypes2[s]}) + // if s != "uint8" { // do not generate fast path for slice of bytes. Treat specially already. + // gt.Values = append(gt.Values, genV{Elem: s, Size: mapvaltypes2[s]}) + // } + gt.Values = append(gt.Values, genV{Elem: s, Size: mapvaltypes2[s]}) + if _, ok := mapvaltypes2[s]; !ok { + gt.Values = append(gt.Values, genV{MapKey: s, Elem: s, Size: 2 * mapvaltypes2[s]}) + } + for _, ms := range mapvaltypes { + gt.Values = append(gt.Values, genV{MapKey: s, Elem: ms, Size: mapvaltypes2[s] + mapvaltypes2[ms]}) + } + } + + funcs := make(template.FuncMap) + // funcs["haspfx"] = strings.HasPrefix + funcs["encmd"] = genInternalEncCommandAsString + funcs["decmd"] = genInternalDecCommandAsString + funcs["zerocmd"] = genInternalZeroValue + funcs["nonzerocmd"] = genInternalNonZeroValue + funcs["hasprefix"] = strings.HasPrefix + funcs["sorttype"] = genInternalSortType + + genInternalV = gt + genInternalTmplFuncs = funcs +} + +// 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) (err error) { + genInternalOnce.Do(genInternalInit) + + gt := genInternalV + + t := template.New("").Funcs(genInternalTmplFuncs) + + tmplstr, err := ioutil.ReadAll(r) + if err != nil { + return + } + + if t, err = t.Parse(string(tmplstr)); err != nil { + return + } + + var out bytes.Buffer + err = t.Execute(&out, gt) + if err != nil { + return + } + + bout, err := format.Source(out.Bytes()) + if err != nil { + w.Write(out.Bytes()) // write out if error, so we can still see. + // w.Write(bout) // write out if error, as much as possible, so we can still see. + return + } + w.Write(bout) + return +} diff --git a/vendor/github.com/ugorji/go/codec/goversion_arrayof_gte_go15.go b/vendor/github.com/ugorji/go/codec/goversion_arrayof_gte_go15.go new file mode 100644 index 000000000..9ddbe2059 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/goversion_arrayof_gte_go15.go @@ -0,0 +1,14 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +// +build go1.5 + +package codec + +import "reflect" + +const reflectArrayOfSupported = true + +func reflectArrayOf(count int, elem reflect.Type) reflect.Type { + return reflect.ArrayOf(count, elem) +} diff --git a/vendor/github.com/ugorji/go/codec/goversion_arrayof_lt_go15.go b/vendor/github.com/ugorji/go/codec/goversion_arrayof_lt_go15.go new file mode 100644 index 000000000..c5fcd6697 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/goversion_arrayof_lt_go15.go @@ -0,0 +1,14 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +// +build !go1.5 + +package codec + +import "reflect" + +const reflectArrayOfSupported = false + +func reflectArrayOf(count int, elem reflect.Type) reflect.Type { + panic("codec: reflect.ArrayOf unsupported in this go version") +} diff --git a/vendor/github.com/ugorji/go/codec/goversion_makemap_gte_go19.go b/vendor/github.com/ugorji/go/codec/goversion_makemap_gte_go19.go new file mode 100644 index 000000000..bc39d6b71 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/goversion_makemap_gte_go19.go @@ -0,0 +1,15 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +// +build go1.9 + +package codec + +import "reflect" + +func makeMapReflect(t reflect.Type, size int) reflect.Value { + if size < 0 { + return reflect.MakeMapWithSize(t, 4) + } + return reflect.MakeMapWithSize(t, size) +} diff --git a/vendor/github.com/ugorji/go/codec/goversion_makemap_lt_go19.go b/vendor/github.com/ugorji/go/codec/goversion_makemap_lt_go19.go new file mode 100644 index 000000000..cde4cd372 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/goversion_makemap_lt_go19.go @@ -0,0 +1,12 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +// +build !go1.9 + +package codec + +import "reflect" + +func makeMapReflect(t reflect.Type, size int) reflect.Value { + return reflect.MakeMap(t) +} diff --git a/vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_gte_go110.go b/vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_gte_go110.go new file mode 100644 index 000000000..794133a3c --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_gte_go110.go @@ -0,0 +1,8 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +// +build go1.10 + +package codec + +const allowSetUnexportedEmbeddedPtr = false diff --git a/vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_lt_go110.go b/vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_lt_go110.go new file mode 100644 index 000000000..fd92ede35 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_lt_go110.go @@ -0,0 +1,8 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +// +build !go1.10 + +package codec + +const allowSetUnexportedEmbeddedPtr = true diff --git a/vendor/github.com/ugorji/go/codec/goversion_unsupported_lt_go14.go b/vendor/github.com/ugorji/go/codec/goversion_unsupported_lt_go14.go new file mode 100644 index 000000000..8debfa613 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/goversion_unsupported_lt_go14.go @@ -0,0 +1,17 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +// +build !go1.4 + +package codec + +// This codec package will only work for go1.4 and above. +// This is for the following reasons: +// - go 1.4 was released in 2014 +// - go runtime is written fully in go +// - interface only holds pointers +// - reflect.Value is stabilized as 3 words + +func init() { + panic("codec: go 1.3 and below are not supported") +} diff --git a/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go15.go b/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go15.go new file mode 100644 index 000000000..0f1bb01e5 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go15.go @@ -0,0 +1,10 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +// +build go1.5,!go1.6 + +package codec + +import "os" + +var genCheckVendor = os.Getenv("GO15VENDOREXPERIMENT") == "1" diff --git a/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go16.go b/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go16.go new file mode 100644 index 000000000..2fb4b057d --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go16.go @@ -0,0 +1,10 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +// +build go1.6,!go1.7 + +package codec + +import "os" + +var genCheckVendor = os.Getenv("GO15VENDOREXPERIMENT") != "0" diff --git a/vendor/github.com/ugorji/go/codec/goversion_vendor_gte_go17.go b/vendor/github.com/ugorji/go/codec/goversion_vendor_gte_go17.go new file mode 100644 index 000000000..c5b815505 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/goversion_vendor_gte_go17.go @@ -0,0 +1,8 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +// +build go1.7 + +package codec + +const genCheckVendor = true diff --git a/vendor/github.com/ugorji/go/codec/goversion_vendor_lt_go15.go b/vendor/github.com/ugorji/go/codec/goversion_vendor_lt_go15.go new file mode 100644 index 000000000..837cf240b --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/goversion_vendor_lt_go15.go @@ -0,0 +1,8 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +// +build !go1.5 + +package codec + +var genCheckVendor = false diff --git a/vendor/github.com/ugorji/go/codec/helper.go b/vendor/github.com/ugorji/go/codec/helper.go index e6dc0563f..8ada846be 100644 --- a/vendor/github.com/ugorji/go/codec/helper.go +++ b/vendor/github.com/ugorji/go/codec/helper.go @@ -1,61 +1,200 @@ -// Copyright (c) 2012, 2013 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. package codec // Contains code shared by both encode and decode. +// Some shared ideas around encoding/decoding +// ------------------------------------------ +// +// If an interface{} is passed, we first do a type assertion to see if it is +// a primitive type or a map/slice of primitive types, and use a fastpath to handle it. +// +// If we start with a reflect.Value, we are already in reflect.Value land and +// will try to grab the function for the underlying Type and directly call that function. +// This is more performant than calling reflect.Value.Interface(). +// +// This still helps us bypass many layers of reflection, and give best performance. +// +// Containers +// ------------ +// Containers in the stream are either associative arrays (key-value pairs) or +// regular arrays (indexed by incrementing integers). +// +// Some streams support indefinite-length containers, and use a breaking +// byte-sequence to denote that the container has come to an end. +// +// Some streams also are text-based, and use explicit separators to denote the +// end/beginning of different values. +// +// During encode, we use a high-level condition to determine how to iterate through +// the container. That decision is based on whether the container is text-based (with +// separators) or binary (without separators). If binary, we do not even call the +// encoding of separators. +// +// During decode, we use a different high-level condition to determine how to iterate +// through the containers. That decision is based on whether the stream contained +// a length prefix, or if it used explicit breaks. If length-prefixed, we assume that +// it has to be binary, and we do not even try to read separators. +// +// Philosophy +// ------------ +// On decode, this codec will update containers appropriately: +// - If struct, update fields from stream into fields of struct. +// If field in stream not found in struct, handle appropriately (based on option). +// If a struct field has no corresponding value in the stream, leave it AS IS. +// If nil in stream, set value to nil/zero value. +// - If map, update map from stream. +// If the stream value is NIL, set the map to nil. +// - if slice, try to update up to length of array in stream. +// if container len is less than stream array length, +// and container cannot be expanded, handled (based on option). +// This means you can decode 4-element stream array into 1-element array. +// +// ------------------------------------ +// On encode, user can specify omitEmpty. This means that the value will be omitted +// if the zero value. The problem may occur during decode, where omitted values do not affect +// the value being decoded into. This means that if decoding into a struct with an +// int field with current value=5, and the field is omitted in the stream, then after +// decoding, the value will still be 5 (not 0). +// omitEmpty only works if you guarantee that you always decode into zero-values. +// +// ------------------------------------ +// We could have truncated a map to remove keys not available in the stream, +// or set values in the struct which are not in the stream to their zero values. +// We decided against it because there is no efficient way to do it. +// We may introduce it as an option later. +// However, that will require enabling it for both runtime and code generation modes. +// +// To support truncate, we need to do 2 passes over the container: +// map +// - first collect all keys (e.g. in k1) +// - for each key in stream, mark k1 that the key should not be removed +// - after updating map, do second pass and call delete for all keys in k1 which are not marked +// struct: +// - for each field, track the *typeInfo s1 +// - iterate through all s1, and for each one not marked, set value to zero +// - this involves checking the possible anonymous fields which are nil ptrs. +// too much work. +// +// ------------------------------------------ +// Error Handling is done within the library using panic. +// +// This way, the code doesn't have to keep checking if an error has happened, +// and we don't have to keep sending the error value along with each call +// or storing it in the En|Decoder and checking it constantly along the way. +// +// The disadvantage is that small functions which use panics cannot be inlined. +// The code accounts for that by only using panics behind an interface; +// since interface calls cannot be inlined, this is irrelevant. +// +// We considered storing the error is En|Decoder. +// - once it has its err field set, it cannot be used again. +// - panicing will be optional, controlled by const flag. +// - code should always check error first and return early. +// We eventually decided against it as it makes the code clumsier to always +// check for these error conditions. + import ( + "bytes" + "encoding" "encoding/binary" + "errors" "fmt" + "io" "math" "reflect" "sort" + "strconv" "strings" "sync" + "sync/atomic" "time" - "unicode" - "unicode/utf8" ) const ( - structTagName = "codec" + scratchByteArrayLen = 32 + // initCollectionCap = 16 // 32 is defensive. 16 is preferred. - // Support - // encoding.BinaryMarshaler: MarshalBinary() (data []byte, err error) - // encoding.BinaryUnmarshaler: UnmarshalBinary(data []byte) error + // Support encoding.(Binary|Text)(Unm|M)arshaler. // This constant flag will enable or disable it. - supportBinaryMarshal = true - - // Each Encoder or Decoder uses a cache of functions based on conditionals, - // so that the conditionals are not run every time. - // - // Either a map or a slice is used to keep track of the functions. - // The map is more natural, but has a higher cost than a slice/array. - // This flag (useMapForCodecCache) controls which is used. - useMapForCodecCache = false - - // For some common container types, we can short-circuit an elaborate - // reflection dance and call encode/decode directly. - // The currently supported types are: - // - slices of strings, or id's (int64,uint64) or interfaces. - // - maps of str->str, str->intf, id(int64,uint64)->intf, intf->intf - shortCircuitReflectToFastPath = true + supportMarshalInterfaces = true // for debugging, set this to false, to catch panic traces. // Note that this will always cause rpc tests to fail, since they need io.EOF sent via panic. recoverPanicToErr = true + + // arrayCacheLen is the length of the cache used in encoder or decoder for + // allowing zero-alloc initialization. + // arrayCacheLen = 8 + + // size of the cacheline: defaulting to value for archs: amd64, arm64, 386 + // should use "runtime/internal/sys".CacheLineSize, but that is not exposed. + cacheLineSize = 64 + + wordSizeBits = 32 << (^uint(0) >> 63) // strconv.IntSize + wordSize = wordSizeBits / 8 + + // so structFieldInfo fits into 8 bytes + maxLevelsEmbedding = 14 + + // useFinalizers=true configures finalizers to release pool'ed resources + // acquired by Encoder/Decoder during their GC. + // + // Note that calling SetFinalizer is always expensive, + // as code must be run on the systemstack even for SetFinalizer(t, nil). + // + // We document that folks SHOULD call Release() when done, or they can + // explicitly call SetFinalizer themselves e.g. + // runtime.SetFinalizer(e, (*Encoder).Release) + // runtime.SetFinalizer(d, (*Decoder).Release) + useFinalizers = false ) +var oneByteArr [1]byte +var zeroByteSlice = oneByteArr[:0:0] + +var codecgen bool + +var refBitset bitset256 +var pool pooler +var panicv panicHdl + +func init() { + pool.init() + + refBitset.set(byte(reflect.Map)) + refBitset.set(byte(reflect.Ptr)) + refBitset.set(byte(reflect.Func)) + refBitset.set(byte(reflect.Chan)) +} + +type clsErr struct { + closed bool // is it closed? + errClosed error // error on closing +} + +// type entryType uint8 + +// const ( +// entryTypeBytes entryType = iota // make this 0, so a comparison is cheap +// entryTypeIo +// entryTypeBufio +// entryTypeUnset = 255 +// ) + type charEncoding uint8 const ( - c_RAW charEncoding = iota - c_UTF8 - c_UTF16LE - c_UTF16BE - c_UTF32LE - c_UTF32BE + _ charEncoding = iota // make 0 unset + cUTF8 + cUTF16LE + cUTF16BE + cUTF32LE + cUTF32BE + // Deprecated: not a true char encoding value + cRAW charEncoding = 255 ) // valueType is the stream type @@ -73,517 +212,2486 @@ const ( valueTypeBytes valueTypeMap valueTypeArray - valueTypeTimestamp + valueTypeTime valueTypeExt - valueTypeInvalid = 0xff + // valueTypeInvalid = 0xff +) + +var valueTypeStrings = [...]string{ + "Unset", + "Nil", + "Int", + "Uint", + "Float", + "Bool", + "String", + "Symbol", + "Bytes", + "Map", + "Array", + "Timestamp", + "Ext", +} + +func (x valueType) String() string { + if int(x) < len(valueTypeStrings) { + return valueTypeStrings[x] + } + return strconv.FormatInt(int64(x), 10) +} + +type seqType uint8 + +const ( + _ seqType = iota + seqTypeArray + seqTypeSlice + seqTypeChan +) + +// note that containerMapStart and containerArraySend are not sent. +// This is because the ReadXXXStart and EncodeXXXStart already does these. +type containerState uint8 + +const ( + _ containerState = iota + + containerMapStart // slot left open, since Driver method already covers it + containerMapKey + containerMapValue + containerMapEnd + containerArrayStart // slot left open, since Driver methods already cover it + containerArrayElem + containerArrayEnd +) + +// // sfiIdx used for tracking where a (field/enc)Name is seen in a []*structFieldInfo +// type sfiIdx struct { +// name string +// index int +// } + +// do not recurse if a containing type refers to an embedded type +// which refers back to its containing type (via a pointer). +// The second time this back-reference happens, break out, +// so as not to cause an infinite loop. +const rgetMaxRecursion = 2 + +// Anecdotally, we believe most types have <= 12 fields. +// - even Java's PMD rules set TooManyFields threshold to 15. +// However, go has embedded fields, which should be regarded as +// top level, allowing structs to possibly double or triple. +// In addition, we don't want to keep creating transient arrays, +// especially for the sfi index tracking, and the evtypes tracking. +// +// So - try to keep typeInfoLoadArray within 2K bytes +const ( + typeInfoLoadArraySfisLen = 16 + typeInfoLoadArraySfiidxLen = 8 * 112 + typeInfoLoadArrayEtypesLen = 12 + typeInfoLoadArrayBLen = 8 * 4 ) +type typeInfoLoad struct { + // fNames []string + // encNames []string + etypes []uintptr + sfis []structFieldInfo +} + +type typeInfoLoadArray struct { + // fNames [typeInfoLoadArrayLen]string + // encNames [typeInfoLoadArrayLen]string + sfis [typeInfoLoadArraySfisLen]structFieldInfo + sfiidx [typeInfoLoadArraySfiidxLen]byte + etypes [typeInfoLoadArrayEtypesLen]uintptr + b [typeInfoLoadArrayBLen]byte // scratch - used for struct field names +} + +// mirror json.Marshaler and json.Unmarshaler here, +// so we don't import the encoding/json package + +type jsonMarshaler interface { + MarshalJSON() ([]byte, error) +} +type jsonUnmarshaler interface { + UnmarshalJSON([]byte) error +} + +type isZeroer interface { + IsZero() bool +} + +type codecError struct { + name string + err interface{} +} + +func (e codecError) Cause() error { + switch xerr := e.err.(type) { + case nil: + return nil + case error: + return xerr + case string: + return errors.New(xerr) + case fmt.Stringer: + return errors.New(xerr.String()) + default: + return fmt.Errorf("%v", e.err) + } +} + +func (e codecError) Error() string { + return fmt.Sprintf("%s error: %v", e.name, e.err) +} + +// type byteAccepter func(byte) bool + var ( bigen = binary.BigEndian structInfoFieldName = "_struct" - cachedTypeInfo = make(map[uintptr]*typeInfo, 4) - cachedTypeInfoMutex sync.RWMutex - - intfSliceTyp = reflect.TypeOf([]interface{}(nil)) - intfTyp = intfSliceTyp.Elem() - - strSliceTyp = reflect.TypeOf([]string(nil)) - boolSliceTyp = reflect.TypeOf([]bool(nil)) - uintSliceTyp = reflect.TypeOf([]uint(nil)) - uint8SliceTyp = reflect.TypeOf([]uint8(nil)) - uint16SliceTyp = reflect.TypeOf([]uint16(nil)) - uint32SliceTyp = reflect.TypeOf([]uint32(nil)) - uint64SliceTyp = reflect.TypeOf([]uint64(nil)) - intSliceTyp = reflect.TypeOf([]int(nil)) - int8SliceTyp = reflect.TypeOf([]int8(nil)) - int16SliceTyp = reflect.TypeOf([]int16(nil)) - int32SliceTyp = reflect.TypeOf([]int32(nil)) - int64SliceTyp = reflect.TypeOf([]int64(nil)) - float32SliceTyp = reflect.TypeOf([]float32(nil)) - float64SliceTyp = reflect.TypeOf([]float64(nil)) - - mapIntfIntfTyp = reflect.TypeOf(map[interface{}]interface{}(nil)) mapStrIntfTyp = reflect.TypeOf(map[string]interface{}(nil)) - mapStrStrTyp = reflect.TypeOf(map[string]string(nil)) - - mapIntIntfTyp = reflect.TypeOf(map[int]interface{}(nil)) - mapInt64IntfTyp = reflect.TypeOf(map[int64]interface{}(nil)) - mapUintIntfTyp = reflect.TypeOf(map[uint]interface{}(nil)) - mapUint64IntfTyp = reflect.TypeOf(map[uint64]interface{}(nil)) - - stringTyp = reflect.TypeOf("") - timeTyp = reflect.TypeOf(time.Time{}) - rawExtTyp = reflect.TypeOf(RawExt{}) - - mapBySliceTyp = reflect.TypeOf((*MapBySlice)(nil)).Elem() - binaryMarshalerTyp = reflect.TypeOf((*binaryMarshaler)(nil)).Elem() - binaryUnmarshalerTyp = reflect.TypeOf((*binaryUnmarshaler)(nil)).Elem() - - rawExtTypId = reflect.ValueOf(rawExtTyp).Pointer() - intfTypId = reflect.ValueOf(intfTyp).Pointer() - timeTypId = reflect.ValueOf(timeTyp).Pointer() - - intfSliceTypId = reflect.ValueOf(intfSliceTyp).Pointer() - strSliceTypId = reflect.ValueOf(strSliceTyp).Pointer() - - boolSliceTypId = reflect.ValueOf(boolSliceTyp).Pointer() - uintSliceTypId = reflect.ValueOf(uintSliceTyp).Pointer() - uint8SliceTypId = reflect.ValueOf(uint8SliceTyp).Pointer() - uint16SliceTypId = reflect.ValueOf(uint16SliceTyp).Pointer() - uint32SliceTypId = reflect.ValueOf(uint32SliceTyp).Pointer() - uint64SliceTypId = reflect.ValueOf(uint64SliceTyp).Pointer() - intSliceTypId = reflect.ValueOf(intSliceTyp).Pointer() - int8SliceTypId = reflect.ValueOf(int8SliceTyp).Pointer() - int16SliceTypId = reflect.ValueOf(int16SliceTyp).Pointer() - int32SliceTypId = reflect.ValueOf(int32SliceTyp).Pointer() - int64SliceTypId = reflect.ValueOf(int64SliceTyp).Pointer() - float32SliceTypId = reflect.ValueOf(float32SliceTyp).Pointer() - float64SliceTypId = reflect.ValueOf(float64SliceTyp).Pointer() - - mapStrStrTypId = reflect.ValueOf(mapStrStrTyp).Pointer() - mapIntfIntfTypId = reflect.ValueOf(mapIntfIntfTyp).Pointer() - mapStrIntfTypId = reflect.ValueOf(mapStrIntfTyp).Pointer() - mapIntIntfTypId = reflect.ValueOf(mapIntIntfTyp).Pointer() - mapInt64IntfTypId = reflect.ValueOf(mapInt64IntfTyp).Pointer() - mapUintIntfTypId = reflect.ValueOf(mapUintIntfTyp).Pointer() - mapUint64IntfTypId = reflect.ValueOf(mapUint64IntfTyp).Pointer() - // Id = reflect.ValueOf().Pointer() - // mapBySliceTypId = reflect.ValueOf(mapBySliceTyp).Pointer() - - binaryMarshalerTypId = reflect.ValueOf(binaryMarshalerTyp).Pointer() - binaryUnmarshalerTypId = reflect.ValueOf(binaryUnmarshalerTyp).Pointer() - - intBitsize uint8 = uint8(reflect.TypeOf(int(0)).Bits()) - uintBitsize uint8 = uint8(reflect.TypeOf(uint(0)).Bits()) - - bsAll0x00 = []byte{0, 0, 0, 0, 0, 0, 0, 0} + mapIntfIntfTyp = reflect.TypeOf(map[interface{}]interface{}(nil)) + intfSliceTyp = reflect.TypeOf([]interface{}(nil)) + intfTyp = intfSliceTyp.Elem() + + reflectValTyp = reflect.TypeOf((*reflect.Value)(nil)).Elem() + + stringTyp = reflect.TypeOf("") + timeTyp = reflect.TypeOf(time.Time{}) + rawExtTyp = reflect.TypeOf(RawExt{}) + rawTyp = reflect.TypeOf(Raw{}) + uintptrTyp = reflect.TypeOf(uintptr(0)) + uint8Typ = reflect.TypeOf(uint8(0)) + uint8SliceTyp = reflect.TypeOf([]uint8(nil)) + uintTyp = reflect.TypeOf(uint(0)) + intTyp = reflect.TypeOf(int(0)) + + mapBySliceTyp = reflect.TypeOf((*MapBySlice)(nil)).Elem() + + binaryMarshalerTyp = reflect.TypeOf((*encoding.BinaryMarshaler)(nil)).Elem() + binaryUnmarshalerTyp = reflect.TypeOf((*encoding.BinaryUnmarshaler)(nil)).Elem() + + textMarshalerTyp = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem() + textUnmarshalerTyp = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem() + + jsonMarshalerTyp = reflect.TypeOf((*jsonMarshaler)(nil)).Elem() + jsonUnmarshalerTyp = reflect.TypeOf((*jsonUnmarshaler)(nil)).Elem() + + selferTyp = reflect.TypeOf((*Selfer)(nil)).Elem() + missingFielderTyp = reflect.TypeOf((*MissingFielder)(nil)).Elem() + iszeroTyp = reflect.TypeOf((*isZeroer)(nil)).Elem() + + uint8TypId = rt2id(uint8Typ) + uint8SliceTypId = rt2id(uint8SliceTyp) + rawExtTypId = rt2id(rawExtTyp) + rawTypId = rt2id(rawTyp) + intfTypId = rt2id(intfTyp) + timeTypId = rt2id(timeTyp) + stringTypId = rt2id(stringTyp) + + mapStrIntfTypId = rt2id(mapStrIntfTyp) + mapIntfIntfTypId = rt2id(mapIntfIntfTyp) + intfSliceTypId = rt2id(intfSliceTyp) + // mapBySliceTypId = rt2id(mapBySliceTyp) + + intBitsize = uint8(intTyp.Bits()) + uintBitsize = uint8(uintTyp.Bits()) + + // bsAll0x00 = []byte{0, 0, 0, 0, 0, 0, 0, 0} bsAll0xff = []byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff} + + chkOvf checkOverflow + + errNoFieldNameToStructFieldInfo = errors.New("no field name passed to parseStructFieldInfo") ) -type binaryUnmarshaler interface { - UnmarshalBinary(data []byte) error +var defTypeInfos = NewTypeInfos([]string{"codec", "json"}) + +var immutableKindsSet = [32]bool{ + // reflect.Invalid: , + reflect.Bool: true, + reflect.Int: true, + reflect.Int8: true, + reflect.Int16: true, + reflect.Int32: true, + reflect.Int64: true, + reflect.Uint: true, + reflect.Uint8: true, + reflect.Uint16: true, + reflect.Uint32: true, + reflect.Uint64: true, + reflect.Uintptr: true, + reflect.Float32: true, + reflect.Float64: true, + reflect.Complex64: true, + reflect.Complex128: true, + // reflect.Array + // reflect.Chan + // reflect.Func: true, + // reflect.Interface + // reflect.Map + // reflect.Ptr + // reflect.Slice + reflect.String: true, + // reflect.Struct + // reflect.UnsafePointer +} + +// Selfer defines methods by which a value can encode or decode itself. +// +// Any type which implements Selfer will be able to encode or decode itself. +// Consequently, during (en|de)code, this takes precedence over +// (text|binary)(M|Unm)arshal or extension support. +// +// By definition, it is not allowed for a Selfer to directly call Encode or Decode on itself. +// If that is done, Encode/Decode will rightfully fail with a Stack Overflow style error. +// For example, the snippet below will cause such an error. +// type testSelferRecur struct{} +// func (s *testSelferRecur) CodecEncodeSelf(e *Encoder) { e.MustEncode(s) } +// func (s *testSelferRecur) CodecDecodeSelf(d *Decoder) { d.MustDecode(s) } +// +// Note: *the first set of bytes of any value MUST NOT represent nil in the format*. +// This is because, during each decode, we first check the the next set of bytes +// represent nil, and if so, we just set the value to nil. +type Selfer interface { + CodecEncodeSelf(*Encoder) + CodecDecodeSelf(*Decoder) } -type binaryMarshaler interface { - MarshalBinary() (data []byte, err error) +// MissingFielder defines the interface allowing structs to internally decode or encode +// values which do not map to struct fields. +// +// We expect that this interface is bound to a pointer type (so the mutation function works). +// +// A use-case is if a version of a type unexports a field, but you want compatibility between +// both versions during encoding and decoding. +// +// Note that the interface is completely ignored during codecgen. +type MissingFielder interface { + // CodecMissingField is called to set a missing field and value pair. + // + // It returns true if the missing field was set on the struct. + CodecMissingField(field []byte, value interface{}) bool + + // CodecMissingFields returns the set of fields which are not struct fields + CodecMissingFields() map[string]interface{} } -// MapBySlice represents a slice which should be encoded as a map in the stream. +// MapBySlice is a tag interface that denotes wrapped slice should encode as a map in the stream. // The slice contains a sequence of key-value pairs. +// This affords storing a map in a specific sequence in the stream. +// +// Example usage: +// type T1 []string // or []int or []Point or any other "slice" type +// func (_ T1) MapBySlice{} // T1 now implements MapBySlice, and will be encoded as a map +// type T2 struct { KeyValues T1 } +// +// var kvs = []string{"one", "1", "two", "2", "three", "3"} +// var v2 = T2{ KeyValues: T1(kvs) } +// // v2 will be encoded like the map: {"KeyValues": {"one": "1", "two": "2", "three": "3"} } +// +// The support of MapBySlice affords the following: +// - A slice type which implements MapBySlice will be encoded as a map +// - A slice can be decoded from a map in the stream +// - It MUST be a slice type (not a pointer receiver) that implements MapBySlice type MapBySlice interface { MapBySlice() } -// WARNING: DO NOT USE DIRECTLY. EXPORTED FOR GODOC BENEFIT. WILL BE REMOVED. -// // BasicHandle encapsulates the common options and extension functions. +// +// Deprecated: DO NOT USE DIRECTLY. EXPORTED FOR GODOC BENEFIT. WILL BE REMOVED. type BasicHandle struct { + // BasicHandle is always a part of a different type. + // It doesn't have to fit into it own cache lines. + + // TypeInfos is used to get the type info for any type. + // + // If not configured, the default TypeInfos is used, which uses struct tag keys: codec, json + TypeInfos *TypeInfos + + // Note: BasicHandle is not comparable, due to these slices here (extHandle, intf2impls). + // If *[]T is used instead, this becomes comparable, at the cost of extra indirection. + // Thses slices are used all the time, so keep as slices (not pointers). + extHandle - EncodeOptions + + intf2impls + + inited uint32 + _ uint32 // padding + + // ---- cache line + + RPCOptions + + // TimeNotBuiltin configures whether time.Time should be treated as a builtin type. + // + // All Handlers should know how to encode/decode time.Time as part of the core + // format specification, or as a standard extension defined by the format. + // + // However, users can elect to handle time.Time as a custom extension, or via the + // standard library's encoding.Binary(M|Unm)arshaler or Text(M|Unm)arshaler interface. + // To elect this behavior, users can set TimeNotBuiltin=true. + // Note: Setting TimeNotBuiltin=true can be used to enable the legacy behavior + // (for Cbor and Msgpack), where time.Time was not a builtin supported type. + TimeNotBuiltin bool + + // ExplicitRelease configures whether Release() is implicitly called after an encode or + // decode call. + // + // If you will hold onto an Encoder or Decoder for re-use, by calling Reset(...) + // on it or calling (Must)Encode repeatedly into a given []byte or io.Writer, + // then you do not want it to be implicitly closed after each Encode/Decode call. + // Doing so will unnecessarily return resources to the shared pool, only for you to + // grab them right after again to do another Encode/Decode call. + // + // Instead, you configure ExplicitRelease=true, and you explicitly call Release() when + // you are truly done. + // + // As an alternative, you can explicitly set a finalizer - so its resources + // are returned to the shared pool before it is garbage-collected. Do it as below: + // runtime.SetFinalizer(e, (*Encoder).Release) + // runtime.SetFinalizer(d, (*Decoder).Release) + ExplicitRelease bool + + be bool // is handle a binary encoding? + js bool // is handle javascript handler? + n byte // first letter of handle name + _ uint16 // padding + + // ---- cache line + DecodeOptions + + // ---- cache line + + EncodeOptions + + // noBuiltInTypeChecker + + rtidFns atomicRtidFnSlice + mu sync.Mutex + // r []uintptr // rtids mapped to s above +} + +// basicHandle returns an initialized BasicHandle from the Handle. +func basicHandle(hh Handle) (x *BasicHandle) { + x = hh.getBasicHandle() + if atomic.CompareAndSwapUint32(&x.inited, 0, 1) { + x.be = hh.isBinary() + _, x.js = hh.(*JsonHandle) + x.n = hh.Name()[0] + } + return +} + +func (x *BasicHandle) getBasicHandle() *BasicHandle { + return x +} + +func (x *BasicHandle) getTypeInfo(rtid uintptr, rt reflect.Type) (pti *typeInfo) { + if x.TypeInfos == nil { + return defTypeInfos.get(rtid, rt) + } + return x.TypeInfos.get(rtid, rt) +} + +func findFn(s []codecRtidFn, rtid uintptr) (i uint, fn *codecFn) { + // binary search. adapted from sort/search.go. + // Note: we use goto (instead of for loop) so this can be inlined. + + // h, i, j := 0, 0, len(s) + var h uint // var h, i uint + var j = uint(len(s)) +LOOP: + if i < j { + h = i + (j-i)/2 + if s[h].rtid < rtid { + i = h + 1 + } else { + j = h + } + goto LOOP + } + if i < uint(len(s)) && s[i].rtid == rtid { + fn = s[i].fn + } + return +} + +func (x *BasicHandle) fn(rt reflect.Type, checkFastpath, checkCodecSelfer bool) (fn *codecFn) { + rtid := rt2id(rt) + sp := x.rtidFns.load() + if sp != nil { + if _, fn = findFn(sp, rtid); fn != nil { + // xdebugf("<<<< %c: found fn for %v in rtidfns of size: %v", c.n, rt, len(sp)) + return + } + } + c := x + // xdebugf("#### for %c: load fn for %v in rtidfns of size: %v", c.n, rt, len(sp)) + fn = new(codecFn) + fi := &(fn.i) + ti := c.getTypeInfo(rtid, rt) + fi.ti = ti + + rk := reflect.Kind(ti.kind) + + if checkCodecSelfer && (ti.cs || ti.csp) { + fn.fe = (*Encoder).selferMarshal + fn.fd = (*Decoder).selferUnmarshal + fi.addrF = true + fi.addrD = ti.csp + fi.addrE = ti.csp + } else if rtid == timeTypId && !c.TimeNotBuiltin { + fn.fe = (*Encoder).kTime + fn.fd = (*Decoder).kTime + } else if rtid == rawTypId { + fn.fe = (*Encoder).raw + fn.fd = (*Decoder).raw + } else if rtid == rawExtTypId { + fn.fe = (*Encoder).rawExt + fn.fd = (*Decoder).rawExt + fi.addrF = true + fi.addrD = true + fi.addrE = true + } else if xfFn := c.getExt(rtid); xfFn != nil { + fi.xfTag, fi.xfFn = xfFn.tag, xfFn.ext + fn.fe = (*Encoder).ext + fn.fd = (*Decoder).ext + fi.addrF = true + fi.addrD = true + if rk == reflect.Struct || rk == reflect.Array { + fi.addrE = true + } + } else if supportMarshalInterfaces && c.be && (ti.bm || ti.bmp) && (ti.bu || ti.bup) { + fn.fe = (*Encoder).binaryMarshal + fn.fd = (*Decoder).binaryUnmarshal + fi.addrF = true + fi.addrD = ti.bup + fi.addrE = ti.bmp + } else if supportMarshalInterfaces && !c.be && c.js && (ti.jm || ti.jmp) && (ti.ju || ti.jup) { + //If JSON, we should check JSONMarshal before textMarshal + fn.fe = (*Encoder).jsonMarshal + fn.fd = (*Decoder).jsonUnmarshal + fi.addrF = true + fi.addrD = ti.jup + fi.addrE = ti.jmp + } else if supportMarshalInterfaces && !c.be && (ti.tm || ti.tmp) && (ti.tu || ti.tup) { + fn.fe = (*Encoder).textMarshal + fn.fd = (*Decoder).textUnmarshal + fi.addrF = true + fi.addrD = ti.tup + fi.addrE = ti.tmp + } else { + if fastpathEnabled && checkFastpath && (rk == reflect.Map || rk == reflect.Slice) { + if ti.pkgpath == "" { // un-named slice or map + if idx := fastpathAV.index(rtid); idx != -1 { + fn.fe = fastpathAV[idx].encfn + fn.fd = fastpathAV[idx].decfn + fi.addrD = true + fi.addrF = false + } + } else { + // use mapping for underlying type if there + var rtu reflect.Type + if rk == reflect.Map { + rtu = reflect.MapOf(ti.key, ti.elem) + } else { + rtu = reflect.SliceOf(ti.elem) + } + rtuid := rt2id(rtu) + if idx := fastpathAV.index(rtuid); idx != -1 { + xfnf := fastpathAV[idx].encfn + xrt := fastpathAV[idx].rt + fn.fe = func(e *Encoder, xf *codecFnInfo, xrv reflect.Value) { + xfnf(e, xf, xrv.Convert(xrt)) + } + fi.addrD = true + fi.addrF = false // meaning it can be an address(ptr) or a value + xfnf2 := fastpathAV[idx].decfn + fn.fd = func(d *Decoder, xf *codecFnInfo, xrv reflect.Value) { + if xrv.Kind() == reflect.Ptr { + xfnf2(d, xf, xrv.Convert(reflect.PtrTo(xrt))) + } else { + xfnf2(d, xf, xrv.Convert(xrt)) + } + } + } + } + } + if fn.fe == nil && fn.fd == nil { + switch rk { + case reflect.Bool: + fn.fe = (*Encoder).kBool + fn.fd = (*Decoder).kBool + case reflect.String: + fn.fe = (*Encoder).kString + fn.fd = (*Decoder).kString + case reflect.Int: + fn.fd = (*Decoder).kInt + fn.fe = (*Encoder).kInt + case reflect.Int8: + fn.fe = (*Encoder).kInt8 + fn.fd = (*Decoder).kInt8 + case reflect.Int16: + fn.fe = (*Encoder).kInt16 + fn.fd = (*Decoder).kInt16 + case reflect.Int32: + fn.fe = (*Encoder).kInt32 + fn.fd = (*Decoder).kInt32 + case reflect.Int64: + fn.fe = (*Encoder).kInt64 + fn.fd = (*Decoder).kInt64 + case reflect.Uint: + fn.fd = (*Decoder).kUint + fn.fe = (*Encoder).kUint + case reflect.Uint8: + fn.fe = (*Encoder).kUint8 + fn.fd = (*Decoder).kUint8 + case reflect.Uint16: + fn.fe = (*Encoder).kUint16 + fn.fd = (*Decoder).kUint16 + case reflect.Uint32: + fn.fe = (*Encoder).kUint32 + fn.fd = (*Decoder).kUint32 + case reflect.Uint64: + fn.fe = (*Encoder).kUint64 + fn.fd = (*Decoder).kUint64 + case reflect.Uintptr: + fn.fe = (*Encoder).kUintptr + fn.fd = (*Decoder).kUintptr + case reflect.Float32: + fn.fe = (*Encoder).kFloat32 + fn.fd = (*Decoder).kFloat32 + case reflect.Float64: + fn.fe = (*Encoder).kFloat64 + fn.fd = (*Decoder).kFloat64 + case reflect.Invalid: + fn.fe = (*Encoder).kInvalid + fn.fd = (*Decoder).kErr + case reflect.Chan: + fi.seq = seqTypeChan + fn.fe = (*Encoder).kSlice + fn.fd = (*Decoder).kSlice + case reflect.Slice: + fi.seq = seqTypeSlice + fn.fe = (*Encoder).kSlice + fn.fd = (*Decoder).kSlice + case reflect.Array: + fi.seq = seqTypeArray + fn.fe = (*Encoder).kSlice + fi.addrF = false + fi.addrD = false + rt2 := reflect.SliceOf(ti.elem) + fn.fd = func(d *Decoder, xf *codecFnInfo, xrv reflect.Value) { + d.h.fn(rt2, true, false).fd(d, xf, xrv.Slice(0, xrv.Len())) + } + // fn.fd = (*Decoder).kArray + case reflect.Struct: + if ti.anyOmitEmpty || ti.mf || ti.mfp { + fn.fe = (*Encoder).kStruct + } else { + fn.fe = (*Encoder).kStructNoOmitempty + } + fn.fd = (*Decoder).kStruct + case reflect.Map: + fn.fe = (*Encoder).kMap + fn.fd = (*Decoder).kMap + case reflect.Interface: + // encode: reflect.Interface are handled already by preEncodeValue + fn.fd = (*Decoder).kInterface + fn.fe = (*Encoder).kErr + default: + // reflect.Ptr and reflect.Interface are handled already by preEncodeValue + fn.fe = (*Encoder).kErr + fn.fd = (*Decoder).kErr + } + } + } + + c.mu.Lock() + var sp2 []codecRtidFn + sp = c.rtidFns.load() + if sp == nil { + sp2 = []codecRtidFn{{rtid, fn}} + c.rtidFns.store(sp2) + // xdebugf(">>>> adding rt: %v to rtidfns of size: %v", rt, len(sp2)) + // xdebugf(">>>> loading stored rtidfns of size: %v", len(c.rtidFns.load())) + } else { + idx, fn2 := findFn(sp, rtid) + if fn2 == nil { + sp2 = make([]codecRtidFn, len(sp)+1) + copy(sp2, sp[:idx]) + copy(sp2[idx+1:], sp[idx:]) + sp2[idx] = codecRtidFn{rtid, fn} + c.rtidFns.store(sp2) + // xdebugf(">>>> adding rt: %v to rtidfns of size: %v", rt, len(sp2)) + + } + } + c.mu.Unlock() + return } -// Handle is the interface for a specific encoding format. +// Handle defines a specific encoding format. It also stores any runtime state +// used during an Encoding or Decoding session e.g. stored state about Types, etc. +// +// Once a handle is configured, it can be shared across multiple Encoders and Decoders. // -// Typically, a Handle is pre-configured before first time use, -// and not modified while in use. Such a pre-configured Handle -// is safe for concurrent access. +// Note that a Handle is NOT safe for concurrent modification. +// Consequently, do not modify it after it is configured if shared among +// multiple Encoders and Decoders in different goroutines. +// +// Consequently, the typical usage model is that a Handle is pre-configured +// before first time use, and not modified while in use. +// Such a pre-configured Handle is safe for concurrent access. type Handle interface { - writeExt() bool + Name() string + // return the basic handle. It may not have been inited. + // Prefer to use basicHandle() helper function that ensures it has been inited. getBasicHandle() *BasicHandle - newEncDriver(w encWriter) encDriver - newDecDriver(r decReader) decDriver + recreateEncDriver(encDriver) bool + newEncDriver(w *Encoder) encDriver + newDecDriver(r *Decoder) decDriver + isBinary() bool + hasElemSeparators() bool + // IsBuiltinType(rtid uintptr) bool } +// Raw represents raw formatted bytes. +// We "blindly" store it during encode and retrieve the raw bytes during decode. +// Note: it is dangerous during encode, so we may gate the behaviour +// behind an Encode flag which must be explicitly set. +type Raw []byte + // RawExt represents raw unprocessed extension data. +// Some codecs will decode extension data as a *RawExt +// if there is no registered extension for the tag. +// +// Only one of Data or Value is nil. +// If Data is nil, then the content of the RawExt is in the Value. type RawExt struct { - Tag byte + Tag uint64 + // Data is the []byte which represents the raw ext. If nil, ext is exposed in Value. + // Data is used by codecs (e.g. binc, msgpack, simple) which do custom serialization of types Data []byte + // Value represents the extension, if Data is nil. + // Value is used by codecs (e.g. cbor, json) which leverage the format to do + // custom serialization of the types. + Value interface{} } -type extTypeTagFn struct { - rtid uintptr - rt reflect.Type - tag byte - encFn func(reflect.Value) ([]byte, error) - decFn func(reflect.Value, []byte) error -} +// BytesExt handles custom (de)serialization of types to/from []byte. +// It is used by codecs (e.g. binc, msgpack, simple) which do custom serialization of the types. +type BytesExt interface { + // WriteExt converts a value to a []byte. + // + // Note: v is a pointer iff the registered extension type is a struct or array kind. + WriteExt(v interface{}) []byte -type extHandle []*extTypeTagFn + // ReadExt updates a value from a []byte. + // + // Note: dst is always a pointer kind to the registered extension type. + ReadExt(dst interface{}, src []byte) +} -// AddExt registers an encode and decode function for a reflect.Type. -// Note that the type must be a named type, and specifically not -// a pointer or Interface. An error is returned if that is not honored. +// InterfaceExt handles custom (de)serialization of types to/from another interface{} value. +// The Encoder or Decoder will then handle the further (de)serialization of that known type. // -// To Deregister an ext, call AddExt with 0 tag, nil encfn and nil decfn. -func (o *extHandle) AddExt( - rt reflect.Type, - tag byte, - encfn func(reflect.Value) ([]byte, error), - decfn func(reflect.Value, []byte) error, -) (err error) { - // o is a pointer, because we may need to initialize it - if rt.PkgPath() == "" || rt.Kind() == reflect.Interface { - err = fmt.Errorf("codec.Handle.AddExt: Takes named type, especially not a pointer or interface: %T", - reflect.Zero(rt).Interface()) - return - } +// It is used by codecs (e.g. cbor, json) which use the format to do custom serialization of types. +type InterfaceExt interface { + // ConvertExt converts a value into a simpler interface for easy encoding + // e.g. convert time.Time to int64. + // + // Note: v is a pointer iff the registered extension type is a struct or array kind. + ConvertExt(v interface{}) interface{} - // o cannot be nil, since it is always embedded in a Handle. - // if nil, let it panic. - // if o == nil { - // err = errors.New("codec.Handle.AddExt: extHandle cannot be a nil pointer.") - // return - // } + // UpdateExt updates a value from a simpler interface for easy decoding + // e.g. convert int64 to time.Time. + // + // Note: dst is always a pointer kind to the registered extension type. + UpdateExt(dst interface{}, src interface{}) +} - rtid := reflect.ValueOf(rt).Pointer() - for _, v := range *o { - if v.rtid == rtid { - v.tag, v.encFn, v.decFn = tag, encfn, decfn - return - } - } +// Ext handles custom (de)serialization of custom types / extensions. +type Ext interface { + BytesExt + InterfaceExt +} - *o = append(*o, &extTypeTagFn{rtid, rt, tag, encfn, decfn}) - return +// addExtWrapper is a wrapper implementation to support former AddExt exported method. +type addExtWrapper struct { + encFn func(reflect.Value) ([]byte, error) + decFn func(reflect.Value, []byte) error } -func (o extHandle) getExt(rtid uintptr) *extTypeTagFn { - for _, v := range o { - if v.rtid == rtid { - return v - } +func (x addExtWrapper) WriteExt(v interface{}) []byte { + bs, err := x.encFn(reflect.ValueOf(v)) + if err != nil { + panic(err) } - return nil + return bs } -func (o extHandle) getExtForTag(tag byte) *extTypeTagFn { - for _, v := range o { - if v.tag == tag { - return v - } +func (x addExtWrapper) ReadExt(v interface{}, bs []byte) { + if err := x.decFn(reflect.ValueOf(v), bs); err != nil { + panic(err) } - return nil } -func (o extHandle) getDecodeExtForTag(tag byte) ( - rv reflect.Value, fn func(reflect.Value, []byte) error) { - if x := o.getExtForTag(tag); x != nil { - // ext is only registered for base - rv = reflect.New(x.rt).Elem() - fn = x.decFn - } - return +func (x addExtWrapper) ConvertExt(v interface{}) interface{} { + return x.WriteExt(v) } -func (o extHandle) getDecodeExt(rtid uintptr) (tag byte, fn func(reflect.Value, []byte) error) { - if x := o.getExt(rtid); x != nil { - tag = x.tag - fn = x.decFn - } - return +func (x addExtWrapper) UpdateExt(dest interface{}, v interface{}) { + x.ReadExt(dest, v.([]byte)) } -func (o extHandle) getEncodeExt(rtid uintptr) (tag byte, fn func(reflect.Value) ([]byte, error)) { - if x := o.getExt(rtid); x != nil { - tag = x.tag - fn = x.encFn - } - return +type extWrapper struct { + BytesExt + InterfaceExt } -type structFieldInfo struct { - encName string // encode name +type bytesExtFailer struct{} - // only one of 'i' or 'is' can be set. If 'i' is -1, then 'is' has been set. +func (bytesExtFailer) WriteExt(v interface{}) []byte { + panicv.errorstr("BytesExt.WriteExt is not supported") + return nil +} +func (bytesExtFailer) ReadExt(v interface{}, bs []byte) { + panicv.errorstr("BytesExt.ReadExt is not supported") +} - is []int // (recursive/embedded) field index in struct - i int16 // field index in struct - omitEmpty bool - toArray bool // if field is _struct, is the toArray set? +type interfaceExtFailer struct{} - // tag string // tag - // name string // field name - // encNameBs []byte // encoded name as byte stream - // ikind int // kind of the field as an int i.e. int(reflect.Kind) +func (interfaceExtFailer) ConvertExt(v interface{}) interface{} { + panicv.errorstr("InterfaceExt.ConvertExt is not supported") + return nil +} +func (interfaceExtFailer) UpdateExt(dest interface{}, v interface{}) { + panicv.errorstr("InterfaceExt.UpdateExt is not supported") } -func parseStructFieldInfo(fname string, stag string) *structFieldInfo { - if fname == "" { - panic("parseStructFieldInfo: No Field Name") - } - si := structFieldInfo{ - // name: fname, - encName: fname, - // tag: stag, - } +type binaryEncodingType struct{} - if stag != "" { - for i, s := range strings.Split(stag, ",") { - if i == 0 { - if s != "" { - si.encName = s - } - } else { - switch s { - case "omitempty": - si.omitEmpty = true - case "toarray": - si.toArray = true - } - } - } - } - // si.encNameBs = []byte(si.encName) - return &si -} +func (binaryEncodingType) isBinary() bool { return true } -type sfiSortedByEncName []*structFieldInfo +type textEncodingType struct{} + +func (textEncodingType) isBinary() bool { return false } + +// noBuiltInTypes is embedded into many types which do not support builtins +// e.g. msgpack, simple, cbor. + +// type noBuiltInTypeChecker struct{} +// func (noBuiltInTypeChecker) IsBuiltinType(rt uintptr) bool { return false } +// type noBuiltInTypes struct{ noBuiltInTypeChecker } -func (p sfiSortedByEncName) Len() int { - return len(p) +type noBuiltInTypes struct{} + +func (noBuiltInTypes) EncodeBuiltin(rt uintptr, v interface{}) {} +func (noBuiltInTypes) DecodeBuiltin(rt uintptr, v interface{}) {} + +// type noStreamingCodec struct{} +// func (noStreamingCodec) CheckBreak() bool { return false } +// func (noStreamingCodec) hasElemSeparators() bool { return false } + +type noElemSeparators struct{} + +func (noElemSeparators) hasElemSeparators() (v bool) { return } +func (noElemSeparators) recreateEncDriver(e encDriver) (v bool) { return } + +// bigenHelper. +// Users must already slice the x completely, because we will not reslice. +type bigenHelper struct { + x []byte // must be correctly sliced to appropriate len. slicing is a cost. + w *encWriterSwitch } -func (p sfiSortedByEncName) Less(i, j int) bool { - return p[i].encName < p[j].encName +func (z bigenHelper) writeUint16(v uint16) { + bigen.PutUint16(z.x, v) + z.w.writeb(z.x) } -func (p sfiSortedByEncName) Swap(i, j int) { - p[i], p[j] = p[j], p[i] +func (z bigenHelper) writeUint32(v uint32) { + bigen.PutUint32(z.x, v) + z.w.writeb(z.x) } -// typeInfo keeps information about each type referenced in the encode/decode sequence. -// -// During an encode/decode sequence, we work as below: -// - If base is a built in type, en/decode base value -// - If base is registered as an extension, en/decode base value -// - If type is binary(M/Unm)arshaler, call Binary(M/Unm)arshal method -// - Else decode appropriately based on the reflect.Kind -type typeInfo struct { - sfi []*structFieldInfo // sorted. Used when enc/dec struct to map. - sfip []*structFieldInfo // unsorted. Used when enc/dec struct to array. +func (z bigenHelper) writeUint64(v uint64) { + bigen.PutUint64(z.x, v) + z.w.writeb(z.x) +} - rt reflect.Type - rtid uintptr +type extTypeTagFn struct { + rtid uintptr + rtidptr uintptr + rt reflect.Type + tag uint64 + ext Ext + _ [1]uint64 // padding +} - // baseId gives pointer to the base reflect.Type, after deferencing - // the pointers. E.g. base type of ***time.Time is time.Time. - base reflect.Type - baseId uintptr - baseIndir int8 // number of indirections to get to base - - mbs bool // base type (T or *T) is a MapBySlice - - m bool // base type (T or *T) is a binaryMarshaler - unm bool // base type (T or *T) is a binaryUnmarshaler - mIndir int8 // number of indirections to get to binaryMarshaler type - unmIndir int8 // number of indirections to get to binaryUnmarshaler type - toArray bool // whether this (struct) type should be encoded as an array -} - -func (ti *typeInfo) indexForEncName(name string) int { - //tisfi := ti.sfi - const binarySearchThreshold = 16 - if sfilen := len(ti.sfi); sfilen < binarySearchThreshold { - // linear search. faster than binary search in my testing up to 16-field structs. - for i, si := range ti.sfi { - if si.encName == name { - return i - } - } - } else { - // binary search. adapted from sort/search.go. - h, i, j := 0, 0, sfilen - for i < j { - h = i + (j-i)/2 - if ti.sfi[h].encName < name { - i = h + 1 - } else { - j = h - } - } - if i < sfilen && ti.sfi[i].encName == name { - return i - } +type extHandle []extTypeTagFn + +// AddExt registes an encode and decode function for a reflect.Type. +// To deregister an Ext, call AddExt with nil encfn and/or nil decfn. +// +// Deprecated: Use SetBytesExt or SetInterfaceExt on the Handle instead. +func (o *extHandle) AddExt(rt reflect.Type, tag byte, + encfn func(reflect.Value) ([]byte, error), + decfn func(reflect.Value, []byte) error) (err error) { + if encfn == nil || decfn == nil { + return o.SetExt(rt, uint64(tag), nil) } - return -1 + return o.SetExt(rt, uint64(tag), addExtWrapper{encfn, decfn}) } -func getTypeInfo(rtid uintptr, rt reflect.Type) (pti *typeInfo) { - var ok bool - cachedTypeInfoMutex.RLock() - pti, ok = cachedTypeInfo[rtid] - cachedTypeInfoMutex.RUnlock() - if ok { - return +// SetExt will set the extension for a tag and reflect.Type. +// Note that the type must be a named type, and specifically not a pointer or Interface. +// An error is returned if that is not honored. +// To Deregister an ext, call SetExt with nil Ext. +// +// Deprecated: Use SetBytesExt or SetInterfaceExt on the Handle instead. +func (o *extHandle) SetExt(rt reflect.Type, tag uint64, ext Ext) (err error) { + // o is a pointer, because we may need to initialize it + rk := rt.Kind() + for rk == reflect.Ptr { + rt = rt.Elem() + rk = rt.Kind() } - cachedTypeInfoMutex.Lock() - defer cachedTypeInfoMutex.Unlock() - if pti, ok = cachedTypeInfo[rtid]; ok { - return + if rt.PkgPath() == "" || rk == reflect.Interface { // || rk == reflect.Ptr { + return fmt.Errorf("codec.Handle.SetExt: Takes named type, not a pointer or interface: %v", rt) } - ti := typeInfo{rt: rt, rtid: rtid} - pti = &ti - - var indir int8 - if ok, indir = implementsIntf(rt, binaryMarshalerTyp); ok { - ti.m, ti.mIndir = true, indir - } - if ok, indir = implementsIntf(rt, binaryUnmarshalerTyp); ok { - ti.unm, ti.unmIndir = true, indir + rtid := rt2id(rt) + switch rtid { + case timeTypId, rawTypId, rawExtTypId: + // all natively supported type, so cannot have an extension + return // TODO: should we silently ignore, or return an error??? } - if ok, _ = implementsIntf(rt, mapBySliceTyp); ok { - ti.mbs = true + // if o == nil { + // return errors.New("codec.Handle.SetExt: extHandle not initialized") + // } + o2 := *o + // if o2 == nil { + // return errors.New("codec.Handle.SetExt: extHandle not initialized") + // } + for i := range o2 { + v := &o2[i] + if v.rtid == rtid { + v.tag, v.ext = tag, ext + return + } + } + rtidptr := rt2id(reflect.PtrTo(rt)) + *o = append(o2, extTypeTagFn{rtid, rtidptr, rt, tag, ext, [1]uint64{}}) + return +} + +func (o extHandle) getExt(rtid uintptr) (v *extTypeTagFn) { + for i := range o { + v = &o[i] + if v.rtid == rtid || v.rtidptr == rtid { + return + } + } + return nil +} + +func (o extHandle) getExtForTag(tag uint64) (v *extTypeTagFn) { + for i := range o { + v = &o[i] + if v.tag == tag { + return + } + } + return nil +} + +type intf2impl struct { + rtid uintptr // for intf + impl reflect.Type + // _ [1]uint64 // padding // not-needed, as *intf2impl is never returned. +} + +type intf2impls []intf2impl + +// Intf2Impl maps an interface to an implementing type. +// This allows us support infering the concrete type +// and populating it when passed an interface. +// e.g. var v io.Reader can be decoded as a bytes.Buffer, etc. +// +// Passing a nil impl will clear the mapping. +func (o *intf2impls) Intf2Impl(intf, impl reflect.Type) (err error) { + if impl != nil && !impl.Implements(intf) { + return fmt.Errorf("Intf2Impl: %v does not implement %v", impl, intf) + } + rtid := rt2id(intf) + o2 := *o + for i := range o2 { + v := &o2[i] + if v.rtid == rtid { + v.impl = impl + return + } + } + *o = append(o2, intf2impl{rtid, impl}) + return +} + +func (o intf2impls) intf2impl(rtid uintptr) (rv reflect.Value) { + for i := range o { + v := &o[i] + if v.rtid == rtid { + if v.impl == nil { + return + } + if v.impl.Kind() == reflect.Ptr { + return reflect.New(v.impl.Elem()) + } + return reflect.New(v.impl).Elem() + } + } + return +} + +type structFieldInfoFlag uint8 + +const ( + _ structFieldInfoFlag = 1 << iota + structFieldInfoFlagReady + structFieldInfoFlagOmitEmpty +) + +func (x *structFieldInfoFlag) flagSet(f structFieldInfoFlag) { + *x = *x | f +} + +func (x *structFieldInfoFlag) flagClr(f structFieldInfoFlag) { + *x = *x &^ f +} + +func (x structFieldInfoFlag) flagGet(f structFieldInfoFlag) bool { + return x&f != 0 +} + +func (x structFieldInfoFlag) omitEmpty() bool { + return x.flagGet(structFieldInfoFlagOmitEmpty) +} + +func (x structFieldInfoFlag) ready() bool { + return x.flagGet(structFieldInfoFlagReady) +} + +type structFieldInfo struct { + encName string // encode name + fieldName string // field name + + is [maxLevelsEmbedding]uint16 // (recursive/embedded) field index in struct + nis uint8 // num levels of embedding. if 1, then it's not embedded. + + encNameAsciiAlphaNum bool // the encName only contains ascii alphabet and numbers + structFieldInfoFlag + _ [1]byte // padding +} + +func (si *structFieldInfo) setToZeroValue(v reflect.Value) { + if v, valid := si.field(v, false); valid { + v.Set(reflect.Zero(v.Type())) + } +} + +// rv returns the field of the struct. +// If anonymous, it returns an Invalid +func (si *structFieldInfo) field(v reflect.Value, update bool) (rv2 reflect.Value, valid bool) { + // replicate FieldByIndex + for i, x := range si.is { + if uint8(i) == si.nis { + break + } + if v, valid = baseStructRv(v, update); !valid { + return + } + v = v.Field(int(x)) + } + + return v, true +} + +// func (si *structFieldInfo) fieldval(v reflect.Value, update bool) reflect.Value { +// v, _ = si.field(v, update) +// return v +// } + +func parseStructInfo(stag string) (toArray, omitEmpty bool, keytype valueType) { + keytype = valueTypeString // default + if stag == "" { + return + } + for i, s := range strings.Split(stag, ",") { + if i == 0 { + } else { + switch s { + case "omitempty": + omitEmpty = true + case "toarray": + toArray = true + case "int": + keytype = valueTypeInt + case "uint": + keytype = valueTypeUint + case "float": + keytype = valueTypeFloat + // case "bool": + // keytype = valueTypeBool + case "string": + keytype = valueTypeString + } + } + } + return +} + +func (si *structFieldInfo) parseTag(stag string) { + // if fname == "" { + // panic(errNoFieldNameToStructFieldInfo) + // } + + if stag == "" { + return + } + for i, s := range strings.Split(stag, ",") { + if i == 0 { + if s != "" { + si.encName = s + } + } else { + switch s { + case "omitempty": + si.flagSet(structFieldInfoFlagOmitEmpty) + // si.omitEmpty = true + // case "toarray": + // si.toArray = true + } + } + } +} + +type sfiSortedByEncName []*structFieldInfo + +func (p sfiSortedByEncName) Len() int { return len(p) } +func (p sfiSortedByEncName) Less(i, j int) bool { return p[uint(i)].encName < p[uint(j)].encName } +func (p sfiSortedByEncName) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] } + +const structFieldNodeNumToCache = 4 + +type structFieldNodeCache struct { + rv [structFieldNodeNumToCache]reflect.Value + idx [structFieldNodeNumToCache]uint32 + num uint8 +} + +func (x *structFieldNodeCache) get(key uint32) (fv reflect.Value, valid bool) { + for i, k := range &x.idx { + if uint8(i) == x.num { + return // break + } + if key == k { + return x.rv[i], true + } + } + return +} + +func (x *structFieldNodeCache) tryAdd(fv reflect.Value, key uint32) { + if x.num < structFieldNodeNumToCache { + x.rv[x.num] = fv + x.idx[x.num] = key + x.num++ + return + } +} + +type structFieldNode struct { + v reflect.Value + cache2 structFieldNodeCache + cache3 structFieldNodeCache + update bool +} + +func (x *structFieldNode) field(si *structFieldInfo) (fv reflect.Value) { + // return si.fieldval(x.v, x.update) + // Note: we only cache if nis=2 or nis=3 i.e. up to 2 levels of embedding + // This mostly saves us time on the repeated calls to v.Elem, v.Field, etc. + var valid bool + switch si.nis { + case 1: + fv = x.v.Field(int(si.is[0])) + case 2: + if fv, valid = x.cache2.get(uint32(si.is[0])); valid { + fv = fv.Field(int(si.is[1])) + return + } + fv = x.v.Field(int(si.is[0])) + if fv, valid = baseStructRv(fv, x.update); !valid { + return + } + x.cache2.tryAdd(fv, uint32(si.is[0])) + fv = fv.Field(int(si.is[1])) + case 3: + var key uint32 = uint32(si.is[0])<<16 | uint32(si.is[1]) + if fv, valid = x.cache3.get(key); valid { + fv = fv.Field(int(si.is[2])) + return + } + fv = x.v.Field(int(si.is[0])) + if fv, valid = baseStructRv(fv, x.update); !valid { + return + } + fv = fv.Field(int(si.is[1])) + if fv, valid = baseStructRv(fv, x.update); !valid { + return + } + x.cache3.tryAdd(fv, key) + fv = fv.Field(int(si.is[2])) + default: + fv, _ = si.field(x.v, x.update) } + return +} - pt := rt - var ptIndir int8 - // for ; pt.Kind() == reflect.Ptr; pt, ptIndir = pt.Elem(), ptIndir+1 { } - for pt.Kind() == reflect.Ptr { - pt = pt.Elem() - ptIndir++ +func baseStructRv(v reflect.Value, update bool) (v2 reflect.Value, valid bool) { + for v.Kind() == reflect.Ptr { + if v.IsNil() { + if !update { + return + } + v.Set(reflect.New(v.Type().Elem())) + } + v = v.Elem() } - if ptIndir == 0 { - ti.base = rt - ti.baseId = rtid + return v, true +} + +type typeInfoFlag uint8 + +const ( + typeInfoFlagComparable = 1 << iota + typeInfoFlagIsZeroer + typeInfoFlagIsZeroerPtr +) + +// typeInfo keeps information about each (non-ptr) type referenced in the encode/decode sequence. +// +// During an encode/decode sequence, we work as below: +// - If base is a built in type, en/decode base value +// - If base is registered as an extension, en/decode base value +// - If type is binary(M/Unm)arshaler, call Binary(M/Unm)arshal method +// - If type is text(M/Unm)arshaler, call Text(M/Unm)arshal method +// - Else decode appropriately based on the reflect.Kind +type typeInfo struct { + rt reflect.Type + elem reflect.Type + pkgpath string + + rtid uintptr + // rv0 reflect.Value // saved zero value, used if immutableKind + + numMeth uint16 // number of methods + kind uint8 + chandir uint8 + + anyOmitEmpty bool // true if a struct, and any of the fields are tagged "omitempty" + toArray bool // whether this (struct) type should be encoded as an array + keyType valueType // if struct, how is the field name stored in a stream? default is string + mbs bool // base type (T or *T) is a MapBySlice + + // ---- cpu cache line boundary? + sfiSort []*structFieldInfo // sorted. Used when enc/dec struct to map. + sfiSrc []*structFieldInfo // unsorted. Used when enc/dec struct to array. + + key reflect.Type + + // ---- cpu cache line boundary? + // sfis []structFieldInfo // all sfi, in src order, as created. + sfiNamesSort []byte // all names, with indexes into the sfiSort + + // format of marshal type fields below: [btj][mu]p? OR csp? + + bm bool // T is a binaryMarshaler + bmp bool // *T is a binaryMarshaler + bu bool // T is a binaryUnmarshaler + bup bool // *T is a binaryUnmarshaler + tm bool // T is a textMarshaler + tmp bool // *T is a textMarshaler + tu bool // T is a textUnmarshaler + tup bool // *T is a textUnmarshaler + + jm bool // T is a jsonMarshaler + jmp bool // *T is a jsonMarshaler + ju bool // T is a jsonUnmarshaler + jup bool // *T is a jsonUnmarshaler + cs bool // T is a Selfer + csp bool // *T is a Selfer + mf bool // T is a MissingFielder + mfp bool // *T is a MissingFielder + + // other flags, with individual bits representing if set. + flags typeInfoFlag + infoFieldOmitempty bool + + _ [6]byte // padding + _ [2]uint64 // padding +} + +func (ti *typeInfo) isFlag(f typeInfoFlag) bool { + return ti.flags&f != 0 +} + +func (ti *typeInfo) indexForEncName(name []byte) (index int16) { + var sn []byte + if len(name)+2 <= 32 { + var buf [32]byte // should not escape to heap + sn = buf[:len(name)+2] } else { - ti.base = pt - ti.baseId = reflect.ValueOf(pt).Pointer() - ti.baseIndir = ptIndir + sn = make([]byte, len(name)+2) } + copy(sn[1:], name) + sn[0], sn[len(sn)-1] = tiSep2(name), 0xff + j := bytes.Index(ti.sfiNamesSort, sn) + if j < 0 { + return -1 + } + index = int16(uint16(ti.sfiNamesSort[j+len(sn)+1]) | uint16(ti.sfiNamesSort[j+len(sn)])<<8) + return +} - if rt.Kind() == reflect.Struct { - var siInfo *structFieldInfo - if f, ok := rt.FieldByName(structInfoFieldName); ok { - siInfo = parseStructFieldInfo(structInfoFieldName, f.Tag.Get(structTagName)) - ti.toArray = siInfo.toArray - } - sfip := make([]*structFieldInfo, 0, rt.NumField()) - rgetTypeInfo(rt, nil, make(map[string]bool), &sfip, siInfo) - - // // try to put all si close together - // const tryToPutAllStructFieldInfoTogether = true - // if tryToPutAllStructFieldInfoTogether { - // sfip2 := make([]structFieldInfo, len(sfip)) - // for i, si := range sfip { - // sfip2[i] = *si - // } - // for i := range sfip { - // sfip[i] = &sfip2[i] - // } - // } - - ti.sfip = make([]*structFieldInfo, len(sfip)) - ti.sfi = make([]*structFieldInfo, len(sfip)) - copy(ti.sfip, sfip) - sort.Sort(sfiSortedByEncName(sfip)) - copy(ti.sfi, sfip) - } - // sfi = sfip - cachedTypeInfo[rtid] = pti +type rtid2ti struct { + rtid uintptr + ti *typeInfo +} + +// TypeInfos caches typeInfo for each type on first inspection. +// +// It is configured with a set of tag keys, which are used to get +// configuration for the type. +type TypeInfos struct { + // infos: formerly map[uintptr]*typeInfo, now *[]rtid2ti, 2 words expected + infos atomicTypeInfoSlice + mu sync.Mutex + tags []string + _ [2]uint64 // padding +} + +// NewTypeInfos creates a TypeInfos given a set of struct tags keys. +// +// This allows users customize the struct tag keys which contain configuration +// of their types. +func NewTypeInfos(tags []string) *TypeInfos { + return &TypeInfos{tags: tags} +} + +func (x *TypeInfos) structTag(t reflect.StructTag) (s string) { + // check for tags: codec, json, in that order. + // this allows seamless support for many configured structs. + for _, x := range x.tags { + s = t.Get(x) + if s != "" { + return s + } + } return } -func rgetTypeInfo(rt reflect.Type, indexstack []int, fnameToHastag map[string]bool, - sfi *[]*structFieldInfo, siInfo *structFieldInfo, -) { - // for rt.Kind() == reflect.Ptr { - // // indexstack = append(indexstack, 0) - // rt = rt.Elem() +func findTypeInfo(s []rtid2ti, rtid uintptr) (i uint, ti *typeInfo) { + // binary search. adapted from sort/search.go. + // Note: we use goto (instead of for loop) so this can be inlined. + + // if sp == nil { + // return -1, nil // } - for j := 0; j < rt.NumField(); j++ { - f := rt.Field(j) - stag := f.Tag.Get(structTagName) - if stag == "-" { + // s := *sp + + // h, i, j := 0, 0, len(s) + var h uint // var h, i uint + var j = uint(len(s)) +LOOP: + if i < j { + h = i + (j-i)/2 + if s[h].rtid < rtid { + i = h + 1 + } else { + j = h + } + goto LOOP + } + if i < uint(len(s)) && s[i].rtid == rtid { + ti = s[i].ti + } + return +} + +func (x *TypeInfos) get(rtid uintptr, rt reflect.Type) (pti *typeInfo) { + sp := x.infos.load() + if sp != nil { + _, pti = findTypeInfo(sp, rtid) + if pti != nil { + return + } + } + + rk := rt.Kind() + + if rk == reflect.Ptr { // || (rk == reflect.Interface && rtid != intfTypId) { + panicv.errorf("invalid kind passed to TypeInfos.get: %v - %v", rk, rt) + } + + // do not hold lock while computing this. + // it may lead to duplication, but that's ok. + ti := typeInfo{ + rt: rt, + rtid: rtid, + kind: uint8(rk), + pkgpath: rt.PkgPath(), + keyType: valueTypeString, // default it - so it's never 0 + } + // ti.rv0 = reflect.Zero(rt) + + // ti.comparable = rt.Comparable() + ti.numMeth = uint16(rt.NumMethod()) + + ti.bm, ti.bmp = implIntf(rt, binaryMarshalerTyp) + ti.bu, ti.bup = implIntf(rt, binaryUnmarshalerTyp) + ti.tm, ti.tmp = implIntf(rt, textMarshalerTyp) + ti.tu, ti.tup = implIntf(rt, textUnmarshalerTyp) + ti.jm, ti.jmp = implIntf(rt, jsonMarshalerTyp) + ti.ju, ti.jup = implIntf(rt, jsonUnmarshalerTyp) + ti.cs, ti.csp = implIntf(rt, selferTyp) + ti.mf, ti.mfp = implIntf(rt, missingFielderTyp) + + b1, b2 := implIntf(rt, iszeroTyp) + if b1 { + ti.flags |= typeInfoFlagIsZeroer + } + if b2 { + ti.flags |= typeInfoFlagIsZeroerPtr + } + if rt.Comparable() { + ti.flags |= typeInfoFlagComparable + } + + switch rk { + case reflect.Struct: + var omitEmpty bool + if f, ok := rt.FieldByName(structInfoFieldName); ok { + ti.toArray, omitEmpty, ti.keyType = parseStructInfo(x.structTag(f.Tag)) + ti.infoFieldOmitempty = omitEmpty + } else { + ti.keyType = valueTypeString + } + pp, pi := &pool.tiload, pool.tiload.Get() // pool.tiLoad() + pv := pi.(*typeInfoLoadArray) + pv.etypes[0] = ti.rtid + // vv := typeInfoLoad{pv.fNames[:0], pv.encNames[:0], pv.etypes[:1], pv.sfis[:0]} + vv := typeInfoLoad{pv.etypes[:1], pv.sfis[:0]} + x.rget(rt, rtid, omitEmpty, nil, &vv) + // ti.sfis = vv.sfis + ti.sfiSrc, ti.sfiSort, ti.sfiNamesSort, ti.anyOmitEmpty = rgetResolveSFI(rt, vv.sfis, pv) + pp.Put(pi) + case reflect.Map: + ti.elem = rt.Elem() + ti.key = rt.Key() + case reflect.Slice: + ti.mbs, _ = implIntf(rt, mapBySliceTyp) + ti.elem = rt.Elem() + case reflect.Chan: + ti.elem = rt.Elem() + ti.chandir = uint8(rt.ChanDir()) + case reflect.Array, reflect.Ptr: + ti.elem = rt.Elem() + } + // sfi = sfiSrc + + x.mu.Lock() + sp = x.infos.load() + var sp2 []rtid2ti + if sp == nil { + pti = &ti + sp2 = []rtid2ti{{rtid, pti}} + x.infos.store(sp2) + } else { + var idx uint + idx, pti = findTypeInfo(sp, rtid) + if pti == nil { + pti = &ti + sp2 = make([]rtid2ti, len(sp)+1) + copy(sp2, sp[:idx]) + copy(sp2[idx+1:], sp[idx:]) + sp2[idx] = rtid2ti{rtid, pti} + x.infos.store(sp2) + } + } + x.mu.Unlock() + return +} + +func (x *TypeInfos) rget(rt reflect.Type, rtid uintptr, omitEmpty bool, + indexstack []uint16, pv *typeInfoLoad) { + // Read up fields and store how to access the value. + // + // It uses go's rules for message selectors, + // which say that the field with the shallowest depth is selected. + // + // Note: we consciously use slices, not a map, to simulate a set. + // Typically, types have < 16 fields, + // and iteration using equals is faster than maps there + flen := rt.NumField() + if flen > (1< %v fields are not supported - has %v fields", + (1<= 0; i-- { // bounds-check elimination + b := si.encName[i] + if (b >= '0' && b <= '9') || (b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') { + continue + } + si.encNameAsciiAlphaNum = false + break + } + si.fieldName = f.Name + si.flagSet(structFieldInfoFlagReady) + + // pv.encNames = append(pv.encNames, si.encName) + // si.ikind = int(f.Type.Kind()) - if len(indexstack) == 0 { - si.i = int16(j) - } else { - si.i = -1 - si.is = append(append(make([]int, 0, len(indexstack)+4), indexstack...), j) + if len(indexstack) > maxLevelsEmbedding-1 { + panicv.errorf("codec: only supports up to %v depth of embedding - type has %v depth", + maxLevelsEmbedding-1, len(indexstack)) + } + si.nis = uint8(len(indexstack)) + 1 + copy(si.is[:], indexstack) + si.is[len(indexstack)] = j + + if omitEmpty { + si.flagSet(structFieldInfoFlagOmitEmpty) } + pv.sfis = append(pv.sfis, si) + } +} - if siInfo != nil { - if siInfo.omitEmpty { - si.omitEmpty = true +func tiSep(name string) uint8 { + // (xn[0]%64) // (between 192-255 - outside ascii BMP) + // return 0xfe - (name[0] & 63) + // return 0xfe - (name[0] & 63) - uint8(len(name)) + // return 0xfe - (name[0] & 63) - uint8(len(name)&63) + // return ((0xfe - (name[0] & 63)) & 0xf8) | (uint8(len(name) & 0x07)) + return 0xfe - (name[0] & 63) - uint8(len(name)&63) +} + +func tiSep2(name []byte) uint8 { + return 0xfe - (name[0] & 63) - uint8(len(name)&63) +} + +// resolves the struct field info got from a call to rget. +// Returns a trimmed, unsorted and sorted []*structFieldInfo. +func rgetResolveSFI(rt reflect.Type, x []structFieldInfo, pv *typeInfoLoadArray) ( + y, z []*structFieldInfo, ss []byte, anyOmitEmpty bool) { + sa := pv.sfiidx[:0] + sn := pv.b[:] + n := len(x) + + var xn string + var ui uint16 + var sep byte + + for i := range x { + ui = uint16(i) + xn = x[i].encName // fieldName or encName? use encName for now. + if len(xn)+2 > cap(pv.b) { + sn = make([]byte, len(xn)+2) + } else { + sn = sn[:len(xn)+2] + } + // use a custom sep, so that misses are less frequent, + // since the sep (first char in search) is as unique as first char in field name. + sep = tiSep(xn) + sn[0], sn[len(sn)-1] = sep, 0xff + copy(sn[1:], xn) + j := bytes.Index(sa, sn) + if j == -1 { + sa = append(sa, sep) + sa = append(sa, xn...) + sa = append(sa, 0xff, byte(ui>>8), byte(ui)) + } else { + index := uint16(sa[j+len(sn)+1]) | uint16(sa[j+len(sn)])<<8 + // one of them must be reset to nil, + // and the index updated appropriately to the other one + if x[i].nis == x[index].nis { + } else if x[i].nis < x[index].nis { + sa[j+len(sn)], sa[j+len(sn)+1] = byte(ui>>8), byte(ui) + if x[index].ready() { + x[index].flagClr(structFieldInfoFlagReady) + n-- + } + } else { + if x[i].ready() { + x[i].flagClr(structFieldInfoFlagReady) + n-- + } } } - *sfi = append(*sfi, si) - fnameToHastag[f.Name] = stag != "" + + } + var w []structFieldInfo + sharingArray := len(x) <= typeInfoLoadArraySfisLen // sharing array with typeInfoLoadArray + if sharingArray { + w = make([]structFieldInfo, n) + } + + // remove all the nils (non-ready) + y = make([]*structFieldInfo, n) + n = 0 + var sslen int + for i := range x { + if !x[i].ready() { + continue + } + if !anyOmitEmpty && x[i].omitEmpty() { + anyOmitEmpty = true + } + if sharingArray { + w[n] = x[i] + y[n] = &w[n] + } else { + y[n] = &x[i] + } + sslen = sslen + len(x[i].encName) + 4 + n++ + } + if n != len(y) { + panicv.errorf("failure reading struct %v - expecting %d of %d valid fields, got %d", + rt, len(y), len(x), n) + } + + z = make([]*structFieldInfo, len(y)) + copy(z, y) + sort.Sort(sfiSortedByEncName(z)) + + sharingArray = len(sa) <= typeInfoLoadArraySfiidxLen + if sharingArray { + ss = make([]byte, 0, sslen) + } else { + ss = sa[:0] // reuse the newly made sa array if necessary + } + for i := range z { + xn = z[i].encName + sep = tiSep(xn) + ui = uint16(i) + ss = append(ss, sep) + ss = append(ss, xn...) + ss = append(ss, 0xff, byte(ui>>8), byte(ui)) } + return +} + +func implIntf(rt, iTyp reflect.Type) (base bool, indir bool) { + return rt.Implements(iTyp), reflect.PtrTo(rt).Implements(iTyp) } -func panicToErr(err *error) { +// isEmptyStruct is only called from isEmptyValue, and checks if a struct is empty: +// - does it implement IsZero() bool +// - is it comparable, and can i compare directly using == +// - if checkStruct, then walk through the encodable fields +// and check if they are empty or not. +func isEmptyStruct(v reflect.Value, tinfos *TypeInfos, deref, checkStruct bool) bool { + // v is a struct kind - no need to check again. + // We only check isZero on a struct kind, to reduce the amount of times + // that we lookup the rtid and typeInfo for each type as we walk the tree. + + vt := v.Type() + rtid := rt2id(vt) + if tinfos == nil { + tinfos = defTypeInfos + } + ti := tinfos.get(rtid, vt) + if ti.rtid == timeTypId { + return rv2i(v).(time.Time).IsZero() + } + if ti.isFlag(typeInfoFlagIsZeroerPtr) && v.CanAddr() { + return rv2i(v.Addr()).(isZeroer).IsZero() + } + if ti.isFlag(typeInfoFlagIsZeroer) { + return rv2i(v).(isZeroer).IsZero() + } + if ti.isFlag(typeInfoFlagComparable) { + return rv2i(v) == rv2i(reflect.Zero(vt)) + } + if !checkStruct { + return false + } + // We only care about what we can encode/decode, + // so that is what we use to check omitEmpty. + for _, si := range ti.sfiSrc { + sfv, valid := si.field(v, false) + if valid && !isEmptyValue(sfv, tinfos, deref, checkStruct) { + return false + } + } + return true +} + +// func roundFloat(x float64) float64 { +// t := math.Trunc(x) +// if math.Abs(x-t) >= 0.5 { +// return t + math.Copysign(1, x) +// } +// return t +// } + +func panicToErr(h errDecorator, err *error) { + // Note: This method MUST be called directly from defer i.e. defer panicToErr ... + // else it seems the recover is not fully handled if recoverPanicToErr { if x := recover(); x != nil { - //debug.PrintStack() - panicValToErr(x, err) + // fmt.Printf("panic'ing with: %v\n", x) + // debug.PrintStack() + panicValToErr(h, x, err) } } } -func doPanic(tag string, format string, params ...interface{}) { - params2 := make([]interface{}, len(params)+1) - params2[0] = tag - copy(params2[1:], params) - panic(fmt.Errorf("%s: "+format, params2...)) +func panicValToErr(h errDecorator, v interface{}, err *error) { + switch xerr := v.(type) { + case nil: + case error: + switch xerr { + case nil: + case io.EOF, io.ErrUnexpectedEOF, errEncoderNotInitialized, errDecoderNotInitialized: + // treat as special (bubble up) + *err = xerr + default: + h.wrapErr(xerr, err) + } + case string: + if xerr != "" { + h.wrapErr(xerr, err) + } + case fmt.Stringer: + if xerr != nil { + h.wrapErr(xerr, err) + } + default: + h.wrapErr(v, err) + } +} + +func isImmutableKind(k reflect.Kind) (v bool) { + // return immutableKindsSet[k] + // since we know reflect.Kind is in range 0..31, then use the k%32 == k constraint + return immutableKindsSet[k%reflect.Kind(len(immutableKindsSet))] // bounds-check-elimination +} + +// ---- + +type codecFnInfo struct { + ti *typeInfo + xfFn Ext + xfTag uint64 + seq seqType + addrD bool + addrF bool // if addrD, this says whether decode function can take a value or a ptr + addrE bool +} + +// codecFn encapsulates the captured variables and the encode function. +// This way, we only do some calculations one times, and pass to the +// code block that should be called (encapsulated in a function) +// instead of executing the checks every time. +type codecFn struct { + i codecFnInfo + fe func(*Encoder, *codecFnInfo, reflect.Value) + fd func(*Decoder, *codecFnInfo, reflect.Value) + _ [1]uint64 // padding +} + +type codecRtidFn struct { + rtid uintptr + fn *codecFn +} + +// ---- + +// these "checkOverflow" functions must be inlinable, and not call anybody. +// Overflow means that the value cannot be represented without wrapping/overflow. +// Overflow=false does not mean that the value can be represented without losing precision +// (especially for floating point). + +type checkOverflow struct{} + +// func (checkOverflow) Float16(f float64) (overflow bool) { +// panicv.errorf("unimplemented") +// if f < 0 { +// f = -f +// } +// return math.MaxFloat32 < f && f <= math.MaxFloat64 +// } + +func (checkOverflow) Float32(v float64) (overflow bool) { + if v < 0 { + v = -v + } + return math.MaxFloat32 < v && v <= math.MaxFloat64 +} +func (checkOverflow) Uint(v uint64, bitsize uint8) (overflow bool) { + if bitsize == 0 || bitsize >= 64 || v == 0 { + return + } + if trunc := (v << (64 - bitsize)) >> (64 - bitsize); v != trunc { + overflow = true + } + return +} +func (checkOverflow) Int(v int64, bitsize uint8) (overflow bool) { + if bitsize == 0 || bitsize >= 64 || v == 0 { + return + } + if trunc := (v << (64 - bitsize)) >> (64 - bitsize); v != trunc { + overflow = true + } + return +} +func (checkOverflow) SignedInt(v uint64) (overflow bool) { + //e.g. -127 to 128 for int8 + pos := (v >> 63) == 0 + ui2 := v & 0x7fffffffffffffff + if pos { + if ui2 > math.MaxInt64 { + overflow = true + } + } else { + if ui2 > math.MaxInt64-1 { + overflow = true + } + } + return +} + +func (x checkOverflow) Float32V(v float64) float64 { + if x.Float32(v) { + panicv.errorf("float32 overflow: %v", v) + } + return v +} +func (x checkOverflow) UintV(v uint64, bitsize uint8) uint64 { + if x.Uint(v, bitsize) { + panicv.errorf("uint64 overflow: %v", v) + } + return v +} +func (x checkOverflow) IntV(v int64, bitsize uint8) int64 { + if x.Int(v, bitsize) { + panicv.errorf("int64 overflow: %v", v) + } + return v +} +func (x checkOverflow) SignedIntV(v uint64) int64 { + if x.SignedInt(v) { + panicv.errorf("uint64 to int64 overflow: %v", v) + } + return int64(v) +} + +// ------------------ SORT ----------------- + +func isNaN(f float64) bool { return f != f } + +// ----------------------- + +type ioFlusher interface { + Flush() error +} + +type ioPeeker interface { + Peek(int) ([]byte, error) +} + +type ioBuffered interface { + Buffered() int +} + +// ----------------------- + +type intSlice []int64 +type uintSlice []uint64 + +// type uintptrSlice []uintptr +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[uint(i)] < p[uint(j)] } +func (p intSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] } + +func (p uintSlice) Len() int { return len(p) } +func (p uintSlice) Less(i, j int) bool { return p[uint(i)] < p[uint(j)] } +func (p uintSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] } + +// func (p uintptrSlice) Len() int { return len(p) } +// func (p uintptrSlice) Less(i, j int) bool { return p[uint(i)] < p[uint(j)] } +// func (p uintptrSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] } + +func (p floatSlice) Len() int { return len(p) } +func (p floatSlice) Less(i, j int) bool { + return p[uint(i)] < p[uint(j)] || isNaN(p[uint(i)]) && !isNaN(p[uint(j)]) +} +func (p floatSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] } + +func (p stringSlice) Len() int { return len(p) } +func (p stringSlice) Less(i, j int) bool { return p[uint(i)] < p[uint(j)] } +func (p stringSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] } + +// func (p bytesSlice) Len() int { return len(p) } +// func (p bytesSlice) Less(i, j int) bool { return bytes.Compare(p[uint(i)], p[uint(j)]) == -1 } +// func (p bytesSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] } + +func (p boolSlice) Len() int { return len(p) } +func (p boolSlice) Less(i, j int) bool { return !p[uint(i)] && p[uint(j)] } +func (p boolSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] } + +// --------------------- + +type sfiRv struct { + v *structFieldInfo + r reflect.Value +} + +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 +type timeRv struct { + v time.Time + r reflect.Value +} +type timeRvSlice []timeRv + +func (p intRvSlice) Len() int { return len(p) } +func (p intRvSlice) Less(i, j int) bool { return p[uint(i)].v < p[uint(j)].v } +func (p intRvSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] } + +func (p uintRvSlice) Len() int { return len(p) } +func (p uintRvSlice) Less(i, j int) bool { return p[uint(i)].v < p[uint(j)].v } +func (p uintRvSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] } + +func (p floatRvSlice) Len() int { return len(p) } +func (p floatRvSlice) Less(i, j int) bool { + return p[uint(i)].v < p[uint(j)].v || isNaN(p[uint(i)].v) && !isNaN(p[uint(j)].v) +} +func (p floatRvSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] } + +func (p stringRvSlice) Len() int { return len(p) } +func (p stringRvSlice) Less(i, j int) bool { return p[uint(i)].v < p[uint(j)].v } +func (p stringRvSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] } + +func (p bytesRvSlice) Len() int { return len(p) } +func (p bytesRvSlice) Less(i, j int) bool { return bytes.Compare(p[uint(i)].v, p[uint(j)].v) == -1 } +func (p bytesRvSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] } + +func (p boolRvSlice) Len() int { return len(p) } +func (p boolRvSlice) Less(i, j int) bool { return !p[uint(i)].v && p[uint(j)].v } +func (p boolRvSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] } + +func (p timeRvSlice) Len() int { return len(p) } +func (p timeRvSlice) Less(i, j int) bool { return p[uint(i)].v.Before(p[uint(j)].v) } +func (p timeRvSlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] } + +// ----------------- + +type bytesI struct { + v []byte + i interface{} } -func checkOverflowFloat32(f float64, doCheck bool) { - if !doCheck { +type bytesISlice []bytesI + +func (p bytesISlice) Len() int { return len(p) } +func (p bytesISlice) Less(i, j int) bool { return bytes.Compare(p[uint(i)].v, p[uint(j)].v) == -1 } +func (p bytesISlice) Swap(i, j int) { p[uint(i)], p[uint(j)] = p[uint(j)], p[uint(i)] } + +// ----------------- + +type set []uintptr + +func (s *set) add(v uintptr) (exists bool) { + // e.ci is always nil, or len >= 1 + x := *s + if x == nil { + x = make([]uintptr, 1, 8) + x[0] = v + *s = x return } - // check overflow (logic adapted from std pkg reflect/value.go OverflowFloat() - f2 := f - if f2 < 0 { - f2 = -f + // typically, length will be 1. make this perform. + if len(x) == 1 { + if j := x[0]; j == 0 { + x[0] = v + } else if j == v { + exists = true + } else { + x = append(x, v) + *s = x + } + return } - if math.MaxFloat32 < f2 && f2 <= math.MaxFloat64 { - decErr("Overflow float32 value: %v", f2) + // check if it exists + for _, j := range x { + if j == v { + exists = true + return + } } + // try to replace a "deleted" slot + for i, j := range x { + if j == 0 { + x[i] = v + return + } + } + // if unable to replace deleted slot, just append it. + x = append(x, v) + *s = x + return } -func checkOverflow(ui uint64, i int64, bitsize uint8) { - // check overflow (logic adapted from std pkg reflect/value.go OverflowUint() - if bitsize == 0 { +func (s *set) remove(v uintptr) (exists bool) { + x := *s + if len(x) == 0 { return } - if i != 0 { - if trunc := (i << (64 - bitsize)) >> (64 - bitsize); i != trunc { - decErr("Overflow int value: %v", i) + if len(x) == 1 { + if x[0] == v { + x[0] = 0 } + return } - if ui != 0 { - if trunc := (ui << (64 - bitsize)) >> (64 - bitsize); ui != trunc { - decErr("Overflow uint value: %v", ui) + for i, j := range x { + if j == v { + exists = true + x[i] = 0 // set it to 0, as way to delete it. + // copy(x[i:], x[i+1:]) + // x = x[:len(x)-1] + return } } + return +} + +// ------ + +// bitset types are better than [256]bool, because they permit the whole +// bitset array being on a single cache line and use less memory. +// +// Also, since pos is a byte (0-255), there's no bounds checks on indexing (cheap). +// +// We previously had bitset128 [16]byte, and bitset32 [4]byte, but those introduces +// bounds checking, so we discarded them, and everyone uses bitset256. +// +// given x > 0 and n > 0 and x is exactly 2^n, then pos/x === pos>>n AND pos%x === pos&(x-1). +// consequently, pos/32 === pos>>5, pos/16 === pos>>4, pos/8 === pos>>3, pos%8 == pos&7 + +type bitset256 [32]byte + +func (x *bitset256) isset(pos byte) bool { + return x[pos>>3]&(1<<(pos&7)) != 0 } + +// func (x *bitset256) issetv(pos byte) byte { +// return x[pos>>3] & (1 << (pos & 7)) +// } + +func (x *bitset256) set(pos byte) { + x[pos>>3] |= (1 << (pos & 7)) +} + +// func (x *bitset256) unset(pos byte) { +// x[pos>>3] &^= (1 << (pos & 7)) +// } + +// type bit2set256 [64]byte + +// func (x *bit2set256) set(pos byte, v1, v2 bool) { +// var pos2 uint8 = (pos & 3) << 1 // returning 0, 2, 4 or 6 +// if v1 { +// x[pos>>2] |= 1 << (pos2 + 1) +// } +// if v2 { +// x[pos>>2] |= 1 << pos2 +// } +// } +// func (x *bit2set256) get(pos byte) uint8 { +// var pos2 uint8 = (pos & 3) << 1 // returning 0, 2, 4 or 6 +// return x[pos>>2] << (6 - pos2) >> 6 // 11000000 -> 00000011 +// } + +// ------------ + +type pooler struct { + // function-scoped pooled resources + tiload sync.Pool // for type info loading + sfiRv8, sfiRv16, sfiRv32, sfiRv64, sfiRv128 sync.Pool // for struct encoding + + // lifetime-scoped pooled resources + // dn sync.Pool // for decNaked + buf1k, buf2k, buf4k, buf8k, buf16k, buf32k, buf64k sync.Pool // for [N]byte +} + +func (p *pooler) init() { + p.tiload.New = func() interface{} { return new(typeInfoLoadArray) } + + p.sfiRv8.New = func() interface{} { return new([8]sfiRv) } + p.sfiRv16.New = func() interface{} { return new([16]sfiRv) } + p.sfiRv32.New = func() interface{} { return new([32]sfiRv) } + p.sfiRv64.New = func() interface{} { return new([64]sfiRv) } + p.sfiRv128.New = func() interface{} { return new([128]sfiRv) } + + // p.dn.New = func() interface{} { x := new(decNaked); x.init(); return x } + + p.buf1k.New = func() interface{} { return new([1 * 1024]byte) } + p.buf2k.New = func() interface{} { return new([2 * 1024]byte) } + p.buf4k.New = func() interface{} { return new([4 * 1024]byte) } + p.buf8k.New = func() interface{} { return new([8 * 1024]byte) } + p.buf16k.New = func() interface{} { return new([16 * 1024]byte) } + p.buf32k.New = func() interface{} { return new([32 * 1024]byte) } + p.buf64k.New = func() interface{} { return new([64 * 1024]byte) } + +} + +// func (p *pooler) sfiRv8() (sp *sync.Pool, v interface{}) { +// return &p.strRv8, p.strRv8.Get() +// } +// func (p *pooler) sfiRv16() (sp *sync.Pool, v interface{}) { +// return &p.strRv16, p.strRv16.Get() +// } +// func (p *pooler) sfiRv32() (sp *sync.Pool, v interface{}) { +// return &p.strRv32, p.strRv32.Get() +// } +// func (p *pooler) sfiRv64() (sp *sync.Pool, v interface{}) { +// return &p.strRv64, p.strRv64.Get() +// } +// func (p *pooler) sfiRv128() (sp *sync.Pool, v interface{}) { +// return &p.strRv128, p.strRv128.Get() +// } + +// func (p *pooler) bytes1k() (sp *sync.Pool, v interface{}) { +// return &p.buf1k, p.buf1k.Get() +// } +// func (p *pooler) bytes2k() (sp *sync.Pool, v interface{}) { +// return &p.buf2k, p.buf2k.Get() +// } +// func (p *pooler) bytes4k() (sp *sync.Pool, v interface{}) { +// return &p.buf4k, p.buf4k.Get() +// } +// func (p *pooler) bytes8k() (sp *sync.Pool, v interface{}) { +// return &p.buf8k, p.buf8k.Get() +// } +// func (p *pooler) bytes16k() (sp *sync.Pool, v interface{}) { +// return &p.buf16k, p.buf16k.Get() +// } +// func (p *pooler) bytes32k() (sp *sync.Pool, v interface{}) { +// return &p.buf32k, p.buf32k.Get() +// } +// func (p *pooler) bytes64k() (sp *sync.Pool, v interface{}) { +// return &p.buf64k, p.buf64k.Get() +// } + +// func (p *pooler) tiLoad() (sp *sync.Pool, v interface{}) { +// return &p.tiload, p.tiload.Get() +// } + +// func (p *pooler) decNaked() (sp *sync.Pool, v interface{}) { +// return &p.dn, p.dn.Get() +// } + +// func (p *pooler) decNaked() (v *decNaked, f func(*decNaked) ) { +// sp := &(p.dn) +// vv := sp.Get() +// return vv.(*decNaked), func(x *decNaked) { sp.Put(vv) } +// } +// func (p *pooler) decNakedGet() (v interface{}) { +// return p.dn.Get() +// } +// func (p *pooler) tiLoadGet() (v interface{}) { +// return p.tiload.Get() +// } +// func (p *pooler) decNakedPut(v interface{}) { +// p.dn.Put(v) +// } +// func (p *pooler) tiLoadPut(v interface{}) { +// p.tiload.Put(v) +// } + +// ---------------------------------------------------- + +type panicHdl struct{} + +func (panicHdl) errorv(err error) { + if err != nil { + panic(err) + } +} + +func (panicHdl) errorstr(message string) { + if message != "" { + panic(message) + } +} + +func (panicHdl) errorf(format string, params ...interface{}) { + if format == "" { + } else if len(params) == 0 { + panic(format) + } else { + panic(fmt.Sprintf(format, params...)) + } +} + +// ---------------------------------------------------- + +type errDecorator interface { + wrapErr(in interface{}, out *error) +} + +type errDecoratorDef struct{} + +func (errDecoratorDef) wrapErr(v interface{}, e *error) { *e = fmt.Errorf("%v", v) } + +// ---------------------------------------------------- + +type must struct{} + +func (must) String(s string, err error) string { + if err != nil { + panicv.errorv(err) + } + return s +} +func (must) Int(s int64, err error) int64 { + if err != nil { + panicv.errorv(err) + } + return s +} +func (must) Uint(s uint64, err error) uint64 { + if err != nil { + panicv.errorv(err) + } + return s +} +func (must) Float(s float64, err error) float64 { + if err != nil { + panicv.errorv(err) + } + return s +} + +// ------------------- + +type bytesBufPooler struct { + pool *sync.Pool + poolbuf interface{} +} + +func (z *bytesBufPooler) end() { + if z.pool != nil { + z.pool.Put(z.poolbuf) + z.pool, z.poolbuf = nil, nil + } +} + +func (z *bytesBufPooler) get(bufsize int) (buf []byte) { + // ensure an end is called first (if necessary) + if z.pool != nil { + z.pool.Put(z.poolbuf) + z.pool, z.poolbuf = nil, nil + } + + // // Try to use binary search. + // // This is not optimal, as most folks select 1k or 2k buffers + // // so a linear search is better (sequence of if/else blocks) + // if bufsize < 1 { + // bufsize = 0 + // } else { + // bufsize-- + // bufsize /= 1024 + // } + // switch bufsize { + // case 0: + // z.pool, z.poolbuf = pool.bytes1k() + // buf = z.poolbuf.(*[1 * 1024]byte)[:] + // case 1: + // z.pool, z.poolbuf = pool.bytes2k() + // buf = z.poolbuf.(*[2 * 1024]byte)[:] + // case 2, 3: + // z.pool, z.poolbuf = pool.bytes4k() + // buf = z.poolbuf.(*[4 * 1024]byte)[:] + // case 4, 5, 6, 7: + // z.pool, z.poolbuf = pool.bytes8k() + // buf = z.poolbuf.(*[8 * 1024]byte)[:] + // case 8, 9, 10, 11, 12, 13, 14, 15: + // z.pool, z.poolbuf = pool.bytes16k() + // buf = z.poolbuf.(*[16 * 1024]byte)[:] + // case 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31: + // z.pool, z.poolbuf = pool.bytes32k() + // buf = z.poolbuf.(*[32 * 1024]byte)[:] + // default: + // z.pool, z.poolbuf = pool.bytes64k() + // buf = z.poolbuf.(*[64 * 1024]byte)[:] + // } + // return + + if bufsize <= 1*1024 { + z.pool, z.poolbuf = &pool.buf1k, pool.buf1k.Get() // pool.bytes1k() + buf = z.poolbuf.(*[1 * 1024]byte)[:] + } else if bufsize <= 2*1024 { + z.pool, z.poolbuf = &pool.buf2k, pool.buf2k.Get() // pool.bytes2k() + buf = z.poolbuf.(*[2 * 1024]byte)[:] + } else if bufsize <= 4*1024 { + z.pool, z.poolbuf = &pool.buf4k, pool.buf4k.Get() // pool.bytes4k() + buf = z.poolbuf.(*[4 * 1024]byte)[:] + } else if bufsize <= 8*1024 { + z.pool, z.poolbuf = &pool.buf8k, pool.buf8k.Get() // pool.bytes8k() + buf = z.poolbuf.(*[8 * 1024]byte)[:] + } else if bufsize <= 16*1024 { + z.pool, z.poolbuf = &pool.buf16k, pool.buf16k.Get() // pool.bytes16k() + buf = z.poolbuf.(*[16 * 1024]byte)[:] + } else if bufsize <= 32*1024 { + z.pool, z.poolbuf = &pool.buf32k, pool.buf32k.Get() // pool.bytes32k() + buf = z.poolbuf.(*[32 * 1024]byte)[:] + } else { + z.pool, z.poolbuf = &pool.buf64k, pool.buf64k.Get() // pool.bytes64k() + buf = z.poolbuf.(*[64 * 1024]byte)[:] + } + return +} + +// ---------------- + +type sfiRvPooler struct { + pool *sync.Pool + poolv interface{} +} + +func (z *sfiRvPooler) end() { + if z.pool != nil { + z.pool.Put(z.poolv) + z.pool, z.poolv = nil, nil + } +} + +func (z *sfiRvPooler) get(newlen int) (fkvs []sfiRv) { + if newlen < 0 { // bounds-check-elimination + // cannot happen // here for bounds-check-elimination + } else if newlen <= 8 { + z.pool, z.poolv = &pool.sfiRv8, pool.sfiRv8.Get() // pool.sfiRv8() + fkvs = z.poolv.(*[8]sfiRv)[:newlen] + } else if newlen <= 16 { + z.pool, z.poolv = &pool.sfiRv16, pool.sfiRv16.Get() // pool.sfiRv16() + fkvs = z.poolv.(*[16]sfiRv)[:newlen] + } else if newlen <= 32 { + z.pool, z.poolv = &pool.sfiRv32, pool.sfiRv32.Get() // pool.sfiRv32() + fkvs = z.poolv.(*[32]sfiRv)[:newlen] + } else if newlen <= 64 { + z.pool, z.poolv = &pool.sfiRv64, pool.sfiRv64.Get() // pool.sfiRv64() + fkvs = z.poolv.(*[64]sfiRv)[:newlen] + } else if newlen <= 128 { + z.pool, z.poolv = &pool.sfiRv128, pool.sfiRv128.Get() // pool.sfiRv128() + fkvs = z.poolv.(*[128]sfiRv)[:newlen] + } else { + fkvs = make([]sfiRv, newlen) + } + return +} + +// xdebugf prints the message in red on the terminal. +// Use it in place of fmt.Printf (which it calls internally) +func xdebugf(pattern string, args ...interface{}) { + var delim string + if len(pattern) > 0 && pattern[len(pattern)-1] != '\n' { + delim = "\n" + } + fmt.Printf("\033[1;31m"+pattern+delim+"\033[0m", args...) +} + +// func isImmutableKind(k reflect.Kind) (v bool) { +// return false || +// k == reflect.Int || +// k == reflect.Int8 || +// k == reflect.Int16 || +// k == reflect.Int32 || +// k == reflect.Int64 || +// k == reflect.Uint || +// k == reflect.Uint8 || +// k == reflect.Uint16 || +// k == reflect.Uint32 || +// k == reflect.Uint64 || +// k == reflect.Uintptr || +// k == reflect.Float32 || +// k == reflect.Float64 || +// k == reflect.Bool || +// k == reflect.String +// } + +// func timeLocUTCName(tzint int16) string { +// if tzint == 0 { +// return "UTC" +// } +// var tzname = []byte("UTC+00:00") +// //tzname := fmt.Sprintf("UTC%s%02d:%02d", tzsign, tz/60, tz%60) //perf issue using Sprintf. inline below. +// //tzhr, tzmin := tz/60, tz%60 //faster if u convert to int first +// var tzhr, tzmin int16 +// if tzint < 0 { +// tzname[3] = '-' // (TODO: verify. this works here) +// tzhr, tzmin = -tzint/60, (-tzint)%60 +// } else { +// tzhr, tzmin = tzint/60, tzint%60 +// } +// tzname[4] = timeDigits[tzhr/10] +// tzname[5] = timeDigits[tzhr%10] +// tzname[7] = timeDigits[tzmin/10] +// tzname[8] = timeDigits[tzmin%10] +// return string(tzname) +// //return time.FixedZone(string(tzname), int(tzint)*60) +// } diff --git a/vendor/github.com/ugorji/go/codec/helper_internal.go b/vendor/github.com/ugorji/go/codec/helper_internal.go index 58417da95..0cbd665e2 100644 --- a/vendor/github.com/ugorji/go/codec/helper_internal.go +++ b/vendor/github.com/ugorji/go/codec/helper_internal.go @@ -1,127 +1,121 @@ -// Copyright (c) 2012, 2013 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. package codec // All non-std package dependencies live in this file, // so porting to different environment is easy (just update functions). -import ( - "errors" - "fmt" - "math" - "reflect" -) - -var ( - raisePanicAfterRecover = false - debugging = true -) - -func panicValToErr(panicVal interface{}, err *error) { - switch xerr := panicVal.(type) { - case error: - *err = xerr - case string: - *err = errors.New(xerr) - default: - *err = fmt.Errorf("%v", panicVal) - } - if raisePanicAfterRecover { - panic(panicVal) +func pruneSignExt(v []byte, pos bool) (n int) { + if len(v) < 2 { + } else if pos && v[0] == 0 { + for ; v[n] == 0 && n+1 < len(v) && (v[n+1]&(1<<7) == 0); n++ { + } + } else if !pos && v[0] == 0xff { + for ; v[n] == 0xff && n+1 < len(v) && (v[n+1]&(1<<7) != 0); n++ { + } } return } -func isEmptyValueDeref(v reflect.Value, deref bool) bool { - switch v.Kind() { - case reflect.Array, reflect.Map, reflect.Slice, reflect.String: - return v.Len() == 0 - case reflect.Bool: - return !v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Interface, reflect.Ptr: - if deref { - if v.IsNil() { - return true - } - return isEmptyValueDeref(v.Elem(), deref) - } else { - return v.IsNil() - } - case reflect.Struct: - // return true if all fields are empty. else return false. +// validate that this function is correct ... +// culled from OGRE (Object-Oriented Graphics Rendering Engine) +// function: halfToFloatI (http://stderr.org/doc/ogre-doc/api/OgreBitwise_8h-source.html) +func halfFloatToFloatBits(yy uint16) (d uint32) { + y := uint32(yy) + s := (y >> 15) & 0x01 + e := (y >> 10) & 0x1f + m := y & 0x03ff - // we cannot use equality check, because some fields may be maps/slices/etc - // and consequently the structs are not comparable. - // return v.Interface() == reflect.Zero(v.Type()).Interface() - for i, n := 0, v.NumField(); i < n; i++ { - if !isEmptyValueDeref(v.Field(i), deref) { - return false - } + if e == 0 { + if m == 0 { // plu or minus 0 + return s << 31 + } + // Denormalized number -- renormalize it + for (m & 0x00000400) == 0 { + m <<= 1 + e -= 1 } - return true + e += 1 + const zz uint32 = 0x0400 + m &= ^zz + } else if e == 31 { + if m == 0 { // Inf + return (s << 31) | 0x7f800000 + } + return (s << 31) | 0x7f800000 | (m << 13) // NaN } - return false + e = e + (127 - 15) + m = m << 13 + return (s << 31) | (e << 23) | m } -func isEmptyValue(v reflect.Value) bool { - return isEmptyValueDeref(v, true) -} +// GrowCap will return a new capacity for a slice, given the following: +// - oldCap: current capacity +// - unit: in-memory size of an element +// - num: number of elements to add +func growCap(oldCap, unit, num int) (newCap int) { + // appendslice logic (if cap < 1024, *2, else *1.25): + // leads to many copy calls, especially when copying bytes. + // bytes.Buffer model (2*cap + n): much better for bytes. + // smarter way is to take the byte-size of the appended element(type) into account -func debugf(format string, args ...interface{}) { - if debugging { - if len(format) == 0 || format[len(format)-1] != '\n' { - format = format + "\n" - } - fmt.Printf(format, args...) + // maintain 3 thresholds: + // t1: if cap <= t1, newcap = 2x + // t2: if cap <= t2, newcap = 1.75x + // t3: if cap <= t3, newcap = 1.5x + // else newcap = 1.25x + // + // t1, t2, t3 >= 1024 always. + // i.e. if unit size >= 16, then always do 2x or 1.25x (ie t1, t2, t3 are all same) + // + // With this, appending for bytes increase by: + // 100% up to 4K + // 75% up to 8K + // 50% up to 16K + // 25% beyond that + + // unit can be 0 e.g. for struct{}{}; handle that appropriately + var t1, t2, t3 int // thresholds + if unit <= 1 { + t1, t2, t3 = 4*1024, 8*1024, 16*1024 + } else if unit < 16 { + t3 = 16 / unit * 1024 + t1 = t3 * 1 / 4 + t2 = t3 * 2 / 4 + } else { + t1, t2, t3 = 1024, 1024, 1024 } -} -func pruneSignExt(v []byte, pos bool) (n int) { - if len(v) < 2 { - } else if pos && v[0] == 0 { - for ; v[n] == 0 && n+1 < len(v) && (v[n+1]&(1<<7) == 0); n++ { - } - } else if !pos && v[0] == 0xff { - for ; v[n] == 0xff && n+1 < len(v) && (v[n+1]&(1<<7) != 0); n++ { - } + var x int // temporary variable + + // x is multiplier here: one of 5, 6, 7 or 8; incr of 25%, 50%, 75% or 100% respectively + if oldCap <= t1 { // [0,t1] + x = 8 + } else if oldCap > t3 { // (t3,infinity] + x = 5 + } else if oldCap <= t2 { // (t1,t2] + x = 7 + } else { // (t2,t3] + x = 6 } - return -} + newCap = x * oldCap / 4 -func implementsIntf(typ, iTyp reflect.Type) (success bool, indir int8) { - if typ == nil { - return + if num > 0 { + newCap += num } - rt := typ - // The type might be a pointer and we need to keep - // dereferencing to the base type until we find an implementation. - for { - if rt.Implements(iTyp) { - return true, indir - } - if p := rt; p.Kind() == reflect.Ptr { - indir++ - if indir >= math.MaxInt8 { // insane number of indirections - return false, 0 - } - rt = p.Elem() - continue + + // ensure newCap is a multiple of 64 (if it is > 64) or 16. + if newCap > 64 { + if x = newCap % 64; x != 0 { + x = newCap / 64 + newCap = 64 * (x + 1) } - break - } - // No luck yet, but if this is a base type (non-pointer), the pointer might satisfy. - if typ.Kind() != reflect.Ptr { - // Not a pointer, but does the pointer work? - if reflect.PtrTo(typ).Implements(iTyp) { - return true, -1 + } else { + if x = newCap % 16; x != 0 { + x = newCap / 16 + newCap = 16 * (x + 1) } } - return false, 0 + return } diff --git a/vendor/github.com/ugorji/go/codec/helper_not_unsafe.go b/vendor/github.com/ugorji/go/codec/helper_not_unsafe.go new file mode 100644 index 000000000..74987f9f7 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/helper_not_unsafe.go @@ -0,0 +1,331 @@ +// +build !go1.7 safe appengine + +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +package codec + +import ( + "reflect" + "sync/atomic" + "time" +) + +const safeMode = true + +// stringView returns a view of the []byte as a string. +// In unsafe mode, it doesn't incur allocation and copying caused by conversion. +// In regular safe mode, it is an allocation and copy. +// +// Usage: Always maintain a reference to v while result of this call is in use, +// and call keepAlive4BytesView(v) at point where done with view. +func stringView(v []byte) string { + return string(v) +} + +// bytesView returns a view of the string as a []byte. +// In unsafe mode, it doesn't incur allocation and copying caused by conversion. +// In regular safe mode, it is an allocation and copy. +// +// Usage: Always maintain a reference to v while result of this call is in use, +// and call keepAlive4BytesView(v) at point where done with view. +func bytesView(v string) []byte { + return []byte(v) +} + +func definitelyNil(v interface{}) bool { + // this is a best-effort option. + // We just return false, so we don't unnecessarily incur the cost of reflection this early. + return false +} + +func rv2i(rv reflect.Value) interface{} { + return rv.Interface() +} + +func rt2id(rt reflect.Type) uintptr { + return reflect.ValueOf(rt).Pointer() +} + +// func rv2rtid(rv reflect.Value) uintptr { +// return reflect.ValueOf(rv.Type()).Pointer() +// } + +func i2rtid(i interface{}) uintptr { + return reflect.ValueOf(reflect.TypeOf(i)).Pointer() +} + +// -------------------------- + +func isEmptyValue(v reflect.Value, tinfos *TypeInfos, deref, checkStruct bool) bool { + switch v.Kind() { + case reflect.Invalid: + return true + case reflect.Array, reflect.Map, reflect.Slice, reflect.String: + return v.Len() == 0 + case reflect.Bool: + return !v.Bool() + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return v.Int() == 0 + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return v.Uint() == 0 + case reflect.Float32, reflect.Float64: + return v.Float() == 0 + case reflect.Interface, reflect.Ptr: + if deref { + if v.IsNil() { + return true + } + return isEmptyValue(v.Elem(), tinfos, deref, checkStruct) + } + return v.IsNil() + case reflect.Struct: + return isEmptyStruct(v, tinfos, deref, checkStruct) + } + return false +} + +// -------------------------- +// type ptrToRvMap struct{} + +// func (*ptrToRvMap) init() {} +// func (*ptrToRvMap) get(i interface{}) reflect.Value { +// return reflect.ValueOf(i).Elem() +// } + +// -------------------------- +type atomicClsErr struct { + v atomic.Value +} + +func (x *atomicClsErr) load() (e clsErr) { + if i := x.v.Load(); i != nil { + e = i.(clsErr) + } + return +} + +func (x *atomicClsErr) store(p clsErr) { + x.v.Store(p) +} + +// -------------------------- +type atomicTypeInfoSlice struct { // expected to be 2 words + v atomic.Value +} + +func (x *atomicTypeInfoSlice) load() (e []rtid2ti) { + if i := x.v.Load(); i != nil { + e = i.([]rtid2ti) + } + return +} + +func (x *atomicTypeInfoSlice) store(p []rtid2ti) { + x.v.Store(p) +} + +// -------------------------- +type atomicRtidFnSlice struct { // expected to be 2 words + v atomic.Value +} + +func (x *atomicRtidFnSlice) load() (e []codecRtidFn) { + if i := x.v.Load(); i != nil { + e = i.([]codecRtidFn) + } + return +} + +func (x *atomicRtidFnSlice) store(p []codecRtidFn) { + x.v.Store(p) +} + +// -------------------------- +func (n *decNaked) ru() reflect.Value { + return reflect.ValueOf(&n.u).Elem() +} +func (n *decNaked) ri() reflect.Value { + return reflect.ValueOf(&n.i).Elem() +} +func (n *decNaked) rf() reflect.Value { + return reflect.ValueOf(&n.f).Elem() +} +func (n *decNaked) rl() reflect.Value { + return reflect.ValueOf(&n.l).Elem() +} +func (n *decNaked) rs() reflect.Value { + return reflect.ValueOf(&n.s).Elem() +} +func (n *decNaked) rt() reflect.Value { + return reflect.ValueOf(&n.t).Elem() +} +func (n *decNaked) rb() reflect.Value { + return reflect.ValueOf(&n.b).Elem() +} + +// -------------------------- +func (d *Decoder) raw(f *codecFnInfo, rv reflect.Value) { + rv.SetBytes(d.rawBytes()) +} + +func (d *Decoder) kString(f *codecFnInfo, rv reflect.Value) { + rv.SetString(d.d.DecodeString()) +} + +func (d *Decoder) kBool(f *codecFnInfo, rv reflect.Value) { + rv.SetBool(d.d.DecodeBool()) +} + +func (d *Decoder) kTime(f *codecFnInfo, rv reflect.Value) { + rv.Set(reflect.ValueOf(d.d.DecodeTime())) +} + +func (d *Decoder) kFloat32(f *codecFnInfo, rv reflect.Value) { + fv := d.d.DecodeFloat64() + if chkOvf.Float32(fv) { + d.errorf("float32 overflow: %v", fv) + } + rv.SetFloat(fv) +} + +func (d *Decoder) kFloat64(f *codecFnInfo, rv reflect.Value) { + rv.SetFloat(d.d.DecodeFloat64()) +} + +func (d *Decoder) kInt(f *codecFnInfo, rv reflect.Value) { + rv.SetInt(chkOvf.IntV(d.d.DecodeInt64(), intBitsize)) +} + +func (d *Decoder) kInt8(f *codecFnInfo, rv reflect.Value) { + rv.SetInt(chkOvf.IntV(d.d.DecodeInt64(), 8)) +} + +func (d *Decoder) kInt16(f *codecFnInfo, rv reflect.Value) { + rv.SetInt(chkOvf.IntV(d.d.DecodeInt64(), 16)) +} + +func (d *Decoder) kInt32(f *codecFnInfo, rv reflect.Value) { + rv.SetInt(chkOvf.IntV(d.d.DecodeInt64(), 32)) +} + +func (d *Decoder) kInt64(f *codecFnInfo, rv reflect.Value) { + rv.SetInt(d.d.DecodeInt64()) +} + +func (d *Decoder) kUint(f *codecFnInfo, rv reflect.Value) { + rv.SetUint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize)) +} + +func (d *Decoder) kUintptr(f *codecFnInfo, rv reflect.Value) { + rv.SetUint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize)) +} + +func (d *Decoder) kUint8(f *codecFnInfo, rv reflect.Value) { + rv.SetUint(chkOvf.UintV(d.d.DecodeUint64(), 8)) +} + +func (d *Decoder) kUint16(f *codecFnInfo, rv reflect.Value) { + rv.SetUint(chkOvf.UintV(d.d.DecodeUint64(), 16)) +} + +func (d *Decoder) kUint32(f *codecFnInfo, rv reflect.Value) { + rv.SetUint(chkOvf.UintV(d.d.DecodeUint64(), 32)) +} + +func (d *Decoder) kUint64(f *codecFnInfo, rv reflect.Value) { + rv.SetUint(d.d.DecodeUint64()) +} + +// ---------------- + +func (e *Encoder) kBool(f *codecFnInfo, rv reflect.Value) { + e.e.EncodeBool(rv.Bool()) +} + +func (e *Encoder) kTime(f *codecFnInfo, rv reflect.Value) { + e.e.EncodeTime(rv2i(rv).(time.Time)) +} + +func (e *Encoder) kString(f *codecFnInfo, rv reflect.Value) { + s := rv.String() + if e.h.StringToRaw { + e.e.EncodeStringBytesRaw(bytesView(s)) + } else { + e.e.EncodeStringEnc(cUTF8, s) + } +} + +func (e *Encoder) kFloat64(f *codecFnInfo, rv reflect.Value) { + e.e.EncodeFloat64(rv.Float()) +} + +func (e *Encoder) kFloat32(f *codecFnInfo, rv reflect.Value) { + e.e.EncodeFloat32(float32(rv.Float())) +} + +func (e *Encoder) kInt(f *codecFnInfo, rv reflect.Value) { + e.e.EncodeInt(rv.Int()) +} + +func (e *Encoder) kInt8(f *codecFnInfo, rv reflect.Value) { + e.e.EncodeInt(rv.Int()) +} + +func (e *Encoder) kInt16(f *codecFnInfo, rv reflect.Value) { + e.e.EncodeInt(rv.Int()) +} + +func (e *Encoder) kInt32(f *codecFnInfo, rv reflect.Value) { + e.e.EncodeInt(rv.Int()) +} + +func (e *Encoder) kInt64(f *codecFnInfo, rv reflect.Value) { + e.e.EncodeInt(rv.Int()) +} + +func (e *Encoder) kUint(f *codecFnInfo, rv reflect.Value) { + e.e.EncodeUint(rv.Uint()) +} + +func (e *Encoder) kUint8(f *codecFnInfo, rv reflect.Value) { + e.e.EncodeUint(rv.Uint()) +} + +func (e *Encoder) kUint16(f *codecFnInfo, rv reflect.Value) { + e.e.EncodeUint(rv.Uint()) +} + +func (e *Encoder) kUint32(f *codecFnInfo, rv reflect.Value) { + e.e.EncodeUint(rv.Uint()) +} + +func (e *Encoder) kUint64(f *codecFnInfo, rv reflect.Value) { + e.e.EncodeUint(rv.Uint()) +} + +func (e *Encoder) kUintptr(f *codecFnInfo, rv reflect.Value) { + e.e.EncodeUint(rv.Uint()) +} + +// // keepAlive4BytesView maintains a reference to the input parameter for bytesView. +// // +// // Usage: call this at point where done with the bytes view. +// func keepAlive4BytesView(v string) {} + +// // keepAlive4BytesView maintains a reference to the input parameter for stringView. +// // +// // Usage: call this at point where done with the string view. +// func keepAlive4StringView(v []byte) {} + +// func definitelyNil(v interface{}) bool { +// rv := reflect.ValueOf(v) +// switch rv.Kind() { +// case reflect.Invalid: +// return true +// case reflect.Ptr, reflect.Interface, reflect.Chan, reflect.Slice, reflect.Map, reflect.Func: +// return rv.IsNil() +// default: +// return false +// } +// } diff --git a/vendor/github.com/ugorji/go/codec/helper_test.go b/vendor/github.com/ugorji/go/codec/helper_test.go new file mode 100644 index 000000000..a765fd4a4 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/helper_test.go @@ -0,0 +1,54 @@ +// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +package codec + +// All non-std package dependencies related to testing live in this file, +// so porting to different environment is easy (just update functions). + +import ( + "errors" + "reflect" +) + +// --- these functions are used by both benchmarks and tests + +func deepEqual(v1, v2 interface{}) (err error) { + if !reflect.DeepEqual(v1, v2) { + err = errors.New("Not Match") + } + return +} + +func approxDataSize(rv reflect.Value) (sum int) { + switch rk := rv.Kind(); rk { + case reflect.Invalid: + case reflect.Ptr, reflect.Interface: + sum += int(rv.Type().Size()) + sum += approxDataSize(rv.Elem()) + case reflect.Slice: + sum += int(rv.Type().Size()) + for j := 0; j < rv.Len(); j++ { + sum += approxDataSize(rv.Index(j)) + } + case reflect.String: + sum += int(rv.Type().Size()) + sum += rv.Len() + case reflect.Map: + sum += int(rv.Type().Size()) + for _, mk := range rv.MapKeys() { + sum += approxDataSize(mk) + sum += approxDataSize(rv.MapIndex(mk)) + } + case reflect.Struct: + //struct size already includes the full data size. + //sum += int(rv.Type().Size()) + for j := 0; j < rv.NumField(); j++ { + sum += approxDataSize(rv.Field(j)) + } + default: + //pure value types + sum += int(rv.Type().Size()) + } + return +} diff --git a/vendor/github.com/ugorji/go/codec/helper_unsafe.go b/vendor/github.com/ugorji/go/codec/helper_unsafe.go new file mode 100644 index 000000000..3bc34d90d --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/helper_unsafe.go @@ -0,0 +1,745 @@ +// +build !safe +// +build !appengine +// +build go1.7 + +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +package codec + +import ( + "reflect" + "sync/atomic" + "time" + "unsafe" +) + +// This file has unsafe variants of some helper methods. +// NOTE: See helper_not_unsafe.go for the usage information. + +// var zeroRTv [4]uintptr + +const safeMode = false +const unsafeFlagIndir = 1 << 7 // keep in sync with GO_ROOT/src/reflect/value.go + +type unsafeString struct { + Data unsafe.Pointer + Len int +} + +type unsafeSlice struct { + Data unsafe.Pointer + Len int + Cap int +} + +type unsafeIntf struct { + typ unsafe.Pointer + word unsafe.Pointer +} + +type unsafeReflectValue struct { + typ unsafe.Pointer + ptr unsafe.Pointer + flag uintptr +} + +func stringView(v []byte) string { + if len(v) == 0 { + return "" + } + bx := (*unsafeSlice)(unsafe.Pointer(&v)) + return *(*string)(unsafe.Pointer(&unsafeString{bx.Data, bx.Len})) +} + +func bytesView(v string) []byte { + if len(v) == 0 { + return zeroByteSlice + } + sx := (*unsafeString)(unsafe.Pointer(&v)) + return *(*[]byte)(unsafe.Pointer(&unsafeSlice{sx.Data, sx.Len, sx.Len})) +} + +func definitelyNil(v interface{}) bool { + // There is no global way of checking if an interface is nil. + // For true references (map, ptr, func, chan), you can just look + // at the word of the interface. However, for slices, you have to dereference + // the word, and get a pointer to the 3-word interface value. + // + // However, the following are cheap calls + // - TypeOf(interface): cheap 2-line call. + // - ValueOf(interface{}): expensive + // - type.Kind: cheap call through an interface + // - Value.Type(): cheap call + // except it's a method value (e.g. r.Read, which implies that it is a Func) + + return ((*unsafeIntf)(unsafe.Pointer(&v))).word == nil +} + +func rv2i(rv reflect.Value) interface{} { + // TODO: consider a more generally-known optimization for reflect.Value ==> Interface + // + // Currently, we use this fragile method that taps into implememtation details from + // the source go stdlib reflect/value.go, and trims the implementation. + + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + // true references (map, func, chan, ptr - NOT slice) may be double-referenced as flagIndir + var ptr unsafe.Pointer + if refBitset.isset(byte(urv.flag&(1<<5-1))) && urv.flag&unsafeFlagIndir != 0 { + ptr = *(*unsafe.Pointer)(urv.ptr) + } else { + ptr = urv.ptr + } + return *(*interface{})(unsafe.Pointer(&unsafeIntf{typ: urv.typ, word: ptr})) +} + +func rt2id(rt reflect.Type) uintptr { + return uintptr(((*unsafeIntf)(unsafe.Pointer(&rt))).word) +} + +// func rv2rtid(rv reflect.Value) uintptr { +// return uintptr((*unsafeReflectValue)(unsafe.Pointer(&rv)).typ) +// } + +func i2rtid(i interface{}) uintptr { + return uintptr(((*unsafeIntf)(unsafe.Pointer(&i))).typ) +} + +// -------------------------- + +func isEmptyValue(v reflect.Value, tinfos *TypeInfos, deref, checkStruct bool) bool { + urv := (*unsafeReflectValue)(unsafe.Pointer(&v)) + if urv.flag == 0 { + return true + } + switch v.Kind() { + case reflect.Invalid: + return true + case reflect.String: + return (*unsafeString)(urv.ptr).Len == 0 + case reflect.Slice: + return (*unsafeSlice)(urv.ptr).Len == 0 + case reflect.Bool: + return !*(*bool)(urv.ptr) + case reflect.Int: + return *(*int)(urv.ptr) == 0 + case reflect.Int8: + return *(*int8)(urv.ptr) == 0 + case reflect.Int16: + return *(*int16)(urv.ptr) == 0 + case reflect.Int32: + return *(*int32)(urv.ptr) == 0 + case reflect.Int64: + return *(*int64)(urv.ptr) == 0 + case reflect.Uint: + return *(*uint)(urv.ptr) == 0 + case reflect.Uint8: + return *(*uint8)(urv.ptr) == 0 + case reflect.Uint16: + return *(*uint16)(urv.ptr) == 0 + case reflect.Uint32: + return *(*uint32)(urv.ptr) == 0 + case reflect.Uint64: + return *(*uint64)(urv.ptr) == 0 + case reflect.Uintptr: + return *(*uintptr)(urv.ptr) == 0 + case reflect.Float32: + return *(*float32)(urv.ptr) == 0 + case reflect.Float64: + return *(*float64)(urv.ptr) == 0 + case reflect.Interface: + isnil := urv.ptr == nil || *(*unsafe.Pointer)(urv.ptr) == nil + if deref { + if isnil { + return true + } + return isEmptyValue(v.Elem(), tinfos, deref, checkStruct) + } + return isnil + case reflect.Ptr: + // isnil := urv.ptr == nil (not sufficient, as a pointer value encodes the type) + isnil := urv.ptr == nil || *(*unsafe.Pointer)(urv.ptr) == nil + if deref { + if isnil { + return true + } + return isEmptyValue(v.Elem(), tinfos, deref, checkStruct) + } + return isnil + case reflect.Struct: + return isEmptyStruct(v, tinfos, deref, checkStruct) + case reflect.Map, reflect.Array, reflect.Chan: + return v.Len() == 0 + } + return false +} + +// -------------------------- + +// atomicXXX is expected to be 2 words (for symmetry with atomic.Value) +// +// Note that we do not atomically load/store length and data pointer separately, +// as this could lead to some races. Instead, we atomically load/store cappedSlice. +// +// Note: with atomic.(Load|Store)Pointer, we MUST work with an unsafe.Pointer directly. + +// ---------------------- +type atomicTypeInfoSlice struct { + v unsafe.Pointer // *[]rtid2ti + _ uintptr // padding (atomicXXX expected to be 2 words) +} + +func (x *atomicTypeInfoSlice) load() (s []rtid2ti) { + x2 := atomic.LoadPointer(&x.v) + if x2 != nil { + s = *(*[]rtid2ti)(x2) + } + return +} + +func (x *atomicTypeInfoSlice) store(p []rtid2ti) { + atomic.StorePointer(&x.v, unsafe.Pointer(&p)) +} + +// -------------------------- +type atomicRtidFnSlice struct { + v unsafe.Pointer // *[]codecRtidFn + _ uintptr // padding (atomicXXX expected to be 2 words) +} + +func (x *atomicRtidFnSlice) load() (s []codecRtidFn) { + x2 := atomic.LoadPointer(&x.v) + if x2 != nil { + s = *(*[]codecRtidFn)(x2) + } + return +} + +func (x *atomicRtidFnSlice) store(p []codecRtidFn) { + atomic.StorePointer(&x.v, unsafe.Pointer(&p)) +} + +// -------------------------- +type atomicClsErr struct { + v unsafe.Pointer // *clsErr + _ uintptr // padding (atomicXXX expected to be 2 words) +} + +func (x *atomicClsErr) load() (e clsErr) { + x2 := (*clsErr)(atomic.LoadPointer(&x.v)) + if x2 != nil { + e = *x2 + } + return +} + +func (x *atomicClsErr) store(p clsErr) { + atomic.StorePointer(&x.v, unsafe.Pointer(&p)) +} + +// -------------------------- + +// to create a reflect.Value for each member field of decNaked, +// we first create a global decNaked, and create reflect.Value +// for them all. +// This way, we have the flags and type in the reflect.Value. +// Then, when a reflect.Value is called, we just copy it, +// update the ptr to the decNaked's, and return it. + +type unsafeDecNakedWrapper struct { + decNaked + ru, ri, rf, rl, rs, rb, rt reflect.Value // mapping to the primitives above +} + +func (n *unsafeDecNakedWrapper) init() { + n.ru = reflect.ValueOf(&n.u).Elem() + n.ri = reflect.ValueOf(&n.i).Elem() + n.rf = reflect.ValueOf(&n.f).Elem() + n.rl = reflect.ValueOf(&n.l).Elem() + n.rs = reflect.ValueOf(&n.s).Elem() + n.rt = reflect.ValueOf(&n.t).Elem() + n.rb = reflect.ValueOf(&n.b).Elem() + // n.rr[] = reflect.ValueOf(&n.) +} + +var defUnsafeDecNakedWrapper unsafeDecNakedWrapper + +func init() { + defUnsafeDecNakedWrapper.init() +} + +func (n *decNaked) ru() (v reflect.Value) { + v = defUnsafeDecNakedWrapper.ru + ((*unsafeReflectValue)(unsafe.Pointer(&v))).ptr = unsafe.Pointer(&n.u) + return +} +func (n *decNaked) ri() (v reflect.Value) { + v = defUnsafeDecNakedWrapper.ri + ((*unsafeReflectValue)(unsafe.Pointer(&v))).ptr = unsafe.Pointer(&n.i) + return +} +func (n *decNaked) rf() (v reflect.Value) { + v = defUnsafeDecNakedWrapper.rf + ((*unsafeReflectValue)(unsafe.Pointer(&v))).ptr = unsafe.Pointer(&n.f) + return +} +func (n *decNaked) rl() (v reflect.Value) { + v = defUnsafeDecNakedWrapper.rl + ((*unsafeReflectValue)(unsafe.Pointer(&v))).ptr = unsafe.Pointer(&n.l) + return +} +func (n *decNaked) rs() (v reflect.Value) { + v = defUnsafeDecNakedWrapper.rs + ((*unsafeReflectValue)(unsafe.Pointer(&v))).ptr = unsafe.Pointer(&n.s) + return +} +func (n *decNaked) rt() (v reflect.Value) { + v = defUnsafeDecNakedWrapper.rt + ((*unsafeReflectValue)(unsafe.Pointer(&v))).ptr = unsafe.Pointer(&n.t) + return +} +func (n *decNaked) rb() (v reflect.Value) { + v = defUnsafeDecNakedWrapper.rb + ((*unsafeReflectValue)(unsafe.Pointer(&v))).ptr = unsafe.Pointer(&n.b) + return +} + +// -------------------------- +func (d *Decoder) raw(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*[]byte)(urv.ptr) = d.rawBytes() +} + +func (d *Decoder) kString(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*string)(urv.ptr) = d.d.DecodeString() +} + +func (d *Decoder) kBool(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*bool)(urv.ptr) = d.d.DecodeBool() +} + +func (d *Decoder) kTime(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*time.Time)(urv.ptr) = d.d.DecodeTime() +} + +func (d *Decoder) kFloat32(f *codecFnInfo, rv reflect.Value) { + fv := d.d.DecodeFloat64() + if chkOvf.Float32(fv) { + d.errorf("float32 overflow: %v", fv) + } + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*float32)(urv.ptr) = float32(fv) +} + +func (d *Decoder) kFloat64(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*float64)(urv.ptr) = d.d.DecodeFloat64() +} + +func (d *Decoder) kInt(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*int)(urv.ptr) = int(chkOvf.IntV(d.d.DecodeInt64(), intBitsize)) +} + +func (d *Decoder) kInt8(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*int8)(urv.ptr) = int8(chkOvf.IntV(d.d.DecodeInt64(), 8)) +} + +func (d *Decoder) kInt16(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*int16)(urv.ptr) = int16(chkOvf.IntV(d.d.DecodeInt64(), 16)) +} + +func (d *Decoder) kInt32(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*int32)(urv.ptr) = int32(chkOvf.IntV(d.d.DecodeInt64(), 32)) +} + +func (d *Decoder) kInt64(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*int64)(urv.ptr) = d.d.DecodeInt64() +} + +func (d *Decoder) kUint(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*uint)(urv.ptr) = uint(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize)) +} + +func (d *Decoder) kUintptr(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*uintptr)(urv.ptr) = uintptr(chkOvf.UintV(d.d.DecodeUint64(), uintBitsize)) +} + +func (d *Decoder) kUint8(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*uint8)(urv.ptr) = uint8(chkOvf.UintV(d.d.DecodeUint64(), 8)) +} + +func (d *Decoder) kUint16(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*uint16)(urv.ptr) = uint16(chkOvf.UintV(d.d.DecodeUint64(), 16)) +} + +func (d *Decoder) kUint32(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*uint32)(urv.ptr) = uint32(chkOvf.UintV(d.d.DecodeUint64(), 32)) +} + +func (d *Decoder) kUint64(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*uint64)(urv.ptr) = d.d.DecodeUint64() +} + +// ------------ + +func (e *Encoder) kBool(f *codecFnInfo, rv reflect.Value) { + v := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + e.e.EncodeBool(*(*bool)(v.ptr)) +} + +func (e *Encoder) kTime(f *codecFnInfo, rv reflect.Value) { + v := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + e.e.EncodeTime(*(*time.Time)(v.ptr)) +} + +func (e *Encoder) kString(f *codecFnInfo, rv reflect.Value) { + v := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + s := *(*string)(v.ptr) + if e.h.StringToRaw { + e.e.EncodeStringBytesRaw(bytesView(s)) + } else { + e.e.EncodeStringEnc(cUTF8, s) + } +} + +func (e *Encoder) kFloat64(f *codecFnInfo, rv reflect.Value) { + v := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + e.e.EncodeFloat64(*(*float64)(v.ptr)) +} + +func (e *Encoder) kFloat32(f *codecFnInfo, rv reflect.Value) { + v := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + e.e.EncodeFloat32(*(*float32)(v.ptr)) +} + +func (e *Encoder) kInt(f *codecFnInfo, rv reflect.Value) { + v := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + e.e.EncodeInt(int64(*(*int)(v.ptr))) +} + +func (e *Encoder) kInt8(f *codecFnInfo, rv reflect.Value) { + v := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + e.e.EncodeInt(int64(*(*int8)(v.ptr))) +} + +func (e *Encoder) kInt16(f *codecFnInfo, rv reflect.Value) { + v := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + e.e.EncodeInt(int64(*(*int16)(v.ptr))) +} + +func (e *Encoder) kInt32(f *codecFnInfo, rv reflect.Value) { + v := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + e.e.EncodeInt(int64(*(*int32)(v.ptr))) +} + +func (e *Encoder) kInt64(f *codecFnInfo, rv reflect.Value) { + v := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + e.e.EncodeInt(int64(*(*int64)(v.ptr))) +} + +func (e *Encoder) kUint(f *codecFnInfo, rv reflect.Value) { + v := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + e.e.EncodeUint(uint64(*(*uint)(v.ptr))) +} + +func (e *Encoder) kUint8(f *codecFnInfo, rv reflect.Value) { + v := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + e.e.EncodeUint(uint64(*(*uint8)(v.ptr))) +} + +func (e *Encoder) kUint16(f *codecFnInfo, rv reflect.Value) { + v := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + e.e.EncodeUint(uint64(*(*uint16)(v.ptr))) +} + +func (e *Encoder) kUint32(f *codecFnInfo, rv reflect.Value) { + v := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + e.e.EncodeUint(uint64(*(*uint32)(v.ptr))) +} + +func (e *Encoder) kUint64(f *codecFnInfo, rv reflect.Value) { + v := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + e.e.EncodeUint(uint64(*(*uint64)(v.ptr))) +} + +func (e *Encoder) kUintptr(f *codecFnInfo, rv reflect.Value) { + v := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + e.e.EncodeUint(uint64(*(*uintptr)(v.ptr))) +} + +// ------------ + +// func (d *Decoder) raw(f *codecFnInfo, rv reflect.Value) { +// urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) +// // if urv.flag&unsafeFlagIndir != 0 { +// // urv.ptr = *(*unsafe.Pointer)(urv.ptr) +// // } +// *(*[]byte)(urv.ptr) = d.rawBytes() +// } + +// func rv0t(rt reflect.Type) reflect.Value { +// ut := (*unsafeIntf)(unsafe.Pointer(&rt)) +// // we need to determine whether ifaceIndir, and then whether to just pass 0 as the ptr +// uv := unsafeReflectValue{ut.word, &zeroRTv, flag(rt.Kind())} +// return *(*reflect.Value)(unsafe.Pointer(&uv}) +// } + +// func rv2i(rv reflect.Value) interface{} { +// urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) +// // true references (map, func, chan, ptr - NOT slice) may be double-referenced as flagIndir +// var ptr unsafe.Pointer +// // kk := reflect.Kind(urv.flag & (1<<5 - 1)) +// // if (kk == reflect.Map || kk == reflect.Ptr || kk == reflect.Chan || kk == reflect.Func) && urv.flag&unsafeFlagIndir != 0 { +// if refBitset.isset(byte(urv.flag&(1<<5-1))) && urv.flag&unsafeFlagIndir != 0 { +// ptr = *(*unsafe.Pointer)(urv.ptr) +// } else { +// ptr = urv.ptr +// } +// return *(*interface{})(unsafe.Pointer(&unsafeIntf{typ: urv.typ, word: ptr})) +// // return *(*interface{})(unsafe.Pointer(&unsafeIntf{word: *(*unsafe.Pointer)(urv.ptr), typ: urv.typ})) +// // return *(*interface{})(unsafe.Pointer(&unsafeIntf{word: urv.ptr, typ: urv.typ})) +// } + +// func definitelyNil(v interface{}) bool { +// var ui *unsafeIntf = (*unsafeIntf)(unsafe.Pointer(&v)) +// if ui.word == nil { +// return true +// } +// var tk = reflect.TypeOf(v).Kind() +// return (tk == reflect.Interface || tk == reflect.Slice) && *(*unsafe.Pointer)(ui.word) == nil +// fmt.Printf(">>>> definitely nil: isnil: %v, TYPE: \t%T, word: %v, *word: %v, type: %v, nil: %v\n", +// v == nil, v, word, *((*unsafe.Pointer)(word)), ui.typ, nil) +// } + +// func keepAlive4BytesView(v string) { +// runtime.KeepAlive(v) +// } + +// func keepAlive4StringView(v []byte) { +// runtime.KeepAlive(v) +// } + +// func rt2id(rt reflect.Type) uintptr { +// return uintptr(((*unsafeIntf)(unsafe.Pointer(&rt))).word) +// // var i interface{} = rt +// // // ui := (*unsafeIntf)(unsafe.Pointer(&i)) +// // return ((*unsafeIntf)(unsafe.Pointer(&i))).word +// } + +// func rv2i(rv reflect.Value) interface{} { +// urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) +// // non-reference type: already indir +// // reference type: depend on flagIndir property ('cos maybe was double-referenced) +// // const (unsafeRvFlagKindMask = 1<<5 - 1 , unsafeRvFlagIndir = 1 << 7 ) +// // rvk := reflect.Kind(urv.flag & (1<<5 - 1)) +// // if (rvk == reflect.Chan || +// // rvk == reflect.Func || +// // rvk == reflect.Interface || +// // rvk == reflect.Map || +// // rvk == reflect.Ptr || +// // rvk == reflect.UnsafePointer) && urv.flag&(1<<8) != 0 { +// // fmt.Printf(">>>>> ---- double indirect reference: %v, %v\n", rvk, rv.Type()) +// // return *(*interface{})(unsafe.Pointer(&unsafeIntf{word: *(*unsafe.Pointer)(urv.ptr), typ: urv.typ})) +// // } +// if urv.flag&(1<<5-1) == uintptr(reflect.Map) && urv.flag&(1<<7) != 0 { +// // fmt.Printf(">>>>> ---- double indirect reference: %v, %v\n", rvk, rv.Type()) +// return *(*interface{})(unsafe.Pointer(&unsafeIntf{word: *(*unsafe.Pointer)(urv.ptr), typ: urv.typ})) +// } +// // fmt.Printf(">>>>> ++++ direct reference: %v, %v\n", rvk, rv.Type()) +// return *(*interface{})(unsafe.Pointer(&unsafeIntf{word: urv.ptr, typ: urv.typ})) +// } + +// const ( +// unsafeRvFlagKindMask = 1<<5 - 1 +// unsafeRvKindDirectIface = 1 << 5 +// unsafeRvFlagIndir = 1 << 7 +// unsafeRvFlagAddr = 1 << 8 +// unsafeRvFlagMethod = 1 << 9 + +// _USE_RV_INTERFACE bool = false +// _UNSAFE_RV_DEBUG = true +// ) + +// type unsafeRtype struct { +// _ [2]uintptr +// _ uint32 +// _ uint8 +// _ uint8 +// _ uint8 +// kind uint8 +// _ [2]uintptr +// _ int32 +// } + +// func _rv2i(rv reflect.Value) interface{} { +// // Note: From use, +// // - it's never an interface +// // - the only calls here are for ifaceIndir types. +// // (though that conditional is wrong) +// // To know for sure, we need the value of t.kind (which is not exposed). +// // +// // Need to validate the path: type is indirect ==> only value is indirect ==> default (value is direct) +// // - Type indirect, Value indirect: ==> numbers, boolean, slice, struct, array, string +// // - Type Direct, Value indirect: ==> map??? +// // - Type Direct, Value direct: ==> pointers, unsafe.Pointer, func, chan, map +// // +// // TRANSLATES TO: +// // if typeIndirect { } else if valueIndirect { } else { } +// // +// // Since we don't deal with funcs, then "flagNethod" is unset, and can be ignored. + +// if _USE_RV_INTERFACE { +// return rv.Interface() +// } +// urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + +// // if urv.flag&unsafeRvFlagMethod != 0 || urv.flag&unsafeRvFlagKindMask == uintptr(reflect.Interface) { +// // println("***** IS flag method or interface: delegating to rv.Interface()") +// // return rv.Interface() +// // } + +// // if urv.flag&unsafeRvFlagKindMask == uintptr(reflect.Interface) { +// // println("***** IS Interface: delegate to rv.Interface") +// // return rv.Interface() +// // } +// // if urv.flag&unsafeRvFlagKindMask&unsafeRvKindDirectIface == 0 { +// // if urv.flag&unsafeRvFlagAddr == 0 { +// // println("***** IS ifaceIndir typ") +// // // ui := unsafeIntf{word: urv.ptr, typ: urv.typ} +// // // return *(*interface{})(unsafe.Pointer(&ui)) +// // // return *(*interface{})(unsafe.Pointer(&unsafeIntf{word: urv.ptr, typ: urv.typ})) +// // } +// // } else if urv.flag&unsafeRvFlagIndir != 0 { +// // println("***** IS flagindir") +// // // return *(*interface{})(unsafe.Pointer(&unsafeIntf{word: *(*unsafe.Pointer)(urv.ptr), typ: urv.typ})) +// // } else { +// // println("***** NOT flagindir") +// // return *(*interface{})(unsafe.Pointer(&unsafeIntf{word: urv.ptr, typ: urv.typ})) +// // } +// // println("***** default: delegate to rv.Interface") + +// urt := (*unsafeRtype)(unsafe.Pointer(urv.typ)) +// if _UNSAFE_RV_DEBUG { +// fmt.Printf(">>>> start: %v: ", rv.Type()) +// fmt.Printf("%v - %v\n", *urv, *urt) +// } +// if urt.kind&unsafeRvKindDirectIface == 0 { +// if _UNSAFE_RV_DEBUG { +// fmt.Printf("**** +ifaceIndir type: %v\n", rv.Type()) +// } +// // println("***** IS ifaceIndir typ") +// // if true || urv.flag&unsafeRvFlagAddr == 0 { +// // // println(" ***** IS NOT addr") +// return *(*interface{})(unsafe.Pointer(&unsafeIntf{word: urv.ptr, typ: urv.typ})) +// // } +// } else if urv.flag&unsafeRvFlagIndir != 0 { +// if _UNSAFE_RV_DEBUG { +// fmt.Printf("**** +flagIndir type: %v\n", rv.Type()) +// } +// // println("***** IS flagindir") +// return *(*interface{})(unsafe.Pointer(&unsafeIntf{word: *(*unsafe.Pointer)(urv.ptr), typ: urv.typ})) +// } else { +// if _UNSAFE_RV_DEBUG { +// fmt.Printf("**** -flagIndir type: %v\n", rv.Type()) +// } +// // println("***** NOT flagindir") +// return *(*interface{})(unsafe.Pointer(&unsafeIntf{word: urv.ptr, typ: urv.typ})) +// } +// // println("***** default: delegating to rv.Interface()") +// // return rv.Interface() +// } + +// var staticM0 = make(map[string]uint64) +// var staticI0 = (int32)(-5) + +// func staticRv2iTest() { +// i0 := (int32)(-5) +// m0 := make(map[string]uint16) +// m0["1"] = 1 +// for _, i := range []interface{}{ +// (int)(7), +// (uint)(8), +// (int16)(-9), +// (uint16)(19), +// (uintptr)(77), +// (bool)(true), +// float32(-32.7), +// float64(64.9), +// complex(float32(19), 5), +// complex(float64(-32), 7), +// [4]uint64{1, 2, 3, 4}, +// (chan<- int)(nil), // chan, +// rv2i, // func +// io.Writer(ioutil.Discard), +// make(map[string]uint), +// (map[string]uint)(nil), +// staticM0, +// m0, +// &m0, +// i0, +// &i0, +// &staticI0, +// &staticM0, +// []uint32{6, 7, 8}, +// "abc", +// Raw{}, +// RawExt{}, +// &Raw{}, +// &RawExt{}, +// unsafe.Pointer(&i0), +// } { +// i2 := rv2i(reflect.ValueOf(i)) +// eq := reflect.DeepEqual(i, i2) +// fmt.Printf(">>>> %v == %v? %v\n", i, i2, eq) +// } +// // os.Exit(0) +// } + +// func init() { +// staticRv2iTest() +// } + +// func rv2i(rv reflect.Value) interface{} { +// if _USE_RV_INTERFACE || rv.Kind() == reflect.Interface || rv.CanAddr() { +// return rv.Interface() +// } +// // var i interface{} +// // ui := (*unsafeIntf)(unsafe.Pointer(&i)) +// var ui unsafeIntf +// urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) +// // fmt.Printf("urv: flag: %b, typ: %b, ptr: %b\n", urv.flag, uintptr(urv.typ), uintptr(urv.ptr)) +// if (urv.flag&unsafeRvFlagKindMask)&unsafeRvKindDirectIface == 0 { +// if urv.flag&unsafeRvFlagAddr != 0 { +// println("***** indirect and addressable! Needs typed move - delegate to rv.Interface()") +// return rv.Interface() +// } +// println("****** indirect type/kind") +// ui.word = urv.ptr +// } else if urv.flag&unsafeRvFlagIndir != 0 { +// println("****** unsafe rv flag indir") +// ui.word = *(*unsafe.Pointer)(urv.ptr) +// } else { +// println("****** default: assign prt to word directly") +// ui.word = urv.ptr +// } +// // ui.word = urv.ptr +// ui.typ = urv.typ +// // fmt.Printf("(pointers) ui.typ: %p, word: %p\n", ui.typ, ui.word) +// // fmt.Printf("(binary) ui.typ: %b, word: %b\n", uintptr(ui.typ), uintptr(ui.word)) +// return *(*interface{})(unsafe.Pointer(&ui)) +// // return i +// } diff --git a/vendor/github.com/ugorji/go/codec/json.go b/vendor/github.com/ugorji/go/codec/json.go new file mode 100644 index 000000000..619bc5b52 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/json.go @@ -0,0 +1,1508 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +package codec + +// By default, this json support uses base64 encoding for bytes, because you cannot +// store and read any arbitrary string in json (only unicode). +// However, the user can configre how to encode/decode bytes. +// +// This library specifically supports UTF-8 for encoding and decoding only. +// +// Note that the library will happily encode/decode things which are not valid +// json e.g. a map[int64]string. We do it for consistency. With valid json, +// we will encode and decode appropriately. +// Users can specify their map type if necessary to force it. +// +// Note: +// - we cannot use strconv.Quote and strconv.Unquote because json quotes/unquotes differently. +// We implement it here. + +// Top-level methods of json(End|Dec)Driver (which are implementations of (en|de)cDriver +// MUST not call one-another. + +import ( + "bytes" + "encoding/base64" + "math" + "reflect" + "strconv" + "time" + "unicode" + "unicode/utf16" + "unicode/utf8" +) + +//-------------------------------- + +var jsonLiterals = [...]byte{ + '"', 't', 'r', 'u', 'e', '"', + '"', 'f', 'a', 'l', 's', 'e', '"', + '"', 'n', 'u', 'l', 'l', '"', +} + +const ( + jsonLitTrueQ = 0 + jsonLitTrue = 1 + jsonLitFalseQ = 6 + jsonLitFalse = 7 + // jsonLitNullQ = 13 + jsonLitNull = 14 +) + +var ( + jsonLiteral4True = jsonLiterals[jsonLitTrue+1 : jsonLitTrue+4] + jsonLiteral4False = jsonLiterals[jsonLitFalse+1 : jsonLitFalse+5] + jsonLiteral4Null = jsonLiterals[jsonLitNull+1 : jsonLitNull+4] +) + +const ( + jsonU4Chk2 = '0' + jsonU4Chk1 = 'a' - 10 + jsonU4Chk0 = 'A' - 10 + + jsonScratchArrayLen = 64 +) + +const ( + // If !jsonValidateSymbols, decoding will be faster, by skipping some checks: + // - If we see first character of null, false or true, + // do not validate subsequent characters. + // - e.g. if we see a n, assume null and skip next 3 characters, + // and do not validate they are ull. + // P.S. Do not expect a significant decoding boost from this. + jsonValidateSymbols = true + + jsonSpacesOrTabsLen = 128 + + jsonAlwaysReturnInternString = false +) + +var ( + // jsonTabs and jsonSpaces are used as caches for indents + jsonTabs, jsonSpaces [jsonSpacesOrTabsLen]byte + + jsonCharHtmlSafeSet bitset256 + jsonCharSafeSet bitset256 + jsonCharWhitespaceSet bitset256 + jsonNumSet bitset256 +) + +func init() { + var i byte + for i = 0; i < jsonSpacesOrTabsLen; i++ { + jsonSpaces[i] = ' ' + jsonTabs[i] = '\t' + } + + // populate the safe values as true: note: ASCII control characters are (0-31) + // jsonCharSafeSet: all true except (0-31) " \ + // jsonCharHtmlSafeSet: all true except (0-31) " \ < > & + for i = 32; i < utf8.RuneSelf; i++ { + switch i { + case '"', '\\': + case '<', '>', '&': + jsonCharSafeSet.set(i) // = true + default: + jsonCharSafeSet.set(i) + jsonCharHtmlSafeSet.set(i) + } + } + for i = 0; i <= utf8.RuneSelf; i++ { + switch i { + case ' ', '\t', '\r', '\n': + jsonCharWhitespaceSet.set(i) + case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'e', 'E', '.', '+', '-': + jsonNumSet.set(i) + } + } +} + +// ---------------- + +type jsonEncDriverTypical struct { + w *encWriterSwitch + b *[jsonScratchArrayLen]byte + tw bool // term white space + c containerState +} + +func (e *jsonEncDriverTypical) typical() {} + +func (e *jsonEncDriverTypical) reset(ee *jsonEncDriver) { + e.w = ee.ew + e.b = &ee.b + e.tw = ee.h.TermWhitespace + e.c = 0 +} + +func (e *jsonEncDriverTypical) WriteArrayStart(length int) { + e.w.writen1('[') + e.c = containerArrayStart +} + +func (e *jsonEncDriverTypical) WriteArrayElem() { + if e.c != containerArrayStart { + e.w.writen1(',') + } + e.c = containerArrayElem +} + +func (e *jsonEncDriverTypical) WriteArrayEnd() { + e.w.writen1(']') + e.c = containerArrayEnd +} + +func (e *jsonEncDriverTypical) WriteMapStart(length int) { + e.w.writen1('{') + e.c = containerMapStart +} + +func (e *jsonEncDriverTypical) WriteMapElemKey() { + if e.c != containerMapStart { + e.w.writen1(',') + } + e.c = containerMapKey +} + +func (e *jsonEncDriverTypical) WriteMapElemValue() { + e.w.writen1(':') + e.c = containerMapValue +} + +func (e *jsonEncDriverTypical) WriteMapEnd() { + e.w.writen1('}') + e.c = containerMapEnd +} + +func (e *jsonEncDriverTypical) EncodeBool(b bool) { + if b { + e.w.writeb(jsonLiterals[jsonLitTrue : jsonLitTrue+4]) + } else { + e.w.writeb(jsonLiterals[jsonLitFalse : jsonLitFalse+5]) + } +} + +func (e *jsonEncDriverTypical) EncodeFloat64(f float64) { + fmt, prec := jsonFloatStrconvFmtPrec(f) + e.w.writeb(strconv.AppendFloat(e.b[:0], f, fmt, prec, 64)) +} + +func (e *jsonEncDriverTypical) EncodeInt(v int64) { + e.w.writeb(strconv.AppendInt(e.b[:0], v, 10)) +} + +func (e *jsonEncDriverTypical) EncodeUint(v uint64) { + e.w.writeb(strconv.AppendUint(e.b[:0], v, 10)) +} + +func (e *jsonEncDriverTypical) EncodeFloat32(f float32) { + e.EncodeFloat64(float64(f)) +} + +func (e *jsonEncDriverTypical) atEndOfEncode() { + if e.tw { + e.w.writen1(' ') + } +} + +// ---------------- + +type jsonEncDriverGeneric struct { + w *encWriterSwitch + b *[jsonScratchArrayLen]byte + c containerState + // ds string // indent string + di int8 // indent per + d bool // indenting? + dt bool // indent using tabs + dl uint16 // indent level + ks bool // map key as string + is byte // integer as string + tw bool // term white space + _ [7]byte // padding +} + +// indent is done as below: +// - newline and indent are added before each mapKey or arrayElem +// - newline and indent are added before each ending, +// except there was no entry (so we can have {} or []) + +func (e *jsonEncDriverGeneric) reset(ee *jsonEncDriver) { + e.w = ee.ew + e.b = &ee.b + e.tw = ee.h.TermWhitespace + e.c = 0 + e.d, e.dt, e.dl, e.di = false, false, 0, 0 + h := ee.h + if h.Indent > 0 { + e.d = true + e.di = int8(h.Indent) + } else if h.Indent < 0 { + e.d = true + e.dt = true + e.di = int8(-h.Indent) + } + e.ks = h.MapKeyAsString + e.is = h.IntegerAsString +} + +func (e *jsonEncDriverGeneric) WriteArrayStart(length int) { + if e.d { + e.dl++ + } + e.w.writen1('[') + e.c = containerArrayStart +} + +func (e *jsonEncDriverGeneric) WriteArrayElem() { + if e.c != containerArrayStart { + e.w.writen1(',') + } + if e.d { + e.writeIndent() + } + e.c = containerArrayElem +} + +func (e *jsonEncDriverGeneric) WriteArrayEnd() { + if e.d { + e.dl-- + if e.c != containerArrayStart { + e.writeIndent() + } + } + e.w.writen1(']') + e.c = containerArrayEnd +} + +func (e *jsonEncDriverGeneric) WriteMapStart(length int) { + if e.d { + e.dl++ + } + e.w.writen1('{') + e.c = containerMapStart +} + +func (e *jsonEncDriverGeneric) WriteMapElemKey() { + if e.c != containerMapStart { + e.w.writen1(',') + } + if e.d { + e.writeIndent() + } + e.c = containerMapKey +} + +func (e *jsonEncDriverGeneric) WriteMapElemValue() { + if e.d { + e.w.writen2(':', ' ') + } else { + e.w.writen1(':') + } + e.c = containerMapValue +} + +func (e *jsonEncDriverGeneric) WriteMapEnd() { + if e.d { + e.dl-- + if e.c != containerMapStart { + e.writeIndent() + } + } + e.w.writen1('}') + e.c = containerMapEnd +} + +func (e *jsonEncDriverGeneric) writeIndent() { + e.w.writen1('\n') + x := int(e.di) * int(e.dl) + if e.dt { + for x > jsonSpacesOrTabsLen { + e.w.writeb(jsonTabs[:]) + x -= jsonSpacesOrTabsLen + } + e.w.writeb(jsonTabs[:x]) + } else { + for x > jsonSpacesOrTabsLen { + e.w.writeb(jsonSpaces[:]) + x -= jsonSpacesOrTabsLen + } + e.w.writeb(jsonSpaces[:x]) + } +} + +func (e *jsonEncDriverGeneric) EncodeBool(b bool) { + if e.ks && e.c == containerMapKey { + if b { + e.w.writeb(jsonLiterals[jsonLitTrueQ : jsonLitTrueQ+6]) + } else { + e.w.writeb(jsonLiterals[jsonLitFalseQ : jsonLitFalseQ+7]) + } + } else { + if b { + e.w.writeb(jsonLiterals[jsonLitTrue : jsonLitTrue+4]) + } else { + e.w.writeb(jsonLiterals[jsonLitFalse : jsonLitFalse+5]) + } + } +} + +func (e *jsonEncDriverGeneric) EncodeFloat64(f float64) { + // instead of using 'g', specify whether to use 'e' or 'f' + fmt, prec := jsonFloatStrconvFmtPrec(f) + + var blen int + if e.ks && e.c == containerMapKey { + blen = 2 + len(strconv.AppendFloat(e.b[1:1], f, fmt, prec, 64)) + e.b[0] = '"' + e.b[blen-1] = '"' + } else { + blen = len(strconv.AppendFloat(e.b[:0], f, fmt, prec, 64)) + } + e.w.writeb(e.b[:blen]) +} + +func (e *jsonEncDriverGeneric) EncodeInt(v int64) { + x := e.is + if x == 'A' || x == 'L' && (v > 1<<53 || v < -(1<<53)) || (e.ks && e.c == containerMapKey) { + blen := 2 + len(strconv.AppendInt(e.b[1:1], v, 10)) + e.b[0] = '"' + e.b[blen-1] = '"' + e.w.writeb(e.b[:blen]) + return + } + e.w.writeb(strconv.AppendInt(e.b[:0], v, 10)) +} + +func (e *jsonEncDriverGeneric) EncodeUint(v uint64) { + x := e.is + if x == 'A' || x == 'L' && v > 1<<53 || (e.ks && e.c == containerMapKey) { + blen := 2 + len(strconv.AppendUint(e.b[1:1], v, 10)) + e.b[0] = '"' + e.b[blen-1] = '"' + e.w.writeb(e.b[:blen]) + return + } + e.w.writeb(strconv.AppendUint(e.b[:0], v, 10)) +} + +func (e *jsonEncDriverGeneric) EncodeFloat32(f float32) { + // e.encodeFloat(float64(f), 32) + // always encode all floats as IEEE 64-bit floating point. + // It also ensures that we can decode in full precision even if into a float32, + // as what is written is always to float64 precision. + e.EncodeFloat64(float64(f)) +} + +func (e *jsonEncDriverGeneric) atEndOfEncode() { + if e.tw { + if e.d { + e.w.writen1('\n') + } else { + e.w.writen1(' ') + } + } +} + +// -------------------- + +type jsonEncDriver struct { + noBuiltInTypes + e *Encoder + h *JsonHandle + ew *encWriterSwitch + se extWrapper + // ---- cpu cache line boundary? + bs []byte // scratch + // ---- cpu cache line boundary? + b [jsonScratchArrayLen]byte // scratch (encode time, + _ [2]uint64 // padding +} + +func (e *jsonEncDriver) EncodeNil() { + // We always encode nil as just null (never in quotes) + // This allows us to easily decode if a nil in the json stream + // ie if initial token is n. + e.ew.writeb(jsonLiterals[jsonLitNull : jsonLitNull+4]) + + // if e.h.MapKeyAsString && e.c == containerMapKey { + // e.ew.writeb(jsonLiterals[jsonLitNullQ : jsonLitNullQ+6]) + // } else { + // e.ew.writeb(jsonLiterals[jsonLitNull : jsonLitNull+4]) + // } +} + +func (e *jsonEncDriver) EncodeTime(t time.Time) { + // Do NOT use MarshalJSON, as it allocates internally. + // instead, we call AppendFormat directly, using our scratch buffer (e.b) + if t.IsZero() { + e.EncodeNil() + } else { + e.b[0] = '"' + b := t.AppendFormat(e.b[1:1], time.RFC3339Nano) + e.b[len(b)+1] = '"' + e.ew.writeb(e.b[:len(b)+2]) + } + // v, err := t.MarshalJSON(); if err != nil { e.e.error(err) } e.ew.writeb(v) +} + +func (e *jsonEncDriver) EncodeExt(rv interface{}, xtag uint64, ext Ext, en *Encoder) { + if v := ext.ConvertExt(rv); v == nil { + e.EncodeNil() + } else { + en.encode(v) + } +} + +func (e *jsonEncDriver) EncodeRawExt(re *RawExt, en *Encoder) { + // only encodes re.Value (never re.Data) + if re.Value == nil { + e.EncodeNil() + } else { + en.encode(re.Value) + } +} + +func (e *jsonEncDriver) EncodeString(c charEncoding, v string) { + e.quoteStr(v) +} + +func (e *jsonEncDriver) EncodeStringEnc(c charEncoding, v string) { + e.quoteStr(v) +} + +func (e *jsonEncDriver) EncodeStringBytes(c charEncoding, v []byte) { + // if encoding raw bytes and RawBytesExt is configured, use it to encode + if v == nil { + e.EncodeNil() + return + } + if c == cRAW { + if e.se.InterfaceExt != nil { + e.EncodeExt(v, 0, &e.se, e.e) + return + } + + slen := base64.StdEncoding.EncodedLen(len(v)) + 2 + if cap(e.bs) >= slen { + e.bs = e.bs[:slen] + } else { + e.bs = make([]byte, slen) + } + e.bs[0] = '"' + base64.StdEncoding.Encode(e.bs[1:], v) + e.bs[slen-1] = '"' + e.ew.writeb(e.bs) + } else { + e.quoteStr(stringView(v)) + } +} + +func (e *jsonEncDriver) EncodeStringBytesRaw(v []byte) { + // if encoding raw bytes and RawBytesExt is configured, use it to encode + if v == nil { + e.EncodeNil() + return + } + if e.se.InterfaceExt != nil { + e.EncodeExt(v, 0, &e.se, e.e) + return + } + + slen := base64.StdEncoding.EncodedLen(len(v)) + 2 + if cap(e.bs) >= slen { + e.bs = e.bs[:slen] + } else { + e.bs = make([]byte, slen) + } + e.bs[0] = '"' + base64.StdEncoding.Encode(e.bs[1:], v) + e.bs[slen-1] = '"' + e.ew.writeb(e.bs) +} + +func (e *jsonEncDriver) EncodeAsis(v []byte) { + e.ew.writeb(v) +} + +func (e *jsonEncDriver) quoteStr(s string) { + // adapted from std pkg encoding/json + const hex = "0123456789abcdef" + w := e.ew + htmlasis := e.h.HTMLCharsAsIs + w.writen1('"') + var start int + for i, slen := 0, len(s); i < slen; { + // encode all bytes < 0x20 (except \r, \n). + // also encode < > & to prevent security holes when served to some browsers. + if b := s[i]; b < utf8.RuneSelf { + // if 0x20 <= b && b != '\\' && b != '"' && b != '<' && b != '>' && b != '&' { + // if (htmlasis && jsonCharSafeSet.isset(b)) || jsonCharHtmlSafeSet.isset(b) { + if jsonCharHtmlSafeSet.isset(b) || (htmlasis && jsonCharSafeSet.isset(b)) { + i++ + continue + } + if start < i { + w.writestr(s[start:i]) + } + switch b { + case '\\', '"': + w.writen2('\\', b) + case '\n': + w.writen2('\\', 'n') + case '\r': + w.writen2('\\', 'r') + case '\b': + w.writen2('\\', 'b') + case '\f': + w.writen2('\\', 'f') + case '\t': + w.writen2('\\', 't') + default: + w.writestr(`\u00`) + w.writen2(hex[b>>4], hex[b&0xF]) + } + i++ + start = i + continue + } + c, size := utf8.DecodeRuneInString(s[i:]) + if c == utf8.RuneError && size == 1 { + if start < i { + w.writestr(s[start:i]) + } + w.writestr(`\ufffd`) + i += size + start = i + continue + } + // U+2028 is LINE SEPARATOR. U+2029 is PARAGRAPH SEPARATOR. + // Both technically valid JSON, but bomb on JSONP, so fix here unconditionally. + if c == '\u2028' || c == '\u2029' { + if start < i { + w.writestr(s[start:i]) + } + w.writestr(`\u202`) + w.writen1(hex[c&0xF]) + i += size + start = i + continue + } + i += size + } + if start < len(s) { + w.writestr(s[start:]) + } + w.writen1('"') +} + +type jsonDecDriver struct { + noBuiltInTypes + d *Decoder + h *JsonHandle + r *decReaderSwitch + se extWrapper + + // ---- writable fields during execution --- *try* to keep in sep cache line + + c containerState + // tok is used to store the token read right after skipWhiteSpace. + tok uint8 + fnull bool // found null from appendStringAsBytes + bs []byte // scratch. Initialized from b. Used for parsing strings or numbers. + bstr [8]byte // scratch used for string \UXXX parsing + // ---- cpu cache line boundary? + b [jsonScratchArrayLen]byte // scratch 1, used for parsing strings or numbers or time.Time + b2 [jsonScratchArrayLen]byte // scratch 2, used only for readUntil, decNumBytes + + // _ [3]uint64 // padding + // n jsonNum +} + +// func jsonIsWS(b byte) bool { +// // return b == ' ' || b == '\t' || b == '\r' || b == '\n' +// return jsonCharWhitespaceSet.isset(b) +// } + +func (d *jsonDecDriver) uncacheRead() { + if d.tok != 0 { + d.r.unreadn1() + d.tok = 0 + } +} + +func (d *jsonDecDriver) ReadMapStart() int { + if d.tok == 0 { + d.tok = d.r.skip(&jsonCharWhitespaceSet) + } + const xc uint8 = '{' + if d.tok != xc { + d.d.errorf("read map - expect char '%c' but got char '%c'", xc, d.tok) + } + d.tok = 0 + d.c = containerMapStart + return -1 +} + +func (d *jsonDecDriver) ReadArrayStart() int { + if d.tok == 0 { + d.tok = d.r.skip(&jsonCharWhitespaceSet) + } + const xc uint8 = '[' + if d.tok != xc { + d.d.errorf("read array - expect char '%c' but got char '%c'", xc, d.tok) + } + d.tok = 0 + d.c = containerArrayStart + return -1 +} + +func (d *jsonDecDriver) CheckBreak() bool { + if d.tok == 0 { + d.tok = d.r.skip(&jsonCharWhitespaceSet) + } + return d.tok == '}' || d.tok == ']' +} + +// For the ReadXXX methods below, we could just delegate to helper functions +// readContainerState(c containerState, xc uint8, check bool) +// - ReadArrayElem would become: +// readContainerState(containerArrayElem, ',', d.c != containerArrayStart) +// +// However, until mid-stack inlining comes in go1.11 which supports inlining of +// one-liners, we explicitly write them all 5 out to elide the extra func call. +// +// TODO: For Go 1.11, if inlined, consider consolidating these. + +func (d *jsonDecDriver) ReadArrayElem() { + const xc uint8 = ',' + if d.tok == 0 { + d.tok = d.r.skip(&jsonCharWhitespaceSet) + } + if d.c != containerArrayStart { + if d.tok != xc { + d.d.errorf("read array element - expect char '%c' but got char '%c'", xc, d.tok) + } + d.tok = 0 + } + d.c = containerArrayElem +} + +func (d *jsonDecDriver) ReadArrayEnd() { + const xc uint8 = ']' + if d.tok == 0 { + d.tok = d.r.skip(&jsonCharWhitespaceSet) + } + if d.tok != xc { + d.d.errorf("read array end - expect char '%c' but got char '%c'", xc, d.tok) + } + d.tok = 0 + d.c = containerArrayEnd +} + +func (d *jsonDecDriver) ReadMapElemKey() { + const xc uint8 = ',' + if d.tok == 0 { + d.tok = d.r.skip(&jsonCharWhitespaceSet) + } + if d.c != containerMapStart { + if d.tok != xc { + d.d.errorf("read map key - expect char '%c' but got char '%c'", xc, d.tok) + } + d.tok = 0 + } + d.c = containerMapKey +} + +func (d *jsonDecDriver) ReadMapElemValue() { + const xc uint8 = ':' + if d.tok == 0 { + d.tok = d.r.skip(&jsonCharWhitespaceSet) + } + if d.tok != xc { + d.d.errorf("read map value - expect char '%c' but got char '%c'", xc, d.tok) + } + d.tok = 0 + d.c = containerMapValue +} + +func (d *jsonDecDriver) ReadMapEnd() { + const xc uint8 = '}' + if d.tok == 0 { + d.tok = d.r.skip(&jsonCharWhitespaceSet) + } + if d.tok != xc { + d.d.errorf("read map end - expect char '%c' but got char '%c'", xc, d.tok) + } + d.tok = 0 + d.c = containerMapEnd +} + +// func (d *jsonDecDriver) readLit(length, fromIdx uint8) { +// // length here is always less than 8 (literals are: null, true, false) +// bs := d.r.readx(int(length)) +// d.tok = 0 +// if jsonValidateSymbols && !bytes.Equal(bs, jsonLiterals[fromIdx:fromIdx+length]) { +// d.d.errorf("expecting %s: got %s", jsonLiterals[fromIdx:fromIdx+length], bs) +// } +// } + +func (d *jsonDecDriver) readLit4True() { + bs := d.r.readx(3) + d.tok = 0 + if jsonValidateSymbols && !bytes.Equal(bs, jsonLiteral4True) { + d.d.errorf("expecting %s: got %s", jsonLiteral4True, bs) + } +} + +func (d *jsonDecDriver) readLit4False() { + bs := d.r.readx(4) + d.tok = 0 + if jsonValidateSymbols && !bytes.Equal(bs, jsonLiteral4False) { + d.d.errorf("expecting %s: got %s", jsonLiteral4False, bs) + } +} + +func (d *jsonDecDriver) readLit4Null() { + bs := d.r.readx(3) + d.tok = 0 + if jsonValidateSymbols && !bytes.Equal(bs, jsonLiteral4Null) { + d.d.errorf("expecting %s: got %s", jsonLiteral4Null, bs) + } +} + +func (d *jsonDecDriver) TryDecodeAsNil() bool { + if d.tok == 0 { + d.tok = d.r.skip(&jsonCharWhitespaceSet) + } + // we shouldn't try to see if "null" was here, right? + // only the plain string: `null` denotes a nil (ie not quotes) + if d.tok == 'n' { + d.readLit4Null() + return true + } + return false +} + +func (d *jsonDecDriver) DecodeBool() (v bool) { + if d.tok == 0 { + d.tok = d.r.skip(&jsonCharWhitespaceSet) + } + fquot := d.c == containerMapKey && d.tok == '"' + if fquot { + d.tok = d.r.readn1() + } + switch d.tok { + case 'f': + d.readLit4False() + // v = false + case 't': + d.readLit4True() + v = true + default: + d.d.errorf("decode bool: got first char %c", d.tok) + // v = false // "unreachable" + } + if fquot { + d.r.readn1() + } + return +} + +func (d *jsonDecDriver) DecodeTime() (t time.Time) { + // read string, and pass the string into json.unmarshal + d.appendStringAsBytes() + if d.fnull { + return + } + t, err := time.Parse(time.RFC3339, stringView(d.bs)) + if err != nil { + d.d.errorv(err) + } + return +} + +func (d *jsonDecDriver) ContainerType() (vt valueType) { + // check container type by checking the first char + if d.tok == 0 { + d.tok = d.r.skip(&jsonCharWhitespaceSet) + } + + // optimize this, so we don't do 4 checks but do one computation. + // return jsonContainerSet[d.tok] + + // ContainerType is mostly called for Map and Array, + // so this conditional is good enough (max 2 checks typically) + if b := d.tok; b == '{' { + return valueTypeMap + } else if b == '[' { + return valueTypeArray + } else if b == 'n' { + return valueTypeNil + } else if b == '"' { + return valueTypeString + } + return valueTypeUnset +} + +func (d *jsonDecDriver) decNumBytes() (bs []byte) { + // stores num bytes in d.bs + if d.tok == 0 { + d.tok = d.r.skip(&jsonCharWhitespaceSet) + } + if d.tok == '"' { + bs = d.r.readUntil(d.b2[:0], '"') + bs = bs[:len(bs)-1] + } else { + d.r.unreadn1() + bs = d.r.readTo(d.bs[:0], &jsonNumSet) + } + d.tok = 0 + return bs +} + +func (d *jsonDecDriver) DecodeUint64() (u uint64) { + bs := d.decNumBytes() + if len(bs) == 0 { + return + } + n, neg, badsyntax, overflow := jsonParseInteger(bs) + if overflow { + d.d.errorf("overflow parsing unsigned integer: %s", bs) + } else if neg { + d.d.errorf("minus found parsing unsigned integer: %s", bs) + } else if badsyntax { + // fallback: try to decode as float, and cast + n = d.decUint64ViaFloat(stringView(bs)) + } + return n +} + +func (d *jsonDecDriver) DecodeInt64() (i int64) { + const cutoff = uint64(1 << uint(64-1)) + bs := d.decNumBytes() + if len(bs) == 0 { + return + } + n, neg, badsyntax, overflow := jsonParseInteger(bs) + if overflow { + d.d.errorf("overflow parsing integer: %s", bs) + } else if badsyntax { + // d.d.errorf("invalid syntax for integer: %s", bs) + // fallback: try to decode as float, and cast + if neg { + n = d.decUint64ViaFloat(stringView(bs[1:])) + } else { + n = d.decUint64ViaFloat(stringView(bs)) + } + } + if neg { + if n > cutoff { + d.d.errorf("overflow parsing integer: %s", bs) + } + i = -(int64(n)) + } else { + if n >= cutoff { + d.d.errorf("overflow parsing integer: %s", bs) + } + i = int64(n) + } + return +} + +func (d *jsonDecDriver) decUint64ViaFloat(s string) (u uint64) { + if len(s) == 0 { + return + } + f, err := strconv.ParseFloat(s, 64) + if err != nil { + d.d.errorf("invalid syntax for integer: %s", s) + // d.d.errorv(err) + } + fi, ff := math.Modf(f) + if ff > 0 { + d.d.errorf("fractional part found parsing integer: %s", s) + } else if fi > float64(math.MaxUint64) { + d.d.errorf("overflow parsing integer: %s", s) + } + return uint64(fi) +} + +func (d *jsonDecDriver) DecodeFloat64() (f float64) { + bs := d.decNumBytes() + if len(bs) == 0 { + return + } + f, err := strconv.ParseFloat(stringView(bs), 64) + if err != nil { + d.d.errorv(err) + } + return +} + +func (d *jsonDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) (realxtag uint64) { + if ext == nil { + re := rv.(*RawExt) + re.Tag = xtag + d.d.decode(&re.Value) + } else { + var v interface{} + d.d.decode(&v) + ext.UpdateExt(rv, v) + } + return +} + +func (d *jsonDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) { + // if decoding into raw bytes, and the RawBytesExt is configured, use it to decode. + if d.se.InterfaceExt != nil { + bsOut = bs + d.DecodeExt(&bsOut, 0, &d.se) + return + } + if d.tok == 0 { + d.tok = d.r.skip(&jsonCharWhitespaceSet) + } + // check if an "array" of uint8's (see ContainerType for how to infer if an array) + if d.tok == '[' { + bsOut, _ = fastpathTV.DecSliceUint8V(bs, true, d.d) + return + } + d.appendStringAsBytes() + // base64 encodes []byte{} as "", and we encode nil []byte as null. + // Consequently, base64 should decode null as a nil []byte, and "" as an empty []byte{}. + // appendStringAsBytes returns a zero-len slice for both, so as not to reset d.bs. + // However, it sets a fnull field to true, so we can check if a null was found. + if len(d.bs) == 0 { + if d.fnull { + return nil + } + return []byte{} + } + bs0 := d.bs + slen := base64.StdEncoding.DecodedLen(len(bs0)) + if slen <= cap(bs) { + bsOut = bs[:slen] + } else if zerocopy && slen <= cap(d.b2) { + bsOut = d.b2[:slen] + } else { + bsOut = make([]byte, slen) + } + slen2, err := base64.StdEncoding.Decode(bsOut, bs0) + if err != nil { + d.d.errorf("error decoding base64 binary '%s': %v", bs0, err) + return nil + } + if slen != slen2 { + bsOut = bsOut[:slen2] + } + return +} + +func (d *jsonDecDriver) DecodeString() (s string) { + d.appendStringAsBytes() + return d.bsToString() +} + +func (d *jsonDecDriver) DecodeStringAsBytes() (s []byte) { + d.appendStringAsBytes() + return d.bs +} + +func (d *jsonDecDriver) appendStringAsBytes() { + if d.tok == 0 { + d.tok = d.r.skip(&jsonCharWhitespaceSet) + } + + d.fnull = false + if d.tok != '"' { + // d.d.errorf("expect char '%c' but got char '%c'", '"', d.tok) + // handle non-string scalar: null, true, false or a number + switch d.tok { + case 'n': + d.readLit4Null() + d.bs = d.bs[:0] + d.fnull = true + case 'f': + d.readLit4False() + d.bs = d.bs[:5] + copy(d.bs, "false") + case 't': + d.readLit4True() + d.bs = d.bs[:4] + copy(d.bs, "true") + default: + // try to parse a valid number + bs := d.decNumBytes() + if len(bs) <= cap(d.bs) { + d.bs = d.bs[:len(bs)] + } else { + d.bs = make([]byte, len(bs)) + } + copy(d.bs, bs) + } + return + } + + d.tok = 0 + r := d.r + var cs = r.readUntil(d.b2[:0], '"') + var cslen = uint(len(cs)) + var c uint8 + v := d.bs[:0] + // append on each byte seen can be expensive, so we just + // keep track of where we last read a contiguous set of + // non-special bytes (using cursor variable), + // and when we see a special byte + // e.g. end-of-slice, " or \, + // we will append the full range into the v slice before proceeding + var i, cursor uint + for { + if i == cslen { + v = append(v, cs[cursor:]...) + cs = r.readUntil(d.b2[:0], '"') + cslen = uint(len(cs)) + i, cursor = 0, 0 + } + c = cs[i] + if c == '"' { + v = append(v, cs[cursor:i]...) + break + } + if c != '\\' { + i++ + continue + } + v = append(v, cs[cursor:i]...) + i++ + c = cs[i] + switch c { + case '"', '\\', '/', '\'': + v = append(v, c) + case 'b': + v = append(v, '\b') + case 'f': + v = append(v, '\f') + case 'n': + v = append(v, '\n') + case 'r': + v = append(v, '\r') + case 't': + v = append(v, '\t') + case 'u': + var r rune + var rr uint32 + if cslen < i+4 { + d.d.errorf("need at least 4 more bytes for unicode sequence") + } + var j uint + for _, c = range cs[i+1 : i+5] { // bounds-check-elimination + // best to use explicit if-else + // - not a table, etc which involve memory loads, array lookup with bounds checks, etc + if c >= '0' && c <= '9' { + rr = rr*16 + uint32(c-jsonU4Chk2) + } else if c >= 'a' && c <= 'f' { + rr = rr*16 + uint32(c-jsonU4Chk1) + } else if c >= 'A' && c <= 'F' { + rr = rr*16 + uint32(c-jsonU4Chk0) + } else { + r = unicode.ReplacementChar + i += 4 + goto encode_rune + } + } + r = rune(rr) + i += 4 + if utf16.IsSurrogate(r) { + if len(cs) >= int(i+6) { + var cx = cs[i+1:][:6:6] // [:6] affords bounds-check-elimination + if cx[0] == '\\' && cx[1] == 'u' { + i += 2 + var rr1 uint32 + for j = 2; j < 6; j++ { + c = cx[j] + if c >= '0' && c <= '9' { + rr = rr*16 + uint32(c-jsonU4Chk2) + } else if c >= 'a' && c <= 'f' { + rr = rr*16 + uint32(c-jsonU4Chk1) + } else if c >= 'A' && c <= 'F' { + rr = rr*16 + uint32(c-jsonU4Chk0) + } else { + r = unicode.ReplacementChar + i += 4 + goto encode_rune + } + } + r = utf16.DecodeRune(r, rune(rr1)) + i += 4 + goto encode_rune + } + } + r = unicode.ReplacementChar + } + encode_rune: + w2 := utf8.EncodeRune(d.bstr[:], r) + v = append(v, d.bstr[:w2]...) + default: + d.d.errorf("unsupported escaped value: %c", c) + } + i++ + cursor = i + } + d.bs = v +} + +func (d *jsonDecDriver) nakedNum(z *decNaked, bs []byte) (err error) { + const cutoff = uint64(1 << uint(64-1)) + + var n uint64 + var neg, badsyntax, overflow bool + + if len(bs) == 0 { + if d.h.PreferFloat { + z.v = valueTypeFloat + z.f = 0 + } else if d.h.SignedInteger { + z.v = valueTypeInt + z.i = 0 + } else { + z.v = valueTypeUint + z.u = 0 + } + return + } + if d.h.PreferFloat { + goto F + } + n, neg, badsyntax, overflow = jsonParseInteger(bs) + if badsyntax || overflow { + goto F + } + if neg { + if n > cutoff { + goto F + } + z.v = valueTypeInt + z.i = -(int64(n)) + } else if d.h.SignedInteger { + if n >= cutoff { + goto F + } + z.v = valueTypeInt + z.i = int64(n) + } else { + z.v = valueTypeUint + z.u = n + } + return +F: + z.v = valueTypeFloat + z.f, err = strconv.ParseFloat(stringView(bs), 64) + return +} + +func (d *jsonDecDriver) bsToString() string { + // if x := d.s.sc; x != nil && x.so && x.st == '}' { // map key + if jsonAlwaysReturnInternString || d.c == containerMapKey { + return d.d.string(d.bs) + } + return string(d.bs) +} + +func (d *jsonDecDriver) DecodeNaked() { + z := d.d.naked() + // var decodeFurther bool + + if d.tok == 0 { + d.tok = d.r.skip(&jsonCharWhitespaceSet) + } + switch d.tok { + case 'n': + d.readLit4Null() + z.v = valueTypeNil + case 'f': + d.readLit4False() + z.v = valueTypeBool + z.b = false + case 't': + d.readLit4True() + z.v = valueTypeBool + z.b = true + case '{': + z.v = valueTypeMap // don't consume. kInterfaceNaked will call ReadMapStart + case '[': + z.v = valueTypeArray // don't consume. kInterfaceNaked will call ReadArrayStart + case '"': + // if a string, and MapKeyAsString, then try to decode it as a nil, bool or number first + d.appendStringAsBytes() + if len(d.bs) > 0 && d.c == containerMapKey && d.h.MapKeyAsString { + switch stringView(d.bs) { + case "null": + z.v = valueTypeNil + case "true": + z.v = valueTypeBool + z.b = true + case "false": + z.v = valueTypeBool + z.b = false + default: + // check if a number: float, int or uint + if err := d.nakedNum(z, d.bs); err != nil { + z.v = valueTypeString + z.s = d.bsToString() + } + } + } else { + z.v = valueTypeString + z.s = d.bsToString() + } + default: // number + bs := d.decNumBytes() + if len(bs) == 0 { + d.d.errorf("decode number from empty string") + return + } + if err := d.nakedNum(z, bs); err != nil { + d.d.errorf("decode number from %s: %v", bs, err) + return + } + } + // if decodeFurther { + // d.s.sc.retryRead() + // } +} + +//---------------------- + +// JsonHandle is a handle for JSON encoding format. +// +// Json is comprehensively supported: +// - decodes numbers into interface{} as int, uint or float64 +// based on how the number looks and some config parameters e.g. PreferFloat, SignedInt, etc. +// - decode integers from float formatted numbers e.g. 1.27e+8 +// - decode any json value (numbers, bool, etc) from quoted strings +// - configurable way to encode/decode []byte . +// by default, encodes and decodes []byte using base64 Std Encoding +// - UTF-8 support for encoding and decoding +// +// It has better performance than the json library in the standard library, +// by leveraging the performance improvements of the codec library. +// +// In addition, it doesn't read more bytes than necessary during a decode, which allows +// reading multiple values from a stream containing json and non-json content. +// For example, a user can read a json value, then a cbor value, then a msgpack value, +// all from the same stream in sequence. +// +// Note that, when decoding quoted strings, invalid UTF-8 or invalid UTF-16 surrogate pairs are +// not treated as an error. Instead, they are replaced by the Unicode replacement character U+FFFD. +type JsonHandle struct { + textEncodingType + BasicHandle + + // Indent indicates how a value is encoded. + // - If positive, indent by that number of spaces. + // - If negative, indent by that number of tabs. + Indent int8 + + // IntegerAsString controls how integers (signed and unsigned) are encoded. + // + // Per the JSON Spec, JSON numbers are 64-bit floating point numbers. + // Consequently, integers > 2^53 cannot be represented as a JSON number without losing precision. + // This can be mitigated by configuring how to encode integers. + // + // IntegerAsString interpretes the following values: + // - if 'L', then encode integers > 2^53 as a json string. + // - if 'A', then encode all integers as a json string + // containing the exact integer representation as a decimal. + // - else encode all integers as a json number (default) + IntegerAsString byte + + // HTMLCharsAsIs controls how to encode some special characters to html: < > & + // + // By default, we encode them as \uXXX + // to prevent security holes when served from some browsers. + HTMLCharsAsIs bool + + // PreferFloat says that we will default to decoding a number as a float. + // If not set, we will examine the characters of the number and decode as an + // integer type if it doesn't have any of the characters [.eE]. + PreferFloat bool + + // TermWhitespace says that we add a whitespace character + // at the end of an encoding. + // + // The whitespace is important, especially if using numbers in a context + // where multiple items are written to a stream. + TermWhitespace bool + + // MapKeyAsString says to encode all map keys as strings. + // + // Use this to enforce strict json output. + // The only caveat is that nil value is ALWAYS written as null (never as "null") + MapKeyAsString bool + + // _ [2]byte // padding + + // Note: below, we store hardly-used items e.g. RawBytesExt is cached in the (en|de)cDriver. + + // RawBytesExt, if configured, is used to encode and decode raw bytes in a custom way. + // If not configured, raw bytes are encoded to/from base64 text. + RawBytesExt InterfaceExt + + _ [2]uint64 // padding +} + +// Name returns the name of the handle: json +func (h *JsonHandle) Name() string { return "json" } +func (h *JsonHandle) hasElemSeparators() bool { return true } +func (h *JsonHandle) typical() bool { + return h.Indent == 0 && !h.MapKeyAsString && h.IntegerAsString != 'A' && h.IntegerAsString != 'L' +} + +type jsonTypical interface { + typical() +} + +func (h *JsonHandle) recreateEncDriver(ed encDriver) (v bool) { + _, v = ed.(jsonTypical) + return v != h.typical() +} + +// SetInterfaceExt sets an extension +func (h *JsonHandle) SetInterfaceExt(rt reflect.Type, tag uint64, ext InterfaceExt) (err error) { + return h.SetExt(rt, tag, &extWrapper{bytesExtFailer{}, ext}) +} + +type jsonEncDriverTypicalImpl struct { + jsonEncDriver + jsonEncDriverTypical + _ [1]uint64 // padding +} + +func (x *jsonEncDriverTypicalImpl) reset() { + x.jsonEncDriver.reset() + x.jsonEncDriverTypical.reset(&x.jsonEncDriver) +} + +type jsonEncDriverGenericImpl struct { + jsonEncDriver + jsonEncDriverGeneric + // _ [2]uint64 // padding +} + +func (x *jsonEncDriverGenericImpl) reset() { + x.jsonEncDriver.reset() + x.jsonEncDriverGeneric.reset(&x.jsonEncDriver) +} + +func (h *JsonHandle) newEncDriver(e *Encoder) (ee encDriver) { + var hd *jsonEncDriver + if h.typical() { + var v jsonEncDriverTypicalImpl + ee = &v + hd = &v.jsonEncDriver + } else { + var v jsonEncDriverGenericImpl + ee = &v + hd = &v.jsonEncDriver + } + hd.e, hd.h, hd.bs = e, h, hd.b[:0] + hd.se.BytesExt = bytesExtFailer{} + ee.reset() + return +} + +func (h *JsonHandle) newDecDriver(d *Decoder) decDriver { + // d := jsonDecDriver{r: r.(*bytesDecReader), h: h} + hd := jsonDecDriver{d: d, h: h} + hd.se.BytesExt = bytesExtFailer{} + hd.bs = hd.b[:0] + hd.reset() + return &hd +} + +func (e *jsonEncDriver) reset() { + e.ew = e.e.w + e.se.InterfaceExt = e.h.RawBytesExt + if e.bs != nil { + e.bs = e.bs[:0] + } +} + +func (d *jsonDecDriver) reset() { + d.r = d.d.r + d.se.InterfaceExt = d.h.RawBytesExt + if d.bs != nil { + d.bs = d.bs[:0] + } + d.c, d.tok = 0, 0 + // d.n.reset() +} + +func jsonFloatStrconvFmtPrec(f float64) (fmt byte, prec int) { + prec = -1 + var abs = math.Abs(f) + if abs != 0 && (abs < 1e-6 || abs >= 1e21) { + fmt = 'e' + } else { + fmt = 'f' + // set prec to 1 iff mod is 0. + // better than using jsonIsFloatBytesB2 to check if a . or E in the float bytes. + // this ensures that every float has an e or .0 in it. + if abs <= 1 { + if abs == 0 || abs == 1 { + prec = 1 + } + } else if _, mod := math.Modf(abs); mod == 0 { + prec = 1 + } + } + return +} + +// custom-fitted version of strconv.Parse(Ui|I)nt. +// Also ensures we don't have to search for .eE to determine if a float or not. +// Note: s CANNOT be a zero-length slice. +func jsonParseInteger(s []byte) (n uint64, neg, badSyntax, overflow bool) { + const maxUint64 = (1<<64 - 1) + const cutoff = maxUint64/10 + 1 + + if len(s) == 0 { // bounds-check-elimination + // treat empty string as zero value + // badSyntax = true + return + } + switch s[0] { + case '+': + s = s[1:] + case '-': + s = s[1:] + neg = true + } + for _, c := range s { + if c < '0' || c > '9' { + badSyntax = true + return + } + // unsigned integers don't overflow well on multiplication, so check cutoff here + // e.g. (maxUint64-5)*10 doesn't overflow well ... + if n >= cutoff { + overflow = true + return + } + n *= 10 + n1 := n + uint64(c-'0') + if n1 < n || n1 > maxUint64 { + overflow = true + return + } + n = n1 + } + return +} + +var _ decDriver = (*jsonDecDriver)(nil) +var _ encDriver = (*jsonEncDriverGenericImpl)(nil) +var _ encDriver = (*jsonEncDriverTypicalImpl)(nil) +var _ jsonTypical = (*jsonEncDriverTypical)(nil) diff --git a/vendor/github.com/ugorji/go/codec/mammoth-test.go.tmpl b/vendor/github.com/ugorji/go/codec/mammoth-test.go.tmpl new file mode 100644 index 000000000..c598cc73a --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/mammoth-test.go.tmpl @@ -0,0 +1,154 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +// Code generated from mammoth-test.go.tmpl - DO NOT EDIT. + +package codec + +import "testing" +import "fmt" +import "reflect" + +// TestMammoth has all the different paths optimized in fast-path +// It has all the primitives, slices and maps. +// +// For each of those types, it has a pointer and a non-pointer field. + +func init() { _ = fmt.Printf } // so we can include fmt as needed + +type TestMammoth struct { + +{{range .Values }}{{if .Primitive }}{{/* +*/}}{{ .MethodNamePfx "F" true }} {{ .Primitive }} +{{ .MethodNamePfx "Fptr" true }} *{{ .Primitive }} +{{end}}{{end}} + +{{range .Values }}{{if not .Primitive }}{{if not .MapKey }}{{/* +*/}}{{ .MethodNamePfx "F" false }} []{{ .Elem }} +{{ .MethodNamePfx "Fptr" false }} *[]{{ .Elem }} +{{end}}{{end}}{{end}} + +{{range .Values }}{{if not .Primitive }}{{if .MapKey }}{{/* +*/}}{{ .MethodNamePfx "F" false }} map[{{ .MapKey }}]{{ .Elem }} +{{ .MethodNamePfx "Fptr" false }} *map[{{ .MapKey }}]{{ .Elem }} +{{end}}{{end}}{{end}} + +} + +{{range .Values }}{{if not .Primitive }}{{if not .MapKey }}{{/* +*/}} type {{ .MethodNamePfx "typMbs" false }} []{{ .Elem }} +func (_ {{ .MethodNamePfx "typMbs" false }}) MapBySlice() { } +{{end}}{{end}}{{end}} + +{{range .Values }}{{if not .Primitive }}{{if .MapKey }}{{/* +*/}} type {{ .MethodNamePfx "typMap" false }} map[{{ .MapKey }}]{{ .Elem }} +{{end}}{{end}}{{end}} + +func doTestMammothSlices(t *testing.T, h Handle) { +{{range $i, $e := .Values }}{{if not .Primitive }}{{if not .MapKey }}{{/* +*/}} + var v{{$i}}va [8]{{ .Elem }} + for _, v := range [][]{{ .Elem }}{ nil, {}, { {{ nonzerocmd .Elem }}, {{ zerocmd .Elem }}, {{ zerocmd .Elem }}, {{ nonzerocmd .Elem }} } } { {{/* + // fmt.Printf(">>>> running mammoth slice v{{$i}}: %v\n", v) + // - encode value to some []byte + // - decode into a length-wise-equal []byte + // - check if equal to initial slice + // - encode ptr to the value + // - check if encode bytes are same + // - decode into ptrs to: nil, then 1-elem slice, equal-length, then large len slice + // - decode into non-addressable slice of equal length, then larger len + // - for each decode, compare elem-by-elem to the original slice + // - + // - rinse and repeat for a MapBySlice version + // - + */}} + var v{{$i}}v1, v{{$i}}v2 []{{ .Elem }} + v{{$i}}v1 = v + bs{{$i}} := testMarshalErr(v{{$i}}v1, h, t, "enc-slice-v{{$i}}") + if v == nil { v{{$i}}v2 = nil } else { v{{$i}}v2 = make([]{{ .Elem }}, len(v)) } + testUnmarshalErr(v{{$i}}v2, bs{{$i}}, h, t, "dec-slice-v{{$i}}") + testDeepEqualErr(v{{$i}}v1, v{{$i}}v2, t, "equal-slice-v{{$i}}") + if v == nil { v{{$i}}v2 = nil } else { v{{$i}}v2 = make([]{{ .Elem }}, len(v)) } + testUnmarshalErr(reflect.ValueOf(v{{$i}}v2), bs{{$i}}, h, t, "dec-slice-v{{$i}}-noaddr") // non-addressable value + testDeepEqualErr(v{{$i}}v1, v{{$i}}v2, t, "equal-slice-v{{$i}}-noaddr") + // ... + bs{{$i}} = testMarshalErr(&v{{$i}}v1, h, t, "enc-slice-v{{$i}}-p") + v{{$i}}v2 = nil + testUnmarshalErr(&v{{$i}}v2, bs{{$i}}, h, t, "dec-slice-v{{$i}}-p") + testDeepEqualErr(v{{$i}}v1, v{{$i}}v2, t, "equal-slice-v{{$i}}-p") + v{{$i}}va = [8]{{ .Elem }}{} // clear the array + v{{$i}}v2 = v{{$i}}va[:1:1] + testUnmarshalErr(&v{{$i}}v2, bs{{$i}}, h, t, "dec-slice-v{{$i}}-p-1") + testDeepEqualErr(v{{$i}}v1, v{{$i}}v2, t, "equal-slice-v{{$i}}-p-1") + v{{$i}}va = [8]{{ .Elem }}{} // clear the array + v{{$i}}v2 = v{{$i}}va[:len(v{{$i}}v1):len(v{{$i}}v1)] + testUnmarshalErr(&v{{$i}}v2, bs{{$i}}, h, t, "dec-slice-v{{$i}}-p-len") + testDeepEqualErr(v{{$i}}v1, v{{$i}}v2, t, "equal-slice-v{{$i}}-p-len") + v{{$i}}va = [8]{{ .Elem }}{} // clear the array + v{{$i}}v2 = v{{$i}}va[:] + testUnmarshalErr(&v{{$i}}v2, bs{{$i}}, h, t, "dec-slice-v{{$i}}-p-cap") + testDeepEqualErr(v{{$i}}v1, v{{$i}}v2, t, "equal-slice-v{{$i}}-p-cap") + if len(v{{$i}}v1) > 1 { + v{{$i}}va = [8]{{ .Elem }}{} // clear the array + testUnmarshalErr((&v{{$i}}va)[:len(v{{$i}}v1)], bs{{$i}}, h, t, "dec-slice-v{{$i}}-p-len-noaddr") + testDeepEqualErr(v{{$i}}v1, v{{$i}}va[:len(v{{$i}}v1)], t, "equal-slice-v{{$i}}-p-len-noaddr") + v{{$i}}va = [8]{{ .Elem }}{} // clear the array + testUnmarshalErr((&v{{$i}}va)[:], bs{{$i}}, h, t, "dec-slice-v{{$i}}-p-cap-noaddr") + testDeepEqualErr(v{{$i}}v1, v{{$i}}va[:len(v{{$i}}v1)], t, "equal-slice-v{{$i}}-p-cap-noaddr") + } + // ... + var v{{$i}}v3, v{{$i}}v4 {{ .MethodNamePfx "typMbs" false }} + v{{$i}}v2 = nil + if v != nil { v{{$i}}v2 = make([]{{ .Elem }}, len(v)) } + v{{$i}}v3 = {{ .MethodNamePfx "typMbs" false }}(v{{$i}}v1) + v{{$i}}v4 = {{ .MethodNamePfx "typMbs" false }}(v{{$i}}v2) + bs{{$i}} = testMarshalErr(v{{$i}}v3, h, t, "enc-slice-v{{$i}}-custom") + testUnmarshalErr(v{{$i}}v4, bs{{$i}}, h, t, "dec-slice-v{{$i}}-custom") + testDeepEqualErr(v{{$i}}v3, v{{$i}}v4, t, "equal-slice-v{{$i}}-custom") + bs{{$i}} = testMarshalErr(&v{{$i}}v3, h, t, "enc-slice-v{{$i}}-custom-p") + v{{$i}}v2 = nil + v{{$i}}v4 = {{ .MethodNamePfx "typMbs" false }}(v{{$i}}v2) + testUnmarshalErr(&v{{$i}}v4, bs{{$i}}, h, t, "dec-slice-v{{$i}}-custom-p") + testDeepEqualErr(v{{$i}}v3, v{{$i}}v4, t, "equal-slice-v{{$i}}-custom-p") + } +{{end}}{{end}}{{end}} +} + +func doTestMammothMaps(t *testing.T, h Handle) { +{{range $i, $e := .Values }}{{if not .Primitive }}{{if .MapKey }}{{/* +*/}} + for _, v := range []map[{{ .MapKey }}]{{ .Elem }}{ nil, {}, { {{ nonzerocmd .MapKey }}:{{ zerocmd .Elem }} {{if ne "bool" .MapKey}}, {{ nonzerocmd .MapKey }}:{{ nonzerocmd .Elem }} {{end}} } } { + // fmt.Printf(">>>> running mammoth map v{{$i}}: %v\n", v) + var v{{$i}}v1, v{{$i}}v2 map[{{ .MapKey }}]{{ .Elem }} + v{{$i}}v1 = v + bs{{$i}} := testMarshalErr(v{{$i}}v1, h, t, "enc-map-v{{$i}}") + if v == nil { v{{$i}}v2 = nil } else { v{{$i}}v2 = make(map[{{ .MapKey }}]{{ .Elem }}, len(v)) } // reset map + testUnmarshalErr(v{{$i}}v2, bs{{$i}}, h, t, "dec-map-v{{$i}}") + testDeepEqualErr(v{{$i}}v1, v{{$i}}v2, t, "equal-map-v{{$i}}") + if v == nil { v{{$i}}v2 = nil } else { v{{$i}}v2 = make(map[{{ .MapKey }}]{{ .Elem }}, len(v)) } // reset map + testUnmarshalErr(reflect.ValueOf(v{{$i}}v2), bs{{$i}}, h, t, "dec-map-v{{$i}}-noaddr") // decode into non-addressable map value + testDeepEqualErr(v{{$i}}v1, v{{$i}}v2, t, "equal-map-v{{$i}}-noaddr") + if v == nil { v{{$i}}v2 = nil } else { v{{$i}}v2 = make(map[{{ .MapKey }}]{{ .Elem }}, len(v)) } // reset map + testUnmarshalErr(&v{{$i}}v2, bs{{$i}}, h, t, "dec-map-v{{$i}}-p-len") + testDeepEqualErr(v{{$i}}v1, v{{$i}}v2, t, "equal-map-v{{$i}}-p-len") + bs{{$i}} = testMarshalErr(&v{{$i}}v1, h, t, "enc-map-v{{$i}}-p") + v{{$i}}v2 = nil + testUnmarshalErr(&v{{$i}}v2, bs{{$i}}, h, t, "dec-map-v{{$i}}-p-nil") + testDeepEqualErr(v{{$i}}v1, v{{$i}}v2, t, "equal-map-v{{$i}}-p-nil") + // ... + if v == nil { v{{$i}}v2 = nil } else { v{{$i}}v2 = make(map[{{ .MapKey }}]{{ .Elem }}, len(v)) } // reset map + var v{{$i}}v3, v{{$i}}v4 {{ .MethodNamePfx "typMap" false }} + v{{$i}}v3 = {{ .MethodNamePfx "typMap" false }}(v{{$i}}v1) + v{{$i}}v4 = {{ .MethodNamePfx "typMap" false }}(v{{$i}}v2) + bs{{$i}} = testMarshalErr(v{{$i}}v3, h, t, "enc-map-v{{$i}}-custom") + testUnmarshalErr(v{{$i}}v4, bs{{$i}}, h, t, "dec-map-v{{$i}}-p-len") + testDeepEqualErr(v{{$i}}v3, v{{$i}}v4, t, "equal-map-v{{$i}}-p-len") + } +{{end}}{{end}}{{end}} + +} + +func doTestMammothMapsAndSlices(t *testing.T, h Handle) { + doTestMammothSlices(t, h) + doTestMammothMaps(t, h) +} diff --git a/vendor/github.com/ugorji/go/codec/mammoth2-test.go.tmpl b/vendor/github.com/ugorji/go/codec/mammoth2-test.go.tmpl new file mode 100644 index 000000000..71eaf618a --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/mammoth2-test.go.tmpl @@ -0,0 +1,94 @@ +// +build !notfastpath + +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +// Code generated from mammoth2-test.go.tmpl - DO NOT EDIT. + +package codec + +// Increase codecoverage by covering all the codecgen paths, in fast-path and gen-helper.go.... +// +// Add: +// - test file for creating a mammoth generated file as _mammoth_generated.go +// - generate a second mammoth files in a different file: mammoth2_generated_test.go +// - mammoth-test.go.tmpl will do this +// - run codecgen on it, into mammoth2_codecgen_generated_test.go (no build tags) +// - as part of TestMammoth, run it also +// - this will cover all the codecgen, gen-helper, etc in one full run +// - check in mammoth* files into github also +// - then +// +// Now, add some types: +// - some that implement BinaryMarshal, TextMarshal, JSONMarshal, and one that implements none of it +// - create a wrapper type that includes TestMammoth2, with it in slices, and maps, and the custom types +// - this wrapper object is what we work encode/decode (so that the codecgen methods are called) + + +// import "encoding/binary" +import "fmt" + +type TestMammoth2 struct { + +{{range .Values }}{{if .Primitive }}{{/* +*/}}{{ .MethodNamePfx "F" true }} {{ .Primitive }} +{{ .MethodNamePfx "Fptr" true }} *{{ .Primitive }} +{{end}}{{end}} + +{{range .Values }}{{if not .Primitive }}{{if not .MapKey }}{{/* +*/}}{{ .MethodNamePfx "F" false }} []{{ .Elem }} +{{ .MethodNamePfx "Fptr" false }} *[]{{ .Elem }} +{{end}}{{end}}{{end}} + +{{range .Values }}{{if not .Primitive }}{{if .MapKey }}{{/* +*/}}{{ .MethodNamePfx "F" false }} map[{{ .MapKey }}]{{ .Elem }} +{{ .MethodNamePfx "Fptr" false }} *map[{{ .MapKey }}]{{ .Elem }} +{{end}}{{end}}{{end}} + +} + +// ----------- + +type testMammoth2Binary uint64 +func (x testMammoth2Binary) MarshalBinary() (data []byte, err error) { +data = make([]byte, 8) +bigen.PutUint64(data, uint64(x)) +return +} +func (x *testMammoth2Binary) UnmarshalBinary(data []byte) (err error) { +*x = testMammoth2Binary(bigen.Uint64(data)) +return +} + +type testMammoth2Text uint64 +func (x testMammoth2Text) MarshalText() (data []byte, err error) { +data = []byte(fmt.Sprintf("%b", uint64(x))) +return +} +func (x *testMammoth2Text) UnmarshalText(data []byte) (err error) { +_, err = fmt.Sscanf(string(data), "%b", (*uint64)(x)) +return +} + +type testMammoth2Json uint64 +func (x testMammoth2Json) MarshalJSON() (data []byte, err error) { +data = []byte(fmt.Sprintf("%v", uint64(x))) +return +} +func (x *testMammoth2Json) UnmarshalJSON(data []byte) (err error) { +_, err = fmt.Sscanf(string(data), "%v", (*uint64)(x)) +return +} + +type testMammoth2Basic [4]uint64 + +type TestMammoth2Wrapper struct { + V TestMammoth2 + T testMammoth2Text + B testMammoth2Binary + J testMammoth2Json + C testMammoth2Basic + M map[testMammoth2Basic]TestMammoth2 + L []TestMammoth2 + A [4]int64 +} diff --git a/vendor/github.com/ugorji/go/codec/mammoth2_codecgen_generated_test.go b/vendor/github.com/ugorji/go/codec/mammoth2_codecgen_generated_test.go new file mode 100644 index 000000000..d742def26 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/mammoth2_codecgen_generated_test.go @@ -0,0 +1,40827 @@ +// +build !notfastpath + +// Code generated by codecgen - DO NOT EDIT. + +package codec + +import ( + "errors" + "runtime" + "strconv" +) + +const ( + // ----- content types ---- + codecSelferCcUTF819781 = 1 + codecSelferCcRAW19781 = 255 + // ----- value types used ---- + codecSelferValueTypeArray19781 = 10 + codecSelferValueTypeMap19781 = 9 + codecSelferValueTypeString19781 = 6 + codecSelferValueTypeInt19781 = 2 + codecSelferValueTypeUint19781 = 3 + codecSelferValueTypeFloat19781 = 4 + codecSelferBitsize19781 = uint8(32 << (^uint(0) >> 63)) +) + +var ( + errCodecSelferOnlyMapOrArrayEncodeToStruct19781 = errors.New(`only encoded map or array can be decoded into a struct`) +) + +type codecSelfer19781 struct{} + +func init() { + if GenVersion != 10 { + _, file, _, _ := runtime.Caller(0) + panic("codecgen version mismatch: current: 10, need " + strconv.FormatInt(int64(GenVersion), 10) + ". Re-generate file: " + file) + } + if false { + var _ byte = 0 // reference the types, but skip this branch at build/run time + } +} + +func (x *TestMammoth2) CodecEncodeSelf(e *Encoder) { + var h codecSelfer19781 + z, r := GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + if false { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) + } else { + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + r.WriteArrayStart(576) + } else { + r.WriteMapStart(576) + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FIntf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.EncFallback(x.FIntf) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FIntf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FIntf`) + } + r.WriteMapElemValue() + if x.FIntf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.EncFallback(x.FIntf) + } + } + } + var yyn6 bool + if x.FptrIntf == nil { + yyn6 = true + goto LABEL6 + } + LABEL6: + if yyr2 || yy2arr2 { + if yyn6 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrIntf == nil { + r.EncodeNil() + } else { + yy7 := *x.FptrIntf + if false { + } else { + z.EncFallback(yy7) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrIntf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrIntf`) + } + r.WriteMapElemValue() + if yyn6 { + r.EncodeNil() + } else { + if x.FptrIntf == nil { + r.EncodeNil() + } else { + yy9 := *x.FptrIntf + if false { + } else { + z.EncFallback(yy9) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if false { + } else { + if z.EncBasicHandle().StringToRaw { + r.EncodeStringBytesRaw(z.BytesView(string(x.FString))) + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, string(x.FString)) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FString\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FString`) + } + r.WriteMapElemValue() + if false { + } else { + if z.EncBasicHandle().StringToRaw { + r.EncodeStringBytesRaw(z.BytesView(string(x.FString))) + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, string(x.FString)) + } + } + } + var yyn14 bool + if x.FptrString == nil { + yyn14 = true + goto LABEL14 + } + LABEL14: + if yyr2 || yy2arr2 { + if yyn14 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrString == nil { + r.EncodeNil() + } else { + yy15 := *x.FptrString + if false { + } else { + if z.EncBasicHandle().StringToRaw { + r.EncodeStringBytesRaw(z.BytesView(string(yy15))) + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, string(yy15)) + } + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrString\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrString`) + } + r.WriteMapElemValue() + if yyn14 { + r.EncodeNil() + } else { + if x.FptrString == nil { + r.EncodeNil() + } else { + yy17 := *x.FptrString + if false { + } else { + if z.EncBasicHandle().StringToRaw { + r.EncodeStringBytesRaw(z.BytesView(string(yy17))) + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, string(yy17)) + } + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if false { + } else { + r.EncodeFloat32(float32(x.FFloat32)) + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FFloat32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FFloat32`) + } + r.WriteMapElemValue() + if false { + } else { + r.EncodeFloat32(float32(x.FFloat32)) + } + } + var yyn22 bool + if x.FptrFloat32 == nil { + yyn22 = true + goto LABEL22 + } + LABEL22: + if yyr2 || yy2arr2 { + if yyn22 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrFloat32 == nil { + r.EncodeNil() + } else { + yy23 := *x.FptrFloat32 + if false { + } else { + r.EncodeFloat32(float32(yy23)) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrFloat32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrFloat32`) + } + r.WriteMapElemValue() + if yyn22 { + r.EncodeNil() + } else { + if x.FptrFloat32 == nil { + r.EncodeNil() + } else { + yy25 := *x.FptrFloat32 + if false { + } else { + r.EncodeFloat32(float32(yy25)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if false { + } else { + r.EncodeFloat64(float64(x.FFloat64)) + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FFloat64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FFloat64`) + } + r.WriteMapElemValue() + if false { + } else { + r.EncodeFloat64(float64(x.FFloat64)) + } + } + var yyn30 bool + if x.FptrFloat64 == nil { + yyn30 = true + goto LABEL30 + } + LABEL30: + if yyr2 || yy2arr2 { + if yyn30 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrFloat64 == nil { + r.EncodeNil() + } else { + yy31 := *x.FptrFloat64 + if false { + } else { + r.EncodeFloat64(float64(yy31)) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrFloat64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrFloat64`) + } + r.WriteMapElemValue() + if yyn30 { + r.EncodeNil() + } else { + if x.FptrFloat64 == nil { + r.EncodeNil() + } else { + yy33 := *x.FptrFloat64 + if false { + } else { + r.EncodeFloat64(float64(yy33)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if false { + } else { + r.EncodeUint(uint64(x.FUint)) + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FUint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FUint`) + } + r.WriteMapElemValue() + if false { + } else { + r.EncodeUint(uint64(x.FUint)) + } + } + var yyn38 bool + if x.FptrUint == nil { + yyn38 = true + goto LABEL38 + } + LABEL38: + if yyr2 || yy2arr2 { + if yyn38 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrUint == nil { + r.EncodeNil() + } else { + yy39 := *x.FptrUint + if false { + } else { + r.EncodeUint(uint64(yy39)) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrUint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrUint`) + } + r.WriteMapElemValue() + if yyn38 { + r.EncodeNil() + } else { + if x.FptrUint == nil { + r.EncodeNil() + } else { + yy41 := *x.FptrUint + if false { + } else { + r.EncodeUint(uint64(yy41)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if false { + } else { + r.EncodeUint(uint64(x.FUint8)) + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FUint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FUint8`) + } + r.WriteMapElemValue() + if false { + } else { + r.EncodeUint(uint64(x.FUint8)) + } + } + var yyn46 bool + if x.FptrUint8 == nil { + yyn46 = true + goto LABEL46 + } + LABEL46: + if yyr2 || yy2arr2 { + if yyn46 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrUint8 == nil { + r.EncodeNil() + } else { + yy47 := *x.FptrUint8 + if false { + } else { + r.EncodeUint(uint64(yy47)) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrUint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrUint8`) + } + r.WriteMapElemValue() + if yyn46 { + r.EncodeNil() + } else { + if x.FptrUint8 == nil { + r.EncodeNil() + } else { + yy49 := *x.FptrUint8 + if false { + } else { + r.EncodeUint(uint64(yy49)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if false { + } else { + r.EncodeUint(uint64(x.FUint16)) + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FUint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FUint16`) + } + r.WriteMapElemValue() + if false { + } else { + r.EncodeUint(uint64(x.FUint16)) + } + } + var yyn54 bool + if x.FptrUint16 == nil { + yyn54 = true + goto LABEL54 + } + LABEL54: + if yyr2 || yy2arr2 { + if yyn54 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrUint16 == nil { + r.EncodeNil() + } else { + yy55 := *x.FptrUint16 + if false { + } else { + r.EncodeUint(uint64(yy55)) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrUint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrUint16`) + } + r.WriteMapElemValue() + if yyn54 { + r.EncodeNil() + } else { + if x.FptrUint16 == nil { + r.EncodeNil() + } else { + yy57 := *x.FptrUint16 + if false { + } else { + r.EncodeUint(uint64(yy57)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if false { + } else { + r.EncodeUint(uint64(x.FUint32)) + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FUint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FUint32`) + } + r.WriteMapElemValue() + if false { + } else { + r.EncodeUint(uint64(x.FUint32)) + } + } + var yyn62 bool + if x.FptrUint32 == nil { + yyn62 = true + goto LABEL62 + } + LABEL62: + if yyr2 || yy2arr2 { + if yyn62 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrUint32 == nil { + r.EncodeNil() + } else { + yy63 := *x.FptrUint32 + if false { + } else { + r.EncodeUint(uint64(yy63)) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrUint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrUint32`) + } + r.WriteMapElemValue() + if yyn62 { + r.EncodeNil() + } else { + if x.FptrUint32 == nil { + r.EncodeNil() + } else { + yy65 := *x.FptrUint32 + if false { + } else { + r.EncodeUint(uint64(yy65)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if false { + } else { + r.EncodeUint(uint64(x.FUint64)) + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FUint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FUint64`) + } + r.WriteMapElemValue() + if false { + } else { + r.EncodeUint(uint64(x.FUint64)) + } + } + var yyn70 bool + if x.FptrUint64 == nil { + yyn70 = true + goto LABEL70 + } + LABEL70: + if yyr2 || yy2arr2 { + if yyn70 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrUint64 == nil { + r.EncodeNil() + } else { + yy71 := *x.FptrUint64 + if false { + } else { + r.EncodeUint(uint64(yy71)) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrUint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrUint64`) + } + r.WriteMapElemValue() + if yyn70 { + r.EncodeNil() + } else { + if x.FptrUint64 == nil { + r.EncodeNil() + } else { + yy73 := *x.FptrUint64 + if false { + } else { + r.EncodeUint(uint64(yy73)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if false { + } else { + r.EncodeUint(uint64(x.FUintptr)) + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FUintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FUintptr`) + } + r.WriteMapElemValue() + if false { + } else { + r.EncodeUint(uint64(x.FUintptr)) + } + } + var yyn78 bool + if x.FptrUintptr == nil { + yyn78 = true + goto LABEL78 + } + LABEL78: + if yyr2 || yy2arr2 { + if yyn78 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrUintptr == nil { + r.EncodeNil() + } else { + yy79 := *x.FptrUintptr + if false { + } else { + r.EncodeUint(uint64(yy79)) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrUintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrUintptr`) + } + r.WriteMapElemValue() + if yyn78 { + r.EncodeNil() + } else { + if x.FptrUintptr == nil { + r.EncodeNil() + } else { + yy81 := *x.FptrUintptr + if false { + } else { + r.EncodeUint(uint64(yy81)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if false { + } else { + r.EncodeInt(int64(x.FInt)) + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FInt\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FInt`) + } + r.WriteMapElemValue() + if false { + } else { + r.EncodeInt(int64(x.FInt)) + } + } + var yyn86 bool + if x.FptrInt == nil { + yyn86 = true + goto LABEL86 + } + LABEL86: + if yyr2 || yy2arr2 { + if yyn86 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrInt == nil { + r.EncodeNil() + } else { + yy87 := *x.FptrInt + if false { + } else { + r.EncodeInt(int64(yy87)) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrInt\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrInt`) + } + r.WriteMapElemValue() + if yyn86 { + r.EncodeNil() + } else { + if x.FptrInt == nil { + r.EncodeNil() + } else { + yy89 := *x.FptrInt + if false { + } else { + r.EncodeInt(int64(yy89)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if false { + } else { + r.EncodeInt(int64(x.FInt8)) + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FInt8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FInt8`) + } + r.WriteMapElemValue() + if false { + } else { + r.EncodeInt(int64(x.FInt8)) + } + } + var yyn94 bool + if x.FptrInt8 == nil { + yyn94 = true + goto LABEL94 + } + LABEL94: + if yyr2 || yy2arr2 { + if yyn94 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrInt8 == nil { + r.EncodeNil() + } else { + yy95 := *x.FptrInt8 + if false { + } else { + r.EncodeInt(int64(yy95)) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrInt8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrInt8`) + } + r.WriteMapElemValue() + if yyn94 { + r.EncodeNil() + } else { + if x.FptrInt8 == nil { + r.EncodeNil() + } else { + yy97 := *x.FptrInt8 + if false { + } else { + r.EncodeInt(int64(yy97)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if false { + } else { + r.EncodeInt(int64(x.FInt16)) + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FInt16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FInt16`) + } + r.WriteMapElemValue() + if false { + } else { + r.EncodeInt(int64(x.FInt16)) + } + } + var yyn102 bool + if x.FptrInt16 == nil { + yyn102 = true + goto LABEL102 + } + LABEL102: + if yyr2 || yy2arr2 { + if yyn102 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrInt16 == nil { + r.EncodeNil() + } else { + yy103 := *x.FptrInt16 + if false { + } else { + r.EncodeInt(int64(yy103)) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrInt16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrInt16`) + } + r.WriteMapElemValue() + if yyn102 { + r.EncodeNil() + } else { + if x.FptrInt16 == nil { + r.EncodeNil() + } else { + yy105 := *x.FptrInt16 + if false { + } else { + r.EncodeInt(int64(yy105)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if false { + } else { + r.EncodeInt(int64(x.FInt32)) + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FInt32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FInt32`) + } + r.WriteMapElemValue() + if false { + } else { + r.EncodeInt(int64(x.FInt32)) + } + } + var yyn110 bool + if x.FptrInt32 == nil { + yyn110 = true + goto LABEL110 + } + LABEL110: + if yyr2 || yy2arr2 { + if yyn110 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrInt32 == nil { + r.EncodeNil() + } else { + yy111 := *x.FptrInt32 + if false { + } else { + r.EncodeInt(int64(yy111)) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrInt32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrInt32`) + } + r.WriteMapElemValue() + if yyn110 { + r.EncodeNil() + } else { + if x.FptrInt32 == nil { + r.EncodeNil() + } else { + yy113 := *x.FptrInt32 + if false { + } else { + r.EncodeInt(int64(yy113)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if false { + } else { + r.EncodeInt(int64(x.FInt64)) + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FInt64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FInt64`) + } + r.WriteMapElemValue() + if false { + } else { + r.EncodeInt(int64(x.FInt64)) + } + } + var yyn118 bool + if x.FptrInt64 == nil { + yyn118 = true + goto LABEL118 + } + LABEL118: + if yyr2 || yy2arr2 { + if yyn118 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrInt64 == nil { + r.EncodeNil() + } else { + yy119 := *x.FptrInt64 + if false { + } else { + r.EncodeInt(int64(yy119)) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrInt64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrInt64`) + } + r.WriteMapElemValue() + if yyn118 { + r.EncodeNil() + } else { + if x.FptrInt64 == nil { + r.EncodeNil() + } else { + yy121 := *x.FptrInt64 + if false { + } else { + r.EncodeInt(int64(yy121)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if false { + } else { + r.EncodeBool(bool(x.FBool)) + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FBool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FBool`) + } + r.WriteMapElemValue() + if false { + } else { + r.EncodeBool(bool(x.FBool)) + } + } + var yyn126 bool + if x.FptrBool == nil { + yyn126 = true + goto LABEL126 + } + LABEL126: + if yyr2 || yy2arr2 { + if yyn126 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrBool == nil { + r.EncodeNil() + } else { + yy127 := *x.FptrBool + if false { + } else { + r.EncodeBool(bool(yy127)) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrBool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrBool`) + } + r.WriteMapElemValue() + if yyn126 { + r.EncodeNil() + } else { + if x.FptrBool == nil { + r.EncodeNil() + } else { + yy129 := *x.FptrBool + if false { + } else { + r.EncodeBool(bool(yy129)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceIntf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceIntfV(x.FSliceIntf, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FSliceIntf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FSliceIntf`) + } + r.WriteMapElemValue() + if x.FSliceIntf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceIntfV(x.FSliceIntf, e) + } + } + } + var yyn134 bool + if x.FptrSliceIntf == nil { + yyn134 = true + goto LABEL134 + } + LABEL134: + if yyr2 || yy2arr2 { + if yyn134 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrSliceIntf == nil { + r.EncodeNil() + } else { + yy135 := *x.FptrSliceIntf + if false { + } else { + z.F.EncSliceIntfV(yy135, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrSliceIntf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrSliceIntf`) + } + r.WriteMapElemValue() + if yyn134 { + r.EncodeNil() + } else { + if x.FptrSliceIntf == nil { + r.EncodeNil() + } else { + yy137 := *x.FptrSliceIntf + if false { + } else { + z.F.EncSliceIntfV(yy137, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceString == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceStringV(x.FSliceString, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FSliceString\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FSliceString`) + } + r.WriteMapElemValue() + if x.FSliceString == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceStringV(x.FSliceString, e) + } + } + } + var yyn142 bool + if x.FptrSliceString == nil { + yyn142 = true + goto LABEL142 + } + LABEL142: + if yyr2 || yy2arr2 { + if yyn142 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrSliceString == nil { + r.EncodeNil() + } else { + yy143 := *x.FptrSliceString + if false { + } else { + z.F.EncSliceStringV(yy143, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrSliceString\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrSliceString`) + } + r.WriteMapElemValue() + if yyn142 { + r.EncodeNil() + } else { + if x.FptrSliceString == nil { + r.EncodeNil() + } else { + yy145 := *x.FptrSliceString + if false { + } else { + z.F.EncSliceStringV(yy145, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceFloat32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceFloat32V(x.FSliceFloat32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FSliceFloat32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FSliceFloat32`) + } + r.WriteMapElemValue() + if x.FSliceFloat32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceFloat32V(x.FSliceFloat32, e) + } + } + } + var yyn150 bool + if x.FptrSliceFloat32 == nil { + yyn150 = true + goto LABEL150 + } + LABEL150: + if yyr2 || yy2arr2 { + if yyn150 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrSliceFloat32 == nil { + r.EncodeNil() + } else { + yy151 := *x.FptrSliceFloat32 + if false { + } else { + z.F.EncSliceFloat32V(yy151, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrSliceFloat32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrSliceFloat32`) + } + r.WriteMapElemValue() + if yyn150 { + r.EncodeNil() + } else { + if x.FptrSliceFloat32 == nil { + r.EncodeNil() + } else { + yy153 := *x.FptrSliceFloat32 + if false { + } else { + z.F.EncSliceFloat32V(yy153, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceFloat64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceFloat64V(x.FSliceFloat64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FSliceFloat64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FSliceFloat64`) + } + r.WriteMapElemValue() + if x.FSliceFloat64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceFloat64V(x.FSliceFloat64, e) + } + } + } + var yyn158 bool + if x.FptrSliceFloat64 == nil { + yyn158 = true + goto LABEL158 + } + LABEL158: + if yyr2 || yy2arr2 { + if yyn158 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrSliceFloat64 == nil { + r.EncodeNil() + } else { + yy159 := *x.FptrSliceFloat64 + if false { + } else { + z.F.EncSliceFloat64V(yy159, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrSliceFloat64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrSliceFloat64`) + } + r.WriteMapElemValue() + if yyn158 { + r.EncodeNil() + } else { + if x.FptrSliceFloat64 == nil { + r.EncodeNil() + } else { + yy161 := *x.FptrSliceFloat64 + if false { + } else { + z.F.EncSliceFloat64V(yy161, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceUint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceUintV(x.FSliceUint, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FSliceUint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FSliceUint`) + } + r.WriteMapElemValue() + if x.FSliceUint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceUintV(x.FSliceUint, e) + } + } + } + var yyn166 bool + if x.FptrSliceUint == nil { + yyn166 = true + goto LABEL166 + } + LABEL166: + if yyr2 || yy2arr2 { + if yyn166 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrSliceUint == nil { + r.EncodeNil() + } else { + yy167 := *x.FptrSliceUint + if false { + } else { + z.F.EncSliceUintV(yy167, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrSliceUint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrSliceUint`) + } + r.WriteMapElemValue() + if yyn166 { + r.EncodeNil() + } else { + if x.FptrSliceUint == nil { + r.EncodeNil() + } else { + yy169 := *x.FptrSliceUint + if false { + } else { + z.F.EncSliceUintV(yy169, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceUint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + r.EncodeStringBytesRaw([]byte(x.FSliceUint8)) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FSliceUint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FSliceUint8`) + } + r.WriteMapElemValue() + if x.FSliceUint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + r.EncodeStringBytesRaw([]byte(x.FSliceUint8)) + } + } + } + var yyn174 bool + if x.FptrSliceUint8 == nil { + yyn174 = true + goto LABEL174 + } + LABEL174: + if yyr2 || yy2arr2 { + if yyn174 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrSliceUint8 == nil { + r.EncodeNil() + } else { + yy175 := *x.FptrSliceUint8 + if false { + } else { + r.EncodeStringBytesRaw([]byte(yy175)) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrSliceUint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrSliceUint8`) + } + r.WriteMapElemValue() + if yyn174 { + r.EncodeNil() + } else { + if x.FptrSliceUint8 == nil { + r.EncodeNil() + } else { + yy177 := *x.FptrSliceUint8 + if false { + } else { + r.EncodeStringBytesRaw([]byte(yy177)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceUint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceUint16V(x.FSliceUint16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FSliceUint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FSliceUint16`) + } + r.WriteMapElemValue() + if x.FSliceUint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceUint16V(x.FSliceUint16, e) + } + } + } + var yyn182 bool + if x.FptrSliceUint16 == nil { + yyn182 = true + goto LABEL182 + } + LABEL182: + if yyr2 || yy2arr2 { + if yyn182 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrSliceUint16 == nil { + r.EncodeNil() + } else { + yy183 := *x.FptrSliceUint16 + if false { + } else { + z.F.EncSliceUint16V(yy183, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrSliceUint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrSliceUint16`) + } + r.WriteMapElemValue() + if yyn182 { + r.EncodeNil() + } else { + if x.FptrSliceUint16 == nil { + r.EncodeNil() + } else { + yy185 := *x.FptrSliceUint16 + if false { + } else { + z.F.EncSliceUint16V(yy185, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceUint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceUint32V(x.FSliceUint32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FSliceUint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FSliceUint32`) + } + r.WriteMapElemValue() + if x.FSliceUint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceUint32V(x.FSliceUint32, e) + } + } + } + var yyn190 bool + if x.FptrSliceUint32 == nil { + yyn190 = true + goto LABEL190 + } + LABEL190: + if yyr2 || yy2arr2 { + if yyn190 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrSliceUint32 == nil { + r.EncodeNil() + } else { + yy191 := *x.FptrSliceUint32 + if false { + } else { + z.F.EncSliceUint32V(yy191, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrSliceUint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrSliceUint32`) + } + r.WriteMapElemValue() + if yyn190 { + r.EncodeNil() + } else { + if x.FptrSliceUint32 == nil { + r.EncodeNil() + } else { + yy193 := *x.FptrSliceUint32 + if false { + } else { + z.F.EncSliceUint32V(yy193, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceUint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceUint64V(x.FSliceUint64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FSliceUint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FSliceUint64`) + } + r.WriteMapElemValue() + if x.FSliceUint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceUint64V(x.FSliceUint64, e) + } + } + } + var yyn198 bool + if x.FptrSliceUint64 == nil { + yyn198 = true + goto LABEL198 + } + LABEL198: + if yyr2 || yy2arr2 { + if yyn198 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrSliceUint64 == nil { + r.EncodeNil() + } else { + yy199 := *x.FptrSliceUint64 + if false { + } else { + z.F.EncSliceUint64V(yy199, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrSliceUint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrSliceUint64`) + } + r.WriteMapElemValue() + if yyn198 { + r.EncodeNil() + } else { + if x.FptrSliceUint64 == nil { + r.EncodeNil() + } else { + yy201 := *x.FptrSliceUint64 + if false { + } else { + z.F.EncSliceUint64V(yy201, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceUintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceUintptrV(x.FSliceUintptr, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FSliceUintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FSliceUintptr`) + } + r.WriteMapElemValue() + if x.FSliceUintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceUintptrV(x.FSliceUintptr, e) + } + } + } + var yyn206 bool + if x.FptrSliceUintptr == nil { + yyn206 = true + goto LABEL206 + } + LABEL206: + if yyr2 || yy2arr2 { + if yyn206 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrSliceUintptr == nil { + r.EncodeNil() + } else { + yy207 := *x.FptrSliceUintptr + if false { + } else { + z.F.EncSliceUintptrV(yy207, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrSliceUintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrSliceUintptr`) + } + r.WriteMapElemValue() + if yyn206 { + r.EncodeNil() + } else { + if x.FptrSliceUintptr == nil { + r.EncodeNil() + } else { + yy209 := *x.FptrSliceUintptr + if false { + } else { + z.F.EncSliceUintptrV(yy209, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceInt == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceIntV(x.FSliceInt, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FSliceInt\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FSliceInt`) + } + r.WriteMapElemValue() + if x.FSliceInt == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceIntV(x.FSliceInt, e) + } + } + } + var yyn214 bool + if x.FptrSliceInt == nil { + yyn214 = true + goto LABEL214 + } + LABEL214: + if yyr2 || yy2arr2 { + if yyn214 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrSliceInt == nil { + r.EncodeNil() + } else { + yy215 := *x.FptrSliceInt + if false { + } else { + z.F.EncSliceIntV(yy215, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrSliceInt\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrSliceInt`) + } + r.WriteMapElemValue() + if yyn214 { + r.EncodeNil() + } else { + if x.FptrSliceInt == nil { + r.EncodeNil() + } else { + yy217 := *x.FptrSliceInt + if false { + } else { + z.F.EncSliceIntV(yy217, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceInt8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceInt8V(x.FSliceInt8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FSliceInt8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FSliceInt8`) + } + r.WriteMapElemValue() + if x.FSliceInt8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceInt8V(x.FSliceInt8, e) + } + } + } + var yyn222 bool + if x.FptrSliceInt8 == nil { + yyn222 = true + goto LABEL222 + } + LABEL222: + if yyr2 || yy2arr2 { + if yyn222 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrSliceInt8 == nil { + r.EncodeNil() + } else { + yy223 := *x.FptrSliceInt8 + if false { + } else { + z.F.EncSliceInt8V(yy223, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrSliceInt8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrSliceInt8`) + } + r.WriteMapElemValue() + if yyn222 { + r.EncodeNil() + } else { + if x.FptrSliceInt8 == nil { + r.EncodeNil() + } else { + yy225 := *x.FptrSliceInt8 + if false { + } else { + z.F.EncSliceInt8V(yy225, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceInt16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceInt16V(x.FSliceInt16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FSliceInt16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FSliceInt16`) + } + r.WriteMapElemValue() + if x.FSliceInt16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceInt16V(x.FSliceInt16, e) + } + } + } + var yyn230 bool + if x.FptrSliceInt16 == nil { + yyn230 = true + goto LABEL230 + } + LABEL230: + if yyr2 || yy2arr2 { + if yyn230 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrSliceInt16 == nil { + r.EncodeNil() + } else { + yy231 := *x.FptrSliceInt16 + if false { + } else { + z.F.EncSliceInt16V(yy231, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrSliceInt16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrSliceInt16`) + } + r.WriteMapElemValue() + if yyn230 { + r.EncodeNil() + } else { + if x.FptrSliceInt16 == nil { + r.EncodeNil() + } else { + yy233 := *x.FptrSliceInt16 + if false { + } else { + z.F.EncSliceInt16V(yy233, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceInt32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceInt32V(x.FSliceInt32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FSliceInt32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FSliceInt32`) + } + r.WriteMapElemValue() + if x.FSliceInt32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceInt32V(x.FSliceInt32, e) + } + } + } + var yyn238 bool + if x.FptrSliceInt32 == nil { + yyn238 = true + goto LABEL238 + } + LABEL238: + if yyr2 || yy2arr2 { + if yyn238 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrSliceInt32 == nil { + r.EncodeNil() + } else { + yy239 := *x.FptrSliceInt32 + if false { + } else { + z.F.EncSliceInt32V(yy239, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrSliceInt32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrSliceInt32`) + } + r.WriteMapElemValue() + if yyn238 { + r.EncodeNil() + } else { + if x.FptrSliceInt32 == nil { + r.EncodeNil() + } else { + yy241 := *x.FptrSliceInt32 + if false { + } else { + z.F.EncSliceInt32V(yy241, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceInt64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceInt64V(x.FSliceInt64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FSliceInt64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FSliceInt64`) + } + r.WriteMapElemValue() + if x.FSliceInt64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceInt64V(x.FSliceInt64, e) + } + } + } + var yyn246 bool + if x.FptrSliceInt64 == nil { + yyn246 = true + goto LABEL246 + } + LABEL246: + if yyr2 || yy2arr2 { + if yyn246 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrSliceInt64 == nil { + r.EncodeNil() + } else { + yy247 := *x.FptrSliceInt64 + if false { + } else { + z.F.EncSliceInt64V(yy247, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrSliceInt64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrSliceInt64`) + } + r.WriteMapElemValue() + if yyn246 { + r.EncodeNil() + } else { + if x.FptrSliceInt64 == nil { + r.EncodeNil() + } else { + yy249 := *x.FptrSliceInt64 + if false { + } else { + z.F.EncSliceInt64V(yy249, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceBool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceBoolV(x.FSliceBool, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FSliceBool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FSliceBool`) + } + r.WriteMapElemValue() + if x.FSliceBool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncSliceBoolV(x.FSliceBool, e) + } + } + } + var yyn254 bool + if x.FptrSliceBool == nil { + yyn254 = true + goto LABEL254 + } + LABEL254: + if yyr2 || yy2arr2 { + if yyn254 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrSliceBool == nil { + r.EncodeNil() + } else { + yy255 := *x.FptrSliceBool + if false { + } else { + z.F.EncSliceBoolV(yy255, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrSliceBool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrSliceBool`) + } + r.WriteMapElemValue() + if yyn254 { + r.EncodeNil() + } else { + if x.FptrSliceBool == nil { + r.EncodeNil() + } else { + yy257 := *x.FptrSliceBool + if false { + } else { + z.F.EncSliceBoolV(yy257, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfIntf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfIntfV(x.FMapIntfIntf, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntfIntf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntfIntf`) + } + r.WriteMapElemValue() + if x.FMapIntfIntf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfIntfV(x.FMapIntfIntf, e) + } + } + } + var yyn262 bool + if x.FptrMapIntfIntf == nil { + yyn262 = true + goto LABEL262 + } + LABEL262: + if yyr2 || yy2arr2 { + if yyn262 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntfIntf == nil { + r.EncodeNil() + } else { + yy263 := *x.FptrMapIntfIntf + if false { + } else { + z.F.EncMapIntfIntfV(yy263, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntfIntf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntfIntf`) + } + r.WriteMapElemValue() + if yyn262 { + r.EncodeNil() + } else { + if x.FptrMapIntfIntf == nil { + r.EncodeNil() + } else { + yy265 := *x.FptrMapIntfIntf + if false { + } else { + z.F.EncMapIntfIntfV(yy265, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfString == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfStringV(x.FMapIntfString, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntfString\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntfString`) + } + r.WriteMapElemValue() + if x.FMapIntfString == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfStringV(x.FMapIntfString, e) + } + } + } + var yyn270 bool + if x.FptrMapIntfString == nil { + yyn270 = true + goto LABEL270 + } + LABEL270: + if yyr2 || yy2arr2 { + if yyn270 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntfString == nil { + r.EncodeNil() + } else { + yy271 := *x.FptrMapIntfString + if false { + } else { + z.F.EncMapIntfStringV(yy271, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntfString\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntfString`) + } + r.WriteMapElemValue() + if yyn270 { + r.EncodeNil() + } else { + if x.FptrMapIntfString == nil { + r.EncodeNil() + } else { + yy273 := *x.FptrMapIntfString + if false { + } else { + z.F.EncMapIntfStringV(yy273, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfUint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfUintV(x.FMapIntfUint, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntfUint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntfUint`) + } + r.WriteMapElemValue() + if x.FMapIntfUint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfUintV(x.FMapIntfUint, e) + } + } + } + var yyn278 bool + if x.FptrMapIntfUint == nil { + yyn278 = true + goto LABEL278 + } + LABEL278: + if yyr2 || yy2arr2 { + if yyn278 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntfUint == nil { + r.EncodeNil() + } else { + yy279 := *x.FptrMapIntfUint + if false { + } else { + z.F.EncMapIntfUintV(yy279, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntfUint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntfUint`) + } + r.WriteMapElemValue() + if yyn278 { + r.EncodeNil() + } else { + if x.FptrMapIntfUint == nil { + r.EncodeNil() + } else { + yy281 := *x.FptrMapIntfUint + if false { + } else { + z.F.EncMapIntfUintV(yy281, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfUint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfUint8V(x.FMapIntfUint8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntfUint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntfUint8`) + } + r.WriteMapElemValue() + if x.FMapIntfUint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfUint8V(x.FMapIntfUint8, e) + } + } + } + var yyn286 bool + if x.FptrMapIntfUint8 == nil { + yyn286 = true + goto LABEL286 + } + LABEL286: + if yyr2 || yy2arr2 { + if yyn286 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntfUint8 == nil { + r.EncodeNil() + } else { + yy287 := *x.FptrMapIntfUint8 + if false { + } else { + z.F.EncMapIntfUint8V(yy287, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntfUint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntfUint8`) + } + r.WriteMapElemValue() + if yyn286 { + r.EncodeNil() + } else { + if x.FptrMapIntfUint8 == nil { + r.EncodeNil() + } else { + yy289 := *x.FptrMapIntfUint8 + if false { + } else { + z.F.EncMapIntfUint8V(yy289, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfUint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfUint16V(x.FMapIntfUint16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntfUint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntfUint16`) + } + r.WriteMapElemValue() + if x.FMapIntfUint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfUint16V(x.FMapIntfUint16, e) + } + } + } + var yyn294 bool + if x.FptrMapIntfUint16 == nil { + yyn294 = true + goto LABEL294 + } + LABEL294: + if yyr2 || yy2arr2 { + if yyn294 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntfUint16 == nil { + r.EncodeNil() + } else { + yy295 := *x.FptrMapIntfUint16 + if false { + } else { + z.F.EncMapIntfUint16V(yy295, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntfUint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntfUint16`) + } + r.WriteMapElemValue() + if yyn294 { + r.EncodeNil() + } else { + if x.FptrMapIntfUint16 == nil { + r.EncodeNil() + } else { + yy297 := *x.FptrMapIntfUint16 + if false { + } else { + z.F.EncMapIntfUint16V(yy297, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfUint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfUint32V(x.FMapIntfUint32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntfUint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntfUint32`) + } + r.WriteMapElemValue() + if x.FMapIntfUint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfUint32V(x.FMapIntfUint32, e) + } + } + } + var yyn302 bool + if x.FptrMapIntfUint32 == nil { + yyn302 = true + goto LABEL302 + } + LABEL302: + if yyr2 || yy2arr2 { + if yyn302 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntfUint32 == nil { + r.EncodeNil() + } else { + yy303 := *x.FptrMapIntfUint32 + if false { + } else { + z.F.EncMapIntfUint32V(yy303, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntfUint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntfUint32`) + } + r.WriteMapElemValue() + if yyn302 { + r.EncodeNil() + } else { + if x.FptrMapIntfUint32 == nil { + r.EncodeNil() + } else { + yy305 := *x.FptrMapIntfUint32 + if false { + } else { + z.F.EncMapIntfUint32V(yy305, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfUint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfUint64V(x.FMapIntfUint64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntfUint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntfUint64`) + } + r.WriteMapElemValue() + if x.FMapIntfUint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfUint64V(x.FMapIntfUint64, e) + } + } + } + var yyn310 bool + if x.FptrMapIntfUint64 == nil { + yyn310 = true + goto LABEL310 + } + LABEL310: + if yyr2 || yy2arr2 { + if yyn310 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntfUint64 == nil { + r.EncodeNil() + } else { + yy311 := *x.FptrMapIntfUint64 + if false { + } else { + z.F.EncMapIntfUint64V(yy311, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntfUint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntfUint64`) + } + r.WriteMapElemValue() + if yyn310 { + r.EncodeNil() + } else { + if x.FptrMapIntfUint64 == nil { + r.EncodeNil() + } else { + yy313 := *x.FptrMapIntfUint64 + if false { + } else { + z.F.EncMapIntfUint64V(yy313, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfUintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfUintptrV(x.FMapIntfUintptr, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntfUintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntfUintptr`) + } + r.WriteMapElemValue() + if x.FMapIntfUintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfUintptrV(x.FMapIntfUintptr, e) + } + } + } + var yyn318 bool + if x.FptrMapIntfUintptr == nil { + yyn318 = true + goto LABEL318 + } + LABEL318: + if yyr2 || yy2arr2 { + if yyn318 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntfUintptr == nil { + r.EncodeNil() + } else { + yy319 := *x.FptrMapIntfUintptr + if false { + } else { + z.F.EncMapIntfUintptrV(yy319, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntfUintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntfUintptr`) + } + r.WriteMapElemValue() + if yyn318 { + r.EncodeNil() + } else { + if x.FptrMapIntfUintptr == nil { + r.EncodeNil() + } else { + yy321 := *x.FptrMapIntfUintptr + if false { + } else { + z.F.EncMapIntfUintptrV(yy321, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfInt == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfIntV(x.FMapIntfInt, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntfInt\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntfInt`) + } + r.WriteMapElemValue() + if x.FMapIntfInt == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfIntV(x.FMapIntfInt, e) + } + } + } + var yyn326 bool + if x.FptrMapIntfInt == nil { + yyn326 = true + goto LABEL326 + } + LABEL326: + if yyr2 || yy2arr2 { + if yyn326 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntfInt == nil { + r.EncodeNil() + } else { + yy327 := *x.FptrMapIntfInt + if false { + } else { + z.F.EncMapIntfIntV(yy327, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntfInt\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntfInt`) + } + r.WriteMapElemValue() + if yyn326 { + r.EncodeNil() + } else { + if x.FptrMapIntfInt == nil { + r.EncodeNil() + } else { + yy329 := *x.FptrMapIntfInt + if false { + } else { + z.F.EncMapIntfIntV(yy329, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfInt8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfInt8V(x.FMapIntfInt8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntfInt8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntfInt8`) + } + r.WriteMapElemValue() + if x.FMapIntfInt8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfInt8V(x.FMapIntfInt8, e) + } + } + } + var yyn334 bool + if x.FptrMapIntfInt8 == nil { + yyn334 = true + goto LABEL334 + } + LABEL334: + if yyr2 || yy2arr2 { + if yyn334 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntfInt8 == nil { + r.EncodeNil() + } else { + yy335 := *x.FptrMapIntfInt8 + if false { + } else { + z.F.EncMapIntfInt8V(yy335, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntfInt8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntfInt8`) + } + r.WriteMapElemValue() + if yyn334 { + r.EncodeNil() + } else { + if x.FptrMapIntfInt8 == nil { + r.EncodeNil() + } else { + yy337 := *x.FptrMapIntfInt8 + if false { + } else { + z.F.EncMapIntfInt8V(yy337, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfInt16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfInt16V(x.FMapIntfInt16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntfInt16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntfInt16`) + } + r.WriteMapElemValue() + if x.FMapIntfInt16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfInt16V(x.FMapIntfInt16, e) + } + } + } + var yyn342 bool + if x.FptrMapIntfInt16 == nil { + yyn342 = true + goto LABEL342 + } + LABEL342: + if yyr2 || yy2arr2 { + if yyn342 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntfInt16 == nil { + r.EncodeNil() + } else { + yy343 := *x.FptrMapIntfInt16 + if false { + } else { + z.F.EncMapIntfInt16V(yy343, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntfInt16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntfInt16`) + } + r.WriteMapElemValue() + if yyn342 { + r.EncodeNil() + } else { + if x.FptrMapIntfInt16 == nil { + r.EncodeNil() + } else { + yy345 := *x.FptrMapIntfInt16 + if false { + } else { + z.F.EncMapIntfInt16V(yy345, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfInt32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfInt32V(x.FMapIntfInt32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntfInt32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntfInt32`) + } + r.WriteMapElemValue() + if x.FMapIntfInt32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfInt32V(x.FMapIntfInt32, e) + } + } + } + var yyn350 bool + if x.FptrMapIntfInt32 == nil { + yyn350 = true + goto LABEL350 + } + LABEL350: + if yyr2 || yy2arr2 { + if yyn350 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntfInt32 == nil { + r.EncodeNil() + } else { + yy351 := *x.FptrMapIntfInt32 + if false { + } else { + z.F.EncMapIntfInt32V(yy351, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntfInt32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntfInt32`) + } + r.WriteMapElemValue() + if yyn350 { + r.EncodeNil() + } else { + if x.FptrMapIntfInt32 == nil { + r.EncodeNil() + } else { + yy353 := *x.FptrMapIntfInt32 + if false { + } else { + z.F.EncMapIntfInt32V(yy353, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfInt64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfInt64V(x.FMapIntfInt64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntfInt64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntfInt64`) + } + r.WriteMapElemValue() + if x.FMapIntfInt64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfInt64V(x.FMapIntfInt64, e) + } + } + } + var yyn358 bool + if x.FptrMapIntfInt64 == nil { + yyn358 = true + goto LABEL358 + } + LABEL358: + if yyr2 || yy2arr2 { + if yyn358 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntfInt64 == nil { + r.EncodeNil() + } else { + yy359 := *x.FptrMapIntfInt64 + if false { + } else { + z.F.EncMapIntfInt64V(yy359, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntfInt64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntfInt64`) + } + r.WriteMapElemValue() + if yyn358 { + r.EncodeNil() + } else { + if x.FptrMapIntfInt64 == nil { + r.EncodeNil() + } else { + yy361 := *x.FptrMapIntfInt64 + if false { + } else { + z.F.EncMapIntfInt64V(yy361, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfFloat32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfFloat32V(x.FMapIntfFloat32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntfFloat32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntfFloat32`) + } + r.WriteMapElemValue() + if x.FMapIntfFloat32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfFloat32V(x.FMapIntfFloat32, e) + } + } + } + var yyn366 bool + if x.FptrMapIntfFloat32 == nil { + yyn366 = true + goto LABEL366 + } + LABEL366: + if yyr2 || yy2arr2 { + if yyn366 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntfFloat32 == nil { + r.EncodeNil() + } else { + yy367 := *x.FptrMapIntfFloat32 + if false { + } else { + z.F.EncMapIntfFloat32V(yy367, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntfFloat32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntfFloat32`) + } + r.WriteMapElemValue() + if yyn366 { + r.EncodeNil() + } else { + if x.FptrMapIntfFloat32 == nil { + r.EncodeNil() + } else { + yy369 := *x.FptrMapIntfFloat32 + if false { + } else { + z.F.EncMapIntfFloat32V(yy369, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfFloat64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfFloat64V(x.FMapIntfFloat64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntfFloat64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntfFloat64`) + } + r.WriteMapElemValue() + if x.FMapIntfFloat64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfFloat64V(x.FMapIntfFloat64, e) + } + } + } + var yyn374 bool + if x.FptrMapIntfFloat64 == nil { + yyn374 = true + goto LABEL374 + } + LABEL374: + if yyr2 || yy2arr2 { + if yyn374 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntfFloat64 == nil { + r.EncodeNil() + } else { + yy375 := *x.FptrMapIntfFloat64 + if false { + } else { + z.F.EncMapIntfFloat64V(yy375, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntfFloat64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntfFloat64`) + } + r.WriteMapElemValue() + if yyn374 { + r.EncodeNil() + } else { + if x.FptrMapIntfFloat64 == nil { + r.EncodeNil() + } else { + yy377 := *x.FptrMapIntfFloat64 + if false { + } else { + z.F.EncMapIntfFloat64V(yy377, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfBool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfBoolV(x.FMapIntfBool, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntfBool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntfBool`) + } + r.WriteMapElemValue() + if x.FMapIntfBool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntfBoolV(x.FMapIntfBool, e) + } + } + } + var yyn382 bool + if x.FptrMapIntfBool == nil { + yyn382 = true + goto LABEL382 + } + LABEL382: + if yyr2 || yy2arr2 { + if yyn382 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntfBool == nil { + r.EncodeNil() + } else { + yy383 := *x.FptrMapIntfBool + if false { + } else { + z.F.EncMapIntfBoolV(yy383, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntfBool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntfBool`) + } + r.WriteMapElemValue() + if yyn382 { + r.EncodeNil() + } else { + if x.FptrMapIntfBool == nil { + r.EncodeNil() + } else { + yy385 := *x.FptrMapIntfBool + if false { + } else { + z.F.EncMapIntfBoolV(yy385, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringIntf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringIntfV(x.FMapStringIntf, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapStringIntf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapStringIntf`) + } + r.WriteMapElemValue() + if x.FMapStringIntf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringIntfV(x.FMapStringIntf, e) + } + } + } + var yyn390 bool + if x.FptrMapStringIntf == nil { + yyn390 = true + goto LABEL390 + } + LABEL390: + if yyr2 || yy2arr2 { + if yyn390 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapStringIntf == nil { + r.EncodeNil() + } else { + yy391 := *x.FptrMapStringIntf + if false { + } else { + z.F.EncMapStringIntfV(yy391, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapStringIntf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapStringIntf`) + } + r.WriteMapElemValue() + if yyn390 { + r.EncodeNil() + } else { + if x.FptrMapStringIntf == nil { + r.EncodeNil() + } else { + yy393 := *x.FptrMapStringIntf + if false { + } else { + z.F.EncMapStringIntfV(yy393, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringString == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringStringV(x.FMapStringString, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapStringString\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapStringString`) + } + r.WriteMapElemValue() + if x.FMapStringString == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringStringV(x.FMapStringString, e) + } + } + } + var yyn398 bool + if x.FptrMapStringString == nil { + yyn398 = true + goto LABEL398 + } + LABEL398: + if yyr2 || yy2arr2 { + if yyn398 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapStringString == nil { + r.EncodeNil() + } else { + yy399 := *x.FptrMapStringString + if false { + } else { + z.F.EncMapStringStringV(yy399, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapStringString\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapStringString`) + } + r.WriteMapElemValue() + if yyn398 { + r.EncodeNil() + } else { + if x.FptrMapStringString == nil { + r.EncodeNil() + } else { + yy401 := *x.FptrMapStringString + if false { + } else { + z.F.EncMapStringStringV(yy401, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringUint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringUintV(x.FMapStringUint, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapStringUint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapStringUint`) + } + r.WriteMapElemValue() + if x.FMapStringUint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringUintV(x.FMapStringUint, e) + } + } + } + var yyn406 bool + if x.FptrMapStringUint == nil { + yyn406 = true + goto LABEL406 + } + LABEL406: + if yyr2 || yy2arr2 { + if yyn406 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapStringUint == nil { + r.EncodeNil() + } else { + yy407 := *x.FptrMapStringUint + if false { + } else { + z.F.EncMapStringUintV(yy407, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapStringUint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapStringUint`) + } + r.WriteMapElemValue() + if yyn406 { + r.EncodeNil() + } else { + if x.FptrMapStringUint == nil { + r.EncodeNil() + } else { + yy409 := *x.FptrMapStringUint + if false { + } else { + z.F.EncMapStringUintV(yy409, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringUint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringUint8V(x.FMapStringUint8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapStringUint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapStringUint8`) + } + r.WriteMapElemValue() + if x.FMapStringUint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringUint8V(x.FMapStringUint8, e) + } + } + } + var yyn414 bool + if x.FptrMapStringUint8 == nil { + yyn414 = true + goto LABEL414 + } + LABEL414: + if yyr2 || yy2arr2 { + if yyn414 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapStringUint8 == nil { + r.EncodeNil() + } else { + yy415 := *x.FptrMapStringUint8 + if false { + } else { + z.F.EncMapStringUint8V(yy415, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapStringUint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapStringUint8`) + } + r.WriteMapElemValue() + if yyn414 { + r.EncodeNil() + } else { + if x.FptrMapStringUint8 == nil { + r.EncodeNil() + } else { + yy417 := *x.FptrMapStringUint8 + if false { + } else { + z.F.EncMapStringUint8V(yy417, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringUint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringUint16V(x.FMapStringUint16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapStringUint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapStringUint16`) + } + r.WriteMapElemValue() + if x.FMapStringUint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringUint16V(x.FMapStringUint16, e) + } + } + } + var yyn422 bool + if x.FptrMapStringUint16 == nil { + yyn422 = true + goto LABEL422 + } + LABEL422: + if yyr2 || yy2arr2 { + if yyn422 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapStringUint16 == nil { + r.EncodeNil() + } else { + yy423 := *x.FptrMapStringUint16 + if false { + } else { + z.F.EncMapStringUint16V(yy423, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapStringUint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapStringUint16`) + } + r.WriteMapElemValue() + if yyn422 { + r.EncodeNil() + } else { + if x.FptrMapStringUint16 == nil { + r.EncodeNil() + } else { + yy425 := *x.FptrMapStringUint16 + if false { + } else { + z.F.EncMapStringUint16V(yy425, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringUint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringUint32V(x.FMapStringUint32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapStringUint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapStringUint32`) + } + r.WriteMapElemValue() + if x.FMapStringUint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringUint32V(x.FMapStringUint32, e) + } + } + } + var yyn430 bool + if x.FptrMapStringUint32 == nil { + yyn430 = true + goto LABEL430 + } + LABEL430: + if yyr2 || yy2arr2 { + if yyn430 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapStringUint32 == nil { + r.EncodeNil() + } else { + yy431 := *x.FptrMapStringUint32 + if false { + } else { + z.F.EncMapStringUint32V(yy431, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapStringUint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapStringUint32`) + } + r.WriteMapElemValue() + if yyn430 { + r.EncodeNil() + } else { + if x.FptrMapStringUint32 == nil { + r.EncodeNil() + } else { + yy433 := *x.FptrMapStringUint32 + if false { + } else { + z.F.EncMapStringUint32V(yy433, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringUint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringUint64V(x.FMapStringUint64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapStringUint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapStringUint64`) + } + r.WriteMapElemValue() + if x.FMapStringUint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringUint64V(x.FMapStringUint64, e) + } + } + } + var yyn438 bool + if x.FptrMapStringUint64 == nil { + yyn438 = true + goto LABEL438 + } + LABEL438: + if yyr2 || yy2arr2 { + if yyn438 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapStringUint64 == nil { + r.EncodeNil() + } else { + yy439 := *x.FptrMapStringUint64 + if false { + } else { + z.F.EncMapStringUint64V(yy439, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapStringUint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapStringUint64`) + } + r.WriteMapElemValue() + if yyn438 { + r.EncodeNil() + } else { + if x.FptrMapStringUint64 == nil { + r.EncodeNil() + } else { + yy441 := *x.FptrMapStringUint64 + if false { + } else { + z.F.EncMapStringUint64V(yy441, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringUintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringUintptrV(x.FMapStringUintptr, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapStringUintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapStringUintptr`) + } + r.WriteMapElemValue() + if x.FMapStringUintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringUintptrV(x.FMapStringUintptr, e) + } + } + } + var yyn446 bool + if x.FptrMapStringUintptr == nil { + yyn446 = true + goto LABEL446 + } + LABEL446: + if yyr2 || yy2arr2 { + if yyn446 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapStringUintptr == nil { + r.EncodeNil() + } else { + yy447 := *x.FptrMapStringUintptr + if false { + } else { + z.F.EncMapStringUintptrV(yy447, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapStringUintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapStringUintptr`) + } + r.WriteMapElemValue() + if yyn446 { + r.EncodeNil() + } else { + if x.FptrMapStringUintptr == nil { + r.EncodeNil() + } else { + yy449 := *x.FptrMapStringUintptr + if false { + } else { + z.F.EncMapStringUintptrV(yy449, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringInt == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringIntV(x.FMapStringInt, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapStringInt\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapStringInt`) + } + r.WriteMapElemValue() + if x.FMapStringInt == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringIntV(x.FMapStringInt, e) + } + } + } + var yyn454 bool + if x.FptrMapStringInt == nil { + yyn454 = true + goto LABEL454 + } + LABEL454: + if yyr2 || yy2arr2 { + if yyn454 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapStringInt == nil { + r.EncodeNil() + } else { + yy455 := *x.FptrMapStringInt + if false { + } else { + z.F.EncMapStringIntV(yy455, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapStringInt\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapStringInt`) + } + r.WriteMapElemValue() + if yyn454 { + r.EncodeNil() + } else { + if x.FptrMapStringInt == nil { + r.EncodeNil() + } else { + yy457 := *x.FptrMapStringInt + if false { + } else { + z.F.EncMapStringIntV(yy457, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringInt8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringInt8V(x.FMapStringInt8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapStringInt8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapStringInt8`) + } + r.WriteMapElemValue() + if x.FMapStringInt8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringInt8V(x.FMapStringInt8, e) + } + } + } + var yyn462 bool + if x.FptrMapStringInt8 == nil { + yyn462 = true + goto LABEL462 + } + LABEL462: + if yyr2 || yy2arr2 { + if yyn462 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapStringInt8 == nil { + r.EncodeNil() + } else { + yy463 := *x.FptrMapStringInt8 + if false { + } else { + z.F.EncMapStringInt8V(yy463, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapStringInt8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapStringInt8`) + } + r.WriteMapElemValue() + if yyn462 { + r.EncodeNil() + } else { + if x.FptrMapStringInt8 == nil { + r.EncodeNil() + } else { + yy465 := *x.FptrMapStringInt8 + if false { + } else { + z.F.EncMapStringInt8V(yy465, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringInt16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringInt16V(x.FMapStringInt16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapStringInt16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapStringInt16`) + } + r.WriteMapElemValue() + if x.FMapStringInt16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringInt16V(x.FMapStringInt16, e) + } + } + } + var yyn470 bool + if x.FptrMapStringInt16 == nil { + yyn470 = true + goto LABEL470 + } + LABEL470: + if yyr2 || yy2arr2 { + if yyn470 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapStringInt16 == nil { + r.EncodeNil() + } else { + yy471 := *x.FptrMapStringInt16 + if false { + } else { + z.F.EncMapStringInt16V(yy471, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapStringInt16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapStringInt16`) + } + r.WriteMapElemValue() + if yyn470 { + r.EncodeNil() + } else { + if x.FptrMapStringInt16 == nil { + r.EncodeNil() + } else { + yy473 := *x.FptrMapStringInt16 + if false { + } else { + z.F.EncMapStringInt16V(yy473, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringInt32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringInt32V(x.FMapStringInt32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapStringInt32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapStringInt32`) + } + r.WriteMapElemValue() + if x.FMapStringInt32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringInt32V(x.FMapStringInt32, e) + } + } + } + var yyn478 bool + if x.FptrMapStringInt32 == nil { + yyn478 = true + goto LABEL478 + } + LABEL478: + if yyr2 || yy2arr2 { + if yyn478 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapStringInt32 == nil { + r.EncodeNil() + } else { + yy479 := *x.FptrMapStringInt32 + if false { + } else { + z.F.EncMapStringInt32V(yy479, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapStringInt32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapStringInt32`) + } + r.WriteMapElemValue() + if yyn478 { + r.EncodeNil() + } else { + if x.FptrMapStringInt32 == nil { + r.EncodeNil() + } else { + yy481 := *x.FptrMapStringInt32 + if false { + } else { + z.F.EncMapStringInt32V(yy481, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringInt64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringInt64V(x.FMapStringInt64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapStringInt64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapStringInt64`) + } + r.WriteMapElemValue() + if x.FMapStringInt64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringInt64V(x.FMapStringInt64, e) + } + } + } + var yyn486 bool + if x.FptrMapStringInt64 == nil { + yyn486 = true + goto LABEL486 + } + LABEL486: + if yyr2 || yy2arr2 { + if yyn486 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapStringInt64 == nil { + r.EncodeNil() + } else { + yy487 := *x.FptrMapStringInt64 + if false { + } else { + z.F.EncMapStringInt64V(yy487, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapStringInt64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapStringInt64`) + } + r.WriteMapElemValue() + if yyn486 { + r.EncodeNil() + } else { + if x.FptrMapStringInt64 == nil { + r.EncodeNil() + } else { + yy489 := *x.FptrMapStringInt64 + if false { + } else { + z.F.EncMapStringInt64V(yy489, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringFloat32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringFloat32V(x.FMapStringFloat32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapStringFloat32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapStringFloat32`) + } + r.WriteMapElemValue() + if x.FMapStringFloat32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringFloat32V(x.FMapStringFloat32, e) + } + } + } + var yyn494 bool + if x.FptrMapStringFloat32 == nil { + yyn494 = true + goto LABEL494 + } + LABEL494: + if yyr2 || yy2arr2 { + if yyn494 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapStringFloat32 == nil { + r.EncodeNil() + } else { + yy495 := *x.FptrMapStringFloat32 + if false { + } else { + z.F.EncMapStringFloat32V(yy495, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapStringFloat32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapStringFloat32`) + } + r.WriteMapElemValue() + if yyn494 { + r.EncodeNil() + } else { + if x.FptrMapStringFloat32 == nil { + r.EncodeNil() + } else { + yy497 := *x.FptrMapStringFloat32 + if false { + } else { + z.F.EncMapStringFloat32V(yy497, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringFloat64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringFloat64V(x.FMapStringFloat64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapStringFloat64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapStringFloat64`) + } + r.WriteMapElemValue() + if x.FMapStringFloat64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringFloat64V(x.FMapStringFloat64, e) + } + } + } + var yyn502 bool + if x.FptrMapStringFloat64 == nil { + yyn502 = true + goto LABEL502 + } + LABEL502: + if yyr2 || yy2arr2 { + if yyn502 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapStringFloat64 == nil { + r.EncodeNil() + } else { + yy503 := *x.FptrMapStringFloat64 + if false { + } else { + z.F.EncMapStringFloat64V(yy503, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapStringFloat64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapStringFloat64`) + } + r.WriteMapElemValue() + if yyn502 { + r.EncodeNil() + } else { + if x.FptrMapStringFloat64 == nil { + r.EncodeNil() + } else { + yy505 := *x.FptrMapStringFloat64 + if false { + } else { + z.F.EncMapStringFloat64V(yy505, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringBool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringBoolV(x.FMapStringBool, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapStringBool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapStringBool`) + } + r.WriteMapElemValue() + if x.FMapStringBool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapStringBoolV(x.FMapStringBool, e) + } + } + } + var yyn510 bool + if x.FptrMapStringBool == nil { + yyn510 = true + goto LABEL510 + } + LABEL510: + if yyr2 || yy2arr2 { + if yyn510 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapStringBool == nil { + r.EncodeNil() + } else { + yy511 := *x.FptrMapStringBool + if false { + } else { + z.F.EncMapStringBoolV(yy511, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapStringBool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapStringBool`) + } + r.WriteMapElemValue() + if yyn510 { + r.EncodeNil() + } else { + if x.FptrMapStringBool == nil { + r.EncodeNil() + } else { + yy513 := *x.FptrMapStringBool + if false { + } else { + z.F.EncMapStringBoolV(yy513, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Intf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32IntfV(x.FMapFloat32Intf, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat32Intf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat32Intf`) + } + r.WriteMapElemValue() + if x.FMapFloat32Intf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32IntfV(x.FMapFloat32Intf, e) + } + } + } + var yyn518 bool + if x.FptrMapFloat32Intf == nil { + yyn518 = true + goto LABEL518 + } + LABEL518: + if yyr2 || yy2arr2 { + if yyn518 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat32Intf == nil { + r.EncodeNil() + } else { + yy519 := *x.FptrMapFloat32Intf + if false { + } else { + z.F.EncMapFloat32IntfV(yy519, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat32Intf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat32Intf`) + } + r.WriteMapElemValue() + if yyn518 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Intf == nil { + r.EncodeNil() + } else { + yy521 := *x.FptrMapFloat32Intf + if false { + } else { + z.F.EncMapFloat32IntfV(yy521, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32String == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32StringV(x.FMapFloat32String, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat32String\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat32String`) + } + r.WriteMapElemValue() + if x.FMapFloat32String == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32StringV(x.FMapFloat32String, e) + } + } + } + var yyn526 bool + if x.FptrMapFloat32String == nil { + yyn526 = true + goto LABEL526 + } + LABEL526: + if yyr2 || yy2arr2 { + if yyn526 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat32String == nil { + r.EncodeNil() + } else { + yy527 := *x.FptrMapFloat32String + if false { + } else { + z.F.EncMapFloat32StringV(yy527, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat32String\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat32String`) + } + r.WriteMapElemValue() + if yyn526 { + r.EncodeNil() + } else { + if x.FptrMapFloat32String == nil { + r.EncodeNil() + } else { + yy529 := *x.FptrMapFloat32String + if false { + } else { + z.F.EncMapFloat32StringV(yy529, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Uint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32UintV(x.FMapFloat32Uint, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat32Uint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat32Uint`) + } + r.WriteMapElemValue() + if x.FMapFloat32Uint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32UintV(x.FMapFloat32Uint, e) + } + } + } + var yyn534 bool + if x.FptrMapFloat32Uint == nil { + yyn534 = true + goto LABEL534 + } + LABEL534: + if yyr2 || yy2arr2 { + if yyn534 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat32Uint == nil { + r.EncodeNil() + } else { + yy535 := *x.FptrMapFloat32Uint + if false { + } else { + z.F.EncMapFloat32UintV(yy535, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat32Uint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat32Uint`) + } + r.WriteMapElemValue() + if yyn534 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Uint == nil { + r.EncodeNil() + } else { + yy537 := *x.FptrMapFloat32Uint + if false { + } else { + z.F.EncMapFloat32UintV(yy537, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Uint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32Uint8V(x.FMapFloat32Uint8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat32Uint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat32Uint8`) + } + r.WriteMapElemValue() + if x.FMapFloat32Uint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32Uint8V(x.FMapFloat32Uint8, e) + } + } + } + var yyn542 bool + if x.FptrMapFloat32Uint8 == nil { + yyn542 = true + goto LABEL542 + } + LABEL542: + if yyr2 || yy2arr2 { + if yyn542 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat32Uint8 == nil { + r.EncodeNil() + } else { + yy543 := *x.FptrMapFloat32Uint8 + if false { + } else { + z.F.EncMapFloat32Uint8V(yy543, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat32Uint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat32Uint8`) + } + r.WriteMapElemValue() + if yyn542 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Uint8 == nil { + r.EncodeNil() + } else { + yy545 := *x.FptrMapFloat32Uint8 + if false { + } else { + z.F.EncMapFloat32Uint8V(yy545, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Uint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32Uint16V(x.FMapFloat32Uint16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat32Uint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat32Uint16`) + } + r.WriteMapElemValue() + if x.FMapFloat32Uint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32Uint16V(x.FMapFloat32Uint16, e) + } + } + } + var yyn550 bool + if x.FptrMapFloat32Uint16 == nil { + yyn550 = true + goto LABEL550 + } + LABEL550: + if yyr2 || yy2arr2 { + if yyn550 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat32Uint16 == nil { + r.EncodeNil() + } else { + yy551 := *x.FptrMapFloat32Uint16 + if false { + } else { + z.F.EncMapFloat32Uint16V(yy551, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat32Uint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat32Uint16`) + } + r.WriteMapElemValue() + if yyn550 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Uint16 == nil { + r.EncodeNil() + } else { + yy553 := *x.FptrMapFloat32Uint16 + if false { + } else { + z.F.EncMapFloat32Uint16V(yy553, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Uint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32Uint32V(x.FMapFloat32Uint32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat32Uint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat32Uint32`) + } + r.WriteMapElemValue() + if x.FMapFloat32Uint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32Uint32V(x.FMapFloat32Uint32, e) + } + } + } + var yyn558 bool + if x.FptrMapFloat32Uint32 == nil { + yyn558 = true + goto LABEL558 + } + LABEL558: + if yyr2 || yy2arr2 { + if yyn558 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat32Uint32 == nil { + r.EncodeNil() + } else { + yy559 := *x.FptrMapFloat32Uint32 + if false { + } else { + z.F.EncMapFloat32Uint32V(yy559, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat32Uint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat32Uint32`) + } + r.WriteMapElemValue() + if yyn558 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Uint32 == nil { + r.EncodeNil() + } else { + yy561 := *x.FptrMapFloat32Uint32 + if false { + } else { + z.F.EncMapFloat32Uint32V(yy561, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Uint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32Uint64V(x.FMapFloat32Uint64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat32Uint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat32Uint64`) + } + r.WriteMapElemValue() + if x.FMapFloat32Uint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32Uint64V(x.FMapFloat32Uint64, e) + } + } + } + var yyn566 bool + if x.FptrMapFloat32Uint64 == nil { + yyn566 = true + goto LABEL566 + } + LABEL566: + if yyr2 || yy2arr2 { + if yyn566 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat32Uint64 == nil { + r.EncodeNil() + } else { + yy567 := *x.FptrMapFloat32Uint64 + if false { + } else { + z.F.EncMapFloat32Uint64V(yy567, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat32Uint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat32Uint64`) + } + r.WriteMapElemValue() + if yyn566 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Uint64 == nil { + r.EncodeNil() + } else { + yy569 := *x.FptrMapFloat32Uint64 + if false { + } else { + z.F.EncMapFloat32Uint64V(yy569, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Uintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32UintptrV(x.FMapFloat32Uintptr, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat32Uintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat32Uintptr`) + } + r.WriteMapElemValue() + if x.FMapFloat32Uintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32UintptrV(x.FMapFloat32Uintptr, e) + } + } + } + var yyn574 bool + if x.FptrMapFloat32Uintptr == nil { + yyn574 = true + goto LABEL574 + } + LABEL574: + if yyr2 || yy2arr2 { + if yyn574 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat32Uintptr == nil { + r.EncodeNil() + } else { + yy575 := *x.FptrMapFloat32Uintptr + if false { + } else { + z.F.EncMapFloat32UintptrV(yy575, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat32Uintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat32Uintptr`) + } + r.WriteMapElemValue() + if yyn574 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Uintptr == nil { + r.EncodeNil() + } else { + yy577 := *x.FptrMapFloat32Uintptr + if false { + } else { + z.F.EncMapFloat32UintptrV(yy577, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Int == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32IntV(x.FMapFloat32Int, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat32Int\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat32Int`) + } + r.WriteMapElemValue() + if x.FMapFloat32Int == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32IntV(x.FMapFloat32Int, e) + } + } + } + var yyn582 bool + if x.FptrMapFloat32Int == nil { + yyn582 = true + goto LABEL582 + } + LABEL582: + if yyr2 || yy2arr2 { + if yyn582 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat32Int == nil { + r.EncodeNil() + } else { + yy583 := *x.FptrMapFloat32Int + if false { + } else { + z.F.EncMapFloat32IntV(yy583, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat32Int\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat32Int`) + } + r.WriteMapElemValue() + if yyn582 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Int == nil { + r.EncodeNil() + } else { + yy585 := *x.FptrMapFloat32Int + if false { + } else { + z.F.EncMapFloat32IntV(yy585, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Int8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32Int8V(x.FMapFloat32Int8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat32Int8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat32Int8`) + } + r.WriteMapElemValue() + if x.FMapFloat32Int8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32Int8V(x.FMapFloat32Int8, e) + } + } + } + var yyn590 bool + if x.FptrMapFloat32Int8 == nil { + yyn590 = true + goto LABEL590 + } + LABEL590: + if yyr2 || yy2arr2 { + if yyn590 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat32Int8 == nil { + r.EncodeNil() + } else { + yy591 := *x.FptrMapFloat32Int8 + if false { + } else { + z.F.EncMapFloat32Int8V(yy591, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat32Int8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat32Int8`) + } + r.WriteMapElemValue() + if yyn590 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Int8 == nil { + r.EncodeNil() + } else { + yy593 := *x.FptrMapFloat32Int8 + if false { + } else { + z.F.EncMapFloat32Int8V(yy593, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Int16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32Int16V(x.FMapFloat32Int16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat32Int16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat32Int16`) + } + r.WriteMapElemValue() + if x.FMapFloat32Int16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32Int16V(x.FMapFloat32Int16, e) + } + } + } + var yyn598 bool + if x.FptrMapFloat32Int16 == nil { + yyn598 = true + goto LABEL598 + } + LABEL598: + if yyr2 || yy2arr2 { + if yyn598 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat32Int16 == nil { + r.EncodeNil() + } else { + yy599 := *x.FptrMapFloat32Int16 + if false { + } else { + z.F.EncMapFloat32Int16V(yy599, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat32Int16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat32Int16`) + } + r.WriteMapElemValue() + if yyn598 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Int16 == nil { + r.EncodeNil() + } else { + yy601 := *x.FptrMapFloat32Int16 + if false { + } else { + z.F.EncMapFloat32Int16V(yy601, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Int32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32Int32V(x.FMapFloat32Int32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat32Int32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat32Int32`) + } + r.WriteMapElemValue() + if x.FMapFloat32Int32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32Int32V(x.FMapFloat32Int32, e) + } + } + } + var yyn606 bool + if x.FptrMapFloat32Int32 == nil { + yyn606 = true + goto LABEL606 + } + LABEL606: + if yyr2 || yy2arr2 { + if yyn606 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat32Int32 == nil { + r.EncodeNil() + } else { + yy607 := *x.FptrMapFloat32Int32 + if false { + } else { + z.F.EncMapFloat32Int32V(yy607, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat32Int32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat32Int32`) + } + r.WriteMapElemValue() + if yyn606 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Int32 == nil { + r.EncodeNil() + } else { + yy609 := *x.FptrMapFloat32Int32 + if false { + } else { + z.F.EncMapFloat32Int32V(yy609, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Int64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32Int64V(x.FMapFloat32Int64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat32Int64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat32Int64`) + } + r.WriteMapElemValue() + if x.FMapFloat32Int64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32Int64V(x.FMapFloat32Int64, e) + } + } + } + var yyn614 bool + if x.FptrMapFloat32Int64 == nil { + yyn614 = true + goto LABEL614 + } + LABEL614: + if yyr2 || yy2arr2 { + if yyn614 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat32Int64 == nil { + r.EncodeNil() + } else { + yy615 := *x.FptrMapFloat32Int64 + if false { + } else { + z.F.EncMapFloat32Int64V(yy615, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat32Int64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat32Int64`) + } + r.WriteMapElemValue() + if yyn614 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Int64 == nil { + r.EncodeNil() + } else { + yy617 := *x.FptrMapFloat32Int64 + if false { + } else { + z.F.EncMapFloat32Int64V(yy617, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Float32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32Float32V(x.FMapFloat32Float32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat32Float32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat32Float32`) + } + r.WriteMapElemValue() + if x.FMapFloat32Float32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32Float32V(x.FMapFloat32Float32, e) + } + } + } + var yyn622 bool + if x.FptrMapFloat32Float32 == nil { + yyn622 = true + goto LABEL622 + } + LABEL622: + if yyr2 || yy2arr2 { + if yyn622 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat32Float32 == nil { + r.EncodeNil() + } else { + yy623 := *x.FptrMapFloat32Float32 + if false { + } else { + z.F.EncMapFloat32Float32V(yy623, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat32Float32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat32Float32`) + } + r.WriteMapElemValue() + if yyn622 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Float32 == nil { + r.EncodeNil() + } else { + yy625 := *x.FptrMapFloat32Float32 + if false { + } else { + z.F.EncMapFloat32Float32V(yy625, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Float64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32Float64V(x.FMapFloat32Float64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat32Float64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat32Float64`) + } + r.WriteMapElemValue() + if x.FMapFloat32Float64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32Float64V(x.FMapFloat32Float64, e) + } + } + } + var yyn630 bool + if x.FptrMapFloat32Float64 == nil { + yyn630 = true + goto LABEL630 + } + LABEL630: + if yyr2 || yy2arr2 { + if yyn630 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat32Float64 == nil { + r.EncodeNil() + } else { + yy631 := *x.FptrMapFloat32Float64 + if false { + } else { + z.F.EncMapFloat32Float64V(yy631, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat32Float64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat32Float64`) + } + r.WriteMapElemValue() + if yyn630 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Float64 == nil { + r.EncodeNil() + } else { + yy633 := *x.FptrMapFloat32Float64 + if false { + } else { + z.F.EncMapFloat32Float64V(yy633, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Bool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32BoolV(x.FMapFloat32Bool, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat32Bool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat32Bool`) + } + r.WriteMapElemValue() + if x.FMapFloat32Bool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat32BoolV(x.FMapFloat32Bool, e) + } + } + } + var yyn638 bool + if x.FptrMapFloat32Bool == nil { + yyn638 = true + goto LABEL638 + } + LABEL638: + if yyr2 || yy2arr2 { + if yyn638 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat32Bool == nil { + r.EncodeNil() + } else { + yy639 := *x.FptrMapFloat32Bool + if false { + } else { + z.F.EncMapFloat32BoolV(yy639, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat32Bool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat32Bool`) + } + r.WriteMapElemValue() + if yyn638 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Bool == nil { + r.EncodeNil() + } else { + yy641 := *x.FptrMapFloat32Bool + if false { + } else { + z.F.EncMapFloat32BoolV(yy641, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Intf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64IntfV(x.FMapFloat64Intf, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat64Intf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat64Intf`) + } + r.WriteMapElemValue() + if x.FMapFloat64Intf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64IntfV(x.FMapFloat64Intf, e) + } + } + } + var yyn646 bool + if x.FptrMapFloat64Intf == nil { + yyn646 = true + goto LABEL646 + } + LABEL646: + if yyr2 || yy2arr2 { + if yyn646 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat64Intf == nil { + r.EncodeNil() + } else { + yy647 := *x.FptrMapFloat64Intf + if false { + } else { + z.F.EncMapFloat64IntfV(yy647, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat64Intf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat64Intf`) + } + r.WriteMapElemValue() + if yyn646 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Intf == nil { + r.EncodeNil() + } else { + yy649 := *x.FptrMapFloat64Intf + if false { + } else { + z.F.EncMapFloat64IntfV(yy649, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64String == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64StringV(x.FMapFloat64String, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat64String\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat64String`) + } + r.WriteMapElemValue() + if x.FMapFloat64String == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64StringV(x.FMapFloat64String, e) + } + } + } + var yyn654 bool + if x.FptrMapFloat64String == nil { + yyn654 = true + goto LABEL654 + } + LABEL654: + if yyr2 || yy2arr2 { + if yyn654 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat64String == nil { + r.EncodeNil() + } else { + yy655 := *x.FptrMapFloat64String + if false { + } else { + z.F.EncMapFloat64StringV(yy655, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat64String\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat64String`) + } + r.WriteMapElemValue() + if yyn654 { + r.EncodeNil() + } else { + if x.FptrMapFloat64String == nil { + r.EncodeNil() + } else { + yy657 := *x.FptrMapFloat64String + if false { + } else { + z.F.EncMapFloat64StringV(yy657, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Uint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64UintV(x.FMapFloat64Uint, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat64Uint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat64Uint`) + } + r.WriteMapElemValue() + if x.FMapFloat64Uint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64UintV(x.FMapFloat64Uint, e) + } + } + } + var yyn662 bool + if x.FptrMapFloat64Uint == nil { + yyn662 = true + goto LABEL662 + } + LABEL662: + if yyr2 || yy2arr2 { + if yyn662 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat64Uint == nil { + r.EncodeNil() + } else { + yy663 := *x.FptrMapFloat64Uint + if false { + } else { + z.F.EncMapFloat64UintV(yy663, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat64Uint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat64Uint`) + } + r.WriteMapElemValue() + if yyn662 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Uint == nil { + r.EncodeNil() + } else { + yy665 := *x.FptrMapFloat64Uint + if false { + } else { + z.F.EncMapFloat64UintV(yy665, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Uint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64Uint8V(x.FMapFloat64Uint8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat64Uint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat64Uint8`) + } + r.WriteMapElemValue() + if x.FMapFloat64Uint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64Uint8V(x.FMapFloat64Uint8, e) + } + } + } + var yyn670 bool + if x.FptrMapFloat64Uint8 == nil { + yyn670 = true + goto LABEL670 + } + LABEL670: + if yyr2 || yy2arr2 { + if yyn670 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat64Uint8 == nil { + r.EncodeNil() + } else { + yy671 := *x.FptrMapFloat64Uint8 + if false { + } else { + z.F.EncMapFloat64Uint8V(yy671, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat64Uint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat64Uint8`) + } + r.WriteMapElemValue() + if yyn670 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Uint8 == nil { + r.EncodeNil() + } else { + yy673 := *x.FptrMapFloat64Uint8 + if false { + } else { + z.F.EncMapFloat64Uint8V(yy673, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Uint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64Uint16V(x.FMapFloat64Uint16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat64Uint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat64Uint16`) + } + r.WriteMapElemValue() + if x.FMapFloat64Uint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64Uint16V(x.FMapFloat64Uint16, e) + } + } + } + var yyn678 bool + if x.FptrMapFloat64Uint16 == nil { + yyn678 = true + goto LABEL678 + } + LABEL678: + if yyr2 || yy2arr2 { + if yyn678 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat64Uint16 == nil { + r.EncodeNil() + } else { + yy679 := *x.FptrMapFloat64Uint16 + if false { + } else { + z.F.EncMapFloat64Uint16V(yy679, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat64Uint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat64Uint16`) + } + r.WriteMapElemValue() + if yyn678 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Uint16 == nil { + r.EncodeNil() + } else { + yy681 := *x.FptrMapFloat64Uint16 + if false { + } else { + z.F.EncMapFloat64Uint16V(yy681, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Uint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64Uint32V(x.FMapFloat64Uint32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat64Uint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat64Uint32`) + } + r.WriteMapElemValue() + if x.FMapFloat64Uint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64Uint32V(x.FMapFloat64Uint32, e) + } + } + } + var yyn686 bool + if x.FptrMapFloat64Uint32 == nil { + yyn686 = true + goto LABEL686 + } + LABEL686: + if yyr2 || yy2arr2 { + if yyn686 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat64Uint32 == nil { + r.EncodeNil() + } else { + yy687 := *x.FptrMapFloat64Uint32 + if false { + } else { + z.F.EncMapFloat64Uint32V(yy687, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat64Uint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat64Uint32`) + } + r.WriteMapElemValue() + if yyn686 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Uint32 == nil { + r.EncodeNil() + } else { + yy689 := *x.FptrMapFloat64Uint32 + if false { + } else { + z.F.EncMapFloat64Uint32V(yy689, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Uint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64Uint64V(x.FMapFloat64Uint64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat64Uint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat64Uint64`) + } + r.WriteMapElemValue() + if x.FMapFloat64Uint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64Uint64V(x.FMapFloat64Uint64, e) + } + } + } + var yyn694 bool + if x.FptrMapFloat64Uint64 == nil { + yyn694 = true + goto LABEL694 + } + LABEL694: + if yyr2 || yy2arr2 { + if yyn694 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat64Uint64 == nil { + r.EncodeNil() + } else { + yy695 := *x.FptrMapFloat64Uint64 + if false { + } else { + z.F.EncMapFloat64Uint64V(yy695, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat64Uint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat64Uint64`) + } + r.WriteMapElemValue() + if yyn694 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Uint64 == nil { + r.EncodeNil() + } else { + yy697 := *x.FptrMapFloat64Uint64 + if false { + } else { + z.F.EncMapFloat64Uint64V(yy697, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Uintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64UintptrV(x.FMapFloat64Uintptr, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat64Uintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat64Uintptr`) + } + r.WriteMapElemValue() + if x.FMapFloat64Uintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64UintptrV(x.FMapFloat64Uintptr, e) + } + } + } + var yyn702 bool + if x.FptrMapFloat64Uintptr == nil { + yyn702 = true + goto LABEL702 + } + LABEL702: + if yyr2 || yy2arr2 { + if yyn702 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat64Uintptr == nil { + r.EncodeNil() + } else { + yy703 := *x.FptrMapFloat64Uintptr + if false { + } else { + z.F.EncMapFloat64UintptrV(yy703, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat64Uintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat64Uintptr`) + } + r.WriteMapElemValue() + if yyn702 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Uintptr == nil { + r.EncodeNil() + } else { + yy705 := *x.FptrMapFloat64Uintptr + if false { + } else { + z.F.EncMapFloat64UintptrV(yy705, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Int == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64IntV(x.FMapFloat64Int, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat64Int\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat64Int`) + } + r.WriteMapElemValue() + if x.FMapFloat64Int == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64IntV(x.FMapFloat64Int, e) + } + } + } + var yyn710 bool + if x.FptrMapFloat64Int == nil { + yyn710 = true + goto LABEL710 + } + LABEL710: + if yyr2 || yy2arr2 { + if yyn710 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat64Int == nil { + r.EncodeNil() + } else { + yy711 := *x.FptrMapFloat64Int + if false { + } else { + z.F.EncMapFloat64IntV(yy711, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat64Int\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat64Int`) + } + r.WriteMapElemValue() + if yyn710 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Int == nil { + r.EncodeNil() + } else { + yy713 := *x.FptrMapFloat64Int + if false { + } else { + z.F.EncMapFloat64IntV(yy713, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Int8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64Int8V(x.FMapFloat64Int8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat64Int8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat64Int8`) + } + r.WriteMapElemValue() + if x.FMapFloat64Int8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64Int8V(x.FMapFloat64Int8, e) + } + } + } + var yyn718 bool + if x.FptrMapFloat64Int8 == nil { + yyn718 = true + goto LABEL718 + } + LABEL718: + if yyr2 || yy2arr2 { + if yyn718 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat64Int8 == nil { + r.EncodeNil() + } else { + yy719 := *x.FptrMapFloat64Int8 + if false { + } else { + z.F.EncMapFloat64Int8V(yy719, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat64Int8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat64Int8`) + } + r.WriteMapElemValue() + if yyn718 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Int8 == nil { + r.EncodeNil() + } else { + yy721 := *x.FptrMapFloat64Int8 + if false { + } else { + z.F.EncMapFloat64Int8V(yy721, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Int16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64Int16V(x.FMapFloat64Int16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat64Int16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat64Int16`) + } + r.WriteMapElemValue() + if x.FMapFloat64Int16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64Int16V(x.FMapFloat64Int16, e) + } + } + } + var yyn726 bool + if x.FptrMapFloat64Int16 == nil { + yyn726 = true + goto LABEL726 + } + LABEL726: + if yyr2 || yy2arr2 { + if yyn726 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat64Int16 == nil { + r.EncodeNil() + } else { + yy727 := *x.FptrMapFloat64Int16 + if false { + } else { + z.F.EncMapFloat64Int16V(yy727, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat64Int16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat64Int16`) + } + r.WriteMapElemValue() + if yyn726 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Int16 == nil { + r.EncodeNil() + } else { + yy729 := *x.FptrMapFloat64Int16 + if false { + } else { + z.F.EncMapFloat64Int16V(yy729, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Int32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64Int32V(x.FMapFloat64Int32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat64Int32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat64Int32`) + } + r.WriteMapElemValue() + if x.FMapFloat64Int32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64Int32V(x.FMapFloat64Int32, e) + } + } + } + var yyn734 bool + if x.FptrMapFloat64Int32 == nil { + yyn734 = true + goto LABEL734 + } + LABEL734: + if yyr2 || yy2arr2 { + if yyn734 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat64Int32 == nil { + r.EncodeNil() + } else { + yy735 := *x.FptrMapFloat64Int32 + if false { + } else { + z.F.EncMapFloat64Int32V(yy735, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat64Int32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat64Int32`) + } + r.WriteMapElemValue() + if yyn734 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Int32 == nil { + r.EncodeNil() + } else { + yy737 := *x.FptrMapFloat64Int32 + if false { + } else { + z.F.EncMapFloat64Int32V(yy737, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Int64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64Int64V(x.FMapFloat64Int64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat64Int64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat64Int64`) + } + r.WriteMapElemValue() + if x.FMapFloat64Int64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64Int64V(x.FMapFloat64Int64, e) + } + } + } + var yyn742 bool + if x.FptrMapFloat64Int64 == nil { + yyn742 = true + goto LABEL742 + } + LABEL742: + if yyr2 || yy2arr2 { + if yyn742 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat64Int64 == nil { + r.EncodeNil() + } else { + yy743 := *x.FptrMapFloat64Int64 + if false { + } else { + z.F.EncMapFloat64Int64V(yy743, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat64Int64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat64Int64`) + } + r.WriteMapElemValue() + if yyn742 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Int64 == nil { + r.EncodeNil() + } else { + yy745 := *x.FptrMapFloat64Int64 + if false { + } else { + z.F.EncMapFloat64Int64V(yy745, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Float32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64Float32V(x.FMapFloat64Float32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat64Float32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat64Float32`) + } + r.WriteMapElemValue() + if x.FMapFloat64Float32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64Float32V(x.FMapFloat64Float32, e) + } + } + } + var yyn750 bool + if x.FptrMapFloat64Float32 == nil { + yyn750 = true + goto LABEL750 + } + LABEL750: + if yyr2 || yy2arr2 { + if yyn750 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat64Float32 == nil { + r.EncodeNil() + } else { + yy751 := *x.FptrMapFloat64Float32 + if false { + } else { + z.F.EncMapFloat64Float32V(yy751, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat64Float32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat64Float32`) + } + r.WriteMapElemValue() + if yyn750 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Float32 == nil { + r.EncodeNil() + } else { + yy753 := *x.FptrMapFloat64Float32 + if false { + } else { + z.F.EncMapFloat64Float32V(yy753, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Float64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64Float64V(x.FMapFloat64Float64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat64Float64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat64Float64`) + } + r.WriteMapElemValue() + if x.FMapFloat64Float64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64Float64V(x.FMapFloat64Float64, e) + } + } + } + var yyn758 bool + if x.FptrMapFloat64Float64 == nil { + yyn758 = true + goto LABEL758 + } + LABEL758: + if yyr2 || yy2arr2 { + if yyn758 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat64Float64 == nil { + r.EncodeNil() + } else { + yy759 := *x.FptrMapFloat64Float64 + if false { + } else { + z.F.EncMapFloat64Float64V(yy759, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat64Float64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat64Float64`) + } + r.WriteMapElemValue() + if yyn758 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Float64 == nil { + r.EncodeNil() + } else { + yy761 := *x.FptrMapFloat64Float64 + if false { + } else { + z.F.EncMapFloat64Float64V(yy761, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Bool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64BoolV(x.FMapFloat64Bool, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapFloat64Bool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapFloat64Bool`) + } + r.WriteMapElemValue() + if x.FMapFloat64Bool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapFloat64BoolV(x.FMapFloat64Bool, e) + } + } + } + var yyn766 bool + if x.FptrMapFloat64Bool == nil { + yyn766 = true + goto LABEL766 + } + LABEL766: + if yyr2 || yy2arr2 { + if yyn766 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapFloat64Bool == nil { + r.EncodeNil() + } else { + yy767 := *x.FptrMapFloat64Bool + if false { + } else { + z.F.EncMapFloat64BoolV(yy767, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapFloat64Bool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapFloat64Bool`) + } + r.WriteMapElemValue() + if yyn766 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Bool == nil { + r.EncodeNil() + } else { + yy769 := *x.FptrMapFloat64Bool + if false { + } else { + z.F.EncMapFloat64BoolV(yy769, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintIntf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintIntfV(x.FMapUintIntf, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintIntf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintIntf`) + } + r.WriteMapElemValue() + if x.FMapUintIntf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintIntfV(x.FMapUintIntf, e) + } + } + } + var yyn774 bool + if x.FptrMapUintIntf == nil { + yyn774 = true + goto LABEL774 + } + LABEL774: + if yyr2 || yy2arr2 { + if yyn774 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintIntf == nil { + r.EncodeNil() + } else { + yy775 := *x.FptrMapUintIntf + if false { + } else { + z.F.EncMapUintIntfV(yy775, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintIntf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintIntf`) + } + r.WriteMapElemValue() + if yyn774 { + r.EncodeNil() + } else { + if x.FptrMapUintIntf == nil { + r.EncodeNil() + } else { + yy777 := *x.FptrMapUintIntf + if false { + } else { + z.F.EncMapUintIntfV(yy777, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintString == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintStringV(x.FMapUintString, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintString\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintString`) + } + r.WriteMapElemValue() + if x.FMapUintString == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintStringV(x.FMapUintString, e) + } + } + } + var yyn782 bool + if x.FptrMapUintString == nil { + yyn782 = true + goto LABEL782 + } + LABEL782: + if yyr2 || yy2arr2 { + if yyn782 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintString == nil { + r.EncodeNil() + } else { + yy783 := *x.FptrMapUintString + if false { + } else { + z.F.EncMapUintStringV(yy783, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintString\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintString`) + } + r.WriteMapElemValue() + if yyn782 { + r.EncodeNil() + } else { + if x.FptrMapUintString == nil { + r.EncodeNil() + } else { + yy785 := *x.FptrMapUintString + if false { + } else { + z.F.EncMapUintStringV(yy785, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintUint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintUintV(x.FMapUintUint, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintUint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintUint`) + } + r.WriteMapElemValue() + if x.FMapUintUint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintUintV(x.FMapUintUint, e) + } + } + } + var yyn790 bool + if x.FptrMapUintUint == nil { + yyn790 = true + goto LABEL790 + } + LABEL790: + if yyr2 || yy2arr2 { + if yyn790 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintUint == nil { + r.EncodeNil() + } else { + yy791 := *x.FptrMapUintUint + if false { + } else { + z.F.EncMapUintUintV(yy791, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintUint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintUint`) + } + r.WriteMapElemValue() + if yyn790 { + r.EncodeNil() + } else { + if x.FptrMapUintUint == nil { + r.EncodeNil() + } else { + yy793 := *x.FptrMapUintUint + if false { + } else { + z.F.EncMapUintUintV(yy793, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintUint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintUint8V(x.FMapUintUint8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintUint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintUint8`) + } + r.WriteMapElemValue() + if x.FMapUintUint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintUint8V(x.FMapUintUint8, e) + } + } + } + var yyn798 bool + if x.FptrMapUintUint8 == nil { + yyn798 = true + goto LABEL798 + } + LABEL798: + if yyr2 || yy2arr2 { + if yyn798 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintUint8 == nil { + r.EncodeNil() + } else { + yy799 := *x.FptrMapUintUint8 + if false { + } else { + z.F.EncMapUintUint8V(yy799, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintUint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintUint8`) + } + r.WriteMapElemValue() + if yyn798 { + r.EncodeNil() + } else { + if x.FptrMapUintUint8 == nil { + r.EncodeNil() + } else { + yy801 := *x.FptrMapUintUint8 + if false { + } else { + z.F.EncMapUintUint8V(yy801, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintUint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintUint16V(x.FMapUintUint16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintUint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintUint16`) + } + r.WriteMapElemValue() + if x.FMapUintUint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintUint16V(x.FMapUintUint16, e) + } + } + } + var yyn806 bool + if x.FptrMapUintUint16 == nil { + yyn806 = true + goto LABEL806 + } + LABEL806: + if yyr2 || yy2arr2 { + if yyn806 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintUint16 == nil { + r.EncodeNil() + } else { + yy807 := *x.FptrMapUintUint16 + if false { + } else { + z.F.EncMapUintUint16V(yy807, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintUint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintUint16`) + } + r.WriteMapElemValue() + if yyn806 { + r.EncodeNil() + } else { + if x.FptrMapUintUint16 == nil { + r.EncodeNil() + } else { + yy809 := *x.FptrMapUintUint16 + if false { + } else { + z.F.EncMapUintUint16V(yy809, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintUint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintUint32V(x.FMapUintUint32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintUint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintUint32`) + } + r.WriteMapElemValue() + if x.FMapUintUint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintUint32V(x.FMapUintUint32, e) + } + } + } + var yyn814 bool + if x.FptrMapUintUint32 == nil { + yyn814 = true + goto LABEL814 + } + LABEL814: + if yyr2 || yy2arr2 { + if yyn814 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintUint32 == nil { + r.EncodeNil() + } else { + yy815 := *x.FptrMapUintUint32 + if false { + } else { + z.F.EncMapUintUint32V(yy815, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintUint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintUint32`) + } + r.WriteMapElemValue() + if yyn814 { + r.EncodeNil() + } else { + if x.FptrMapUintUint32 == nil { + r.EncodeNil() + } else { + yy817 := *x.FptrMapUintUint32 + if false { + } else { + z.F.EncMapUintUint32V(yy817, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintUint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintUint64V(x.FMapUintUint64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintUint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintUint64`) + } + r.WriteMapElemValue() + if x.FMapUintUint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintUint64V(x.FMapUintUint64, e) + } + } + } + var yyn822 bool + if x.FptrMapUintUint64 == nil { + yyn822 = true + goto LABEL822 + } + LABEL822: + if yyr2 || yy2arr2 { + if yyn822 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintUint64 == nil { + r.EncodeNil() + } else { + yy823 := *x.FptrMapUintUint64 + if false { + } else { + z.F.EncMapUintUint64V(yy823, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintUint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintUint64`) + } + r.WriteMapElemValue() + if yyn822 { + r.EncodeNil() + } else { + if x.FptrMapUintUint64 == nil { + r.EncodeNil() + } else { + yy825 := *x.FptrMapUintUint64 + if false { + } else { + z.F.EncMapUintUint64V(yy825, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintUintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintUintptrV(x.FMapUintUintptr, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintUintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintUintptr`) + } + r.WriteMapElemValue() + if x.FMapUintUintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintUintptrV(x.FMapUintUintptr, e) + } + } + } + var yyn830 bool + if x.FptrMapUintUintptr == nil { + yyn830 = true + goto LABEL830 + } + LABEL830: + if yyr2 || yy2arr2 { + if yyn830 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintUintptr == nil { + r.EncodeNil() + } else { + yy831 := *x.FptrMapUintUintptr + if false { + } else { + z.F.EncMapUintUintptrV(yy831, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintUintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintUintptr`) + } + r.WriteMapElemValue() + if yyn830 { + r.EncodeNil() + } else { + if x.FptrMapUintUintptr == nil { + r.EncodeNil() + } else { + yy833 := *x.FptrMapUintUintptr + if false { + } else { + z.F.EncMapUintUintptrV(yy833, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintInt == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintIntV(x.FMapUintInt, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintInt\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintInt`) + } + r.WriteMapElemValue() + if x.FMapUintInt == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintIntV(x.FMapUintInt, e) + } + } + } + var yyn838 bool + if x.FptrMapUintInt == nil { + yyn838 = true + goto LABEL838 + } + LABEL838: + if yyr2 || yy2arr2 { + if yyn838 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintInt == nil { + r.EncodeNil() + } else { + yy839 := *x.FptrMapUintInt + if false { + } else { + z.F.EncMapUintIntV(yy839, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintInt\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintInt`) + } + r.WriteMapElemValue() + if yyn838 { + r.EncodeNil() + } else { + if x.FptrMapUintInt == nil { + r.EncodeNil() + } else { + yy841 := *x.FptrMapUintInt + if false { + } else { + z.F.EncMapUintIntV(yy841, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintInt8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintInt8V(x.FMapUintInt8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintInt8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintInt8`) + } + r.WriteMapElemValue() + if x.FMapUintInt8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintInt8V(x.FMapUintInt8, e) + } + } + } + var yyn846 bool + if x.FptrMapUintInt8 == nil { + yyn846 = true + goto LABEL846 + } + LABEL846: + if yyr2 || yy2arr2 { + if yyn846 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintInt8 == nil { + r.EncodeNil() + } else { + yy847 := *x.FptrMapUintInt8 + if false { + } else { + z.F.EncMapUintInt8V(yy847, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintInt8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintInt8`) + } + r.WriteMapElemValue() + if yyn846 { + r.EncodeNil() + } else { + if x.FptrMapUintInt8 == nil { + r.EncodeNil() + } else { + yy849 := *x.FptrMapUintInt8 + if false { + } else { + z.F.EncMapUintInt8V(yy849, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintInt16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintInt16V(x.FMapUintInt16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintInt16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintInt16`) + } + r.WriteMapElemValue() + if x.FMapUintInt16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintInt16V(x.FMapUintInt16, e) + } + } + } + var yyn854 bool + if x.FptrMapUintInt16 == nil { + yyn854 = true + goto LABEL854 + } + LABEL854: + if yyr2 || yy2arr2 { + if yyn854 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintInt16 == nil { + r.EncodeNil() + } else { + yy855 := *x.FptrMapUintInt16 + if false { + } else { + z.F.EncMapUintInt16V(yy855, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintInt16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintInt16`) + } + r.WriteMapElemValue() + if yyn854 { + r.EncodeNil() + } else { + if x.FptrMapUintInt16 == nil { + r.EncodeNil() + } else { + yy857 := *x.FptrMapUintInt16 + if false { + } else { + z.F.EncMapUintInt16V(yy857, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintInt32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintInt32V(x.FMapUintInt32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintInt32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintInt32`) + } + r.WriteMapElemValue() + if x.FMapUintInt32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintInt32V(x.FMapUintInt32, e) + } + } + } + var yyn862 bool + if x.FptrMapUintInt32 == nil { + yyn862 = true + goto LABEL862 + } + LABEL862: + if yyr2 || yy2arr2 { + if yyn862 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintInt32 == nil { + r.EncodeNil() + } else { + yy863 := *x.FptrMapUintInt32 + if false { + } else { + z.F.EncMapUintInt32V(yy863, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintInt32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintInt32`) + } + r.WriteMapElemValue() + if yyn862 { + r.EncodeNil() + } else { + if x.FptrMapUintInt32 == nil { + r.EncodeNil() + } else { + yy865 := *x.FptrMapUintInt32 + if false { + } else { + z.F.EncMapUintInt32V(yy865, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintInt64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintInt64V(x.FMapUintInt64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintInt64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintInt64`) + } + r.WriteMapElemValue() + if x.FMapUintInt64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintInt64V(x.FMapUintInt64, e) + } + } + } + var yyn870 bool + if x.FptrMapUintInt64 == nil { + yyn870 = true + goto LABEL870 + } + LABEL870: + if yyr2 || yy2arr2 { + if yyn870 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintInt64 == nil { + r.EncodeNil() + } else { + yy871 := *x.FptrMapUintInt64 + if false { + } else { + z.F.EncMapUintInt64V(yy871, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintInt64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintInt64`) + } + r.WriteMapElemValue() + if yyn870 { + r.EncodeNil() + } else { + if x.FptrMapUintInt64 == nil { + r.EncodeNil() + } else { + yy873 := *x.FptrMapUintInt64 + if false { + } else { + z.F.EncMapUintInt64V(yy873, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintFloat32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintFloat32V(x.FMapUintFloat32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintFloat32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintFloat32`) + } + r.WriteMapElemValue() + if x.FMapUintFloat32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintFloat32V(x.FMapUintFloat32, e) + } + } + } + var yyn878 bool + if x.FptrMapUintFloat32 == nil { + yyn878 = true + goto LABEL878 + } + LABEL878: + if yyr2 || yy2arr2 { + if yyn878 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintFloat32 == nil { + r.EncodeNil() + } else { + yy879 := *x.FptrMapUintFloat32 + if false { + } else { + z.F.EncMapUintFloat32V(yy879, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintFloat32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintFloat32`) + } + r.WriteMapElemValue() + if yyn878 { + r.EncodeNil() + } else { + if x.FptrMapUintFloat32 == nil { + r.EncodeNil() + } else { + yy881 := *x.FptrMapUintFloat32 + if false { + } else { + z.F.EncMapUintFloat32V(yy881, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintFloat64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintFloat64V(x.FMapUintFloat64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintFloat64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintFloat64`) + } + r.WriteMapElemValue() + if x.FMapUintFloat64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintFloat64V(x.FMapUintFloat64, e) + } + } + } + var yyn886 bool + if x.FptrMapUintFloat64 == nil { + yyn886 = true + goto LABEL886 + } + LABEL886: + if yyr2 || yy2arr2 { + if yyn886 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintFloat64 == nil { + r.EncodeNil() + } else { + yy887 := *x.FptrMapUintFloat64 + if false { + } else { + z.F.EncMapUintFloat64V(yy887, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintFloat64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintFloat64`) + } + r.WriteMapElemValue() + if yyn886 { + r.EncodeNil() + } else { + if x.FptrMapUintFloat64 == nil { + r.EncodeNil() + } else { + yy889 := *x.FptrMapUintFloat64 + if false { + } else { + z.F.EncMapUintFloat64V(yy889, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintBool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintBoolV(x.FMapUintBool, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintBool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintBool`) + } + r.WriteMapElemValue() + if x.FMapUintBool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintBoolV(x.FMapUintBool, e) + } + } + } + var yyn894 bool + if x.FptrMapUintBool == nil { + yyn894 = true + goto LABEL894 + } + LABEL894: + if yyr2 || yy2arr2 { + if yyn894 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintBool == nil { + r.EncodeNil() + } else { + yy895 := *x.FptrMapUintBool + if false { + } else { + z.F.EncMapUintBoolV(yy895, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintBool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintBool`) + } + r.WriteMapElemValue() + if yyn894 { + r.EncodeNil() + } else { + if x.FptrMapUintBool == nil { + r.EncodeNil() + } else { + yy897 := *x.FptrMapUintBool + if false { + } else { + z.F.EncMapUintBoolV(yy897, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Intf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8IntfV(x.FMapUint8Intf, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint8Intf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint8Intf`) + } + r.WriteMapElemValue() + if x.FMapUint8Intf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8IntfV(x.FMapUint8Intf, e) + } + } + } + var yyn902 bool + if x.FptrMapUint8Intf == nil { + yyn902 = true + goto LABEL902 + } + LABEL902: + if yyr2 || yy2arr2 { + if yyn902 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint8Intf == nil { + r.EncodeNil() + } else { + yy903 := *x.FptrMapUint8Intf + if false { + } else { + z.F.EncMapUint8IntfV(yy903, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint8Intf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint8Intf`) + } + r.WriteMapElemValue() + if yyn902 { + r.EncodeNil() + } else { + if x.FptrMapUint8Intf == nil { + r.EncodeNil() + } else { + yy905 := *x.FptrMapUint8Intf + if false { + } else { + z.F.EncMapUint8IntfV(yy905, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8String == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8StringV(x.FMapUint8String, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint8String\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint8String`) + } + r.WriteMapElemValue() + if x.FMapUint8String == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8StringV(x.FMapUint8String, e) + } + } + } + var yyn910 bool + if x.FptrMapUint8String == nil { + yyn910 = true + goto LABEL910 + } + LABEL910: + if yyr2 || yy2arr2 { + if yyn910 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint8String == nil { + r.EncodeNil() + } else { + yy911 := *x.FptrMapUint8String + if false { + } else { + z.F.EncMapUint8StringV(yy911, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint8String\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint8String`) + } + r.WriteMapElemValue() + if yyn910 { + r.EncodeNil() + } else { + if x.FptrMapUint8String == nil { + r.EncodeNil() + } else { + yy913 := *x.FptrMapUint8String + if false { + } else { + z.F.EncMapUint8StringV(yy913, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Uint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8UintV(x.FMapUint8Uint, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint8Uint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint8Uint`) + } + r.WriteMapElemValue() + if x.FMapUint8Uint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8UintV(x.FMapUint8Uint, e) + } + } + } + var yyn918 bool + if x.FptrMapUint8Uint == nil { + yyn918 = true + goto LABEL918 + } + LABEL918: + if yyr2 || yy2arr2 { + if yyn918 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint8Uint == nil { + r.EncodeNil() + } else { + yy919 := *x.FptrMapUint8Uint + if false { + } else { + z.F.EncMapUint8UintV(yy919, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint8Uint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint8Uint`) + } + r.WriteMapElemValue() + if yyn918 { + r.EncodeNil() + } else { + if x.FptrMapUint8Uint == nil { + r.EncodeNil() + } else { + yy921 := *x.FptrMapUint8Uint + if false { + } else { + z.F.EncMapUint8UintV(yy921, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Uint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8Uint8V(x.FMapUint8Uint8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint8Uint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint8Uint8`) + } + r.WriteMapElemValue() + if x.FMapUint8Uint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8Uint8V(x.FMapUint8Uint8, e) + } + } + } + var yyn926 bool + if x.FptrMapUint8Uint8 == nil { + yyn926 = true + goto LABEL926 + } + LABEL926: + if yyr2 || yy2arr2 { + if yyn926 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint8Uint8 == nil { + r.EncodeNil() + } else { + yy927 := *x.FptrMapUint8Uint8 + if false { + } else { + z.F.EncMapUint8Uint8V(yy927, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint8Uint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint8Uint8`) + } + r.WriteMapElemValue() + if yyn926 { + r.EncodeNil() + } else { + if x.FptrMapUint8Uint8 == nil { + r.EncodeNil() + } else { + yy929 := *x.FptrMapUint8Uint8 + if false { + } else { + z.F.EncMapUint8Uint8V(yy929, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Uint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8Uint16V(x.FMapUint8Uint16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint8Uint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint8Uint16`) + } + r.WriteMapElemValue() + if x.FMapUint8Uint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8Uint16V(x.FMapUint8Uint16, e) + } + } + } + var yyn934 bool + if x.FptrMapUint8Uint16 == nil { + yyn934 = true + goto LABEL934 + } + LABEL934: + if yyr2 || yy2arr2 { + if yyn934 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint8Uint16 == nil { + r.EncodeNil() + } else { + yy935 := *x.FptrMapUint8Uint16 + if false { + } else { + z.F.EncMapUint8Uint16V(yy935, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint8Uint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint8Uint16`) + } + r.WriteMapElemValue() + if yyn934 { + r.EncodeNil() + } else { + if x.FptrMapUint8Uint16 == nil { + r.EncodeNil() + } else { + yy937 := *x.FptrMapUint8Uint16 + if false { + } else { + z.F.EncMapUint8Uint16V(yy937, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Uint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8Uint32V(x.FMapUint8Uint32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint8Uint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint8Uint32`) + } + r.WriteMapElemValue() + if x.FMapUint8Uint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8Uint32V(x.FMapUint8Uint32, e) + } + } + } + var yyn942 bool + if x.FptrMapUint8Uint32 == nil { + yyn942 = true + goto LABEL942 + } + LABEL942: + if yyr2 || yy2arr2 { + if yyn942 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint8Uint32 == nil { + r.EncodeNil() + } else { + yy943 := *x.FptrMapUint8Uint32 + if false { + } else { + z.F.EncMapUint8Uint32V(yy943, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint8Uint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint8Uint32`) + } + r.WriteMapElemValue() + if yyn942 { + r.EncodeNil() + } else { + if x.FptrMapUint8Uint32 == nil { + r.EncodeNil() + } else { + yy945 := *x.FptrMapUint8Uint32 + if false { + } else { + z.F.EncMapUint8Uint32V(yy945, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Uint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8Uint64V(x.FMapUint8Uint64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint8Uint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint8Uint64`) + } + r.WriteMapElemValue() + if x.FMapUint8Uint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8Uint64V(x.FMapUint8Uint64, e) + } + } + } + var yyn950 bool + if x.FptrMapUint8Uint64 == nil { + yyn950 = true + goto LABEL950 + } + LABEL950: + if yyr2 || yy2arr2 { + if yyn950 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint8Uint64 == nil { + r.EncodeNil() + } else { + yy951 := *x.FptrMapUint8Uint64 + if false { + } else { + z.F.EncMapUint8Uint64V(yy951, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint8Uint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint8Uint64`) + } + r.WriteMapElemValue() + if yyn950 { + r.EncodeNil() + } else { + if x.FptrMapUint8Uint64 == nil { + r.EncodeNil() + } else { + yy953 := *x.FptrMapUint8Uint64 + if false { + } else { + z.F.EncMapUint8Uint64V(yy953, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Uintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8UintptrV(x.FMapUint8Uintptr, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint8Uintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint8Uintptr`) + } + r.WriteMapElemValue() + if x.FMapUint8Uintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8UintptrV(x.FMapUint8Uintptr, e) + } + } + } + var yyn958 bool + if x.FptrMapUint8Uintptr == nil { + yyn958 = true + goto LABEL958 + } + LABEL958: + if yyr2 || yy2arr2 { + if yyn958 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint8Uintptr == nil { + r.EncodeNil() + } else { + yy959 := *x.FptrMapUint8Uintptr + if false { + } else { + z.F.EncMapUint8UintptrV(yy959, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint8Uintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint8Uintptr`) + } + r.WriteMapElemValue() + if yyn958 { + r.EncodeNil() + } else { + if x.FptrMapUint8Uintptr == nil { + r.EncodeNil() + } else { + yy961 := *x.FptrMapUint8Uintptr + if false { + } else { + z.F.EncMapUint8UintptrV(yy961, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Int == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8IntV(x.FMapUint8Int, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint8Int\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint8Int`) + } + r.WriteMapElemValue() + if x.FMapUint8Int == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8IntV(x.FMapUint8Int, e) + } + } + } + var yyn966 bool + if x.FptrMapUint8Int == nil { + yyn966 = true + goto LABEL966 + } + LABEL966: + if yyr2 || yy2arr2 { + if yyn966 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint8Int == nil { + r.EncodeNil() + } else { + yy967 := *x.FptrMapUint8Int + if false { + } else { + z.F.EncMapUint8IntV(yy967, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint8Int\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint8Int`) + } + r.WriteMapElemValue() + if yyn966 { + r.EncodeNil() + } else { + if x.FptrMapUint8Int == nil { + r.EncodeNil() + } else { + yy969 := *x.FptrMapUint8Int + if false { + } else { + z.F.EncMapUint8IntV(yy969, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Int8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8Int8V(x.FMapUint8Int8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint8Int8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint8Int8`) + } + r.WriteMapElemValue() + if x.FMapUint8Int8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8Int8V(x.FMapUint8Int8, e) + } + } + } + var yyn974 bool + if x.FptrMapUint8Int8 == nil { + yyn974 = true + goto LABEL974 + } + LABEL974: + if yyr2 || yy2arr2 { + if yyn974 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint8Int8 == nil { + r.EncodeNil() + } else { + yy975 := *x.FptrMapUint8Int8 + if false { + } else { + z.F.EncMapUint8Int8V(yy975, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint8Int8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint8Int8`) + } + r.WriteMapElemValue() + if yyn974 { + r.EncodeNil() + } else { + if x.FptrMapUint8Int8 == nil { + r.EncodeNil() + } else { + yy977 := *x.FptrMapUint8Int8 + if false { + } else { + z.F.EncMapUint8Int8V(yy977, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Int16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8Int16V(x.FMapUint8Int16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint8Int16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint8Int16`) + } + r.WriteMapElemValue() + if x.FMapUint8Int16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8Int16V(x.FMapUint8Int16, e) + } + } + } + var yyn982 bool + if x.FptrMapUint8Int16 == nil { + yyn982 = true + goto LABEL982 + } + LABEL982: + if yyr2 || yy2arr2 { + if yyn982 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint8Int16 == nil { + r.EncodeNil() + } else { + yy983 := *x.FptrMapUint8Int16 + if false { + } else { + z.F.EncMapUint8Int16V(yy983, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint8Int16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint8Int16`) + } + r.WriteMapElemValue() + if yyn982 { + r.EncodeNil() + } else { + if x.FptrMapUint8Int16 == nil { + r.EncodeNil() + } else { + yy985 := *x.FptrMapUint8Int16 + if false { + } else { + z.F.EncMapUint8Int16V(yy985, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Int32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8Int32V(x.FMapUint8Int32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint8Int32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint8Int32`) + } + r.WriteMapElemValue() + if x.FMapUint8Int32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8Int32V(x.FMapUint8Int32, e) + } + } + } + var yyn990 bool + if x.FptrMapUint8Int32 == nil { + yyn990 = true + goto LABEL990 + } + LABEL990: + if yyr2 || yy2arr2 { + if yyn990 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint8Int32 == nil { + r.EncodeNil() + } else { + yy991 := *x.FptrMapUint8Int32 + if false { + } else { + z.F.EncMapUint8Int32V(yy991, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint8Int32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint8Int32`) + } + r.WriteMapElemValue() + if yyn990 { + r.EncodeNil() + } else { + if x.FptrMapUint8Int32 == nil { + r.EncodeNil() + } else { + yy993 := *x.FptrMapUint8Int32 + if false { + } else { + z.F.EncMapUint8Int32V(yy993, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Int64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8Int64V(x.FMapUint8Int64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint8Int64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint8Int64`) + } + r.WriteMapElemValue() + if x.FMapUint8Int64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8Int64V(x.FMapUint8Int64, e) + } + } + } + var yyn998 bool + if x.FptrMapUint8Int64 == nil { + yyn998 = true + goto LABEL998 + } + LABEL998: + if yyr2 || yy2arr2 { + if yyn998 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint8Int64 == nil { + r.EncodeNil() + } else { + yy999 := *x.FptrMapUint8Int64 + if false { + } else { + z.F.EncMapUint8Int64V(yy999, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint8Int64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint8Int64`) + } + r.WriteMapElemValue() + if yyn998 { + r.EncodeNil() + } else { + if x.FptrMapUint8Int64 == nil { + r.EncodeNil() + } else { + yy1001 := *x.FptrMapUint8Int64 + if false { + } else { + z.F.EncMapUint8Int64V(yy1001, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Float32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8Float32V(x.FMapUint8Float32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint8Float32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint8Float32`) + } + r.WriteMapElemValue() + if x.FMapUint8Float32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8Float32V(x.FMapUint8Float32, e) + } + } + } + var yyn1006 bool + if x.FptrMapUint8Float32 == nil { + yyn1006 = true + goto LABEL1006 + } + LABEL1006: + if yyr2 || yy2arr2 { + if yyn1006 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint8Float32 == nil { + r.EncodeNil() + } else { + yy1007 := *x.FptrMapUint8Float32 + if false { + } else { + z.F.EncMapUint8Float32V(yy1007, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint8Float32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint8Float32`) + } + r.WriteMapElemValue() + if yyn1006 { + r.EncodeNil() + } else { + if x.FptrMapUint8Float32 == nil { + r.EncodeNil() + } else { + yy1009 := *x.FptrMapUint8Float32 + if false { + } else { + z.F.EncMapUint8Float32V(yy1009, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Float64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8Float64V(x.FMapUint8Float64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint8Float64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint8Float64`) + } + r.WriteMapElemValue() + if x.FMapUint8Float64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8Float64V(x.FMapUint8Float64, e) + } + } + } + var yyn1014 bool + if x.FptrMapUint8Float64 == nil { + yyn1014 = true + goto LABEL1014 + } + LABEL1014: + if yyr2 || yy2arr2 { + if yyn1014 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint8Float64 == nil { + r.EncodeNil() + } else { + yy1015 := *x.FptrMapUint8Float64 + if false { + } else { + z.F.EncMapUint8Float64V(yy1015, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint8Float64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint8Float64`) + } + r.WriteMapElemValue() + if yyn1014 { + r.EncodeNil() + } else { + if x.FptrMapUint8Float64 == nil { + r.EncodeNil() + } else { + yy1017 := *x.FptrMapUint8Float64 + if false { + } else { + z.F.EncMapUint8Float64V(yy1017, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Bool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8BoolV(x.FMapUint8Bool, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint8Bool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint8Bool`) + } + r.WriteMapElemValue() + if x.FMapUint8Bool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint8BoolV(x.FMapUint8Bool, e) + } + } + } + var yyn1022 bool + if x.FptrMapUint8Bool == nil { + yyn1022 = true + goto LABEL1022 + } + LABEL1022: + if yyr2 || yy2arr2 { + if yyn1022 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint8Bool == nil { + r.EncodeNil() + } else { + yy1023 := *x.FptrMapUint8Bool + if false { + } else { + z.F.EncMapUint8BoolV(yy1023, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint8Bool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint8Bool`) + } + r.WriteMapElemValue() + if yyn1022 { + r.EncodeNil() + } else { + if x.FptrMapUint8Bool == nil { + r.EncodeNil() + } else { + yy1025 := *x.FptrMapUint8Bool + if false { + } else { + z.F.EncMapUint8BoolV(yy1025, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Intf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16IntfV(x.FMapUint16Intf, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint16Intf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint16Intf`) + } + r.WriteMapElemValue() + if x.FMapUint16Intf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16IntfV(x.FMapUint16Intf, e) + } + } + } + var yyn1030 bool + if x.FptrMapUint16Intf == nil { + yyn1030 = true + goto LABEL1030 + } + LABEL1030: + if yyr2 || yy2arr2 { + if yyn1030 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint16Intf == nil { + r.EncodeNil() + } else { + yy1031 := *x.FptrMapUint16Intf + if false { + } else { + z.F.EncMapUint16IntfV(yy1031, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint16Intf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint16Intf`) + } + r.WriteMapElemValue() + if yyn1030 { + r.EncodeNil() + } else { + if x.FptrMapUint16Intf == nil { + r.EncodeNil() + } else { + yy1033 := *x.FptrMapUint16Intf + if false { + } else { + z.F.EncMapUint16IntfV(yy1033, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16String == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16StringV(x.FMapUint16String, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint16String\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint16String`) + } + r.WriteMapElemValue() + if x.FMapUint16String == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16StringV(x.FMapUint16String, e) + } + } + } + var yyn1038 bool + if x.FptrMapUint16String == nil { + yyn1038 = true + goto LABEL1038 + } + LABEL1038: + if yyr2 || yy2arr2 { + if yyn1038 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint16String == nil { + r.EncodeNil() + } else { + yy1039 := *x.FptrMapUint16String + if false { + } else { + z.F.EncMapUint16StringV(yy1039, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint16String\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint16String`) + } + r.WriteMapElemValue() + if yyn1038 { + r.EncodeNil() + } else { + if x.FptrMapUint16String == nil { + r.EncodeNil() + } else { + yy1041 := *x.FptrMapUint16String + if false { + } else { + z.F.EncMapUint16StringV(yy1041, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Uint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16UintV(x.FMapUint16Uint, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint16Uint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint16Uint`) + } + r.WriteMapElemValue() + if x.FMapUint16Uint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16UintV(x.FMapUint16Uint, e) + } + } + } + var yyn1046 bool + if x.FptrMapUint16Uint == nil { + yyn1046 = true + goto LABEL1046 + } + LABEL1046: + if yyr2 || yy2arr2 { + if yyn1046 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint16Uint == nil { + r.EncodeNil() + } else { + yy1047 := *x.FptrMapUint16Uint + if false { + } else { + z.F.EncMapUint16UintV(yy1047, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint16Uint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint16Uint`) + } + r.WriteMapElemValue() + if yyn1046 { + r.EncodeNil() + } else { + if x.FptrMapUint16Uint == nil { + r.EncodeNil() + } else { + yy1049 := *x.FptrMapUint16Uint + if false { + } else { + z.F.EncMapUint16UintV(yy1049, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Uint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16Uint8V(x.FMapUint16Uint8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint16Uint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint16Uint8`) + } + r.WriteMapElemValue() + if x.FMapUint16Uint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16Uint8V(x.FMapUint16Uint8, e) + } + } + } + var yyn1054 bool + if x.FptrMapUint16Uint8 == nil { + yyn1054 = true + goto LABEL1054 + } + LABEL1054: + if yyr2 || yy2arr2 { + if yyn1054 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint16Uint8 == nil { + r.EncodeNil() + } else { + yy1055 := *x.FptrMapUint16Uint8 + if false { + } else { + z.F.EncMapUint16Uint8V(yy1055, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint16Uint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint16Uint8`) + } + r.WriteMapElemValue() + if yyn1054 { + r.EncodeNil() + } else { + if x.FptrMapUint16Uint8 == nil { + r.EncodeNil() + } else { + yy1057 := *x.FptrMapUint16Uint8 + if false { + } else { + z.F.EncMapUint16Uint8V(yy1057, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Uint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16Uint16V(x.FMapUint16Uint16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint16Uint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint16Uint16`) + } + r.WriteMapElemValue() + if x.FMapUint16Uint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16Uint16V(x.FMapUint16Uint16, e) + } + } + } + var yyn1062 bool + if x.FptrMapUint16Uint16 == nil { + yyn1062 = true + goto LABEL1062 + } + LABEL1062: + if yyr2 || yy2arr2 { + if yyn1062 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint16Uint16 == nil { + r.EncodeNil() + } else { + yy1063 := *x.FptrMapUint16Uint16 + if false { + } else { + z.F.EncMapUint16Uint16V(yy1063, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint16Uint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint16Uint16`) + } + r.WriteMapElemValue() + if yyn1062 { + r.EncodeNil() + } else { + if x.FptrMapUint16Uint16 == nil { + r.EncodeNil() + } else { + yy1065 := *x.FptrMapUint16Uint16 + if false { + } else { + z.F.EncMapUint16Uint16V(yy1065, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Uint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16Uint32V(x.FMapUint16Uint32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint16Uint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint16Uint32`) + } + r.WriteMapElemValue() + if x.FMapUint16Uint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16Uint32V(x.FMapUint16Uint32, e) + } + } + } + var yyn1070 bool + if x.FptrMapUint16Uint32 == nil { + yyn1070 = true + goto LABEL1070 + } + LABEL1070: + if yyr2 || yy2arr2 { + if yyn1070 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint16Uint32 == nil { + r.EncodeNil() + } else { + yy1071 := *x.FptrMapUint16Uint32 + if false { + } else { + z.F.EncMapUint16Uint32V(yy1071, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint16Uint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint16Uint32`) + } + r.WriteMapElemValue() + if yyn1070 { + r.EncodeNil() + } else { + if x.FptrMapUint16Uint32 == nil { + r.EncodeNil() + } else { + yy1073 := *x.FptrMapUint16Uint32 + if false { + } else { + z.F.EncMapUint16Uint32V(yy1073, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Uint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16Uint64V(x.FMapUint16Uint64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint16Uint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint16Uint64`) + } + r.WriteMapElemValue() + if x.FMapUint16Uint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16Uint64V(x.FMapUint16Uint64, e) + } + } + } + var yyn1078 bool + if x.FptrMapUint16Uint64 == nil { + yyn1078 = true + goto LABEL1078 + } + LABEL1078: + if yyr2 || yy2arr2 { + if yyn1078 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint16Uint64 == nil { + r.EncodeNil() + } else { + yy1079 := *x.FptrMapUint16Uint64 + if false { + } else { + z.F.EncMapUint16Uint64V(yy1079, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint16Uint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint16Uint64`) + } + r.WriteMapElemValue() + if yyn1078 { + r.EncodeNil() + } else { + if x.FptrMapUint16Uint64 == nil { + r.EncodeNil() + } else { + yy1081 := *x.FptrMapUint16Uint64 + if false { + } else { + z.F.EncMapUint16Uint64V(yy1081, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Uintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16UintptrV(x.FMapUint16Uintptr, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint16Uintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint16Uintptr`) + } + r.WriteMapElemValue() + if x.FMapUint16Uintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16UintptrV(x.FMapUint16Uintptr, e) + } + } + } + var yyn1086 bool + if x.FptrMapUint16Uintptr == nil { + yyn1086 = true + goto LABEL1086 + } + LABEL1086: + if yyr2 || yy2arr2 { + if yyn1086 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint16Uintptr == nil { + r.EncodeNil() + } else { + yy1087 := *x.FptrMapUint16Uintptr + if false { + } else { + z.F.EncMapUint16UintptrV(yy1087, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint16Uintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint16Uintptr`) + } + r.WriteMapElemValue() + if yyn1086 { + r.EncodeNil() + } else { + if x.FptrMapUint16Uintptr == nil { + r.EncodeNil() + } else { + yy1089 := *x.FptrMapUint16Uintptr + if false { + } else { + z.F.EncMapUint16UintptrV(yy1089, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Int == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16IntV(x.FMapUint16Int, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint16Int\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint16Int`) + } + r.WriteMapElemValue() + if x.FMapUint16Int == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16IntV(x.FMapUint16Int, e) + } + } + } + var yyn1094 bool + if x.FptrMapUint16Int == nil { + yyn1094 = true + goto LABEL1094 + } + LABEL1094: + if yyr2 || yy2arr2 { + if yyn1094 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint16Int == nil { + r.EncodeNil() + } else { + yy1095 := *x.FptrMapUint16Int + if false { + } else { + z.F.EncMapUint16IntV(yy1095, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint16Int\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint16Int`) + } + r.WriteMapElemValue() + if yyn1094 { + r.EncodeNil() + } else { + if x.FptrMapUint16Int == nil { + r.EncodeNil() + } else { + yy1097 := *x.FptrMapUint16Int + if false { + } else { + z.F.EncMapUint16IntV(yy1097, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Int8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16Int8V(x.FMapUint16Int8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint16Int8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint16Int8`) + } + r.WriteMapElemValue() + if x.FMapUint16Int8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16Int8V(x.FMapUint16Int8, e) + } + } + } + var yyn1102 bool + if x.FptrMapUint16Int8 == nil { + yyn1102 = true + goto LABEL1102 + } + LABEL1102: + if yyr2 || yy2arr2 { + if yyn1102 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint16Int8 == nil { + r.EncodeNil() + } else { + yy1103 := *x.FptrMapUint16Int8 + if false { + } else { + z.F.EncMapUint16Int8V(yy1103, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint16Int8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint16Int8`) + } + r.WriteMapElemValue() + if yyn1102 { + r.EncodeNil() + } else { + if x.FptrMapUint16Int8 == nil { + r.EncodeNil() + } else { + yy1105 := *x.FptrMapUint16Int8 + if false { + } else { + z.F.EncMapUint16Int8V(yy1105, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Int16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16Int16V(x.FMapUint16Int16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint16Int16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint16Int16`) + } + r.WriteMapElemValue() + if x.FMapUint16Int16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16Int16V(x.FMapUint16Int16, e) + } + } + } + var yyn1110 bool + if x.FptrMapUint16Int16 == nil { + yyn1110 = true + goto LABEL1110 + } + LABEL1110: + if yyr2 || yy2arr2 { + if yyn1110 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint16Int16 == nil { + r.EncodeNil() + } else { + yy1111 := *x.FptrMapUint16Int16 + if false { + } else { + z.F.EncMapUint16Int16V(yy1111, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint16Int16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint16Int16`) + } + r.WriteMapElemValue() + if yyn1110 { + r.EncodeNil() + } else { + if x.FptrMapUint16Int16 == nil { + r.EncodeNil() + } else { + yy1113 := *x.FptrMapUint16Int16 + if false { + } else { + z.F.EncMapUint16Int16V(yy1113, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Int32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16Int32V(x.FMapUint16Int32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint16Int32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint16Int32`) + } + r.WriteMapElemValue() + if x.FMapUint16Int32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16Int32V(x.FMapUint16Int32, e) + } + } + } + var yyn1118 bool + if x.FptrMapUint16Int32 == nil { + yyn1118 = true + goto LABEL1118 + } + LABEL1118: + if yyr2 || yy2arr2 { + if yyn1118 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint16Int32 == nil { + r.EncodeNil() + } else { + yy1119 := *x.FptrMapUint16Int32 + if false { + } else { + z.F.EncMapUint16Int32V(yy1119, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint16Int32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint16Int32`) + } + r.WriteMapElemValue() + if yyn1118 { + r.EncodeNil() + } else { + if x.FptrMapUint16Int32 == nil { + r.EncodeNil() + } else { + yy1121 := *x.FptrMapUint16Int32 + if false { + } else { + z.F.EncMapUint16Int32V(yy1121, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Int64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16Int64V(x.FMapUint16Int64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint16Int64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint16Int64`) + } + r.WriteMapElemValue() + if x.FMapUint16Int64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16Int64V(x.FMapUint16Int64, e) + } + } + } + var yyn1126 bool + if x.FptrMapUint16Int64 == nil { + yyn1126 = true + goto LABEL1126 + } + LABEL1126: + if yyr2 || yy2arr2 { + if yyn1126 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint16Int64 == nil { + r.EncodeNil() + } else { + yy1127 := *x.FptrMapUint16Int64 + if false { + } else { + z.F.EncMapUint16Int64V(yy1127, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint16Int64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint16Int64`) + } + r.WriteMapElemValue() + if yyn1126 { + r.EncodeNil() + } else { + if x.FptrMapUint16Int64 == nil { + r.EncodeNil() + } else { + yy1129 := *x.FptrMapUint16Int64 + if false { + } else { + z.F.EncMapUint16Int64V(yy1129, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Float32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16Float32V(x.FMapUint16Float32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint16Float32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint16Float32`) + } + r.WriteMapElemValue() + if x.FMapUint16Float32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16Float32V(x.FMapUint16Float32, e) + } + } + } + var yyn1134 bool + if x.FptrMapUint16Float32 == nil { + yyn1134 = true + goto LABEL1134 + } + LABEL1134: + if yyr2 || yy2arr2 { + if yyn1134 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint16Float32 == nil { + r.EncodeNil() + } else { + yy1135 := *x.FptrMapUint16Float32 + if false { + } else { + z.F.EncMapUint16Float32V(yy1135, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint16Float32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint16Float32`) + } + r.WriteMapElemValue() + if yyn1134 { + r.EncodeNil() + } else { + if x.FptrMapUint16Float32 == nil { + r.EncodeNil() + } else { + yy1137 := *x.FptrMapUint16Float32 + if false { + } else { + z.F.EncMapUint16Float32V(yy1137, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Float64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16Float64V(x.FMapUint16Float64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint16Float64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint16Float64`) + } + r.WriteMapElemValue() + if x.FMapUint16Float64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16Float64V(x.FMapUint16Float64, e) + } + } + } + var yyn1142 bool + if x.FptrMapUint16Float64 == nil { + yyn1142 = true + goto LABEL1142 + } + LABEL1142: + if yyr2 || yy2arr2 { + if yyn1142 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint16Float64 == nil { + r.EncodeNil() + } else { + yy1143 := *x.FptrMapUint16Float64 + if false { + } else { + z.F.EncMapUint16Float64V(yy1143, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint16Float64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint16Float64`) + } + r.WriteMapElemValue() + if yyn1142 { + r.EncodeNil() + } else { + if x.FptrMapUint16Float64 == nil { + r.EncodeNil() + } else { + yy1145 := *x.FptrMapUint16Float64 + if false { + } else { + z.F.EncMapUint16Float64V(yy1145, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Bool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16BoolV(x.FMapUint16Bool, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint16Bool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint16Bool`) + } + r.WriteMapElemValue() + if x.FMapUint16Bool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint16BoolV(x.FMapUint16Bool, e) + } + } + } + var yyn1150 bool + if x.FptrMapUint16Bool == nil { + yyn1150 = true + goto LABEL1150 + } + LABEL1150: + if yyr2 || yy2arr2 { + if yyn1150 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint16Bool == nil { + r.EncodeNil() + } else { + yy1151 := *x.FptrMapUint16Bool + if false { + } else { + z.F.EncMapUint16BoolV(yy1151, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint16Bool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint16Bool`) + } + r.WriteMapElemValue() + if yyn1150 { + r.EncodeNil() + } else { + if x.FptrMapUint16Bool == nil { + r.EncodeNil() + } else { + yy1153 := *x.FptrMapUint16Bool + if false { + } else { + z.F.EncMapUint16BoolV(yy1153, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Intf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32IntfV(x.FMapUint32Intf, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint32Intf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint32Intf`) + } + r.WriteMapElemValue() + if x.FMapUint32Intf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32IntfV(x.FMapUint32Intf, e) + } + } + } + var yyn1158 bool + if x.FptrMapUint32Intf == nil { + yyn1158 = true + goto LABEL1158 + } + LABEL1158: + if yyr2 || yy2arr2 { + if yyn1158 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint32Intf == nil { + r.EncodeNil() + } else { + yy1159 := *x.FptrMapUint32Intf + if false { + } else { + z.F.EncMapUint32IntfV(yy1159, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint32Intf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint32Intf`) + } + r.WriteMapElemValue() + if yyn1158 { + r.EncodeNil() + } else { + if x.FptrMapUint32Intf == nil { + r.EncodeNil() + } else { + yy1161 := *x.FptrMapUint32Intf + if false { + } else { + z.F.EncMapUint32IntfV(yy1161, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32String == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32StringV(x.FMapUint32String, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint32String\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint32String`) + } + r.WriteMapElemValue() + if x.FMapUint32String == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32StringV(x.FMapUint32String, e) + } + } + } + var yyn1166 bool + if x.FptrMapUint32String == nil { + yyn1166 = true + goto LABEL1166 + } + LABEL1166: + if yyr2 || yy2arr2 { + if yyn1166 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint32String == nil { + r.EncodeNil() + } else { + yy1167 := *x.FptrMapUint32String + if false { + } else { + z.F.EncMapUint32StringV(yy1167, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint32String\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint32String`) + } + r.WriteMapElemValue() + if yyn1166 { + r.EncodeNil() + } else { + if x.FptrMapUint32String == nil { + r.EncodeNil() + } else { + yy1169 := *x.FptrMapUint32String + if false { + } else { + z.F.EncMapUint32StringV(yy1169, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Uint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32UintV(x.FMapUint32Uint, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint32Uint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint32Uint`) + } + r.WriteMapElemValue() + if x.FMapUint32Uint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32UintV(x.FMapUint32Uint, e) + } + } + } + var yyn1174 bool + if x.FptrMapUint32Uint == nil { + yyn1174 = true + goto LABEL1174 + } + LABEL1174: + if yyr2 || yy2arr2 { + if yyn1174 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint32Uint == nil { + r.EncodeNil() + } else { + yy1175 := *x.FptrMapUint32Uint + if false { + } else { + z.F.EncMapUint32UintV(yy1175, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint32Uint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint32Uint`) + } + r.WriteMapElemValue() + if yyn1174 { + r.EncodeNil() + } else { + if x.FptrMapUint32Uint == nil { + r.EncodeNil() + } else { + yy1177 := *x.FptrMapUint32Uint + if false { + } else { + z.F.EncMapUint32UintV(yy1177, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Uint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32Uint8V(x.FMapUint32Uint8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint32Uint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint32Uint8`) + } + r.WriteMapElemValue() + if x.FMapUint32Uint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32Uint8V(x.FMapUint32Uint8, e) + } + } + } + var yyn1182 bool + if x.FptrMapUint32Uint8 == nil { + yyn1182 = true + goto LABEL1182 + } + LABEL1182: + if yyr2 || yy2arr2 { + if yyn1182 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint32Uint8 == nil { + r.EncodeNil() + } else { + yy1183 := *x.FptrMapUint32Uint8 + if false { + } else { + z.F.EncMapUint32Uint8V(yy1183, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint32Uint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint32Uint8`) + } + r.WriteMapElemValue() + if yyn1182 { + r.EncodeNil() + } else { + if x.FptrMapUint32Uint8 == nil { + r.EncodeNil() + } else { + yy1185 := *x.FptrMapUint32Uint8 + if false { + } else { + z.F.EncMapUint32Uint8V(yy1185, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Uint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32Uint16V(x.FMapUint32Uint16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint32Uint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint32Uint16`) + } + r.WriteMapElemValue() + if x.FMapUint32Uint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32Uint16V(x.FMapUint32Uint16, e) + } + } + } + var yyn1190 bool + if x.FptrMapUint32Uint16 == nil { + yyn1190 = true + goto LABEL1190 + } + LABEL1190: + if yyr2 || yy2arr2 { + if yyn1190 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint32Uint16 == nil { + r.EncodeNil() + } else { + yy1191 := *x.FptrMapUint32Uint16 + if false { + } else { + z.F.EncMapUint32Uint16V(yy1191, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint32Uint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint32Uint16`) + } + r.WriteMapElemValue() + if yyn1190 { + r.EncodeNil() + } else { + if x.FptrMapUint32Uint16 == nil { + r.EncodeNil() + } else { + yy1193 := *x.FptrMapUint32Uint16 + if false { + } else { + z.F.EncMapUint32Uint16V(yy1193, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Uint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32Uint32V(x.FMapUint32Uint32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint32Uint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint32Uint32`) + } + r.WriteMapElemValue() + if x.FMapUint32Uint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32Uint32V(x.FMapUint32Uint32, e) + } + } + } + var yyn1198 bool + if x.FptrMapUint32Uint32 == nil { + yyn1198 = true + goto LABEL1198 + } + LABEL1198: + if yyr2 || yy2arr2 { + if yyn1198 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint32Uint32 == nil { + r.EncodeNil() + } else { + yy1199 := *x.FptrMapUint32Uint32 + if false { + } else { + z.F.EncMapUint32Uint32V(yy1199, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint32Uint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint32Uint32`) + } + r.WriteMapElemValue() + if yyn1198 { + r.EncodeNil() + } else { + if x.FptrMapUint32Uint32 == nil { + r.EncodeNil() + } else { + yy1201 := *x.FptrMapUint32Uint32 + if false { + } else { + z.F.EncMapUint32Uint32V(yy1201, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Uint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32Uint64V(x.FMapUint32Uint64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint32Uint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint32Uint64`) + } + r.WriteMapElemValue() + if x.FMapUint32Uint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32Uint64V(x.FMapUint32Uint64, e) + } + } + } + var yyn1206 bool + if x.FptrMapUint32Uint64 == nil { + yyn1206 = true + goto LABEL1206 + } + LABEL1206: + if yyr2 || yy2arr2 { + if yyn1206 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint32Uint64 == nil { + r.EncodeNil() + } else { + yy1207 := *x.FptrMapUint32Uint64 + if false { + } else { + z.F.EncMapUint32Uint64V(yy1207, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint32Uint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint32Uint64`) + } + r.WriteMapElemValue() + if yyn1206 { + r.EncodeNil() + } else { + if x.FptrMapUint32Uint64 == nil { + r.EncodeNil() + } else { + yy1209 := *x.FptrMapUint32Uint64 + if false { + } else { + z.F.EncMapUint32Uint64V(yy1209, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Uintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32UintptrV(x.FMapUint32Uintptr, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint32Uintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint32Uintptr`) + } + r.WriteMapElemValue() + if x.FMapUint32Uintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32UintptrV(x.FMapUint32Uintptr, e) + } + } + } + var yyn1214 bool + if x.FptrMapUint32Uintptr == nil { + yyn1214 = true + goto LABEL1214 + } + LABEL1214: + if yyr2 || yy2arr2 { + if yyn1214 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint32Uintptr == nil { + r.EncodeNil() + } else { + yy1215 := *x.FptrMapUint32Uintptr + if false { + } else { + z.F.EncMapUint32UintptrV(yy1215, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint32Uintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint32Uintptr`) + } + r.WriteMapElemValue() + if yyn1214 { + r.EncodeNil() + } else { + if x.FptrMapUint32Uintptr == nil { + r.EncodeNil() + } else { + yy1217 := *x.FptrMapUint32Uintptr + if false { + } else { + z.F.EncMapUint32UintptrV(yy1217, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Int == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32IntV(x.FMapUint32Int, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint32Int\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint32Int`) + } + r.WriteMapElemValue() + if x.FMapUint32Int == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32IntV(x.FMapUint32Int, e) + } + } + } + var yyn1222 bool + if x.FptrMapUint32Int == nil { + yyn1222 = true + goto LABEL1222 + } + LABEL1222: + if yyr2 || yy2arr2 { + if yyn1222 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint32Int == nil { + r.EncodeNil() + } else { + yy1223 := *x.FptrMapUint32Int + if false { + } else { + z.F.EncMapUint32IntV(yy1223, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint32Int\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint32Int`) + } + r.WriteMapElemValue() + if yyn1222 { + r.EncodeNil() + } else { + if x.FptrMapUint32Int == nil { + r.EncodeNil() + } else { + yy1225 := *x.FptrMapUint32Int + if false { + } else { + z.F.EncMapUint32IntV(yy1225, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Int8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32Int8V(x.FMapUint32Int8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint32Int8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint32Int8`) + } + r.WriteMapElemValue() + if x.FMapUint32Int8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32Int8V(x.FMapUint32Int8, e) + } + } + } + var yyn1230 bool + if x.FptrMapUint32Int8 == nil { + yyn1230 = true + goto LABEL1230 + } + LABEL1230: + if yyr2 || yy2arr2 { + if yyn1230 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint32Int8 == nil { + r.EncodeNil() + } else { + yy1231 := *x.FptrMapUint32Int8 + if false { + } else { + z.F.EncMapUint32Int8V(yy1231, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint32Int8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint32Int8`) + } + r.WriteMapElemValue() + if yyn1230 { + r.EncodeNil() + } else { + if x.FptrMapUint32Int8 == nil { + r.EncodeNil() + } else { + yy1233 := *x.FptrMapUint32Int8 + if false { + } else { + z.F.EncMapUint32Int8V(yy1233, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Int16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32Int16V(x.FMapUint32Int16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint32Int16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint32Int16`) + } + r.WriteMapElemValue() + if x.FMapUint32Int16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32Int16V(x.FMapUint32Int16, e) + } + } + } + var yyn1238 bool + if x.FptrMapUint32Int16 == nil { + yyn1238 = true + goto LABEL1238 + } + LABEL1238: + if yyr2 || yy2arr2 { + if yyn1238 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint32Int16 == nil { + r.EncodeNil() + } else { + yy1239 := *x.FptrMapUint32Int16 + if false { + } else { + z.F.EncMapUint32Int16V(yy1239, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint32Int16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint32Int16`) + } + r.WriteMapElemValue() + if yyn1238 { + r.EncodeNil() + } else { + if x.FptrMapUint32Int16 == nil { + r.EncodeNil() + } else { + yy1241 := *x.FptrMapUint32Int16 + if false { + } else { + z.F.EncMapUint32Int16V(yy1241, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Int32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32Int32V(x.FMapUint32Int32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint32Int32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint32Int32`) + } + r.WriteMapElemValue() + if x.FMapUint32Int32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32Int32V(x.FMapUint32Int32, e) + } + } + } + var yyn1246 bool + if x.FptrMapUint32Int32 == nil { + yyn1246 = true + goto LABEL1246 + } + LABEL1246: + if yyr2 || yy2arr2 { + if yyn1246 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint32Int32 == nil { + r.EncodeNil() + } else { + yy1247 := *x.FptrMapUint32Int32 + if false { + } else { + z.F.EncMapUint32Int32V(yy1247, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint32Int32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint32Int32`) + } + r.WriteMapElemValue() + if yyn1246 { + r.EncodeNil() + } else { + if x.FptrMapUint32Int32 == nil { + r.EncodeNil() + } else { + yy1249 := *x.FptrMapUint32Int32 + if false { + } else { + z.F.EncMapUint32Int32V(yy1249, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Int64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32Int64V(x.FMapUint32Int64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint32Int64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint32Int64`) + } + r.WriteMapElemValue() + if x.FMapUint32Int64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32Int64V(x.FMapUint32Int64, e) + } + } + } + var yyn1254 bool + if x.FptrMapUint32Int64 == nil { + yyn1254 = true + goto LABEL1254 + } + LABEL1254: + if yyr2 || yy2arr2 { + if yyn1254 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint32Int64 == nil { + r.EncodeNil() + } else { + yy1255 := *x.FptrMapUint32Int64 + if false { + } else { + z.F.EncMapUint32Int64V(yy1255, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint32Int64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint32Int64`) + } + r.WriteMapElemValue() + if yyn1254 { + r.EncodeNil() + } else { + if x.FptrMapUint32Int64 == nil { + r.EncodeNil() + } else { + yy1257 := *x.FptrMapUint32Int64 + if false { + } else { + z.F.EncMapUint32Int64V(yy1257, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Float32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32Float32V(x.FMapUint32Float32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint32Float32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint32Float32`) + } + r.WriteMapElemValue() + if x.FMapUint32Float32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32Float32V(x.FMapUint32Float32, e) + } + } + } + var yyn1262 bool + if x.FptrMapUint32Float32 == nil { + yyn1262 = true + goto LABEL1262 + } + LABEL1262: + if yyr2 || yy2arr2 { + if yyn1262 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint32Float32 == nil { + r.EncodeNil() + } else { + yy1263 := *x.FptrMapUint32Float32 + if false { + } else { + z.F.EncMapUint32Float32V(yy1263, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint32Float32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint32Float32`) + } + r.WriteMapElemValue() + if yyn1262 { + r.EncodeNil() + } else { + if x.FptrMapUint32Float32 == nil { + r.EncodeNil() + } else { + yy1265 := *x.FptrMapUint32Float32 + if false { + } else { + z.F.EncMapUint32Float32V(yy1265, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Float64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32Float64V(x.FMapUint32Float64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint32Float64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint32Float64`) + } + r.WriteMapElemValue() + if x.FMapUint32Float64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32Float64V(x.FMapUint32Float64, e) + } + } + } + var yyn1270 bool + if x.FptrMapUint32Float64 == nil { + yyn1270 = true + goto LABEL1270 + } + LABEL1270: + if yyr2 || yy2arr2 { + if yyn1270 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint32Float64 == nil { + r.EncodeNil() + } else { + yy1271 := *x.FptrMapUint32Float64 + if false { + } else { + z.F.EncMapUint32Float64V(yy1271, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint32Float64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint32Float64`) + } + r.WriteMapElemValue() + if yyn1270 { + r.EncodeNil() + } else { + if x.FptrMapUint32Float64 == nil { + r.EncodeNil() + } else { + yy1273 := *x.FptrMapUint32Float64 + if false { + } else { + z.F.EncMapUint32Float64V(yy1273, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Bool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32BoolV(x.FMapUint32Bool, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint32Bool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint32Bool`) + } + r.WriteMapElemValue() + if x.FMapUint32Bool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint32BoolV(x.FMapUint32Bool, e) + } + } + } + var yyn1278 bool + if x.FptrMapUint32Bool == nil { + yyn1278 = true + goto LABEL1278 + } + LABEL1278: + if yyr2 || yy2arr2 { + if yyn1278 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint32Bool == nil { + r.EncodeNil() + } else { + yy1279 := *x.FptrMapUint32Bool + if false { + } else { + z.F.EncMapUint32BoolV(yy1279, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint32Bool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint32Bool`) + } + r.WriteMapElemValue() + if yyn1278 { + r.EncodeNil() + } else { + if x.FptrMapUint32Bool == nil { + r.EncodeNil() + } else { + yy1281 := *x.FptrMapUint32Bool + if false { + } else { + z.F.EncMapUint32BoolV(yy1281, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Intf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64IntfV(x.FMapUint64Intf, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint64Intf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint64Intf`) + } + r.WriteMapElemValue() + if x.FMapUint64Intf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64IntfV(x.FMapUint64Intf, e) + } + } + } + var yyn1286 bool + if x.FptrMapUint64Intf == nil { + yyn1286 = true + goto LABEL1286 + } + LABEL1286: + if yyr2 || yy2arr2 { + if yyn1286 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint64Intf == nil { + r.EncodeNil() + } else { + yy1287 := *x.FptrMapUint64Intf + if false { + } else { + z.F.EncMapUint64IntfV(yy1287, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint64Intf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint64Intf`) + } + r.WriteMapElemValue() + if yyn1286 { + r.EncodeNil() + } else { + if x.FptrMapUint64Intf == nil { + r.EncodeNil() + } else { + yy1289 := *x.FptrMapUint64Intf + if false { + } else { + z.F.EncMapUint64IntfV(yy1289, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64String == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64StringV(x.FMapUint64String, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint64String\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint64String`) + } + r.WriteMapElemValue() + if x.FMapUint64String == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64StringV(x.FMapUint64String, e) + } + } + } + var yyn1294 bool + if x.FptrMapUint64String == nil { + yyn1294 = true + goto LABEL1294 + } + LABEL1294: + if yyr2 || yy2arr2 { + if yyn1294 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint64String == nil { + r.EncodeNil() + } else { + yy1295 := *x.FptrMapUint64String + if false { + } else { + z.F.EncMapUint64StringV(yy1295, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint64String\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint64String`) + } + r.WriteMapElemValue() + if yyn1294 { + r.EncodeNil() + } else { + if x.FptrMapUint64String == nil { + r.EncodeNil() + } else { + yy1297 := *x.FptrMapUint64String + if false { + } else { + z.F.EncMapUint64StringV(yy1297, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Uint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64UintV(x.FMapUint64Uint, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint64Uint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint64Uint`) + } + r.WriteMapElemValue() + if x.FMapUint64Uint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64UintV(x.FMapUint64Uint, e) + } + } + } + var yyn1302 bool + if x.FptrMapUint64Uint == nil { + yyn1302 = true + goto LABEL1302 + } + LABEL1302: + if yyr2 || yy2arr2 { + if yyn1302 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint64Uint == nil { + r.EncodeNil() + } else { + yy1303 := *x.FptrMapUint64Uint + if false { + } else { + z.F.EncMapUint64UintV(yy1303, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint64Uint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint64Uint`) + } + r.WriteMapElemValue() + if yyn1302 { + r.EncodeNil() + } else { + if x.FptrMapUint64Uint == nil { + r.EncodeNil() + } else { + yy1305 := *x.FptrMapUint64Uint + if false { + } else { + z.F.EncMapUint64UintV(yy1305, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Uint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64Uint8V(x.FMapUint64Uint8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint64Uint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint64Uint8`) + } + r.WriteMapElemValue() + if x.FMapUint64Uint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64Uint8V(x.FMapUint64Uint8, e) + } + } + } + var yyn1310 bool + if x.FptrMapUint64Uint8 == nil { + yyn1310 = true + goto LABEL1310 + } + LABEL1310: + if yyr2 || yy2arr2 { + if yyn1310 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint64Uint8 == nil { + r.EncodeNil() + } else { + yy1311 := *x.FptrMapUint64Uint8 + if false { + } else { + z.F.EncMapUint64Uint8V(yy1311, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint64Uint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint64Uint8`) + } + r.WriteMapElemValue() + if yyn1310 { + r.EncodeNil() + } else { + if x.FptrMapUint64Uint8 == nil { + r.EncodeNil() + } else { + yy1313 := *x.FptrMapUint64Uint8 + if false { + } else { + z.F.EncMapUint64Uint8V(yy1313, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Uint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64Uint16V(x.FMapUint64Uint16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint64Uint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint64Uint16`) + } + r.WriteMapElemValue() + if x.FMapUint64Uint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64Uint16V(x.FMapUint64Uint16, e) + } + } + } + var yyn1318 bool + if x.FptrMapUint64Uint16 == nil { + yyn1318 = true + goto LABEL1318 + } + LABEL1318: + if yyr2 || yy2arr2 { + if yyn1318 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint64Uint16 == nil { + r.EncodeNil() + } else { + yy1319 := *x.FptrMapUint64Uint16 + if false { + } else { + z.F.EncMapUint64Uint16V(yy1319, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint64Uint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint64Uint16`) + } + r.WriteMapElemValue() + if yyn1318 { + r.EncodeNil() + } else { + if x.FptrMapUint64Uint16 == nil { + r.EncodeNil() + } else { + yy1321 := *x.FptrMapUint64Uint16 + if false { + } else { + z.F.EncMapUint64Uint16V(yy1321, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Uint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64Uint32V(x.FMapUint64Uint32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint64Uint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint64Uint32`) + } + r.WriteMapElemValue() + if x.FMapUint64Uint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64Uint32V(x.FMapUint64Uint32, e) + } + } + } + var yyn1326 bool + if x.FptrMapUint64Uint32 == nil { + yyn1326 = true + goto LABEL1326 + } + LABEL1326: + if yyr2 || yy2arr2 { + if yyn1326 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint64Uint32 == nil { + r.EncodeNil() + } else { + yy1327 := *x.FptrMapUint64Uint32 + if false { + } else { + z.F.EncMapUint64Uint32V(yy1327, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint64Uint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint64Uint32`) + } + r.WriteMapElemValue() + if yyn1326 { + r.EncodeNil() + } else { + if x.FptrMapUint64Uint32 == nil { + r.EncodeNil() + } else { + yy1329 := *x.FptrMapUint64Uint32 + if false { + } else { + z.F.EncMapUint64Uint32V(yy1329, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Uint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64Uint64V(x.FMapUint64Uint64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint64Uint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint64Uint64`) + } + r.WriteMapElemValue() + if x.FMapUint64Uint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64Uint64V(x.FMapUint64Uint64, e) + } + } + } + var yyn1334 bool + if x.FptrMapUint64Uint64 == nil { + yyn1334 = true + goto LABEL1334 + } + LABEL1334: + if yyr2 || yy2arr2 { + if yyn1334 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint64Uint64 == nil { + r.EncodeNil() + } else { + yy1335 := *x.FptrMapUint64Uint64 + if false { + } else { + z.F.EncMapUint64Uint64V(yy1335, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint64Uint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint64Uint64`) + } + r.WriteMapElemValue() + if yyn1334 { + r.EncodeNil() + } else { + if x.FptrMapUint64Uint64 == nil { + r.EncodeNil() + } else { + yy1337 := *x.FptrMapUint64Uint64 + if false { + } else { + z.F.EncMapUint64Uint64V(yy1337, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Uintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64UintptrV(x.FMapUint64Uintptr, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint64Uintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint64Uintptr`) + } + r.WriteMapElemValue() + if x.FMapUint64Uintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64UintptrV(x.FMapUint64Uintptr, e) + } + } + } + var yyn1342 bool + if x.FptrMapUint64Uintptr == nil { + yyn1342 = true + goto LABEL1342 + } + LABEL1342: + if yyr2 || yy2arr2 { + if yyn1342 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint64Uintptr == nil { + r.EncodeNil() + } else { + yy1343 := *x.FptrMapUint64Uintptr + if false { + } else { + z.F.EncMapUint64UintptrV(yy1343, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint64Uintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint64Uintptr`) + } + r.WriteMapElemValue() + if yyn1342 { + r.EncodeNil() + } else { + if x.FptrMapUint64Uintptr == nil { + r.EncodeNil() + } else { + yy1345 := *x.FptrMapUint64Uintptr + if false { + } else { + z.F.EncMapUint64UintptrV(yy1345, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Int == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64IntV(x.FMapUint64Int, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint64Int\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint64Int`) + } + r.WriteMapElemValue() + if x.FMapUint64Int == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64IntV(x.FMapUint64Int, e) + } + } + } + var yyn1350 bool + if x.FptrMapUint64Int == nil { + yyn1350 = true + goto LABEL1350 + } + LABEL1350: + if yyr2 || yy2arr2 { + if yyn1350 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint64Int == nil { + r.EncodeNil() + } else { + yy1351 := *x.FptrMapUint64Int + if false { + } else { + z.F.EncMapUint64IntV(yy1351, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint64Int\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint64Int`) + } + r.WriteMapElemValue() + if yyn1350 { + r.EncodeNil() + } else { + if x.FptrMapUint64Int == nil { + r.EncodeNil() + } else { + yy1353 := *x.FptrMapUint64Int + if false { + } else { + z.F.EncMapUint64IntV(yy1353, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Int8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64Int8V(x.FMapUint64Int8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint64Int8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint64Int8`) + } + r.WriteMapElemValue() + if x.FMapUint64Int8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64Int8V(x.FMapUint64Int8, e) + } + } + } + var yyn1358 bool + if x.FptrMapUint64Int8 == nil { + yyn1358 = true + goto LABEL1358 + } + LABEL1358: + if yyr2 || yy2arr2 { + if yyn1358 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint64Int8 == nil { + r.EncodeNil() + } else { + yy1359 := *x.FptrMapUint64Int8 + if false { + } else { + z.F.EncMapUint64Int8V(yy1359, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint64Int8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint64Int8`) + } + r.WriteMapElemValue() + if yyn1358 { + r.EncodeNil() + } else { + if x.FptrMapUint64Int8 == nil { + r.EncodeNil() + } else { + yy1361 := *x.FptrMapUint64Int8 + if false { + } else { + z.F.EncMapUint64Int8V(yy1361, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Int16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64Int16V(x.FMapUint64Int16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint64Int16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint64Int16`) + } + r.WriteMapElemValue() + if x.FMapUint64Int16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64Int16V(x.FMapUint64Int16, e) + } + } + } + var yyn1366 bool + if x.FptrMapUint64Int16 == nil { + yyn1366 = true + goto LABEL1366 + } + LABEL1366: + if yyr2 || yy2arr2 { + if yyn1366 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint64Int16 == nil { + r.EncodeNil() + } else { + yy1367 := *x.FptrMapUint64Int16 + if false { + } else { + z.F.EncMapUint64Int16V(yy1367, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint64Int16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint64Int16`) + } + r.WriteMapElemValue() + if yyn1366 { + r.EncodeNil() + } else { + if x.FptrMapUint64Int16 == nil { + r.EncodeNil() + } else { + yy1369 := *x.FptrMapUint64Int16 + if false { + } else { + z.F.EncMapUint64Int16V(yy1369, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Int32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64Int32V(x.FMapUint64Int32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint64Int32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint64Int32`) + } + r.WriteMapElemValue() + if x.FMapUint64Int32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64Int32V(x.FMapUint64Int32, e) + } + } + } + var yyn1374 bool + if x.FptrMapUint64Int32 == nil { + yyn1374 = true + goto LABEL1374 + } + LABEL1374: + if yyr2 || yy2arr2 { + if yyn1374 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint64Int32 == nil { + r.EncodeNil() + } else { + yy1375 := *x.FptrMapUint64Int32 + if false { + } else { + z.F.EncMapUint64Int32V(yy1375, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint64Int32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint64Int32`) + } + r.WriteMapElemValue() + if yyn1374 { + r.EncodeNil() + } else { + if x.FptrMapUint64Int32 == nil { + r.EncodeNil() + } else { + yy1377 := *x.FptrMapUint64Int32 + if false { + } else { + z.F.EncMapUint64Int32V(yy1377, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Int64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64Int64V(x.FMapUint64Int64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint64Int64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint64Int64`) + } + r.WriteMapElemValue() + if x.FMapUint64Int64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64Int64V(x.FMapUint64Int64, e) + } + } + } + var yyn1382 bool + if x.FptrMapUint64Int64 == nil { + yyn1382 = true + goto LABEL1382 + } + LABEL1382: + if yyr2 || yy2arr2 { + if yyn1382 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint64Int64 == nil { + r.EncodeNil() + } else { + yy1383 := *x.FptrMapUint64Int64 + if false { + } else { + z.F.EncMapUint64Int64V(yy1383, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint64Int64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint64Int64`) + } + r.WriteMapElemValue() + if yyn1382 { + r.EncodeNil() + } else { + if x.FptrMapUint64Int64 == nil { + r.EncodeNil() + } else { + yy1385 := *x.FptrMapUint64Int64 + if false { + } else { + z.F.EncMapUint64Int64V(yy1385, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Float32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64Float32V(x.FMapUint64Float32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint64Float32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint64Float32`) + } + r.WriteMapElemValue() + if x.FMapUint64Float32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64Float32V(x.FMapUint64Float32, e) + } + } + } + var yyn1390 bool + if x.FptrMapUint64Float32 == nil { + yyn1390 = true + goto LABEL1390 + } + LABEL1390: + if yyr2 || yy2arr2 { + if yyn1390 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint64Float32 == nil { + r.EncodeNil() + } else { + yy1391 := *x.FptrMapUint64Float32 + if false { + } else { + z.F.EncMapUint64Float32V(yy1391, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint64Float32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint64Float32`) + } + r.WriteMapElemValue() + if yyn1390 { + r.EncodeNil() + } else { + if x.FptrMapUint64Float32 == nil { + r.EncodeNil() + } else { + yy1393 := *x.FptrMapUint64Float32 + if false { + } else { + z.F.EncMapUint64Float32V(yy1393, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Float64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64Float64V(x.FMapUint64Float64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint64Float64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint64Float64`) + } + r.WriteMapElemValue() + if x.FMapUint64Float64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64Float64V(x.FMapUint64Float64, e) + } + } + } + var yyn1398 bool + if x.FptrMapUint64Float64 == nil { + yyn1398 = true + goto LABEL1398 + } + LABEL1398: + if yyr2 || yy2arr2 { + if yyn1398 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint64Float64 == nil { + r.EncodeNil() + } else { + yy1399 := *x.FptrMapUint64Float64 + if false { + } else { + z.F.EncMapUint64Float64V(yy1399, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint64Float64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint64Float64`) + } + r.WriteMapElemValue() + if yyn1398 { + r.EncodeNil() + } else { + if x.FptrMapUint64Float64 == nil { + r.EncodeNil() + } else { + yy1401 := *x.FptrMapUint64Float64 + if false { + } else { + z.F.EncMapUint64Float64V(yy1401, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Bool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64BoolV(x.FMapUint64Bool, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUint64Bool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUint64Bool`) + } + r.WriteMapElemValue() + if x.FMapUint64Bool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUint64BoolV(x.FMapUint64Bool, e) + } + } + } + var yyn1406 bool + if x.FptrMapUint64Bool == nil { + yyn1406 = true + goto LABEL1406 + } + LABEL1406: + if yyr2 || yy2arr2 { + if yyn1406 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUint64Bool == nil { + r.EncodeNil() + } else { + yy1407 := *x.FptrMapUint64Bool + if false { + } else { + z.F.EncMapUint64BoolV(yy1407, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUint64Bool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUint64Bool`) + } + r.WriteMapElemValue() + if yyn1406 { + r.EncodeNil() + } else { + if x.FptrMapUint64Bool == nil { + r.EncodeNil() + } else { + yy1409 := *x.FptrMapUint64Bool + if false { + } else { + z.F.EncMapUint64BoolV(yy1409, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrIntf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrIntfV(x.FMapUintptrIntf, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintptrIntf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintptrIntf`) + } + r.WriteMapElemValue() + if x.FMapUintptrIntf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrIntfV(x.FMapUintptrIntf, e) + } + } + } + var yyn1414 bool + if x.FptrMapUintptrIntf == nil { + yyn1414 = true + goto LABEL1414 + } + LABEL1414: + if yyr2 || yy2arr2 { + if yyn1414 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintptrIntf == nil { + r.EncodeNil() + } else { + yy1415 := *x.FptrMapUintptrIntf + if false { + } else { + z.F.EncMapUintptrIntfV(yy1415, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintptrIntf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintptrIntf`) + } + r.WriteMapElemValue() + if yyn1414 { + r.EncodeNil() + } else { + if x.FptrMapUintptrIntf == nil { + r.EncodeNil() + } else { + yy1417 := *x.FptrMapUintptrIntf + if false { + } else { + z.F.EncMapUintptrIntfV(yy1417, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrString == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrStringV(x.FMapUintptrString, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintptrString\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintptrString`) + } + r.WriteMapElemValue() + if x.FMapUintptrString == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrStringV(x.FMapUintptrString, e) + } + } + } + var yyn1422 bool + if x.FptrMapUintptrString == nil { + yyn1422 = true + goto LABEL1422 + } + LABEL1422: + if yyr2 || yy2arr2 { + if yyn1422 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintptrString == nil { + r.EncodeNil() + } else { + yy1423 := *x.FptrMapUintptrString + if false { + } else { + z.F.EncMapUintptrStringV(yy1423, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintptrString\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintptrString`) + } + r.WriteMapElemValue() + if yyn1422 { + r.EncodeNil() + } else { + if x.FptrMapUintptrString == nil { + r.EncodeNil() + } else { + yy1425 := *x.FptrMapUintptrString + if false { + } else { + z.F.EncMapUintptrStringV(yy1425, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrUint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrUintV(x.FMapUintptrUint, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintptrUint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintptrUint`) + } + r.WriteMapElemValue() + if x.FMapUintptrUint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrUintV(x.FMapUintptrUint, e) + } + } + } + var yyn1430 bool + if x.FptrMapUintptrUint == nil { + yyn1430 = true + goto LABEL1430 + } + LABEL1430: + if yyr2 || yy2arr2 { + if yyn1430 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintptrUint == nil { + r.EncodeNil() + } else { + yy1431 := *x.FptrMapUintptrUint + if false { + } else { + z.F.EncMapUintptrUintV(yy1431, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintptrUint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintptrUint`) + } + r.WriteMapElemValue() + if yyn1430 { + r.EncodeNil() + } else { + if x.FptrMapUintptrUint == nil { + r.EncodeNil() + } else { + yy1433 := *x.FptrMapUintptrUint + if false { + } else { + z.F.EncMapUintptrUintV(yy1433, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrUint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrUint8V(x.FMapUintptrUint8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintptrUint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintptrUint8`) + } + r.WriteMapElemValue() + if x.FMapUintptrUint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrUint8V(x.FMapUintptrUint8, e) + } + } + } + var yyn1438 bool + if x.FptrMapUintptrUint8 == nil { + yyn1438 = true + goto LABEL1438 + } + LABEL1438: + if yyr2 || yy2arr2 { + if yyn1438 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintptrUint8 == nil { + r.EncodeNil() + } else { + yy1439 := *x.FptrMapUintptrUint8 + if false { + } else { + z.F.EncMapUintptrUint8V(yy1439, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintptrUint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintptrUint8`) + } + r.WriteMapElemValue() + if yyn1438 { + r.EncodeNil() + } else { + if x.FptrMapUintptrUint8 == nil { + r.EncodeNil() + } else { + yy1441 := *x.FptrMapUintptrUint8 + if false { + } else { + z.F.EncMapUintptrUint8V(yy1441, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrUint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrUint16V(x.FMapUintptrUint16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintptrUint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintptrUint16`) + } + r.WriteMapElemValue() + if x.FMapUintptrUint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrUint16V(x.FMapUintptrUint16, e) + } + } + } + var yyn1446 bool + if x.FptrMapUintptrUint16 == nil { + yyn1446 = true + goto LABEL1446 + } + LABEL1446: + if yyr2 || yy2arr2 { + if yyn1446 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintptrUint16 == nil { + r.EncodeNil() + } else { + yy1447 := *x.FptrMapUintptrUint16 + if false { + } else { + z.F.EncMapUintptrUint16V(yy1447, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintptrUint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintptrUint16`) + } + r.WriteMapElemValue() + if yyn1446 { + r.EncodeNil() + } else { + if x.FptrMapUintptrUint16 == nil { + r.EncodeNil() + } else { + yy1449 := *x.FptrMapUintptrUint16 + if false { + } else { + z.F.EncMapUintptrUint16V(yy1449, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrUint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrUint32V(x.FMapUintptrUint32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintptrUint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintptrUint32`) + } + r.WriteMapElemValue() + if x.FMapUintptrUint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrUint32V(x.FMapUintptrUint32, e) + } + } + } + var yyn1454 bool + if x.FptrMapUintptrUint32 == nil { + yyn1454 = true + goto LABEL1454 + } + LABEL1454: + if yyr2 || yy2arr2 { + if yyn1454 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintptrUint32 == nil { + r.EncodeNil() + } else { + yy1455 := *x.FptrMapUintptrUint32 + if false { + } else { + z.F.EncMapUintptrUint32V(yy1455, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintptrUint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintptrUint32`) + } + r.WriteMapElemValue() + if yyn1454 { + r.EncodeNil() + } else { + if x.FptrMapUintptrUint32 == nil { + r.EncodeNil() + } else { + yy1457 := *x.FptrMapUintptrUint32 + if false { + } else { + z.F.EncMapUintptrUint32V(yy1457, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrUint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrUint64V(x.FMapUintptrUint64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintptrUint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintptrUint64`) + } + r.WriteMapElemValue() + if x.FMapUintptrUint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrUint64V(x.FMapUintptrUint64, e) + } + } + } + var yyn1462 bool + if x.FptrMapUintptrUint64 == nil { + yyn1462 = true + goto LABEL1462 + } + LABEL1462: + if yyr2 || yy2arr2 { + if yyn1462 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintptrUint64 == nil { + r.EncodeNil() + } else { + yy1463 := *x.FptrMapUintptrUint64 + if false { + } else { + z.F.EncMapUintptrUint64V(yy1463, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintptrUint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintptrUint64`) + } + r.WriteMapElemValue() + if yyn1462 { + r.EncodeNil() + } else { + if x.FptrMapUintptrUint64 == nil { + r.EncodeNil() + } else { + yy1465 := *x.FptrMapUintptrUint64 + if false { + } else { + z.F.EncMapUintptrUint64V(yy1465, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrUintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrUintptrV(x.FMapUintptrUintptr, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintptrUintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintptrUintptr`) + } + r.WriteMapElemValue() + if x.FMapUintptrUintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrUintptrV(x.FMapUintptrUintptr, e) + } + } + } + var yyn1470 bool + if x.FptrMapUintptrUintptr == nil { + yyn1470 = true + goto LABEL1470 + } + LABEL1470: + if yyr2 || yy2arr2 { + if yyn1470 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintptrUintptr == nil { + r.EncodeNil() + } else { + yy1471 := *x.FptrMapUintptrUintptr + if false { + } else { + z.F.EncMapUintptrUintptrV(yy1471, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintptrUintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintptrUintptr`) + } + r.WriteMapElemValue() + if yyn1470 { + r.EncodeNil() + } else { + if x.FptrMapUintptrUintptr == nil { + r.EncodeNil() + } else { + yy1473 := *x.FptrMapUintptrUintptr + if false { + } else { + z.F.EncMapUintptrUintptrV(yy1473, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrInt == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrIntV(x.FMapUintptrInt, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintptrInt\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintptrInt`) + } + r.WriteMapElemValue() + if x.FMapUintptrInt == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrIntV(x.FMapUintptrInt, e) + } + } + } + var yyn1478 bool + if x.FptrMapUintptrInt == nil { + yyn1478 = true + goto LABEL1478 + } + LABEL1478: + if yyr2 || yy2arr2 { + if yyn1478 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintptrInt == nil { + r.EncodeNil() + } else { + yy1479 := *x.FptrMapUintptrInt + if false { + } else { + z.F.EncMapUintptrIntV(yy1479, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintptrInt\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintptrInt`) + } + r.WriteMapElemValue() + if yyn1478 { + r.EncodeNil() + } else { + if x.FptrMapUintptrInt == nil { + r.EncodeNil() + } else { + yy1481 := *x.FptrMapUintptrInt + if false { + } else { + z.F.EncMapUintptrIntV(yy1481, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrInt8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrInt8V(x.FMapUintptrInt8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintptrInt8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintptrInt8`) + } + r.WriteMapElemValue() + if x.FMapUintptrInt8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrInt8V(x.FMapUintptrInt8, e) + } + } + } + var yyn1486 bool + if x.FptrMapUintptrInt8 == nil { + yyn1486 = true + goto LABEL1486 + } + LABEL1486: + if yyr2 || yy2arr2 { + if yyn1486 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintptrInt8 == nil { + r.EncodeNil() + } else { + yy1487 := *x.FptrMapUintptrInt8 + if false { + } else { + z.F.EncMapUintptrInt8V(yy1487, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintptrInt8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintptrInt8`) + } + r.WriteMapElemValue() + if yyn1486 { + r.EncodeNil() + } else { + if x.FptrMapUintptrInt8 == nil { + r.EncodeNil() + } else { + yy1489 := *x.FptrMapUintptrInt8 + if false { + } else { + z.F.EncMapUintptrInt8V(yy1489, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrInt16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrInt16V(x.FMapUintptrInt16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintptrInt16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintptrInt16`) + } + r.WriteMapElemValue() + if x.FMapUintptrInt16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrInt16V(x.FMapUintptrInt16, e) + } + } + } + var yyn1494 bool + if x.FptrMapUintptrInt16 == nil { + yyn1494 = true + goto LABEL1494 + } + LABEL1494: + if yyr2 || yy2arr2 { + if yyn1494 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintptrInt16 == nil { + r.EncodeNil() + } else { + yy1495 := *x.FptrMapUintptrInt16 + if false { + } else { + z.F.EncMapUintptrInt16V(yy1495, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintptrInt16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintptrInt16`) + } + r.WriteMapElemValue() + if yyn1494 { + r.EncodeNil() + } else { + if x.FptrMapUintptrInt16 == nil { + r.EncodeNil() + } else { + yy1497 := *x.FptrMapUintptrInt16 + if false { + } else { + z.F.EncMapUintptrInt16V(yy1497, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrInt32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrInt32V(x.FMapUintptrInt32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintptrInt32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintptrInt32`) + } + r.WriteMapElemValue() + if x.FMapUintptrInt32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrInt32V(x.FMapUintptrInt32, e) + } + } + } + var yyn1502 bool + if x.FptrMapUintptrInt32 == nil { + yyn1502 = true + goto LABEL1502 + } + LABEL1502: + if yyr2 || yy2arr2 { + if yyn1502 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintptrInt32 == nil { + r.EncodeNil() + } else { + yy1503 := *x.FptrMapUintptrInt32 + if false { + } else { + z.F.EncMapUintptrInt32V(yy1503, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintptrInt32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintptrInt32`) + } + r.WriteMapElemValue() + if yyn1502 { + r.EncodeNil() + } else { + if x.FptrMapUintptrInt32 == nil { + r.EncodeNil() + } else { + yy1505 := *x.FptrMapUintptrInt32 + if false { + } else { + z.F.EncMapUintptrInt32V(yy1505, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrInt64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrInt64V(x.FMapUintptrInt64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintptrInt64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintptrInt64`) + } + r.WriteMapElemValue() + if x.FMapUintptrInt64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrInt64V(x.FMapUintptrInt64, e) + } + } + } + var yyn1510 bool + if x.FptrMapUintptrInt64 == nil { + yyn1510 = true + goto LABEL1510 + } + LABEL1510: + if yyr2 || yy2arr2 { + if yyn1510 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintptrInt64 == nil { + r.EncodeNil() + } else { + yy1511 := *x.FptrMapUintptrInt64 + if false { + } else { + z.F.EncMapUintptrInt64V(yy1511, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintptrInt64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintptrInt64`) + } + r.WriteMapElemValue() + if yyn1510 { + r.EncodeNil() + } else { + if x.FptrMapUintptrInt64 == nil { + r.EncodeNil() + } else { + yy1513 := *x.FptrMapUintptrInt64 + if false { + } else { + z.F.EncMapUintptrInt64V(yy1513, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrFloat32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrFloat32V(x.FMapUintptrFloat32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintptrFloat32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintptrFloat32`) + } + r.WriteMapElemValue() + if x.FMapUintptrFloat32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrFloat32V(x.FMapUintptrFloat32, e) + } + } + } + var yyn1518 bool + if x.FptrMapUintptrFloat32 == nil { + yyn1518 = true + goto LABEL1518 + } + LABEL1518: + if yyr2 || yy2arr2 { + if yyn1518 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintptrFloat32 == nil { + r.EncodeNil() + } else { + yy1519 := *x.FptrMapUintptrFloat32 + if false { + } else { + z.F.EncMapUintptrFloat32V(yy1519, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintptrFloat32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintptrFloat32`) + } + r.WriteMapElemValue() + if yyn1518 { + r.EncodeNil() + } else { + if x.FptrMapUintptrFloat32 == nil { + r.EncodeNil() + } else { + yy1521 := *x.FptrMapUintptrFloat32 + if false { + } else { + z.F.EncMapUintptrFloat32V(yy1521, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrFloat64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrFloat64V(x.FMapUintptrFloat64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintptrFloat64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintptrFloat64`) + } + r.WriteMapElemValue() + if x.FMapUintptrFloat64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrFloat64V(x.FMapUintptrFloat64, e) + } + } + } + var yyn1526 bool + if x.FptrMapUintptrFloat64 == nil { + yyn1526 = true + goto LABEL1526 + } + LABEL1526: + if yyr2 || yy2arr2 { + if yyn1526 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintptrFloat64 == nil { + r.EncodeNil() + } else { + yy1527 := *x.FptrMapUintptrFloat64 + if false { + } else { + z.F.EncMapUintptrFloat64V(yy1527, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintptrFloat64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintptrFloat64`) + } + r.WriteMapElemValue() + if yyn1526 { + r.EncodeNil() + } else { + if x.FptrMapUintptrFloat64 == nil { + r.EncodeNil() + } else { + yy1529 := *x.FptrMapUintptrFloat64 + if false { + } else { + z.F.EncMapUintptrFloat64V(yy1529, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrBool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrBoolV(x.FMapUintptrBool, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapUintptrBool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapUintptrBool`) + } + r.WriteMapElemValue() + if x.FMapUintptrBool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapUintptrBoolV(x.FMapUintptrBool, e) + } + } + } + var yyn1534 bool + if x.FptrMapUintptrBool == nil { + yyn1534 = true + goto LABEL1534 + } + LABEL1534: + if yyr2 || yy2arr2 { + if yyn1534 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapUintptrBool == nil { + r.EncodeNil() + } else { + yy1535 := *x.FptrMapUintptrBool + if false { + } else { + z.F.EncMapUintptrBoolV(yy1535, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapUintptrBool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapUintptrBool`) + } + r.WriteMapElemValue() + if yyn1534 { + r.EncodeNil() + } else { + if x.FptrMapUintptrBool == nil { + r.EncodeNil() + } else { + yy1537 := *x.FptrMapUintptrBool + if false { + } else { + z.F.EncMapUintptrBoolV(yy1537, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntIntf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntIntfV(x.FMapIntIntf, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntIntf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntIntf`) + } + r.WriteMapElemValue() + if x.FMapIntIntf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntIntfV(x.FMapIntIntf, e) + } + } + } + var yyn1542 bool + if x.FptrMapIntIntf == nil { + yyn1542 = true + goto LABEL1542 + } + LABEL1542: + if yyr2 || yy2arr2 { + if yyn1542 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntIntf == nil { + r.EncodeNil() + } else { + yy1543 := *x.FptrMapIntIntf + if false { + } else { + z.F.EncMapIntIntfV(yy1543, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntIntf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntIntf`) + } + r.WriteMapElemValue() + if yyn1542 { + r.EncodeNil() + } else { + if x.FptrMapIntIntf == nil { + r.EncodeNil() + } else { + yy1545 := *x.FptrMapIntIntf + if false { + } else { + z.F.EncMapIntIntfV(yy1545, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntString == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntStringV(x.FMapIntString, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntString\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntString`) + } + r.WriteMapElemValue() + if x.FMapIntString == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntStringV(x.FMapIntString, e) + } + } + } + var yyn1550 bool + if x.FptrMapIntString == nil { + yyn1550 = true + goto LABEL1550 + } + LABEL1550: + if yyr2 || yy2arr2 { + if yyn1550 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntString == nil { + r.EncodeNil() + } else { + yy1551 := *x.FptrMapIntString + if false { + } else { + z.F.EncMapIntStringV(yy1551, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntString\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntString`) + } + r.WriteMapElemValue() + if yyn1550 { + r.EncodeNil() + } else { + if x.FptrMapIntString == nil { + r.EncodeNil() + } else { + yy1553 := *x.FptrMapIntString + if false { + } else { + z.F.EncMapIntStringV(yy1553, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntUint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntUintV(x.FMapIntUint, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntUint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntUint`) + } + r.WriteMapElemValue() + if x.FMapIntUint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntUintV(x.FMapIntUint, e) + } + } + } + var yyn1558 bool + if x.FptrMapIntUint == nil { + yyn1558 = true + goto LABEL1558 + } + LABEL1558: + if yyr2 || yy2arr2 { + if yyn1558 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntUint == nil { + r.EncodeNil() + } else { + yy1559 := *x.FptrMapIntUint + if false { + } else { + z.F.EncMapIntUintV(yy1559, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntUint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntUint`) + } + r.WriteMapElemValue() + if yyn1558 { + r.EncodeNil() + } else { + if x.FptrMapIntUint == nil { + r.EncodeNil() + } else { + yy1561 := *x.FptrMapIntUint + if false { + } else { + z.F.EncMapIntUintV(yy1561, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntUint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntUint8V(x.FMapIntUint8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntUint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntUint8`) + } + r.WriteMapElemValue() + if x.FMapIntUint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntUint8V(x.FMapIntUint8, e) + } + } + } + var yyn1566 bool + if x.FptrMapIntUint8 == nil { + yyn1566 = true + goto LABEL1566 + } + LABEL1566: + if yyr2 || yy2arr2 { + if yyn1566 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntUint8 == nil { + r.EncodeNil() + } else { + yy1567 := *x.FptrMapIntUint8 + if false { + } else { + z.F.EncMapIntUint8V(yy1567, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntUint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntUint8`) + } + r.WriteMapElemValue() + if yyn1566 { + r.EncodeNil() + } else { + if x.FptrMapIntUint8 == nil { + r.EncodeNil() + } else { + yy1569 := *x.FptrMapIntUint8 + if false { + } else { + z.F.EncMapIntUint8V(yy1569, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntUint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntUint16V(x.FMapIntUint16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntUint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntUint16`) + } + r.WriteMapElemValue() + if x.FMapIntUint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntUint16V(x.FMapIntUint16, e) + } + } + } + var yyn1574 bool + if x.FptrMapIntUint16 == nil { + yyn1574 = true + goto LABEL1574 + } + LABEL1574: + if yyr2 || yy2arr2 { + if yyn1574 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntUint16 == nil { + r.EncodeNil() + } else { + yy1575 := *x.FptrMapIntUint16 + if false { + } else { + z.F.EncMapIntUint16V(yy1575, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntUint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntUint16`) + } + r.WriteMapElemValue() + if yyn1574 { + r.EncodeNil() + } else { + if x.FptrMapIntUint16 == nil { + r.EncodeNil() + } else { + yy1577 := *x.FptrMapIntUint16 + if false { + } else { + z.F.EncMapIntUint16V(yy1577, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntUint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntUint32V(x.FMapIntUint32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntUint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntUint32`) + } + r.WriteMapElemValue() + if x.FMapIntUint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntUint32V(x.FMapIntUint32, e) + } + } + } + var yyn1582 bool + if x.FptrMapIntUint32 == nil { + yyn1582 = true + goto LABEL1582 + } + LABEL1582: + if yyr2 || yy2arr2 { + if yyn1582 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntUint32 == nil { + r.EncodeNil() + } else { + yy1583 := *x.FptrMapIntUint32 + if false { + } else { + z.F.EncMapIntUint32V(yy1583, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntUint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntUint32`) + } + r.WriteMapElemValue() + if yyn1582 { + r.EncodeNil() + } else { + if x.FptrMapIntUint32 == nil { + r.EncodeNil() + } else { + yy1585 := *x.FptrMapIntUint32 + if false { + } else { + z.F.EncMapIntUint32V(yy1585, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntUint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntUint64V(x.FMapIntUint64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntUint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntUint64`) + } + r.WriteMapElemValue() + if x.FMapIntUint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntUint64V(x.FMapIntUint64, e) + } + } + } + var yyn1590 bool + if x.FptrMapIntUint64 == nil { + yyn1590 = true + goto LABEL1590 + } + LABEL1590: + if yyr2 || yy2arr2 { + if yyn1590 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntUint64 == nil { + r.EncodeNil() + } else { + yy1591 := *x.FptrMapIntUint64 + if false { + } else { + z.F.EncMapIntUint64V(yy1591, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntUint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntUint64`) + } + r.WriteMapElemValue() + if yyn1590 { + r.EncodeNil() + } else { + if x.FptrMapIntUint64 == nil { + r.EncodeNil() + } else { + yy1593 := *x.FptrMapIntUint64 + if false { + } else { + z.F.EncMapIntUint64V(yy1593, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntUintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntUintptrV(x.FMapIntUintptr, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntUintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntUintptr`) + } + r.WriteMapElemValue() + if x.FMapIntUintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntUintptrV(x.FMapIntUintptr, e) + } + } + } + var yyn1598 bool + if x.FptrMapIntUintptr == nil { + yyn1598 = true + goto LABEL1598 + } + LABEL1598: + if yyr2 || yy2arr2 { + if yyn1598 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntUintptr == nil { + r.EncodeNil() + } else { + yy1599 := *x.FptrMapIntUintptr + if false { + } else { + z.F.EncMapIntUintptrV(yy1599, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntUintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntUintptr`) + } + r.WriteMapElemValue() + if yyn1598 { + r.EncodeNil() + } else { + if x.FptrMapIntUintptr == nil { + r.EncodeNil() + } else { + yy1601 := *x.FptrMapIntUintptr + if false { + } else { + z.F.EncMapIntUintptrV(yy1601, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntInt == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntIntV(x.FMapIntInt, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntInt\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntInt`) + } + r.WriteMapElemValue() + if x.FMapIntInt == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntIntV(x.FMapIntInt, e) + } + } + } + var yyn1606 bool + if x.FptrMapIntInt == nil { + yyn1606 = true + goto LABEL1606 + } + LABEL1606: + if yyr2 || yy2arr2 { + if yyn1606 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntInt == nil { + r.EncodeNil() + } else { + yy1607 := *x.FptrMapIntInt + if false { + } else { + z.F.EncMapIntIntV(yy1607, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntInt\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntInt`) + } + r.WriteMapElemValue() + if yyn1606 { + r.EncodeNil() + } else { + if x.FptrMapIntInt == nil { + r.EncodeNil() + } else { + yy1609 := *x.FptrMapIntInt + if false { + } else { + z.F.EncMapIntIntV(yy1609, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntInt8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntInt8V(x.FMapIntInt8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntInt8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntInt8`) + } + r.WriteMapElemValue() + if x.FMapIntInt8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntInt8V(x.FMapIntInt8, e) + } + } + } + var yyn1614 bool + if x.FptrMapIntInt8 == nil { + yyn1614 = true + goto LABEL1614 + } + LABEL1614: + if yyr2 || yy2arr2 { + if yyn1614 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntInt8 == nil { + r.EncodeNil() + } else { + yy1615 := *x.FptrMapIntInt8 + if false { + } else { + z.F.EncMapIntInt8V(yy1615, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntInt8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntInt8`) + } + r.WriteMapElemValue() + if yyn1614 { + r.EncodeNil() + } else { + if x.FptrMapIntInt8 == nil { + r.EncodeNil() + } else { + yy1617 := *x.FptrMapIntInt8 + if false { + } else { + z.F.EncMapIntInt8V(yy1617, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntInt16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntInt16V(x.FMapIntInt16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntInt16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntInt16`) + } + r.WriteMapElemValue() + if x.FMapIntInt16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntInt16V(x.FMapIntInt16, e) + } + } + } + var yyn1622 bool + if x.FptrMapIntInt16 == nil { + yyn1622 = true + goto LABEL1622 + } + LABEL1622: + if yyr2 || yy2arr2 { + if yyn1622 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntInt16 == nil { + r.EncodeNil() + } else { + yy1623 := *x.FptrMapIntInt16 + if false { + } else { + z.F.EncMapIntInt16V(yy1623, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntInt16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntInt16`) + } + r.WriteMapElemValue() + if yyn1622 { + r.EncodeNil() + } else { + if x.FptrMapIntInt16 == nil { + r.EncodeNil() + } else { + yy1625 := *x.FptrMapIntInt16 + if false { + } else { + z.F.EncMapIntInt16V(yy1625, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntInt32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntInt32V(x.FMapIntInt32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntInt32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntInt32`) + } + r.WriteMapElemValue() + if x.FMapIntInt32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntInt32V(x.FMapIntInt32, e) + } + } + } + var yyn1630 bool + if x.FptrMapIntInt32 == nil { + yyn1630 = true + goto LABEL1630 + } + LABEL1630: + if yyr2 || yy2arr2 { + if yyn1630 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntInt32 == nil { + r.EncodeNil() + } else { + yy1631 := *x.FptrMapIntInt32 + if false { + } else { + z.F.EncMapIntInt32V(yy1631, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntInt32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntInt32`) + } + r.WriteMapElemValue() + if yyn1630 { + r.EncodeNil() + } else { + if x.FptrMapIntInt32 == nil { + r.EncodeNil() + } else { + yy1633 := *x.FptrMapIntInt32 + if false { + } else { + z.F.EncMapIntInt32V(yy1633, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntInt64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntInt64V(x.FMapIntInt64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntInt64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntInt64`) + } + r.WriteMapElemValue() + if x.FMapIntInt64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntInt64V(x.FMapIntInt64, e) + } + } + } + var yyn1638 bool + if x.FptrMapIntInt64 == nil { + yyn1638 = true + goto LABEL1638 + } + LABEL1638: + if yyr2 || yy2arr2 { + if yyn1638 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntInt64 == nil { + r.EncodeNil() + } else { + yy1639 := *x.FptrMapIntInt64 + if false { + } else { + z.F.EncMapIntInt64V(yy1639, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntInt64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntInt64`) + } + r.WriteMapElemValue() + if yyn1638 { + r.EncodeNil() + } else { + if x.FptrMapIntInt64 == nil { + r.EncodeNil() + } else { + yy1641 := *x.FptrMapIntInt64 + if false { + } else { + z.F.EncMapIntInt64V(yy1641, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntFloat32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntFloat32V(x.FMapIntFloat32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntFloat32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntFloat32`) + } + r.WriteMapElemValue() + if x.FMapIntFloat32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntFloat32V(x.FMapIntFloat32, e) + } + } + } + var yyn1646 bool + if x.FptrMapIntFloat32 == nil { + yyn1646 = true + goto LABEL1646 + } + LABEL1646: + if yyr2 || yy2arr2 { + if yyn1646 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntFloat32 == nil { + r.EncodeNil() + } else { + yy1647 := *x.FptrMapIntFloat32 + if false { + } else { + z.F.EncMapIntFloat32V(yy1647, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntFloat32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntFloat32`) + } + r.WriteMapElemValue() + if yyn1646 { + r.EncodeNil() + } else { + if x.FptrMapIntFloat32 == nil { + r.EncodeNil() + } else { + yy1649 := *x.FptrMapIntFloat32 + if false { + } else { + z.F.EncMapIntFloat32V(yy1649, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntFloat64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntFloat64V(x.FMapIntFloat64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntFloat64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntFloat64`) + } + r.WriteMapElemValue() + if x.FMapIntFloat64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntFloat64V(x.FMapIntFloat64, e) + } + } + } + var yyn1654 bool + if x.FptrMapIntFloat64 == nil { + yyn1654 = true + goto LABEL1654 + } + LABEL1654: + if yyr2 || yy2arr2 { + if yyn1654 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntFloat64 == nil { + r.EncodeNil() + } else { + yy1655 := *x.FptrMapIntFloat64 + if false { + } else { + z.F.EncMapIntFloat64V(yy1655, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntFloat64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntFloat64`) + } + r.WriteMapElemValue() + if yyn1654 { + r.EncodeNil() + } else { + if x.FptrMapIntFloat64 == nil { + r.EncodeNil() + } else { + yy1657 := *x.FptrMapIntFloat64 + if false { + } else { + z.F.EncMapIntFloat64V(yy1657, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntBool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntBoolV(x.FMapIntBool, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapIntBool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapIntBool`) + } + r.WriteMapElemValue() + if x.FMapIntBool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapIntBoolV(x.FMapIntBool, e) + } + } + } + var yyn1662 bool + if x.FptrMapIntBool == nil { + yyn1662 = true + goto LABEL1662 + } + LABEL1662: + if yyr2 || yy2arr2 { + if yyn1662 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapIntBool == nil { + r.EncodeNil() + } else { + yy1663 := *x.FptrMapIntBool + if false { + } else { + z.F.EncMapIntBoolV(yy1663, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapIntBool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapIntBool`) + } + r.WriteMapElemValue() + if yyn1662 { + r.EncodeNil() + } else { + if x.FptrMapIntBool == nil { + r.EncodeNil() + } else { + yy1665 := *x.FptrMapIntBool + if false { + } else { + z.F.EncMapIntBoolV(yy1665, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Intf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8IntfV(x.FMapInt8Intf, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt8Intf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt8Intf`) + } + r.WriteMapElemValue() + if x.FMapInt8Intf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8IntfV(x.FMapInt8Intf, e) + } + } + } + var yyn1670 bool + if x.FptrMapInt8Intf == nil { + yyn1670 = true + goto LABEL1670 + } + LABEL1670: + if yyr2 || yy2arr2 { + if yyn1670 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt8Intf == nil { + r.EncodeNil() + } else { + yy1671 := *x.FptrMapInt8Intf + if false { + } else { + z.F.EncMapInt8IntfV(yy1671, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt8Intf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt8Intf`) + } + r.WriteMapElemValue() + if yyn1670 { + r.EncodeNil() + } else { + if x.FptrMapInt8Intf == nil { + r.EncodeNil() + } else { + yy1673 := *x.FptrMapInt8Intf + if false { + } else { + z.F.EncMapInt8IntfV(yy1673, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8String == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8StringV(x.FMapInt8String, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt8String\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt8String`) + } + r.WriteMapElemValue() + if x.FMapInt8String == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8StringV(x.FMapInt8String, e) + } + } + } + var yyn1678 bool + if x.FptrMapInt8String == nil { + yyn1678 = true + goto LABEL1678 + } + LABEL1678: + if yyr2 || yy2arr2 { + if yyn1678 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt8String == nil { + r.EncodeNil() + } else { + yy1679 := *x.FptrMapInt8String + if false { + } else { + z.F.EncMapInt8StringV(yy1679, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt8String\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt8String`) + } + r.WriteMapElemValue() + if yyn1678 { + r.EncodeNil() + } else { + if x.FptrMapInt8String == nil { + r.EncodeNil() + } else { + yy1681 := *x.FptrMapInt8String + if false { + } else { + z.F.EncMapInt8StringV(yy1681, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Uint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8UintV(x.FMapInt8Uint, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt8Uint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt8Uint`) + } + r.WriteMapElemValue() + if x.FMapInt8Uint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8UintV(x.FMapInt8Uint, e) + } + } + } + var yyn1686 bool + if x.FptrMapInt8Uint == nil { + yyn1686 = true + goto LABEL1686 + } + LABEL1686: + if yyr2 || yy2arr2 { + if yyn1686 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt8Uint == nil { + r.EncodeNil() + } else { + yy1687 := *x.FptrMapInt8Uint + if false { + } else { + z.F.EncMapInt8UintV(yy1687, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt8Uint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt8Uint`) + } + r.WriteMapElemValue() + if yyn1686 { + r.EncodeNil() + } else { + if x.FptrMapInt8Uint == nil { + r.EncodeNil() + } else { + yy1689 := *x.FptrMapInt8Uint + if false { + } else { + z.F.EncMapInt8UintV(yy1689, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Uint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8Uint8V(x.FMapInt8Uint8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt8Uint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt8Uint8`) + } + r.WriteMapElemValue() + if x.FMapInt8Uint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8Uint8V(x.FMapInt8Uint8, e) + } + } + } + var yyn1694 bool + if x.FptrMapInt8Uint8 == nil { + yyn1694 = true + goto LABEL1694 + } + LABEL1694: + if yyr2 || yy2arr2 { + if yyn1694 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt8Uint8 == nil { + r.EncodeNil() + } else { + yy1695 := *x.FptrMapInt8Uint8 + if false { + } else { + z.F.EncMapInt8Uint8V(yy1695, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt8Uint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt8Uint8`) + } + r.WriteMapElemValue() + if yyn1694 { + r.EncodeNil() + } else { + if x.FptrMapInt8Uint8 == nil { + r.EncodeNil() + } else { + yy1697 := *x.FptrMapInt8Uint8 + if false { + } else { + z.F.EncMapInt8Uint8V(yy1697, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Uint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8Uint16V(x.FMapInt8Uint16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt8Uint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt8Uint16`) + } + r.WriteMapElemValue() + if x.FMapInt8Uint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8Uint16V(x.FMapInt8Uint16, e) + } + } + } + var yyn1702 bool + if x.FptrMapInt8Uint16 == nil { + yyn1702 = true + goto LABEL1702 + } + LABEL1702: + if yyr2 || yy2arr2 { + if yyn1702 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt8Uint16 == nil { + r.EncodeNil() + } else { + yy1703 := *x.FptrMapInt8Uint16 + if false { + } else { + z.F.EncMapInt8Uint16V(yy1703, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt8Uint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt8Uint16`) + } + r.WriteMapElemValue() + if yyn1702 { + r.EncodeNil() + } else { + if x.FptrMapInt8Uint16 == nil { + r.EncodeNil() + } else { + yy1705 := *x.FptrMapInt8Uint16 + if false { + } else { + z.F.EncMapInt8Uint16V(yy1705, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Uint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8Uint32V(x.FMapInt8Uint32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt8Uint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt8Uint32`) + } + r.WriteMapElemValue() + if x.FMapInt8Uint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8Uint32V(x.FMapInt8Uint32, e) + } + } + } + var yyn1710 bool + if x.FptrMapInt8Uint32 == nil { + yyn1710 = true + goto LABEL1710 + } + LABEL1710: + if yyr2 || yy2arr2 { + if yyn1710 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt8Uint32 == nil { + r.EncodeNil() + } else { + yy1711 := *x.FptrMapInt8Uint32 + if false { + } else { + z.F.EncMapInt8Uint32V(yy1711, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt8Uint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt8Uint32`) + } + r.WriteMapElemValue() + if yyn1710 { + r.EncodeNil() + } else { + if x.FptrMapInt8Uint32 == nil { + r.EncodeNil() + } else { + yy1713 := *x.FptrMapInt8Uint32 + if false { + } else { + z.F.EncMapInt8Uint32V(yy1713, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Uint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8Uint64V(x.FMapInt8Uint64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt8Uint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt8Uint64`) + } + r.WriteMapElemValue() + if x.FMapInt8Uint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8Uint64V(x.FMapInt8Uint64, e) + } + } + } + var yyn1718 bool + if x.FptrMapInt8Uint64 == nil { + yyn1718 = true + goto LABEL1718 + } + LABEL1718: + if yyr2 || yy2arr2 { + if yyn1718 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt8Uint64 == nil { + r.EncodeNil() + } else { + yy1719 := *x.FptrMapInt8Uint64 + if false { + } else { + z.F.EncMapInt8Uint64V(yy1719, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt8Uint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt8Uint64`) + } + r.WriteMapElemValue() + if yyn1718 { + r.EncodeNil() + } else { + if x.FptrMapInt8Uint64 == nil { + r.EncodeNil() + } else { + yy1721 := *x.FptrMapInt8Uint64 + if false { + } else { + z.F.EncMapInt8Uint64V(yy1721, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Uintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8UintptrV(x.FMapInt8Uintptr, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt8Uintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt8Uintptr`) + } + r.WriteMapElemValue() + if x.FMapInt8Uintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8UintptrV(x.FMapInt8Uintptr, e) + } + } + } + var yyn1726 bool + if x.FptrMapInt8Uintptr == nil { + yyn1726 = true + goto LABEL1726 + } + LABEL1726: + if yyr2 || yy2arr2 { + if yyn1726 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt8Uintptr == nil { + r.EncodeNil() + } else { + yy1727 := *x.FptrMapInt8Uintptr + if false { + } else { + z.F.EncMapInt8UintptrV(yy1727, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt8Uintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt8Uintptr`) + } + r.WriteMapElemValue() + if yyn1726 { + r.EncodeNil() + } else { + if x.FptrMapInt8Uintptr == nil { + r.EncodeNil() + } else { + yy1729 := *x.FptrMapInt8Uintptr + if false { + } else { + z.F.EncMapInt8UintptrV(yy1729, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Int == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8IntV(x.FMapInt8Int, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt8Int\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt8Int`) + } + r.WriteMapElemValue() + if x.FMapInt8Int == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8IntV(x.FMapInt8Int, e) + } + } + } + var yyn1734 bool + if x.FptrMapInt8Int == nil { + yyn1734 = true + goto LABEL1734 + } + LABEL1734: + if yyr2 || yy2arr2 { + if yyn1734 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt8Int == nil { + r.EncodeNil() + } else { + yy1735 := *x.FptrMapInt8Int + if false { + } else { + z.F.EncMapInt8IntV(yy1735, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt8Int\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt8Int`) + } + r.WriteMapElemValue() + if yyn1734 { + r.EncodeNil() + } else { + if x.FptrMapInt8Int == nil { + r.EncodeNil() + } else { + yy1737 := *x.FptrMapInt8Int + if false { + } else { + z.F.EncMapInt8IntV(yy1737, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Int8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8Int8V(x.FMapInt8Int8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt8Int8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt8Int8`) + } + r.WriteMapElemValue() + if x.FMapInt8Int8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8Int8V(x.FMapInt8Int8, e) + } + } + } + var yyn1742 bool + if x.FptrMapInt8Int8 == nil { + yyn1742 = true + goto LABEL1742 + } + LABEL1742: + if yyr2 || yy2arr2 { + if yyn1742 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt8Int8 == nil { + r.EncodeNil() + } else { + yy1743 := *x.FptrMapInt8Int8 + if false { + } else { + z.F.EncMapInt8Int8V(yy1743, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt8Int8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt8Int8`) + } + r.WriteMapElemValue() + if yyn1742 { + r.EncodeNil() + } else { + if x.FptrMapInt8Int8 == nil { + r.EncodeNil() + } else { + yy1745 := *x.FptrMapInt8Int8 + if false { + } else { + z.F.EncMapInt8Int8V(yy1745, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Int16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8Int16V(x.FMapInt8Int16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt8Int16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt8Int16`) + } + r.WriteMapElemValue() + if x.FMapInt8Int16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8Int16V(x.FMapInt8Int16, e) + } + } + } + var yyn1750 bool + if x.FptrMapInt8Int16 == nil { + yyn1750 = true + goto LABEL1750 + } + LABEL1750: + if yyr2 || yy2arr2 { + if yyn1750 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt8Int16 == nil { + r.EncodeNil() + } else { + yy1751 := *x.FptrMapInt8Int16 + if false { + } else { + z.F.EncMapInt8Int16V(yy1751, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt8Int16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt8Int16`) + } + r.WriteMapElemValue() + if yyn1750 { + r.EncodeNil() + } else { + if x.FptrMapInt8Int16 == nil { + r.EncodeNil() + } else { + yy1753 := *x.FptrMapInt8Int16 + if false { + } else { + z.F.EncMapInt8Int16V(yy1753, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Int32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8Int32V(x.FMapInt8Int32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt8Int32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt8Int32`) + } + r.WriteMapElemValue() + if x.FMapInt8Int32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8Int32V(x.FMapInt8Int32, e) + } + } + } + var yyn1758 bool + if x.FptrMapInt8Int32 == nil { + yyn1758 = true + goto LABEL1758 + } + LABEL1758: + if yyr2 || yy2arr2 { + if yyn1758 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt8Int32 == nil { + r.EncodeNil() + } else { + yy1759 := *x.FptrMapInt8Int32 + if false { + } else { + z.F.EncMapInt8Int32V(yy1759, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt8Int32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt8Int32`) + } + r.WriteMapElemValue() + if yyn1758 { + r.EncodeNil() + } else { + if x.FptrMapInt8Int32 == nil { + r.EncodeNil() + } else { + yy1761 := *x.FptrMapInt8Int32 + if false { + } else { + z.F.EncMapInt8Int32V(yy1761, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Int64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8Int64V(x.FMapInt8Int64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt8Int64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt8Int64`) + } + r.WriteMapElemValue() + if x.FMapInt8Int64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8Int64V(x.FMapInt8Int64, e) + } + } + } + var yyn1766 bool + if x.FptrMapInt8Int64 == nil { + yyn1766 = true + goto LABEL1766 + } + LABEL1766: + if yyr2 || yy2arr2 { + if yyn1766 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt8Int64 == nil { + r.EncodeNil() + } else { + yy1767 := *x.FptrMapInt8Int64 + if false { + } else { + z.F.EncMapInt8Int64V(yy1767, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt8Int64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt8Int64`) + } + r.WriteMapElemValue() + if yyn1766 { + r.EncodeNil() + } else { + if x.FptrMapInt8Int64 == nil { + r.EncodeNil() + } else { + yy1769 := *x.FptrMapInt8Int64 + if false { + } else { + z.F.EncMapInt8Int64V(yy1769, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Float32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8Float32V(x.FMapInt8Float32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt8Float32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt8Float32`) + } + r.WriteMapElemValue() + if x.FMapInt8Float32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8Float32V(x.FMapInt8Float32, e) + } + } + } + var yyn1774 bool + if x.FptrMapInt8Float32 == nil { + yyn1774 = true + goto LABEL1774 + } + LABEL1774: + if yyr2 || yy2arr2 { + if yyn1774 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt8Float32 == nil { + r.EncodeNil() + } else { + yy1775 := *x.FptrMapInt8Float32 + if false { + } else { + z.F.EncMapInt8Float32V(yy1775, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt8Float32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt8Float32`) + } + r.WriteMapElemValue() + if yyn1774 { + r.EncodeNil() + } else { + if x.FptrMapInt8Float32 == nil { + r.EncodeNil() + } else { + yy1777 := *x.FptrMapInt8Float32 + if false { + } else { + z.F.EncMapInt8Float32V(yy1777, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Float64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8Float64V(x.FMapInt8Float64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt8Float64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt8Float64`) + } + r.WriteMapElemValue() + if x.FMapInt8Float64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8Float64V(x.FMapInt8Float64, e) + } + } + } + var yyn1782 bool + if x.FptrMapInt8Float64 == nil { + yyn1782 = true + goto LABEL1782 + } + LABEL1782: + if yyr2 || yy2arr2 { + if yyn1782 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt8Float64 == nil { + r.EncodeNil() + } else { + yy1783 := *x.FptrMapInt8Float64 + if false { + } else { + z.F.EncMapInt8Float64V(yy1783, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt8Float64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt8Float64`) + } + r.WriteMapElemValue() + if yyn1782 { + r.EncodeNil() + } else { + if x.FptrMapInt8Float64 == nil { + r.EncodeNil() + } else { + yy1785 := *x.FptrMapInt8Float64 + if false { + } else { + z.F.EncMapInt8Float64V(yy1785, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Bool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8BoolV(x.FMapInt8Bool, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt8Bool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt8Bool`) + } + r.WriteMapElemValue() + if x.FMapInt8Bool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt8BoolV(x.FMapInt8Bool, e) + } + } + } + var yyn1790 bool + if x.FptrMapInt8Bool == nil { + yyn1790 = true + goto LABEL1790 + } + LABEL1790: + if yyr2 || yy2arr2 { + if yyn1790 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt8Bool == nil { + r.EncodeNil() + } else { + yy1791 := *x.FptrMapInt8Bool + if false { + } else { + z.F.EncMapInt8BoolV(yy1791, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt8Bool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt8Bool`) + } + r.WriteMapElemValue() + if yyn1790 { + r.EncodeNil() + } else { + if x.FptrMapInt8Bool == nil { + r.EncodeNil() + } else { + yy1793 := *x.FptrMapInt8Bool + if false { + } else { + z.F.EncMapInt8BoolV(yy1793, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Intf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16IntfV(x.FMapInt16Intf, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt16Intf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt16Intf`) + } + r.WriteMapElemValue() + if x.FMapInt16Intf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16IntfV(x.FMapInt16Intf, e) + } + } + } + var yyn1798 bool + if x.FptrMapInt16Intf == nil { + yyn1798 = true + goto LABEL1798 + } + LABEL1798: + if yyr2 || yy2arr2 { + if yyn1798 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt16Intf == nil { + r.EncodeNil() + } else { + yy1799 := *x.FptrMapInt16Intf + if false { + } else { + z.F.EncMapInt16IntfV(yy1799, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt16Intf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt16Intf`) + } + r.WriteMapElemValue() + if yyn1798 { + r.EncodeNil() + } else { + if x.FptrMapInt16Intf == nil { + r.EncodeNil() + } else { + yy1801 := *x.FptrMapInt16Intf + if false { + } else { + z.F.EncMapInt16IntfV(yy1801, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16String == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16StringV(x.FMapInt16String, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt16String\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt16String`) + } + r.WriteMapElemValue() + if x.FMapInt16String == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16StringV(x.FMapInt16String, e) + } + } + } + var yyn1806 bool + if x.FptrMapInt16String == nil { + yyn1806 = true + goto LABEL1806 + } + LABEL1806: + if yyr2 || yy2arr2 { + if yyn1806 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt16String == nil { + r.EncodeNil() + } else { + yy1807 := *x.FptrMapInt16String + if false { + } else { + z.F.EncMapInt16StringV(yy1807, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt16String\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt16String`) + } + r.WriteMapElemValue() + if yyn1806 { + r.EncodeNil() + } else { + if x.FptrMapInt16String == nil { + r.EncodeNil() + } else { + yy1809 := *x.FptrMapInt16String + if false { + } else { + z.F.EncMapInt16StringV(yy1809, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Uint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16UintV(x.FMapInt16Uint, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt16Uint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt16Uint`) + } + r.WriteMapElemValue() + if x.FMapInt16Uint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16UintV(x.FMapInt16Uint, e) + } + } + } + var yyn1814 bool + if x.FptrMapInt16Uint == nil { + yyn1814 = true + goto LABEL1814 + } + LABEL1814: + if yyr2 || yy2arr2 { + if yyn1814 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt16Uint == nil { + r.EncodeNil() + } else { + yy1815 := *x.FptrMapInt16Uint + if false { + } else { + z.F.EncMapInt16UintV(yy1815, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt16Uint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt16Uint`) + } + r.WriteMapElemValue() + if yyn1814 { + r.EncodeNil() + } else { + if x.FptrMapInt16Uint == nil { + r.EncodeNil() + } else { + yy1817 := *x.FptrMapInt16Uint + if false { + } else { + z.F.EncMapInt16UintV(yy1817, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Uint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16Uint8V(x.FMapInt16Uint8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt16Uint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt16Uint8`) + } + r.WriteMapElemValue() + if x.FMapInt16Uint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16Uint8V(x.FMapInt16Uint8, e) + } + } + } + var yyn1822 bool + if x.FptrMapInt16Uint8 == nil { + yyn1822 = true + goto LABEL1822 + } + LABEL1822: + if yyr2 || yy2arr2 { + if yyn1822 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt16Uint8 == nil { + r.EncodeNil() + } else { + yy1823 := *x.FptrMapInt16Uint8 + if false { + } else { + z.F.EncMapInt16Uint8V(yy1823, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt16Uint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt16Uint8`) + } + r.WriteMapElemValue() + if yyn1822 { + r.EncodeNil() + } else { + if x.FptrMapInt16Uint8 == nil { + r.EncodeNil() + } else { + yy1825 := *x.FptrMapInt16Uint8 + if false { + } else { + z.F.EncMapInt16Uint8V(yy1825, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Uint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16Uint16V(x.FMapInt16Uint16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt16Uint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt16Uint16`) + } + r.WriteMapElemValue() + if x.FMapInt16Uint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16Uint16V(x.FMapInt16Uint16, e) + } + } + } + var yyn1830 bool + if x.FptrMapInt16Uint16 == nil { + yyn1830 = true + goto LABEL1830 + } + LABEL1830: + if yyr2 || yy2arr2 { + if yyn1830 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt16Uint16 == nil { + r.EncodeNil() + } else { + yy1831 := *x.FptrMapInt16Uint16 + if false { + } else { + z.F.EncMapInt16Uint16V(yy1831, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt16Uint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt16Uint16`) + } + r.WriteMapElemValue() + if yyn1830 { + r.EncodeNil() + } else { + if x.FptrMapInt16Uint16 == nil { + r.EncodeNil() + } else { + yy1833 := *x.FptrMapInt16Uint16 + if false { + } else { + z.F.EncMapInt16Uint16V(yy1833, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Uint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16Uint32V(x.FMapInt16Uint32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt16Uint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt16Uint32`) + } + r.WriteMapElemValue() + if x.FMapInt16Uint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16Uint32V(x.FMapInt16Uint32, e) + } + } + } + var yyn1838 bool + if x.FptrMapInt16Uint32 == nil { + yyn1838 = true + goto LABEL1838 + } + LABEL1838: + if yyr2 || yy2arr2 { + if yyn1838 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt16Uint32 == nil { + r.EncodeNil() + } else { + yy1839 := *x.FptrMapInt16Uint32 + if false { + } else { + z.F.EncMapInt16Uint32V(yy1839, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt16Uint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt16Uint32`) + } + r.WriteMapElemValue() + if yyn1838 { + r.EncodeNil() + } else { + if x.FptrMapInt16Uint32 == nil { + r.EncodeNil() + } else { + yy1841 := *x.FptrMapInt16Uint32 + if false { + } else { + z.F.EncMapInt16Uint32V(yy1841, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Uint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16Uint64V(x.FMapInt16Uint64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt16Uint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt16Uint64`) + } + r.WriteMapElemValue() + if x.FMapInt16Uint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16Uint64V(x.FMapInt16Uint64, e) + } + } + } + var yyn1846 bool + if x.FptrMapInt16Uint64 == nil { + yyn1846 = true + goto LABEL1846 + } + LABEL1846: + if yyr2 || yy2arr2 { + if yyn1846 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt16Uint64 == nil { + r.EncodeNil() + } else { + yy1847 := *x.FptrMapInt16Uint64 + if false { + } else { + z.F.EncMapInt16Uint64V(yy1847, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt16Uint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt16Uint64`) + } + r.WriteMapElemValue() + if yyn1846 { + r.EncodeNil() + } else { + if x.FptrMapInt16Uint64 == nil { + r.EncodeNil() + } else { + yy1849 := *x.FptrMapInt16Uint64 + if false { + } else { + z.F.EncMapInt16Uint64V(yy1849, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Uintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16UintptrV(x.FMapInt16Uintptr, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt16Uintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt16Uintptr`) + } + r.WriteMapElemValue() + if x.FMapInt16Uintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16UintptrV(x.FMapInt16Uintptr, e) + } + } + } + var yyn1854 bool + if x.FptrMapInt16Uintptr == nil { + yyn1854 = true + goto LABEL1854 + } + LABEL1854: + if yyr2 || yy2arr2 { + if yyn1854 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt16Uintptr == nil { + r.EncodeNil() + } else { + yy1855 := *x.FptrMapInt16Uintptr + if false { + } else { + z.F.EncMapInt16UintptrV(yy1855, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt16Uintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt16Uintptr`) + } + r.WriteMapElemValue() + if yyn1854 { + r.EncodeNil() + } else { + if x.FptrMapInt16Uintptr == nil { + r.EncodeNil() + } else { + yy1857 := *x.FptrMapInt16Uintptr + if false { + } else { + z.F.EncMapInt16UintptrV(yy1857, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Int == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16IntV(x.FMapInt16Int, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt16Int\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt16Int`) + } + r.WriteMapElemValue() + if x.FMapInt16Int == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16IntV(x.FMapInt16Int, e) + } + } + } + var yyn1862 bool + if x.FptrMapInt16Int == nil { + yyn1862 = true + goto LABEL1862 + } + LABEL1862: + if yyr2 || yy2arr2 { + if yyn1862 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt16Int == nil { + r.EncodeNil() + } else { + yy1863 := *x.FptrMapInt16Int + if false { + } else { + z.F.EncMapInt16IntV(yy1863, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt16Int\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt16Int`) + } + r.WriteMapElemValue() + if yyn1862 { + r.EncodeNil() + } else { + if x.FptrMapInt16Int == nil { + r.EncodeNil() + } else { + yy1865 := *x.FptrMapInt16Int + if false { + } else { + z.F.EncMapInt16IntV(yy1865, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Int8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16Int8V(x.FMapInt16Int8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt16Int8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt16Int8`) + } + r.WriteMapElemValue() + if x.FMapInt16Int8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16Int8V(x.FMapInt16Int8, e) + } + } + } + var yyn1870 bool + if x.FptrMapInt16Int8 == nil { + yyn1870 = true + goto LABEL1870 + } + LABEL1870: + if yyr2 || yy2arr2 { + if yyn1870 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt16Int8 == nil { + r.EncodeNil() + } else { + yy1871 := *x.FptrMapInt16Int8 + if false { + } else { + z.F.EncMapInt16Int8V(yy1871, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt16Int8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt16Int8`) + } + r.WriteMapElemValue() + if yyn1870 { + r.EncodeNil() + } else { + if x.FptrMapInt16Int8 == nil { + r.EncodeNil() + } else { + yy1873 := *x.FptrMapInt16Int8 + if false { + } else { + z.F.EncMapInt16Int8V(yy1873, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Int16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16Int16V(x.FMapInt16Int16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt16Int16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt16Int16`) + } + r.WriteMapElemValue() + if x.FMapInt16Int16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16Int16V(x.FMapInt16Int16, e) + } + } + } + var yyn1878 bool + if x.FptrMapInt16Int16 == nil { + yyn1878 = true + goto LABEL1878 + } + LABEL1878: + if yyr2 || yy2arr2 { + if yyn1878 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt16Int16 == nil { + r.EncodeNil() + } else { + yy1879 := *x.FptrMapInt16Int16 + if false { + } else { + z.F.EncMapInt16Int16V(yy1879, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt16Int16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt16Int16`) + } + r.WriteMapElemValue() + if yyn1878 { + r.EncodeNil() + } else { + if x.FptrMapInt16Int16 == nil { + r.EncodeNil() + } else { + yy1881 := *x.FptrMapInt16Int16 + if false { + } else { + z.F.EncMapInt16Int16V(yy1881, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Int32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16Int32V(x.FMapInt16Int32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt16Int32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt16Int32`) + } + r.WriteMapElemValue() + if x.FMapInt16Int32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16Int32V(x.FMapInt16Int32, e) + } + } + } + var yyn1886 bool + if x.FptrMapInt16Int32 == nil { + yyn1886 = true + goto LABEL1886 + } + LABEL1886: + if yyr2 || yy2arr2 { + if yyn1886 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt16Int32 == nil { + r.EncodeNil() + } else { + yy1887 := *x.FptrMapInt16Int32 + if false { + } else { + z.F.EncMapInt16Int32V(yy1887, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt16Int32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt16Int32`) + } + r.WriteMapElemValue() + if yyn1886 { + r.EncodeNil() + } else { + if x.FptrMapInt16Int32 == nil { + r.EncodeNil() + } else { + yy1889 := *x.FptrMapInt16Int32 + if false { + } else { + z.F.EncMapInt16Int32V(yy1889, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Int64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16Int64V(x.FMapInt16Int64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt16Int64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt16Int64`) + } + r.WriteMapElemValue() + if x.FMapInt16Int64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16Int64V(x.FMapInt16Int64, e) + } + } + } + var yyn1894 bool + if x.FptrMapInt16Int64 == nil { + yyn1894 = true + goto LABEL1894 + } + LABEL1894: + if yyr2 || yy2arr2 { + if yyn1894 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt16Int64 == nil { + r.EncodeNil() + } else { + yy1895 := *x.FptrMapInt16Int64 + if false { + } else { + z.F.EncMapInt16Int64V(yy1895, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt16Int64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt16Int64`) + } + r.WriteMapElemValue() + if yyn1894 { + r.EncodeNil() + } else { + if x.FptrMapInt16Int64 == nil { + r.EncodeNil() + } else { + yy1897 := *x.FptrMapInt16Int64 + if false { + } else { + z.F.EncMapInt16Int64V(yy1897, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Float32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16Float32V(x.FMapInt16Float32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt16Float32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt16Float32`) + } + r.WriteMapElemValue() + if x.FMapInt16Float32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16Float32V(x.FMapInt16Float32, e) + } + } + } + var yyn1902 bool + if x.FptrMapInt16Float32 == nil { + yyn1902 = true + goto LABEL1902 + } + LABEL1902: + if yyr2 || yy2arr2 { + if yyn1902 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt16Float32 == nil { + r.EncodeNil() + } else { + yy1903 := *x.FptrMapInt16Float32 + if false { + } else { + z.F.EncMapInt16Float32V(yy1903, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt16Float32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt16Float32`) + } + r.WriteMapElemValue() + if yyn1902 { + r.EncodeNil() + } else { + if x.FptrMapInt16Float32 == nil { + r.EncodeNil() + } else { + yy1905 := *x.FptrMapInt16Float32 + if false { + } else { + z.F.EncMapInt16Float32V(yy1905, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Float64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16Float64V(x.FMapInt16Float64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt16Float64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt16Float64`) + } + r.WriteMapElemValue() + if x.FMapInt16Float64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16Float64V(x.FMapInt16Float64, e) + } + } + } + var yyn1910 bool + if x.FptrMapInt16Float64 == nil { + yyn1910 = true + goto LABEL1910 + } + LABEL1910: + if yyr2 || yy2arr2 { + if yyn1910 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt16Float64 == nil { + r.EncodeNil() + } else { + yy1911 := *x.FptrMapInt16Float64 + if false { + } else { + z.F.EncMapInt16Float64V(yy1911, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt16Float64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt16Float64`) + } + r.WriteMapElemValue() + if yyn1910 { + r.EncodeNil() + } else { + if x.FptrMapInt16Float64 == nil { + r.EncodeNil() + } else { + yy1913 := *x.FptrMapInt16Float64 + if false { + } else { + z.F.EncMapInt16Float64V(yy1913, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Bool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16BoolV(x.FMapInt16Bool, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt16Bool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt16Bool`) + } + r.WriteMapElemValue() + if x.FMapInt16Bool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt16BoolV(x.FMapInt16Bool, e) + } + } + } + var yyn1918 bool + if x.FptrMapInt16Bool == nil { + yyn1918 = true + goto LABEL1918 + } + LABEL1918: + if yyr2 || yy2arr2 { + if yyn1918 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt16Bool == nil { + r.EncodeNil() + } else { + yy1919 := *x.FptrMapInt16Bool + if false { + } else { + z.F.EncMapInt16BoolV(yy1919, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt16Bool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt16Bool`) + } + r.WriteMapElemValue() + if yyn1918 { + r.EncodeNil() + } else { + if x.FptrMapInt16Bool == nil { + r.EncodeNil() + } else { + yy1921 := *x.FptrMapInt16Bool + if false { + } else { + z.F.EncMapInt16BoolV(yy1921, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Intf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32IntfV(x.FMapInt32Intf, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt32Intf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt32Intf`) + } + r.WriteMapElemValue() + if x.FMapInt32Intf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32IntfV(x.FMapInt32Intf, e) + } + } + } + var yyn1926 bool + if x.FptrMapInt32Intf == nil { + yyn1926 = true + goto LABEL1926 + } + LABEL1926: + if yyr2 || yy2arr2 { + if yyn1926 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt32Intf == nil { + r.EncodeNil() + } else { + yy1927 := *x.FptrMapInt32Intf + if false { + } else { + z.F.EncMapInt32IntfV(yy1927, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt32Intf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt32Intf`) + } + r.WriteMapElemValue() + if yyn1926 { + r.EncodeNil() + } else { + if x.FptrMapInt32Intf == nil { + r.EncodeNil() + } else { + yy1929 := *x.FptrMapInt32Intf + if false { + } else { + z.F.EncMapInt32IntfV(yy1929, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32String == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32StringV(x.FMapInt32String, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt32String\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt32String`) + } + r.WriteMapElemValue() + if x.FMapInt32String == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32StringV(x.FMapInt32String, e) + } + } + } + var yyn1934 bool + if x.FptrMapInt32String == nil { + yyn1934 = true + goto LABEL1934 + } + LABEL1934: + if yyr2 || yy2arr2 { + if yyn1934 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt32String == nil { + r.EncodeNil() + } else { + yy1935 := *x.FptrMapInt32String + if false { + } else { + z.F.EncMapInt32StringV(yy1935, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt32String\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt32String`) + } + r.WriteMapElemValue() + if yyn1934 { + r.EncodeNil() + } else { + if x.FptrMapInt32String == nil { + r.EncodeNil() + } else { + yy1937 := *x.FptrMapInt32String + if false { + } else { + z.F.EncMapInt32StringV(yy1937, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Uint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32UintV(x.FMapInt32Uint, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt32Uint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt32Uint`) + } + r.WriteMapElemValue() + if x.FMapInt32Uint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32UintV(x.FMapInt32Uint, e) + } + } + } + var yyn1942 bool + if x.FptrMapInt32Uint == nil { + yyn1942 = true + goto LABEL1942 + } + LABEL1942: + if yyr2 || yy2arr2 { + if yyn1942 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt32Uint == nil { + r.EncodeNil() + } else { + yy1943 := *x.FptrMapInt32Uint + if false { + } else { + z.F.EncMapInt32UintV(yy1943, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt32Uint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt32Uint`) + } + r.WriteMapElemValue() + if yyn1942 { + r.EncodeNil() + } else { + if x.FptrMapInt32Uint == nil { + r.EncodeNil() + } else { + yy1945 := *x.FptrMapInt32Uint + if false { + } else { + z.F.EncMapInt32UintV(yy1945, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Uint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32Uint8V(x.FMapInt32Uint8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt32Uint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt32Uint8`) + } + r.WriteMapElemValue() + if x.FMapInt32Uint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32Uint8V(x.FMapInt32Uint8, e) + } + } + } + var yyn1950 bool + if x.FptrMapInt32Uint8 == nil { + yyn1950 = true + goto LABEL1950 + } + LABEL1950: + if yyr2 || yy2arr2 { + if yyn1950 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt32Uint8 == nil { + r.EncodeNil() + } else { + yy1951 := *x.FptrMapInt32Uint8 + if false { + } else { + z.F.EncMapInt32Uint8V(yy1951, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt32Uint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt32Uint8`) + } + r.WriteMapElemValue() + if yyn1950 { + r.EncodeNil() + } else { + if x.FptrMapInt32Uint8 == nil { + r.EncodeNil() + } else { + yy1953 := *x.FptrMapInt32Uint8 + if false { + } else { + z.F.EncMapInt32Uint8V(yy1953, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Uint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32Uint16V(x.FMapInt32Uint16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt32Uint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt32Uint16`) + } + r.WriteMapElemValue() + if x.FMapInt32Uint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32Uint16V(x.FMapInt32Uint16, e) + } + } + } + var yyn1958 bool + if x.FptrMapInt32Uint16 == nil { + yyn1958 = true + goto LABEL1958 + } + LABEL1958: + if yyr2 || yy2arr2 { + if yyn1958 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt32Uint16 == nil { + r.EncodeNil() + } else { + yy1959 := *x.FptrMapInt32Uint16 + if false { + } else { + z.F.EncMapInt32Uint16V(yy1959, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt32Uint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt32Uint16`) + } + r.WriteMapElemValue() + if yyn1958 { + r.EncodeNil() + } else { + if x.FptrMapInt32Uint16 == nil { + r.EncodeNil() + } else { + yy1961 := *x.FptrMapInt32Uint16 + if false { + } else { + z.F.EncMapInt32Uint16V(yy1961, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Uint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32Uint32V(x.FMapInt32Uint32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt32Uint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt32Uint32`) + } + r.WriteMapElemValue() + if x.FMapInt32Uint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32Uint32V(x.FMapInt32Uint32, e) + } + } + } + var yyn1966 bool + if x.FptrMapInt32Uint32 == nil { + yyn1966 = true + goto LABEL1966 + } + LABEL1966: + if yyr2 || yy2arr2 { + if yyn1966 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt32Uint32 == nil { + r.EncodeNil() + } else { + yy1967 := *x.FptrMapInt32Uint32 + if false { + } else { + z.F.EncMapInt32Uint32V(yy1967, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt32Uint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt32Uint32`) + } + r.WriteMapElemValue() + if yyn1966 { + r.EncodeNil() + } else { + if x.FptrMapInt32Uint32 == nil { + r.EncodeNil() + } else { + yy1969 := *x.FptrMapInt32Uint32 + if false { + } else { + z.F.EncMapInt32Uint32V(yy1969, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Uint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32Uint64V(x.FMapInt32Uint64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt32Uint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt32Uint64`) + } + r.WriteMapElemValue() + if x.FMapInt32Uint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32Uint64V(x.FMapInt32Uint64, e) + } + } + } + var yyn1974 bool + if x.FptrMapInt32Uint64 == nil { + yyn1974 = true + goto LABEL1974 + } + LABEL1974: + if yyr2 || yy2arr2 { + if yyn1974 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt32Uint64 == nil { + r.EncodeNil() + } else { + yy1975 := *x.FptrMapInt32Uint64 + if false { + } else { + z.F.EncMapInt32Uint64V(yy1975, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt32Uint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt32Uint64`) + } + r.WriteMapElemValue() + if yyn1974 { + r.EncodeNil() + } else { + if x.FptrMapInt32Uint64 == nil { + r.EncodeNil() + } else { + yy1977 := *x.FptrMapInt32Uint64 + if false { + } else { + z.F.EncMapInt32Uint64V(yy1977, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Uintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32UintptrV(x.FMapInt32Uintptr, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt32Uintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt32Uintptr`) + } + r.WriteMapElemValue() + if x.FMapInt32Uintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32UintptrV(x.FMapInt32Uintptr, e) + } + } + } + var yyn1982 bool + if x.FptrMapInt32Uintptr == nil { + yyn1982 = true + goto LABEL1982 + } + LABEL1982: + if yyr2 || yy2arr2 { + if yyn1982 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt32Uintptr == nil { + r.EncodeNil() + } else { + yy1983 := *x.FptrMapInt32Uintptr + if false { + } else { + z.F.EncMapInt32UintptrV(yy1983, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt32Uintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt32Uintptr`) + } + r.WriteMapElemValue() + if yyn1982 { + r.EncodeNil() + } else { + if x.FptrMapInt32Uintptr == nil { + r.EncodeNil() + } else { + yy1985 := *x.FptrMapInt32Uintptr + if false { + } else { + z.F.EncMapInt32UintptrV(yy1985, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Int == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32IntV(x.FMapInt32Int, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt32Int\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt32Int`) + } + r.WriteMapElemValue() + if x.FMapInt32Int == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32IntV(x.FMapInt32Int, e) + } + } + } + var yyn1990 bool + if x.FptrMapInt32Int == nil { + yyn1990 = true + goto LABEL1990 + } + LABEL1990: + if yyr2 || yy2arr2 { + if yyn1990 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt32Int == nil { + r.EncodeNil() + } else { + yy1991 := *x.FptrMapInt32Int + if false { + } else { + z.F.EncMapInt32IntV(yy1991, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt32Int\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt32Int`) + } + r.WriteMapElemValue() + if yyn1990 { + r.EncodeNil() + } else { + if x.FptrMapInt32Int == nil { + r.EncodeNil() + } else { + yy1993 := *x.FptrMapInt32Int + if false { + } else { + z.F.EncMapInt32IntV(yy1993, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Int8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32Int8V(x.FMapInt32Int8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt32Int8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt32Int8`) + } + r.WriteMapElemValue() + if x.FMapInt32Int8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32Int8V(x.FMapInt32Int8, e) + } + } + } + var yyn1998 bool + if x.FptrMapInt32Int8 == nil { + yyn1998 = true + goto LABEL1998 + } + LABEL1998: + if yyr2 || yy2arr2 { + if yyn1998 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt32Int8 == nil { + r.EncodeNil() + } else { + yy1999 := *x.FptrMapInt32Int8 + if false { + } else { + z.F.EncMapInt32Int8V(yy1999, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt32Int8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt32Int8`) + } + r.WriteMapElemValue() + if yyn1998 { + r.EncodeNil() + } else { + if x.FptrMapInt32Int8 == nil { + r.EncodeNil() + } else { + yy2001 := *x.FptrMapInt32Int8 + if false { + } else { + z.F.EncMapInt32Int8V(yy2001, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Int16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32Int16V(x.FMapInt32Int16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt32Int16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt32Int16`) + } + r.WriteMapElemValue() + if x.FMapInt32Int16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32Int16V(x.FMapInt32Int16, e) + } + } + } + var yyn2006 bool + if x.FptrMapInt32Int16 == nil { + yyn2006 = true + goto LABEL2006 + } + LABEL2006: + if yyr2 || yy2arr2 { + if yyn2006 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt32Int16 == nil { + r.EncodeNil() + } else { + yy2007 := *x.FptrMapInt32Int16 + if false { + } else { + z.F.EncMapInt32Int16V(yy2007, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt32Int16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt32Int16`) + } + r.WriteMapElemValue() + if yyn2006 { + r.EncodeNil() + } else { + if x.FptrMapInt32Int16 == nil { + r.EncodeNil() + } else { + yy2009 := *x.FptrMapInt32Int16 + if false { + } else { + z.F.EncMapInt32Int16V(yy2009, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Int32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32Int32V(x.FMapInt32Int32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt32Int32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt32Int32`) + } + r.WriteMapElemValue() + if x.FMapInt32Int32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32Int32V(x.FMapInt32Int32, e) + } + } + } + var yyn2014 bool + if x.FptrMapInt32Int32 == nil { + yyn2014 = true + goto LABEL2014 + } + LABEL2014: + if yyr2 || yy2arr2 { + if yyn2014 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt32Int32 == nil { + r.EncodeNil() + } else { + yy2015 := *x.FptrMapInt32Int32 + if false { + } else { + z.F.EncMapInt32Int32V(yy2015, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt32Int32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt32Int32`) + } + r.WriteMapElemValue() + if yyn2014 { + r.EncodeNil() + } else { + if x.FptrMapInt32Int32 == nil { + r.EncodeNil() + } else { + yy2017 := *x.FptrMapInt32Int32 + if false { + } else { + z.F.EncMapInt32Int32V(yy2017, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Int64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32Int64V(x.FMapInt32Int64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt32Int64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt32Int64`) + } + r.WriteMapElemValue() + if x.FMapInt32Int64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32Int64V(x.FMapInt32Int64, e) + } + } + } + var yyn2022 bool + if x.FptrMapInt32Int64 == nil { + yyn2022 = true + goto LABEL2022 + } + LABEL2022: + if yyr2 || yy2arr2 { + if yyn2022 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt32Int64 == nil { + r.EncodeNil() + } else { + yy2023 := *x.FptrMapInt32Int64 + if false { + } else { + z.F.EncMapInt32Int64V(yy2023, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt32Int64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt32Int64`) + } + r.WriteMapElemValue() + if yyn2022 { + r.EncodeNil() + } else { + if x.FptrMapInt32Int64 == nil { + r.EncodeNil() + } else { + yy2025 := *x.FptrMapInt32Int64 + if false { + } else { + z.F.EncMapInt32Int64V(yy2025, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Float32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32Float32V(x.FMapInt32Float32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt32Float32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt32Float32`) + } + r.WriteMapElemValue() + if x.FMapInt32Float32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32Float32V(x.FMapInt32Float32, e) + } + } + } + var yyn2030 bool + if x.FptrMapInt32Float32 == nil { + yyn2030 = true + goto LABEL2030 + } + LABEL2030: + if yyr2 || yy2arr2 { + if yyn2030 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt32Float32 == nil { + r.EncodeNil() + } else { + yy2031 := *x.FptrMapInt32Float32 + if false { + } else { + z.F.EncMapInt32Float32V(yy2031, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt32Float32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt32Float32`) + } + r.WriteMapElemValue() + if yyn2030 { + r.EncodeNil() + } else { + if x.FptrMapInt32Float32 == nil { + r.EncodeNil() + } else { + yy2033 := *x.FptrMapInt32Float32 + if false { + } else { + z.F.EncMapInt32Float32V(yy2033, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Float64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32Float64V(x.FMapInt32Float64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt32Float64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt32Float64`) + } + r.WriteMapElemValue() + if x.FMapInt32Float64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32Float64V(x.FMapInt32Float64, e) + } + } + } + var yyn2038 bool + if x.FptrMapInt32Float64 == nil { + yyn2038 = true + goto LABEL2038 + } + LABEL2038: + if yyr2 || yy2arr2 { + if yyn2038 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt32Float64 == nil { + r.EncodeNil() + } else { + yy2039 := *x.FptrMapInt32Float64 + if false { + } else { + z.F.EncMapInt32Float64V(yy2039, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt32Float64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt32Float64`) + } + r.WriteMapElemValue() + if yyn2038 { + r.EncodeNil() + } else { + if x.FptrMapInt32Float64 == nil { + r.EncodeNil() + } else { + yy2041 := *x.FptrMapInt32Float64 + if false { + } else { + z.F.EncMapInt32Float64V(yy2041, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Bool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32BoolV(x.FMapInt32Bool, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt32Bool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt32Bool`) + } + r.WriteMapElemValue() + if x.FMapInt32Bool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt32BoolV(x.FMapInt32Bool, e) + } + } + } + var yyn2046 bool + if x.FptrMapInt32Bool == nil { + yyn2046 = true + goto LABEL2046 + } + LABEL2046: + if yyr2 || yy2arr2 { + if yyn2046 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt32Bool == nil { + r.EncodeNil() + } else { + yy2047 := *x.FptrMapInt32Bool + if false { + } else { + z.F.EncMapInt32BoolV(yy2047, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt32Bool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt32Bool`) + } + r.WriteMapElemValue() + if yyn2046 { + r.EncodeNil() + } else { + if x.FptrMapInt32Bool == nil { + r.EncodeNil() + } else { + yy2049 := *x.FptrMapInt32Bool + if false { + } else { + z.F.EncMapInt32BoolV(yy2049, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Intf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64IntfV(x.FMapInt64Intf, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt64Intf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt64Intf`) + } + r.WriteMapElemValue() + if x.FMapInt64Intf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64IntfV(x.FMapInt64Intf, e) + } + } + } + var yyn2054 bool + if x.FptrMapInt64Intf == nil { + yyn2054 = true + goto LABEL2054 + } + LABEL2054: + if yyr2 || yy2arr2 { + if yyn2054 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt64Intf == nil { + r.EncodeNil() + } else { + yy2055 := *x.FptrMapInt64Intf + if false { + } else { + z.F.EncMapInt64IntfV(yy2055, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt64Intf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt64Intf`) + } + r.WriteMapElemValue() + if yyn2054 { + r.EncodeNil() + } else { + if x.FptrMapInt64Intf == nil { + r.EncodeNil() + } else { + yy2057 := *x.FptrMapInt64Intf + if false { + } else { + z.F.EncMapInt64IntfV(yy2057, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64String == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64StringV(x.FMapInt64String, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt64String\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt64String`) + } + r.WriteMapElemValue() + if x.FMapInt64String == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64StringV(x.FMapInt64String, e) + } + } + } + var yyn2062 bool + if x.FptrMapInt64String == nil { + yyn2062 = true + goto LABEL2062 + } + LABEL2062: + if yyr2 || yy2arr2 { + if yyn2062 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt64String == nil { + r.EncodeNil() + } else { + yy2063 := *x.FptrMapInt64String + if false { + } else { + z.F.EncMapInt64StringV(yy2063, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt64String\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt64String`) + } + r.WriteMapElemValue() + if yyn2062 { + r.EncodeNil() + } else { + if x.FptrMapInt64String == nil { + r.EncodeNil() + } else { + yy2065 := *x.FptrMapInt64String + if false { + } else { + z.F.EncMapInt64StringV(yy2065, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Uint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64UintV(x.FMapInt64Uint, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt64Uint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt64Uint`) + } + r.WriteMapElemValue() + if x.FMapInt64Uint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64UintV(x.FMapInt64Uint, e) + } + } + } + var yyn2070 bool + if x.FptrMapInt64Uint == nil { + yyn2070 = true + goto LABEL2070 + } + LABEL2070: + if yyr2 || yy2arr2 { + if yyn2070 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt64Uint == nil { + r.EncodeNil() + } else { + yy2071 := *x.FptrMapInt64Uint + if false { + } else { + z.F.EncMapInt64UintV(yy2071, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt64Uint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt64Uint`) + } + r.WriteMapElemValue() + if yyn2070 { + r.EncodeNil() + } else { + if x.FptrMapInt64Uint == nil { + r.EncodeNil() + } else { + yy2073 := *x.FptrMapInt64Uint + if false { + } else { + z.F.EncMapInt64UintV(yy2073, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Uint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64Uint8V(x.FMapInt64Uint8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt64Uint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt64Uint8`) + } + r.WriteMapElemValue() + if x.FMapInt64Uint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64Uint8V(x.FMapInt64Uint8, e) + } + } + } + var yyn2078 bool + if x.FptrMapInt64Uint8 == nil { + yyn2078 = true + goto LABEL2078 + } + LABEL2078: + if yyr2 || yy2arr2 { + if yyn2078 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt64Uint8 == nil { + r.EncodeNil() + } else { + yy2079 := *x.FptrMapInt64Uint8 + if false { + } else { + z.F.EncMapInt64Uint8V(yy2079, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt64Uint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt64Uint8`) + } + r.WriteMapElemValue() + if yyn2078 { + r.EncodeNil() + } else { + if x.FptrMapInt64Uint8 == nil { + r.EncodeNil() + } else { + yy2081 := *x.FptrMapInt64Uint8 + if false { + } else { + z.F.EncMapInt64Uint8V(yy2081, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Uint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64Uint16V(x.FMapInt64Uint16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt64Uint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt64Uint16`) + } + r.WriteMapElemValue() + if x.FMapInt64Uint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64Uint16V(x.FMapInt64Uint16, e) + } + } + } + var yyn2086 bool + if x.FptrMapInt64Uint16 == nil { + yyn2086 = true + goto LABEL2086 + } + LABEL2086: + if yyr2 || yy2arr2 { + if yyn2086 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt64Uint16 == nil { + r.EncodeNil() + } else { + yy2087 := *x.FptrMapInt64Uint16 + if false { + } else { + z.F.EncMapInt64Uint16V(yy2087, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt64Uint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt64Uint16`) + } + r.WriteMapElemValue() + if yyn2086 { + r.EncodeNil() + } else { + if x.FptrMapInt64Uint16 == nil { + r.EncodeNil() + } else { + yy2089 := *x.FptrMapInt64Uint16 + if false { + } else { + z.F.EncMapInt64Uint16V(yy2089, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Uint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64Uint32V(x.FMapInt64Uint32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt64Uint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt64Uint32`) + } + r.WriteMapElemValue() + if x.FMapInt64Uint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64Uint32V(x.FMapInt64Uint32, e) + } + } + } + var yyn2094 bool + if x.FptrMapInt64Uint32 == nil { + yyn2094 = true + goto LABEL2094 + } + LABEL2094: + if yyr2 || yy2arr2 { + if yyn2094 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt64Uint32 == nil { + r.EncodeNil() + } else { + yy2095 := *x.FptrMapInt64Uint32 + if false { + } else { + z.F.EncMapInt64Uint32V(yy2095, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt64Uint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt64Uint32`) + } + r.WriteMapElemValue() + if yyn2094 { + r.EncodeNil() + } else { + if x.FptrMapInt64Uint32 == nil { + r.EncodeNil() + } else { + yy2097 := *x.FptrMapInt64Uint32 + if false { + } else { + z.F.EncMapInt64Uint32V(yy2097, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Uint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64Uint64V(x.FMapInt64Uint64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt64Uint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt64Uint64`) + } + r.WriteMapElemValue() + if x.FMapInt64Uint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64Uint64V(x.FMapInt64Uint64, e) + } + } + } + var yyn2102 bool + if x.FptrMapInt64Uint64 == nil { + yyn2102 = true + goto LABEL2102 + } + LABEL2102: + if yyr2 || yy2arr2 { + if yyn2102 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt64Uint64 == nil { + r.EncodeNil() + } else { + yy2103 := *x.FptrMapInt64Uint64 + if false { + } else { + z.F.EncMapInt64Uint64V(yy2103, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt64Uint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt64Uint64`) + } + r.WriteMapElemValue() + if yyn2102 { + r.EncodeNil() + } else { + if x.FptrMapInt64Uint64 == nil { + r.EncodeNil() + } else { + yy2105 := *x.FptrMapInt64Uint64 + if false { + } else { + z.F.EncMapInt64Uint64V(yy2105, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Uintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64UintptrV(x.FMapInt64Uintptr, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt64Uintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt64Uintptr`) + } + r.WriteMapElemValue() + if x.FMapInt64Uintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64UintptrV(x.FMapInt64Uintptr, e) + } + } + } + var yyn2110 bool + if x.FptrMapInt64Uintptr == nil { + yyn2110 = true + goto LABEL2110 + } + LABEL2110: + if yyr2 || yy2arr2 { + if yyn2110 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt64Uintptr == nil { + r.EncodeNil() + } else { + yy2111 := *x.FptrMapInt64Uintptr + if false { + } else { + z.F.EncMapInt64UintptrV(yy2111, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt64Uintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt64Uintptr`) + } + r.WriteMapElemValue() + if yyn2110 { + r.EncodeNil() + } else { + if x.FptrMapInt64Uintptr == nil { + r.EncodeNil() + } else { + yy2113 := *x.FptrMapInt64Uintptr + if false { + } else { + z.F.EncMapInt64UintptrV(yy2113, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Int == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64IntV(x.FMapInt64Int, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt64Int\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt64Int`) + } + r.WriteMapElemValue() + if x.FMapInt64Int == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64IntV(x.FMapInt64Int, e) + } + } + } + var yyn2118 bool + if x.FptrMapInt64Int == nil { + yyn2118 = true + goto LABEL2118 + } + LABEL2118: + if yyr2 || yy2arr2 { + if yyn2118 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt64Int == nil { + r.EncodeNil() + } else { + yy2119 := *x.FptrMapInt64Int + if false { + } else { + z.F.EncMapInt64IntV(yy2119, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt64Int\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt64Int`) + } + r.WriteMapElemValue() + if yyn2118 { + r.EncodeNil() + } else { + if x.FptrMapInt64Int == nil { + r.EncodeNil() + } else { + yy2121 := *x.FptrMapInt64Int + if false { + } else { + z.F.EncMapInt64IntV(yy2121, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Int8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64Int8V(x.FMapInt64Int8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt64Int8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt64Int8`) + } + r.WriteMapElemValue() + if x.FMapInt64Int8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64Int8V(x.FMapInt64Int8, e) + } + } + } + var yyn2126 bool + if x.FptrMapInt64Int8 == nil { + yyn2126 = true + goto LABEL2126 + } + LABEL2126: + if yyr2 || yy2arr2 { + if yyn2126 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt64Int8 == nil { + r.EncodeNil() + } else { + yy2127 := *x.FptrMapInt64Int8 + if false { + } else { + z.F.EncMapInt64Int8V(yy2127, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt64Int8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt64Int8`) + } + r.WriteMapElemValue() + if yyn2126 { + r.EncodeNil() + } else { + if x.FptrMapInt64Int8 == nil { + r.EncodeNil() + } else { + yy2129 := *x.FptrMapInt64Int8 + if false { + } else { + z.F.EncMapInt64Int8V(yy2129, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Int16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64Int16V(x.FMapInt64Int16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt64Int16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt64Int16`) + } + r.WriteMapElemValue() + if x.FMapInt64Int16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64Int16V(x.FMapInt64Int16, e) + } + } + } + var yyn2134 bool + if x.FptrMapInt64Int16 == nil { + yyn2134 = true + goto LABEL2134 + } + LABEL2134: + if yyr2 || yy2arr2 { + if yyn2134 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt64Int16 == nil { + r.EncodeNil() + } else { + yy2135 := *x.FptrMapInt64Int16 + if false { + } else { + z.F.EncMapInt64Int16V(yy2135, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt64Int16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt64Int16`) + } + r.WriteMapElemValue() + if yyn2134 { + r.EncodeNil() + } else { + if x.FptrMapInt64Int16 == nil { + r.EncodeNil() + } else { + yy2137 := *x.FptrMapInt64Int16 + if false { + } else { + z.F.EncMapInt64Int16V(yy2137, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Int32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64Int32V(x.FMapInt64Int32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt64Int32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt64Int32`) + } + r.WriteMapElemValue() + if x.FMapInt64Int32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64Int32V(x.FMapInt64Int32, e) + } + } + } + var yyn2142 bool + if x.FptrMapInt64Int32 == nil { + yyn2142 = true + goto LABEL2142 + } + LABEL2142: + if yyr2 || yy2arr2 { + if yyn2142 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt64Int32 == nil { + r.EncodeNil() + } else { + yy2143 := *x.FptrMapInt64Int32 + if false { + } else { + z.F.EncMapInt64Int32V(yy2143, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt64Int32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt64Int32`) + } + r.WriteMapElemValue() + if yyn2142 { + r.EncodeNil() + } else { + if x.FptrMapInt64Int32 == nil { + r.EncodeNil() + } else { + yy2145 := *x.FptrMapInt64Int32 + if false { + } else { + z.F.EncMapInt64Int32V(yy2145, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Int64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64Int64V(x.FMapInt64Int64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt64Int64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt64Int64`) + } + r.WriteMapElemValue() + if x.FMapInt64Int64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64Int64V(x.FMapInt64Int64, e) + } + } + } + var yyn2150 bool + if x.FptrMapInt64Int64 == nil { + yyn2150 = true + goto LABEL2150 + } + LABEL2150: + if yyr2 || yy2arr2 { + if yyn2150 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt64Int64 == nil { + r.EncodeNil() + } else { + yy2151 := *x.FptrMapInt64Int64 + if false { + } else { + z.F.EncMapInt64Int64V(yy2151, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt64Int64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt64Int64`) + } + r.WriteMapElemValue() + if yyn2150 { + r.EncodeNil() + } else { + if x.FptrMapInt64Int64 == nil { + r.EncodeNil() + } else { + yy2153 := *x.FptrMapInt64Int64 + if false { + } else { + z.F.EncMapInt64Int64V(yy2153, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Float32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64Float32V(x.FMapInt64Float32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt64Float32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt64Float32`) + } + r.WriteMapElemValue() + if x.FMapInt64Float32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64Float32V(x.FMapInt64Float32, e) + } + } + } + var yyn2158 bool + if x.FptrMapInt64Float32 == nil { + yyn2158 = true + goto LABEL2158 + } + LABEL2158: + if yyr2 || yy2arr2 { + if yyn2158 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt64Float32 == nil { + r.EncodeNil() + } else { + yy2159 := *x.FptrMapInt64Float32 + if false { + } else { + z.F.EncMapInt64Float32V(yy2159, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt64Float32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt64Float32`) + } + r.WriteMapElemValue() + if yyn2158 { + r.EncodeNil() + } else { + if x.FptrMapInt64Float32 == nil { + r.EncodeNil() + } else { + yy2161 := *x.FptrMapInt64Float32 + if false { + } else { + z.F.EncMapInt64Float32V(yy2161, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Float64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64Float64V(x.FMapInt64Float64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt64Float64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt64Float64`) + } + r.WriteMapElemValue() + if x.FMapInt64Float64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64Float64V(x.FMapInt64Float64, e) + } + } + } + var yyn2166 bool + if x.FptrMapInt64Float64 == nil { + yyn2166 = true + goto LABEL2166 + } + LABEL2166: + if yyr2 || yy2arr2 { + if yyn2166 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt64Float64 == nil { + r.EncodeNil() + } else { + yy2167 := *x.FptrMapInt64Float64 + if false { + } else { + z.F.EncMapInt64Float64V(yy2167, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt64Float64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt64Float64`) + } + r.WriteMapElemValue() + if yyn2166 { + r.EncodeNil() + } else { + if x.FptrMapInt64Float64 == nil { + r.EncodeNil() + } else { + yy2169 := *x.FptrMapInt64Float64 + if false { + } else { + z.F.EncMapInt64Float64V(yy2169, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Bool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64BoolV(x.FMapInt64Bool, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapInt64Bool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapInt64Bool`) + } + r.WriteMapElemValue() + if x.FMapInt64Bool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapInt64BoolV(x.FMapInt64Bool, e) + } + } + } + var yyn2174 bool + if x.FptrMapInt64Bool == nil { + yyn2174 = true + goto LABEL2174 + } + LABEL2174: + if yyr2 || yy2arr2 { + if yyn2174 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapInt64Bool == nil { + r.EncodeNil() + } else { + yy2175 := *x.FptrMapInt64Bool + if false { + } else { + z.F.EncMapInt64BoolV(yy2175, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapInt64Bool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapInt64Bool`) + } + r.WriteMapElemValue() + if yyn2174 { + r.EncodeNil() + } else { + if x.FptrMapInt64Bool == nil { + r.EncodeNil() + } else { + yy2177 := *x.FptrMapInt64Bool + if false { + } else { + z.F.EncMapInt64BoolV(yy2177, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolIntf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolIntfV(x.FMapBoolIntf, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapBoolIntf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapBoolIntf`) + } + r.WriteMapElemValue() + if x.FMapBoolIntf == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolIntfV(x.FMapBoolIntf, e) + } + } + } + var yyn2182 bool + if x.FptrMapBoolIntf == nil { + yyn2182 = true + goto LABEL2182 + } + LABEL2182: + if yyr2 || yy2arr2 { + if yyn2182 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapBoolIntf == nil { + r.EncodeNil() + } else { + yy2183 := *x.FptrMapBoolIntf + if false { + } else { + z.F.EncMapBoolIntfV(yy2183, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapBoolIntf\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapBoolIntf`) + } + r.WriteMapElemValue() + if yyn2182 { + r.EncodeNil() + } else { + if x.FptrMapBoolIntf == nil { + r.EncodeNil() + } else { + yy2185 := *x.FptrMapBoolIntf + if false { + } else { + z.F.EncMapBoolIntfV(yy2185, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolString == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolStringV(x.FMapBoolString, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapBoolString\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapBoolString`) + } + r.WriteMapElemValue() + if x.FMapBoolString == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolStringV(x.FMapBoolString, e) + } + } + } + var yyn2190 bool + if x.FptrMapBoolString == nil { + yyn2190 = true + goto LABEL2190 + } + LABEL2190: + if yyr2 || yy2arr2 { + if yyn2190 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapBoolString == nil { + r.EncodeNil() + } else { + yy2191 := *x.FptrMapBoolString + if false { + } else { + z.F.EncMapBoolStringV(yy2191, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapBoolString\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapBoolString`) + } + r.WriteMapElemValue() + if yyn2190 { + r.EncodeNil() + } else { + if x.FptrMapBoolString == nil { + r.EncodeNil() + } else { + yy2193 := *x.FptrMapBoolString + if false { + } else { + z.F.EncMapBoolStringV(yy2193, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolUint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolUintV(x.FMapBoolUint, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapBoolUint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapBoolUint`) + } + r.WriteMapElemValue() + if x.FMapBoolUint == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolUintV(x.FMapBoolUint, e) + } + } + } + var yyn2198 bool + if x.FptrMapBoolUint == nil { + yyn2198 = true + goto LABEL2198 + } + LABEL2198: + if yyr2 || yy2arr2 { + if yyn2198 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapBoolUint == nil { + r.EncodeNil() + } else { + yy2199 := *x.FptrMapBoolUint + if false { + } else { + z.F.EncMapBoolUintV(yy2199, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapBoolUint\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapBoolUint`) + } + r.WriteMapElemValue() + if yyn2198 { + r.EncodeNil() + } else { + if x.FptrMapBoolUint == nil { + r.EncodeNil() + } else { + yy2201 := *x.FptrMapBoolUint + if false { + } else { + z.F.EncMapBoolUintV(yy2201, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolUint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolUint8V(x.FMapBoolUint8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapBoolUint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapBoolUint8`) + } + r.WriteMapElemValue() + if x.FMapBoolUint8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolUint8V(x.FMapBoolUint8, e) + } + } + } + var yyn2206 bool + if x.FptrMapBoolUint8 == nil { + yyn2206 = true + goto LABEL2206 + } + LABEL2206: + if yyr2 || yy2arr2 { + if yyn2206 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapBoolUint8 == nil { + r.EncodeNil() + } else { + yy2207 := *x.FptrMapBoolUint8 + if false { + } else { + z.F.EncMapBoolUint8V(yy2207, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapBoolUint8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapBoolUint8`) + } + r.WriteMapElemValue() + if yyn2206 { + r.EncodeNil() + } else { + if x.FptrMapBoolUint8 == nil { + r.EncodeNil() + } else { + yy2209 := *x.FptrMapBoolUint8 + if false { + } else { + z.F.EncMapBoolUint8V(yy2209, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolUint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolUint16V(x.FMapBoolUint16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapBoolUint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapBoolUint16`) + } + r.WriteMapElemValue() + if x.FMapBoolUint16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolUint16V(x.FMapBoolUint16, e) + } + } + } + var yyn2214 bool + if x.FptrMapBoolUint16 == nil { + yyn2214 = true + goto LABEL2214 + } + LABEL2214: + if yyr2 || yy2arr2 { + if yyn2214 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapBoolUint16 == nil { + r.EncodeNil() + } else { + yy2215 := *x.FptrMapBoolUint16 + if false { + } else { + z.F.EncMapBoolUint16V(yy2215, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapBoolUint16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapBoolUint16`) + } + r.WriteMapElemValue() + if yyn2214 { + r.EncodeNil() + } else { + if x.FptrMapBoolUint16 == nil { + r.EncodeNil() + } else { + yy2217 := *x.FptrMapBoolUint16 + if false { + } else { + z.F.EncMapBoolUint16V(yy2217, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolUint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolUint32V(x.FMapBoolUint32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapBoolUint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapBoolUint32`) + } + r.WriteMapElemValue() + if x.FMapBoolUint32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolUint32V(x.FMapBoolUint32, e) + } + } + } + var yyn2222 bool + if x.FptrMapBoolUint32 == nil { + yyn2222 = true + goto LABEL2222 + } + LABEL2222: + if yyr2 || yy2arr2 { + if yyn2222 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapBoolUint32 == nil { + r.EncodeNil() + } else { + yy2223 := *x.FptrMapBoolUint32 + if false { + } else { + z.F.EncMapBoolUint32V(yy2223, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapBoolUint32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapBoolUint32`) + } + r.WriteMapElemValue() + if yyn2222 { + r.EncodeNil() + } else { + if x.FptrMapBoolUint32 == nil { + r.EncodeNil() + } else { + yy2225 := *x.FptrMapBoolUint32 + if false { + } else { + z.F.EncMapBoolUint32V(yy2225, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolUint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolUint64V(x.FMapBoolUint64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapBoolUint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapBoolUint64`) + } + r.WriteMapElemValue() + if x.FMapBoolUint64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolUint64V(x.FMapBoolUint64, e) + } + } + } + var yyn2230 bool + if x.FptrMapBoolUint64 == nil { + yyn2230 = true + goto LABEL2230 + } + LABEL2230: + if yyr2 || yy2arr2 { + if yyn2230 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapBoolUint64 == nil { + r.EncodeNil() + } else { + yy2231 := *x.FptrMapBoolUint64 + if false { + } else { + z.F.EncMapBoolUint64V(yy2231, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapBoolUint64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapBoolUint64`) + } + r.WriteMapElemValue() + if yyn2230 { + r.EncodeNil() + } else { + if x.FptrMapBoolUint64 == nil { + r.EncodeNil() + } else { + yy2233 := *x.FptrMapBoolUint64 + if false { + } else { + z.F.EncMapBoolUint64V(yy2233, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolUintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolUintptrV(x.FMapBoolUintptr, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapBoolUintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapBoolUintptr`) + } + r.WriteMapElemValue() + if x.FMapBoolUintptr == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolUintptrV(x.FMapBoolUintptr, e) + } + } + } + var yyn2238 bool + if x.FptrMapBoolUintptr == nil { + yyn2238 = true + goto LABEL2238 + } + LABEL2238: + if yyr2 || yy2arr2 { + if yyn2238 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapBoolUintptr == nil { + r.EncodeNil() + } else { + yy2239 := *x.FptrMapBoolUintptr + if false { + } else { + z.F.EncMapBoolUintptrV(yy2239, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapBoolUintptr\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapBoolUintptr`) + } + r.WriteMapElemValue() + if yyn2238 { + r.EncodeNil() + } else { + if x.FptrMapBoolUintptr == nil { + r.EncodeNil() + } else { + yy2241 := *x.FptrMapBoolUintptr + if false { + } else { + z.F.EncMapBoolUintptrV(yy2241, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolInt == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolIntV(x.FMapBoolInt, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapBoolInt\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapBoolInt`) + } + r.WriteMapElemValue() + if x.FMapBoolInt == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolIntV(x.FMapBoolInt, e) + } + } + } + var yyn2246 bool + if x.FptrMapBoolInt == nil { + yyn2246 = true + goto LABEL2246 + } + LABEL2246: + if yyr2 || yy2arr2 { + if yyn2246 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapBoolInt == nil { + r.EncodeNil() + } else { + yy2247 := *x.FptrMapBoolInt + if false { + } else { + z.F.EncMapBoolIntV(yy2247, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapBoolInt\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapBoolInt`) + } + r.WriteMapElemValue() + if yyn2246 { + r.EncodeNil() + } else { + if x.FptrMapBoolInt == nil { + r.EncodeNil() + } else { + yy2249 := *x.FptrMapBoolInt + if false { + } else { + z.F.EncMapBoolIntV(yy2249, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolInt8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolInt8V(x.FMapBoolInt8, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapBoolInt8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapBoolInt8`) + } + r.WriteMapElemValue() + if x.FMapBoolInt8 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolInt8V(x.FMapBoolInt8, e) + } + } + } + var yyn2254 bool + if x.FptrMapBoolInt8 == nil { + yyn2254 = true + goto LABEL2254 + } + LABEL2254: + if yyr2 || yy2arr2 { + if yyn2254 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapBoolInt8 == nil { + r.EncodeNil() + } else { + yy2255 := *x.FptrMapBoolInt8 + if false { + } else { + z.F.EncMapBoolInt8V(yy2255, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapBoolInt8\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapBoolInt8`) + } + r.WriteMapElemValue() + if yyn2254 { + r.EncodeNil() + } else { + if x.FptrMapBoolInt8 == nil { + r.EncodeNil() + } else { + yy2257 := *x.FptrMapBoolInt8 + if false { + } else { + z.F.EncMapBoolInt8V(yy2257, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolInt16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolInt16V(x.FMapBoolInt16, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapBoolInt16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapBoolInt16`) + } + r.WriteMapElemValue() + if x.FMapBoolInt16 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolInt16V(x.FMapBoolInt16, e) + } + } + } + var yyn2262 bool + if x.FptrMapBoolInt16 == nil { + yyn2262 = true + goto LABEL2262 + } + LABEL2262: + if yyr2 || yy2arr2 { + if yyn2262 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapBoolInt16 == nil { + r.EncodeNil() + } else { + yy2263 := *x.FptrMapBoolInt16 + if false { + } else { + z.F.EncMapBoolInt16V(yy2263, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapBoolInt16\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapBoolInt16`) + } + r.WriteMapElemValue() + if yyn2262 { + r.EncodeNil() + } else { + if x.FptrMapBoolInt16 == nil { + r.EncodeNil() + } else { + yy2265 := *x.FptrMapBoolInt16 + if false { + } else { + z.F.EncMapBoolInt16V(yy2265, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolInt32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolInt32V(x.FMapBoolInt32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapBoolInt32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapBoolInt32`) + } + r.WriteMapElemValue() + if x.FMapBoolInt32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolInt32V(x.FMapBoolInt32, e) + } + } + } + var yyn2270 bool + if x.FptrMapBoolInt32 == nil { + yyn2270 = true + goto LABEL2270 + } + LABEL2270: + if yyr2 || yy2arr2 { + if yyn2270 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapBoolInt32 == nil { + r.EncodeNil() + } else { + yy2271 := *x.FptrMapBoolInt32 + if false { + } else { + z.F.EncMapBoolInt32V(yy2271, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapBoolInt32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapBoolInt32`) + } + r.WriteMapElemValue() + if yyn2270 { + r.EncodeNil() + } else { + if x.FptrMapBoolInt32 == nil { + r.EncodeNil() + } else { + yy2273 := *x.FptrMapBoolInt32 + if false { + } else { + z.F.EncMapBoolInt32V(yy2273, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolInt64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolInt64V(x.FMapBoolInt64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapBoolInt64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapBoolInt64`) + } + r.WriteMapElemValue() + if x.FMapBoolInt64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolInt64V(x.FMapBoolInt64, e) + } + } + } + var yyn2278 bool + if x.FptrMapBoolInt64 == nil { + yyn2278 = true + goto LABEL2278 + } + LABEL2278: + if yyr2 || yy2arr2 { + if yyn2278 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapBoolInt64 == nil { + r.EncodeNil() + } else { + yy2279 := *x.FptrMapBoolInt64 + if false { + } else { + z.F.EncMapBoolInt64V(yy2279, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapBoolInt64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapBoolInt64`) + } + r.WriteMapElemValue() + if yyn2278 { + r.EncodeNil() + } else { + if x.FptrMapBoolInt64 == nil { + r.EncodeNil() + } else { + yy2281 := *x.FptrMapBoolInt64 + if false { + } else { + z.F.EncMapBoolInt64V(yy2281, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolFloat32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolFloat32V(x.FMapBoolFloat32, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapBoolFloat32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapBoolFloat32`) + } + r.WriteMapElemValue() + if x.FMapBoolFloat32 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolFloat32V(x.FMapBoolFloat32, e) + } + } + } + var yyn2286 bool + if x.FptrMapBoolFloat32 == nil { + yyn2286 = true + goto LABEL2286 + } + LABEL2286: + if yyr2 || yy2arr2 { + if yyn2286 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapBoolFloat32 == nil { + r.EncodeNil() + } else { + yy2287 := *x.FptrMapBoolFloat32 + if false { + } else { + z.F.EncMapBoolFloat32V(yy2287, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapBoolFloat32\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapBoolFloat32`) + } + r.WriteMapElemValue() + if yyn2286 { + r.EncodeNil() + } else { + if x.FptrMapBoolFloat32 == nil { + r.EncodeNil() + } else { + yy2289 := *x.FptrMapBoolFloat32 + if false { + } else { + z.F.EncMapBoolFloat32V(yy2289, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolFloat64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolFloat64V(x.FMapBoolFloat64, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapBoolFloat64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapBoolFloat64`) + } + r.WriteMapElemValue() + if x.FMapBoolFloat64 == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolFloat64V(x.FMapBoolFloat64, e) + } + } + } + var yyn2294 bool + if x.FptrMapBoolFloat64 == nil { + yyn2294 = true + goto LABEL2294 + } + LABEL2294: + if yyr2 || yy2arr2 { + if yyn2294 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapBoolFloat64 == nil { + r.EncodeNil() + } else { + yy2295 := *x.FptrMapBoolFloat64 + if false { + } else { + z.F.EncMapBoolFloat64V(yy2295, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapBoolFloat64\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapBoolFloat64`) + } + r.WriteMapElemValue() + if yyn2294 { + r.EncodeNil() + } else { + if x.FptrMapBoolFloat64 == nil { + r.EncodeNil() + } else { + yy2297 := *x.FptrMapBoolFloat64 + if false { + } else { + z.F.EncMapBoolFloat64V(yy2297, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolBool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolBoolV(x.FMapBoolBool, e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FMapBoolBool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FMapBoolBool`) + } + r.WriteMapElemValue() + if x.FMapBoolBool == nil { + r.EncodeNil() + } else { + if false { + } else { + z.F.EncMapBoolBoolV(x.FMapBoolBool, e) + } + } + } + var yyn2302 bool + if x.FptrMapBoolBool == nil { + yyn2302 = true + goto LABEL2302 + } + LABEL2302: + if yyr2 || yy2arr2 { + if yyn2302 { + r.WriteArrayElem() + r.EncodeNil() + } else { + r.WriteArrayElem() + if x.FptrMapBoolBool == nil { + r.EncodeNil() + } else { + yy2303 := *x.FptrMapBoolBool + if false { + } else { + z.F.EncMapBoolBoolV(yy2303, e) + } + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"FptrMapBoolBool\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `FptrMapBoolBool`) + } + r.WriteMapElemValue() + if yyn2302 { + r.EncodeNil() + } else { + if x.FptrMapBoolBool == nil { + r.EncodeNil() + } else { + yy2305 := *x.FptrMapBoolBool + if false { + } else { + z.F.EncMapBoolBoolV(yy2305, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayEnd() + } else { + r.WriteMapEnd() + } + } + } +} + +func (x *TestMammoth2) CodecDecodeSelf(d *Decoder) { + var h codecSelfer19781 + z, r := GenHelperDecoder(d) + _, _, _ = h, z, r + if false { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) + } else { + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeMap19781 { + yyl2 := r.ReadMapStart() + if yyl2 == 0 { + r.ReadMapEnd() + } else { + x.codecDecodeSelfFromMap(yyl2, d) + } + } else if yyct2 == codecSelferValueTypeArray19781 { + yyl2 := r.ReadArrayStart() + if yyl2 == 0 { + r.ReadArrayEnd() + } else { + x.codecDecodeSelfFromArray(yyl2, d) + } + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct19781) + } + } +} + +func (x *TestMammoth2) codecDecodeSelfFromMap(l int, d *Decoder) { + var h codecSelfer19781 + z, r := GenHelperDecoder(d) + _, _, _ = h, z, r + var yyhl3 bool = l >= 0 + for yyj3 := 0; ; yyj3++ { + if yyhl3 { + if yyj3 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + r.ReadMapElemKey() + yys3 := z.StringView(r.DecodeStringAsBytes()) + r.ReadMapElemValue() + switch yys3 { + case "FIntf": + if r.TryDecodeAsNil() { + x.FIntf = nil + } else { + if false { + } else { + z.DecFallback(&x.FIntf, true) + } + } + case "FptrIntf": + if r.TryDecodeAsNil() { + if true && x.FptrIntf != nil { + x.FptrIntf = nil + } + } else { + if x.FptrIntf == nil { + x.FptrIntf = new(interface{}) + } + + if false { + } else { + z.DecFallback(x.FptrIntf, true) + } + } + case "FString": + if r.TryDecodeAsNil() { + x.FString = "" + } else { + x.FString = (string)(r.DecodeString()) + } + case "FptrString": + if r.TryDecodeAsNil() { + if true && x.FptrString != nil { + x.FptrString = nil + } + } else { + if x.FptrString == nil { + x.FptrString = new(string) + } + + if false { + } else { + *x.FptrString = (string)(r.DecodeString()) + } + } + case "FFloat32": + if r.TryDecodeAsNil() { + x.FFloat32 = 0 + } else { + x.FFloat32 = (float32)(r.DecodeFloat32As64()) + } + case "FptrFloat32": + if r.TryDecodeAsNil() { + if true && x.FptrFloat32 != nil { + x.FptrFloat32 = nil + } + } else { + if x.FptrFloat32 == nil { + x.FptrFloat32 = new(float32) + } + + if false { + } else { + *x.FptrFloat32 = (float32)(r.DecodeFloat32As64()) + } + } + case "FFloat64": + if r.TryDecodeAsNil() { + x.FFloat64 = 0 + } else { + x.FFloat64 = (float64)(r.DecodeFloat64()) + } + case "FptrFloat64": + if r.TryDecodeAsNil() { + if true && x.FptrFloat64 != nil { + x.FptrFloat64 = nil + } + } else { + if x.FptrFloat64 == nil { + x.FptrFloat64 = new(float64) + } + + if false { + } else { + *x.FptrFloat64 = (float64)(r.DecodeFloat64()) + } + } + case "FUint": + if r.TryDecodeAsNil() { + x.FUint = 0 + } else { + x.FUint = (uint)(z.C.UintV(r.DecodeUint64(), codecSelferBitsize19781)) + } + case "FptrUint": + if r.TryDecodeAsNil() { + if true && x.FptrUint != nil { + x.FptrUint = nil + } + } else { + if x.FptrUint == nil { + x.FptrUint = new(uint) + } + + if false { + } else { + *x.FptrUint = (uint)(z.C.UintV(r.DecodeUint64(), codecSelferBitsize19781)) + } + } + case "FUint8": + if r.TryDecodeAsNil() { + x.FUint8 = 0 + } else { + x.FUint8 = (uint8)(z.C.UintV(r.DecodeUint64(), 8)) + } + case "FptrUint8": + if r.TryDecodeAsNil() { + if true && x.FptrUint8 != nil { + x.FptrUint8 = nil + } + } else { + if x.FptrUint8 == nil { + x.FptrUint8 = new(uint8) + } + + if false { + } else { + *x.FptrUint8 = (uint8)(z.C.UintV(r.DecodeUint64(), 8)) + } + } + case "FUint16": + if r.TryDecodeAsNil() { + x.FUint16 = 0 + } else { + x.FUint16 = (uint16)(z.C.UintV(r.DecodeUint64(), 16)) + } + case "FptrUint16": + if r.TryDecodeAsNil() { + if true && x.FptrUint16 != nil { + x.FptrUint16 = nil + } + } else { + if x.FptrUint16 == nil { + x.FptrUint16 = new(uint16) + } + + if false { + } else { + *x.FptrUint16 = (uint16)(z.C.UintV(r.DecodeUint64(), 16)) + } + } + case "FUint32": + if r.TryDecodeAsNil() { + x.FUint32 = 0 + } else { + x.FUint32 = (uint32)(z.C.UintV(r.DecodeUint64(), 32)) + } + case "FptrUint32": + if r.TryDecodeAsNil() { + if true && x.FptrUint32 != nil { + x.FptrUint32 = nil + } + } else { + if x.FptrUint32 == nil { + x.FptrUint32 = new(uint32) + } + + if false { + } else { + *x.FptrUint32 = (uint32)(z.C.UintV(r.DecodeUint64(), 32)) + } + } + case "FUint64": + if r.TryDecodeAsNil() { + x.FUint64 = 0 + } else { + x.FUint64 = (uint64)(r.DecodeUint64()) + } + case "FptrUint64": + if r.TryDecodeAsNil() { + if true && x.FptrUint64 != nil { + x.FptrUint64 = nil + } + } else { + if x.FptrUint64 == nil { + x.FptrUint64 = new(uint64) + } + + if false { + } else { + *x.FptrUint64 = (uint64)(r.DecodeUint64()) + } + } + case "FUintptr": + if r.TryDecodeAsNil() { + x.FUintptr = 0 + } else { + x.FUintptr = (uintptr)(z.C.UintV(r.DecodeUint64(), codecSelferBitsize19781)) + } + case "FptrUintptr": + if r.TryDecodeAsNil() { + if true && x.FptrUintptr != nil { + x.FptrUintptr = nil + } + } else { + if x.FptrUintptr == nil { + x.FptrUintptr = new(uintptr) + } + + if false { + } else { + *x.FptrUintptr = (uintptr)(z.C.UintV(r.DecodeUint64(), codecSelferBitsize19781)) + } + } + case "FInt": + if r.TryDecodeAsNil() { + x.FInt = 0 + } else { + x.FInt = (int)(z.C.IntV(r.DecodeInt64(), codecSelferBitsize19781)) + } + case "FptrInt": + if r.TryDecodeAsNil() { + if true && x.FptrInt != nil { + x.FptrInt = nil + } + } else { + if x.FptrInt == nil { + x.FptrInt = new(int) + } + + if false { + } else { + *x.FptrInt = (int)(z.C.IntV(r.DecodeInt64(), codecSelferBitsize19781)) + } + } + case "FInt8": + if r.TryDecodeAsNil() { + x.FInt8 = 0 + } else { + x.FInt8 = (int8)(z.C.IntV(r.DecodeInt64(), 8)) + } + case "FptrInt8": + if r.TryDecodeAsNil() { + if true && x.FptrInt8 != nil { + x.FptrInt8 = nil + } + } else { + if x.FptrInt8 == nil { + x.FptrInt8 = new(int8) + } + + if false { + } else { + *x.FptrInt8 = (int8)(z.C.IntV(r.DecodeInt64(), 8)) + } + } + case "FInt16": + if r.TryDecodeAsNil() { + x.FInt16 = 0 + } else { + x.FInt16 = (int16)(z.C.IntV(r.DecodeInt64(), 16)) + } + case "FptrInt16": + if r.TryDecodeAsNil() { + if true && x.FptrInt16 != nil { + x.FptrInt16 = nil + } + } else { + if x.FptrInt16 == nil { + x.FptrInt16 = new(int16) + } + + if false { + } else { + *x.FptrInt16 = (int16)(z.C.IntV(r.DecodeInt64(), 16)) + } + } + case "FInt32": + if r.TryDecodeAsNil() { + x.FInt32 = 0 + } else { + x.FInt32 = (int32)(z.C.IntV(r.DecodeInt64(), 32)) + } + case "FptrInt32": + if r.TryDecodeAsNil() { + if true && x.FptrInt32 != nil { + x.FptrInt32 = nil + } + } else { + if x.FptrInt32 == nil { + x.FptrInt32 = new(int32) + } + + if false { + } else { + *x.FptrInt32 = (int32)(z.C.IntV(r.DecodeInt64(), 32)) + } + } + case "FInt64": + if r.TryDecodeAsNil() { + x.FInt64 = 0 + } else { + x.FInt64 = (int64)(r.DecodeInt64()) + } + case "FptrInt64": + if r.TryDecodeAsNil() { + if true && x.FptrInt64 != nil { + x.FptrInt64 = nil + } + } else { + if x.FptrInt64 == nil { + x.FptrInt64 = new(int64) + } + + if false { + } else { + *x.FptrInt64 = (int64)(r.DecodeInt64()) + } + } + case "FBool": + if r.TryDecodeAsNil() { + x.FBool = false + } else { + x.FBool = (bool)(r.DecodeBool()) + } + case "FptrBool": + if r.TryDecodeAsNil() { + if true && x.FptrBool != nil { + x.FptrBool = nil + } + } else { + if x.FptrBool == nil { + x.FptrBool = new(bool) + } + + if false { + } else { + *x.FptrBool = (bool)(r.DecodeBool()) + } + } + case "FSliceIntf": + if r.TryDecodeAsNil() { + x.FSliceIntf = nil + } else { + if false { + } else { + z.F.DecSliceIntfX(&x.FSliceIntf, d) + } + } + case "FptrSliceIntf": + if r.TryDecodeAsNil() { + if true && x.FptrSliceIntf != nil { + x.FptrSliceIntf = nil + } + } else { + if x.FptrSliceIntf == nil { + x.FptrSliceIntf = new([]interface{}) + } + + if false { + } else { + z.F.DecSliceIntfX(x.FptrSliceIntf, d) + } + } + case "FSliceString": + if r.TryDecodeAsNil() { + x.FSliceString = nil + } else { + if false { + } else { + z.F.DecSliceStringX(&x.FSliceString, d) + } + } + case "FptrSliceString": + if r.TryDecodeAsNil() { + if true && x.FptrSliceString != nil { + x.FptrSliceString = nil + } + } else { + if x.FptrSliceString == nil { + x.FptrSliceString = new([]string) + } + + if false { + } else { + z.F.DecSliceStringX(x.FptrSliceString, d) + } + } + case "FSliceFloat32": + if r.TryDecodeAsNil() { + x.FSliceFloat32 = nil + } else { + if false { + } else { + z.F.DecSliceFloat32X(&x.FSliceFloat32, d) + } + } + case "FptrSliceFloat32": + if r.TryDecodeAsNil() { + if true && x.FptrSliceFloat32 != nil { + x.FptrSliceFloat32 = nil + } + } else { + if x.FptrSliceFloat32 == nil { + x.FptrSliceFloat32 = new([]float32) + } + + if false { + } else { + z.F.DecSliceFloat32X(x.FptrSliceFloat32, d) + } + } + case "FSliceFloat64": + if r.TryDecodeAsNil() { + x.FSliceFloat64 = nil + } else { + if false { + } else { + z.F.DecSliceFloat64X(&x.FSliceFloat64, d) + } + } + case "FptrSliceFloat64": + if r.TryDecodeAsNil() { + if true && x.FptrSliceFloat64 != nil { + x.FptrSliceFloat64 = nil + } + } else { + if x.FptrSliceFloat64 == nil { + x.FptrSliceFloat64 = new([]float64) + } + + if false { + } else { + z.F.DecSliceFloat64X(x.FptrSliceFloat64, d) + } + } + case "FSliceUint": + if r.TryDecodeAsNil() { + x.FSliceUint = nil + } else { + if false { + } else { + z.F.DecSliceUintX(&x.FSliceUint, d) + } + } + case "FptrSliceUint": + if r.TryDecodeAsNil() { + if true && x.FptrSliceUint != nil { + x.FptrSliceUint = nil + } + } else { + if x.FptrSliceUint == nil { + x.FptrSliceUint = new([]uint) + } + + if false { + } else { + z.F.DecSliceUintX(x.FptrSliceUint, d) + } + } + case "FSliceUint8": + if r.TryDecodeAsNil() { + x.FSliceUint8 = nil + } else { + if false { + } else { + x.FSliceUint8 = r.DecodeBytes(([]byte)(x.FSliceUint8), false) + } + } + case "FptrSliceUint8": + if r.TryDecodeAsNil() { + if true && x.FptrSliceUint8 != nil { + x.FptrSliceUint8 = nil + } + } else { + if x.FptrSliceUint8 == nil { + x.FptrSliceUint8 = new([]uint8) + } + + if false { + } else { + *x.FptrSliceUint8 = r.DecodeBytes(*(*[]byte)(x.FptrSliceUint8), false) + } + } + case "FSliceUint16": + if r.TryDecodeAsNil() { + x.FSliceUint16 = nil + } else { + if false { + } else { + z.F.DecSliceUint16X(&x.FSliceUint16, d) + } + } + case "FptrSliceUint16": + if r.TryDecodeAsNil() { + if true && x.FptrSliceUint16 != nil { + x.FptrSliceUint16 = nil + } + } else { + if x.FptrSliceUint16 == nil { + x.FptrSliceUint16 = new([]uint16) + } + + if false { + } else { + z.F.DecSliceUint16X(x.FptrSliceUint16, d) + } + } + case "FSliceUint32": + if r.TryDecodeAsNil() { + x.FSliceUint32 = nil + } else { + if false { + } else { + z.F.DecSliceUint32X(&x.FSliceUint32, d) + } + } + case "FptrSliceUint32": + if r.TryDecodeAsNil() { + if true && x.FptrSliceUint32 != nil { + x.FptrSliceUint32 = nil + } + } else { + if x.FptrSliceUint32 == nil { + x.FptrSliceUint32 = new([]uint32) + } + + if false { + } else { + z.F.DecSliceUint32X(x.FptrSliceUint32, d) + } + } + case "FSliceUint64": + if r.TryDecodeAsNil() { + x.FSliceUint64 = nil + } else { + if false { + } else { + z.F.DecSliceUint64X(&x.FSliceUint64, d) + } + } + case "FptrSliceUint64": + if r.TryDecodeAsNil() { + if true && x.FptrSliceUint64 != nil { + x.FptrSliceUint64 = nil + } + } else { + if x.FptrSliceUint64 == nil { + x.FptrSliceUint64 = new([]uint64) + } + + if false { + } else { + z.F.DecSliceUint64X(x.FptrSliceUint64, d) + } + } + case "FSliceUintptr": + if r.TryDecodeAsNil() { + x.FSliceUintptr = nil + } else { + if false { + } else { + z.F.DecSliceUintptrX(&x.FSliceUintptr, d) + } + } + case "FptrSliceUintptr": + if r.TryDecodeAsNil() { + if true && x.FptrSliceUintptr != nil { + x.FptrSliceUintptr = nil + } + } else { + if x.FptrSliceUintptr == nil { + x.FptrSliceUintptr = new([]uintptr) + } + + if false { + } else { + z.F.DecSliceUintptrX(x.FptrSliceUintptr, d) + } + } + case "FSliceInt": + if r.TryDecodeAsNil() { + x.FSliceInt = nil + } else { + if false { + } else { + z.F.DecSliceIntX(&x.FSliceInt, d) + } + } + case "FptrSliceInt": + if r.TryDecodeAsNil() { + if true && x.FptrSliceInt != nil { + x.FptrSliceInt = nil + } + } else { + if x.FptrSliceInt == nil { + x.FptrSliceInt = new([]int) + } + + if false { + } else { + z.F.DecSliceIntX(x.FptrSliceInt, d) + } + } + case "FSliceInt8": + if r.TryDecodeAsNil() { + x.FSliceInt8 = nil + } else { + if false { + } else { + z.F.DecSliceInt8X(&x.FSliceInt8, d) + } + } + case "FptrSliceInt8": + if r.TryDecodeAsNil() { + if true && x.FptrSliceInt8 != nil { + x.FptrSliceInt8 = nil + } + } else { + if x.FptrSliceInt8 == nil { + x.FptrSliceInt8 = new([]int8) + } + + if false { + } else { + z.F.DecSliceInt8X(x.FptrSliceInt8, d) + } + } + case "FSliceInt16": + if r.TryDecodeAsNil() { + x.FSliceInt16 = nil + } else { + if false { + } else { + z.F.DecSliceInt16X(&x.FSliceInt16, d) + } + } + case "FptrSliceInt16": + if r.TryDecodeAsNil() { + if true && x.FptrSliceInt16 != nil { + x.FptrSliceInt16 = nil + } + } else { + if x.FptrSliceInt16 == nil { + x.FptrSliceInt16 = new([]int16) + } + + if false { + } else { + z.F.DecSliceInt16X(x.FptrSliceInt16, d) + } + } + case "FSliceInt32": + if r.TryDecodeAsNil() { + x.FSliceInt32 = nil + } else { + if false { + } else { + z.F.DecSliceInt32X(&x.FSliceInt32, d) + } + } + case "FptrSliceInt32": + if r.TryDecodeAsNil() { + if true && x.FptrSliceInt32 != nil { + x.FptrSliceInt32 = nil + } + } else { + if x.FptrSliceInt32 == nil { + x.FptrSliceInt32 = new([]int32) + } + + if false { + } else { + z.F.DecSliceInt32X(x.FptrSliceInt32, d) + } + } + case "FSliceInt64": + if r.TryDecodeAsNil() { + x.FSliceInt64 = nil + } else { + if false { + } else { + z.F.DecSliceInt64X(&x.FSliceInt64, d) + } + } + case "FptrSliceInt64": + if r.TryDecodeAsNil() { + if true && x.FptrSliceInt64 != nil { + x.FptrSliceInt64 = nil + } + } else { + if x.FptrSliceInt64 == nil { + x.FptrSliceInt64 = new([]int64) + } + + if false { + } else { + z.F.DecSliceInt64X(x.FptrSliceInt64, d) + } + } + case "FSliceBool": + if r.TryDecodeAsNil() { + x.FSliceBool = nil + } else { + if false { + } else { + z.F.DecSliceBoolX(&x.FSliceBool, d) + } + } + case "FptrSliceBool": + if r.TryDecodeAsNil() { + if true && x.FptrSliceBool != nil { + x.FptrSliceBool = nil + } + } else { + if x.FptrSliceBool == nil { + x.FptrSliceBool = new([]bool) + } + + if false { + } else { + z.F.DecSliceBoolX(x.FptrSliceBool, d) + } + } + case "FMapIntfIntf": + if r.TryDecodeAsNil() { + x.FMapIntfIntf = nil + } else { + if false { + } else { + z.F.DecMapIntfIntfX(&x.FMapIntfIntf, d) + } + } + case "FptrMapIntfIntf": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfIntf != nil { + x.FptrMapIntfIntf = nil + } + } else { + if x.FptrMapIntfIntf == nil { + x.FptrMapIntfIntf = new(map[interface{}]interface{}) + } + + if false { + } else { + z.F.DecMapIntfIntfX(x.FptrMapIntfIntf, d) + } + } + case "FMapIntfString": + if r.TryDecodeAsNil() { + x.FMapIntfString = nil + } else { + if false { + } else { + z.F.DecMapIntfStringX(&x.FMapIntfString, d) + } + } + case "FptrMapIntfString": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfString != nil { + x.FptrMapIntfString = nil + } + } else { + if x.FptrMapIntfString == nil { + x.FptrMapIntfString = new(map[interface{}]string) + } + + if false { + } else { + z.F.DecMapIntfStringX(x.FptrMapIntfString, d) + } + } + case "FMapIntfUint": + if r.TryDecodeAsNil() { + x.FMapIntfUint = nil + } else { + if false { + } else { + z.F.DecMapIntfUintX(&x.FMapIntfUint, d) + } + } + case "FptrMapIntfUint": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfUint != nil { + x.FptrMapIntfUint = nil + } + } else { + if x.FptrMapIntfUint == nil { + x.FptrMapIntfUint = new(map[interface{}]uint) + } + + if false { + } else { + z.F.DecMapIntfUintX(x.FptrMapIntfUint, d) + } + } + case "FMapIntfUint8": + if r.TryDecodeAsNil() { + x.FMapIntfUint8 = nil + } else { + if false { + } else { + z.F.DecMapIntfUint8X(&x.FMapIntfUint8, d) + } + } + case "FptrMapIntfUint8": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfUint8 != nil { + x.FptrMapIntfUint8 = nil + } + } else { + if x.FptrMapIntfUint8 == nil { + x.FptrMapIntfUint8 = new(map[interface{}]uint8) + } + + if false { + } else { + z.F.DecMapIntfUint8X(x.FptrMapIntfUint8, d) + } + } + case "FMapIntfUint16": + if r.TryDecodeAsNil() { + x.FMapIntfUint16 = nil + } else { + if false { + } else { + z.F.DecMapIntfUint16X(&x.FMapIntfUint16, d) + } + } + case "FptrMapIntfUint16": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfUint16 != nil { + x.FptrMapIntfUint16 = nil + } + } else { + if x.FptrMapIntfUint16 == nil { + x.FptrMapIntfUint16 = new(map[interface{}]uint16) + } + + if false { + } else { + z.F.DecMapIntfUint16X(x.FptrMapIntfUint16, d) + } + } + case "FMapIntfUint32": + if r.TryDecodeAsNil() { + x.FMapIntfUint32 = nil + } else { + if false { + } else { + z.F.DecMapIntfUint32X(&x.FMapIntfUint32, d) + } + } + case "FptrMapIntfUint32": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfUint32 != nil { + x.FptrMapIntfUint32 = nil + } + } else { + if x.FptrMapIntfUint32 == nil { + x.FptrMapIntfUint32 = new(map[interface{}]uint32) + } + + if false { + } else { + z.F.DecMapIntfUint32X(x.FptrMapIntfUint32, d) + } + } + case "FMapIntfUint64": + if r.TryDecodeAsNil() { + x.FMapIntfUint64 = nil + } else { + if false { + } else { + z.F.DecMapIntfUint64X(&x.FMapIntfUint64, d) + } + } + case "FptrMapIntfUint64": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfUint64 != nil { + x.FptrMapIntfUint64 = nil + } + } else { + if x.FptrMapIntfUint64 == nil { + x.FptrMapIntfUint64 = new(map[interface{}]uint64) + } + + if false { + } else { + z.F.DecMapIntfUint64X(x.FptrMapIntfUint64, d) + } + } + case "FMapIntfUintptr": + if r.TryDecodeAsNil() { + x.FMapIntfUintptr = nil + } else { + if false { + } else { + z.F.DecMapIntfUintptrX(&x.FMapIntfUintptr, d) + } + } + case "FptrMapIntfUintptr": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfUintptr != nil { + x.FptrMapIntfUintptr = nil + } + } else { + if x.FptrMapIntfUintptr == nil { + x.FptrMapIntfUintptr = new(map[interface{}]uintptr) + } + + if false { + } else { + z.F.DecMapIntfUintptrX(x.FptrMapIntfUintptr, d) + } + } + case "FMapIntfInt": + if r.TryDecodeAsNil() { + x.FMapIntfInt = nil + } else { + if false { + } else { + z.F.DecMapIntfIntX(&x.FMapIntfInt, d) + } + } + case "FptrMapIntfInt": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfInt != nil { + x.FptrMapIntfInt = nil + } + } else { + if x.FptrMapIntfInt == nil { + x.FptrMapIntfInt = new(map[interface{}]int) + } + + if false { + } else { + z.F.DecMapIntfIntX(x.FptrMapIntfInt, d) + } + } + case "FMapIntfInt8": + if r.TryDecodeAsNil() { + x.FMapIntfInt8 = nil + } else { + if false { + } else { + z.F.DecMapIntfInt8X(&x.FMapIntfInt8, d) + } + } + case "FptrMapIntfInt8": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfInt8 != nil { + x.FptrMapIntfInt8 = nil + } + } else { + if x.FptrMapIntfInt8 == nil { + x.FptrMapIntfInt8 = new(map[interface{}]int8) + } + + if false { + } else { + z.F.DecMapIntfInt8X(x.FptrMapIntfInt8, d) + } + } + case "FMapIntfInt16": + if r.TryDecodeAsNil() { + x.FMapIntfInt16 = nil + } else { + if false { + } else { + z.F.DecMapIntfInt16X(&x.FMapIntfInt16, d) + } + } + case "FptrMapIntfInt16": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfInt16 != nil { + x.FptrMapIntfInt16 = nil + } + } else { + if x.FptrMapIntfInt16 == nil { + x.FptrMapIntfInt16 = new(map[interface{}]int16) + } + + if false { + } else { + z.F.DecMapIntfInt16X(x.FptrMapIntfInt16, d) + } + } + case "FMapIntfInt32": + if r.TryDecodeAsNil() { + x.FMapIntfInt32 = nil + } else { + if false { + } else { + z.F.DecMapIntfInt32X(&x.FMapIntfInt32, d) + } + } + case "FptrMapIntfInt32": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfInt32 != nil { + x.FptrMapIntfInt32 = nil + } + } else { + if x.FptrMapIntfInt32 == nil { + x.FptrMapIntfInt32 = new(map[interface{}]int32) + } + + if false { + } else { + z.F.DecMapIntfInt32X(x.FptrMapIntfInt32, d) + } + } + case "FMapIntfInt64": + if r.TryDecodeAsNil() { + x.FMapIntfInt64 = nil + } else { + if false { + } else { + z.F.DecMapIntfInt64X(&x.FMapIntfInt64, d) + } + } + case "FptrMapIntfInt64": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfInt64 != nil { + x.FptrMapIntfInt64 = nil + } + } else { + if x.FptrMapIntfInt64 == nil { + x.FptrMapIntfInt64 = new(map[interface{}]int64) + } + + if false { + } else { + z.F.DecMapIntfInt64X(x.FptrMapIntfInt64, d) + } + } + case "FMapIntfFloat32": + if r.TryDecodeAsNil() { + x.FMapIntfFloat32 = nil + } else { + if false { + } else { + z.F.DecMapIntfFloat32X(&x.FMapIntfFloat32, d) + } + } + case "FptrMapIntfFloat32": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfFloat32 != nil { + x.FptrMapIntfFloat32 = nil + } + } else { + if x.FptrMapIntfFloat32 == nil { + x.FptrMapIntfFloat32 = new(map[interface{}]float32) + } + + if false { + } else { + z.F.DecMapIntfFloat32X(x.FptrMapIntfFloat32, d) + } + } + case "FMapIntfFloat64": + if r.TryDecodeAsNil() { + x.FMapIntfFloat64 = nil + } else { + if false { + } else { + z.F.DecMapIntfFloat64X(&x.FMapIntfFloat64, d) + } + } + case "FptrMapIntfFloat64": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfFloat64 != nil { + x.FptrMapIntfFloat64 = nil + } + } else { + if x.FptrMapIntfFloat64 == nil { + x.FptrMapIntfFloat64 = new(map[interface{}]float64) + } + + if false { + } else { + z.F.DecMapIntfFloat64X(x.FptrMapIntfFloat64, d) + } + } + case "FMapIntfBool": + if r.TryDecodeAsNil() { + x.FMapIntfBool = nil + } else { + if false { + } else { + z.F.DecMapIntfBoolX(&x.FMapIntfBool, d) + } + } + case "FptrMapIntfBool": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfBool != nil { + x.FptrMapIntfBool = nil + } + } else { + if x.FptrMapIntfBool == nil { + x.FptrMapIntfBool = new(map[interface{}]bool) + } + + if false { + } else { + z.F.DecMapIntfBoolX(x.FptrMapIntfBool, d) + } + } + case "FMapStringIntf": + if r.TryDecodeAsNil() { + x.FMapStringIntf = nil + } else { + if false { + } else { + z.F.DecMapStringIntfX(&x.FMapStringIntf, d) + } + } + case "FptrMapStringIntf": + if r.TryDecodeAsNil() { + if true && x.FptrMapStringIntf != nil { + x.FptrMapStringIntf = nil + } + } else { + if x.FptrMapStringIntf == nil { + x.FptrMapStringIntf = new(map[string]interface{}) + } + + if false { + } else { + z.F.DecMapStringIntfX(x.FptrMapStringIntf, d) + } + } + case "FMapStringString": + if r.TryDecodeAsNil() { + x.FMapStringString = nil + } else { + if false { + } else { + z.F.DecMapStringStringX(&x.FMapStringString, d) + } + } + case "FptrMapStringString": + if r.TryDecodeAsNil() { + if true && x.FptrMapStringString != nil { + x.FptrMapStringString = nil + } + } else { + if x.FptrMapStringString == nil { + x.FptrMapStringString = new(map[string]string) + } + + if false { + } else { + z.F.DecMapStringStringX(x.FptrMapStringString, d) + } + } + case "FMapStringUint": + if r.TryDecodeAsNil() { + x.FMapStringUint = nil + } else { + if false { + } else { + z.F.DecMapStringUintX(&x.FMapStringUint, d) + } + } + case "FptrMapStringUint": + if r.TryDecodeAsNil() { + if true && x.FptrMapStringUint != nil { + x.FptrMapStringUint = nil + } + } else { + if x.FptrMapStringUint == nil { + x.FptrMapStringUint = new(map[string]uint) + } + + if false { + } else { + z.F.DecMapStringUintX(x.FptrMapStringUint, d) + } + } + case "FMapStringUint8": + if r.TryDecodeAsNil() { + x.FMapStringUint8 = nil + } else { + if false { + } else { + z.F.DecMapStringUint8X(&x.FMapStringUint8, d) + } + } + case "FptrMapStringUint8": + if r.TryDecodeAsNil() { + if true && x.FptrMapStringUint8 != nil { + x.FptrMapStringUint8 = nil + } + } else { + if x.FptrMapStringUint8 == nil { + x.FptrMapStringUint8 = new(map[string]uint8) + } + + if false { + } else { + z.F.DecMapStringUint8X(x.FptrMapStringUint8, d) + } + } + case "FMapStringUint16": + if r.TryDecodeAsNil() { + x.FMapStringUint16 = nil + } else { + if false { + } else { + z.F.DecMapStringUint16X(&x.FMapStringUint16, d) + } + } + case "FptrMapStringUint16": + if r.TryDecodeAsNil() { + if true && x.FptrMapStringUint16 != nil { + x.FptrMapStringUint16 = nil + } + } else { + if x.FptrMapStringUint16 == nil { + x.FptrMapStringUint16 = new(map[string]uint16) + } + + if false { + } else { + z.F.DecMapStringUint16X(x.FptrMapStringUint16, d) + } + } + case "FMapStringUint32": + if r.TryDecodeAsNil() { + x.FMapStringUint32 = nil + } else { + if false { + } else { + z.F.DecMapStringUint32X(&x.FMapStringUint32, d) + } + } + case "FptrMapStringUint32": + if r.TryDecodeAsNil() { + if true && x.FptrMapStringUint32 != nil { + x.FptrMapStringUint32 = nil + } + } else { + if x.FptrMapStringUint32 == nil { + x.FptrMapStringUint32 = new(map[string]uint32) + } + + if false { + } else { + z.F.DecMapStringUint32X(x.FptrMapStringUint32, d) + } + } + case "FMapStringUint64": + if r.TryDecodeAsNil() { + x.FMapStringUint64 = nil + } else { + if false { + } else { + z.F.DecMapStringUint64X(&x.FMapStringUint64, d) + } + } + case "FptrMapStringUint64": + if r.TryDecodeAsNil() { + if true && x.FptrMapStringUint64 != nil { + x.FptrMapStringUint64 = nil + } + } else { + if x.FptrMapStringUint64 == nil { + x.FptrMapStringUint64 = new(map[string]uint64) + } + + if false { + } else { + z.F.DecMapStringUint64X(x.FptrMapStringUint64, d) + } + } + case "FMapStringUintptr": + if r.TryDecodeAsNil() { + x.FMapStringUintptr = nil + } else { + if false { + } else { + z.F.DecMapStringUintptrX(&x.FMapStringUintptr, d) + } + } + case "FptrMapStringUintptr": + if r.TryDecodeAsNil() { + if true && x.FptrMapStringUintptr != nil { + x.FptrMapStringUintptr = nil + } + } else { + if x.FptrMapStringUintptr == nil { + x.FptrMapStringUintptr = new(map[string]uintptr) + } + + if false { + } else { + z.F.DecMapStringUintptrX(x.FptrMapStringUintptr, d) + } + } + case "FMapStringInt": + if r.TryDecodeAsNil() { + x.FMapStringInt = nil + } else { + if false { + } else { + z.F.DecMapStringIntX(&x.FMapStringInt, d) + } + } + case "FptrMapStringInt": + if r.TryDecodeAsNil() { + if true && x.FptrMapStringInt != nil { + x.FptrMapStringInt = nil + } + } else { + if x.FptrMapStringInt == nil { + x.FptrMapStringInt = new(map[string]int) + } + + if false { + } else { + z.F.DecMapStringIntX(x.FptrMapStringInt, d) + } + } + case "FMapStringInt8": + if r.TryDecodeAsNil() { + x.FMapStringInt8 = nil + } else { + if false { + } else { + z.F.DecMapStringInt8X(&x.FMapStringInt8, d) + } + } + case "FptrMapStringInt8": + if r.TryDecodeAsNil() { + if true && x.FptrMapStringInt8 != nil { + x.FptrMapStringInt8 = nil + } + } else { + if x.FptrMapStringInt8 == nil { + x.FptrMapStringInt8 = new(map[string]int8) + } + + if false { + } else { + z.F.DecMapStringInt8X(x.FptrMapStringInt8, d) + } + } + case "FMapStringInt16": + if r.TryDecodeAsNil() { + x.FMapStringInt16 = nil + } else { + if false { + } else { + z.F.DecMapStringInt16X(&x.FMapStringInt16, d) + } + } + case "FptrMapStringInt16": + if r.TryDecodeAsNil() { + if true && x.FptrMapStringInt16 != nil { + x.FptrMapStringInt16 = nil + } + } else { + if x.FptrMapStringInt16 == nil { + x.FptrMapStringInt16 = new(map[string]int16) + } + + if false { + } else { + z.F.DecMapStringInt16X(x.FptrMapStringInt16, d) + } + } + case "FMapStringInt32": + if r.TryDecodeAsNil() { + x.FMapStringInt32 = nil + } else { + if false { + } else { + z.F.DecMapStringInt32X(&x.FMapStringInt32, d) + } + } + case "FptrMapStringInt32": + if r.TryDecodeAsNil() { + if true && x.FptrMapStringInt32 != nil { + x.FptrMapStringInt32 = nil + } + } else { + if x.FptrMapStringInt32 == nil { + x.FptrMapStringInt32 = new(map[string]int32) + } + + if false { + } else { + z.F.DecMapStringInt32X(x.FptrMapStringInt32, d) + } + } + case "FMapStringInt64": + if r.TryDecodeAsNil() { + x.FMapStringInt64 = nil + } else { + if false { + } else { + z.F.DecMapStringInt64X(&x.FMapStringInt64, d) + } + } + case "FptrMapStringInt64": + if r.TryDecodeAsNil() { + if true && x.FptrMapStringInt64 != nil { + x.FptrMapStringInt64 = nil + } + } else { + if x.FptrMapStringInt64 == nil { + x.FptrMapStringInt64 = new(map[string]int64) + } + + if false { + } else { + z.F.DecMapStringInt64X(x.FptrMapStringInt64, d) + } + } + case "FMapStringFloat32": + if r.TryDecodeAsNil() { + x.FMapStringFloat32 = nil + } else { + if false { + } else { + z.F.DecMapStringFloat32X(&x.FMapStringFloat32, d) + } + } + case "FptrMapStringFloat32": + if r.TryDecodeAsNil() { + if true && x.FptrMapStringFloat32 != nil { + x.FptrMapStringFloat32 = nil + } + } else { + if x.FptrMapStringFloat32 == nil { + x.FptrMapStringFloat32 = new(map[string]float32) + } + + if false { + } else { + z.F.DecMapStringFloat32X(x.FptrMapStringFloat32, d) + } + } + case "FMapStringFloat64": + if r.TryDecodeAsNil() { + x.FMapStringFloat64 = nil + } else { + if false { + } else { + z.F.DecMapStringFloat64X(&x.FMapStringFloat64, d) + } + } + case "FptrMapStringFloat64": + if r.TryDecodeAsNil() { + if true && x.FptrMapStringFloat64 != nil { + x.FptrMapStringFloat64 = nil + } + } else { + if x.FptrMapStringFloat64 == nil { + x.FptrMapStringFloat64 = new(map[string]float64) + } + + if false { + } else { + z.F.DecMapStringFloat64X(x.FptrMapStringFloat64, d) + } + } + case "FMapStringBool": + if r.TryDecodeAsNil() { + x.FMapStringBool = nil + } else { + if false { + } else { + z.F.DecMapStringBoolX(&x.FMapStringBool, d) + } + } + case "FptrMapStringBool": + if r.TryDecodeAsNil() { + if true && x.FptrMapStringBool != nil { + x.FptrMapStringBool = nil + } + } else { + if x.FptrMapStringBool == nil { + x.FptrMapStringBool = new(map[string]bool) + } + + if false { + } else { + z.F.DecMapStringBoolX(x.FptrMapStringBool, d) + } + } + case "FMapFloat32Intf": + if r.TryDecodeAsNil() { + x.FMapFloat32Intf = nil + } else { + if false { + } else { + z.F.DecMapFloat32IntfX(&x.FMapFloat32Intf, d) + } + } + case "FptrMapFloat32Intf": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Intf != nil { + x.FptrMapFloat32Intf = nil + } + } else { + if x.FptrMapFloat32Intf == nil { + x.FptrMapFloat32Intf = new(map[float32]interface{}) + } + + if false { + } else { + z.F.DecMapFloat32IntfX(x.FptrMapFloat32Intf, d) + } + } + case "FMapFloat32String": + if r.TryDecodeAsNil() { + x.FMapFloat32String = nil + } else { + if false { + } else { + z.F.DecMapFloat32StringX(&x.FMapFloat32String, d) + } + } + case "FptrMapFloat32String": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32String != nil { + x.FptrMapFloat32String = nil + } + } else { + if x.FptrMapFloat32String == nil { + x.FptrMapFloat32String = new(map[float32]string) + } + + if false { + } else { + z.F.DecMapFloat32StringX(x.FptrMapFloat32String, d) + } + } + case "FMapFloat32Uint": + if r.TryDecodeAsNil() { + x.FMapFloat32Uint = nil + } else { + if false { + } else { + z.F.DecMapFloat32UintX(&x.FMapFloat32Uint, d) + } + } + case "FptrMapFloat32Uint": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Uint != nil { + x.FptrMapFloat32Uint = nil + } + } else { + if x.FptrMapFloat32Uint == nil { + x.FptrMapFloat32Uint = new(map[float32]uint) + } + + if false { + } else { + z.F.DecMapFloat32UintX(x.FptrMapFloat32Uint, d) + } + } + case "FMapFloat32Uint8": + if r.TryDecodeAsNil() { + x.FMapFloat32Uint8 = nil + } else { + if false { + } else { + z.F.DecMapFloat32Uint8X(&x.FMapFloat32Uint8, d) + } + } + case "FptrMapFloat32Uint8": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Uint8 != nil { + x.FptrMapFloat32Uint8 = nil + } + } else { + if x.FptrMapFloat32Uint8 == nil { + x.FptrMapFloat32Uint8 = new(map[float32]uint8) + } + + if false { + } else { + z.F.DecMapFloat32Uint8X(x.FptrMapFloat32Uint8, d) + } + } + case "FMapFloat32Uint16": + if r.TryDecodeAsNil() { + x.FMapFloat32Uint16 = nil + } else { + if false { + } else { + z.F.DecMapFloat32Uint16X(&x.FMapFloat32Uint16, d) + } + } + case "FptrMapFloat32Uint16": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Uint16 != nil { + x.FptrMapFloat32Uint16 = nil + } + } else { + if x.FptrMapFloat32Uint16 == nil { + x.FptrMapFloat32Uint16 = new(map[float32]uint16) + } + + if false { + } else { + z.F.DecMapFloat32Uint16X(x.FptrMapFloat32Uint16, d) + } + } + case "FMapFloat32Uint32": + if r.TryDecodeAsNil() { + x.FMapFloat32Uint32 = nil + } else { + if false { + } else { + z.F.DecMapFloat32Uint32X(&x.FMapFloat32Uint32, d) + } + } + case "FptrMapFloat32Uint32": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Uint32 != nil { + x.FptrMapFloat32Uint32 = nil + } + } else { + if x.FptrMapFloat32Uint32 == nil { + x.FptrMapFloat32Uint32 = new(map[float32]uint32) + } + + if false { + } else { + z.F.DecMapFloat32Uint32X(x.FptrMapFloat32Uint32, d) + } + } + case "FMapFloat32Uint64": + if r.TryDecodeAsNil() { + x.FMapFloat32Uint64 = nil + } else { + if false { + } else { + z.F.DecMapFloat32Uint64X(&x.FMapFloat32Uint64, d) + } + } + case "FptrMapFloat32Uint64": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Uint64 != nil { + x.FptrMapFloat32Uint64 = nil + } + } else { + if x.FptrMapFloat32Uint64 == nil { + x.FptrMapFloat32Uint64 = new(map[float32]uint64) + } + + if false { + } else { + z.F.DecMapFloat32Uint64X(x.FptrMapFloat32Uint64, d) + } + } + case "FMapFloat32Uintptr": + if r.TryDecodeAsNil() { + x.FMapFloat32Uintptr = nil + } else { + if false { + } else { + z.F.DecMapFloat32UintptrX(&x.FMapFloat32Uintptr, d) + } + } + case "FptrMapFloat32Uintptr": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Uintptr != nil { + x.FptrMapFloat32Uintptr = nil + } + } else { + if x.FptrMapFloat32Uintptr == nil { + x.FptrMapFloat32Uintptr = new(map[float32]uintptr) + } + + if false { + } else { + z.F.DecMapFloat32UintptrX(x.FptrMapFloat32Uintptr, d) + } + } + case "FMapFloat32Int": + if r.TryDecodeAsNil() { + x.FMapFloat32Int = nil + } else { + if false { + } else { + z.F.DecMapFloat32IntX(&x.FMapFloat32Int, d) + } + } + case "FptrMapFloat32Int": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Int != nil { + x.FptrMapFloat32Int = nil + } + } else { + if x.FptrMapFloat32Int == nil { + x.FptrMapFloat32Int = new(map[float32]int) + } + + if false { + } else { + z.F.DecMapFloat32IntX(x.FptrMapFloat32Int, d) + } + } + case "FMapFloat32Int8": + if r.TryDecodeAsNil() { + x.FMapFloat32Int8 = nil + } else { + if false { + } else { + z.F.DecMapFloat32Int8X(&x.FMapFloat32Int8, d) + } + } + case "FptrMapFloat32Int8": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Int8 != nil { + x.FptrMapFloat32Int8 = nil + } + } else { + if x.FptrMapFloat32Int8 == nil { + x.FptrMapFloat32Int8 = new(map[float32]int8) + } + + if false { + } else { + z.F.DecMapFloat32Int8X(x.FptrMapFloat32Int8, d) + } + } + case "FMapFloat32Int16": + if r.TryDecodeAsNil() { + x.FMapFloat32Int16 = nil + } else { + if false { + } else { + z.F.DecMapFloat32Int16X(&x.FMapFloat32Int16, d) + } + } + case "FptrMapFloat32Int16": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Int16 != nil { + x.FptrMapFloat32Int16 = nil + } + } else { + if x.FptrMapFloat32Int16 == nil { + x.FptrMapFloat32Int16 = new(map[float32]int16) + } + + if false { + } else { + z.F.DecMapFloat32Int16X(x.FptrMapFloat32Int16, d) + } + } + case "FMapFloat32Int32": + if r.TryDecodeAsNil() { + x.FMapFloat32Int32 = nil + } else { + if false { + } else { + z.F.DecMapFloat32Int32X(&x.FMapFloat32Int32, d) + } + } + case "FptrMapFloat32Int32": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Int32 != nil { + x.FptrMapFloat32Int32 = nil + } + } else { + if x.FptrMapFloat32Int32 == nil { + x.FptrMapFloat32Int32 = new(map[float32]int32) + } + + if false { + } else { + z.F.DecMapFloat32Int32X(x.FptrMapFloat32Int32, d) + } + } + case "FMapFloat32Int64": + if r.TryDecodeAsNil() { + x.FMapFloat32Int64 = nil + } else { + if false { + } else { + z.F.DecMapFloat32Int64X(&x.FMapFloat32Int64, d) + } + } + case "FptrMapFloat32Int64": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Int64 != nil { + x.FptrMapFloat32Int64 = nil + } + } else { + if x.FptrMapFloat32Int64 == nil { + x.FptrMapFloat32Int64 = new(map[float32]int64) + } + + if false { + } else { + z.F.DecMapFloat32Int64X(x.FptrMapFloat32Int64, d) + } + } + case "FMapFloat32Float32": + if r.TryDecodeAsNil() { + x.FMapFloat32Float32 = nil + } else { + if false { + } else { + z.F.DecMapFloat32Float32X(&x.FMapFloat32Float32, d) + } + } + case "FptrMapFloat32Float32": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Float32 != nil { + x.FptrMapFloat32Float32 = nil + } + } else { + if x.FptrMapFloat32Float32 == nil { + x.FptrMapFloat32Float32 = new(map[float32]float32) + } + + if false { + } else { + z.F.DecMapFloat32Float32X(x.FptrMapFloat32Float32, d) + } + } + case "FMapFloat32Float64": + if r.TryDecodeAsNil() { + x.FMapFloat32Float64 = nil + } else { + if false { + } else { + z.F.DecMapFloat32Float64X(&x.FMapFloat32Float64, d) + } + } + case "FptrMapFloat32Float64": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Float64 != nil { + x.FptrMapFloat32Float64 = nil + } + } else { + if x.FptrMapFloat32Float64 == nil { + x.FptrMapFloat32Float64 = new(map[float32]float64) + } + + if false { + } else { + z.F.DecMapFloat32Float64X(x.FptrMapFloat32Float64, d) + } + } + case "FMapFloat32Bool": + if r.TryDecodeAsNil() { + x.FMapFloat32Bool = nil + } else { + if false { + } else { + z.F.DecMapFloat32BoolX(&x.FMapFloat32Bool, d) + } + } + case "FptrMapFloat32Bool": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Bool != nil { + x.FptrMapFloat32Bool = nil + } + } else { + if x.FptrMapFloat32Bool == nil { + x.FptrMapFloat32Bool = new(map[float32]bool) + } + + if false { + } else { + z.F.DecMapFloat32BoolX(x.FptrMapFloat32Bool, d) + } + } + case "FMapFloat64Intf": + if r.TryDecodeAsNil() { + x.FMapFloat64Intf = nil + } else { + if false { + } else { + z.F.DecMapFloat64IntfX(&x.FMapFloat64Intf, d) + } + } + case "FptrMapFloat64Intf": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Intf != nil { + x.FptrMapFloat64Intf = nil + } + } else { + if x.FptrMapFloat64Intf == nil { + x.FptrMapFloat64Intf = new(map[float64]interface{}) + } + + if false { + } else { + z.F.DecMapFloat64IntfX(x.FptrMapFloat64Intf, d) + } + } + case "FMapFloat64String": + if r.TryDecodeAsNil() { + x.FMapFloat64String = nil + } else { + if false { + } else { + z.F.DecMapFloat64StringX(&x.FMapFloat64String, d) + } + } + case "FptrMapFloat64String": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64String != nil { + x.FptrMapFloat64String = nil + } + } else { + if x.FptrMapFloat64String == nil { + x.FptrMapFloat64String = new(map[float64]string) + } + + if false { + } else { + z.F.DecMapFloat64StringX(x.FptrMapFloat64String, d) + } + } + case "FMapFloat64Uint": + if r.TryDecodeAsNil() { + x.FMapFloat64Uint = nil + } else { + if false { + } else { + z.F.DecMapFloat64UintX(&x.FMapFloat64Uint, d) + } + } + case "FptrMapFloat64Uint": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Uint != nil { + x.FptrMapFloat64Uint = nil + } + } else { + if x.FptrMapFloat64Uint == nil { + x.FptrMapFloat64Uint = new(map[float64]uint) + } + + if false { + } else { + z.F.DecMapFloat64UintX(x.FptrMapFloat64Uint, d) + } + } + case "FMapFloat64Uint8": + if r.TryDecodeAsNil() { + x.FMapFloat64Uint8 = nil + } else { + if false { + } else { + z.F.DecMapFloat64Uint8X(&x.FMapFloat64Uint8, d) + } + } + case "FptrMapFloat64Uint8": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Uint8 != nil { + x.FptrMapFloat64Uint8 = nil + } + } else { + if x.FptrMapFloat64Uint8 == nil { + x.FptrMapFloat64Uint8 = new(map[float64]uint8) + } + + if false { + } else { + z.F.DecMapFloat64Uint8X(x.FptrMapFloat64Uint8, d) + } + } + case "FMapFloat64Uint16": + if r.TryDecodeAsNil() { + x.FMapFloat64Uint16 = nil + } else { + if false { + } else { + z.F.DecMapFloat64Uint16X(&x.FMapFloat64Uint16, d) + } + } + case "FptrMapFloat64Uint16": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Uint16 != nil { + x.FptrMapFloat64Uint16 = nil + } + } else { + if x.FptrMapFloat64Uint16 == nil { + x.FptrMapFloat64Uint16 = new(map[float64]uint16) + } + + if false { + } else { + z.F.DecMapFloat64Uint16X(x.FptrMapFloat64Uint16, d) + } + } + case "FMapFloat64Uint32": + if r.TryDecodeAsNil() { + x.FMapFloat64Uint32 = nil + } else { + if false { + } else { + z.F.DecMapFloat64Uint32X(&x.FMapFloat64Uint32, d) + } + } + case "FptrMapFloat64Uint32": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Uint32 != nil { + x.FptrMapFloat64Uint32 = nil + } + } else { + if x.FptrMapFloat64Uint32 == nil { + x.FptrMapFloat64Uint32 = new(map[float64]uint32) + } + + if false { + } else { + z.F.DecMapFloat64Uint32X(x.FptrMapFloat64Uint32, d) + } + } + case "FMapFloat64Uint64": + if r.TryDecodeAsNil() { + x.FMapFloat64Uint64 = nil + } else { + if false { + } else { + z.F.DecMapFloat64Uint64X(&x.FMapFloat64Uint64, d) + } + } + case "FptrMapFloat64Uint64": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Uint64 != nil { + x.FptrMapFloat64Uint64 = nil + } + } else { + if x.FptrMapFloat64Uint64 == nil { + x.FptrMapFloat64Uint64 = new(map[float64]uint64) + } + + if false { + } else { + z.F.DecMapFloat64Uint64X(x.FptrMapFloat64Uint64, d) + } + } + case "FMapFloat64Uintptr": + if r.TryDecodeAsNil() { + x.FMapFloat64Uintptr = nil + } else { + if false { + } else { + z.F.DecMapFloat64UintptrX(&x.FMapFloat64Uintptr, d) + } + } + case "FptrMapFloat64Uintptr": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Uintptr != nil { + x.FptrMapFloat64Uintptr = nil + } + } else { + if x.FptrMapFloat64Uintptr == nil { + x.FptrMapFloat64Uintptr = new(map[float64]uintptr) + } + + if false { + } else { + z.F.DecMapFloat64UintptrX(x.FptrMapFloat64Uintptr, d) + } + } + case "FMapFloat64Int": + if r.TryDecodeAsNil() { + x.FMapFloat64Int = nil + } else { + if false { + } else { + z.F.DecMapFloat64IntX(&x.FMapFloat64Int, d) + } + } + case "FptrMapFloat64Int": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Int != nil { + x.FptrMapFloat64Int = nil + } + } else { + if x.FptrMapFloat64Int == nil { + x.FptrMapFloat64Int = new(map[float64]int) + } + + if false { + } else { + z.F.DecMapFloat64IntX(x.FptrMapFloat64Int, d) + } + } + case "FMapFloat64Int8": + if r.TryDecodeAsNil() { + x.FMapFloat64Int8 = nil + } else { + if false { + } else { + z.F.DecMapFloat64Int8X(&x.FMapFloat64Int8, d) + } + } + case "FptrMapFloat64Int8": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Int8 != nil { + x.FptrMapFloat64Int8 = nil + } + } else { + if x.FptrMapFloat64Int8 == nil { + x.FptrMapFloat64Int8 = new(map[float64]int8) + } + + if false { + } else { + z.F.DecMapFloat64Int8X(x.FptrMapFloat64Int8, d) + } + } + case "FMapFloat64Int16": + if r.TryDecodeAsNil() { + x.FMapFloat64Int16 = nil + } else { + if false { + } else { + z.F.DecMapFloat64Int16X(&x.FMapFloat64Int16, d) + } + } + case "FptrMapFloat64Int16": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Int16 != nil { + x.FptrMapFloat64Int16 = nil + } + } else { + if x.FptrMapFloat64Int16 == nil { + x.FptrMapFloat64Int16 = new(map[float64]int16) + } + + if false { + } else { + z.F.DecMapFloat64Int16X(x.FptrMapFloat64Int16, d) + } + } + case "FMapFloat64Int32": + if r.TryDecodeAsNil() { + x.FMapFloat64Int32 = nil + } else { + if false { + } else { + z.F.DecMapFloat64Int32X(&x.FMapFloat64Int32, d) + } + } + case "FptrMapFloat64Int32": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Int32 != nil { + x.FptrMapFloat64Int32 = nil + } + } else { + if x.FptrMapFloat64Int32 == nil { + x.FptrMapFloat64Int32 = new(map[float64]int32) + } + + if false { + } else { + z.F.DecMapFloat64Int32X(x.FptrMapFloat64Int32, d) + } + } + case "FMapFloat64Int64": + if r.TryDecodeAsNil() { + x.FMapFloat64Int64 = nil + } else { + if false { + } else { + z.F.DecMapFloat64Int64X(&x.FMapFloat64Int64, d) + } + } + case "FptrMapFloat64Int64": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Int64 != nil { + x.FptrMapFloat64Int64 = nil + } + } else { + if x.FptrMapFloat64Int64 == nil { + x.FptrMapFloat64Int64 = new(map[float64]int64) + } + + if false { + } else { + z.F.DecMapFloat64Int64X(x.FptrMapFloat64Int64, d) + } + } + case "FMapFloat64Float32": + if r.TryDecodeAsNil() { + x.FMapFloat64Float32 = nil + } else { + if false { + } else { + z.F.DecMapFloat64Float32X(&x.FMapFloat64Float32, d) + } + } + case "FptrMapFloat64Float32": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Float32 != nil { + x.FptrMapFloat64Float32 = nil + } + } else { + if x.FptrMapFloat64Float32 == nil { + x.FptrMapFloat64Float32 = new(map[float64]float32) + } + + if false { + } else { + z.F.DecMapFloat64Float32X(x.FptrMapFloat64Float32, d) + } + } + case "FMapFloat64Float64": + if r.TryDecodeAsNil() { + x.FMapFloat64Float64 = nil + } else { + if false { + } else { + z.F.DecMapFloat64Float64X(&x.FMapFloat64Float64, d) + } + } + case "FptrMapFloat64Float64": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Float64 != nil { + x.FptrMapFloat64Float64 = nil + } + } else { + if x.FptrMapFloat64Float64 == nil { + x.FptrMapFloat64Float64 = new(map[float64]float64) + } + + if false { + } else { + z.F.DecMapFloat64Float64X(x.FptrMapFloat64Float64, d) + } + } + case "FMapFloat64Bool": + if r.TryDecodeAsNil() { + x.FMapFloat64Bool = nil + } else { + if false { + } else { + z.F.DecMapFloat64BoolX(&x.FMapFloat64Bool, d) + } + } + case "FptrMapFloat64Bool": + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Bool != nil { + x.FptrMapFloat64Bool = nil + } + } else { + if x.FptrMapFloat64Bool == nil { + x.FptrMapFloat64Bool = new(map[float64]bool) + } + + if false { + } else { + z.F.DecMapFloat64BoolX(x.FptrMapFloat64Bool, d) + } + } + case "FMapUintIntf": + if r.TryDecodeAsNil() { + x.FMapUintIntf = nil + } else { + if false { + } else { + z.F.DecMapUintIntfX(&x.FMapUintIntf, d) + } + } + case "FptrMapUintIntf": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintIntf != nil { + x.FptrMapUintIntf = nil + } + } else { + if x.FptrMapUintIntf == nil { + x.FptrMapUintIntf = new(map[uint]interface{}) + } + + if false { + } else { + z.F.DecMapUintIntfX(x.FptrMapUintIntf, d) + } + } + case "FMapUintString": + if r.TryDecodeAsNil() { + x.FMapUintString = nil + } else { + if false { + } else { + z.F.DecMapUintStringX(&x.FMapUintString, d) + } + } + case "FptrMapUintString": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintString != nil { + x.FptrMapUintString = nil + } + } else { + if x.FptrMapUintString == nil { + x.FptrMapUintString = new(map[uint]string) + } + + if false { + } else { + z.F.DecMapUintStringX(x.FptrMapUintString, d) + } + } + case "FMapUintUint": + if r.TryDecodeAsNil() { + x.FMapUintUint = nil + } else { + if false { + } else { + z.F.DecMapUintUintX(&x.FMapUintUint, d) + } + } + case "FptrMapUintUint": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintUint != nil { + x.FptrMapUintUint = nil + } + } else { + if x.FptrMapUintUint == nil { + x.FptrMapUintUint = new(map[uint]uint) + } + + if false { + } else { + z.F.DecMapUintUintX(x.FptrMapUintUint, d) + } + } + case "FMapUintUint8": + if r.TryDecodeAsNil() { + x.FMapUintUint8 = nil + } else { + if false { + } else { + z.F.DecMapUintUint8X(&x.FMapUintUint8, d) + } + } + case "FptrMapUintUint8": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintUint8 != nil { + x.FptrMapUintUint8 = nil + } + } else { + if x.FptrMapUintUint8 == nil { + x.FptrMapUintUint8 = new(map[uint]uint8) + } + + if false { + } else { + z.F.DecMapUintUint8X(x.FptrMapUintUint8, d) + } + } + case "FMapUintUint16": + if r.TryDecodeAsNil() { + x.FMapUintUint16 = nil + } else { + if false { + } else { + z.F.DecMapUintUint16X(&x.FMapUintUint16, d) + } + } + case "FptrMapUintUint16": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintUint16 != nil { + x.FptrMapUintUint16 = nil + } + } else { + if x.FptrMapUintUint16 == nil { + x.FptrMapUintUint16 = new(map[uint]uint16) + } + + if false { + } else { + z.F.DecMapUintUint16X(x.FptrMapUintUint16, d) + } + } + case "FMapUintUint32": + if r.TryDecodeAsNil() { + x.FMapUintUint32 = nil + } else { + if false { + } else { + z.F.DecMapUintUint32X(&x.FMapUintUint32, d) + } + } + case "FptrMapUintUint32": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintUint32 != nil { + x.FptrMapUintUint32 = nil + } + } else { + if x.FptrMapUintUint32 == nil { + x.FptrMapUintUint32 = new(map[uint]uint32) + } + + if false { + } else { + z.F.DecMapUintUint32X(x.FptrMapUintUint32, d) + } + } + case "FMapUintUint64": + if r.TryDecodeAsNil() { + x.FMapUintUint64 = nil + } else { + if false { + } else { + z.F.DecMapUintUint64X(&x.FMapUintUint64, d) + } + } + case "FptrMapUintUint64": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintUint64 != nil { + x.FptrMapUintUint64 = nil + } + } else { + if x.FptrMapUintUint64 == nil { + x.FptrMapUintUint64 = new(map[uint]uint64) + } + + if false { + } else { + z.F.DecMapUintUint64X(x.FptrMapUintUint64, d) + } + } + case "FMapUintUintptr": + if r.TryDecodeAsNil() { + x.FMapUintUintptr = nil + } else { + if false { + } else { + z.F.DecMapUintUintptrX(&x.FMapUintUintptr, d) + } + } + case "FptrMapUintUintptr": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintUintptr != nil { + x.FptrMapUintUintptr = nil + } + } else { + if x.FptrMapUintUintptr == nil { + x.FptrMapUintUintptr = new(map[uint]uintptr) + } + + if false { + } else { + z.F.DecMapUintUintptrX(x.FptrMapUintUintptr, d) + } + } + case "FMapUintInt": + if r.TryDecodeAsNil() { + x.FMapUintInt = nil + } else { + if false { + } else { + z.F.DecMapUintIntX(&x.FMapUintInt, d) + } + } + case "FptrMapUintInt": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintInt != nil { + x.FptrMapUintInt = nil + } + } else { + if x.FptrMapUintInt == nil { + x.FptrMapUintInt = new(map[uint]int) + } + + if false { + } else { + z.F.DecMapUintIntX(x.FptrMapUintInt, d) + } + } + case "FMapUintInt8": + if r.TryDecodeAsNil() { + x.FMapUintInt8 = nil + } else { + if false { + } else { + z.F.DecMapUintInt8X(&x.FMapUintInt8, d) + } + } + case "FptrMapUintInt8": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintInt8 != nil { + x.FptrMapUintInt8 = nil + } + } else { + if x.FptrMapUintInt8 == nil { + x.FptrMapUintInt8 = new(map[uint]int8) + } + + if false { + } else { + z.F.DecMapUintInt8X(x.FptrMapUintInt8, d) + } + } + case "FMapUintInt16": + if r.TryDecodeAsNil() { + x.FMapUintInt16 = nil + } else { + if false { + } else { + z.F.DecMapUintInt16X(&x.FMapUintInt16, d) + } + } + case "FptrMapUintInt16": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintInt16 != nil { + x.FptrMapUintInt16 = nil + } + } else { + if x.FptrMapUintInt16 == nil { + x.FptrMapUintInt16 = new(map[uint]int16) + } + + if false { + } else { + z.F.DecMapUintInt16X(x.FptrMapUintInt16, d) + } + } + case "FMapUintInt32": + if r.TryDecodeAsNil() { + x.FMapUintInt32 = nil + } else { + if false { + } else { + z.F.DecMapUintInt32X(&x.FMapUintInt32, d) + } + } + case "FptrMapUintInt32": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintInt32 != nil { + x.FptrMapUintInt32 = nil + } + } else { + if x.FptrMapUintInt32 == nil { + x.FptrMapUintInt32 = new(map[uint]int32) + } + + if false { + } else { + z.F.DecMapUintInt32X(x.FptrMapUintInt32, d) + } + } + case "FMapUintInt64": + if r.TryDecodeAsNil() { + x.FMapUintInt64 = nil + } else { + if false { + } else { + z.F.DecMapUintInt64X(&x.FMapUintInt64, d) + } + } + case "FptrMapUintInt64": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintInt64 != nil { + x.FptrMapUintInt64 = nil + } + } else { + if x.FptrMapUintInt64 == nil { + x.FptrMapUintInt64 = new(map[uint]int64) + } + + if false { + } else { + z.F.DecMapUintInt64X(x.FptrMapUintInt64, d) + } + } + case "FMapUintFloat32": + if r.TryDecodeAsNil() { + x.FMapUintFloat32 = nil + } else { + if false { + } else { + z.F.DecMapUintFloat32X(&x.FMapUintFloat32, d) + } + } + case "FptrMapUintFloat32": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintFloat32 != nil { + x.FptrMapUintFloat32 = nil + } + } else { + if x.FptrMapUintFloat32 == nil { + x.FptrMapUintFloat32 = new(map[uint]float32) + } + + if false { + } else { + z.F.DecMapUintFloat32X(x.FptrMapUintFloat32, d) + } + } + case "FMapUintFloat64": + if r.TryDecodeAsNil() { + x.FMapUintFloat64 = nil + } else { + if false { + } else { + z.F.DecMapUintFloat64X(&x.FMapUintFloat64, d) + } + } + case "FptrMapUintFloat64": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintFloat64 != nil { + x.FptrMapUintFloat64 = nil + } + } else { + if x.FptrMapUintFloat64 == nil { + x.FptrMapUintFloat64 = new(map[uint]float64) + } + + if false { + } else { + z.F.DecMapUintFloat64X(x.FptrMapUintFloat64, d) + } + } + case "FMapUintBool": + if r.TryDecodeAsNil() { + x.FMapUintBool = nil + } else { + if false { + } else { + z.F.DecMapUintBoolX(&x.FMapUintBool, d) + } + } + case "FptrMapUintBool": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintBool != nil { + x.FptrMapUintBool = nil + } + } else { + if x.FptrMapUintBool == nil { + x.FptrMapUintBool = new(map[uint]bool) + } + + if false { + } else { + z.F.DecMapUintBoolX(x.FptrMapUintBool, d) + } + } + case "FMapUint8Intf": + if r.TryDecodeAsNil() { + x.FMapUint8Intf = nil + } else { + if false { + } else { + z.F.DecMapUint8IntfX(&x.FMapUint8Intf, d) + } + } + case "FptrMapUint8Intf": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Intf != nil { + x.FptrMapUint8Intf = nil + } + } else { + if x.FptrMapUint8Intf == nil { + x.FptrMapUint8Intf = new(map[uint8]interface{}) + } + + if false { + } else { + z.F.DecMapUint8IntfX(x.FptrMapUint8Intf, d) + } + } + case "FMapUint8String": + if r.TryDecodeAsNil() { + x.FMapUint8String = nil + } else { + if false { + } else { + z.F.DecMapUint8StringX(&x.FMapUint8String, d) + } + } + case "FptrMapUint8String": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8String != nil { + x.FptrMapUint8String = nil + } + } else { + if x.FptrMapUint8String == nil { + x.FptrMapUint8String = new(map[uint8]string) + } + + if false { + } else { + z.F.DecMapUint8StringX(x.FptrMapUint8String, d) + } + } + case "FMapUint8Uint": + if r.TryDecodeAsNil() { + x.FMapUint8Uint = nil + } else { + if false { + } else { + z.F.DecMapUint8UintX(&x.FMapUint8Uint, d) + } + } + case "FptrMapUint8Uint": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Uint != nil { + x.FptrMapUint8Uint = nil + } + } else { + if x.FptrMapUint8Uint == nil { + x.FptrMapUint8Uint = new(map[uint8]uint) + } + + if false { + } else { + z.F.DecMapUint8UintX(x.FptrMapUint8Uint, d) + } + } + case "FMapUint8Uint8": + if r.TryDecodeAsNil() { + x.FMapUint8Uint8 = nil + } else { + if false { + } else { + z.F.DecMapUint8Uint8X(&x.FMapUint8Uint8, d) + } + } + case "FptrMapUint8Uint8": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Uint8 != nil { + x.FptrMapUint8Uint8 = nil + } + } else { + if x.FptrMapUint8Uint8 == nil { + x.FptrMapUint8Uint8 = new(map[uint8]uint8) + } + + if false { + } else { + z.F.DecMapUint8Uint8X(x.FptrMapUint8Uint8, d) + } + } + case "FMapUint8Uint16": + if r.TryDecodeAsNil() { + x.FMapUint8Uint16 = nil + } else { + if false { + } else { + z.F.DecMapUint8Uint16X(&x.FMapUint8Uint16, d) + } + } + case "FptrMapUint8Uint16": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Uint16 != nil { + x.FptrMapUint8Uint16 = nil + } + } else { + if x.FptrMapUint8Uint16 == nil { + x.FptrMapUint8Uint16 = new(map[uint8]uint16) + } + + if false { + } else { + z.F.DecMapUint8Uint16X(x.FptrMapUint8Uint16, d) + } + } + case "FMapUint8Uint32": + if r.TryDecodeAsNil() { + x.FMapUint8Uint32 = nil + } else { + if false { + } else { + z.F.DecMapUint8Uint32X(&x.FMapUint8Uint32, d) + } + } + case "FptrMapUint8Uint32": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Uint32 != nil { + x.FptrMapUint8Uint32 = nil + } + } else { + if x.FptrMapUint8Uint32 == nil { + x.FptrMapUint8Uint32 = new(map[uint8]uint32) + } + + if false { + } else { + z.F.DecMapUint8Uint32X(x.FptrMapUint8Uint32, d) + } + } + case "FMapUint8Uint64": + if r.TryDecodeAsNil() { + x.FMapUint8Uint64 = nil + } else { + if false { + } else { + z.F.DecMapUint8Uint64X(&x.FMapUint8Uint64, d) + } + } + case "FptrMapUint8Uint64": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Uint64 != nil { + x.FptrMapUint8Uint64 = nil + } + } else { + if x.FptrMapUint8Uint64 == nil { + x.FptrMapUint8Uint64 = new(map[uint8]uint64) + } + + if false { + } else { + z.F.DecMapUint8Uint64X(x.FptrMapUint8Uint64, d) + } + } + case "FMapUint8Uintptr": + if r.TryDecodeAsNil() { + x.FMapUint8Uintptr = nil + } else { + if false { + } else { + z.F.DecMapUint8UintptrX(&x.FMapUint8Uintptr, d) + } + } + case "FptrMapUint8Uintptr": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Uintptr != nil { + x.FptrMapUint8Uintptr = nil + } + } else { + if x.FptrMapUint8Uintptr == nil { + x.FptrMapUint8Uintptr = new(map[uint8]uintptr) + } + + if false { + } else { + z.F.DecMapUint8UintptrX(x.FptrMapUint8Uintptr, d) + } + } + case "FMapUint8Int": + if r.TryDecodeAsNil() { + x.FMapUint8Int = nil + } else { + if false { + } else { + z.F.DecMapUint8IntX(&x.FMapUint8Int, d) + } + } + case "FptrMapUint8Int": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Int != nil { + x.FptrMapUint8Int = nil + } + } else { + if x.FptrMapUint8Int == nil { + x.FptrMapUint8Int = new(map[uint8]int) + } + + if false { + } else { + z.F.DecMapUint8IntX(x.FptrMapUint8Int, d) + } + } + case "FMapUint8Int8": + if r.TryDecodeAsNil() { + x.FMapUint8Int8 = nil + } else { + if false { + } else { + z.F.DecMapUint8Int8X(&x.FMapUint8Int8, d) + } + } + case "FptrMapUint8Int8": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Int8 != nil { + x.FptrMapUint8Int8 = nil + } + } else { + if x.FptrMapUint8Int8 == nil { + x.FptrMapUint8Int8 = new(map[uint8]int8) + } + + if false { + } else { + z.F.DecMapUint8Int8X(x.FptrMapUint8Int8, d) + } + } + case "FMapUint8Int16": + if r.TryDecodeAsNil() { + x.FMapUint8Int16 = nil + } else { + if false { + } else { + z.F.DecMapUint8Int16X(&x.FMapUint8Int16, d) + } + } + case "FptrMapUint8Int16": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Int16 != nil { + x.FptrMapUint8Int16 = nil + } + } else { + if x.FptrMapUint8Int16 == nil { + x.FptrMapUint8Int16 = new(map[uint8]int16) + } + + if false { + } else { + z.F.DecMapUint8Int16X(x.FptrMapUint8Int16, d) + } + } + case "FMapUint8Int32": + if r.TryDecodeAsNil() { + x.FMapUint8Int32 = nil + } else { + if false { + } else { + z.F.DecMapUint8Int32X(&x.FMapUint8Int32, d) + } + } + case "FptrMapUint8Int32": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Int32 != nil { + x.FptrMapUint8Int32 = nil + } + } else { + if x.FptrMapUint8Int32 == nil { + x.FptrMapUint8Int32 = new(map[uint8]int32) + } + + if false { + } else { + z.F.DecMapUint8Int32X(x.FptrMapUint8Int32, d) + } + } + case "FMapUint8Int64": + if r.TryDecodeAsNil() { + x.FMapUint8Int64 = nil + } else { + if false { + } else { + z.F.DecMapUint8Int64X(&x.FMapUint8Int64, d) + } + } + case "FptrMapUint8Int64": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Int64 != nil { + x.FptrMapUint8Int64 = nil + } + } else { + if x.FptrMapUint8Int64 == nil { + x.FptrMapUint8Int64 = new(map[uint8]int64) + } + + if false { + } else { + z.F.DecMapUint8Int64X(x.FptrMapUint8Int64, d) + } + } + case "FMapUint8Float32": + if r.TryDecodeAsNil() { + x.FMapUint8Float32 = nil + } else { + if false { + } else { + z.F.DecMapUint8Float32X(&x.FMapUint8Float32, d) + } + } + case "FptrMapUint8Float32": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Float32 != nil { + x.FptrMapUint8Float32 = nil + } + } else { + if x.FptrMapUint8Float32 == nil { + x.FptrMapUint8Float32 = new(map[uint8]float32) + } + + if false { + } else { + z.F.DecMapUint8Float32X(x.FptrMapUint8Float32, d) + } + } + case "FMapUint8Float64": + if r.TryDecodeAsNil() { + x.FMapUint8Float64 = nil + } else { + if false { + } else { + z.F.DecMapUint8Float64X(&x.FMapUint8Float64, d) + } + } + case "FptrMapUint8Float64": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Float64 != nil { + x.FptrMapUint8Float64 = nil + } + } else { + if x.FptrMapUint8Float64 == nil { + x.FptrMapUint8Float64 = new(map[uint8]float64) + } + + if false { + } else { + z.F.DecMapUint8Float64X(x.FptrMapUint8Float64, d) + } + } + case "FMapUint8Bool": + if r.TryDecodeAsNil() { + x.FMapUint8Bool = nil + } else { + if false { + } else { + z.F.DecMapUint8BoolX(&x.FMapUint8Bool, d) + } + } + case "FptrMapUint8Bool": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Bool != nil { + x.FptrMapUint8Bool = nil + } + } else { + if x.FptrMapUint8Bool == nil { + x.FptrMapUint8Bool = new(map[uint8]bool) + } + + if false { + } else { + z.F.DecMapUint8BoolX(x.FptrMapUint8Bool, d) + } + } + case "FMapUint16Intf": + if r.TryDecodeAsNil() { + x.FMapUint16Intf = nil + } else { + if false { + } else { + z.F.DecMapUint16IntfX(&x.FMapUint16Intf, d) + } + } + case "FptrMapUint16Intf": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Intf != nil { + x.FptrMapUint16Intf = nil + } + } else { + if x.FptrMapUint16Intf == nil { + x.FptrMapUint16Intf = new(map[uint16]interface{}) + } + + if false { + } else { + z.F.DecMapUint16IntfX(x.FptrMapUint16Intf, d) + } + } + case "FMapUint16String": + if r.TryDecodeAsNil() { + x.FMapUint16String = nil + } else { + if false { + } else { + z.F.DecMapUint16StringX(&x.FMapUint16String, d) + } + } + case "FptrMapUint16String": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16String != nil { + x.FptrMapUint16String = nil + } + } else { + if x.FptrMapUint16String == nil { + x.FptrMapUint16String = new(map[uint16]string) + } + + if false { + } else { + z.F.DecMapUint16StringX(x.FptrMapUint16String, d) + } + } + case "FMapUint16Uint": + if r.TryDecodeAsNil() { + x.FMapUint16Uint = nil + } else { + if false { + } else { + z.F.DecMapUint16UintX(&x.FMapUint16Uint, d) + } + } + case "FptrMapUint16Uint": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Uint != nil { + x.FptrMapUint16Uint = nil + } + } else { + if x.FptrMapUint16Uint == nil { + x.FptrMapUint16Uint = new(map[uint16]uint) + } + + if false { + } else { + z.F.DecMapUint16UintX(x.FptrMapUint16Uint, d) + } + } + case "FMapUint16Uint8": + if r.TryDecodeAsNil() { + x.FMapUint16Uint8 = nil + } else { + if false { + } else { + z.F.DecMapUint16Uint8X(&x.FMapUint16Uint8, d) + } + } + case "FptrMapUint16Uint8": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Uint8 != nil { + x.FptrMapUint16Uint8 = nil + } + } else { + if x.FptrMapUint16Uint8 == nil { + x.FptrMapUint16Uint8 = new(map[uint16]uint8) + } + + if false { + } else { + z.F.DecMapUint16Uint8X(x.FptrMapUint16Uint8, d) + } + } + case "FMapUint16Uint16": + if r.TryDecodeAsNil() { + x.FMapUint16Uint16 = nil + } else { + if false { + } else { + z.F.DecMapUint16Uint16X(&x.FMapUint16Uint16, d) + } + } + case "FptrMapUint16Uint16": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Uint16 != nil { + x.FptrMapUint16Uint16 = nil + } + } else { + if x.FptrMapUint16Uint16 == nil { + x.FptrMapUint16Uint16 = new(map[uint16]uint16) + } + + if false { + } else { + z.F.DecMapUint16Uint16X(x.FptrMapUint16Uint16, d) + } + } + case "FMapUint16Uint32": + if r.TryDecodeAsNil() { + x.FMapUint16Uint32 = nil + } else { + if false { + } else { + z.F.DecMapUint16Uint32X(&x.FMapUint16Uint32, d) + } + } + case "FptrMapUint16Uint32": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Uint32 != nil { + x.FptrMapUint16Uint32 = nil + } + } else { + if x.FptrMapUint16Uint32 == nil { + x.FptrMapUint16Uint32 = new(map[uint16]uint32) + } + + if false { + } else { + z.F.DecMapUint16Uint32X(x.FptrMapUint16Uint32, d) + } + } + case "FMapUint16Uint64": + if r.TryDecodeAsNil() { + x.FMapUint16Uint64 = nil + } else { + if false { + } else { + z.F.DecMapUint16Uint64X(&x.FMapUint16Uint64, d) + } + } + case "FptrMapUint16Uint64": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Uint64 != nil { + x.FptrMapUint16Uint64 = nil + } + } else { + if x.FptrMapUint16Uint64 == nil { + x.FptrMapUint16Uint64 = new(map[uint16]uint64) + } + + if false { + } else { + z.F.DecMapUint16Uint64X(x.FptrMapUint16Uint64, d) + } + } + case "FMapUint16Uintptr": + if r.TryDecodeAsNil() { + x.FMapUint16Uintptr = nil + } else { + if false { + } else { + z.F.DecMapUint16UintptrX(&x.FMapUint16Uintptr, d) + } + } + case "FptrMapUint16Uintptr": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Uintptr != nil { + x.FptrMapUint16Uintptr = nil + } + } else { + if x.FptrMapUint16Uintptr == nil { + x.FptrMapUint16Uintptr = new(map[uint16]uintptr) + } + + if false { + } else { + z.F.DecMapUint16UintptrX(x.FptrMapUint16Uintptr, d) + } + } + case "FMapUint16Int": + if r.TryDecodeAsNil() { + x.FMapUint16Int = nil + } else { + if false { + } else { + z.F.DecMapUint16IntX(&x.FMapUint16Int, d) + } + } + case "FptrMapUint16Int": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Int != nil { + x.FptrMapUint16Int = nil + } + } else { + if x.FptrMapUint16Int == nil { + x.FptrMapUint16Int = new(map[uint16]int) + } + + if false { + } else { + z.F.DecMapUint16IntX(x.FptrMapUint16Int, d) + } + } + case "FMapUint16Int8": + if r.TryDecodeAsNil() { + x.FMapUint16Int8 = nil + } else { + if false { + } else { + z.F.DecMapUint16Int8X(&x.FMapUint16Int8, d) + } + } + case "FptrMapUint16Int8": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Int8 != nil { + x.FptrMapUint16Int8 = nil + } + } else { + if x.FptrMapUint16Int8 == nil { + x.FptrMapUint16Int8 = new(map[uint16]int8) + } + + if false { + } else { + z.F.DecMapUint16Int8X(x.FptrMapUint16Int8, d) + } + } + case "FMapUint16Int16": + if r.TryDecodeAsNil() { + x.FMapUint16Int16 = nil + } else { + if false { + } else { + z.F.DecMapUint16Int16X(&x.FMapUint16Int16, d) + } + } + case "FptrMapUint16Int16": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Int16 != nil { + x.FptrMapUint16Int16 = nil + } + } else { + if x.FptrMapUint16Int16 == nil { + x.FptrMapUint16Int16 = new(map[uint16]int16) + } + + if false { + } else { + z.F.DecMapUint16Int16X(x.FptrMapUint16Int16, d) + } + } + case "FMapUint16Int32": + if r.TryDecodeAsNil() { + x.FMapUint16Int32 = nil + } else { + if false { + } else { + z.F.DecMapUint16Int32X(&x.FMapUint16Int32, d) + } + } + case "FptrMapUint16Int32": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Int32 != nil { + x.FptrMapUint16Int32 = nil + } + } else { + if x.FptrMapUint16Int32 == nil { + x.FptrMapUint16Int32 = new(map[uint16]int32) + } + + if false { + } else { + z.F.DecMapUint16Int32X(x.FptrMapUint16Int32, d) + } + } + case "FMapUint16Int64": + if r.TryDecodeAsNil() { + x.FMapUint16Int64 = nil + } else { + if false { + } else { + z.F.DecMapUint16Int64X(&x.FMapUint16Int64, d) + } + } + case "FptrMapUint16Int64": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Int64 != nil { + x.FptrMapUint16Int64 = nil + } + } else { + if x.FptrMapUint16Int64 == nil { + x.FptrMapUint16Int64 = new(map[uint16]int64) + } + + if false { + } else { + z.F.DecMapUint16Int64X(x.FptrMapUint16Int64, d) + } + } + case "FMapUint16Float32": + if r.TryDecodeAsNil() { + x.FMapUint16Float32 = nil + } else { + if false { + } else { + z.F.DecMapUint16Float32X(&x.FMapUint16Float32, d) + } + } + case "FptrMapUint16Float32": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Float32 != nil { + x.FptrMapUint16Float32 = nil + } + } else { + if x.FptrMapUint16Float32 == nil { + x.FptrMapUint16Float32 = new(map[uint16]float32) + } + + if false { + } else { + z.F.DecMapUint16Float32X(x.FptrMapUint16Float32, d) + } + } + case "FMapUint16Float64": + if r.TryDecodeAsNil() { + x.FMapUint16Float64 = nil + } else { + if false { + } else { + z.F.DecMapUint16Float64X(&x.FMapUint16Float64, d) + } + } + case "FptrMapUint16Float64": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Float64 != nil { + x.FptrMapUint16Float64 = nil + } + } else { + if x.FptrMapUint16Float64 == nil { + x.FptrMapUint16Float64 = new(map[uint16]float64) + } + + if false { + } else { + z.F.DecMapUint16Float64X(x.FptrMapUint16Float64, d) + } + } + case "FMapUint16Bool": + if r.TryDecodeAsNil() { + x.FMapUint16Bool = nil + } else { + if false { + } else { + z.F.DecMapUint16BoolX(&x.FMapUint16Bool, d) + } + } + case "FptrMapUint16Bool": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Bool != nil { + x.FptrMapUint16Bool = nil + } + } else { + if x.FptrMapUint16Bool == nil { + x.FptrMapUint16Bool = new(map[uint16]bool) + } + + if false { + } else { + z.F.DecMapUint16BoolX(x.FptrMapUint16Bool, d) + } + } + case "FMapUint32Intf": + if r.TryDecodeAsNil() { + x.FMapUint32Intf = nil + } else { + if false { + } else { + z.F.DecMapUint32IntfX(&x.FMapUint32Intf, d) + } + } + case "FptrMapUint32Intf": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Intf != nil { + x.FptrMapUint32Intf = nil + } + } else { + if x.FptrMapUint32Intf == nil { + x.FptrMapUint32Intf = new(map[uint32]interface{}) + } + + if false { + } else { + z.F.DecMapUint32IntfX(x.FptrMapUint32Intf, d) + } + } + case "FMapUint32String": + if r.TryDecodeAsNil() { + x.FMapUint32String = nil + } else { + if false { + } else { + z.F.DecMapUint32StringX(&x.FMapUint32String, d) + } + } + case "FptrMapUint32String": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32String != nil { + x.FptrMapUint32String = nil + } + } else { + if x.FptrMapUint32String == nil { + x.FptrMapUint32String = new(map[uint32]string) + } + + if false { + } else { + z.F.DecMapUint32StringX(x.FptrMapUint32String, d) + } + } + case "FMapUint32Uint": + if r.TryDecodeAsNil() { + x.FMapUint32Uint = nil + } else { + if false { + } else { + z.F.DecMapUint32UintX(&x.FMapUint32Uint, d) + } + } + case "FptrMapUint32Uint": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Uint != nil { + x.FptrMapUint32Uint = nil + } + } else { + if x.FptrMapUint32Uint == nil { + x.FptrMapUint32Uint = new(map[uint32]uint) + } + + if false { + } else { + z.F.DecMapUint32UintX(x.FptrMapUint32Uint, d) + } + } + case "FMapUint32Uint8": + if r.TryDecodeAsNil() { + x.FMapUint32Uint8 = nil + } else { + if false { + } else { + z.F.DecMapUint32Uint8X(&x.FMapUint32Uint8, d) + } + } + case "FptrMapUint32Uint8": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Uint8 != nil { + x.FptrMapUint32Uint8 = nil + } + } else { + if x.FptrMapUint32Uint8 == nil { + x.FptrMapUint32Uint8 = new(map[uint32]uint8) + } + + if false { + } else { + z.F.DecMapUint32Uint8X(x.FptrMapUint32Uint8, d) + } + } + case "FMapUint32Uint16": + if r.TryDecodeAsNil() { + x.FMapUint32Uint16 = nil + } else { + if false { + } else { + z.F.DecMapUint32Uint16X(&x.FMapUint32Uint16, d) + } + } + case "FptrMapUint32Uint16": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Uint16 != nil { + x.FptrMapUint32Uint16 = nil + } + } else { + if x.FptrMapUint32Uint16 == nil { + x.FptrMapUint32Uint16 = new(map[uint32]uint16) + } + + if false { + } else { + z.F.DecMapUint32Uint16X(x.FptrMapUint32Uint16, d) + } + } + case "FMapUint32Uint32": + if r.TryDecodeAsNil() { + x.FMapUint32Uint32 = nil + } else { + if false { + } else { + z.F.DecMapUint32Uint32X(&x.FMapUint32Uint32, d) + } + } + case "FptrMapUint32Uint32": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Uint32 != nil { + x.FptrMapUint32Uint32 = nil + } + } else { + if x.FptrMapUint32Uint32 == nil { + x.FptrMapUint32Uint32 = new(map[uint32]uint32) + } + + if false { + } else { + z.F.DecMapUint32Uint32X(x.FptrMapUint32Uint32, d) + } + } + case "FMapUint32Uint64": + if r.TryDecodeAsNil() { + x.FMapUint32Uint64 = nil + } else { + if false { + } else { + z.F.DecMapUint32Uint64X(&x.FMapUint32Uint64, d) + } + } + case "FptrMapUint32Uint64": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Uint64 != nil { + x.FptrMapUint32Uint64 = nil + } + } else { + if x.FptrMapUint32Uint64 == nil { + x.FptrMapUint32Uint64 = new(map[uint32]uint64) + } + + if false { + } else { + z.F.DecMapUint32Uint64X(x.FptrMapUint32Uint64, d) + } + } + case "FMapUint32Uintptr": + if r.TryDecodeAsNil() { + x.FMapUint32Uintptr = nil + } else { + if false { + } else { + z.F.DecMapUint32UintptrX(&x.FMapUint32Uintptr, d) + } + } + case "FptrMapUint32Uintptr": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Uintptr != nil { + x.FptrMapUint32Uintptr = nil + } + } else { + if x.FptrMapUint32Uintptr == nil { + x.FptrMapUint32Uintptr = new(map[uint32]uintptr) + } + + if false { + } else { + z.F.DecMapUint32UintptrX(x.FptrMapUint32Uintptr, d) + } + } + case "FMapUint32Int": + if r.TryDecodeAsNil() { + x.FMapUint32Int = nil + } else { + if false { + } else { + z.F.DecMapUint32IntX(&x.FMapUint32Int, d) + } + } + case "FptrMapUint32Int": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Int != nil { + x.FptrMapUint32Int = nil + } + } else { + if x.FptrMapUint32Int == nil { + x.FptrMapUint32Int = new(map[uint32]int) + } + + if false { + } else { + z.F.DecMapUint32IntX(x.FptrMapUint32Int, d) + } + } + case "FMapUint32Int8": + if r.TryDecodeAsNil() { + x.FMapUint32Int8 = nil + } else { + if false { + } else { + z.F.DecMapUint32Int8X(&x.FMapUint32Int8, d) + } + } + case "FptrMapUint32Int8": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Int8 != nil { + x.FptrMapUint32Int8 = nil + } + } else { + if x.FptrMapUint32Int8 == nil { + x.FptrMapUint32Int8 = new(map[uint32]int8) + } + + if false { + } else { + z.F.DecMapUint32Int8X(x.FptrMapUint32Int8, d) + } + } + case "FMapUint32Int16": + if r.TryDecodeAsNil() { + x.FMapUint32Int16 = nil + } else { + if false { + } else { + z.F.DecMapUint32Int16X(&x.FMapUint32Int16, d) + } + } + case "FptrMapUint32Int16": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Int16 != nil { + x.FptrMapUint32Int16 = nil + } + } else { + if x.FptrMapUint32Int16 == nil { + x.FptrMapUint32Int16 = new(map[uint32]int16) + } + + if false { + } else { + z.F.DecMapUint32Int16X(x.FptrMapUint32Int16, d) + } + } + case "FMapUint32Int32": + if r.TryDecodeAsNil() { + x.FMapUint32Int32 = nil + } else { + if false { + } else { + z.F.DecMapUint32Int32X(&x.FMapUint32Int32, d) + } + } + case "FptrMapUint32Int32": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Int32 != nil { + x.FptrMapUint32Int32 = nil + } + } else { + if x.FptrMapUint32Int32 == nil { + x.FptrMapUint32Int32 = new(map[uint32]int32) + } + + if false { + } else { + z.F.DecMapUint32Int32X(x.FptrMapUint32Int32, d) + } + } + case "FMapUint32Int64": + if r.TryDecodeAsNil() { + x.FMapUint32Int64 = nil + } else { + if false { + } else { + z.F.DecMapUint32Int64X(&x.FMapUint32Int64, d) + } + } + case "FptrMapUint32Int64": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Int64 != nil { + x.FptrMapUint32Int64 = nil + } + } else { + if x.FptrMapUint32Int64 == nil { + x.FptrMapUint32Int64 = new(map[uint32]int64) + } + + if false { + } else { + z.F.DecMapUint32Int64X(x.FptrMapUint32Int64, d) + } + } + case "FMapUint32Float32": + if r.TryDecodeAsNil() { + x.FMapUint32Float32 = nil + } else { + if false { + } else { + z.F.DecMapUint32Float32X(&x.FMapUint32Float32, d) + } + } + case "FptrMapUint32Float32": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Float32 != nil { + x.FptrMapUint32Float32 = nil + } + } else { + if x.FptrMapUint32Float32 == nil { + x.FptrMapUint32Float32 = new(map[uint32]float32) + } + + if false { + } else { + z.F.DecMapUint32Float32X(x.FptrMapUint32Float32, d) + } + } + case "FMapUint32Float64": + if r.TryDecodeAsNil() { + x.FMapUint32Float64 = nil + } else { + if false { + } else { + z.F.DecMapUint32Float64X(&x.FMapUint32Float64, d) + } + } + case "FptrMapUint32Float64": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Float64 != nil { + x.FptrMapUint32Float64 = nil + } + } else { + if x.FptrMapUint32Float64 == nil { + x.FptrMapUint32Float64 = new(map[uint32]float64) + } + + if false { + } else { + z.F.DecMapUint32Float64X(x.FptrMapUint32Float64, d) + } + } + case "FMapUint32Bool": + if r.TryDecodeAsNil() { + x.FMapUint32Bool = nil + } else { + if false { + } else { + z.F.DecMapUint32BoolX(&x.FMapUint32Bool, d) + } + } + case "FptrMapUint32Bool": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Bool != nil { + x.FptrMapUint32Bool = nil + } + } else { + if x.FptrMapUint32Bool == nil { + x.FptrMapUint32Bool = new(map[uint32]bool) + } + + if false { + } else { + z.F.DecMapUint32BoolX(x.FptrMapUint32Bool, d) + } + } + case "FMapUint64Intf": + if r.TryDecodeAsNil() { + x.FMapUint64Intf = nil + } else { + if false { + } else { + z.F.DecMapUint64IntfX(&x.FMapUint64Intf, d) + } + } + case "FptrMapUint64Intf": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Intf != nil { + x.FptrMapUint64Intf = nil + } + } else { + if x.FptrMapUint64Intf == nil { + x.FptrMapUint64Intf = new(map[uint64]interface{}) + } + + if false { + } else { + z.F.DecMapUint64IntfX(x.FptrMapUint64Intf, d) + } + } + case "FMapUint64String": + if r.TryDecodeAsNil() { + x.FMapUint64String = nil + } else { + if false { + } else { + z.F.DecMapUint64StringX(&x.FMapUint64String, d) + } + } + case "FptrMapUint64String": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64String != nil { + x.FptrMapUint64String = nil + } + } else { + if x.FptrMapUint64String == nil { + x.FptrMapUint64String = new(map[uint64]string) + } + + if false { + } else { + z.F.DecMapUint64StringX(x.FptrMapUint64String, d) + } + } + case "FMapUint64Uint": + if r.TryDecodeAsNil() { + x.FMapUint64Uint = nil + } else { + if false { + } else { + z.F.DecMapUint64UintX(&x.FMapUint64Uint, d) + } + } + case "FptrMapUint64Uint": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Uint != nil { + x.FptrMapUint64Uint = nil + } + } else { + if x.FptrMapUint64Uint == nil { + x.FptrMapUint64Uint = new(map[uint64]uint) + } + + if false { + } else { + z.F.DecMapUint64UintX(x.FptrMapUint64Uint, d) + } + } + case "FMapUint64Uint8": + if r.TryDecodeAsNil() { + x.FMapUint64Uint8 = nil + } else { + if false { + } else { + z.F.DecMapUint64Uint8X(&x.FMapUint64Uint8, d) + } + } + case "FptrMapUint64Uint8": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Uint8 != nil { + x.FptrMapUint64Uint8 = nil + } + } else { + if x.FptrMapUint64Uint8 == nil { + x.FptrMapUint64Uint8 = new(map[uint64]uint8) + } + + if false { + } else { + z.F.DecMapUint64Uint8X(x.FptrMapUint64Uint8, d) + } + } + case "FMapUint64Uint16": + if r.TryDecodeAsNil() { + x.FMapUint64Uint16 = nil + } else { + if false { + } else { + z.F.DecMapUint64Uint16X(&x.FMapUint64Uint16, d) + } + } + case "FptrMapUint64Uint16": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Uint16 != nil { + x.FptrMapUint64Uint16 = nil + } + } else { + if x.FptrMapUint64Uint16 == nil { + x.FptrMapUint64Uint16 = new(map[uint64]uint16) + } + + if false { + } else { + z.F.DecMapUint64Uint16X(x.FptrMapUint64Uint16, d) + } + } + case "FMapUint64Uint32": + if r.TryDecodeAsNil() { + x.FMapUint64Uint32 = nil + } else { + if false { + } else { + z.F.DecMapUint64Uint32X(&x.FMapUint64Uint32, d) + } + } + case "FptrMapUint64Uint32": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Uint32 != nil { + x.FptrMapUint64Uint32 = nil + } + } else { + if x.FptrMapUint64Uint32 == nil { + x.FptrMapUint64Uint32 = new(map[uint64]uint32) + } + + if false { + } else { + z.F.DecMapUint64Uint32X(x.FptrMapUint64Uint32, d) + } + } + case "FMapUint64Uint64": + if r.TryDecodeAsNil() { + x.FMapUint64Uint64 = nil + } else { + if false { + } else { + z.F.DecMapUint64Uint64X(&x.FMapUint64Uint64, d) + } + } + case "FptrMapUint64Uint64": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Uint64 != nil { + x.FptrMapUint64Uint64 = nil + } + } else { + if x.FptrMapUint64Uint64 == nil { + x.FptrMapUint64Uint64 = new(map[uint64]uint64) + } + + if false { + } else { + z.F.DecMapUint64Uint64X(x.FptrMapUint64Uint64, d) + } + } + case "FMapUint64Uintptr": + if r.TryDecodeAsNil() { + x.FMapUint64Uintptr = nil + } else { + if false { + } else { + z.F.DecMapUint64UintptrX(&x.FMapUint64Uintptr, d) + } + } + case "FptrMapUint64Uintptr": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Uintptr != nil { + x.FptrMapUint64Uintptr = nil + } + } else { + if x.FptrMapUint64Uintptr == nil { + x.FptrMapUint64Uintptr = new(map[uint64]uintptr) + } + + if false { + } else { + z.F.DecMapUint64UintptrX(x.FptrMapUint64Uintptr, d) + } + } + case "FMapUint64Int": + if r.TryDecodeAsNil() { + x.FMapUint64Int = nil + } else { + if false { + } else { + z.F.DecMapUint64IntX(&x.FMapUint64Int, d) + } + } + case "FptrMapUint64Int": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Int != nil { + x.FptrMapUint64Int = nil + } + } else { + if x.FptrMapUint64Int == nil { + x.FptrMapUint64Int = new(map[uint64]int) + } + + if false { + } else { + z.F.DecMapUint64IntX(x.FptrMapUint64Int, d) + } + } + case "FMapUint64Int8": + if r.TryDecodeAsNil() { + x.FMapUint64Int8 = nil + } else { + if false { + } else { + z.F.DecMapUint64Int8X(&x.FMapUint64Int8, d) + } + } + case "FptrMapUint64Int8": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Int8 != nil { + x.FptrMapUint64Int8 = nil + } + } else { + if x.FptrMapUint64Int8 == nil { + x.FptrMapUint64Int8 = new(map[uint64]int8) + } + + if false { + } else { + z.F.DecMapUint64Int8X(x.FptrMapUint64Int8, d) + } + } + case "FMapUint64Int16": + if r.TryDecodeAsNil() { + x.FMapUint64Int16 = nil + } else { + if false { + } else { + z.F.DecMapUint64Int16X(&x.FMapUint64Int16, d) + } + } + case "FptrMapUint64Int16": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Int16 != nil { + x.FptrMapUint64Int16 = nil + } + } else { + if x.FptrMapUint64Int16 == nil { + x.FptrMapUint64Int16 = new(map[uint64]int16) + } + + if false { + } else { + z.F.DecMapUint64Int16X(x.FptrMapUint64Int16, d) + } + } + case "FMapUint64Int32": + if r.TryDecodeAsNil() { + x.FMapUint64Int32 = nil + } else { + if false { + } else { + z.F.DecMapUint64Int32X(&x.FMapUint64Int32, d) + } + } + case "FptrMapUint64Int32": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Int32 != nil { + x.FptrMapUint64Int32 = nil + } + } else { + if x.FptrMapUint64Int32 == nil { + x.FptrMapUint64Int32 = new(map[uint64]int32) + } + + if false { + } else { + z.F.DecMapUint64Int32X(x.FptrMapUint64Int32, d) + } + } + case "FMapUint64Int64": + if r.TryDecodeAsNil() { + x.FMapUint64Int64 = nil + } else { + if false { + } else { + z.F.DecMapUint64Int64X(&x.FMapUint64Int64, d) + } + } + case "FptrMapUint64Int64": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Int64 != nil { + x.FptrMapUint64Int64 = nil + } + } else { + if x.FptrMapUint64Int64 == nil { + x.FptrMapUint64Int64 = new(map[uint64]int64) + } + + if false { + } else { + z.F.DecMapUint64Int64X(x.FptrMapUint64Int64, d) + } + } + case "FMapUint64Float32": + if r.TryDecodeAsNil() { + x.FMapUint64Float32 = nil + } else { + if false { + } else { + z.F.DecMapUint64Float32X(&x.FMapUint64Float32, d) + } + } + case "FptrMapUint64Float32": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Float32 != nil { + x.FptrMapUint64Float32 = nil + } + } else { + if x.FptrMapUint64Float32 == nil { + x.FptrMapUint64Float32 = new(map[uint64]float32) + } + + if false { + } else { + z.F.DecMapUint64Float32X(x.FptrMapUint64Float32, d) + } + } + case "FMapUint64Float64": + if r.TryDecodeAsNil() { + x.FMapUint64Float64 = nil + } else { + if false { + } else { + z.F.DecMapUint64Float64X(&x.FMapUint64Float64, d) + } + } + case "FptrMapUint64Float64": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Float64 != nil { + x.FptrMapUint64Float64 = nil + } + } else { + if x.FptrMapUint64Float64 == nil { + x.FptrMapUint64Float64 = new(map[uint64]float64) + } + + if false { + } else { + z.F.DecMapUint64Float64X(x.FptrMapUint64Float64, d) + } + } + case "FMapUint64Bool": + if r.TryDecodeAsNil() { + x.FMapUint64Bool = nil + } else { + if false { + } else { + z.F.DecMapUint64BoolX(&x.FMapUint64Bool, d) + } + } + case "FptrMapUint64Bool": + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Bool != nil { + x.FptrMapUint64Bool = nil + } + } else { + if x.FptrMapUint64Bool == nil { + x.FptrMapUint64Bool = new(map[uint64]bool) + } + + if false { + } else { + z.F.DecMapUint64BoolX(x.FptrMapUint64Bool, d) + } + } + case "FMapUintptrIntf": + if r.TryDecodeAsNil() { + x.FMapUintptrIntf = nil + } else { + if false { + } else { + z.F.DecMapUintptrIntfX(&x.FMapUintptrIntf, d) + } + } + case "FptrMapUintptrIntf": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrIntf != nil { + x.FptrMapUintptrIntf = nil + } + } else { + if x.FptrMapUintptrIntf == nil { + x.FptrMapUintptrIntf = new(map[uintptr]interface{}) + } + + if false { + } else { + z.F.DecMapUintptrIntfX(x.FptrMapUintptrIntf, d) + } + } + case "FMapUintptrString": + if r.TryDecodeAsNil() { + x.FMapUintptrString = nil + } else { + if false { + } else { + z.F.DecMapUintptrStringX(&x.FMapUintptrString, d) + } + } + case "FptrMapUintptrString": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrString != nil { + x.FptrMapUintptrString = nil + } + } else { + if x.FptrMapUintptrString == nil { + x.FptrMapUintptrString = new(map[uintptr]string) + } + + if false { + } else { + z.F.DecMapUintptrStringX(x.FptrMapUintptrString, d) + } + } + case "FMapUintptrUint": + if r.TryDecodeAsNil() { + x.FMapUintptrUint = nil + } else { + if false { + } else { + z.F.DecMapUintptrUintX(&x.FMapUintptrUint, d) + } + } + case "FptrMapUintptrUint": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrUint != nil { + x.FptrMapUintptrUint = nil + } + } else { + if x.FptrMapUintptrUint == nil { + x.FptrMapUintptrUint = new(map[uintptr]uint) + } + + if false { + } else { + z.F.DecMapUintptrUintX(x.FptrMapUintptrUint, d) + } + } + case "FMapUintptrUint8": + if r.TryDecodeAsNil() { + x.FMapUintptrUint8 = nil + } else { + if false { + } else { + z.F.DecMapUintptrUint8X(&x.FMapUintptrUint8, d) + } + } + case "FptrMapUintptrUint8": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrUint8 != nil { + x.FptrMapUintptrUint8 = nil + } + } else { + if x.FptrMapUintptrUint8 == nil { + x.FptrMapUintptrUint8 = new(map[uintptr]uint8) + } + + if false { + } else { + z.F.DecMapUintptrUint8X(x.FptrMapUintptrUint8, d) + } + } + case "FMapUintptrUint16": + if r.TryDecodeAsNil() { + x.FMapUintptrUint16 = nil + } else { + if false { + } else { + z.F.DecMapUintptrUint16X(&x.FMapUintptrUint16, d) + } + } + case "FptrMapUintptrUint16": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrUint16 != nil { + x.FptrMapUintptrUint16 = nil + } + } else { + if x.FptrMapUintptrUint16 == nil { + x.FptrMapUintptrUint16 = new(map[uintptr]uint16) + } + + if false { + } else { + z.F.DecMapUintptrUint16X(x.FptrMapUintptrUint16, d) + } + } + case "FMapUintptrUint32": + if r.TryDecodeAsNil() { + x.FMapUintptrUint32 = nil + } else { + if false { + } else { + z.F.DecMapUintptrUint32X(&x.FMapUintptrUint32, d) + } + } + case "FptrMapUintptrUint32": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrUint32 != nil { + x.FptrMapUintptrUint32 = nil + } + } else { + if x.FptrMapUintptrUint32 == nil { + x.FptrMapUintptrUint32 = new(map[uintptr]uint32) + } + + if false { + } else { + z.F.DecMapUintptrUint32X(x.FptrMapUintptrUint32, d) + } + } + case "FMapUintptrUint64": + if r.TryDecodeAsNil() { + x.FMapUintptrUint64 = nil + } else { + if false { + } else { + z.F.DecMapUintptrUint64X(&x.FMapUintptrUint64, d) + } + } + case "FptrMapUintptrUint64": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrUint64 != nil { + x.FptrMapUintptrUint64 = nil + } + } else { + if x.FptrMapUintptrUint64 == nil { + x.FptrMapUintptrUint64 = new(map[uintptr]uint64) + } + + if false { + } else { + z.F.DecMapUintptrUint64X(x.FptrMapUintptrUint64, d) + } + } + case "FMapUintptrUintptr": + if r.TryDecodeAsNil() { + x.FMapUintptrUintptr = nil + } else { + if false { + } else { + z.F.DecMapUintptrUintptrX(&x.FMapUintptrUintptr, d) + } + } + case "FptrMapUintptrUintptr": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrUintptr != nil { + x.FptrMapUintptrUintptr = nil + } + } else { + if x.FptrMapUintptrUintptr == nil { + x.FptrMapUintptrUintptr = new(map[uintptr]uintptr) + } + + if false { + } else { + z.F.DecMapUintptrUintptrX(x.FptrMapUintptrUintptr, d) + } + } + case "FMapUintptrInt": + if r.TryDecodeAsNil() { + x.FMapUintptrInt = nil + } else { + if false { + } else { + z.F.DecMapUintptrIntX(&x.FMapUintptrInt, d) + } + } + case "FptrMapUintptrInt": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrInt != nil { + x.FptrMapUintptrInt = nil + } + } else { + if x.FptrMapUintptrInt == nil { + x.FptrMapUintptrInt = new(map[uintptr]int) + } + + if false { + } else { + z.F.DecMapUintptrIntX(x.FptrMapUintptrInt, d) + } + } + case "FMapUintptrInt8": + if r.TryDecodeAsNil() { + x.FMapUintptrInt8 = nil + } else { + if false { + } else { + z.F.DecMapUintptrInt8X(&x.FMapUintptrInt8, d) + } + } + case "FptrMapUintptrInt8": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrInt8 != nil { + x.FptrMapUintptrInt8 = nil + } + } else { + if x.FptrMapUintptrInt8 == nil { + x.FptrMapUintptrInt8 = new(map[uintptr]int8) + } + + if false { + } else { + z.F.DecMapUintptrInt8X(x.FptrMapUintptrInt8, d) + } + } + case "FMapUintptrInt16": + if r.TryDecodeAsNil() { + x.FMapUintptrInt16 = nil + } else { + if false { + } else { + z.F.DecMapUintptrInt16X(&x.FMapUintptrInt16, d) + } + } + case "FptrMapUintptrInt16": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrInt16 != nil { + x.FptrMapUintptrInt16 = nil + } + } else { + if x.FptrMapUintptrInt16 == nil { + x.FptrMapUintptrInt16 = new(map[uintptr]int16) + } + + if false { + } else { + z.F.DecMapUintptrInt16X(x.FptrMapUintptrInt16, d) + } + } + case "FMapUintptrInt32": + if r.TryDecodeAsNil() { + x.FMapUintptrInt32 = nil + } else { + if false { + } else { + z.F.DecMapUintptrInt32X(&x.FMapUintptrInt32, d) + } + } + case "FptrMapUintptrInt32": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrInt32 != nil { + x.FptrMapUintptrInt32 = nil + } + } else { + if x.FptrMapUintptrInt32 == nil { + x.FptrMapUintptrInt32 = new(map[uintptr]int32) + } + + if false { + } else { + z.F.DecMapUintptrInt32X(x.FptrMapUintptrInt32, d) + } + } + case "FMapUintptrInt64": + if r.TryDecodeAsNil() { + x.FMapUintptrInt64 = nil + } else { + if false { + } else { + z.F.DecMapUintptrInt64X(&x.FMapUintptrInt64, d) + } + } + case "FptrMapUintptrInt64": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrInt64 != nil { + x.FptrMapUintptrInt64 = nil + } + } else { + if x.FptrMapUintptrInt64 == nil { + x.FptrMapUintptrInt64 = new(map[uintptr]int64) + } + + if false { + } else { + z.F.DecMapUintptrInt64X(x.FptrMapUintptrInt64, d) + } + } + case "FMapUintptrFloat32": + if r.TryDecodeAsNil() { + x.FMapUintptrFloat32 = nil + } else { + if false { + } else { + z.F.DecMapUintptrFloat32X(&x.FMapUintptrFloat32, d) + } + } + case "FptrMapUintptrFloat32": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrFloat32 != nil { + x.FptrMapUintptrFloat32 = nil + } + } else { + if x.FptrMapUintptrFloat32 == nil { + x.FptrMapUintptrFloat32 = new(map[uintptr]float32) + } + + if false { + } else { + z.F.DecMapUintptrFloat32X(x.FptrMapUintptrFloat32, d) + } + } + case "FMapUintptrFloat64": + if r.TryDecodeAsNil() { + x.FMapUintptrFloat64 = nil + } else { + if false { + } else { + z.F.DecMapUintptrFloat64X(&x.FMapUintptrFloat64, d) + } + } + case "FptrMapUintptrFloat64": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrFloat64 != nil { + x.FptrMapUintptrFloat64 = nil + } + } else { + if x.FptrMapUintptrFloat64 == nil { + x.FptrMapUintptrFloat64 = new(map[uintptr]float64) + } + + if false { + } else { + z.F.DecMapUintptrFloat64X(x.FptrMapUintptrFloat64, d) + } + } + case "FMapUintptrBool": + if r.TryDecodeAsNil() { + x.FMapUintptrBool = nil + } else { + if false { + } else { + z.F.DecMapUintptrBoolX(&x.FMapUintptrBool, d) + } + } + case "FptrMapUintptrBool": + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrBool != nil { + x.FptrMapUintptrBool = nil + } + } else { + if x.FptrMapUintptrBool == nil { + x.FptrMapUintptrBool = new(map[uintptr]bool) + } + + if false { + } else { + z.F.DecMapUintptrBoolX(x.FptrMapUintptrBool, d) + } + } + case "FMapIntIntf": + if r.TryDecodeAsNil() { + x.FMapIntIntf = nil + } else { + if false { + } else { + z.F.DecMapIntIntfX(&x.FMapIntIntf, d) + } + } + case "FptrMapIntIntf": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntIntf != nil { + x.FptrMapIntIntf = nil + } + } else { + if x.FptrMapIntIntf == nil { + x.FptrMapIntIntf = new(map[int]interface{}) + } + + if false { + } else { + z.F.DecMapIntIntfX(x.FptrMapIntIntf, d) + } + } + case "FMapIntString": + if r.TryDecodeAsNil() { + x.FMapIntString = nil + } else { + if false { + } else { + z.F.DecMapIntStringX(&x.FMapIntString, d) + } + } + case "FptrMapIntString": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntString != nil { + x.FptrMapIntString = nil + } + } else { + if x.FptrMapIntString == nil { + x.FptrMapIntString = new(map[int]string) + } + + if false { + } else { + z.F.DecMapIntStringX(x.FptrMapIntString, d) + } + } + case "FMapIntUint": + if r.TryDecodeAsNil() { + x.FMapIntUint = nil + } else { + if false { + } else { + z.F.DecMapIntUintX(&x.FMapIntUint, d) + } + } + case "FptrMapIntUint": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntUint != nil { + x.FptrMapIntUint = nil + } + } else { + if x.FptrMapIntUint == nil { + x.FptrMapIntUint = new(map[int]uint) + } + + if false { + } else { + z.F.DecMapIntUintX(x.FptrMapIntUint, d) + } + } + case "FMapIntUint8": + if r.TryDecodeAsNil() { + x.FMapIntUint8 = nil + } else { + if false { + } else { + z.F.DecMapIntUint8X(&x.FMapIntUint8, d) + } + } + case "FptrMapIntUint8": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntUint8 != nil { + x.FptrMapIntUint8 = nil + } + } else { + if x.FptrMapIntUint8 == nil { + x.FptrMapIntUint8 = new(map[int]uint8) + } + + if false { + } else { + z.F.DecMapIntUint8X(x.FptrMapIntUint8, d) + } + } + case "FMapIntUint16": + if r.TryDecodeAsNil() { + x.FMapIntUint16 = nil + } else { + if false { + } else { + z.F.DecMapIntUint16X(&x.FMapIntUint16, d) + } + } + case "FptrMapIntUint16": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntUint16 != nil { + x.FptrMapIntUint16 = nil + } + } else { + if x.FptrMapIntUint16 == nil { + x.FptrMapIntUint16 = new(map[int]uint16) + } + + if false { + } else { + z.F.DecMapIntUint16X(x.FptrMapIntUint16, d) + } + } + case "FMapIntUint32": + if r.TryDecodeAsNil() { + x.FMapIntUint32 = nil + } else { + if false { + } else { + z.F.DecMapIntUint32X(&x.FMapIntUint32, d) + } + } + case "FptrMapIntUint32": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntUint32 != nil { + x.FptrMapIntUint32 = nil + } + } else { + if x.FptrMapIntUint32 == nil { + x.FptrMapIntUint32 = new(map[int]uint32) + } + + if false { + } else { + z.F.DecMapIntUint32X(x.FptrMapIntUint32, d) + } + } + case "FMapIntUint64": + if r.TryDecodeAsNil() { + x.FMapIntUint64 = nil + } else { + if false { + } else { + z.F.DecMapIntUint64X(&x.FMapIntUint64, d) + } + } + case "FptrMapIntUint64": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntUint64 != nil { + x.FptrMapIntUint64 = nil + } + } else { + if x.FptrMapIntUint64 == nil { + x.FptrMapIntUint64 = new(map[int]uint64) + } + + if false { + } else { + z.F.DecMapIntUint64X(x.FptrMapIntUint64, d) + } + } + case "FMapIntUintptr": + if r.TryDecodeAsNil() { + x.FMapIntUintptr = nil + } else { + if false { + } else { + z.F.DecMapIntUintptrX(&x.FMapIntUintptr, d) + } + } + case "FptrMapIntUintptr": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntUintptr != nil { + x.FptrMapIntUintptr = nil + } + } else { + if x.FptrMapIntUintptr == nil { + x.FptrMapIntUintptr = new(map[int]uintptr) + } + + if false { + } else { + z.F.DecMapIntUintptrX(x.FptrMapIntUintptr, d) + } + } + case "FMapIntInt": + if r.TryDecodeAsNil() { + x.FMapIntInt = nil + } else { + if false { + } else { + z.F.DecMapIntIntX(&x.FMapIntInt, d) + } + } + case "FptrMapIntInt": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntInt != nil { + x.FptrMapIntInt = nil + } + } else { + if x.FptrMapIntInt == nil { + x.FptrMapIntInt = new(map[int]int) + } + + if false { + } else { + z.F.DecMapIntIntX(x.FptrMapIntInt, d) + } + } + case "FMapIntInt8": + if r.TryDecodeAsNil() { + x.FMapIntInt8 = nil + } else { + if false { + } else { + z.F.DecMapIntInt8X(&x.FMapIntInt8, d) + } + } + case "FptrMapIntInt8": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntInt8 != nil { + x.FptrMapIntInt8 = nil + } + } else { + if x.FptrMapIntInt8 == nil { + x.FptrMapIntInt8 = new(map[int]int8) + } + + if false { + } else { + z.F.DecMapIntInt8X(x.FptrMapIntInt8, d) + } + } + case "FMapIntInt16": + if r.TryDecodeAsNil() { + x.FMapIntInt16 = nil + } else { + if false { + } else { + z.F.DecMapIntInt16X(&x.FMapIntInt16, d) + } + } + case "FptrMapIntInt16": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntInt16 != nil { + x.FptrMapIntInt16 = nil + } + } else { + if x.FptrMapIntInt16 == nil { + x.FptrMapIntInt16 = new(map[int]int16) + } + + if false { + } else { + z.F.DecMapIntInt16X(x.FptrMapIntInt16, d) + } + } + case "FMapIntInt32": + if r.TryDecodeAsNil() { + x.FMapIntInt32 = nil + } else { + if false { + } else { + z.F.DecMapIntInt32X(&x.FMapIntInt32, d) + } + } + case "FptrMapIntInt32": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntInt32 != nil { + x.FptrMapIntInt32 = nil + } + } else { + if x.FptrMapIntInt32 == nil { + x.FptrMapIntInt32 = new(map[int]int32) + } + + if false { + } else { + z.F.DecMapIntInt32X(x.FptrMapIntInt32, d) + } + } + case "FMapIntInt64": + if r.TryDecodeAsNil() { + x.FMapIntInt64 = nil + } else { + if false { + } else { + z.F.DecMapIntInt64X(&x.FMapIntInt64, d) + } + } + case "FptrMapIntInt64": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntInt64 != nil { + x.FptrMapIntInt64 = nil + } + } else { + if x.FptrMapIntInt64 == nil { + x.FptrMapIntInt64 = new(map[int]int64) + } + + if false { + } else { + z.F.DecMapIntInt64X(x.FptrMapIntInt64, d) + } + } + case "FMapIntFloat32": + if r.TryDecodeAsNil() { + x.FMapIntFloat32 = nil + } else { + if false { + } else { + z.F.DecMapIntFloat32X(&x.FMapIntFloat32, d) + } + } + case "FptrMapIntFloat32": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntFloat32 != nil { + x.FptrMapIntFloat32 = nil + } + } else { + if x.FptrMapIntFloat32 == nil { + x.FptrMapIntFloat32 = new(map[int]float32) + } + + if false { + } else { + z.F.DecMapIntFloat32X(x.FptrMapIntFloat32, d) + } + } + case "FMapIntFloat64": + if r.TryDecodeAsNil() { + x.FMapIntFloat64 = nil + } else { + if false { + } else { + z.F.DecMapIntFloat64X(&x.FMapIntFloat64, d) + } + } + case "FptrMapIntFloat64": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntFloat64 != nil { + x.FptrMapIntFloat64 = nil + } + } else { + if x.FptrMapIntFloat64 == nil { + x.FptrMapIntFloat64 = new(map[int]float64) + } + + if false { + } else { + z.F.DecMapIntFloat64X(x.FptrMapIntFloat64, d) + } + } + case "FMapIntBool": + if r.TryDecodeAsNil() { + x.FMapIntBool = nil + } else { + if false { + } else { + z.F.DecMapIntBoolX(&x.FMapIntBool, d) + } + } + case "FptrMapIntBool": + if r.TryDecodeAsNil() { + if true && x.FptrMapIntBool != nil { + x.FptrMapIntBool = nil + } + } else { + if x.FptrMapIntBool == nil { + x.FptrMapIntBool = new(map[int]bool) + } + + if false { + } else { + z.F.DecMapIntBoolX(x.FptrMapIntBool, d) + } + } + case "FMapInt8Intf": + if r.TryDecodeAsNil() { + x.FMapInt8Intf = nil + } else { + if false { + } else { + z.F.DecMapInt8IntfX(&x.FMapInt8Intf, d) + } + } + case "FptrMapInt8Intf": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Intf != nil { + x.FptrMapInt8Intf = nil + } + } else { + if x.FptrMapInt8Intf == nil { + x.FptrMapInt8Intf = new(map[int8]interface{}) + } + + if false { + } else { + z.F.DecMapInt8IntfX(x.FptrMapInt8Intf, d) + } + } + case "FMapInt8String": + if r.TryDecodeAsNil() { + x.FMapInt8String = nil + } else { + if false { + } else { + z.F.DecMapInt8StringX(&x.FMapInt8String, d) + } + } + case "FptrMapInt8String": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8String != nil { + x.FptrMapInt8String = nil + } + } else { + if x.FptrMapInt8String == nil { + x.FptrMapInt8String = new(map[int8]string) + } + + if false { + } else { + z.F.DecMapInt8StringX(x.FptrMapInt8String, d) + } + } + case "FMapInt8Uint": + if r.TryDecodeAsNil() { + x.FMapInt8Uint = nil + } else { + if false { + } else { + z.F.DecMapInt8UintX(&x.FMapInt8Uint, d) + } + } + case "FptrMapInt8Uint": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Uint != nil { + x.FptrMapInt8Uint = nil + } + } else { + if x.FptrMapInt8Uint == nil { + x.FptrMapInt8Uint = new(map[int8]uint) + } + + if false { + } else { + z.F.DecMapInt8UintX(x.FptrMapInt8Uint, d) + } + } + case "FMapInt8Uint8": + if r.TryDecodeAsNil() { + x.FMapInt8Uint8 = nil + } else { + if false { + } else { + z.F.DecMapInt8Uint8X(&x.FMapInt8Uint8, d) + } + } + case "FptrMapInt8Uint8": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Uint8 != nil { + x.FptrMapInt8Uint8 = nil + } + } else { + if x.FptrMapInt8Uint8 == nil { + x.FptrMapInt8Uint8 = new(map[int8]uint8) + } + + if false { + } else { + z.F.DecMapInt8Uint8X(x.FptrMapInt8Uint8, d) + } + } + case "FMapInt8Uint16": + if r.TryDecodeAsNil() { + x.FMapInt8Uint16 = nil + } else { + if false { + } else { + z.F.DecMapInt8Uint16X(&x.FMapInt8Uint16, d) + } + } + case "FptrMapInt8Uint16": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Uint16 != nil { + x.FptrMapInt8Uint16 = nil + } + } else { + if x.FptrMapInt8Uint16 == nil { + x.FptrMapInt8Uint16 = new(map[int8]uint16) + } + + if false { + } else { + z.F.DecMapInt8Uint16X(x.FptrMapInt8Uint16, d) + } + } + case "FMapInt8Uint32": + if r.TryDecodeAsNil() { + x.FMapInt8Uint32 = nil + } else { + if false { + } else { + z.F.DecMapInt8Uint32X(&x.FMapInt8Uint32, d) + } + } + case "FptrMapInt8Uint32": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Uint32 != nil { + x.FptrMapInt8Uint32 = nil + } + } else { + if x.FptrMapInt8Uint32 == nil { + x.FptrMapInt8Uint32 = new(map[int8]uint32) + } + + if false { + } else { + z.F.DecMapInt8Uint32X(x.FptrMapInt8Uint32, d) + } + } + case "FMapInt8Uint64": + if r.TryDecodeAsNil() { + x.FMapInt8Uint64 = nil + } else { + if false { + } else { + z.F.DecMapInt8Uint64X(&x.FMapInt8Uint64, d) + } + } + case "FptrMapInt8Uint64": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Uint64 != nil { + x.FptrMapInt8Uint64 = nil + } + } else { + if x.FptrMapInt8Uint64 == nil { + x.FptrMapInt8Uint64 = new(map[int8]uint64) + } + + if false { + } else { + z.F.DecMapInt8Uint64X(x.FptrMapInt8Uint64, d) + } + } + case "FMapInt8Uintptr": + if r.TryDecodeAsNil() { + x.FMapInt8Uintptr = nil + } else { + if false { + } else { + z.F.DecMapInt8UintptrX(&x.FMapInt8Uintptr, d) + } + } + case "FptrMapInt8Uintptr": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Uintptr != nil { + x.FptrMapInt8Uintptr = nil + } + } else { + if x.FptrMapInt8Uintptr == nil { + x.FptrMapInt8Uintptr = new(map[int8]uintptr) + } + + if false { + } else { + z.F.DecMapInt8UintptrX(x.FptrMapInt8Uintptr, d) + } + } + case "FMapInt8Int": + if r.TryDecodeAsNil() { + x.FMapInt8Int = nil + } else { + if false { + } else { + z.F.DecMapInt8IntX(&x.FMapInt8Int, d) + } + } + case "FptrMapInt8Int": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Int != nil { + x.FptrMapInt8Int = nil + } + } else { + if x.FptrMapInt8Int == nil { + x.FptrMapInt8Int = new(map[int8]int) + } + + if false { + } else { + z.F.DecMapInt8IntX(x.FptrMapInt8Int, d) + } + } + case "FMapInt8Int8": + if r.TryDecodeAsNil() { + x.FMapInt8Int8 = nil + } else { + if false { + } else { + z.F.DecMapInt8Int8X(&x.FMapInt8Int8, d) + } + } + case "FptrMapInt8Int8": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Int8 != nil { + x.FptrMapInt8Int8 = nil + } + } else { + if x.FptrMapInt8Int8 == nil { + x.FptrMapInt8Int8 = new(map[int8]int8) + } + + if false { + } else { + z.F.DecMapInt8Int8X(x.FptrMapInt8Int8, d) + } + } + case "FMapInt8Int16": + if r.TryDecodeAsNil() { + x.FMapInt8Int16 = nil + } else { + if false { + } else { + z.F.DecMapInt8Int16X(&x.FMapInt8Int16, d) + } + } + case "FptrMapInt8Int16": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Int16 != nil { + x.FptrMapInt8Int16 = nil + } + } else { + if x.FptrMapInt8Int16 == nil { + x.FptrMapInt8Int16 = new(map[int8]int16) + } + + if false { + } else { + z.F.DecMapInt8Int16X(x.FptrMapInt8Int16, d) + } + } + case "FMapInt8Int32": + if r.TryDecodeAsNil() { + x.FMapInt8Int32 = nil + } else { + if false { + } else { + z.F.DecMapInt8Int32X(&x.FMapInt8Int32, d) + } + } + case "FptrMapInt8Int32": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Int32 != nil { + x.FptrMapInt8Int32 = nil + } + } else { + if x.FptrMapInt8Int32 == nil { + x.FptrMapInt8Int32 = new(map[int8]int32) + } + + if false { + } else { + z.F.DecMapInt8Int32X(x.FptrMapInt8Int32, d) + } + } + case "FMapInt8Int64": + if r.TryDecodeAsNil() { + x.FMapInt8Int64 = nil + } else { + if false { + } else { + z.F.DecMapInt8Int64X(&x.FMapInt8Int64, d) + } + } + case "FptrMapInt8Int64": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Int64 != nil { + x.FptrMapInt8Int64 = nil + } + } else { + if x.FptrMapInt8Int64 == nil { + x.FptrMapInt8Int64 = new(map[int8]int64) + } + + if false { + } else { + z.F.DecMapInt8Int64X(x.FptrMapInt8Int64, d) + } + } + case "FMapInt8Float32": + if r.TryDecodeAsNil() { + x.FMapInt8Float32 = nil + } else { + if false { + } else { + z.F.DecMapInt8Float32X(&x.FMapInt8Float32, d) + } + } + case "FptrMapInt8Float32": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Float32 != nil { + x.FptrMapInt8Float32 = nil + } + } else { + if x.FptrMapInt8Float32 == nil { + x.FptrMapInt8Float32 = new(map[int8]float32) + } + + if false { + } else { + z.F.DecMapInt8Float32X(x.FptrMapInt8Float32, d) + } + } + case "FMapInt8Float64": + if r.TryDecodeAsNil() { + x.FMapInt8Float64 = nil + } else { + if false { + } else { + z.F.DecMapInt8Float64X(&x.FMapInt8Float64, d) + } + } + case "FptrMapInt8Float64": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Float64 != nil { + x.FptrMapInt8Float64 = nil + } + } else { + if x.FptrMapInt8Float64 == nil { + x.FptrMapInt8Float64 = new(map[int8]float64) + } + + if false { + } else { + z.F.DecMapInt8Float64X(x.FptrMapInt8Float64, d) + } + } + case "FMapInt8Bool": + if r.TryDecodeAsNil() { + x.FMapInt8Bool = nil + } else { + if false { + } else { + z.F.DecMapInt8BoolX(&x.FMapInt8Bool, d) + } + } + case "FptrMapInt8Bool": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Bool != nil { + x.FptrMapInt8Bool = nil + } + } else { + if x.FptrMapInt8Bool == nil { + x.FptrMapInt8Bool = new(map[int8]bool) + } + + if false { + } else { + z.F.DecMapInt8BoolX(x.FptrMapInt8Bool, d) + } + } + case "FMapInt16Intf": + if r.TryDecodeAsNil() { + x.FMapInt16Intf = nil + } else { + if false { + } else { + z.F.DecMapInt16IntfX(&x.FMapInt16Intf, d) + } + } + case "FptrMapInt16Intf": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Intf != nil { + x.FptrMapInt16Intf = nil + } + } else { + if x.FptrMapInt16Intf == nil { + x.FptrMapInt16Intf = new(map[int16]interface{}) + } + + if false { + } else { + z.F.DecMapInt16IntfX(x.FptrMapInt16Intf, d) + } + } + case "FMapInt16String": + if r.TryDecodeAsNil() { + x.FMapInt16String = nil + } else { + if false { + } else { + z.F.DecMapInt16StringX(&x.FMapInt16String, d) + } + } + case "FptrMapInt16String": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16String != nil { + x.FptrMapInt16String = nil + } + } else { + if x.FptrMapInt16String == nil { + x.FptrMapInt16String = new(map[int16]string) + } + + if false { + } else { + z.F.DecMapInt16StringX(x.FptrMapInt16String, d) + } + } + case "FMapInt16Uint": + if r.TryDecodeAsNil() { + x.FMapInt16Uint = nil + } else { + if false { + } else { + z.F.DecMapInt16UintX(&x.FMapInt16Uint, d) + } + } + case "FptrMapInt16Uint": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Uint != nil { + x.FptrMapInt16Uint = nil + } + } else { + if x.FptrMapInt16Uint == nil { + x.FptrMapInt16Uint = new(map[int16]uint) + } + + if false { + } else { + z.F.DecMapInt16UintX(x.FptrMapInt16Uint, d) + } + } + case "FMapInt16Uint8": + if r.TryDecodeAsNil() { + x.FMapInt16Uint8 = nil + } else { + if false { + } else { + z.F.DecMapInt16Uint8X(&x.FMapInt16Uint8, d) + } + } + case "FptrMapInt16Uint8": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Uint8 != nil { + x.FptrMapInt16Uint8 = nil + } + } else { + if x.FptrMapInt16Uint8 == nil { + x.FptrMapInt16Uint8 = new(map[int16]uint8) + } + + if false { + } else { + z.F.DecMapInt16Uint8X(x.FptrMapInt16Uint8, d) + } + } + case "FMapInt16Uint16": + if r.TryDecodeAsNil() { + x.FMapInt16Uint16 = nil + } else { + if false { + } else { + z.F.DecMapInt16Uint16X(&x.FMapInt16Uint16, d) + } + } + case "FptrMapInt16Uint16": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Uint16 != nil { + x.FptrMapInt16Uint16 = nil + } + } else { + if x.FptrMapInt16Uint16 == nil { + x.FptrMapInt16Uint16 = new(map[int16]uint16) + } + + if false { + } else { + z.F.DecMapInt16Uint16X(x.FptrMapInt16Uint16, d) + } + } + case "FMapInt16Uint32": + if r.TryDecodeAsNil() { + x.FMapInt16Uint32 = nil + } else { + if false { + } else { + z.F.DecMapInt16Uint32X(&x.FMapInt16Uint32, d) + } + } + case "FptrMapInt16Uint32": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Uint32 != nil { + x.FptrMapInt16Uint32 = nil + } + } else { + if x.FptrMapInt16Uint32 == nil { + x.FptrMapInt16Uint32 = new(map[int16]uint32) + } + + if false { + } else { + z.F.DecMapInt16Uint32X(x.FptrMapInt16Uint32, d) + } + } + case "FMapInt16Uint64": + if r.TryDecodeAsNil() { + x.FMapInt16Uint64 = nil + } else { + if false { + } else { + z.F.DecMapInt16Uint64X(&x.FMapInt16Uint64, d) + } + } + case "FptrMapInt16Uint64": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Uint64 != nil { + x.FptrMapInt16Uint64 = nil + } + } else { + if x.FptrMapInt16Uint64 == nil { + x.FptrMapInt16Uint64 = new(map[int16]uint64) + } + + if false { + } else { + z.F.DecMapInt16Uint64X(x.FptrMapInt16Uint64, d) + } + } + case "FMapInt16Uintptr": + if r.TryDecodeAsNil() { + x.FMapInt16Uintptr = nil + } else { + if false { + } else { + z.F.DecMapInt16UintptrX(&x.FMapInt16Uintptr, d) + } + } + case "FptrMapInt16Uintptr": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Uintptr != nil { + x.FptrMapInt16Uintptr = nil + } + } else { + if x.FptrMapInt16Uintptr == nil { + x.FptrMapInt16Uintptr = new(map[int16]uintptr) + } + + if false { + } else { + z.F.DecMapInt16UintptrX(x.FptrMapInt16Uintptr, d) + } + } + case "FMapInt16Int": + if r.TryDecodeAsNil() { + x.FMapInt16Int = nil + } else { + if false { + } else { + z.F.DecMapInt16IntX(&x.FMapInt16Int, d) + } + } + case "FptrMapInt16Int": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Int != nil { + x.FptrMapInt16Int = nil + } + } else { + if x.FptrMapInt16Int == nil { + x.FptrMapInt16Int = new(map[int16]int) + } + + if false { + } else { + z.F.DecMapInt16IntX(x.FptrMapInt16Int, d) + } + } + case "FMapInt16Int8": + if r.TryDecodeAsNil() { + x.FMapInt16Int8 = nil + } else { + if false { + } else { + z.F.DecMapInt16Int8X(&x.FMapInt16Int8, d) + } + } + case "FptrMapInt16Int8": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Int8 != nil { + x.FptrMapInt16Int8 = nil + } + } else { + if x.FptrMapInt16Int8 == nil { + x.FptrMapInt16Int8 = new(map[int16]int8) + } + + if false { + } else { + z.F.DecMapInt16Int8X(x.FptrMapInt16Int8, d) + } + } + case "FMapInt16Int16": + if r.TryDecodeAsNil() { + x.FMapInt16Int16 = nil + } else { + if false { + } else { + z.F.DecMapInt16Int16X(&x.FMapInt16Int16, d) + } + } + case "FptrMapInt16Int16": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Int16 != nil { + x.FptrMapInt16Int16 = nil + } + } else { + if x.FptrMapInt16Int16 == nil { + x.FptrMapInt16Int16 = new(map[int16]int16) + } + + if false { + } else { + z.F.DecMapInt16Int16X(x.FptrMapInt16Int16, d) + } + } + case "FMapInt16Int32": + if r.TryDecodeAsNil() { + x.FMapInt16Int32 = nil + } else { + if false { + } else { + z.F.DecMapInt16Int32X(&x.FMapInt16Int32, d) + } + } + case "FptrMapInt16Int32": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Int32 != nil { + x.FptrMapInt16Int32 = nil + } + } else { + if x.FptrMapInt16Int32 == nil { + x.FptrMapInt16Int32 = new(map[int16]int32) + } + + if false { + } else { + z.F.DecMapInt16Int32X(x.FptrMapInt16Int32, d) + } + } + case "FMapInt16Int64": + if r.TryDecodeAsNil() { + x.FMapInt16Int64 = nil + } else { + if false { + } else { + z.F.DecMapInt16Int64X(&x.FMapInt16Int64, d) + } + } + case "FptrMapInt16Int64": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Int64 != nil { + x.FptrMapInt16Int64 = nil + } + } else { + if x.FptrMapInt16Int64 == nil { + x.FptrMapInt16Int64 = new(map[int16]int64) + } + + if false { + } else { + z.F.DecMapInt16Int64X(x.FptrMapInt16Int64, d) + } + } + case "FMapInt16Float32": + if r.TryDecodeAsNil() { + x.FMapInt16Float32 = nil + } else { + if false { + } else { + z.F.DecMapInt16Float32X(&x.FMapInt16Float32, d) + } + } + case "FptrMapInt16Float32": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Float32 != nil { + x.FptrMapInt16Float32 = nil + } + } else { + if x.FptrMapInt16Float32 == nil { + x.FptrMapInt16Float32 = new(map[int16]float32) + } + + if false { + } else { + z.F.DecMapInt16Float32X(x.FptrMapInt16Float32, d) + } + } + case "FMapInt16Float64": + if r.TryDecodeAsNil() { + x.FMapInt16Float64 = nil + } else { + if false { + } else { + z.F.DecMapInt16Float64X(&x.FMapInt16Float64, d) + } + } + case "FptrMapInt16Float64": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Float64 != nil { + x.FptrMapInt16Float64 = nil + } + } else { + if x.FptrMapInt16Float64 == nil { + x.FptrMapInt16Float64 = new(map[int16]float64) + } + + if false { + } else { + z.F.DecMapInt16Float64X(x.FptrMapInt16Float64, d) + } + } + case "FMapInt16Bool": + if r.TryDecodeAsNil() { + x.FMapInt16Bool = nil + } else { + if false { + } else { + z.F.DecMapInt16BoolX(&x.FMapInt16Bool, d) + } + } + case "FptrMapInt16Bool": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Bool != nil { + x.FptrMapInt16Bool = nil + } + } else { + if x.FptrMapInt16Bool == nil { + x.FptrMapInt16Bool = new(map[int16]bool) + } + + if false { + } else { + z.F.DecMapInt16BoolX(x.FptrMapInt16Bool, d) + } + } + case "FMapInt32Intf": + if r.TryDecodeAsNil() { + x.FMapInt32Intf = nil + } else { + if false { + } else { + z.F.DecMapInt32IntfX(&x.FMapInt32Intf, d) + } + } + case "FptrMapInt32Intf": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Intf != nil { + x.FptrMapInt32Intf = nil + } + } else { + if x.FptrMapInt32Intf == nil { + x.FptrMapInt32Intf = new(map[int32]interface{}) + } + + if false { + } else { + z.F.DecMapInt32IntfX(x.FptrMapInt32Intf, d) + } + } + case "FMapInt32String": + if r.TryDecodeAsNil() { + x.FMapInt32String = nil + } else { + if false { + } else { + z.F.DecMapInt32StringX(&x.FMapInt32String, d) + } + } + case "FptrMapInt32String": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32String != nil { + x.FptrMapInt32String = nil + } + } else { + if x.FptrMapInt32String == nil { + x.FptrMapInt32String = new(map[int32]string) + } + + if false { + } else { + z.F.DecMapInt32StringX(x.FptrMapInt32String, d) + } + } + case "FMapInt32Uint": + if r.TryDecodeAsNil() { + x.FMapInt32Uint = nil + } else { + if false { + } else { + z.F.DecMapInt32UintX(&x.FMapInt32Uint, d) + } + } + case "FptrMapInt32Uint": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Uint != nil { + x.FptrMapInt32Uint = nil + } + } else { + if x.FptrMapInt32Uint == nil { + x.FptrMapInt32Uint = new(map[int32]uint) + } + + if false { + } else { + z.F.DecMapInt32UintX(x.FptrMapInt32Uint, d) + } + } + case "FMapInt32Uint8": + if r.TryDecodeAsNil() { + x.FMapInt32Uint8 = nil + } else { + if false { + } else { + z.F.DecMapInt32Uint8X(&x.FMapInt32Uint8, d) + } + } + case "FptrMapInt32Uint8": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Uint8 != nil { + x.FptrMapInt32Uint8 = nil + } + } else { + if x.FptrMapInt32Uint8 == nil { + x.FptrMapInt32Uint8 = new(map[int32]uint8) + } + + if false { + } else { + z.F.DecMapInt32Uint8X(x.FptrMapInt32Uint8, d) + } + } + case "FMapInt32Uint16": + if r.TryDecodeAsNil() { + x.FMapInt32Uint16 = nil + } else { + if false { + } else { + z.F.DecMapInt32Uint16X(&x.FMapInt32Uint16, d) + } + } + case "FptrMapInt32Uint16": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Uint16 != nil { + x.FptrMapInt32Uint16 = nil + } + } else { + if x.FptrMapInt32Uint16 == nil { + x.FptrMapInt32Uint16 = new(map[int32]uint16) + } + + if false { + } else { + z.F.DecMapInt32Uint16X(x.FptrMapInt32Uint16, d) + } + } + case "FMapInt32Uint32": + if r.TryDecodeAsNil() { + x.FMapInt32Uint32 = nil + } else { + if false { + } else { + z.F.DecMapInt32Uint32X(&x.FMapInt32Uint32, d) + } + } + case "FptrMapInt32Uint32": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Uint32 != nil { + x.FptrMapInt32Uint32 = nil + } + } else { + if x.FptrMapInt32Uint32 == nil { + x.FptrMapInt32Uint32 = new(map[int32]uint32) + } + + if false { + } else { + z.F.DecMapInt32Uint32X(x.FptrMapInt32Uint32, d) + } + } + case "FMapInt32Uint64": + if r.TryDecodeAsNil() { + x.FMapInt32Uint64 = nil + } else { + if false { + } else { + z.F.DecMapInt32Uint64X(&x.FMapInt32Uint64, d) + } + } + case "FptrMapInt32Uint64": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Uint64 != nil { + x.FptrMapInt32Uint64 = nil + } + } else { + if x.FptrMapInt32Uint64 == nil { + x.FptrMapInt32Uint64 = new(map[int32]uint64) + } + + if false { + } else { + z.F.DecMapInt32Uint64X(x.FptrMapInt32Uint64, d) + } + } + case "FMapInt32Uintptr": + if r.TryDecodeAsNil() { + x.FMapInt32Uintptr = nil + } else { + if false { + } else { + z.F.DecMapInt32UintptrX(&x.FMapInt32Uintptr, d) + } + } + case "FptrMapInt32Uintptr": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Uintptr != nil { + x.FptrMapInt32Uintptr = nil + } + } else { + if x.FptrMapInt32Uintptr == nil { + x.FptrMapInt32Uintptr = new(map[int32]uintptr) + } + + if false { + } else { + z.F.DecMapInt32UintptrX(x.FptrMapInt32Uintptr, d) + } + } + case "FMapInt32Int": + if r.TryDecodeAsNil() { + x.FMapInt32Int = nil + } else { + if false { + } else { + z.F.DecMapInt32IntX(&x.FMapInt32Int, d) + } + } + case "FptrMapInt32Int": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Int != nil { + x.FptrMapInt32Int = nil + } + } else { + if x.FptrMapInt32Int == nil { + x.FptrMapInt32Int = new(map[int32]int) + } + + if false { + } else { + z.F.DecMapInt32IntX(x.FptrMapInt32Int, d) + } + } + case "FMapInt32Int8": + if r.TryDecodeAsNil() { + x.FMapInt32Int8 = nil + } else { + if false { + } else { + z.F.DecMapInt32Int8X(&x.FMapInt32Int8, d) + } + } + case "FptrMapInt32Int8": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Int8 != nil { + x.FptrMapInt32Int8 = nil + } + } else { + if x.FptrMapInt32Int8 == nil { + x.FptrMapInt32Int8 = new(map[int32]int8) + } + + if false { + } else { + z.F.DecMapInt32Int8X(x.FptrMapInt32Int8, d) + } + } + case "FMapInt32Int16": + if r.TryDecodeAsNil() { + x.FMapInt32Int16 = nil + } else { + if false { + } else { + z.F.DecMapInt32Int16X(&x.FMapInt32Int16, d) + } + } + case "FptrMapInt32Int16": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Int16 != nil { + x.FptrMapInt32Int16 = nil + } + } else { + if x.FptrMapInt32Int16 == nil { + x.FptrMapInt32Int16 = new(map[int32]int16) + } + + if false { + } else { + z.F.DecMapInt32Int16X(x.FptrMapInt32Int16, d) + } + } + case "FMapInt32Int32": + if r.TryDecodeAsNil() { + x.FMapInt32Int32 = nil + } else { + if false { + } else { + z.F.DecMapInt32Int32X(&x.FMapInt32Int32, d) + } + } + case "FptrMapInt32Int32": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Int32 != nil { + x.FptrMapInt32Int32 = nil + } + } else { + if x.FptrMapInt32Int32 == nil { + x.FptrMapInt32Int32 = new(map[int32]int32) + } + + if false { + } else { + z.F.DecMapInt32Int32X(x.FptrMapInt32Int32, d) + } + } + case "FMapInt32Int64": + if r.TryDecodeAsNil() { + x.FMapInt32Int64 = nil + } else { + if false { + } else { + z.F.DecMapInt32Int64X(&x.FMapInt32Int64, d) + } + } + case "FptrMapInt32Int64": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Int64 != nil { + x.FptrMapInt32Int64 = nil + } + } else { + if x.FptrMapInt32Int64 == nil { + x.FptrMapInt32Int64 = new(map[int32]int64) + } + + if false { + } else { + z.F.DecMapInt32Int64X(x.FptrMapInt32Int64, d) + } + } + case "FMapInt32Float32": + if r.TryDecodeAsNil() { + x.FMapInt32Float32 = nil + } else { + if false { + } else { + z.F.DecMapInt32Float32X(&x.FMapInt32Float32, d) + } + } + case "FptrMapInt32Float32": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Float32 != nil { + x.FptrMapInt32Float32 = nil + } + } else { + if x.FptrMapInt32Float32 == nil { + x.FptrMapInt32Float32 = new(map[int32]float32) + } + + if false { + } else { + z.F.DecMapInt32Float32X(x.FptrMapInt32Float32, d) + } + } + case "FMapInt32Float64": + if r.TryDecodeAsNil() { + x.FMapInt32Float64 = nil + } else { + if false { + } else { + z.F.DecMapInt32Float64X(&x.FMapInt32Float64, d) + } + } + case "FptrMapInt32Float64": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Float64 != nil { + x.FptrMapInt32Float64 = nil + } + } else { + if x.FptrMapInt32Float64 == nil { + x.FptrMapInt32Float64 = new(map[int32]float64) + } + + if false { + } else { + z.F.DecMapInt32Float64X(x.FptrMapInt32Float64, d) + } + } + case "FMapInt32Bool": + if r.TryDecodeAsNil() { + x.FMapInt32Bool = nil + } else { + if false { + } else { + z.F.DecMapInt32BoolX(&x.FMapInt32Bool, d) + } + } + case "FptrMapInt32Bool": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Bool != nil { + x.FptrMapInt32Bool = nil + } + } else { + if x.FptrMapInt32Bool == nil { + x.FptrMapInt32Bool = new(map[int32]bool) + } + + if false { + } else { + z.F.DecMapInt32BoolX(x.FptrMapInt32Bool, d) + } + } + case "FMapInt64Intf": + if r.TryDecodeAsNil() { + x.FMapInt64Intf = nil + } else { + if false { + } else { + z.F.DecMapInt64IntfX(&x.FMapInt64Intf, d) + } + } + case "FptrMapInt64Intf": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Intf != nil { + x.FptrMapInt64Intf = nil + } + } else { + if x.FptrMapInt64Intf == nil { + x.FptrMapInt64Intf = new(map[int64]interface{}) + } + + if false { + } else { + z.F.DecMapInt64IntfX(x.FptrMapInt64Intf, d) + } + } + case "FMapInt64String": + if r.TryDecodeAsNil() { + x.FMapInt64String = nil + } else { + if false { + } else { + z.F.DecMapInt64StringX(&x.FMapInt64String, d) + } + } + case "FptrMapInt64String": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64String != nil { + x.FptrMapInt64String = nil + } + } else { + if x.FptrMapInt64String == nil { + x.FptrMapInt64String = new(map[int64]string) + } + + if false { + } else { + z.F.DecMapInt64StringX(x.FptrMapInt64String, d) + } + } + case "FMapInt64Uint": + if r.TryDecodeAsNil() { + x.FMapInt64Uint = nil + } else { + if false { + } else { + z.F.DecMapInt64UintX(&x.FMapInt64Uint, d) + } + } + case "FptrMapInt64Uint": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Uint != nil { + x.FptrMapInt64Uint = nil + } + } else { + if x.FptrMapInt64Uint == nil { + x.FptrMapInt64Uint = new(map[int64]uint) + } + + if false { + } else { + z.F.DecMapInt64UintX(x.FptrMapInt64Uint, d) + } + } + case "FMapInt64Uint8": + if r.TryDecodeAsNil() { + x.FMapInt64Uint8 = nil + } else { + if false { + } else { + z.F.DecMapInt64Uint8X(&x.FMapInt64Uint8, d) + } + } + case "FptrMapInt64Uint8": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Uint8 != nil { + x.FptrMapInt64Uint8 = nil + } + } else { + if x.FptrMapInt64Uint8 == nil { + x.FptrMapInt64Uint8 = new(map[int64]uint8) + } + + if false { + } else { + z.F.DecMapInt64Uint8X(x.FptrMapInt64Uint8, d) + } + } + case "FMapInt64Uint16": + if r.TryDecodeAsNil() { + x.FMapInt64Uint16 = nil + } else { + if false { + } else { + z.F.DecMapInt64Uint16X(&x.FMapInt64Uint16, d) + } + } + case "FptrMapInt64Uint16": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Uint16 != nil { + x.FptrMapInt64Uint16 = nil + } + } else { + if x.FptrMapInt64Uint16 == nil { + x.FptrMapInt64Uint16 = new(map[int64]uint16) + } + + if false { + } else { + z.F.DecMapInt64Uint16X(x.FptrMapInt64Uint16, d) + } + } + case "FMapInt64Uint32": + if r.TryDecodeAsNil() { + x.FMapInt64Uint32 = nil + } else { + if false { + } else { + z.F.DecMapInt64Uint32X(&x.FMapInt64Uint32, d) + } + } + case "FptrMapInt64Uint32": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Uint32 != nil { + x.FptrMapInt64Uint32 = nil + } + } else { + if x.FptrMapInt64Uint32 == nil { + x.FptrMapInt64Uint32 = new(map[int64]uint32) + } + + if false { + } else { + z.F.DecMapInt64Uint32X(x.FptrMapInt64Uint32, d) + } + } + case "FMapInt64Uint64": + if r.TryDecodeAsNil() { + x.FMapInt64Uint64 = nil + } else { + if false { + } else { + z.F.DecMapInt64Uint64X(&x.FMapInt64Uint64, d) + } + } + case "FptrMapInt64Uint64": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Uint64 != nil { + x.FptrMapInt64Uint64 = nil + } + } else { + if x.FptrMapInt64Uint64 == nil { + x.FptrMapInt64Uint64 = new(map[int64]uint64) + } + + if false { + } else { + z.F.DecMapInt64Uint64X(x.FptrMapInt64Uint64, d) + } + } + case "FMapInt64Uintptr": + if r.TryDecodeAsNil() { + x.FMapInt64Uintptr = nil + } else { + if false { + } else { + z.F.DecMapInt64UintptrX(&x.FMapInt64Uintptr, d) + } + } + case "FptrMapInt64Uintptr": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Uintptr != nil { + x.FptrMapInt64Uintptr = nil + } + } else { + if x.FptrMapInt64Uintptr == nil { + x.FptrMapInt64Uintptr = new(map[int64]uintptr) + } + + if false { + } else { + z.F.DecMapInt64UintptrX(x.FptrMapInt64Uintptr, d) + } + } + case "FMapInt64Int": + if r.TryDecodeAsNil() { + x.FMapInt64Int = nil + } else { + if false { + } else { + z.F.DecMapInt64IntX(&x.FMapInt64Int, d) + } + } + case "FptrMapInt64Int": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Int != nil { + x.FptrMapInt64Int = nil + } + } else { + if x.FptrMapInt64Int == nil { + x.FptrMapInt64Int = new(map[int64]int) + } + + if false { + } else { + z.F.DecMapInt64IntX(x.FptrMapInt64Int, d) + } + } + case "FMapInt64Int8": + if r.TryDecodeAsNil() { + x.FMapInt64Int8 = nil + } else { + if false { + } else { + z.F.DecMapInt64Int8X(&x.FMapInt64Int8, d) + } + } + case "FptrMapInt64Int8": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Int8 != nil { + x.FptrMapInt64Int8 = nil + } + } else { + if x.FptrMapInt64Int8 == nil { + x.FptrMapInt64Int8 = new(map[int64]int8) + } + + if false { + } else { + z.F.DecMapInt64Int8X(x.FptrMapInt64Int8, d) + } + } + case "FMapInt64Int16": + if r.TryDecodeAsNil() { + x.FMapInt64Int16 = nil + } else { + if false { + } else { + z.F.DecMapInt64Int16X(&x.FMapInt64Int16, d) + } + } + case "FptrMapInt64Int16": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Int16 != nil { + x.FptrMapInt64Int16 = nil + } + } else { + if x.FptrMapInt64Int16 == nil { + x.FptrMapInt64Int16 = new(map[int64]int16) + } + + if false { + } else { + z.F.DecMapInt64Int16X(x.FptrMapInt64Int16, d) + } + } + case "FMapInt64Int32": + if r.TryDecodeAsNil() { + x.FMapInt64Int32 = nil + } else { + if false { + } else { + z.F.DecMapInt64Int32X(&x.FMapInt64Int32, d) + } + } + case "FptrMapInt64Int32": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Int32 != nil { + x.FptrMapInt64Int32 = nil + } + } else { + if x.FptrMapInt64Int32 == nil { + x.FptrMapInt64Int32 = new(map[int64]int32) + } + + if false { + } else { + z.F.DecMapInt64Int32X(x.FptrMapInt64Int32, d) + } + } + case "FMapInt64Int64": + if r.TryDecodeAsNil() { + x.FMapInt64Int64 = nil + } else { + if false { + } else { + z.F.DecMapInt64Int64X(&x.FMapInt64Int64, d) + } + } + case "FptrMapInt64Int64": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Int64 != nil { + x.FptrMapInt64Int64 = nil + } + } else { + if x.FptrMapInt64Int64 == nil { + x.FptrMapInt64Int64 = new(map[int64]int64) + } + + if false { + } else { + z.F.DecMapInt64Int64X(x.FptrMapInt64Int64, d) + } + } + case "FMapInt64Float32": + if r.TryDecodeAsNil() { + x.FMapInt64Float32 = nil + } else { + if false { + } else { + z.F.DecMapInt64Float32X(&x.FMapInt64Float32, d) + } + } + case "FptrMapInt64Float32": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Float32 != nil { + x.FptrMapInt64Float32 = nil + } + } else { + if x.FptrMapInt64Float32 == nil { + x.FptrMapInt64Float32 = new(map[int64]float32) + } + + if false { + } else { + z.F.DecMapInt64Float32X(x.FptrMapInt64Float32, d) + } + } + case "FMapInt64Float64": + if r.TryDecodeAsNil() { + x.FMapInt64Float64 = nil + } else { + if false { + } else { + z.F.DecMapInt64Float64X(&x.FMapInt64Float64, d) + } + } + case "FptrMapInt64Float64": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Float64 != nil { + x.FptrMapInt64Float64 = nil + } + } else { + if x.FptrMapInt64Float64 == nil { + x.FptrMapInt64Float64 = new(map[int64]float64) + } + + if false { + } else { + z.F.DecMapInt64Float64X(x.FptrMapInt64Float64, d) + } + } + case "FMapInt64Bool": + if r.TryDecodeAsNil() { + x.FMapInt64Bool = nil + } else { + if false { + } else { + z.F.DecMapInt64BoolX(&x.FMapInt64Bool, d) + } + } + case "FptrMapInt64Bool": + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Bool != nil { + x.FptrMapInt64Bool = nil + } + } else { + if x.FptrMapInt64Bool == nil { + x.FptrMapInt64Bool = new(map[int64]bool) + } + + if false { + } else { + z.F.DecMapInt64BoolX(x.FptrMapInt64Bool, d) + } + } + case "FMapBoolIntf": + if r.TryDecodeAsNil() { + x.FMapBoolIntf = nil + } else { + if false { + } else { + z.F.DecMapBoolIntfX(&x.FMapBoolIntf, d) + } + } + case "FptrMapBoolIntf": + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolIntf != nil { + x.FptrMapBoolIntf = nil + } + } else { + if x.FptrMapBoolIntf == nil { + x.FptrMapBoolIntf = new(map[bool]interface{}) + } + + if false { + } else { + z.F.DecMapBoolIntfX(x.FptrMapBoolIntf, d) + } + } + case "FMapBoolString": + if r.TryDecodeAsNil() { + x.FMapBoolString = nil + } else { + if false { + } else { + z.F.DecMapBoolStringX(&x.FMapBoolString, d) + } + } + case "FptrMapBoolString": + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolString != nil { + x.FptrMapBoolString = nil + } + } else { + if x.FptrMapBoolString == nil { + x.FptrMapBoolString = new(map[bool]string) + } + + if false { + } else { + z.F.DecMapBoolStringX(x.FptrMapBoolString, d) + } + } + case "FMapBoolUint": + if r.TryDecodeAsNil() { + x.FMapBoolUint = nil + } else { + if false { + } else { + z.F.DecMapBoolUintX(&x.FMapBoolUint, d) + } + } + case "FptrMapBoolUint": + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolUint != nil { + x.FptrMapBoolUint = nil + } + } else { + if x.FptrMapBoolUint == nil { + x.FptrMapBoolUint = new(map[bool]uint) + } + + if false { + } else { + z.F.DecMapBoolUintX(x.FptrMapBoolUint, d) + } + } + case "FMapBoolUint8": + if r.TryDecodeAsNil() { + x.FMapBoolUint8 = nil + } else { + if false { + } else { + z.F.DecMapBoolUint8X(&x.FMapBoolUint8, d) + } + } + case "FptrMapBoolUint8": + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolUint8 != nil { + x.FptrMapBoolUint8 = nil + } + } else { + if x.FptrMapBoolUint8 == nil { + x.FptrMapBoolUint8 = new(map[bool]uint8) + } + + if false { + } else { + z.F.DecMapBoolUint8X(x.FptrMapBoolUint8, d) + } + } + case "FMapBoolUint16": + if r.TryDecodeAsNil() { + x.FMapBoolUint16 = nil + } else { + if false { + } else { + z.F.DecMapBoolUint16X(&x.FMapBoolUint16, d) + } + } + case "FptrMapBoolUint16": + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolUint16 != nil { + x.FptrMapBoolUint16 = nil + } + } else { + if x.FptrMapBoolUint16 == nil { + x.FptrMapBoolUint16 = new(map[bool]uint16) + } + + if false { + } else { + z.F.DecMapBoolUint16X(x.FptrMapBoolUint16, d) + } + } + case "FMapBoolUint32": + if r.TryDecodeAsNil() { + x.FMapBoolUint32 = nil + } else { + if false { + } else { + z.F.DecMapBoolUint32X(&x.FMapBoolUint32, d) + } + } + case "FptrMapBoolUint32": + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolUint32 != nil { + x.FptrMapBoolUint32 = nil + } + } else { + if x.FptrMapBoolUint32 == nil { + x.FptrMapBoolUint32 = new(map[bool]uint32) + } + + if false { + } else { + z.F.DecMapBoolUint32X(x.FptrMapBoolUint32, d) + } + } + case "FMapBoolUint64": + if r.TryDecodeAsNil() { + x.FMapBoolUint64 = nil + } else { + if false { + } else { + z.F.DecMapBoolUint64X(&x.FMapBoolUint64, d) + } + } + case "FptrMapBoolUint64": + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolUint64 != nil { + x.FptrMapBoolUint64 = nil + } + } else { + if x.FptrMapBoolUint64 == nil { + x.FptrMapBoolUint64 = new(map[bool]uint64) + } + + if false { + } else { + z.F.DecMapBoolUint64X(x.FptrMapBoolUint64, d) + } + } + case "FMapBoolUintptr": + if r.TryDecodeAsNil() { + x.FMapBoolUintptr = nil + } else { + if false { + } else { + z.F.DecMapBoolUintptrX(&x.FMapBoolUintptr, d) + } + } + case "FptrMapBoolUintptr": + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolUintptr != nil { + x.FptrMapBoolUintptr = nil + } + } else { + if x.FptrMapBoolUintptr == nil { + x.FptrMapBoolUintptr = new(map[bool]uintptr) + } + + if false { + } else { + z.F.DecMapBoolUintptrX(x.FptrMapBoolUintptr, d) + } + } + case "FMapBoolInt": + if r.TryDecodeAsNil() { + x.FMapBoolInt = nil + } else { + if false { + } else { + z.F.DecMapBoolIntX(&x.FMapBoolInt, d) + } + } + case "FptrMapBoolInt": + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolInt != nil { + x.FptrMapBoolInt = nil + } + } else { + if x.FptrMapBoolInt == nil { + x.FptrMapBoolInt = new(map[bool]int) + } + + if false { + } else { + z.F.DecMapBoolIntX(x.FptrMapBoolInt, d) + } + } + case "FMapBoolInt8": + if r.TryDecodeAsNil() { + x.FMapBoolInt8 = nil + } else { + if false { + } else { + z.F.DecMapBoolInt8X(&x.FMapBoolInt8, d) + } + } + case "FptrMapBoolInt8": + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolInt8 != nil { + x.FptrMapBoolInt8 = nil + } + } else { + if x.FptrMapBoolInt8 == nil { + x.FptrMapBoolInt8 = new(map[bool]int8) + } + + if false { + } else { + z.F.DecMapBoolInt8X(x.FptrMapBoolInt8, d) + } + } + case "FMapBoolInt16": + if r.TryDecodeAsNil() { + x.FMapBoolInt16 = nil + } else { + if false { + } else { + z.F.DecMapBoolInt16X(&x.FMapBoolInt16, d) + } + } + case "FptrMapBoolInt16": + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolInt16 != nil { + x.FptrMapBoolInt16 = nil + } + } else { + if x.FptrMapBoolInt16 == nil { + x.FptrMapBoolInt16 = new(map[bool]int16) + } + + if false { + } else { + z.F.DecMapBoolInt16X(x.FptrMapBoolInt16, d) + } + } + case "FMapBoolInt32": + if r.TryDecodeAsNil() { + x.FMapBoolInt32 = nil + } else { + if false { + } else { + z.F.DecMapBoolInt32X(&x.FMapBoolInt32, d) + } + } + case "FptrMapBoolInt32": + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolInt32 != nil { + x.FptrMapBoolInt32 = nil + } + } else { + if x.FptrMapBoolInt32 == nil { + x.FptrMapBoolInt32 = new(map[bool]int32) + } + + if false { + } else { + z.F.DecMapBoolInt32X(x.FptrMapBoolInt32, d) + } + } + case "FMapBoolInt64": + if r.TryDecodeAsNil() { + x.FMapBoolInt64 = nil + } else { + if false { + } else { + z.F.DecMapBoolInt64X(&x.FMapBoolInt64, d) + } + } + case "FptrMapBoolInt64": + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolInt64 != nil { + x.FptrMapBoolInt64 = nil + } + } else { + if x.FptrMapBoolInt64 == nil { + x.FptrMapBoolInt64 = new(map[bool]int64) + } + + if false { + } else { + z.F.DecMapBoolInt64X(x.FptrMapBoolInt64, d) + } + } + case "FMapBoolFloat32": + if r.TryDecodeAsNil() { + x.FMapBoolFloat32 = nil + } else { + if false { + } else { + z.F.DecMapBoolFloat32X(&x.FMapBoolFloat32, d) + } + } + case "FptrMapBoolFloat32": + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolFloat32 != nil { + x.FptrMapBoolFloat32 = nil + } + } else { + if x.FptrMapBoolFloat32 == nil { + x.FptrMapBoolFloat32 = new(map[bool]float32) + } + + if false { + } else { + z.F.DecMapBoolFloat32X(x.FptrMapBoolFloat32, d) + } + } + case "FMapBoolFloat64": + if r.TryDecodeAsNil() { + x.FMapBoolFloat64 = nil + } else { + if false { + } else { + z.F.DecMapBoolFloat64X(&x.FMapBoolFloat64, d) + } + } + case "FptrMapBoolFloat64": + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolFloat64 != nil { + x.FptrMapBoolFloat64 = nil + } + } else { + if x.FptrMapBoolFloat64 == nil { + x.FptrMapBoolFloat64 = new(map[bool]float64) + } + + if false { + } else { + z.F.DecMapBoolFloat64X(x.FptrMapBoolFloat64, d) + } + } + case "FMapBoolBool": + if r.TryDecodeAsNil() { + x.FMapBoolBool = nil + } else { + if false { + } else { + z.F.DecMapBoolBoolX(&x.FMapBoolBool, d) + } + } + case "FptrMapBoolBool": + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolBool != nil { + x.FptrMapBoolBool = nil + } + } else { + if x.FptrMapBoolBool == nil { + x.FptrMapBoolBool = new(map[bool]bool) + } + + if false { + } else { + z.F.DecMapBoolBoolX(x.FptrMapBoolBool, d) + } + } + default: + z.DecStructFieldNotFound(-1, yys3) + } // end switch yys3 + } // end for yyj3 + r.ReadMapEnd() +} + +func (x *TestMammoth2) codecDecodeSelfFromArray(l int, d *Decoder) { + var h codecSelfer19781 + z, r := GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj1141 int + var yyb1141 bool + var yyhl1141 bool = l >= 0 + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FIntf = nil + } else { + if false { + } else { + z.DecFallback(&x.FIntf, true) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrIntf != nil { + x.FptrIntf = nil + } + } else { + if x.FptrIntf == nil { + x.FptrIntf = new(interface{}) + } + + if false { + } else { + z.DecFallback(x.FptrIntf, true) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FString = "" + } else { + x.FString = (string)(r.DecodeString()) + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrString != nil { + x.FptrString = nil + } + } else { + if x.FptrString == nil { + x.FptrString = new(string) + } + + if false { + } else { + *x.FptrString = (string)(r.DecodeString()) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FFloat32 = 0 + } else { + x.FFloat32 = (float32)(r.DecodeFloat32As64()) + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrFloat32 != nil { + x.FptrFloat32 = nil + } + } else { + if x.FptrFloat32 == nil { + x.FptrFloat32 = new(float32) + } + + if false { + } else { + *x.FptrFloat32 = (float32)(r.DecodeFloat32As64()) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FFloat64 = 0 + } else { + x.FFloat64 = (float64)(r.DecodeFloat64()) + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrFloat64 != nil { + x.FptrFloat64 = nil + } + } else { + if x.FptrFloat64 == nil { + x.FptrFloat64 = new(float64) + } + + if false { + } else { + *x.FptrFloat64 = (float64)(r.DecodeFloat64()) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FUint = 0 + } else { + x.FUint = (uint)(z.C.UintV(r.DecodeUint64(), codecSelferBitsize19781)) + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrUint != nil { + x.FptrUint = nil + } + } else { + if x.FptrUint == nil { + x.FptrUint = new(uint) + } + + if false { + } else { + *x.FptrUint = (uint)(z.C.UintV(r.DecodeUint64(), codecSelferBitsize19781)) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FUint8 = 0 + } else { + x.FUint8 = (uint8)(z.C.UintV(r.DecodeUint64(), 8)) + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrUint8 != nil { + x.FptrUint8 = nil + } + } else { + if x.FptrUint8 == nil { + x.FptrUint8 = new(uint8) + } + + if false { + } else { + *x.FptrUint8 = (uint8)(z.C.UintV(r.DecodeUint64(), 8)) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FUint16 = 0 + } else { + x.FUint16 = (uint16)(z.C.UintV(r.DecodeUint64(), 16)) + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrUint16 != nil { + x.FptrUint16 = nil + } + } else { + if x.FptrUint16 == nil { + x.FptrUint16 = new(uint16) + } + + if false { + } else { + *x.FptrUint16 = (uint16)(z.C.UintV(r.DecodeUint64(), 16)) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FUint32 = 0 + } else { + x.FUint32 = (uint32)(z.C.UintV(r.DecodeUint64(), 32)) + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrUint32 != nil { + x.FptrUint32 = nil + } + } else { + if x.FptrUint32 == nil { + x.FptrUint32 = new(uint32) + } + + if false { + } else { + *x.FptrUint32 = (uint32)(z.C.UintV(r.DecodeUint64(), 32)) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FUint64 = 0 + } else { + x.FUint64 = (uint64)(r.DecodeUint64()) + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrUint64 != nil { + x.FptrUint64 = nil + } + } else { + if x.FptrUint64 == nil { + x.FptrUint64 = new(uint64) + } + + if false { + } else { + *x.FptrUint64 = (uint64)(r.DecodeUint64()) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FUintptr = 0 + } else { + x.FUintptr = (uintptr)(z.C.UintV(r.DecodeUint64(), codecSelferBitsize19781)) + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrUintptr != nil { + x.FptrUintptr = nil + } + } else { + if x.FptrUintptr == nil { + x.FptrUintptr = new(uintptr) + } + + if false { + } else { + *x.FptrUintptr = (uintptr)(z.C.UintV(r.DecodeUint64(), codecSelferBitsize19781)) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FInt = 0 + } else { + x.FInt = (int)(z.C.IntV(r.DecodeInt64(), codecSelferBitsize19781)) + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrInt != nil { + x.FptrInt = nil + } + } else { + if x.FptrInt == nil { + x.FptrInt = new(int) + } + + if false { + } else { + *x.FptrInt = (int)(z.C.IntV(r.DecodeInt64(), codecSelferBitsize19781)) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FInt8 = 0 + } else { + x.FInt8 = (int8)(z.C.IntV(r.DecodeInt64(), 8)) + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrInt8 != nil { + x.FptrInt8 = nil + } + } else { + if x.FptrInt8 == nil { + x.FptrInt8 = new(int8) + } + + if false { + } else { + *x.FptrInt8 = (int8)(z.C.IntV(r.DecodeInt64(), 8)) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FInt16 = 0 + } else { + x.FInt16 = (int16)(z.C.IntV(r.DecodeInt64(), 16)) + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrInt16 != nil { + x.FptrInt16 = nil + } + } else { + if x.FptrInt16 == nil { + x.FptrInt16 = new(int16) + } + + if false { + } else { + *x.FptrInt16 = (int16)(z.C.IntV(r.DecodeInt64(), 16)) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FInt32 = 0 + } else { + x.FInt32 = (int32)(z.C.IntV(r.DecodeInt64(), 32)) + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrInt32 != nil { + x.FptrInt32 = nil + } + } else { + if x.FptrInt32 == nil { + x.FptrInt32 = new(int32) + } + + if false { + } else { + *x.FptrInt32 = (int32)(z.C.IntV(r.DecodeInt64(), 32)) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FInt64 = 0 + } else { + x.FInt64 = (int64)(r.DecodeInt64()) + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrInt64 != nil { + x.FptrInt64 = nil + } + } else { + if x.FptrInt64 == nil { + x.FptrInt64 = new(int64) + } + + if false { + } else { + *x.FptrInt64 = (int64)(r.DecodeInt64()) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FBool = false + } else { + x.FBool = (bool)(r.DecodeBool()) + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrBool != nil { + x.FptrBool = nil + } + } else { + if x.FptrBool == nil { + x.FptrBool = new(bool) + } + + if false { + } else { + *x.FptrBool = (bool)(r.DecodeBool()) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceIntf = nil + } else { + if false { + } else { + z.F.DecSliceIntfX(&x.FSliceIntf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrSliceIntf != nil { + x.FptrSliceIntf = nil + } + } else { + if x.FptrSliceIntf == nil { + x.FptrSliceIntf = new([]interface{}) + } + + if false { + } else { + z.F.DecSliceIntfX(x.FptrSliceIntf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceString = nil + } else { + if false { + } else { + z.F.DecSliceStringX(&x.FSliceString, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrSliceString != nil { + x.FptrSliceString = nil + } + } else { + if x.FptrSliceString == nil { + x.FptrSliceString = new([]string) + } + + if false { + } else { + z.F.DecSliceStringX(x.FptrSliceString, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceFloat32 = nil + } else { + if false { + } else { + z.F.DecSliceFloat32X(&x.FSliceFloat32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrSliceFloat32 != nil { + x.FptrSliceFloat32 = nil + } + } else { + if x.FptrSliceFloat32 == nil { + x.FptrSliceFloat32 = new([]float32) + } + + if false { + } else { + z.F.DecSliceFloat32X(x.FptrSliceFloat32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceFloat64 = nil + } else { + if false { + } else { + z.F.DecSliceFloat64X(&x.FSliceFloat64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrSliceFloat64 != nil { + x.FptrSliceFloat64 = nil + } + } else { + if x.FptrSliceFloat64 == nil { + x.FptrSliceFloat64 = new([]float64) + } + + if false { + } else { + z.F.DecSliceFloat64X(x.FptrSliceFloat64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceUint = nil + } else { + if false { + } else { + z.F.DecSliceUintX(&x.FSliceUint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrSliceUint != nil { + x.FptrSliceUint = nil + } + } else { + if x.FptrSliceUint == nil { + x.FptrSliceUint = new([]uint) + } + + if false { + } else { + z.F.DecSliceUintX(x.FptrSliceUint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceUint8 = nil + } else { + if false { + } else { + x.FSliceUint8 = r.DecodeBytes(([]byte)(x.FSliceUint8), false) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrSliceUint8 != nil { + x.FptrSliceUint8 = nil + } + } else { + if x.FptrSliceUint8 == nil { + x.FptrSliceUint8 = new([]uint8) + } + + if false { + } else { + *x.FptrSliceUint8 = r.DecodeBytes(*(*[]byte)(x.FptrSliceUint8), false) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceUint16 = nil + } else { + if false { + } else { + z.F.DecSliceUint16X(&x.FSliceUint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrSliceUint16 != nil { + x.FptrSliceUint16 = nil + } + } else { + if x.FptrSliceUint16 == nil { + x.FptrSliceUint16 = new([]uint16) + } + + if false { + } else { + z.F.DecSliceUint16X(x.FptrSliceUint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceUint32 = nil + } else { + if false { + } else { + z.F.DecSliceUint32X(&x.FSliceUint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrSliceUint32 != nil { + x.FptrSliceUint32 = nil + } + } else { + if x.FptrSliceUint32 == nil { + x.FptrSliceUint32 = new([]uint32) + } + + if false { + } else { + z.F.DecSliceUint32X(x.FptrSliceUint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceUint64 = nil + } else { + if false { + } else { + z.F.DecSliceUint64X(&x.FSliceUint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrSliceUint64 != nil { + x.FptrSliceUint64 = nil + } + } else { + if x.FptrSliceUint64 == nil { + x.FptrSliceUint64 = new([]uint64) + } + + if false { + } else { + z.F.DecSliceUint64X(x.FptrSliceUint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceUintptr = nil + } else { + if false { + } else { + z.F.DecSliceUintptrX(&x.FSliceUintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrSliceUintptr != nil { + x.FptrSliceUintptr = nil + } + } else { + if x.FptrSliceUintptr == nil { + x.FptrSliceUintptr = new([]uintptr) + } + + if false { + } else { + z.F.DecSliceUintptrX(x.FptrSliceUintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceInt = nil + } else { + if false { + } else { + z.F.DecSliceIntX(&x.FSliceInt, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrSliceInt != nil { + x.FptrSliceInt = nil + } + } else { + if x.FptrSliceInt == nil { + x.FptrSliceInt = new([]int) + } + + if false { + } else { + z.F.DecSliceIntX(x.FptrSliceInt, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceInt8 = nil + } else { + if false { + } else { + z.F.DecSliceInt8X(&x.FSliceInt8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrSliceInt8 != nil { + x.FptrSliceInt8 = nil + } + } else { + if x.FptrSliceInt8 == nil { + x.FptrSliceInt8 = new([]int8) + } + + if false { + } else { + z.F.DecSliceInt8X(x.FptrSliceInt8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceInt16 = nil + } else { + if false { + } else { + z.F.DecSliceInt16X(&x.FSliceInt16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrSliceInt16 != nil { + x.FptrSliceInt16 = nil + } + } else { + if x.FptrSliceInt16 == nil { + x.FptrSliceInt16 = new([]int16) + } + + if false { + } else { + z.F.DecSliceInt16X(x.FptrSliceInt16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceInt32 = nil + } else { + if false { + } else { + z.F.DecSliceInt32X(&x.FSliceInt32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrSliceInt32 != nil { + x.FptrSliceInt32 = nil + } + } else { + if x.FptrSliceInt32 == nil { + x.FptrSliceInt32 = new([]int32) + } + + if false { + } else { + z.F.DecSliceInt32X(x.FptrSliceInt32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceInt64 = nil + } else { + if false { + } else { + z.F.DecSliceInt64X(&x.FSliceInt64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrSliceInt64 != nil { + x.FptrSliceInt64 = nil + } + } else { + if x.FptrSliceInt64 == nil { + x.FptrSliceInt64 = new([]int64) + } + + if false { + } else { + z.F.DecSliceInt64X(x.FptrSliceInt64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceBool = nil + } else { + if false { + } else { + z.F.DecSliceBoolX(&x.FSliceBool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrSliceBool != nil { + x.FptrSliceBool = nil + } + } else { + if x.FptrSliceBool == nil { + x.FptrSliceBool = new([]bool) + } + + if false { + } else { + z.F.DecSliceBoolX(x.FptrSliceBool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfIntf = nil + } else { + if false { + } else { + z.F.DecMapIntfIntfX(&x.FMapIntfIntf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfIntf != nil { + x.FptrMapIntfIntf = nil + } + } else { + if x.FptrMapIntfIntf == nil { + x.FptrMapIntfIntf = new(map[interface{}]interface{}) + } + + if false { + } else { + z.F.DecMapIntfIntfX(x.FptrMapIntfIntf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfString = nil + } else { + if false { + } else { + z.F.DecMapIntfStringX(&x.FMapIntfString, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfString != nil { + x.FptrMapIntfString = nil + } + } else { + if x.FptrMapIntfString == nil { + x.FptrMapIntfString = new(map[interface{}]string) + } + + if false { + } else { + z.F.DecMapIntfStringX(x.FptrMapIntfString, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfUint = nil + } else { + if false { + } else { + z.F.DecMapIntfUintX(&x.FMapIntfUint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfUint != nil { + x.FptrMapIntfUint = nil + } + } else { + if x.FptrMapIntfUint == nil { + x.FptrMapIntfUint = new(map[interface{}]uint) + } + + if false { + } else { + z.F.DecMapIntfUintX(x.FptrMapIntfUint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfUint8 = nil + } else { + if false { + } else { + z.F.DecMapIntfUint8X(&x.FMapIntfUint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfUint8 != nil { + x.FptrMapIntfUint8 = nil + } + } else { + if x.FptrMapIntfUint8 == nil { + x.FptrMapIntfUint8 = new(map[interface{}]uint8) + } + + if false { + } else { + z.F.DecMapIntfUint8X(x.FptrMapIntfUint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfUint16 = nil + } else { + if false { + } else { + z.F.DecMapIntfUint16X(&x.FMapIntfUint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfUint16 != nil { + x.FptrMapIntfUint16 = nil + } + } else { + if x.FptrMapIntfUint16 == nil { + x.FptrMapIntfUint16 = new(map[interface{}]uint16) + } + + if false { + } else { + z.F.DecMapIntfUint16X(x.FptrMapIntfUint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfUint32 = nil + } else { + if false { + } else { + z.F.DecMapIntfUint32X(&x.FMapIntfUint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfUint32 != nil { + x.FptrMapIntfUint32 = nil + } + } else { + if x.FptrMapIntfUint32 == nil { + x.FptrMapIntfUint32 = new(map[interface{}]uint32) + } + + if false { + } else { + z.F.DecMapIntfUint32X(x.FptrMapIntfUint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfUint64 = nil + } else { + if false { + } else { + z.F.DecMapIntfUint64X(&x.FMapIntfUint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfUint64 != nil { + x.FptrMapIntfUint64 = nil + } + } else { + if x.FptrMapIntfUint64 == nil { + x.FptrMapIntfUint64 = new(map[interface{}]uint64) + } + + if false { + } else { + z.F.DecMapIntfUint64X(x.FptrMapIntfUint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfUintptr = nil + } else { + if false { + } else { + z.F.DecMapIntfUintptrX(&x.FMapIntfUintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfUintptr != nil { + x.FptrMapIntfUintptr = nil + } + } else { + if x.FptrMapIntfUintptr == nil { + x.FptrMapIntfUintptr = new(map[interface{}]uintptr) + } + + if false { + } else { + z.F.DecMapIntfUintptrX(x.FptrMapIntfUintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfInt = nil + } else { + if false { + } else { + z.F.DecMapIntfIntX(&x.FMapIntfInt, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfInt != nil { + x.FptrMapIntfInt = nil + } + } else { + if x.FptrMapIntfInt == nil { + x.FptrMapIntfInt = new(map[interface{}]int) + } + + if false { + } else { + z.F.DecMapIntfIntX(x.FptrMapIntfInt, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfInt8 = nil + } else { + if false { + } else { + z.F.DecMapIntfInt8X(&x.FMapIntfInt8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfInt8 != nil { + x.FptrMapIntfInt8 = nil + } + } else { + if x.FptrMapIntfInt8 == nil { + x.FptrMapIntfInt8 = new(map[interface{}]int8) + } + + if false { + } else { + z.F.DecMapIntfInt8X(x.FptrMapIntfInt8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfInt16 = nil + } else { + if false { + } else { + z.F.DecMapIntfInt16X(&x.FMapIntfInt16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfInt16 != nil { + x.FptrMapIntfInt16 = nil + } + } else { + if x.FptrMapIntfInt16 == nil { + x.FptrMapIntfInt16 = new(map[interface{}]int16) + } + + if false { + } else { + z.F.DecMapIntfInt16X(x.FptrMapIntfInt16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfInt32 = nil + } else { + if false { + } else { + z.F.DecMapIntfInt32X(&x.FMapIntfInt32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfInt32 != nil { + x.FptrMapIntfInt32 = nil + } + } else { + if x.FptrMapIntfInt32 == nil { + x.FptrMapIntfInt32 = new(map[interface{}]int32) + } + + if false { + } else { + z.F.DecMapIntfInt32X(x.FptrMapIntfInt32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfInt64 = nil + } else { + if false { + } else { + z.F.DecMapIntfInt64X(&x.FMapIntfInt64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfInt64 != nil { + x.FptrMapIntfInt64 = nil + } + } else { + if x.FptrMapIntfInt64 == nil { + x.FptrMapIntfInt64 = new(map[interface{}]int64) + } + + if false { + } else { + z.F.DecMapIntfInt64X(x.FptrMapIntfInt64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfFloat32 = nil + } else { + if false { + } else { + z.F.DecMapIntfFloat32X(&x.FMapIntfFloat32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfFloat32 != nil { + x.FptrMapIntfFloat32 = nil + } + } else { + if x.FptrMapIntfFloat32 == nil { + x.FptrMapIntfFloat32 = new(map[interface{}]float32) + } + + if false { + } else { + z.F.DecMapIntfFloat32X(x.FptrMapIntfFloat32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfFloat64 = nil + } else { + if false { + } else { + z.F.DecMapIntfFloat64X(&x.FMapIntfFloat64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfFloat64 != nil { + x.FptrMapIntfFloat64 = nil + } + } else { + if x.FptrMapIntfFloat64 == nil { + x.FptrMapIntfFloat64 = new(map[interface{}]float64) + } + + if false { + } else { + z.F.DecMapIntfFloat64X(x.FptrMapIntfFloat64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfBool = nil + } else { + if false { + } else { + z.F.DecMapIntfBoolX(&x.FMapIntfBool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntfBool != nil { + x.FptrMapIntfBool = nil + } + } else { + if x.FptrMapIntfBool == nil { + x.FptrMapIntfBool = new(map[interface{}]bool) + } + + if false { + } else { + z.F.DecMapIntfBoolX(x.FptrMapIntfBool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringIntf = nil + } else { + if false { + } else { + z.F.DecMapStringIntfX(&x.FMapStringIntf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapStringIntf != nil { + x.FptrMapStringIntf = nil + } + } else { + if x.FptrMapStringIntf == nil { + x.FptrMapStringIntf = new(map[string]interface{}) + } + + if false { + } else { + z.F.DecMapStringIntfX(x.FptrMapStringIntf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringString = nil + } else { + if false { + } else { + z.F.DecMapStringStringX(&x.FMapStringString, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapStringString != nil { + x.FptrMapStringString = nil + } + } else { + if x.FptrMapStringString == nil { + x.FptrMapStringString = new(map[string]string) + } + + if false { + } else { + z.F.DecMapStringStringX(x.FptrMapStringString, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringUint = nil + } else { + if false { + } else { + z.F.DecMapStringUintX(&x.FMapStringUint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapStringUint != nil { + x.FptrMapStringUint = nil + } + } else { + if x.FptrMapStringUint == nil { + x.FptrMapStringUint = new(map[string]uint) + } + + if false { + } else { + z.F.DecMapStringUintX(x.FptrMapStringUint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringUint8 = nil + } else { + if false { + } else { + z.F.DecMapStringUint8X(&x.FMapStringUint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapStringUint8 != nil { + x.FptrMapStringUint8 = nil + } + } else { + if x.FptrMapStringUint8 == nil { + x.FptrMapStringUint8 = new(map[string]uint8) + } + + if false { + } else { + z.F.DecMapStringUint8X(x.FptrMapStringUint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringUint16 = nil + } else { + if false { + } else { + z.F.DecMapStringUint16X(&x.FMapStringUint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapStringUint16 != nil { + x.FptrMapStringUint16 = nil + } + } else { + if x.FptrMapStringUint16 == nil { + x.FptrMapStringUint16 = new(map[string]uint16) + } + + if false { + } else { + z.F.DecMapStringUint16X(x.FptrMapStringUint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringUint32 = nil + } else { + if false { + } else { + z.F.DecMapStringUint32X(&x.FMapStringUint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapStringUint32 != nil { + x.FptrMapStringUint32 = nil + } + } else { + if x.FptrMapStringUint32 == nil { + x.FptrMapStringUint32 = new(map[string]uint32) + } + + if false { + } else { + z.F.DecMapStringUint32X(x.FptrMapStringUint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringUint64 = nil + } else { + if false { + } else { + z.F.DecMapStringUint64X(&x.FMapStringUint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapStringUint64 != nil { + x.FptrMapStringUint64 = nil + } + } else { + if x.FptrMapStringUint64 == nil { + x.FptrMapStringUint64 = new(map[string]uint64) + } + + if false { + } else { + z.F.DecMapStringUint64X(x.FptrMapStringUint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringUintptr = nil + } else { + if false { + } else { + z.F.DecMapStringUintptrX(&x.FMapStringUintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapStringUintptr != nil { + x.FptrMapStringUintptr = nil + } + } else { + if x.FptrMapStringUintptr == nil { + x.FptrMapStringUintptr = new(map[string]uintptr) + } + + if false { + } else { + z.F.DecMapStringUintptrX(x.FptrMapStringUintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringInt = nil + } else { + if false { + } else { + z.F.DecMapStringIntX(&x.FMapStringInt, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapStringInt != nil { + x.FptrMapStringInt = nil + } + } else { + if x.FptrMapStringInt == nil { + x.FptrMapStringInt = new(map[string]int) + } + + if false { + } else { + z.F.DecMapStringIntX(x.FptrMapStringInt, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringInt8 = nil + } else { + if false { + } else { + z.F.DecMapStringInt8X(&x.FMapStringInt8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapStringInt8 != nil { + x.FptrMapStringInt8 = nil + } + } else { + if x.FptrMapStringInt8 == nil { + x.FptrMapStringInt8 = new(map[string]int8) + } + + if false { + } else { + z.F.DecMapStringInt8X(x.FptrMapStringInt8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringInt16 = nil + } else { + if false { + } else { + z.F.DecMapStringInt16X(&x.FMapStringInt16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapStringInt16 != nil { + x.FptrMapStringInt16 = nil + } + } else { + if x.FptrMapStringInt16 == nil { + x.FptrMapStringInt16 = new(map[string]int16) + } + + if false { + } else { + z.F.DecMapStringInt16X(x.FptrMapStringInt16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringInt32 = nil + } else { + if false { + } else { + z.F.DecMapStringInt32X(&x.FMapStringInt32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapStringInt32 != nil { + x.FptrMapStringInt32 = nil + } + } else { + if x.FptrMapStringInt32 == nil { + x.FptrMapStringInt32 = new(map[string]int32) + } + + if false { + } else { + z.F.DecMapStringInt32X(x.FptrMapStringInt32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringInt64 = nil + } else { + if false { + } else { + z.F.DecMapStringInt64X(&x.FMapStringInt64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapStringInt64 != nil { + x.FptrMapStringInt64 = nil + } + } else { + if x.FptrMapStringInt64 == nil { + x.FptrMapStringInt64 = new(map[string]int64) + } + + if false { + } else { + z.F.DecMapStringInt64X(x.FptrMapStringInt64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringFloat32 = nil + } else { + if false { + } else { + z.F.DecMapStringFloat32X(&x.FMapStringFloat32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapStringFloat32 != nil { + x.FptrMapStringFloat32 = nil + } + } else { + if x.FptrMapStringFloat32 == nil { + x.FptrMapStringFloat32 = new(map[string]float32) + } + + if false { + } else { + z.F.DecMapStringFloat32X(x.FptrMapStringFloat32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringFloat64 = nil + } else { + if false { + } else { + z.F.DecMapStringFloat64X(&x.FMapStringFloat64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapStringFloat64 != nil { + x.FptrMapStringFloat64 = nil + } + } else { + if x.FptrMapStringFloat64 == nil { + x.FptrMapStringFloat64 = new(map[string]float64) + } + + if false { + } else { + z.F.DecMapStringFloat64X(x.FptrMapStringFloat64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringBool = nil + } else { + if false { + } else { + z.F.DecMapStringBoolX(&x.FMapStringBool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapStringBool != nil { + x.FptrMapStringBool = nil + } + } else { + if x.FptrMapStringBool == nil { + x.FptrMapStringBool = new(map[string]bool) + } + + if false { + } else { + z.F.DecMapStringBoolX(x.FptrMapStringBool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Intf = nil + } else { + if false { + } else { + z.F.DecMapFloat32IntfX(&x.FMapFloat32Intf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Intf != nil { + x.FptrMapFloat32Intf = nil + } + } else { + if x.FptrMapFloat32Intf == nil { + x.FptrMapFloat32Intf = new(map[float32]interface{}) + } + + if false { + } else { + z.F.DecMapFloat32IntfX(x.FptrMapFloat32Intf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32String = nil + } else { + if false { + } else { + z.F.DecMapFloat32StringX(&x.FMapFloat32String, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32String != nil { + x.FptrMapFloat32String = nil + } + } else { + if x.FptrMapFloat32String == nil { + x.FptrMapFloat32String = new(map[float32]string) + } + + if false { + } else { + z.F.DecMapFloat32StringX(x.FptrMapFloat32String, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Uint = nil + } else { + if false { + } else { + z.F.DecMapFloat32UintX(&x.FMapFloat32Uint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Uint != nil { + x.FptrMapFloat32Uint = nil + } + } else { + if x.FptrMapFloat32Uint == nil { + x.FptrMapFloat32Uint = new(map[float32]uint) + } + + if false { + } else { + z.F.DecMapFloat32UintX(x.FptrMapFloat32Uint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Uint8 = nil + } else { + if false { + } else { + z.F.DecMapFloat32Uint8X(&x.FMapFloat32Uint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Uint8 != nil { + x.FptrMapFloat32Uint8 = nil + } + } else { + if x.FptrMapFloat32Uint8 == nil { + x.FptrMapFloat32Uint8 = new(map[float32]uint8) + } + + if false { + } else { + z.F.DecMapFloat32Uint8X(x.FptrMapFloat32Uint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Uint16 = nil + } else { + if false { + } else { + z.F.DecMapFloat32Uint16X(&x.FMapFloat32Uint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Uint16 != nil { + x.FptrMapFloat32Uint16 = nil + } + } else { + if x.FptrMapFloat32Uint16 == nil { + x.FptrMapFloat32Uint16 = new(map[float32]uint16) + } + + if false { + } else { + z.F.DecMapFloat32Uint16X(x.FptrMapFloat32Uint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Uint32 = nil + } else { + if false { + } else { + z.F.DecMapFloat32Uint32X(&x.FMapFloat32Uint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Uint32 != nil { + x.FptrMapFloat32Uint32 = nil + } + } else { + if x.FptrMapFloat32Uint32 == nil { + x.FptrMapFloat32Uint32 = new(map[float32]uint32) + } + + if false { + } else { + z.F.DecMapFloat32Uint32X(x.FptrMapFloat32Uint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Uint64 = nil + } else { + if false { + } else { + z.F.DecMapFloat32Uint64X(&x.FMapFloat32Uint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Uint64 != nil { + x.FptrMapFloat32Uint64 = nil + } + } else { + if x.FptrMapFloat32Uint64 == nil { + x.FptrMapFloat32Uint64 = new(map[float32]uint64) + } + + if false { + } else { + z.F.DecMapFloat32Uint64X(x.FptrMapFloat32Uint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Uintptr = nil + } else { + if false { + } else { + z.F.DecMapFloat32UintptrX(&x.FMapFloat32Uintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Uintptr != nil { + x.FptrMapFloat32Uintptr = nil + } + } else { + if x.FptrMapFloat32Uintptr == nil { + x.FptrMapFloat32Uintptr = new(map[float32]uintptr) + } + + if false { + } else { + z.F.DecMapFloat32UintptrX(x.FptrMapFloat32Uintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Int = nil + } else { + if false { + } else { + z.F.DecMapFloat32IntX(&x.FMapFloat32Int, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Int != nil { + x.FptrMapFloat32Int = nil + } + } else { + if x.FptrMapFloat32Int == nil { + x.FptrMapFloat32Int = new(map[float32]int) + } + + if false { + } else { + z.F.DecMapFloat32IntX(x.FptrMapFloat32Int, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Int8 = nil + } else { + if false { + } else { + z.F.DecMapFloat32Int8X(&x.FMapFloat32Int8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Int8 != nil { + x.FptrMapFloat32Int8 = nil + } + } else { + if x.FptrMapFloat32Int8 == nil { + x.FptrMapFloat32Int8 = new(map[float32]int8) + } + + if false { + } else { + z.F.DecMapFloat32Int8X(x.FptrMapFloat32Int8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Int16 = nil + } else { + if false { + } else { + z.F.DecMapFloat32Int16X(&x.FMapFloat32Int16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Int16 != nil { + x.FptrMapFloat32Int16 = nil + } + } else { + if x.FptrMapFloat32Int16 == nil { + x.FptrMapFloat32Int16 = new(map[float32]int16) + } + + if false { + } else { + z.F.DecMapFloat32Int16X(x.FptrMapFloat32Int16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Int32 = nil + } else { + if false { + } else { + z.F.DecMapFloat32Int32X(&x.FMapFloat32Int32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Int32 != nil { + x.FptrMapFloat32Int32 = nil + } + } else { + if x.FptrMapFloat32Int32 == nil { + x.FptrMapFloat32Int32 = new(map[float32]int32) + } + + if false { + } else { + z.F.DecMapFloat32Int32X(x.FptrMapFloat32Int32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Int64 = nil + } else { + if false { + } else { + z.F.DecMapFloat32Int64X(&x.FMapFloat32Int64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Int64 != nil { + x.FptrMapFloat32Int64 = nil + } + } else { + if x.FptrMapFloat32Int64 == nil { + x.FptrMapFloat32Int64 = new(map[float32]int64) + } + + if false { + } else { + z.F.DecMapFloat32Int64X(x.FptrMapFloat32Int64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Float32 = nil + } else { + if false { + } else { + z.F.DecMapFloat32Float32X(&x.FMapFloat32Float32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Float32 != nil { + x.FptrMapFloat32Float32 = nil + } + } else { + if x.FptrMapFloat32Float32 == nil { + x.FptrMapFloat32Float32 = new(map[float32]float32) + } + + if false { + } else { + z.F.DecMapFloat32Float32X(x.FptrMapFloat32Float32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Float64 = nil + } else { + if false { + } else { + z.F.DecMapFloat32Float64X(&x.FMapFloat32Float64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Float64 != nil { + x.FptrMapFloat32Float64 = nil + } + } else { + if x.FptrMapFloat32Float64 == nil { + x.FptrMapFloat32Float64 = new(map[float32]float64) + } + + if false { + } else { + z.F.DecMapFloat32Float64X(x.FptrMapFloat32Float64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Bool = nil + } else { + if false { + } else { + z.F.DecMapFloat32BoolX(&x.FMapFloat32Bool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat32Bool != nil { + x.FptrMapFloat32Bool = nil + } + } else { + if x.FptrMapFloat32Bool == nil { + x.FptrMapFloat32Bool = new(map[float32]bool) + } + + if false { + } else { + z.F.DecMapFloat32BoolX(x.FptrMapFloat32Bool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Intf = nil + } else { + if false { + } else { + z.F.DecMapFloat64IntfX(&x.FMapFloat64Intf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Intf != nil { + x.FptrMapFloat64Intf = nil + } + } else { + if x.FptrMapFloat64Intf == nil { + x.FptrMapFloat64Intf = new(map[float64]interface{}) + } + + if false { + } else { + z.F.DecMapFloat64IntfX(x.FptrMapFloat64Intf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64String = nil + } else { + if false { + } else { + z.F.DecMapFloat64StringX(&x.FMapFloat64String, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64String != nil { + x.FptrMapFloat64String = nil + } + } else { + if x.FptrMapFloat64String == nil { + x.FptrMapFloat64String = new(map[float64]string) + } + + if false { + } else { + z.F.DecMapFloat64StringX(x.FptrMapFloat64String, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Uint = nil + } else { + if false { + } else { + z.F.DecMapFloat64UintX(&x.FMapFloat64Uint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Uint != nil { + x.FptrMapFloat64Uint = nil + } + } else { + if x.FptrMapFloat64Uint == nil { + x.FptrMapFloat64Uint = new(map[float64]uint) + } + + if false { + } else { + z.F.DecMapFloat64UintX(x.FptrMapFloat64Uint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Uint8 = nil + } else { + if false { + } else { + z.F.DecMapFloat64Uint8X(&x.FMapFloat64Uint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Uint8 != nil { + x.FptrMapFloat64Uint8 = nil + } + } else { + if x.FptrMapFloat64Uint8 == nil { + x.FptrMapFloat64Uint8 = new(map[float64]uint8) + } + + if false { + } else { + z.F.DecMapFloat64Uint8X(x.FptrMapFloat64Uint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Uint16 = nil + } else { + if false { + } else { + z.F.DecMapFloat64Uint16X(&x.FMapFloat64Uint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Uint16 != nil { + x.FptrMapFloat64Uint16 = nil + } + } else { + if x.FptrMapFloat64Uint16 == nil { + x.FptrMapFloat64Uint16 = new(map[float64]uint16) + } + + if false { + } else { + z.F.DecMapFloat64Uint16X(x.FptrMapFloat64Uint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Uint32 = nil + } else { + if false { + } else { + z.F.DecMapFloat64Uint32X(&x.FMapFloat64Uint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Uint32 != nil { + x.FptrMapFloat64Uint32 = nil + } + } else { + if x.FptrMapFloat64Uint32 == nil { + x.FptrMapFloat64Uint32 = new(map[float64]uint32) + } + + if false { + } else { + z.F.DecMapFloat64Uint32X(x.FptrMapFloat64Uint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Uint64 = nil + } else { + if false { + } else { + z.F.DecMapFloat64Uint64X(&x.FMapFloat64Uint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Uint64 != nil { + x.FptrMapFloat64Uint64 = nil + } + } else { + if x.FptrMapFloat64Uint64 == nil { + x.FptrMapFloat64Uint64 = new(map[float64]uint64) + } + + if false { + } else { + z.F.DecMapFloat64Uint64X(x.FptrMapFloat64Uint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Uintptr = nil + } else { + if false { + } else { + z.F.DecMapFloat64UintptrX(&x.FMapFloat64Uintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Uintptr != nil { + x.FptrMapFloat64Uintptr = nil + } + } else { + if x.FptrMapFloat64Uintptr == nil { + x.FptrMapFloat64Uintptr = new(map[float64]uintptr) + } + + if false { + } else { + z.F.DecMapFloat64UintptrX(x.FptrMapFloat64Uintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Int = nil + } else { + if false { + } else { + z.F.DecMapFloat64IntX(&x.FMapFloat64Int, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Int != nil { + x.FptrMapFloat64Int = nil + } + } else { + if x.FptrMapFloat64Int == nil { + x.FptrMapFloat64Int = new(map[float64]int) + } + + if false { + } else { + z.F.DecMapFloat64IntX(x.FptrMapFloat64Int, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Int8 = nil + } else { + if false { + } else { + z.F.DecMapFloat64Int8X(&x.FMapFloat64Int8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Int8 != nil { + x.FptrMapFloat64Int8 = nil + } + } else { + if x.FptrMapFloat64Int8 == nil { + x.FptrMapFloat64Int8 = new(map[float64]int8) + } + + if false { + } else { + z.F.DecMapFloat64Int8X(x.FptrMapFloat64Int8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Int16 = nil + } else { + if false { + } else { + z.F.DecMapFloat64Int16X(&x.FMapFloat64Int16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Int16 != nil { + x.FptrMapFloat64Int16 = nil + } + } else { + if x.FptrMapFloat64Int16 == nil { + x.FptrMapFloat64Int16 = new(map[float64]int16) + } + + if false { + } else { + z.F.DecMapFloat64Int16X(x.FptrMapFloat64Int16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Int32 = nil + } else { + if false { + } else { + z.F.DecMapFloat64Int32X(&x.FMapFloat64Int32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Int32 != nil { + x.FptrMapFloat64Int32 = nil + } + } else { + if x.FptrMapFloat64Int32 == nil { + x.FptrMapFloat64Int32 = new(map[float64]int32) + } + + if false { + } else { + z.F.DecMapFloat64Int32X(x.FptrMapFloat64Int32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Int64 = nil + } else { + if false { + } else { + z.F.DecMapFloat64Int64X(&x.FMapFloat64Int64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Int64 != nil { + x.FptrMapFloat64Int64 = nil + } + } else { + if x.FptrMapFloat64Int64 == nil { + x.FptrMapFloat64Int64 = new(map[float64]int64) + } + + if false { + } else { + z.F.DecMapFloat64Int64X(x.FptrMapFloat64Int64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Float32 = nil + } else { + if false { + } else { + z.F.DecMapFloat64Float32X(&x.FMapFloat64Float32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Float32 != nil { + x.FptrMapFloat64Float32 = nil + } + } else { + if x.FptrMapFloat64Float32 == nil { + x.FptrMapFloat64Float32 = new(map[float64]float32) + } + + if false { + } else { + z.F.DecMapFloat64Float32X(x.FptrMapFloat64Float32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Float64 = nil + } else { + if false { + } else { + z.F.DecMapFloat64Float64X(&x.FMapFloat64Float64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Float64 != nil { + x.FptrMapFloat64Float64 = nil + } + } else { + if x.FptrMapFloat64Float64 == nil { + x.FptrMapFloat64Float64 = new(map[float64]float64) + } + + if false { + } else { + z.F.DecMapFloat64Float64X(x.FptrMapFloat64Float64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Bool = nil + } else { + if false { + } else { + z.F.DecMapFloat64BoolX(&x.FMapFloat64Bool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapFloat64Bool != nil { + x.FptrMapFloat64Bool = nil + } + } else { + if x.FptrMapFloat64Bool == nil { + x.FptrMapFloat64Bool = new(map[float64]bool) + } + + if false { + } else { + z.F.DecMapFloat64BoolX(x.FptrMapFloat64Bool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintIntf = nil + } else { + if false { + } else { + z.F.DecMapUintIntfX(&x.FMapUintIntf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintIntf != nil { + x.FptrMapUintIntf = nil + } + } else { + if x.FptrMapUintIntf == nil { + x.FptrMapUintIntf = new(map[uint]interface{}) + } + + if false { + } else { + z.F.DecMapUintIntfX(x.FptrMapUintIntf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintString = nil + } else { + if false { + } else { + z.F.DecMapUintStringX(&x.FMapUintString, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintString != nil { + x.FptrMapUintString = nil + } + } else { + if x.FptrMapUintString == nil { + x.FptrMapUintString = new(map[uint]string) + } + + if false { + } else { + z.F.DecMapUintStringX(x.FptrMapUintString, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintUint = nil + } else { + if false { + } else { + z.F.DecMapUintUintX(&x.FMapUintUint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintUint != nil { + x.FptrMapUintUint = nil + } + } else { + if x.FptrMapUintUint == nil { + x.FptrMapUintUint = new(map[uint]uint) + } + + if false { + } else { + z.F.DecMapUintUintX(x.FptrMapUintUint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintUint8 = nil + } else { + if false { + } else { + z.F.DecMapUintUint8X(&x.FMapUintUint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintUint8 != nil { + x.FptrMapUintUint8 = nil + } + } else { + if x.FptrMapUintUint8 == nil { + x.FptrMapUintUint8 = new(map[uint]uint8) + } + + if false { + } else { + z.F.DecMapUintUint8X(x.FptrMapUintUint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintUint16 = nil + } else { + if false { + } else { + z.F.DecMapUintUint16X(&x.FMapUintUint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintUint16 != nil { + x.FptrMapUintUint16 = nil + } + } else { + if x.FptrMapUintUint16 == nil { + x.FptrMapUintUint16 = new(map[uint]uint16) + } + + if false { + } else { + z.F.DecMapUintUint16X(x.FptrMapUintUint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintUint32 = nil + } else { + if false { + } else { + z.F.DecMapUintUint32X(&x.FMapUintUint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintUint32 != nil { + x.FptrMapUintUint32 = nil + } + } else { + if x.FptrMapUintUint32 == nil { + x.FptrMapUintUint32 = new(map[uint]uint32) + } + + if false { + } else { + z.F.DecMapUintUint32X(x.FptrMapUintUint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintUint64 = nil + } else { + if false { + } else { + z.F.DecMapUintUint64X(&x.FMapUintUint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintUint64 != nil { + x.FptrMapUintUint64 = nil + } + } else { + if x.FptrMapUintUint64 == nil { + x.FptrMapUintUint64 = new(map[uint]uint64) + } + + if false { + } else { + z.F.DecMapUintUint64X(x.FptrMapUintUint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintUintptr = nil + } else { + if false { + } else { + z.F.DecMapUintUintptrX(&x.FMapUintUintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintUintptr != nil { + x.FptrMapUintUintptr = nil + } + } else { + if x.FptrMapUintUintptr == nil { + x.FptrMapUintUintptr = new(map[uint]uintptr) + } + + if false { + } else { + z.F.DecMapUintUintptrX(x.FptrMapUintUintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintInt = nil + } else { + if false { + } else { + z.F.DecMapUintIntX(&x.FMapUintInt, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintInt != nil { + x.FptrMapUintInt = nil + } + } else { + if x.FptrMapUintInt == nil { + x.FptrMapUintInt = new(map[uint]int) + } + + if false { + } else { + z.F.DecMapUintIntX(x.FptrMapUintInt, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintInt8 = nil + } else { + if false { + } else { + z.F.DecMapUintInt8X(&x.FMapUintInt8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintInt8 != nil { + x.FptrMapUintInt8 = nil + } + } else { + if x.FptrMapUintInt8 == nil { + x.FptrMapUintInt8 = new(map[uint]int8) + } + + if false { + } else { + z.F.DecMapUintInt8X(x.FptrMapUintInt8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintInt16 = nil + } else { + if false { + } else { + z.F.DecMapUintInt16X(&x.FMapUintInt16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintInt16 != nil { + x.FptrMapUintInt16 = nil + } + } else { + if x.FptrMapUintInt16 == nil { + x.FptrMapUintInt16 = new(map[uint]int16) + } + + if false { + } else { + z.F.DecMapUintInt16X(x.FptrMapUintInt16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintInt32 = nil + } else { + if false { + } else { + z.F.DecMapUintInt32X(&x.FMapUintInt32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintInt32 != nil { + x.FptrMapUintInt32 = nil + } + } else { + if x.FptrMapUintInt32 == nil { + x.FptrMapUintInt32 = new(map[uint]int32) + } + + if false { + } else { + z.F.DecMapUintInt32X(x.FptrMapUintInt32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintInt64 = nil + } else { + if false { + } else { + z.F.DecMapUintInt64X(&x.FMapUintInt64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintInt64 != nil { + x.FptrMapUintInt64 = nil + } + } else { + if x.FptrMapUintInt64 == nil { + x.FptrMapUintInt64 = new(map[uint]int64) + } + + if false { + } else { + z.F.DecMapUintInt64X(x.FptrMapUintInt64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintFloat32 = nil + } else { + if false { + } else { + z.F.DecMapUintFloat32X(&x.FMapUintFloat32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintFloat32 != nil { + x.FptrMapUintFloat32 = nil + } + } else { + if x.FptrMapUintFloat32 == nil { + x.FptrMapUintFloat32 = new(map[uint]float32) + } + + if false { + } else { + z.F.DecMapUintFloat32X(x.FptrMapUintFloat32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintFloat64 = nil + } else { + if false { + } else { + z.F.DecMapUintFloat64X(&x.FMapUintFloat64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintFloat64 != nil { + x.FptrMapUintFloat64 = nil + } + } else { + if x.FptrMapUintFloat64 == nil { + x.FptrMapUintFloat64 = new(map[uint]float64) + } + + if false { + } else { + z.F.DecMapUintFloat64X(x.FptrMapUintFloat64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintBool = nil + } else { + if false { + } else { + z.F.DecMapUintBoolX(&x.FMapUintBool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintBool != nil { + x.FptrMapUintBool = nil + } + } else { + if x.FptrMapUintBool == nil { + x.FptrMapUintBool = new(map[uint]bool) + } + + if false { + } else { + z.F.DecMapUintBoolX(x.FptrMapUintBool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Intf = nil + } else { + if false { + } else { + z.F.DecMapUint8IntfX(&x.FMapUint8Intf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Intf != nil { + x.FptrMapUint8Intf = nil + } + } else { + if x.FptrMapUint8Intf == nil { + x.FptrMapUint8Intf = new(map[uint8]interface{}) + } + + if false { + } else { + z.F.DecMapUint8IntfX(x.FptrMapUint8Intf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8String = nil + } else { + if false { + } else { + z.F.DecMapUint8StringX(&x.FMapUint8String, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8String != nil { + x.FptrMapUint8String = nil + } + } else { + if x.FptrMapUint8String == nil { + x.FptrMapUint8String = new(map[uint8]string) + } + + if false { + } else { + z.F.DecMapUint8StringX(x.FptrMapUint8String, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Uint = nil + } else { + if false { + } else { + z.F.DecMapUint8UintX(&x.FMapUint8Uint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Uint != nil { + x.FptrMapUint8Uint = nil + } + } else { + if x.FptrMapUint8Uint == nil { + x.FptrMapUint8Uint = new(map[uint8]uint) + } + + if false { + } else { + z.F.DecMapUint8UintX(x.FptrMapUint8Uint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Uint8 = nil + } else { + if false { + } else { + z.F.DecMapUint8Uint8X(&x.FMapUint8Uint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Uint8 != nil { + x.FptrMapUint8Uint8 = nil + } + } else { + if x.FptrMapUint8Uint8 == nil { + x.FptrMapUint8Uint8 = new(map[uint8]uint8) + } + + if false { + } else { + z.F.DecMapUint8Uint8X(x.FptrMapUint8Uint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Uint16 = nil + } else { + if false { + } else { + z.F.DecMapUint8Uint16X(&x.FMapUint8Uint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Uint16 != nil { + x.FptrMapUint8Uint16 = nil + } + } else { + if x.FptrMapUint8Uint16 == nil { + x.FptrMapUint8Uint16 = new(map[uint8]uint16) + } + + if false { + } else { + z.F.DecMapUint8Uint16X(x.FptrMapUint8Uint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Uint32 = nil + } else { + if false { + } else { + z.F.DecMapUint8Uint32X(&x.FMapUint8Uint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Uint32 != nil { + x.FptrMapUint8Uint32 = nil + } + } else { + if x.FptrMapUint8Uint32 == nil { + x.FptrMapUint8Uint32 = new(map[uint8]uint32) + } + + if false { + } else { + z.F.DecMapUint8Uint32X(x.FptrMapUint8Uint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Uint64 = nil + } else { + if false { + } else { + z.F.DecMapUint8Uint64X(&x.FMapUint8Uint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Uint64 != nil { + x.FptrMapUint8Uint64 = nil + } + } else { + if x.FptrMapUint8Uint64 == nil { + x.FptrMapUint8Uint64 = new(map[uint8]uint64) + } + + if false { + } else { + z.F.DecMapUint8Uint64X(x.FptrMapUint8Uint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Uintptr = nil + } else { + if false { + } else { + z.F.DecMapUint8UintptrX(&x.FMapUint8Uintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Uintptr != nil { + x.FptrMapUint8Uintptr = nil + } + } else { + if x.FptrMapUint8Uintptr == nil { + x.FptrMapUint8Uintptr = new(map[uint8]uintptr) + } + + if false { + } else { + z.F.DecMapUint8UintptrX(x.FptrMapUint8Uintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Int = nil + } else { + if false { + } else { + z.F.DecMapUint8IntX(&x.FMapUint8Int, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Int != nil { + x.FptrMapUint8Int = nil + } + } else { + if x.FptrMapUint8Int == nil { + x.FptrMapUint8Int = new(map[uint8]int) + } + + if false { + } else { + z.F.DecMapUint8IntX(x.FptrMapUint8Int, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Int8 = nil + } else { + if false { + } else { + z.F.DecMapUint8Int8X(&x.FMapUint8Int8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Int8 != nil { + x.FptrMapUint8Int8 = nil + } + } else { + if x.FptrMapUint8Int8 == nil { + x.FptrMapUint8Int8 = new(map[uint8]int8) + } + + if false { + } else { + z.F.DecMapUint8Int8X(x.FptrMapUint8Int8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Int16 = nil + } else { + if false { + } else { + z.F.DecMapUint8Int16X(&x.FMapUint8Int16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Int16 != nil { + x.FptrMapUint8Int16 = nil + } + } else { + if x.FptrMapUint8Int16 == nil { + x.FptrMapUint8Int16 = new(map[uint8]int16) + } + + if false { + } else { + z.F.DecMapUint8Int16X(x.FptrMapUint8Int16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Int32 = nil + } else { + if false { + } else { + z.F.DecMapUint8Int32X(&x.FMapUint8Int32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Int32 != nil { + x.FptrMapUint8Int32 = nil + } + } else { + if x.FptrMapUint8Int32 == nil { + x.FptrMapUint8Int32 = new(map[uint8]int32) + } + + if false { + } else { + z.F.DecMapUint8Int32X(x.FptrMapUint8Int32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Int64 = nil + } else { + if false { + } else { + z.F.DecMapUint8Int64X(&x.FMapUint8Int64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Int64 != nil { + x.FptrMapUint8Int64 = nil + } + } else { + if x.FptrMapUint8Int64 == nil { + x.FptrMapUint8Int64 = new(map[uint8]int64) + } + + if false { + } else { + z.F.DecMapUint8Int64X(x.FptrMapUint8Int64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Float32 = nil + } else { + if false { + } else { + z.F.DecMapUint8Float32X(&x.FMapUint8Float32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Float32 != nil { + x.FptrMapUint8Float32 = nil + } + } else { + if x.FptrMapUint8Float32 == nil { + x.FptrMapUint8Float32 = new(map[uint8]float32) + } + + if false { + } else { + z.F.DecMapUint8Float32X(x.FptrMapUint8Float32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Float64 = nil + } else { + if false { + } else { + z.F.DecMapUint8Float64X(&x.FMapUint8Float64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Float64 != nil { + x.FptrMapUint8Float64 = nil + } + } else { + if x.FptrMapUint8Float64 == nil { + x.FptrMapUint8Float64 = new(map[uint8]float64) + } + + if false { + } else { + z.F.DecMapUint8Float64X(x.FptrMapUint8Float64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Bool = nil + } else { + if false { + } else { + z.F.DecMapUint8BoolX(&x.FMapUint8Bool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint8Bool != nil { + x.FptrMapUint8Bool = nil + } + } else { + if x.FptrMapUint8Bool == nil { + x.FptrMapUint8Bool = new(map[uint8]bool) + } + + if false { + } else { + z.F.DecMapUint8BoolX(x.FptrMapUint8Bool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Intf = nil + } else { + if false { + } else { + z.F.DecMapUint16IntfX(&x.FMapUint16Intf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Intf != nil { + x.FptrMapUint16Intf = nil + } + } else { + if x.FptrMapUint16Intf == nil { + x.FptrMapUint16Intf = new(map[uint16]interface{}) + } + + if false { + } else { + z.F.DecMapUint16IntfX(x.FptrMapUint16Intf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16String = nil + } else { + if false { + } else { + z.F.DecMapUint16StringX(&x.FMapUint16String, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16String != nil { + x.FptrMapUint16String = nil + } + } else { + if x.FptrMapUint16String == nil { + x.FptrMapUint16String = new(map[uint16]string) + } + + if false { + } else { + z.F.DecMapUint16StringX(x.FptrMapUint16String, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Uint = nil + } else { + if false { + } else { + z.F.DecMapUint16UintX(&x.FMapUint16Uint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Uint != nil { + x.FptrMapUint16Uint = nil + } + } else { + if x.FptrMapUint16Uint == nil { + x.FptrMapUint16Uint = new(map[uint16]uint) + } + + if false { + } else { + z.F.DecMapUint16UintX(x.FptrMapUint16Uint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Uint8 = nil + } else { + if false { + } else { + z.F.DecMapUint16Uint8X(&x.FMapUint16Uint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Uint8 != nil { + x.FptrMapUint16Uint8 = nil + } + } else { + if x.FptrMapUint16Uint8 == nil { + x.FptrMapUint16Uint8 = new(map[uint16]uint8) + } + + if false { + } else { + z.F.DecMapUint16Uint8X(x.FptrMapUint16Uint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Uint16 = nil + } else { + if false { + } else { + z.F.DecMapUint16Uint16X(&x.FMapUint16Uint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Uint16 != nil { + x.FptrMapUint16Uint16 = nil + } + } else { + if x.FptrMapUint16Uint16 == nil { + x.FptrMapUint16Uint16 = new(map[uint16]uint16) + } + + if false { + } else { + z.F.DecMapUint16Uint16X(x.FptrMapUint16Uint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Uint32 = nil + } else { + if false { + } else { + z.F.DecMapUint16Uint32X(&x.FMapUint16Uint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Uint32 != nil { + x.FptrMapUint16Uint32 = nil + } + } else { + if x.FptrMapUint16Uint32 == nil { + x.FptrMapUint16Uint32 = new(map[uint16]uint32) + } + + if false { + } else { + z.F.DecMapUint16Uint32X(x.FptrMapUint16Uint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Uint64 = nil + } else { + if false { + } else { + z.F.DecMapUint16Uint64X(&x.FMapUint16Uint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Uint64 != nil { + x.FptrMapUint16Uint64 = nil + } + } else { + if x.FptrMapUint16Uint64 == nil { + x.FptrMapUint16Uint64 = new(map[uint16]uint64) + } + + if false { + } else { + z.F.DecMapUint16Uint64X(x.FptrMapUint16Uint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Uintptr = nil + } else { + if false { + } else { + z.F.DecMapUint16UintptrX(&x.FMapUint16Uintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Uintptr != nil { + x.FptrMapUint16Uintptr = nil + } + } else { + if x.FptrMapUint16Uintptr == nil { + x.FptrMapUint16Uintptr = new(map[uint16]uintptr) + } + + if false { + } else { + z.F.DecMapUint16UintptrX(x.FptrMapUint16Uintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Int = nil + } else { + if false { + } else { + z.F.DecMapUint16IntX(&x.FMapUint16Int, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Int != nil { + x.FptrMapUint16Int = nil + } + } else { + if x.FptrMapUint16Int == nil { + x.FptrMapUint16Int = new(map[uint16]int) + } + + if false { + } else { + z.F.DecMapUint16IntX(x.FptrMapUint16Int, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Int8 = nil + } else { + if false { + } else { + z.F.DecMapUint16Int8X(&x.FMapUint16Int8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Int8 != nil { + x.FptrMapUint16Int8 = nil + } + } else { + if x.FptrMapUint16Int8 == nil { + x.FptrMapUint16Int8 = new(map[uint16]int8) + } + + if false { + } else { + z.F.DecMapUint16Int8X(x.FptrMapUint16Int8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Int16 = nil + } else { + if false { + } else { + z.F.DecMapUint16Int16X(&x.FMapUint16Int16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Int16 != nil { + x.FptrMapUint16Int16 = nil + } + } else { + if x.FptrMapUint16Int16 == nil { + x.FptrMapUint16Int16 = new(map[uint16]int16) + } + + if false { + } else { + z.F.DecMapUint16Int16X(x.FptrMapUint16Int16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Int32 = nil + } else { + if false { + } else { + z.F.DecMapUint16Int32X(&x.FMapUint16Int32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Int32 != nil { + x.FptrMapUint16Int32 = nil + } + } else { + if x.FptrMapUint16Int32 == nil { + x.FptrMapUint16Int32 = new(map[uint16]int32) + } + + if false { + } else { + z.F.DecMapUint16Int32X(x.FptrMapUint16Int32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Int64 = nil + } else { + if false { + } else { + z.F.DecMapUint16Int64X(&x.FMapUint16Int64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Int64 != nil { + x.FptrMapUint16Int64 = nil + } + } else { + if x.FptrMapUint16Int64 == nil { + x.FptrMapUint16Int64 = new(map[uint16]int64) + } + + if false { + } else { + z.F.DecMapUint16Int64X(x.FptrMapUint16Int64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Float32 = nil + } else { + if false { + } else { + z.F.DecMapUint16Float32X(&x.FMapUint16Float32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Float32 != nil { + x.FptrMapUint16Float32 = nil + } + } else { + if x.FptrMapUint16Float32 == nil { + x.FptrMapUint16Float32 = new(map[uint16]float32) + } + + if false { + } else { + z.F.DecMapUint16Float32X(x.FptrMapUint16Float32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Float64 = nil + } else { + if false { + } else { + z.F.DecMapUint16Float64X(&x.FMapUint16Float64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Float64 != nil { + x.FptrMapUint16Float64 = nil + } + } else { + if x.FptrMapUint16Float64 == nil { + x.FptrMapUint16Float64 = new(map[uint16]float64) + } + + if false { + } else { + z.F.DecMapUint16Float64X(x.FptrMapUint16Float64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Bool = nil + } else { + if false { + } else { + z.F.DecMapUint16BoolX(&x.FMapUint16Bool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint16Bool != nil { + x.FptrMapUint16Bool = nil + } + } else { + if x.FptrMapUint16Bool == nil { + x.FptrMapUint16Bool = new(map[uint16]bool) + } + + if false { + } else { + z.F.DecMapUint16BoolX(x.FptrMapUint16Bool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Intf = nil + } else { + if false { + } else { + z.F.DecMapUint32IntfX(&x.FMapUint32Intf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Intf != nil { + x.FptrMapUint32Intf = nil + } + } else { + if x.FptrMapUint32Intf == nil { + x.FptrMapUint32Intf = new(map[uint32]interface{}) + } + + if false { + } else { + z.F.DecMapUint32IntfX(x.FptrMapUint32Intf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32String = nil + } else { + if false { + } else { + z.F.DecMapUint32StringX(&x.FMapUint32String, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32String != nil { + x.FptrMapUint32String = nil + } + } else { + if x.FptrMapUint32String == nil { + x.FptrMapUint32String = new(map[uint32]string) + } + + if false { + } else { + z.F.DecMapUint32StringX(x.FptrMapUint32String, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Uint = nil + } else { + if false { + } else { + z.F.DecMapUint32UintX(&x.FMapUint32Uint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Uint != nil { + x.FptrMapUint32Uint = nil + } + } else { + if x.FptrMapUint32Uint == nil { + x.FptrMapUint32Uint = new(map[uint32]uint) + } + + if false { + } else { + z.F.DecMapUint32UintX(x.FptrMapUint32Uint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Uint8 = nil + } else { + if false { + } else { + z.F.DecMapUint32Uint8X(&x.FMapUint32Uint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Uint8 != nil { + x.FptrMapUint32Uint8 = nil + } + } else { + if x.FptrMapUint32Uint8 == nil { + x.FptrMapUint32Uint8 = new(map[uint32]uint8) + } + + if false { + } else { + z.F.DecMapUint32Uint8X(x.FptrMapUint32Uint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Uint16 = nil + } else { + if false { + } else { + z.F.DecMapUint32Uint16X(&x.FMapUint32Uint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Uint16 != nil { + x.FptrMapUint32Uint16 = nil + } + } else { + if x.FptrMapUint32Uint16 == nil { + x.FptrMapUint32Uint16 = new(map[uint32]uint16) + } + + if false { + } else { + z.F.DecMapUint32Uint16X(x.FptrMapUint32Uint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Uint32 = nil + } else { + if false { + } else { + z.F.DecMapUint32Uint32X(&x.FMapUint32Uint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Uint32 != nil { + x.FptrMapUint32Uint32 = nil + } + } else { + if x.FptrMapUint32Uint32 == nil { + x.FptrMapUint32Uint32 = new(map[uint32]uint32) + } + + if false { + } else { + z.F.DecMapUint32Uint32X(x.FptrMapUint32Uint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Uint64 = nil + } else { + if false { + } else { + z.F.DecMapUint32Uint64X(&x.FMapUint32Uint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Uint64 != nil { + x.FptrMapUint32Uint64 = nil + } + } else { + if x.FptrMapUint32Uint64 == nil { + x.FptrMapUint32Uint64 = new(map[uint32]uint64) + } + + if false { + } else { + z.F.DecMapUint32Uint64X(x.FptrMapUint32Uint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Uintptr = nil + } else { + if false { + } else { + z.F.DecMapUint32UintptrX(&x.FMapUint32Uintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Uintptr != nil { + x.FptrMapUint32Uintptr = nil + } + } else { + if x.FptrMapUint32Uintptr == nil { + x.FptrMapUint32Uintptr = new(map[uint32]uintptr) + } + + if false { + } else { + z.F.DecMapUint32UintptrX(x.FptrMapUint32Uintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Int = nil + } else { + if false { + } else { + z.F.DecMapUint32IntX(&x.FMapUint32Int, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Int != nil { + x.FptrMapUint32Int = nil + } + } else { + if x.FptrMapUint32Int == nil { + x.FptrMapUint32Int = new(map[uint32]int) + } + + if false { + } else { + z.F.DecMapUint32IntX(x.FptrMapUint32Int, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Int8 = nil + } else { + if false { + } else { + z.F.DecMapUint32Int8X(&x.FMapUint32Int8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Int8 != nil { + x.FptrMapUint32Int8 = nil + } + } else { + if x.FptrMapUint32Int8 == nil { + x.FptrMapUint32Int8 = new(map[uint32]int8) + } + + if false { + } else { + z.F.DecMapUint32Int8X(x.FptrMapUint32Int8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Int16 = nil + } else { + if false { + } else { + z.F.DecMapUint32Int16X(&x.FMapUint32Int16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Int16 != nil { + x.FptrMapUint32Int16 = nil + } + } else { + if x.FptrMapUint32Int16 == nil { + x.FptrMapUint32Int16 = new(map[uint32]int16) + } + + if false { + } else { + z.F.DecMapUint32Int16X(x.FptrMapUint32Int16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Int32 = nil + } else { + if false { + } else { + z.F.DecMapUint32Int32X(&x.FMapUint32Int32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Int32 != nil { + x.FptrMapUint32Int32 = nil + } + } else { + if x.FptrMapUint32Int32 == nil { + x.FptrMapUint32Int32 = new(map[uint32]int32) + } + + if false { + } else { + z.F.DecMapUint32Int32X(x.FptrMapUint32Int32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Int64 = nil + } else { + if false { + } else { + z.F.DecMapUint32Int64X(&x.FMapUint32Int64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Int64 != nil { + x.FptrMapUint32Int64 = nil + } + } else { + if x.FptrMapUint32Int64 == nil { + x.FptrMapUint32Int64 = new(map[uint32]int64) + } + + if false { + } else { + z.F.DecMapUint32Int64X(x.FptrMapUint32Int64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Float32 = nil + } else { + if false { + } else { + z.F.DecMapUint32Float32X(&x.FMapUint32Float32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Float32 != nil { + x.FptrMapUint32Float32 = nil + } + } else { + if x.FptrMapUint32Float32 == nil { + x.FptrMapUint32Float32 = new(map[uint32]float32) + } + + if false { + } else { + z.F.DecMapUint32Float32X(x.FptrMapUint32Float32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Float64 = nil + } else { + if false { + } else { + z.F.DecMapUint32Float64X(&x.FMapUint32Float64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Float64 != nil { + x.FptrMapUint32Float64 = nil + } + } else { + if x.FptrMapUint32Float64 == nil { + x.FptrMapUint32Float64 = new(map[uint32]float64) + } + + if false { + } else { + z.F.DecMapUint32Float64X(x.FptrMapUint32Float64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Bool = nil + } else { + if false { + } else { + z.F.DecMapUint32BoolX(&x.FMapUint32Bool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint32Bool != nil { + x.FptrMapUint32Bool = nil + } + } else { + if x.FptrMapUint32Bool == nil { + x.FptrMapUint32Bool = new(map[uint32]bool) + } + + if false { + } else { + z.F.DecMapUint32BoolX(x.FptrMapUint32Bool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Intf = nil + } else { + if false { + } else { + z.F.DecMapUint64IntfX(&x.FMapUint64Intf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Intf != nil { + x.FptrMapUint64Intf = nil + } + } else { + if x.FptrMapUint64Intf == nil { + x.FptrMapUint64Intf = new(map[uint64]interface{}) + } + + if false { + } else { + z.F.DecMapUint64IntfX(x.FptrMapUint64Intf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64String = nil + } else { + if false { + } else { + z.F.DecMapUint64StringX(&x.FMapUint64String, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64String != nil { + x.FptrMapUint64String = nil + } + } else { + if x.FptrMapUint64String == nil { + x.FptrMapUint64String = new(map[uint64]string) + } + + if false { + } else { + z.F.DecMapUint64StringX(x.FptrMapUint64String, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Uint = nil + } else { + if false { + } else { + z.F.DecMapUint64UintX(&x.FMapUint64Uint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Uint != nil { + x.FptrMapUint64Uint = nil + } + } else { + if x.FptrMapUint64Uint == nil { + x.FptrMapUint64Uint = new(map[uint64]uint) + } + + if false { + } else { + z.F.DecMapUint64UintX(x.FptrMapUint64Uint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Uint8 = nil + } else { + if false { + } else { + z.F.DecMapUint64Uint8X(&x.FMapUint64Uint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Uint8 != nil { + x.FptrMapUint64Uint8 = nil + } + } else { + if x.FptrMapUint64Uint8 == nil { + x.FptrMapUint64Uint8 = new(map[uint64]uint8) + } + + if false { + } else { + z.F.DecMapUint64Uint8X(x.FptrMapUint64Uint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Uint16 = nil + } else { + if false { + } else { + z.F.DecMapUint64Uint16X(&x.FMapUint64Uint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Uint16 != nil { + x.FptrMapUint64Uint16 = nil + } + } else { + if x.FptrMapUint64Uint16 == nil { + x.FptrMapUint64Uint16 = new(map[uint64]uint16) + } + + if false { + } else { + z.F.DecMapUint64Uint16X(x.FptrMapUint64Uint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Uint32 = nil + } else { + if false { + } else { + z.F.DecMapUint64Uint32X(&x.FMapUint64Uint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Uint32 != nil { + x.FptrMapUint64Uint32 = nil + } + } else { + if x.FptrMapUint64Uint32 == nil { + x.FptrMapUint64Uint32 = new(map[uint64]uint32) + } + + if false { + } else { + z.F.DecMapUint64Uint32X(x.FptrMapUint64Uint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Uint64 = nil + } else { + if false { + } else { + z.F.DecMapUint64Uint64X(&x.FMapUint64Uint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Uint64 != nil { + x.FptrMapUint64Uint64 = nil + } + } else { + if x.FptrMapUint64Uint64 == nil { + x.FptrMapUint64Uint64 = new(map[uint64]uint64) + } + + if false { + } else { + z.F.DecMapUint64Uint64X(x.FptrMapUint64Uint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Uintptr = nil + } else { + if false { + } else { + z.F.DecMapUint64UintptrX(&x.FMapUint64Uintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Uintptr != nil { + x.FptrMapUint64Uintptr = nil + } + } else { + if x.FptrMapUint64Uintptr == nil { + x.FptrMapUint64Uintptr = new(map[uint64]uintptr) + } + + if false { + } else { + z.F.DecMapUint64UintptrX(x.FptrMapUint64Uintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Int = nil + } else { + if false { + } else { + z.F.DecMapUint64IntX(&x.FMapUint64Int, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Int != nil { + x.FptrMapUint64Int = nil + } + } else { + if x.FptrMapUint64Int == nil { + x.FptrMapUint64Int = new(map[uint64]int) + } + + if false { + } else { + z.F.DecMapUint64IntX(x.FptrMapUint64Int, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Int8 = nil + } else { + if false { + } else { + z.F.DecMapUint64Int8X(&x.FMapUint64Int8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Int8 != nil { + x.FptrMapUint64Int8 = nil + } + } else { + if x.FptrMapUint64Int8 == nil { + x.FptrMapUint64Int8 = new(map[uint64]int8) + } + + if false { + } else { + z.F.DecMapUint64Int8X(x.FptrMapUint64Int8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Int16 = nil + } else { + if false { + } else { + z.F.DecMapUint64Int16X(&x.FMapUint64Int16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Int16 != nil { + x.FptrMapUint64Int16 = nil + } + } else { + if x.FptrMapUint64Int16 == nil { + x.FptrMapUint64Int16 = new(map[uint64]int16) + } + + if false { + } else { + z.F.DecMapUint64Int16X(x.FptrMapUint64Int16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Int32 = nil + } else { + if false { + } else { + z.F.DecMapUint64Int32X(&x.FMapUint64Int32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Int32 != nil { + x.FptrMapUint64Int32 = nil + } + } else { + if x.FptrMapUint64Int32 == nil { + x.FptrMapUint64Int32 = new(map[uint64]int32) + } + + if false { + } else { + z.F.DecMapUint64Int32X(x.FptrMapUint64Int32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Int64 = nil + } else { + if false { + } else { + z.F.DecMapUint64Int64X(&x.FMapUint64Int64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Int64 != nil { + x.FptrMapUint64Int64 = nil + } + } else { + if x.FptrMapUint64Int64 == nil { + x.FptrMapUint64Int64 = new(map[uint64]int64) + } + + if false { + } else { + z.F.DecMapUint64Int64X(x.FptrMapUint64Int64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Float32 = nil + } else { + if false { + } else { + z.F.DecMapUint64Float32X(&x.FMapUint64Float32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Float32 != nil { + x.FptrMapUint64Float32 = nil + } + } else { + if x.FptrMapUint64Float32 == nil { + x.FptrMapUint64Float32 = new(map[uint64]float32) + } + + if false { + } else { + z.F.DecMapUint64Float32X(x.FptrMapUint64Float32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Float64 = nil + } else { + if false { + } else { + z.F.DecMapUint64Float64X(&x.FMapUint64Float64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Float64 != nil { + x.FptrMapUint64Float64 = nil + } + } else { + if x.FptrMapUint64Float64 == nil { + x.FptrMapUint64Float64 = new(map[uint64]float64) + } + + if false { + } else { + z.F.DecMapUint64Float64X(x.FptrMapUint64Float64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Bool = nil + } else { + if false { + } else { + z.F.DecMapUint64BoolX(&x.FMapUint64Bool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUint64Bool != nil { + x.FptrMapUint64Bool = nil + } + } else { + if x.FptrMapUint64Bool == nil { + x.FptrMapUint64Bool = new(map[uint64]bool) + } + + if false { + } else { + z.F.DecMapUint64BoolX(x.FptrMapUint64Bool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrIntf = nil + } else { + if false { + } else { + z.F.DecMapUintptrIntfX(&x.FMapUintptrIntf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrIntf != nil { + x.FptrMapUintptrIntf = nil + } + } else { + if x.FptrMapUintptrIntf == nil { + x.FptrMapUintptrIntf = new(map[uintptr]interface{}) + } + + if false { + } else { + z.F.DecMapUintptrIntfX(x.FptrMapUintptrIntf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrString = nil + } else { + if false { + } else { + z.F.DecMapUintptrStringX(&x.FMapUintptrString, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrString != nil { + x.FptrMapUintptrString = nil + } + } else { + if x.FptrMapUintptrString == nil { + x.FptrMapUintptrString = new(map[uintptr]string) + } + + if false { + } else { + z.F.DecMapUintptrStringX(x.FptrMapUintptrString, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrUint = nil + } else { + if false { + } else { + z.F.DecMapUintptrUintX(&x.FMapUintptrUint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrUint != nil { + x.FptrMapUintptrUint = nil + } + } else { + if x.FptrMapUintptrUint == nil { + x.FptrMapUintptrUint = new(map[uintptr]uint) + } + + if false { + } else { + z.F.DecMapUintptrUintX(x.FptrMapUintptrUint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrUint8 = nil + } else { + if false { + } else { + z.F.DecMapUintptrUint8X(&x.FMapUintptrUint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrUint8 != nil { + x.FptrMapUintptrUint8 = nil + } + } else { + if x.FptrMapUintptrUint8 == nil { + x.FptrMapUintptrUint8 = new(map[uintptr]uint8) + } + + if false { + } else { + z.F.DecMapUintptrUint8X(x.FptrMapUintptrUint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrUint16 = nil + } else { + if false { + } else { + z.F.DecMapUintptrUint16X(&x.FMapUintptrUint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrUint16 != nil { + x.FptrMapUintptrUint16 = nil + } + } else { + if x.FptrMapUintptrUint16 == nil { + x.FptrMapUintptrUint16 = new(map[uintptr]uint16) + } + + if false { + } else { + z.F.DecMapUintptrUint16X(x.FptrMapUintptrUint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrUint32 = nil + } else { + if false { + } else { + z.F.DecMapUintptrUint32X(&x.FMapUintptrUint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrUint32 != nil { + x.FptrMapUintptrUint32 = nil + } + } else { + if x.FptrMapUintptrUint32 == nil { + x.FptrMapUintptrUint32 = new(map[uintptr]uint32) + } + + if false { + } else { + z.F.DecMapUintptrUint32X(x.FptrMapUintptrUint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrUint64 = nil + } else { + if false { + } else { + z.F.DecMapUintptrUint64X(&x.FMapUintptrUint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrUint64 != nil { + x.FptrMapUintptrUint64 = nil + } + } else { + if x.FptrMapUintptrUint64 == nil { + x.FptrMapUintptrUint64 = new(map[uintptr]uint64) + } + + if false { + } else { + z.F.DecMapUintptrUint64X(x.FptrMapUintptrUint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrUintptr = nil + } else { + if false { + } else { + z.F.DecMapUintptrUintptrX(&x.FMapUintptrUintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrUintptr != nil { + x.FptrMapUintptrUintptr = nil + } + } else { + if x.FptrMapUintptrUintptr == nil { + x.FptrMapUintptrUintptr = new(map[uintptr]uintptr) + } + + if false { + } else { + z.F.DecMapUintptrUintptrX(x.FptrMapUintptrUintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrInt = nil + } else { + if false { + } else { + z.F.DecMapUintptrIntX(&x.FMapUintptrInt, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrInt != nil { + x.FptrMapUintptrInt = nil + } + } else { + if x.FptrMapUintptrInt == nil { + x.FptrMapUintptrInt = new(map[uintptr]int) + } + + if false { + } else { + z.F.DecMapUintptrIntX(x.FptrMapUintptrInt, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrInt8 = nil + } else { + if false { + } else { + z.F.DecMapUintptrInt8X(&x.FMapUintptrInt8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrInt8 != nil { + x.FptrMapUintptrInt8 = nil + } + } else { + if x.FptrMapUintptrInt8 == nil { + x.FptrMapUintptrInt8 = new(map[uintptr]int8) + } + + if false { + } else { + z.F.DecMapUintptrInt8X(x.FptrMapUintptrInt8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrInt16 = nil + } else { + if false { + } else { + z.F.DecMapUintptrInt16X(&x.FMapUintptrInt16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrInt16 != nil { + x.FptrMapUintptrInt16 = nil + } + } else { + if x.FptrMapUintptrInt16 == nil { + x.FptrMapUintptrInt16 = new(map[uintptr]int16) + } + + if false { + } else { + z.F.DecMapUintptrInt16X(x.FptrMapUintptrInt16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrInt32 = nil + } else { + if false { + } else { + z.F.DecMapUintptrInt32X(&x.FMapUintptrInt32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrInt32 != nil { + x.FptrMapUintptrInt32 = nil + } + } else { + if x.FptrMapUintptrInt32 == nil { + x.FptrMapUintptrInt32 = new(map[uintptr]int32) + } + + if false { + } else { + z.F.DecMapUintptrInt32X(x.FptrMapUintptrInt32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrInt64 = nil + } else { + if false { + } else { + z.F.DecMapUintptrInt64X(&x.FMapUintptrInt64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrInt64 != nil { + x.FptrMapUintptrInt64 = nil + } + } else { + if x.FptrMapUintptrInt64 == nil { + x.FptrMapUintptrInt64 = new(map[uintptr]int64) + } + + if false { + } else { + z.F.DecMapUintptrInt64X(x.FptrMapUintptrInt64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrFloat32 = nil + } else { + if false { + } else { + z.F.DecMapUintptrFloat32X(&x.FMapUintptrFloat32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrFloat32 != nil { + x.FptrMapUintptrFloat32 = nil + } + } else { + if x.FptrMapUintptrFloat32 == nil { + x.FptrMapUintptrFloat32 = new(map[uintptr]float32) + } + + if false { + } else { + z.F.DecMapUintptrFloat32X(x.FptrMapUintptrFloat32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrFloat64 = nil + } else { + if false { + } else { + z.F.DecMapUintptrFloat64X(&x.FMapUintptrFloat64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrFloat64 != nil { + x.FptrMapUintptrFloat64 = nil + } + } else { + if x.FptrMapUintptrFloat64 == nil { + x.FptrMapUintptrFloat64 = new(map[uintptr]float64) + } + + if false { + } else { + z.F.DecMapUintptrFloat64X(x.FptrMapUintptrFloat64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrBool = nil + } else { + if false { + } else { + z.F.DecMapUintptrBoolX(&x.FMapUintptrBool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapUintptrBool != nil { + x.FptrMapUintptrBool = nil + } + } else { + if x.FptrMapUintptrBool == nil { + x.FptrMapUintptrBool = new(map[uintptr]bool) + } + + if false { + } else { + z.F.DecMapUintptrBoolX(x.FptrMapUintptrBool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntIntf = nil + } else { + if false { + } else { + z.F.DecMapIntIntfX(&x.FMapIntIntf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntIntf != nil { + x.FptrMapIntIntf = nil + } + } else { + if x.FptrMapIntIntf == nil { + x.FptrMapIntIntf = new(map[int]interface{}) + } + + if false { + } else { + z.F.DecMapIntIntfX(x.FptrMapIntIntf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntString = nil + } else { + if false { + } else { + z.F.DecMapIntStringX(&x.FMapIntString, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntString != nil { + x.FptrMapIntString = nil + } + } else { + if x.FptrMapIntString == nil { + x.FptrMapIntString = new(map[int]string) + } + + if false { + } else { + z.F.DecMapIntStringX(x.FptrMapIntString, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntUint = nil + } else { + if false { + } else { + z.F.DecMapIntUintX(&x.FMapIntUint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntUint != nil { + x.FptrMapIntUint = nil + } + } else { + if x.FptrMapIntUint == nil { + x.FptrMapIntUint = new(map[int]uint) + } + + if false { + } else { + z.F.DecMapIntUintX(x.FptrMapIntUint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntUint8 = nil + } else { + if false { + } else { + z.F.DecMapIntUint8X(&x.FMapIntUint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntUint8 != nil { + x.FptrMapIntUint8 = nil + } + } else { + if x.FptrMapIntUint8 == nil { + x.FptrMapIntUint8 = new(map[int]uint8) + } + + if false { + } else { + z.F.DecMapIntUint8X(x.FptrMapIntUint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntUint16 = nil + } else { + if false { + } else { + z.F.DecMapIntUint16X(&x.FMapIntUint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntUint16 != nil { + x.FptrMapIntUint16 = nil + } + } else { + if x.FptrMapIntUint16 == nil { + x.FptrMapIntUint16 = new(map[int]uint16) + } + + if false { + } else { + z.F.DecMapIntUint16X(x.FptrMapIntUint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntUint32 = nil + } else { + if false { + } else { + z.F.DecMapIntUint32X(&x.FMapIntUint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntUint32 != nil { + x.FptrMapIntUint32 = nil + } + } else { + if x.FptrMapIntUint32 == nil { + x.FptrMapIntUint32 = new(map[int]uint32) + } + + if false { + } else { + z.F.DecMapIntUint32X(x.FptrMapIntUint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntUint64 = nil + } else { + if false { + } else { + z.F.DecMapIntUint64X(&x.FMapIntUint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntUint64 != nil { + x.FptrMapIntUint64 = nil + } + } else { + if x.FptrMapIntUint64 == nil { + x.FptrMapIntUint64 = new(map[int]uint64) + } + + if false { + } else { + z.F.DecMapIntUint64X(x.FptrMapIntUint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntUintptr = nil + } else { + if false { + } else { + z.F.DecMapIntUintptrX(&x.FMapIntUintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntUintptr != nil { + x.FptrMapIntUintptr = nil + } + } else { + if x.FptrMapIntUintptr == nil { + x.FptrMapIntUintptr = new(map[int]uintptr) + } + + if false { + } else { + z.F.DecMapIntUintptrX(x.FptrMapIntUintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntInt = nil + } else { + if false { + } else { + z.F.DecMapIntIntX(&x.FMapIntInt, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntInt != nil { + x.FptrMapIntInt = nil + } + } else { + if x.FptrMapIntInt == nil { + x.FptrMapIntInt = new(map[int]int) + } + + if false { + } else { + z.F.DecMapIntIntX(x.FptrMapIntInt, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntInt8 = nil + } else { + if false { + } else { + z.F.DecMapIntInt8X(&x.FMapIntInt8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntInt8 != nil { + x.FptrMapIntInt8 = nil + } + } else { + if x.FptrMapIntInt8 == nil { + x.FptrMapIntInt8 = new(map[int]int8) + } + + if false { + } else { + z.F.DecMapIntInt8X(x.FptrMapIntInt8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntInt16 = nil + } else { + if false { + } else { + z.F.DecMapIntInt16X(&x.FMapIntInt16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntInt16 != nil { + x.FptrMapIntInt16 = nil + } + } else { + if x.FptrMapIntInt16 == nil { + x.FptrMapIntInt16 = new(map[int]int16) + } + + if false { + } else { + z.F.DecMapIntInt16X(x.FptrMapIntInt16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntInt32 = nil + } else { + if false { + } else { + z.F.DecMapIntInt32X(&x.FMapIntInt32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntInt32 != nil { + x.FptrMapIntInt32 = nil + } + } else { + if x.FptrMapIntInt32 == nil { + x.FptrMapIntInt32 = new(map[int]int32) + } + + if false { + } else { + z.F.DecMapIntInt32X(x.FptrMapIntInt32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntInt64 = nil + } else { + if false { + } else { + z.F.DecMapIntInt64X(&x.FMapIntInt64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntInt64 != nil { + x.FptrMapIntInt64 = nil + } + } else { + if x.FptrMapIntInt64 == nil { + x.FptrMapIntInt64 = new(map[int]int64) + } + + if false { + } else { + z.F.DecMapIntInt64X(x.FptrMapIntInt64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntFloat32 = nil + } else { + if false { + } else { + z.F.DecMapIntFloat32X(&x.FMapIntFloat32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntFloat32 != nil { + x.FptrMapIntFloat32 = nil + } + } else { + if x.FptrMapIntFloat32 == nil { + x.FptrMapIntFloat32 = new(map[int]float32) + } + + if false { + } else { + z.F.DecMapIntFloat32X(x.FptrMapIntFloat32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntFloat64 = nil + } else { + if false { + } else { + z.F.DecMapIntFloat64X(&x.FMapIntFloat64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntFloat64 != nil { + x.FptrMapIntFloat64 = nil + } + } else { + if x.FptrMapIntFloat64 == nil { + x.FptrMapIntFloat64 = new(map[int]float64) + } + + if false { + } else { + z.F.DecMapIntFloat64X(x.FptrMapIntFloat64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntBool = nil + } else { + if false { + } else { + z.F.DecMapIntBoolX(&x.FMapIntBool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapIntBool != nil { + x.FptrMapIntBool = nil + } + } else { + if x.FptrMapIntBool == nil { + x.FptrMapIntBool = new(map[int]bool) + } + + if false { + } else { + z.F.DecMapIntBoolX(x.FptrMapIntBool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Intf = nil + } else { + if false { + } else { + z.F.DecMapInt8IntfX(&x.FMapInt8Intf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Intf != nil { + x.FptrMapInt8Intf = nil + } + } else { + if x.FptrMapInt8Intf == nil { + x.FptrMapInt8Intf = new(map[int8]interface{}) + } + + if false { + } else { + z.F.DecMapInt8IntfX(x.FptrMapInt8Intf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8String = nil + } else { + if false { + } else { + z.F.DecMapInt8StringX(&x.FMapInt8String, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8String != nil { + x.FptrMapInt8String = nil + } + } else { + if x.FptrMapInt8String == nil { + x.FptrMapInt8String = new(map[int8]string) + } + + if false { + } else { + z.F.DecMapInt8StringX(x.FptrMapInt8String, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Uint = nil + } else { + if false { + } else { + z.F.DecMapInt8UintX(&x.FMapInt8Uint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Uint != nil { + x.FptrMapInt8Uint = nil + } + } else { + if x.FptrMapInt8Uint == nil { + x.FptrMapInt8Uint = new(map[int8]uint) + } + + if false { + } else { + z.F.DecMapInt8UintX(x.FptrMapInt8Uint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Uint8 = nil + } else { + if false { + } else { + z.F.DecMapInt8Uint8X(&x.FMapInt8Uint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Uint8 != nil { + x.FptrMapInt8Uint8 = nil + } + } else { + if x.FptrMapInt8Uint8 == nil { + x.FptrMapInt8Uint8 = new(map[int8]uint8) + } + + if false { + } else { + z.F.DecMapInt8Uint8X(x.FptrMapInt8Uint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Uint16 = nil + } else { + if false { + } else { + z.F.DecMapInt8Uint16X(&x.FMapInt8Uint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Uint16 != nil { + x.FptrMapInt8Uint16 = nil + } + } else { + if x.FptrMapInt8Uint16 == nil { + x.FptrMapInt8Uint16 = new(map[int8]uint16) + } + + if false { + } else { + z.F.DecMapInt8Uint16X(x.FptrMapInt8Uint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Uint32 = nil + } else { + if false { + } else { + z.F.DecMapInt8Uint32X(&x.FMapInt8Uint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Uint32 != nil { + x.FptrMapInt8Uint32 = nil + } + } else { + if x.FptrMapInt8Uint32 == nil { + x.FptrMapInt8Uint32 = new(map[int8]uint32) + } + + if false { + } else { + z.F.DecMapInt8Uint32X(x.FptrMapInt8Uint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Uint64 = nil + } else { + if false { + } else { + z.F.DecMapInt8Uint64X(&x.FMapInt8Uint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Uint64 != nil { + x.FptrMapInt8Uint64 = nil + } + } else { + if x.FptrMapInt8Uint64 == nil { + x.FptrMapInt8Uint64 = new(map[int8]uint64) + } + + if false { + } else { + z.F.DecMapInt8Uint64X(x.FptrMapInt8Uint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Uintptr = nil + } else { + if false { + } else { + z.F.DecMapInt8UintptrX(&x.FMapInt8Uintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Uintptr != nil { + x.FptrMapInt8Uintptr = nil + } + } else { + if x.FptrMapInt8Uintptr == nil { + x.FptrMapInt8Uintptr = new(map[int8]uintptr) + } + + if false { + } else { + z.F.DecMapInt8UintptrX(x.FptrMapInt8Uintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Int = nil + } else { + if false { + } else { + z.F.DecMapInt8IntX(&x.FMapInt8Int, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Int != nil { + x.FptrMapInt8Int = nil + } + } else { + if x.FptrMapInt8Int == nil { + x.FptrMapInt8Int = new(map[int8]int) + } + + if false { + } else { + z.F.DecMapInt8IntX(x.FptrMapInt8Int, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Int8 = nil + } else { + if false { + } else { + z.F.DecMapInt8Int8X(&x.FMapInt8Int8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Int8 != nil { + x.FptrMapInt8Int8 = nil + } + } else { + if x.FptrMapInt8Int8 == nil { + x.FptrMapInt8Int8 = new(map[int8]int8) + } + + if false { + } else { + z.F.DecMapInt8Int8X(x.FptrMapInt8Int8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Int16 = nil + } else { + if false { + } else { + z.F.DecMapInt8Int16X(&x.FMapInt8Int16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Int16 != nil { + x.FptrMapInt8Int16 = nil + } + } else { + if x.FptrMapInt8Int16 == nil { + x.FptrMapInt8Int16 = new(map[int8]int16) + } + + if false { + } else { + z.F.DecMapInt8Int16X(x.FptrMapInt8Int16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Int32 = nil + } else { + if false { + } else { + z.F.DecMapInt8Int32X(&x.FMapInt8Int32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Int32 != nil { + x.FptrMapInt8Int32 = nil + } + } else { + if x.FptrMapInt8Int32 == nil { + x.FptrMapInt8Int32 = new(map[int8]int32) + } + + if false { + } else { + z.F.DecMapInt8Int32X(x.FptrMapInt8Int32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Int64 = nil + } else { + if false { + } else { + z.F.DecMapInt8Int64X(&x.FMapInt8Int64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Int64 != nil { + x.FptrMapInt8Int64 = nil + } + } else { + if x.FptrMapInt8Int64 == nil { + x.FptrMapInt8Int64 = new(map[int8]int64) + } + + if false { + } else { + z.F.DecMapInt8Int64X(x.FptrMapInt8Int64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Float32 = nil + } else { + if false { + } else { + z.F.DecMapInt8Float32X(&x.FMapInt8Float32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Float32 != nil { + x.FptrMapInt8Float32 = nil + } + } else { + if x.FptrMapInt8Float32 == nil { + x.FptrMapInt8Float32 = new(map[int8]float32) + } + + if false { + } else { + z.F.DecMapInt8Float32X(x.FptrMapInt8Float32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Float64 = nil + } else { + if false { + } else { + z.F.DecMapInt8Float64X(&x.FMapInt8Float64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Float64 != nil { + x.FptrMapInt8Float64 = nil + } + } else { + if x.FptrMapInt8Float64 == nil { + x.FptrMapInt8Float64 = new(map[int8]float64) + } + + if false { + } else { + z.F.DecMapInt8Float64X(x.FptrMapInt8Float64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Bool = nil + } else { + if false { + } else { + z.F.DecMapInt8BoolX(&x.FMapInt8Bool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt8Bool != nil { + x.FptrMapInt8Bool = nil + } + } else { + if x.FptrMapInt8Bool == nil { + x.FptrMapInt8Bool = new(map[int8]bool) + } + + if false { + } else { + z.F.DecMapInt8BoolX(x.FptrMapInt8Bool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Intf = nil + } else { + if false { + } else { + z.F.DecMapInt16IntfX(&x.FMapInt16Intf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Intf != nil { + x.FptrMapInt16Intf = nil + } + } else { + if x.FptrMapInt16Intf == nil { + x.FptrMapInt16Intf = new(map[int16]interface{}) + } + + if false { + } else { + z.F.DecMapInt16IntfX(x.FptrMapInt16Intf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16String = nil + } else { + if false { + } else { + z.F.DecMapInt16StringX(&x.FMapInt16String, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16String != nil { + x.FptrMapInt16String = nil + } + } else { + if x.FptrMapInt16String == nil { + x.FptrMapInt16String = new(map[int16]string) + } + + if false { + } else { + z.F.DecMapInt16StringX(x.FptrMapInt16String, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Uint = nil + } else { + if false { + } else { + z.F.DecMapInt16UintX(&x.FMapInt16Uint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Uint != nil { + x.FptrMapInt16Uint = nil + } + } else { + if x.FptrMapInt16Uint == nil { + x.FptrMapInt16Uint = new(map[int16]uint) + } + + if false { + } else { + z.F.DecMapInt16UintX(x.FptrMapInt16Uint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Uint8 = nil + } else { + if false { + } else { + z.F.DecMapInt16Uint8X(&x.FMapInt16Uint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Uint8 != nil { + x.FptrMapInt16Uint8 = nil + } + } else { + if x.FptrMapInt16Uint8 == nil { + x.FptrMapInt16Uint8 = new(map[int16]uint8) + } + + if false { + } else { + z.F.DecMapInt16Uint8X(x.FptrMapInt16Uint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Uint16 = nil + } else { + if false { + } else { + z.F.DecMapInt16Uint16X(&x.FMapInt16Uint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Uint16 != nil { + x.FptrMapInt16Uint16 = nil + } + } else { + if x.FptrMapInt16Uint16 == nil { + x.FptrMapInt16Uint16 = new(map[int16]uint16) + } + + if false { + } else { + z.F.DecMapInt16Uint16X(x.FptrMapInt16Uint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Uint32 = nil + } else { + if false { + } else { + z.F.DecMapInt16Uint32X(&x.FMapInt16Uint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Uint32 != nil { + x.FptrMapInt16Uint32 = nil + } + } else { + if x.FptrMapInt16Uint32 == nil { + x.FptrMapInt16Uint32 = new(map[int16]uint32) + } + + if false { + } else { + z.F.DecMapInt16Uint32X(x.FptrMapInt16Uint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Uint64 = nil + } else { + if false { + } else { + z.F.DecMapInt16Uint64X(&x.FMapInt16Uint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Uint64 != nil { + x.FptrMapInt16Uint64 = nil + } + } else { + if x.FptrMapInt16Uint64 == nil { + x.FptrMapInt16Uint64 = new(map[int16]uint64) + } + + if false { + } else { + z.F.DecMapInt16Uint64X(x.FptrMapInt16Uint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Uintptr = nil + } else { + if false { + } else { + z.F.DecMapInt16UintptrX(&x.FMapInt16Uintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Uintptr != nil { + x.FptrMapInt16Uintptr = nil + } + } else { + if x.FptrMapInt16Uintptr == nil { + x.FptrMapInt16Uintptr = new(map[int16]uintptr) + } + + if false { + } else { + z.F.DecMapInt16UintptrX(x.FptrMapInt16Uintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Int = nil + } else { + if false { + } else { + z.F.DecMapInt16IntX(&x.FMapInt16Int, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Int != nil { + x.FptrMapInt16Int = nil + } + } else { + if x.FptrMapInt16Int == nil { + x.FptrMapInt16Int = new(map[int16]int) + } + + if false { + } else { + z.F.DecMapInt16IntX(x.FptrMapInt16Int, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Int8 = nil + } else { + if false { + } else { + z.F.DecMapInt16Int8X(&x.FMapInt16Int8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Int8 != nil { + x.FptrMapInt16Int8 = nil + } + } else { + if x.FptrMapInt16Int8 == nil { + x.FptrMapInt16Int8 = new(map[int16]int8) + } + + if false { + } else { + z.F.DecMapInt16Int8X(x.FptrMapInt16Int8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Int16 = nil + } else { + if false { + } else { + z.F.DecMapInt16Int16X(&x.FMapInt16Int16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Int16 != nil { + x.FptrMapInt16Int16 = nil + } + } else { + if x.FptrMapInt16Int16 == nil { + x.FptrMapInt16Int16 = new(map[int16]int16) + } + + if false { + } else { + z.F.DecMapInt16Int16X(x.FptrMapInt16Int16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Int32 = nil + } else { + if false { + } else { + z.F.DecMapInt16Int32X(&x.FMapInt16Int32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Int32 != nil { + x.FptrMapInt16Int32 = nil + } + } else { + if x.FptrMapInt16Int32 == nil { + x.FptrMapInt16Int32 = new(map[int16]int32) + } + + if false { + } else { + z.F.DecMapInt16Int32X(x.FptrMapInt16Int32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Int64 = nil + } else { + if false { + } else { + z.F.DecMapInt16Int64X(&x.FMapInt16Int64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Int64 != nil { + x.FptrMapInt16Int64 = nil + } + } else { + if x.FptrMapInt16Int64 == nil { + x.FptrMapInt16Int64 = new(map[int16]int64) + } + + if false { + } else { + z.F.DecMapInt16Int64X(x.FptrMapInt16Int64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Float32 = nil + } else { + if false { + } else { + z.F.DecMapInt16Float32X(&x.FMapInt16Float32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Float32 != nil { + x.FptrMapInt16Float32 = nil + } + } else { + if x.FptrMapInt16Float32 == nil { + x.FptrMapInt16Float32 = new(map[int16]float32) + } + + if false { + } else { + z.F.DecMapInt16Float32X(x.FptrMapInt16Float32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Float64 = nil + } else { + if false { + } else { + z.F.DecMapInt16Float64X(&x.FMapInt16Float64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Float64 != nil { + x.FptrMapInt16Float64 = nil + } + } else { + if x.FptrMapInt16Float64 == nil { + x.FptrMapInt16Float64 = new(map[int16]float64) + } + + if false { + } else { + z.F.DecMapInt16Float64X(x.FptrMapInt16Float64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Bool = nil + } else { + if false { + } else { + z.F.DecMapInt16BoolX(&x.FMapInt16Bool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt16Bool != nil { + x.FptrMapInt16Bool = nil + } + } else { + if x.FptrMapInt16Bool == nil { + x.FptrMapInt16Bool = new(map[int16]bool) + } + + if false { + } else { + z.F.DecMapInt16BoolX(x.FptrMapInt16Bool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Intf = nil + } else { + if false { + } else { + z.F.DecMapInt32IntfX(&x.FMapInt32Intf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Intf != nil { + x.FptrMapInt32Intf = nil + } + } else { + if x.FptrMapInt32Intf == nil { + x.FptrMapInt32Intf = new(map[int32]interface{}) + } + + if false { + } else { + z.F.DecMapInt32IntfX(x.FptrMapInt32Intf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32String = nil + } else { + if false { + } else { + z.F.DecMapInt32StringX(&x.FMapInt32String, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32String != nil { + x.FptrMapInt32String = nil + } + } else { + if x.FptrMapInt32String == nil { + x.FptrMapInt32String = new(map[int32]string) + } + + if false { + } else { + z.F.DecMapInt32StringX(x.FptrMapInt32String, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Uint = nil + } else { + if false { + } else { + z.F.DecMapInt32UintX(&x.FMapInt32Uint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Uint != nil { + x.FptrMapInt32Uint = nil + } + } else { + if x.FptrMapInt32Uint == nil { + x.FptrMapInt32Uint = new(map[int32]uint) + } + + if false { + } else { + z.F.DecMapInt32UintX(x.FptrMapInt32Uint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Uint8 = nil + } else { + if false { + } else { + z.F.DecMapInt32Uint8X(&x.FMapInt32Uint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Uint8 != nil { + x.FptrMapInt32Uint8 = nil + } + } else { + if x.FptrMapInt32Uint8 == nil { + x.FptrMapInt32Uint8 = new(map[int32]uint8) + } + + if false { + } else { + z.F.DecMapInt32Uint8X(x.FptrMapInt32Uint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Uint16 = nil + } else { + if false { + } else { + z.F.DecMapInt32Uint16X(&x.FMapInt32Uint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Uint16 != nil { + x.FptrMapInt32Uint16 = nil + } + } else { + if x.FptrMapInt32Uint16 == nil { + x.FptrMapInt32Uint16 = new(map[int32]uint16) + } + + if false { + } else { + z.F.DecMapInt32Uint16X(x.FptrMapInt32Uint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Uint32 = nil + } else { + if false { + } else { + z.F.DecMapInt32Uint32X(&x.FMapInt32Uint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Uint32 != nil { + x.FptrMapInt32Uint32 = nil + } + } else { + if x.FptrMapInt32Uint32 == nil { + x.FptrMapInt32Uint32 = new(map[int32]uint32) + } + + if false { + } else { + z.F.DecMapInt32Uint32X(x.FptrMapInt32Uint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Uint64 = nil + } else { + if false { + } else { + z.F.DecMapInt32Uint64X(&x.FMapInt32Uint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Uint64 != nil { + x.FptrMapInt32Uint64 = nil + } + } else { + if x.FptrMapInt32Uint64 == nil { + x.FptrMapInt32Uint64 = new(map[int32]uint64) + } + + if false { + } else { + z.F.DecMapInt32Uint64X(x.FptrMapInt32Uint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Uintptr = nil + } else { + if false { + } else { + z.F.DecMapInt32UintptrX(&x.FMapInt32Uintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Uintptr != nil { + x.FptrMapInt32Uintptr = nil + } + } else { + if x.FptrMapInt32Uintptr == nil { + x.FptrMapInt32Uintptr = new(map[int32]uintptr) + } + + if false { + } else { + z.F.DecMapInt32UintptrX(x.FptrMapInt32Uintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Int = nil + } else { + if false { + } else { + z.F.DecMapInt32IntX(&x.FMapInt32Int, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Int != nil { + x.FptrMapInt32Int = nil + } + } else { + if x.FptrMapInt32Int == nil { + x.FptrMapInt32Int = new(map[int32]int) + } + + if false { + } else { + z.F.DecMapInt32IntX(x.FptrMapInt32Int, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Int8 = nil + } else { + if false { + } else { + z.F.DecMapInt32Int8X(&x.FMapInt32Int8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Int8 != nil { + x.FptrMapInt32Int8 = nil + } + } else { + if x.FptrMapInt32Int8 == nil { + x.FptrMapInt32Int8 = new(map[int32]int8) + } + + if false { + } else { + z.F.DecMapInt32Int8X(x.FptrMapInt32Int8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Int16 = nil + } else { + if false { + } else { + z.F.DecMapInt32Int16X(&x.FMapInt32Int16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Int16 != nil { + x.FptrMapInt32Int16 = nil + } + } else { + if x.FptrMapInt32Int16 == nil { + x.FptrMapInt32Int16 = new(map[int32]int16) + } + + if false { + } else { + z.F.DecMapInt32Int16X(x.FptrMapInt32Int16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Int32 = nil + } else { + if false { + } else { + z.F.DecMapInt32Int32X(&x.FMapInt32Int32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Int32 != nil { + x.FptrMapInt32Int32 = nil + } + } else { + if x.FptrMapInt32Int32 == nil { + x.FptrMapInt32Int32 = new(map[int32]int32) + } + + if false { + } else { + z.F.DecMapInt32Int32X(x.FptrMapInt32Int32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Int64 = nil + } else { + if false { + } else { + z.F.DecMapInt32Int64X(&x.FMapInt32Int64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Int64 != nil { + x.FptrMapInt32Int64 = nil + } + } else { + if x.FptrMapInt32Int64 == nil { + x.FptrMapInt32Int64 = new(map[int32]int64) + } + + if false { + } else { + z.F.DecMapInt32Int64X(x.FptrMapInt32Int64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Float32 = nil + } else { + if false { + } else { + z.F.DecMapInt32Float32X(&x.FMapInt32Float32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Float32 != nil { + x.FptrMapInt32Float32 = nil + } + } else { + if x.FptrMapInt32Float32 == nil { + x.FptrMapInt32Float32 = new(map[int32]float32) + } + + if false { + } else { + z.F.DecMapInt32Float32X(x.FptrMapInt32Float32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Float64 = nil + } else { + if false { + } else { + z.F.DecMapInt32Float64X(&x.FMapInt32Float64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Float64 != nil { + x.FptrMapInt32Float64 = nil + } + } else { + if x.FptrMapInt32Float64 == nil { + x.FptrMapInt32Float64 = new(map[int32]float64) + } + + if false { + } else { + z.F.DecMapInt32Float64X(x.FptrMapInt32Float64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Bool = nil + } else { + if false { + } else { + z.F.DecMapInt32BoolX(&x.FMapInt32Bool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt32Bool != nil { + x.FptrMapInt32Bool = nil + } + } else { + if x.FptrMapInt32Bool == nil { + x.FptrMapInt32Bool = new(map[int32]bool) + } + + if false { + } else { + z.F.DecMapInt32BoolX(x.FptrMapInt32Bool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Intf = nil + } else { + if false { + } else { + z.F.DecMapInt64IntfX(&x.FMapInt64Intf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Intf != nil { + x.FptrMapInt64Intf = nil + } + } else { + if x.FptrMapInt64Intf == nil { + x.FptrMapInt64Intf = new(map[int64]interface{}) + } + + if false { + } else { + z.F.DecMapInt64IntfX(x.FptrMapInt64Intf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64String = nil + } else { + if false { + } else { + z.F.DecMapInt64StringX(&x.FMapInt64String, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64String != nil { + x.FptrMapInt64String = nil + } + } else { + if x.FptrMapInt64String == nil { + x.FptrMapInt64String = new(map[int64]string) + } + + if false { + } else { + z.F.DecMapInt64StringX(x.FptrMapInt64String, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Uint = nil + } else { + if false { + } else { + z.F.DecMapInt64UintX(&x.FMapInt64Uint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Uint != nil { + x.FptrMapInt64Uint = nil + } + } else { + if x.FptrMapInt64Uint == nil { + x.FptrMapInt64Uint = new(map[int64]uint) + } + + if false { + } else { + z.F.DecMapInt64UintX(x.FptrMapInt64Uint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Uint8 = nil + } else { + if false { + } else { + z.F.DecMapInt64Uint8X(&x.FMapInt64Uint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Uint8 != nil { + x.FptrMapInt64Uint8 = nil + } + } else { + if x.FptrMapInt64Uint8 == nil { + x.FptrMapInt64Uint8 = new(map[int64]uint8) + } + + if false { + } else { + z.F.DecMapInt64Uint8X(x.FptrMapInt64Uint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Uint16 = nil + } else { + if false { + } else { + z.F.DecMapInt64Uint16X(&x.FMapInt64Uint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Uint16 != nil { + x.FptrMapInt64Uint16 = nil + } + } else { + if x.FptrMapInt64Uint16 == nil { + x.FptrMapInt64Uint16 = new(map[int64]uint16) + } + + if false { + } else { + z.F.DecMapInt64Uint16X(x.FptrMapInt64Uint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Uint32 = nil + } else { + if false { + } else { + z.F.DecMapInt64Uint32X(&x.FMapInt64Uint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Uint32 != nil { + x.FptrMapInt64Uint32 = nil + } + } else { + if x.FptrMapInt64Uint32 == nil { + x.FptrMapInt64Uint32 = new(map[int64]uint32) + } + + if false { + } else { + z.F.DecMapInt64Uint32X(x.FptrMapInt64Uint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Uint64 = nil + } else { + if false { + } else { + z.F.DecMapInt64Uint64X(&x.FMapInt64Uint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Uint64 != nil { + x.FptrMapInt64Uint64 = nil + } + } else { + if x.FptrMapInt64Uint64 == nil { + x.FptrMapInt64Uint64 = new(map[int64]uint64) + } + + if false { + } else { + z.F.DecMapInt64Uint64X(x.FptrMapInt64Uint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Uintptr = nil + } else { + if false { + } else { + z.F.DecMapInt64UintptrX(&x.FMapInt64Uintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Uintptr != nil { + x.FptrMapInt64Uintptr = nil + } + } else { + if x.FptrMapInt64Uintptr == nil { + x.FptrMapInt64Uintptr = new(map[int64]uintptr) + } + + if false { + } else { + z.F.DecMapInt64UintptrX(x.FptrMapInt64Uintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Int = nil + } else { + if false { + } else { + z.F.DecMapInt64IntX(&x.FMapInt64Int, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Int != nil { + x.FptrMapInt64Int = nil + } + } else { + if x.FptrMapInt64Int == nil { + x.FptrMapInt64Int = new(map[int64]int) + } + + if false { + } else { + z.F.DecMapInt64IntX(x.FptrMapInt64Int, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Int8 = nil + } else { + if false { + } else { + z.F.DecMapInt64Int8X(&x.FMapInt64Int8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Int8 != nil { + x.FptrMapInt64Int8 = nil + } + } else { + if x.FptrMapInt64Int8 == nil { + x.FptrMapInt64Int8 = new(map[int64]int8) + } + + if false { + } else { + z.F.DecMapInt64Int8X(x.FptrMapInt64Int8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Int16 = nil + } else { + if false { + } else { + z.F.DecMapInt64Int16X(&x.FMapInt64Int16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Int16 != nil { + x.FptrMapInt64Int16 = nil + } + } else { + if x.FptrMapInt64Int16 == nil { + x.FptrMapInt64Int16 = new(map[int64]int16) + } + + if false { + } else { + z.F.DecMapInt64Int16X(x.FptrMapInt64Int16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Int32 = nil + } else { + if false { + } else { + z.F.DecMapInt64Int32X(&x.FMapInt64Int32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Int32 != nil { + x.FptrMapInt64Int32 = nil + } + } else { + if x.FptrMapInt64Int32 == nil { + x.FptrMapInt64Int32 = new(map[int64]int32) + } + + if false { + } else { + z.F.DecMapInt64Int32X(x.FptrMapInt64Int32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Int64 = nil + } else { + if false { + } else { + z.F.DecMapInt64Int64X(&x.FMapInt64Int64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Int64 != nil { + x.FptrMapInt64Int64 = nil + } + } else { + if x.FptrMapInt64Int64 == nil { + x.FptrMapInt64Int64 = new(map[int64]int64) + } + + if false { + } else { + z.F.DecMapInt64Int64X(x.FptrMapInt64Int64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Float32 = nil + } else { + if false { + } else { + z.F.DecMapInt64Float32X(&x.FMapInt64Float32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Float32 != nil { + x.FptrMapInt64Float32 = nil + } + } else { + if x.FptrMapInt64Float32 == nil { + x.FptrMapInt64Float32 = new(map[int64]float32) + } + + if false { + } else { + z.F.DecMapInt64Float32X(x.FptrMapInt64Float32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Float64 = nil + } else { + if false { + } else { + z.F.DecMapInt64Float64X(&x.FMapInt64Float64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Float64 != nil { + x.FptrMapInt64Float64 = nil + } + } else { + if x.FptrMapInt64Float64 == nil { + x.FptrMapInt64Float64 = new(map[int64]float64) + } + + if false { + } else { + z.F.DecMapInt64Float64X(x.FptrMapInt64Float64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Bool = nil + } else { + if false { + } else { + z.F.DecMapInt64BoolX(&x.FMapInt64Bool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapInt64Bool != nil { + x.FptrMapInt64Bool = nil + } + } else { + if x.FptrMapInt64Bool == nil { + x.FptrMapInt64Bool = new(map[int64]bool) + } + + if false { + } else { + z.F.DecMapInt64BoolX(x.FptrMapInt64Bool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolIntf = nil + } else { + if false { + } else { + z.F.DecMapBoolIntfX(&x.FMapBoolIntf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolIntf != nil { + x.FptrMapBoolIntf = nil + } + } else { + if x.FptrMapBoolIntf == nil { + x.FptrMapBoolIntf = new(map[bool]interface{}) + } + + if false { + } else { + z.F.DecMapBoolIntfX(x.FptrMapBoolIntf, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolString = nil + } else { + if false { + } else { + z.F.DecMapBoolStringX(&x.FMapBoolString, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolString != nil { + x.FptrMapBoolString = nil + } + } else { + if x.FptrMapBoolString == nil { + x.FptrMapBoolString = new(map[bool]string) + } + + if false { + } else { + z.F.DecMapBoolStringX(x.FptrMapBoolString, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolUint = nil + } else { + if false { + } else { + z.F.DecMapBoolUintX(&x.FMapBoolUint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolUint != nil { + x.FptrMapBoolUint = nil + } + } else { + if x.FptrMapBoolUint == nil { + x.FptrMapBoolUint = new(map[bool]uint) + } + + if false { + } else { + z.F.DecMapBoolUintX(x.FptrMapBoolUint, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolUint8 = nil + } else { + if false { + } else { + z.F.DecMapBoolUint8X(&x.FMapBoolUint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolUint8 != nil { + x.FptrMapBoolUint8 = nil + } + } else { + if x.FptrMapBoolUint8 == nil { + x.FptrMapBoolUint8 = new(map[bool]uint8) + } + + if false { + } else { + z.F.DecMapBoolUint8X(x.FptrMapBoolUint8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolUint16 = nil + } else { + if false { + } else { + z.F.DecMapBoolUint16X(&x.FMapBoolUint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolUint16 != nil { + x.FptrMapBoolUint16 = nil + } + } else { + if x.FptrMapBoolUint16 == nil { + x.FptrMapBoolUint16 = new(map[bool]uint16) + } + + if false { + } else { + z.F.DecMapBoolUint16X(x.FptrMapBoolUint16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolUint32 = nil + } else { + if false { + } else { + z.F.DecMapBoolUint32X(&x.FMapBoolUint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolUint32 != nil { + x.FptrMapBoolUint32 = nil + } + } else { + if x.FptrMapBoolUint32 == nil { + x.FptrMapBoolUint32 = new(map[bool]uint32) + } + + if false { + } else { + z.F.DecMapBoolUint32X(x.FptrMapBoolUint32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolUint64 = nil + } else { + if false { + } else { + z.F.DecMapBoolUint64X(&x.FMapBoolUint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolUint64 != nil { + x.FptrMapBoolUint64 = nil + } + } else { + if x.FptrMapBoolUint64 == nil { + x.FptrMapBoolUint64 = new(map[bool]uint64) + } + + if false { + } else { + z.F.DecMapBoolUint64X(x.FptrMapBoolUint64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolUintptr = nil + } else { + if false { + } else { + z.F.DecMapBoolUintptrX(&x.FMapBoolUintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolUintptr != nil { + x.FptrMapBoolUintptr = nil + } + } else { + if x.FptrMapBoolUintptr == nil { + x.FptrMapBoolUintptr = new(map[bool]uintptr) + } + + if false { + } else { + z.F.DecMapBoolUintptrX(x.FptrMapBoolUintptr, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolInt = nil + } else { + if false { + } else { + z.F.DecMapBoolIntX(&x.FMapBoolInt, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolInt != nil { + x.FptrMapBoolInt = nil + } + } else { + if x.FptrMapBoolInt == nil { + x.FptrMapBoolInt = new(map[bool]int) + } + + if false { + } else { + z.F.DecMapBoolIntX(x.FptrMapBoolInt, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolInt8 = nil + } else { + if false { + } else { + z.F.DecMapBoolInt8X(&x.FMapBoolInt8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolInt8 != nil { + x.FptrMapBoolInt8 = nil + } + } else { + if x.FptrMapBoolInt8 == nil { + x.FptrMapBoolInt8 = new(map[bool]int8) + } + + if false { + } else { + z.F.DecMapBoolInt8X(x.FptrMapBoolInt8, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolInt16 = nil + } else { + if false { + } else { + z.F.DecMapBoolInt16X(&x.FMapBoolInt16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolInt16 != nil { + x.FptrMapBoolInt16 = nil + } + } else { + if x.FptrMapBoolInt16 == nil { + x.FptrMapBoolInt16 = new(map[bool]int16) + } + + if false { + } else { + z.F.DecMapBoolInt16X(x.FptrMapBoolInt16, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolInt32 = nil + } else { + if false { + } else { + z.F.DecMapBoolInt32X(&x.FMapBoolInt32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolInt32 != nil { + x.FptrMapBoolInt32 = nil + } + } else { + if x.FptrMapBoolInt32 == nil { + x.FptrMapBoolInt32 = new(map[bool]int32) + } + + if false { + } else { + z.F.DecMapBoolInt32X(x.FptrMapBoolInt32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolInt64 = nil + } else { + if false { + } else { + z.F.DecMapBoolInt64X(&x.FMapBoolInt64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolInt64 != nil { + x.FptrMapBoolInt64 = nil + } + } else { + if x.FptrMapBoolInt64 == nil { + x.FptrMapBoolInt64 = new(map[bool]int64) + } + + if false { + } else { + z.F.DecMapBoolInt64X(x.FptrMapBoolInt64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolFloat32 = nil + } else { + if false { + } else { + z.F.DecMapBoolFloat32X(&x.FMapBoolFloat32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolFloat32 != nil { + x.FptrMapBoolFloat32 = nil + } + } else { + if x.FptrMapBoolFloat32 == nil { + x.FptrMapBoolFloat32 = new(map[bool]float32) + } + + if false { + } else { + z.F.DecMapBoolFloat32X(x.FptrMapBoolFloat32, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolFloat64 = nil + } else { + if false { + } else { + z.F.DecMapBoolFloat64X(&x.FMapBoolFloat64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolFloat64 != nil { + x.FptrMapBoolFloat64 = nil + } + } else { + if x.FptrMapBoolFloat64 == nil { + x.FptrMapBoolFloat64 = new(map[bool]float64) + } + + if false { + } else { + z.F.DecMapBoolFloat64X(x.FptrMapBoolFloat64, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolBool = nil + } else { + if false { + } else { + z.F.DecMapBoolBoolX(&x.FMapBoolBool, d) + } + } + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if true && x.FptrMapBoolBool != nil { + x.FptrMapBoolBool = nil + } + } else { + if x.FptrMapBoolBool == nil { + x.FptrMapBoolBool = new(map[bool]bool) + } + + if false { + } else { + z.F.DecMapBoolBoolX(x.FptrMapBoolBool, d) + } + } + for { + yyj1141++ + if yyhl1141 { + yyb1141 = yyj1141 > l + } else { + yyb1141 = r.CheckBreak() + } + if yyb1141 { + break + } + r.ReadArrayElem() + z.DecStructFieldNotFound(yyj1141-1, "") + } + r.ReadArrayEnd() +} + +func (x testMammoth2Binary) CodecEncodeSelf(e *Encoder) { + var h codecSelfer19781 + z, r := GenHelperEncoder(e) + _, _, _ = h, z, r + if false { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) + } else if z.EncBinary() { + z.EncBinaryMarshal(x) + } else { + r.EncodeUint(uint64(x)) + } +} + +func (x *testMammoth2Binary) CodecDecodeSelf(d *Decoder) { + var h codecSelfer19781 + z, r := GenHelperDecoder(d) + _, _, _ = h, z, r + if false { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) + } else if z.DecBinary() { + z.DecBinaryUnmarshal(x) + } else { + *x = (testMammoth2Binary)(r.DecodeUint64()) + } +} + +func (x testMammoth2Text) CodecEncodeSelf(e *Encoder) { + var h codecSelfer19781 + z, r := GenHelperEncoder(e) + _, _, _ = h, z, r + if false { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) + } else if !z.EncBinary() { + z.EncTextMarshal(x) + } else { + r.EncodeUint(uint64(x)) + } +} + +func (x *testMammoth2Text) CodecDecodeSelf(d *Decoder) { + var h codecSelfer19781 + z, r := GenHelperDecoder(d) + _, _, _ = h, z, r + if false { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) + } else if !z.DecBinary() { + z.DecTextUnmarshal(x) + } else { + *x = (testMammoth2Text)(r.DecodeUint64()) + } +} + +func (x testMammoth2Json) CodecEncodeSelf(e *Encoder) { + var h codecSelfer19781 + z, r := GenHelperEncoder(e) + _, _, _ = h, z, r + if false { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) + } else if !z.EncBinary() && z.IsJSONHandle() { + z.EncJSONMarshal(x) + } else { + r.EncodeUint(uint64(x)) + } +} + +func (x *testMammoth2Json) CodecDecodeSelf(d *Decoder) { + var h codecSelfer19781 + z, r := GenHelperDecoder(d) + _, _, _ = h, z, r + if false { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) + } else if !z.DecBinary() && z.IsJSONHandle() { + z.DecJSONUnmarshal(x) + } else { + *x = (testMammoth2Json)(r.DecodeUint64()) + } +} + +func (x *testMammoth2Basic) CodecEncodeSelf(e *Encoder) { + var h codecSelfer19781 + z, r := GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + if false { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) + } else { + h.enctestMammoth2Basic((*testMammoth2Basic)(x), e) + } + } +} + +func (x *testMammoth2Basic) CodecDecodeSelf(d *Decoder) { + var h codecSelfer19781 + z, r := GenHelperDecoder(d) + _, _, _ = h, z, r + if false { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) + } else { + h.dectestMammoth2Basic((*testMammoth2Basic)(x), d) + } +} + +func (x *TestMammoth2Wrapper) CodecEncodeSelf(e *Encoder) { + var h codecSelfer19781 + z, r := GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + if false { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) + } else { + yysep2 := !z.EncBinary() + yy2arr2 := z.EncBasicHandle().StructToArray + _, _ = yysep2, yy2arr2 + const yyr2 bool = false // struct tag has 'toArray' + if yyr2 || yy2arr2 { + r.WriteArrayStart(8) + } else { + r.WriteMapStart(8) + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + yy4 := &x.V + yy4.CodecEncodeSelf(e) + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"V\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `V`) + } + r.WriteMapElemValue() + yy6 := &x.V + yy6.CodecEncodeSelf(e) + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + x.T.CodecEncodeSelf(e) + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"T\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `T`) + } + r.WriteMapElemValue() + x.T.CodecEncodeSelf(e) + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + x.B.CodecEncodeSelf(e) + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"B\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `B`) + } + r.WriteMapElemValue() + x.B.CodecEncodeSelf(e) + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + x.J.CodecEncodeSelf(e) + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"J\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `J`) + } + r.WriteMapElemValue() + x.J.CodecEncodeSelf(e) + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + yy18 := &x.C + yy18.CodecEncodeSelf(e) + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"C\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `C`) + } + r.WriteMapElemValue() + yy20 := &x.C + yy20.CodecEncodeSelf(e) + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.M == nil { + r.EncodeNil() + } else { + if false { + } else { + h.encMaptestMammoth2BasicTestMammoth2((map[testMammoth2Basic]TestMammoth2)(x.M), e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"M\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `M`) + } + r.WriteMapElemValue() + if x.M == nil { + r.EncodeNil() + } else { + if false { + } else { + h.encMaptestMammoth2BasicTestMammoth2((map[testMammoth2Basic]TestMammoth2)(x.M), e) + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.L == nil { + r.EncodeNil() + } else { + if false { + } else { + h.encSliceTestMammoth2(([]TestMammoth2)(x.L), e) + } + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"L\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `L`) + } + r.WriteMapElemValue() + if x.L == nil { + r.EncodeNil() + } else { + if false { + } else { + h.encSliceTestMammoth2(([]TestMammoth2)(x.L), e) + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + yy29 := &x.A + if false { + } else { + h.encArray4int64((*[4]int64)(yy29), e) + } + } else { + r.WriteMapElemKey() + if z.IsJSONHandle() { + z.WriteStr("\"A\"") + } else { + r.EncodeStringEnc(codecSelferCcUTF819781, `A`) + } + r.WriteMapElemValue() + yy31 := &x.A + if false { + } else { + h.encArray4int64((*[4]int64)(yy31), e) + } + } + if yyr2 || yy2arr2 { + r.WriteArrayEnd() + } else { + r.WriteMapEnd() + } + } + } +} + +func (x *TestMammoth2Wrapper) CodecDecodeSelf(d *Decoder) { + var h codecSelfer19781 + z, r := GenHelperDecoder(d) + _, _, _ = h, z, r + if false { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) + } else { + yyct2 := r.ContainerType() + if yyct2 == codecSelferValueTypeMap19781 { + yyl2 := r.ReadMapStart() + if yyl2 == 0 { + r.ReadMapEnd() + } else { + x.codecDecodeSelfFromMap(yyl2, d) + } + } else if yyct2 == codecSelferValueTypeArray19781 { + yyl2 := r.ReadArrayStart() + if yyl2 == 0 { + r.ReadArrayEnd() + } else { + x.codecDecodeSelfFromArray(yyl2, d) + } + } else { + panic(errCodecSelferOnlyMapOrArrayEncodeToStruct19781) + } + } +} + +func (x *TestMammoth2Wrapper) codecDecodeSelfFromMap(l int, d *Decoder) { + var h codecSelfer19781 + z, r := GenHelperDecoder(d) + _, _, _ = h, z, r + var yyhl3 bool = l >= 0 + for yyj3 := 0; ; yyj3++ { + if yyhl3 { + if yyj3 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + r.ReadMapElemKey() + yys3 := z.StringView(r.DecodeStringAsBytes()) + r.ReadMapElemValue() + switch yys3 { + case "V": + if r.TryDecodeAsNil() { + x.V = TestMammoth2{} + } else { + x.V.CodecDecodeSelf(d) + } + case "T": + if r.TryDecodeAsNil() { + x.T = 0 + } else { + x.T.CodecDecodeSelf(d) + } + case "B": + if r.TryDecodeAsNil() { + x.B = 0 + } else { + x.B.CodecDecodeSelf(d) + } + case "J": + if r.TryDecodeAsNil() { + x.J = 0 + } else { + x.J.CodecDecodeSelf(d) + } + case "C": + if r.TryDecodeAsNil() { + x.C = testMammoth2Basic{} + } else { + x.C.CodecDecodeSelf(d) + } + case "M": + if r.TryDecodeAsNil() { + x.M = nil + } else { + if false { + } else { + h.decMaptestMammoth2BasicTestMammoth2((*map[testMammoth2Basic]TestMammoth2)(&x.M), d) + } + } + case "L": + if r.TryDecodeAsNil() { + x.L = nil + } else { + if false { + } else { + h.decSliceTestMammoth2((*[]TestMammoth2)(&x.L), d) + } + } + case "A": + if r.TryDecodeAsNil() { + x.A = [4]int64{} + } else { + if false { + } else { + h.decArray4int64((*[4]int64)(&x.A), d) + } + } + default: + z.DecStructFieldNotFound(-1, yys3) + } // end switch yys3 + } // end for yyj3 + r.ReadMapEnd() +} + +func (x *TestMammoth2Wrapper) codecDecodeSelfFromArray(l int, d *Decoder) { + var h codecSelfer19781 + z, r := GenHelperDecoder(d) + _, _, _ = h, z, r + var yyj15 int + var yyb15 bool + var yyhl15 bool = l >= 0 + yyj15++ + if yyhl15 { + yyb15 = yyj15 > l + } else { + yyb15 = r.CheckBreak() + } + if yyb15 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.V = TestMammoth2{} + } else { + x.V.CodecDecodeSelf(d) + } + yyj15++ + if yyhl15 { + yyb15 = yyj15 > l + } else { + yyb15 = r.CheckBreak() + } + if yyb15 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.T = 0 + } else { + x.T.CodecDecodeSelf(d) + } + yyj15++ + if yyhl15 { + yyb15 = yyj15 > l + } else { + yyb15 = r.CheckBreak() + } + if yyb15 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.B = 0 + } else { + x.B.CodecDecodeSelf(d) + } + yyj15++ + if yyhl15 { + yyb15 = yyj15 > l + } else { + yyb15 = r.CheckBreak() + } + if yyb15 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.J = 0 + } else { + x.J.CodecDecodeSelf(d) + } + yyj15++ + if yyhl15 { + yyb15 = yyj15 > l + } else { + yyb15 = r.CheckBreak() + } + if yyb15 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.C = testMammoth2Basic{} + } else { + x.C.CodecDecodeSelf(d) + } + yyj15++ + if yyhl15 { + yyb15 = yyj15 > l + } else { + yyb15 = r.CheckBreak() + } + if yyb15 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.M = nil + } else { + if false { + } else { + h.decMaptestMammoth2BasicTestMammoth2((*map[testMammoth2Basic]TestMammoth2)(&x.M), d) + } + } + yyj15++ + if yyhl15 { + yyb15 = yyj15 > l + } else { + yyb15 = r.CheckBreak() + } + if yyb15 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.L = nil + } else { + if false { + } else { + h.decSliceTestMammoth2((*[]TestMammoth2)(&x.L), d) + } + } + yyj15++ + if yyhl15 { + yyb15 = yyj15 > l + } else { + yyb15 = r.CheckBreak() + } + if yyb15 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.A = [4]int64{} + } else { + if false { + } else { + h.decArray4int64((*[4]int64)(&x.A), d) + } + } + for { + yyj15++ + if yyhl15 { + yyb15 = yyj15 > l + } else { + yyb15 = r.CheckBreak() + } + if yyb15 { + break + } + r.ReadArrayElem() + z.DecStructFieldNotFound(yyj15-1, "") + } + r.ReadArrayEnd() +} + +func (x codecSelfer19781) enctestMammoth2Basic(v *testMammoth2Basic, e *Encoder) { + var h codecSelfer19781 + z, r := GenHelperEncoder(e) + _, _, _ = h, z, r + r.WriteArrayStart(len(v)) + for _, yyv1 := range v { + r.WriteArrayElem() + if false { + } else { + r.EncodeUint(uint64(yyv1)) + } + } + r.WriteArrayEnd() +} + +func (x codecSelfer19781) dectestMammoth2Basic(v *testMammoth2Basic, d *Decoder) { + var h codecSelfer19781 + z, r := GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv1 := v + yyh1, yyl1 := z.DecSliceHelperStart() + if yyl1 == 0 { + + } else { + yyhl1 := yyl1 > 0 + var yyrl1 int + _ = yyrl1 + + var yyj1 int + // var yydn1 bool + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { // bounds-check-elimination + + yyh1.ElemContainerState(yyj1) + + var yydb1 bool + if yyj1 >= len(yyv1) { + z.DecArrayCannotExpand(len(v), yyj1+1) + yydb1 = true + + } + if yydb1 { + z.DecSwallow() + } else { + if r.TryDecodeAsNil() { + yyv1[yyj1] = 0 + } else { + yyv1[yyj1] = (uint64)(r.DecodeUint64()) + } + + } + + } + + } + yyh1.End() + +} + +func (x codecSelfer19781) encMaptestMammoth2BasicTestMammoth2(v map[testMammoth2Basic]TestMammoth2, e *Encoder) { + var h codecSelfer19781 + z, r := GenHelperEncoder(e) + _, _, _ = h, z, r + r.WriteMapStart(len(v)) + for yyk1, yyv1 := range v { + r.WriteMapElemKey() + yy2 := &yyk1 + yy2.CodecEncodeSelf(e) + r.WriteMapElemValue() + yy4 := &yyv1 + yy4.CodecEncodeSelf(e) + } + r.WriteMapEnd() +} + +func (x codecSelfer19781) decMaptestMammoth2BasicTestMammoth2(v *map[testMammoth2Basic]TestMammoth2, d *Decoder) { + var h codecSelfer19781 + z, r := GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv1 := *v + yyl1 := r.ReadMapStart() + yybh1 := z.DecBasicHandle() + if yyv1 == nil { + yyrl1 := z.DecInferLen(yyl1, yybh1.MaxInitLen, 4912) + yyv1 = make(map[testMammoth2Basic]TestMammoth2, yyrl1) + *v = yyv1 + } + var yymk1 testMammoth2Basic + var yymv1 TestMammoth2 + var yymg1, yymdn1 bool + if yybh1.MapValueReset { + yymg1 = true + } + if yyl1 != 0 { + yyhl1 := yyl1 > 0 + for yyj1 := 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { + r.ReadMapElemKey() + if r.TryDecodeAsNil() { + yymk1 = testMammoth2Basic{} + } else { + yymk1.CodecDecodeSelf(d) + } + + if yymg1 { + yymv1 = yyv1[yymk1] + } else { + yymv1 = TestMammoth2{} + } + r.ReadMapElemValue() + yymdn1 = false + if r.TryDecodeAsNil() { + yymdn1 = true + } else { + yymv1.CodecDecodeSelf(d) + } + + if yymdn1 { + if yybh1.DeleteOnNilMapValue { + delete(yyv1, yymk1) + } else { + yyv1[yymk1] = TestMammoth2{} + } + } else if yyv1 != nil { + yyv1[yymk1] = yymv1 + } + } + } // else len==0: TODO: Should we clear map entries? + r.ReadMapEnd() +} + +func (x codecSelfer19781) encSliceTestMammoth2(v []TestMammoth2, e *Encoder) { + var h codecSelfer19781 + z, r := GenHelperEncoder(e) + _, _, _ = h, z, r + r.WriteArrayStart(len(v)) + for _, yyv1 := range v { + r.WriteArrayElem() + yy2 := &yyv1 + yy2.CodecEncodeSelf(e) + } + r.WriteArrayEnd() +} + +func (x codecSelfer19781) decSliceTestMammoth2(v *[]TestMammoth2, d *Decoder) { + var h codecSelfer19781 + z, r := GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv1 := *v + yyh1, yyl1 := z.DecSliceHelperStart() + var yyc1 bool + _ = yyc1 + if yyl1 == 0 { + if yyv1 == nil { + yyv1 = []TestMammoth2{} + yyc1 = true + } else if len(yyv1) != 0 { + yyv1 = yyv1[:0] + yyc1 = true + } + } else { + yyhl1 := yyl1 > 0 + var yyrl1 int + _ = yyrl1 + if yyhl1 { + if yyl1 > cap(yyv1) { + yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 4880) + if yyrl1 <= cap(yyv1) { + yyv1 = yyv1[:yyrl1] + } else { + yyv1 = make([]TestMammoth2, yyrl1) + } + yyc1 = true + } else if yyl1 != len(yyv1) { + yyv1 = yyv1[:yyl1] + yyc1 = true + } + } + var yyj1 int + // var yydn1 bool + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { // bounds-check-elimination + if yyj1 == 0 && yyv1 == nil { + if yyhl1 { + yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 4880) + } else { + yyrl1 = 8 + } + yyv1 = make([]TestMammoth2, yyrl1) + yyc1 = true + } + yyh1.ElemContainerState(yyj1) + + var yydb1 bool + if yyj1 >= len(yyv1) { + yyv1 = append(yyv1, TestMammoth2{}) + yyc1 = true + + } + if yydb1 { + z.DecSwallow() + } else { + if r.TryDecodeAsNil() { + yyv1[yyj1] = TestMammoth2{} + } else { + yyv1[yyj1].CodecDecodeSelf(d) + } + + } + + } + if yyj1 < len(yyv1) { + yyv1 = yyv1[:yyj1] + yyc1 = true + } else if yyj1 == 0 && yyv1 == nil { + yyv1 = make([]TestMammoth2, 0) + yyc1 = true + } + } + yyh1.End() + if yyc1 { + *v = yyv1 + } +} + +func (x codecSelfer19781) encArray4int64(v *[4]int64, e *Encoder) { + var h codecSelfer19781 + z, r := GenHelperEncoder(e) + _, _, _ = h, z, r + r.WriteArrayStart(len(v)) + for _, yyv1 := range v { + r.WriteArrayElem() + if false { + } else { + r.EncodeInt(int64(yyv1)) + } + } + r.WriteArrayEnd() +} + +func (x codecSelfer19781) decArray4int64(v *[4]int64, d *Decoder) { + var h codecSelfer19781 + z, r := GenHelperDecoder(d) + _, _, _ = h, z, r + + yyv1 := v + yyh1, yyl1 := z.DecSliceHelperStart() + if yyl1 == 0 { + + } else { + yyhl1 := yyl1 > 0 + var yyrl1 int + _ = yyrl1 + + var yyj1 int + // var yydn1 bool + for yyj1 = 0; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { // bounds-check-elimination + + yyh1.ElemContainerState(yyj1) + + var yydb1 bool + if yyj1 >= len(yyv1) { + z.DecArrayCannotExpand(len(v), yyj1+1) + yydb1 = true + + } + if yydb1 { + z.DecSwallow() + } else { + if r.TryDecodeAsNil() { + yyv1[yyj1] = 0 + } else { + yyv1[yyj1] = (int64)(r.DecodeInt64()) + } + + } + + } + + } + yyh1.End() + +} diff --git a/vendor/github.com/ugorji/go/codec/mammoth2_generated_test.go b/vendor/github.com/ugorji/go/codec/mammoth2_generated_test.go new file mode 100644 index 000000000..e9377c550 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/mammoth2_generated_test.go @@ -0,0 +1,658 @@ +// +build !notfastpath + +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +// Code generated from mammoth2-test.go.tmpl - DO NOT EDIT. + +package codec + +// Increase codecoverage by covering all the codecgen paths, in fast-path and gen-helper.go.... +// +// Add: +// - test file for creating a mammoth generated file as _mammoth_generated.go +// - generate a second mammoth files in a different file: mammoth2_generated_test.go +// - mammoth-test.go.tmpl will do this +// - run codecgen on it, into mammoth2_codecgen_generated_test.go (no build tags) +// - as part of TestMammoth, run it also +// - this will cover all the codecgen, gen-helper, etc in one full run +// - check in mammoth* files into github also +// - then +// +// Now, add some types: +// - some that implement BinaryMarshal, TextMarshal, JSONMarshal, and one that implements none of it +// - create a wrapper type that includes TestMammoth2, with it in slices, and maps, and the custom types +// - this wrapper object is what we work encode/decode (so that the codecgen methods are called) + +// import "encoding/binary" +import "fmt" + +type TestMammoth2 struct { + FIntf interface{} + FptrIntf *interface{} + FString string + FptrString *string + FFloat32 float32 + FptrFloat32 *float32 + FFloat64 float64 + FptrFloat64 *float64 + FUint uint + FptrUint *uint + FUint8 uint8 + FptrUint8 *uint8 + FUint16 uint16 + FptrUint16 *uint16 + FUint32 uint32 + FptrUint32 *uint32 + FUint64 uint64 + FptrUint64 *uint64 + FUintptr uintptr + FptrUintptr *uintptr + FInt int + FptrInt *int + FInt8 int8 + FptrInt8 *int8 + FInt16 int16 + FptrInt16 *int16 + FInt32 int32 + FptrInt32 *int32 + FInt64 int64 + FptrInt64 *int64 + FBool bool + FptrBool *bool + + FSliceIntf []interface{} + FptrSliceIntf *[]interface{} + FSliceString []string + FptrSliceString *[]string + FSliceFloat32 []float32 + FptrSliceFloat32 *[]float32 + FSliceFloat64 []float64 + FptrSliceFloat64 *[]float64 + FSliceUint []uint + FptrSliceUint *[]uint + FSliceUint8 []uint8 + FptrSliceUint8 *[]uint8 + FSliceUint16 []uint16 + FptrSliceUint16 *[]uint16 + FSliceUint32 []uint32 + FptrSliceUint32 *[]uint32 + FSliceUint64 []uint64 + FptrSliceUint64 *[]uint64 + FSliceUintptr []uintptr + FptrSliceUintptr *[]uintptr + FSliceInt []int + FptrSliceInt *[]int + FSliceInt8 []int8 + FptrSliceInt8 *[]int8 + FSliceInt16 []int16 + FptrSliceInt16 *[]int16 + FSliceInt32 []int32 + FptrSliceInt32 *[]int32 + FSliceInt64 []int64 + FptrSliceInt64 *[]int64 + FSliceBool []bool + FptrSliceBool *[]bool + + FMapIntfIntf map[interface{}]interface{} + FptrMapIntfIntf *map[interface{}]interface{} + FMapIntfString map[interface{}]string + FptrMapIntfString *map[interface{}]string + FMapIntfUint map[interface{}]uint + FptrMapIntfUint *map[interface{}]uint + FMapIntfUint8 map[interface{}]uint8 + FptrMapIntfUint8 *map[interface{}]uint8 + FMapIntfUint16 map[interface{}]uint16 + FptrMapIntfUint16 *map[interface{}]uint16 + FMapIntfUint32 map[interface{}]uint32 + FptrMapIntfUint32 *map[interface{}]uint32 + FMapIntfUint64 map[interface{}]uint64 + FptrMapIntfUint64 *map[interface{}]uint64 + FMapIntfUintptr map[interface{}]uintptr + FptrMapIntfUintptr *map[interface{}]uintptr + FMapIntfInt map[interface{}]int + FptrMapIntfInt *map[interface{}]int + FMapIntfInt8 map[interface{}]int8 + FptrMapIntfInt8 *map[interface{}]int8 + FMapIntfInt16 map[interface{}]int16 + FptrMapIntfInt16 *map[interface{}]int16 + FMapIntfInt32 map[interface{}]int32 + FptrMapIntfInt32 *map[interface{}]int32 + FMapIntfInt64 map[interface{}]int64 + FptrMapIntfInt64 *map[interface{}]int64 + FMapIntfFloat32 map[interface{}]float32 + FptrMapIntfFloat32 *map[interface{}]float32 + FMapIntfFloat64 map[interface{}]float64 + FptrMapIntfFloat64 *map[interface{}]float64 + FMapIntfBool map[interface{}]bool + FptrMapIntfBool *map[interface{}]bool + FMapStringIntf map[string]interface{} + FptrMapStringIntf *map[string]interface{} + FMapStringString map[string]string + FptrMapStringString *map[string]string + FMapStringUint map[string]uint + FptrMapStringUint *map[string]uint + FMapStringUint8 map[string]uint8 + FptrMapStringUint8 *map[string]uint8 + FMapStringUint16 map[string]uint16 + FptrMapStringUint16 *map[string]uint16 + FMapStringUint32 map[string]uint32 + FptrMapStringUint32 *map[string]uint32 + FMapStringUint64 map[string]uint64 + FptrMapStringUint64 *map[string]uint64 + FMapStringUintptr map[string]uintptr + FptrMapStringUintptr *map[string]uintptr + FMapStringInt map[string]int + FptrMapStringInt *map[string]int + FMapStringInt8 map[string]int8 + FptrMapStringInt8 *map[string]int8 + FMapStringInt16 map[string]int16 + FptrMapStringInt16 *map[string]int16 + FMapStringInt32 map[string]int32 + FptrMapStringInt32 *map[string]int32 + FMapStringInt64 map[string]int64 + FptrMapStringInt64 *map[string]int64 + FMapStringFloat32 map[string]float32 + FptrMapStringFloat32 *map[string]float32 + FMapStringFloat64 map[string]float64 + FptrMapStringFloat64 *map[string]float64 + FMapStringBool map[string]bool + FptrMapStringBool *map[string]bool + FMapFloat32Intf map[float32]interface{} + FptrMapFloat32Intf *map[float32]interface{} + FMapFloat32String map[float32]string + FptrMapFloat32String *map[float32]string + FMapFloat32Uint map[float32]uint + FptrMapFloat32Uint *map[float32]uint + FMapFloat32Uint8 map[float32]uint8 + FptrMapFloat32Uint8 *map[float32]uint8 + FMapFloat32Uint16 map[float32]uint16 + FptrMapFloat32Uint16 *map[float32]uint16 + FMapFloat32Uint32 map[float32]uint32 + FptrMapFloat32Uint32 *map[float32]uint32 + FMapFloat32Uint64 map[float32]uint64 + FptrMapFloat32Uint64 *map[float32]uint64 + FMapFloat32Uintptr map[float32]uintptr + FptrMapFloat32Uintptr *map[float32]uintptr + FMapFloat32Int map[float32]int + FptrMapFloat32Int *map[float32]int + FMapFloat32Int8 map[float32]int8 + FptrMapFloat32Int8 *map[float32]int8 + FMapFloat32Int16 map[float32]int16 + FptrMapFloat32Int16 *map[float32]int16 + FMapFloat32Int32 map[float32]int32 + FptrMapFloat32Int32 *map[float32]int32 + FMapFloat32Int64 map[float32]int64 + FptrMapFloat32Int64 *map[float32]int64 + FMapFloat32Float32 map[float32]float32 + FptrMapFloat32Float32 *map[float32]float32 + FMapFloat32Float64 map[float32]float64 + FptrMapFloat32Float64 *map[float32]float64 + FMapFloat32Bool map[float32]bool + FptrMapFloat32Bool *map[float32]bool + FMapFloat64Intf map[float64]interface{} + FptrMapFloat64Intf *map[float64]interface{} + FMapFloat64String map[float64]string + FptrMapFloat64String *map[float64]string + FMapFloat64Uint map[float64]uint + FptrMapFloat64Uint *map[float64]uint + FMapFloat64Uint8 map[float64]uint8 + FptrMapFloat64Uint8 *map[float64]uint8 + FMapFloat64Uint16 map[float64]uint16 + FptrMapFloat64Uint16 *map[float64]uint16 + FMapFloat64Uint32 map[float64]uint32 + FptrMapFloat64Uint32 *map[float64]uint32 + FMapFloat64Uint64 map[float64]uint64 + FptrMapFloat64Uint64 *map[float64]uint64 + FMapFloat64Uintptr map[float64]uintptr + FptrMapFloat64Uintptr *map[float64]uintptr + FMapFloat64Int map[float64]int + FptrMapFloat64Int *map[float64]int + FMapFloat64Int8 map[float64]int8 + FptrMapFloat64Int8 *map[float64]int8 + FMapFloat64Int16 map[float64]int16 + FptrMapFloat64Int16 *map[float64]int16 + FMapFloat64Int32 map[float64]int32 + FptrMapFloat64Int32 *map[float64]int32 + FMapFloat64Int64 map[float64]int64 + FptrMapFloat64Int64 *map[float64]int64 + FMapFloat64Float32 map[float64]float32 + FptrMapFloat64Float32 *map[float64]float32 + FMapFloat64Float64 map[float64]float64 + FptrMapFloat64Float64 *map[float64]float64 + FMapFloat64Bool map[float64]bool + FptrMapFloat64Bool *map[float64]bool + FMapUintIntf map[uint]interface{} + FptrMapUintIntf *map[uint]interface{} + FMapUintString map[uint]string + FptrMapUintString *map[uint]string + FMapUintUint map[uint]uint + FptrMapUintUint *map[uint]uint + FMapUintUint8 map[uint]uint8 + FptrMapUintUint8 *map[uint]uint8 + FMapUintUint16 map[uint]uint16 + FptrMapUintUint16 *map[uint]uint16 + FMapUintUint32 map[uint]uint32 + FptrMapUintUint32 *map[uint]uint32 + FMapUintUint64 map[uint]uint64 + FptrMapUintUint64 *map[uint]uint64 + FMapUintUintptr map[uint]uintptr + FptrMapUintUintptr *map[uint]uintptr + FMapUintInt map[uint]int + FptrMapUintInt *map[uint]int + FMapUintInt8 map[uint]int8 + FptrMapUintInt8 *map[uint]int8 + FMapUintInt16 map[uint]int16 + FptrMapUintInt16 *map[uint]int16 + FMapUintInt32 map[uint]int32 + FptrMapUintInt32 *map[uint]int32 + FMapUintInt64 map[uint]int64 + FptrMapUintInt64 *map[uint]int64 + FMapUintFloat32 map[uint]float32 + FptrMapUintFloat32 *map[uint]float32 + FMapUintFloat64 map[uint]float64 + FptrMapUintFloat64 *map[uint]float64 + FMapUintBool map[uint]bool + FptrMapUintBool *map[uint]bool + FMapUint8Intf map[uint8]interface{} + FptrMapUint8Intf *map[uint8]interface{} + FMapUint8String map[uint8]string + FptrMapUint8String *map[uint8]string + FMapUint8Uint map[uint8]uint + FptrMapUint8Uint *map[uint8]uint + FMapUint8Uint8 map[uint8]uint8 + FptrMapUint8Uint8 *map[uint8]uint8 + FMapUint8Uint16 map[uint8]uint16 + FptrMapUint8Uint16 *map[uint8]uint16 + FMapUint8Uint32 map[uint8]uint32 + FptrMapUint8Uint32 *map[uint8]uint32 + FMapUint8Uint64 map[uint8]uint64 + FptrMapUint8Uint64 *map[uint8]uint64 + FMapUint8Uintptr map[uint8]uintptr + FptrMapUint8Uintptr *map[uint8]uintptr + FMapUint8Int map[uint8]int + FptrMapUint8Int *map[uint8]int + FMapUint8Int8 map[uint8]int8 + FptrMapUint8Int8 *map[uint8]int8 + FMapUint8Int16 map[uint8]int16 + FptrMapUint8Int16 *map[uint8]int16 + FMapUint8Int32 map[uint8]int32 + FptrMapUint8Int32 *map[uint8]int32 + FMapUint8Int64 map[uint8]int64 + FptrMapUint8Int64 *map[uint8]int64 + FMapUint8Float32 map[uint8]float32 + FptrMapUint8Float32 *map[uint8]float32 + FMapUint8Float64 map[uint8]float64 + FptrMapUint8Float64 *map[uint8]float64 + FMapUint8Bool map[uint8]bool + FptrMapUint8Bool *map[uint8]bool + FMapUint16Intf map[uint16]interface{} + FptrMapUint16Intf *map[uint16]interface{} + FMapUint16String map[uint16]string + FptrMapUint16String *map[uint16]string + FMapUint16Uint map[uint16]uint + FptrMapUint16Uint *map[uint16]uint + FMapUint16Uint8 map[uint16]uint8 + FptrMapUint16Uint8 *map[uint16]uint8 + FMapUint16Uint16 map[uint16]uint16 + FptrMapUint16Uint16 *map[uint16]uint16 + FMapUint16Uint32 map[uint16]uint32 + FptrMapUint16Uint32 *map[uint16]uint32 + FMapUint16Uint64 map[uint16]uint64 + FptrMapUint16Uint64 *map[uint16]uint64 + FMapUint16Uintptr map[uint16]uintptr + FptrMapUint16Uintptr *map[uint16]uintptr + FMapUint16Int map[uint16]int + FptrMapUint16Int *map[uint16]int + FMapUint16Int8 map[uint16]int8 + FptrMapUint16Int8 *map[uint16]int8 + FMapUint16Int16 map[uint16]int16 + FptrMapUint16Int16 *map[uint16]int16 + FMapUint16Int32 map[uint16]int32 + FptrMapUint16Int32 *map[uint16]int32 + FMapUint16Int64 map[uint16]int64 + FptrMapUint16Int64 *map[uint16]int64 + FMapUint16Float32 map[uint16]float32 + FptrMapUint16Float32 *map[uint16]float32 + FMapUint16Float64 map[uint16]float64 + FptrMapUint16Float64 *map[uint16]float64 + FMapUint16Bool map[uint16]bool + FptrMapUint16Bool *map[uint16]bool + FMapUint32Intf map[uint32]interface{} + FptrMapUint32Intf *map[uint32]interface{} + FMapUint32String map[uint32]string + FptrMapUint32String *map[uint32]string + FMapUint32Uint map[uint32]uint + FptrMapUint32Uint *map[uint32]uint + FMapUint32Uint8 map[uint32]uint8 + FptrMapUint32Uint8 *map[uint32]uint8 + FMapUint32Uint16 map[uint32]uint16 + FptrMapUint32Uint16 *map[uint32]uint16 + FMapUint32Uint32 map[uint32]uint32 + FptrMapUint32Uint32 *map[uint32]uint32 + FMapUint32Uint64 map[uint32]uint64 + FptrMapUint32Uint64 *map[uint32]uint64 + FMapUint32Uintptr map[uint32]uintptr + FptrMapUint32Uintptr *map[uint32]uintptr + FMapUint32Int map[uint32]int + FptrMapUint32Int *map[uint32]int + FMapUint32Int8 map[uint32]int8 + FptrMapUint32Int8 *map[uint32]int8 + FMapUint32Int16 map[uint32]int16 + FptrMapUint32Int16 *map[uint32]int16 + FMapUint32Int32 map[uint32]int32 + FptrMapUint32Int32 *map[uint32]int32 + FMapUint32Int64 map[uint32]int64 + FptrMapUint32Int64 *map[uint32]int64 + FMapUint32Float32 map[uint32]float32 + FptrMapUint32Float32 *map[uint32]float32 + FMapUint32Float64 map[uint32]float64 + FptrMapUint32Float64 *map[uint32]float64 + FMapUint32Bool map[uint32]bool + FptrMapUint32Bool *map[uint32]bool + FMapUint64Intf map[uint64]interface{} + FptrMapUint64Intf *map[uint64]interface{} + FMapUint64String map[uint64]string + FptrMapUint64String *map[uint64]string + FMapUint64Uint map[uint64]uint + FptrMapUint64Uint *map[uint64]uint + FMapUint64Uint8 map[uint64]uint8 + FptrMapUint64Uint8 *map[uint64]uint8 + FMapUint64Uint16 map[uint64]uint16 + FptrMapUint64Uint16 *map[uint64]uint16 + FMapUint64Uint32 map[uint64]uint32 + FptrMapUint64Uint32 *map[uint64]uint32 + FMapUint64Uint64 map[uint64]uint64 + FptrMapUint64Uint64 *map[uint64]uint64 + FMapUint64Uintptr map[uint64]uintptr + FptrMapUint64Uintptr *map[uint64]uintptr + FMapUint64Int map[uint64]int + FptrMapUint64Int *map[uint64]int + FMapUint64Int8 map[uint64]int8 + FptrMapUint64Int8 *map[uint64]int8 + FMapUint64Int16 map[uint64]int16 + FptrMapUint64Int16 *map[uint64]int16 + FMapUint64Int32 map[uint64]int32 + FptrMapUint64Int32 *map[uint64]int32 + FMapUint64Int64 map[uint64]int64 + FptrMapUint64Int64 *map[uint64]int64 + FMapUint64Float32 map[uint64]float32 + FptrMapUint64Float32 *map[uint64]float32 + FMapUint64Float64 map[uint64]float64 + FptrMapUint64Float64 *map[uint64]float64 + FMapUint64Bool map[uint64]bool + FptrMapUint64Bool *map[uint64]bool + FMapUintptrIntf map[uintptr]interface{} + FptrMapUintptrIntf *map[uintptr]interface{} + FMapUintptrString map[uintptr]string + FptrMapUintptrString *map[uintptr]string + FMapUintptrUint map[uintptr]uint + FptrMapUintptrUint *map[uintptr]uint + FMapUintptrUint8 map[uintptr]uint8 + FptrMapUintptrUint8 *map[uintptr]uint8 + FMapUintptrUint16 map[uintptr]uint16 + FptrMapUintptrUint16 *map[uintptr]uint16 + FMapUintptrUint32 map[uintptr]uint32 + FptrMapUintptrUint32 *map[uintptr]uint32 + FMapUintptrUint64 map[uintptr]uint64 + FptrMapUintptrUint64 *map[uintptr]uint64 + FMapUintptrUintptr map[uintptr]uintptr + FptrMapUintptrUintptr *map[uintptr]uintptr + FMapUintptrInt map[uintptr]int + FptrMapUintptrInt *map[uintptr]int + FMapUintptrInt8 map[uintptr]int8 + FptrMapUintptrInt8 *map[uintptr]int8 + FMapUintptrInt16 map[uintptr]int16 + FptrMapUintptrInt16 *map[uintptr]int16 + FMapUintptrInt32 map[uintptr]int32 + FptrMapUintptrInt32 *map[uintptr]int32 + FMapUintptrInt64 map[uintptr]int64 + FptrMapUintptrInt64 *map[uintptr]int64 + FMapUintptrFloat32 map[uintptr]float32 + FptrMapUintptrFloat32 *map[uintptr]float32 + FMapUintptrFloat64 map[uintptr]float64 + FptrMapUintptrFloat64 *map[uintptr]float64 + FMapUintptrBool map[uintptr]bool + FptrMapUintptrBool *map[uintptr]bool + FMapIntIntf map[int]interface{} + FptrMapIntIntf *map[int]interface{} + FMapIntString map[int]string + FptrMapIntString *map[int]string + FMapIntUint map[int]uint + FptrMapIntUint *map[int]uint + FMapIntUint8 map[int]uint8 + FptrMapIntUint8 *map[int]uint8 + FMapIntUint16 map[int]uint16 + FptrMapIntUint16 *map[int]uint16 + FMapIntUint32 map[int]uint32 + FptrMapIntUint32 *map[int]uint32 + FMapIntUint64 map[int]uint64 + FptrMapIntUint64 *map[int]uint64 + FMapIntUintptr map[int]uintptr + FptrMapIntUintptr *map[int]uintptr + FMapIntInt map[int]int + FptrMapIntInt *map[int]int + FMapIntInt8 map[int]int8 + FptrMapIntInt8 *map[int]int8 + FMapIntInt16 map[int]int16 + FptrMapIntInt16 *map[int]int16 + FMapIntInt32 map[int]int32 + FptrMapIntInt32 *map[int]int32 + FMapIntInt64 map[int]int64 + FptrMapIntInt64 *map[int]int64 + FMapIntFloat32 map[int]float32 + FptrMapIntFloat32 *map[int]float32 + FMapIntFloat64 map[int]float64 + FptrMapIntFloat64 *map[int]float64 + FMapIntBool map[int]bool + FptrMapIntBool *map[int]bool + FMapInt8Intf map[int8]interface{} + FptrMapInt8Intf *map[int8]interface{} + FMapInt8String map[int8]string + FptrMapInt8String *map[int8]string + FMapInt8Uint map[int8]uint + FptrMapInt8Uint *map[int8]uint + FMapInt8Uint8 map[int8]uint8 + FptrMapInt8Uint8 *map[int8]uint8 + FMapInt8Uint16 map[int8]uint16 + FptrMapInt8Uint16 *map[int8]uint16 + FMapInt8Uint32 map[int8]uint32 + FptrMapInt8Uint32 *map[int8]uint32 + FMapInt8Uint64 map[int8]uint64 + FptrMapInt8Uint64 *map[int8]uint64 + FMapInt8Uintptr map[int8]uintptr + FptrMapInt8Uintptr *map[int8]uintptr + FMapInt8Int map[int8]int + FptrMapInt8Int *map[int8]int + FMapInt8Int8 map[int8]int8 + FptrMapInt8Int8 *map[int8]int8 + FMapInt8Int16 map[int8]int16 + FptrMapInt8Int16 *map[int8]int16 + FMapInt8Int32 map[int8]int32 + FptrMapInt8Int32 *map[int8]int32 + FMapInt8Int64 map[int8]int64 + FptrMapInt8Int64 *map[int8]int64 + FMapInt8Float32 map[int8]float32 + FptrMapInt8Float32 *map[int8]float32 + FMapInt8Float64 map[int8]float64 + FptrMapInt8Float64 *map[int8]float64 + FMapInt8Bool map[int8]bool + FptrMapInt8Bool *map[int8]bool + FMapInt16Intf map[int16]interface{} + FptrMapInt16Intf *map[int16]interface{} + FMapInt16String map[int16]string + FptrMapInt16String *map[int16]string + FMapInt16Uint map[int16]uint + FptrMapInt16Uint *map[int16]uint + FMapInt16Uint8 map[int16]uint8 + FptrMapInt16Uint8 *map[int16]uint8 + FMapInt16Uint16 map[int16]uint16 + FptrMapInt16Uint16 *map[int16]uint16 + FMapInt16Uint32 map[int16]uint32 + FptrMapInt16Uint32 *map[int16]uint32 + FMapInt16Uint64 map[int16]uint64 + FptrMapInt16Uint64 *map[int16]uint64 + FMapInt16Uintptr map[int16]uintptr + FptrMapInt16Uintptr *map[int16]uintptr + FMapInt16Int map[int16]int + FptrMapInt16Int *map[int16]int + FMapInt16Int8 map[int16]int8 + FptrMapInt16Int8 *map[int16]int8 + FMapInt16Int16 map[int16]int16 + FptrMapInt16Int16 *map[int16]int16 + FMapInt16Int32 map[int16]int32 + FptrMapInt16Int32 *map[int16]int32 + FMapInt16Int64 map[int16]int64 + FptrMapInt16Int64 *map[int16]int64 + FMapInt16Float32 map[int16]float32 + FptrMapInt16Float32 *map[int16]float32 + FMapInt16Float64 map[int16]float64 + FptrMapInt16Float64 *map[int16]float64 + FMapInt16Bool map[int16]bool + FptrMapInt16Bool *map[int16]bool + FMapInt32Intf map[int32]interface{} + FptrMapInt32Intf *map[int32]interface{} + FMapInt32String map[int32]string + FptrMapInt32String *map[int32]string + FMapInt32Uint map[int32]uint + FptrMapInt32Uint *map[int32]uint + FMapInt32Uint8 map[int32]uint8 + FptrMapInt32Uint8 *map[int32]uint8 + FMapInt32Uint16 map[int32]uint16 + FptrMapInt32Uint16 *map[int32]uint16 + FMapInt32Uint32 map[int32]uint32 + FptrMapInt32Uint32 *map[int32]uint32 + FMapInt32Uint64 map[int32]uint64 + FptrMapInt32Uint64 *map[int32]uint64 + FMapInt32Uintptr map[int32]uintptr + FptrMapInt32Uintptr *map[int32]uintptr + FMapInt32Int map[int32]int + FptrMapInt32Int *map[int32]int + FMapInt32Int8 map[int32]int8 + FptrMapInt32Int8 *map[int32]int8 + FMapInt32Int16 map[int32]int16 + FptrMapInt32Int16 *map[int32]int16 + FMapInt32Int32 map[int32]int32 + FptrMapInt32Int32 *map[int32]int32 + FMapInt32Int64 map[int32]int64 + FptrMapInt32Int64 *map[int32]int64 + FMapInt32Float32 map[int32]float32 + FptrMapInt32Float32 *map[int32]float32 + FMapInt32Float64 map[int32]float64 + FptrMapInt32Float64 *map[int32]float64 + FMapInt32Bool map[int32]bool + FptrMapInt32Bool *map[int32]bool + FMapInt64Intf map[int64]interface{} + FptrMapInt64Intf *map[int64]interface{} + FMapInt64String map[int64]string + FptrMapInt64String *map[int64]string + FMapInt64Uint map[int64]uint + FptrMapInt64Uint *map[int64]uint + FMapInt64Uint8 map[int64]uint8 + FptrMapInt64Uint8 *map[int64]uint8 + FMapInt64Uint16 map[int64]uint16 + FptrMapInt64Uint16 *map[int64]uint16 + FMapInt64Uint32 map[int64]uint32 + FptrMapInt64Uint32 *map[int64]uint32 + FMapInt64Uint64 map[int64]uint64 + FptrMapInt64Uint64 *map[int64]uint64 + FMapInt64Uintptr map[int64]uintptr + FptrMapInt64Uintptr *map[int64]uintptr + FMapInt64Int map[int64]int + FptrMapInt64Int *map[int64]int + FMapInt64Int8 map[int64]int8 + FptrMapInt64Int8 *map[int64]int8 + FMapInt64Int16 map[int64]int16 + FptrMapInt64Int16 *map[int64]int16 + FMapInt64Int32 map[int64]int32 + FptrMapInt64Int32 *map[int64]int32 + FMapInt64Int64 map[int64]int64 + FptrMapInt64Int64 *map[int64]int64 + FMapInt64Float32 map[int64]float32 + FptrMapInt64Float32 *map[int64]float32 + FMapInt64Float64 map[int64]float64 + FptrMapInt64Float64 *map[int64]float64 + FMapInt64Bool map[int64]bool + FptrMapInt64Bool *map[int64]bool + FMapBoolIntf map[bool]interface{} + FptrMapBoolIntf *map[bool]interface{} + FMapBoolString map[bool]string + FptrMapBoolString *map[bool]string + FMapBoolUint map[bool]uint + FptrMapBoolUint *map[bool]uint + FMapBoolUint8 map[bool]uint8 + FptrMapBoolUint8 *map[bool]uint8 + FMapBoolUint16 map[bool]uint16 + FptrMapBoolUint16 *map[bool]uint16 + FMapBoolUint32 map[bool]uint32 + FptrMapBoolUint32 *map[bool]uint32 + FMapBoolUint64 map[bool]uint64 + FptrMapBoolUint64 *map[bool]uint64 + FMapBoolUintptr map[bool]uintptr + FptrMapBoolUintptr *map[bool]uintptr + FMapBoolInt map[bool]int + FptrMapBoolInt *map[bool]int + FMapBoolInt8 map[bool]int8 + FptrMapBoolInt8 *map[bool]int8 + FMapBoolInt16 map[bool]int16 + FptrMapBoolInt16 *map[bool]int16 + FMapBoolInt32 map[bool]int32 + FptrMapBoolInt32 *map[bool]int32 + FMapBoolInt64 map[bool]int64 + FptrMapBoolInt64 *map[bool]int64 + FMapBoolFloat32 map[bool]float32 + FptrMapBoolFloat32 *map[bool]float32 + FMapBoolFloat64 map[bool]float64 + FptrMapBoolFloat64 *map[bool]float64 + FMapBoolBool map[bool]bool + FptrMapBoolBool *map[bool]bool +} + +// ----------- + +type testMammoth2Binary uint64 + +func (x testMammoth2Binary) MarshalBinary() (data []byte, err error) { + data = make([]byte, 8) + bigen.PutUint64(data, uint64(x)) + return +} +func (x *testMammoth2Binary) UnmarshalBinary(data []byte) (err error) { + *x = testMammoth2Binary(bigen.Uint64(data)) + return +} + +type testMammoth2Text uint64 + +func (x testMammoth2Text) MarshalText() (data []byte, err error) { + data = []byte(fmt.Sprintf("%b", uint64(x))) + return +} +func (x *testMammoth2Text) UnmarshalText(data []byte) (err error) { + _, err = fmt.Sscanf(string(data), "%b", (*uint64)(x)) + return +} + +type testMammoth2Json uint64 + +func (x testMammoth2Json) MarshalJSON() (data []byte, err error) { + data = []byte(fmt.Sprintf("%v", uint64(x))) + return +} +func (x *testMammoth2Json) UnmarshalJSON(data []byte) (err error) { + _, err = fmt.Sscanf(string(data), "%v", (*uint64)(x)) + return +} + +type testMammoth2Basic [4]uint64 + +type TestMammoth2Wrapper struct { + V TestMammoth2 + T testMammoth2Text + B testMammoth2Binary + J testMammoth2Json + C testMammoth2Basic + M map[testMammoth2Basic]TestMammoth2 + L []TestMammoth2 + A [4]int64 +} diff --git a/vendor/github.com/ugorji/go/codec/mammoth_generated_test.go b/vendor/github.com/ugorji/go/codec/mammoth_generated_test.go new file mode 100644 index 000000000..516a410e5 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/mammoth_generated_test.go @@ -0,0 +1,13188 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +// Code generated from mammoth-test.go.tmpl - DO NOT EDIT. + +package codec + +import "testing" +import "fmt" +import "reflect" + +// TestMammoth has all the different paths optimized in fast-path +// It has all the primitives, slices and maps. +// +// For each of those types, it has a pointer and a non-pointer field. + +func init() { _ = fmt.Printf } // so we can include fmt as needed + +type TestMammoth struct { + FIntf interface{} + FptrIntf *interface{} + FString string + FptrString *string + FFloat32 float32 + FptrFloat32 *float32 + FFloat64 float64 + FptrFloat64 *float64 + FUint uint + FptrUint *uint + FUint8 uint8 + FptrUint8 *uint8 + FUint16 uint16 + FptrUint16 *uint16 + FUint32 uint32 + FptrUint32 *uint32 + FUint64 uint64 + FptrUint64 *uint64 + FUintptr uintptr + FptrUintptr *uintptr + FInt int + FptrInt *int + FInt8 int8 + FptrInt8 *int8 + FInt16 int16 + FptrInt16 *int16 + FInt32 int32 + FptrInt32 *int32 + FInt64 int64 + FptrInt64 *int64 + FBool bool + FptrBool *bool + + FSliceIntf []interface{} + FptrSliceIntf *[]interface{} + FSliceString []string + FptrSliceString *[]string + FSliceFloat32 []float32 + FptrSliceFloat32 *[]float32 + FSliceFloat64 []float64 + FptrSliceFloat64 *[]float64 + FSliceUint []uint + FptrSliceUint *[]uint + FSliceUint8 []uint8 + FptrSliceUint8 *[]uint8 + FSliceUint16 []uint16 + FptrSliceUint16 *[]uint16 + FSliceUint32 []uint32 + FptrSliceUint32 *[]uint32 + FSliceUint64 []uint64 + FptrSliceUint64 *[]uint64 + FSliceUintptr []uintptr + FptrSliceUintptr *[]uintptr + FSliceInt []int + FptrSliceInt *[]int + FSliceInt8 []int8 + FptrSliceInt8 *[]int8 + FSliceInt16 []int16 + FptrSliceInt16 *[]int16 + FSliceInt32 []int32 + FptrSliceInt32 *[]int32 + FSliceInt64 []int64 + FptrSliceInt64 *[]int64 + FSliceBool []bool + FptrSliceBool *[]bool + + FMapIntfIntf map[interface{}]interface{} + FptrMapIntfIntf *map[interface{}]interface{} + FMapIntfString map[interface{}]string + FptrMapIntfString *map[interface{}]string + FMapIntfUint map[interface{}]uint + FptrMapIntfUint *map[interface{}]uint + FMapIntfUint8 map[interface{}]uint8 + FptrMapIntfUint8 *map[interface{}]uint8 + FMapIntfUint16 map[interface{}]uint16 + FptrMapIntfUint16 *map[interface{}]uint16 + FMapIntfUint32 map[interface{}]uint32 + FptrMapIntfUint32 *map[interface{}]uint32 + FMapIntfUint64 map[interface{}]uint64 + FptrMapIntfUint64 *map[interface{}]uint64 + FMapIntfUintptr map[interface{}]uintptr + FptrMapIntfUintptr *map[interface{}]uintptr + FMapIntfInt map[interface{}]int + FptrMapIntfInt *map[interface{}]int + FMapIntfInt8 map[interface{}]int8 + FptrMapIntfInt8 *map[interface{}]int8 + FMapIntfInt16 map[interface{}]int16 + FptrMapIntfInt16 *map[interface{}]int16 + FMapIntfInt32 map[interface{}]int32 + FptrMapIntfInt32 *map[interface{}]int32 + FMapIntfInt64 map[interface{}]int64 + FptrMapIntfInt64 *map[interface{}]int64 + FMapIntfFloat32 map[interface{}]float32 + FptrMapIntfFloat32 *map[interface{}]float32 + FMapIntfFloat64 map[interface{}]float64 + FptrMapIntfFloat64 *map[interface{}]float64 + FMapIntfBool map[interface{}]bool + FptrMapIntfBool *map[interface{}]bool + FMapStringIntf map[string]interface{} + FptrMapStringIntf *map[string]interface{} + FMapStringString map[string]string + FptrMapStringString *map[string]string + FMapStringUint map[string]uint + FptrMapStringUint *map[string]uint + FMapStringUint8 map[string]uint8 + FptrMapStringUint8 *map[string]uint8 + FMapStringUint16 map[string]uint16 + FptrMapStringUint16 *map[string]uint16 + FMapStringUint32 map[string]uint32 + FptrMapStringUint32 *map[string]uint32 + FMapStringUint64 map[string]uint64 + FptrMapStringUint64 *map[string]uint64 + FMapStringUintptr map[string]uintptr + FptrMapStringUintptr *map[string]uintptr + FMapStringInt map[string]int + FptrMapStringInt *map[string]int + FMapStringInt8 map[string]int8 + FptrMapStringInt8 *map[string]int8 + FMapStringInt16 map[string]int16 + FptrMapStringInt16 *map[string]int16 + FMapStringInt32 map[string]int32 + FptrMapStringInt32 *map[string]int32 + FMapStringInt64 map[string]int64 + FptrMapStringInt64 *map[string]int64 + FMapStringFloat32 map[string]float32 + FptrMapStringFloat32 *map[string]float32 + FMapStringFloat64 map[string]float64 + FptrMapStringFloat64 *map[string]float64 + FMapStringBool map[string]bool + FptrMapStringBool *map[string]bool + FMapFloat32Intf map[float32]interface{} + FptrMapFloat32Intf *map[float32]interface{} + FMapFloat32String map[float32]string + FptrMapFloat32String *map[float32]string + FMapFloat32Uint map[float32]uint + FptrMapFloat32Uint *map[float32]uint + FMapFloat32Uint8 map[float32]uint8 + FptrMapFloat32Uint8 *map[float32]uint8 + FMapFloat32Uint16 map[float32]uint16 + FptrMapFloat32Uint16 *map[float32]uint16 + FMapFloat32Uint32 map[float32]uint32 + FptrMapFloat32Uint32 *map[float32]uint32 + FMapFloat32Uint64 map[float32]uint64 + FptrMapFloat32Uint64 *map[float32]uint64 + FMapFloat32Uintptr map[float32]uintptr + FptrMapFloat32Uintptr *map[float32]uintptr + FMapFloat32Int map[float32]int + FptrMapFloat32Int *map[float32]int + FMapFloat32Int8 map[float32]int8 + FptrMapFloat32Int8 *map[float32]int8 + FMapFloat32Int16 map[float32]int16 + FptrMapFloat32Int16 *map[float32]int16 + FMapFloat32Int32 map[float32]int32 + FptrMapFloat32Int32 *map[float32]int32 + FMapFloat32Int64 map[float32]int64 + FptrMapFloat32Int64 *map[float32]int64 + FMapFloat32Float32 map[float32]float32 + FptrMapFloat32Float32 *map[float32]float32 + FMapFloat32Float64 map[float32]float64 + FptrMapFloat32Float64 *map[float32]float64 + FMapFloat32Bool map[float32]bool + FptrMapFloat32Bool *map[float32]bool + FMapFloat64Intf map[float64]interface{} + FptrMapFloat64Intf *map[float64]interface{} + FMapFloat64String map[float64]string + FptrMapFloat64String *map[float64]string + FMapFloat64Uint map[float64]uint + FptrMapFloat64Uint *map[float64]uint + FMapFloat64Uint8 map[float64]uint8 + FptrMapFloat64Uint8 *map[float64]uint8 + FMapFloat64Uint16 map[float64]uint16 + FptrMapFloat64Uint16 *map[float64]uint16 + FMapFloat64Uint32 map[float64]uint32 + FptrMapFloat64Uint32 *map[float64]uint32 + FMapFloat64Uint64 map[float64]uint64 + FptrMapFloat64Uint64 *map[float64]uint64 + FMapFloat64Uintptr map[float64]uintptr + FptrMapFloat64Uintptr *map[float64]uintptr + FMapFloat64Int map[float64]int + FptrMapFloat64Int *map[float64]int + FMapFloat64Int8 map[float64]int8 + FptrMapFloat64Int8 *map[float64]int8 + FMapFloat64Int16 map[float64]int16 + FptrMapFloat64Int16 *map[float64]int16 + FMapFloat64Int32 map[float64]int32 + FptrMapFloat64Int32 *map[float64]int32 + FMapFloat64Int64 map[float64]int64 + FptrMapFloat64Int64 *map[float64]int64 + FMapFloat64Float32 map[float64]float32 + FptrMapFloat64Float32 *map[float64]float32 + FMapFloat64Float64 map[float64]float64 + FptrMapFloat64Float64 *map[float64]float64 + FMapFloat64Bool map[float64]bool + FptrMapFloat64Bool *map[float64]bool + FMapUintIntf map[uint]interface{} + FptrMapUintIntf *map[uint]interface{} + FMapUintString map[uint]string + FptrMapUintString *map[uint]string + FMapUintUint map[uint]uint + FptrMapUintUint *map[uint]uint + FMapUintUint8 map[uint]uint8 + FptrMapUintUint8 *map[uint]uint8 + FMapUintUint16 map[uint]uint16 + FptrMapUintUint16 *map[uint]uint16 + FMapUintUint32 map[uint]uint32 + FptrMapUintUint32 *map[uint]uint32 + FMapUintUint64 map[uint]uint64 + FptrMapUintUint64 *map[uint]uint64 + FMapUintUintptr map[uint]uintptr + FptrMapUintUintptr *map[uint]uintptr + FMapUintInt map[uint]int + FptrMapUintInt *map[uint]int + FMapUintInt8 map[uint]int8 + FptrMapUintInt8 *map[uint]int8 + FMapUintInt16 map[uint]int16 + FptrMapUintInt16 *map[uint]int16 + FMapUintInt32 map[uint]int32 + FptrMapUintInt32 *map[uint]int32 + FMapUintInt64 map[uint]int64 + FptrMapUintInt64 *map[uint]int64 + FMapUintFloat32 map[uint]float32 + FptrMapUintFloat32 *map[uint]float32 + FMapUintFloat64 map[uint]float64 + FptrMapUintFloat64 *map[uint]float64 + FMapUintBool map[uint]bool + FptrMapUintBool *map[uint]bool + FMapUint8Intf map[uint8]interface{} + FptrMapUint8Intf *map[uint8]interface{} + FMapUint8String map[uint8]string + FptrMapUint8String *map[uint8]string + FMapUint8Uint map[uint8]uint + FptrMapUint8Uint *map[uint8]uint + FMapUint8Uint8 map[uint8]uint8 + FptrMapUint8Uint8 *map[uint8]uint8 + FMapUint8Uint16 map[uint8]uint16 + FptrMapUint8Uint16 *map[uint8]uint16 + FMapUint8Uint32 map[uint8]uint32 + FptrMapUint8Uint32 *map[uint8]uint32 + FMapUint8Uint64 map[uint8]uint64 + FptrMapUint8Uint64 *map[uint8]uint64 + FMapUint8Uintptr map[uint8]uintptr + FptrMapUint8Uintptr *map[uint8]uintptr + FMapUint8Int map[uint8]int + FptrMapUint8Int *map[uint8]int + FMapUint8Int8 map[uint8]int8 + FptrMapUint8Int8 *map[uint8]int8 + FMapUint8Int16 map[uint8]int16 + FptrMapUint8Int16 *map[uint8]int16 + FMapUint8Int32 map[uint8]int32 + FptrMapUint8Int32 *map[uint8]int32 + FMapUint8Int64 map[uint8]int64 + FptrMapUint8Int64 *map[uint8]int64 + FMapUint8Float32 map[uint8]float32 + FptrMapUint8Float32 *map[uint8]float32 + FMapUint8Float64 map[uint8]float64 + FptrMapUint8Float64 *map[uint8]float64 + FMapUint8Bool map[uint8]bool + FptrMapUint8Bool *map[uint8]bool + FMapUint16Intf map[uint16]interface{} + FptrMapUint16Intf *map[uint16]interface{} + FMapUint16String map[uint16]string + FptrMapUint16String *map[uint16]string + FMapUint16Uint map[uint16]uint + FptrMapUint16Uint *map[uint16]uint + FMapUint16Uint8 map[uint16]uint8 + FptrMapUint16Uint8 *map[uint16]uint8 + FMapUint16Uint16 map[uint16]uint16 + FptrMapUint16Uint16 *map[uint16]uint16 + FMapUint16Uint32 map[uint16]uint32 + FptrMapUint16Uint32 *map[uint16]uint32 + FMapUint16Uint64 map[uint16]uint64 + FptrMapUint16Uint64 *map[uint16]uint64 + FMapUint16Uintptr map[uint16]uintptr + FptrMapUint16Uintptr *map[uint16]uintptr + FMapUint16Int map[uint16]int + FptrMapUint16Int *map[uint16]int + FMapUint16Int8 map[uint16]int8 + FptrMapUint16Int8 *map[uint16]int8 + FMapUint16Int16 map[uint16]int16 + FptrMapUint16Int16 *map[uint16]int16 + FMapUint16Int32 map[uint16]int32 + FptrMapUint16Int32 *map[uint16]int32 + FMapUint16Int64 map[uint16]int64 + FptrMapUint16Int64 *map[uint16]int64 + FMapUint16Float32 map[uint16]float32 + FptrMapUint16Float32 *map[uint16]float32 + FMapUint16Float64 map[uint16]float64 + FptrMapUint16Float64 *map[uint16]float64 + FMapUint16Bool map[uint16]bool + FptrMapUint16Bool *map[uint16]bool + FMapUint32Intf map[uint32]interface{} + FptrMapUint32Intf *map[uint32]interface{} + FMapUint32String map[uint32]string + FptrMapUint32String *map[uint32]string + FMapUint32Uint map[uint32]uint + FptrMapUint32Uint *map[uint32]uint + FMapUint32Uint8 map[uint32]uint8 + FptrMapUint32Uint8 *map[uint32]uint8 + FMapUint32Uint16 map[uint32]uint16 + FptrMapUint32Uint16 *map[uint32]uint16 + FMapUint32Uint32 map[uint32]uint32 + FptrMapUint32Uint32 *map[uint32]uint32 + FMapUint32Uint64 map[uint32]uint64 + FptrMapUint32Uint64 *map[uint32]uint64 + FMapUint32Uintptr map[uint32]uintptr + FptrMapUint32Uintptr *map[uint32]uintptr + FMapUint32Int map[uint32]int + FptrMapUint32Int *map[uint32]int + FMapUint32Int8 map[uint32]int8 + FptrMapUint32Int8 *map[uint32]int8 + FMapUint32Int16 map[uint32]int16 + FptrMapUint32Int16 *map[uint32]int16 + FMapUint32Int32 map[uint32]int32 + FptrMapUint32Int32 *map[uint32]int32 + FMapUint32Int64 map[uint32]int64 + FptrMapUint32Int64 *map[uint32]int64 + FMapUint32Float32 map[uint32]float32 + FptrMapUint32Float32 *map[uint32]float32 + FMapUint32Float64 map[uint32]float64 + FptrMapUint32Float64 *map[uint32]float64 + FMapUint32Bool map[uint32]bool + FptrMapUint32Bool *map[uint32]bool + FMapUint64Intf map[uint64]interface{} + FptrMapUint64Intf *map[uint64]interface{} + FMapUint64String map[uint64]string + FptrMapUint64String *map[uint64]string + FMapUint64Uint map[uint64]uint + FptrMapUint64Uint *map[uint64]uint + FMapUint64Uint8 map[uint64]uint8 + FptrMapUint64Uint8 *map[uint64]uint8 + FMapUint64Uint16 map[uint64]uint16 + FptrMapUint64Uint16 *map[uint64]uint16 + FMapUint64Uint32 map[uint64]uint32 + FptrMapUint64Uint32 *map[uint64]uint32 + FMapUint64Uint64 map[uint64]uint64 + FptrMapUint64Uint64 *map[uint64]uint64 + FMapUint64Uintptr map[uint64]uintptr + FptrMapUint64Uintptr *map[uint64]uintptr + FMapUint64Int map[uint64]int + FptrMapUint64Int *map[uint64]int + FMapUint64Int8 map[uint64]int8 + FptrMapUint64Int8 *map[uint64]int8 + FMapUint64Int16 map[uint64]int16 + FptrMapUint64Int16 *map[uint64]int16 + FMapUint64Int32 map[uint64]int32 + FptrMapUint64Int32 *map[uint64]int32 + FMapUint64Int64 map[uint64]int64 + FptrMapUint64Int64 *map[uint64]int64 + FMapUint64Float32 map[uint64]float32 + FptrMapUint64Float32 *map[uint64]float32 + FMapUint64Float64 map[uint64]float64 + FptrMapUint64Float64 *map[uint64]float64 + FMapUint64Bool map[uint64]bool + FptrMapUint64Bool *map[uint64]bool + FMapUintptrIntf map[uintptr]interface{} + FptrMapUintptrIntf *map[uintptr]interface{} + FMapUintptrString map[uintptr]string + FptrMapUintptrString *map[uintptr]string + FMapUintptrUint map[uintptr]uint + FptrMapUintptrUint *map[uintptr]uint + FMapUintptrUint8 map[uintptr]uint8 + FptrMapUintptrUint8 *map[uintptr]uint8 + FMapUintptrUint16 map[uintptr]uint16 + FptrMapUintptrUint16 *map[uintptr]uint16 + FMapUintptrUint32 map[uintptr]uint32 + FptrMapUintptrUint32 *map[uintptr]uint32 + FMapUintptrUint64 map[uintptr]uint64 + FptrMapUintptrUint64 *map[uintptr]uint64 + FMapUintptrUintptr map[uintptr]uintptr + FptrMapUintptrUintptr *map[uintptr]uintptr + FMapUintptrInt map[uintptr]int + FptrMapUintptrInt *map[uintptr]int + FMapUintptrInt8 map[uintptr]int8 + FptrMapUintptrInt8 *map[uintptr]int8 + FMapUintptrInt16 map[uintptr]int16 + FptrMapUintptrInt16 *map[uintptr]int16 + FMapUintptrInt32 map[uintptr]int32 + FptrMapUintptrInt32 *map[uintptr]int32 + FMapUintptrInt64 map[uintptr]int64 + FptrMapUintptrInt64 *map[uintptr]int64 + FMapUintptrFloat32 map[uintptr]float32 + FptrMapUintptrFloat32 *map[uintptr]float32 + FMapUintptrFloat64 map[uintptr]float64 + FptrMapUintptrFloat64 *map[uintptr]float64 + FMapUintptrBool map[uintptr]bool + FptrMapUintptrBool *map[uintptr]bool + FMapIntIntf map[int]interface{} + FptrMapIntIntf *map[int]interface{} + FMapIntString map[int]string + FptrMapIntString *map[int]string + FMapIntUint map[int]uint + FptrMapIntUint *map[int]uint + FMapIntUint8 map[int]uint8 + FptrMapIntUint8 *map[int]uint8 + FMapIntUint16 map[int]uint16 + FptrMapIntUint16 *map[int]uint16 + FMapIntUint32 map[int]uint32 + FptrMapIntUint32 *map[int]uint32 + FMapIntUint64 map[int]uint64 + FptrMapIntUint64 *map[int]uint64 + FMapIntUintptr map[int]uintptr + FptrMapIntUintptr *map[int]uintptr + FMapIntInt map[int]int + FptrMapIntInt *map[int]int + FMapIntInt8 map[int]int8 + FptrMapIntInt8 *map[int]int8 + FMapIntInt16 map[int]int16 + FptrMapIntInt16 *map[int]int16 + FMapIntInt32 map[int]int32 + FptrMapIntInt32 *map[int]int32 + FMapIntInt64 map[int]int64 + FptrMapIntInt64 *map[int]int64 + FMapIntFloat32 map[int]float32 + FptrMapIntFloat32 *map[int]float32 + FMapIntFloat64 map[int]float64 + FptrMapIntFloat64 *map[int]float64 + FMapIntBool map[int]bool + FptrMapIntBool *map[int]bool + FMapInt8Intf map[int8]interface{} + FptrMapInt8Intf *map[int8]interface{} + FMapInt8String map[int8]string + FptrMapInt8String *map[int8]string + FMapInt8Uint map[int8]uint + FptrMapInt8Uint *map[int8]uint + FMapInt8Uint8 map[int8]uint8 + FptrMapInt8Uint8 *map[int8]uint8 + FMapInt8Uint16 map[int8]uint16 + FptrMapInt8Uint16 *map[int8]uint16 + FMapInt8Uint32 map[int8]uint32 + FptrMapInt8Uint32 *map[int8]uint32 + FMapInt8Uint64 map[int8]uint64 + FptrMapInt8Uint64 *map[int8]uint64 + FMapInt8Uintptr map[int8]uintptr + FptrMapInt8Uintptr *map[int8]uintptr + FMapInt8Int map[int8]int + FptrMapInt8Int *map[int8]int + FMapInt8Int8 map[int8]int8 + FptrMapInt8Int8 *map[int8]int8 + FMapInt8Int16 map[int8]int16 + FptrMapInt8Int16 *map[int8]int16 + FMapInt8Int32 map[int8]int32 + FptrMapInt8Int32 *map[int8]int32 + FMapInt8Int64 map[int8]int64 + FptrMapInt8Int64 *map[int8]int64 + FMapInt8Float32 map[int8]float32 + FptrMapInt8Float32 *map[int8]float32 + FMapInt8Float64 map[int8]float64 + FptrMapInt8Float64 *map[int8]float64 + FMapInt8Bool map[int8]bool + FptrMapInt8Bool *map[int8]bool + FMapInt16Intf map[int16]interface{} + FptrMapInt16Intf *map[int16]interface{} + FMapInt16String map[int16]string + FptrMapInt16String *map[int16]string + FMapInt16Uint map[int16]uint + FptrMapInt16Uint *map[int16]uint + FMapInt16Uint8 map[int16]uint8 + FptrMapInt16Uint8 *map[int16]uint8 + FMapInt16Uint16 map[int16]uint16 + FptrMapInt16Uint16 *map[int16]uint16 + FMapInt16Uint32 map[int16]uint32 + FptrMapInt16Uint32 *map[int16]uint32 + FMapInt16Uint64 map[int16]uint64 + FptrMapInt16Uint64 *map[int16]uint64 + FMapInt16Uintptr map[int16]uintptr + FptrMapInt16Uintptr *map[int16]uintptr + FMapInt16Int map[int16]int + FptrMapInt16Int *map[int16]int + FMapInt16Int8 map[int16]int8 + FptrMapInt16Int8 *map[int16]int8 + FMapInt16Int16 map[int16]int16 + FptrMapInt16Int16 *map[int16]int16 + FMapInt16Int32 map[int16]int32 + FptrMapInt16Int32 *map[int16]int32 + FMapInt16Int64 map[int16]int64 + FptrMapInt16Int64 *map[int16]int64 + FMapInt16Float32 map[int16]float32 + FptrMapInt16Float32 *map[int16]float32 + FMapInt16Float64 map[int16]float64 + FptrMapInt16Float64 *map[int16]float64 + FMapInt16Bool map[int16]bool + FptrMapInt16Bool *map[int16]bool + FMapInt32Intf map[int32]interface{} + FptrMapInt32Intf *map[int32]interface{} + FMapInt32String map[int32]string + FptrMapInt32String *map[int32]string + FMapInt32Uint map[int32]uint + FptrMapInt32Uint *map[int32]uint + FMapInt32Uint8 map[int32]uint8 + FptrMapInt32Uint8 *map[int32]uint8 + FMapInt32Uint16 map[int32]uint16 + FptrMapInt32Uint16 *map[int32]uint16 + FMapInt32Uint32 map[int32]uint32 + FptrMapInt32Uint32 *map[int32]uint32 + FMapInt32Uint64 map[int32]uint64 + FptrMapInt32Uint64 *map[int32]uint64 + FMapInt32Uintptr map[int32]uintptr + FptrMapInt32Uintptr *map[int32]uintptr + FMapInt32Int map[int32]int + FptrMapInt32Int *map[int32]int + FMapInt32Int8 map[int32]int8 + FptrMapInt32Int8 *map[int32]int8 + FMapInt32Int16 map[int32]int16 + FptrMapInt32Int16 *map[int32]int16 + FMapInt32Int32 map[int32]int32 + FptrMapInt32Int32 *map[int32]int32 + FMapInt32Int64 map[int32]int64 + FptrMapInt32Int64 *map[int32]int64 + FMapInt32Float32 map[int32]float32 + FptrMapInt32Float32 *map[int32]float32 + FMapInt32Float64 map[int32]float64 + FptrMapInt32Float64 *map[int32]float64 + FMapInt32Bool map[int32]bool + FptrMapInt32Bool *map[int32]bool + FMapInt64Intf map[int64]interface{} + FptrMapInt64Intf *map[int64]interface{} + FMapInt64String map[int64]string + FptrMapInt64String *map[int64]string + FMapInt64Uint map[int64]uint + FptrMapInt64Uint *map[int64]uint + FMapInt64Uint8 map[int64]uint8 + FptrMapInt64Uint8 *map[int64]uint8 + FMapInt64Uint16 map[int64]uint16 + FptrMapInt64Uint16 *map[int64]uint16 + FMapInt64Uint32 map[int64]uint32 + FptrMapInt64Uint32 *map[int64]uint32 + FMapInt64Uint64 map[int64]uint64 + FptrMapInt64Uint64 *map[int64]uint64 + FMapInt64Uintptr map[int64]uintptr + FptrMapInt64Uintptr *map[int64]uintptr + FMapInt64Int map[int64]int + FptrMapInt64Int *map[int64]int + FMapInt64Int8 map[int64]int8 + FptrMapInt64Int8 *map[int64]int8 + FMapInt64Int16 map[int64]int16 + FptrMapInt64Int16 *map[int64]int16 + FMapInt64Int32 map[int64]int32 + FptrMapInt64Int32 *map[int64]int32 + FMapInt64Int64 map[int64]int64 + FptrMapInt64Int64 *map[int64]int64 + FMapInt64Float32 map[int64]float32 + FptrMapInt64Float32 *map[int64]float32 + FMapInt64Float64 map[int64]float64 + FptrMapInt64Float64 *map[int64]float64 + FMapInt64Bool map[int64]bool + FptrMapInt64Bool *map[int64]bool + FMapBoolIntf map[bool]interface{} + FptrMapBoolIntf *map[bool]interface{} + FMapBoolString map[bool]string + FptrMapBoolString *map[bool]string + FMapBoolUint map[bool]uint + FptrMapBoolUint *map[bool]uint + FMapBoolUint8 map[bool]uint8 + FptrMapBoolUint8 *map[bool]uint8 + FMapBoolUint16 map[bool]uint16 + FptrMapBoolUint16 *map[bool]uint16 + FMapBoolUint32 map[bool]uint32 + FptrMapBoolUint32 *map[bool]uint32 + FMapBoolUint64 map[bool]uint64 + FptrMapBoolUint64 *map[bool]uint64 + FMapBoolUintptr map[bool]uintptr + FptrMapBoolUintptr *map[bool]uintptr + FMapBoolInt map[bool]int + FptrMapBoolInt *map[bool]int + FMapBoolInt8 map[bool]int8 + FptrMapBoolInt8 *map[bool]int8 + FMapBoolInt16 map[bool]int16 + FptrMapBoolInt16 *map[bool]int16 + FMapBoolInt32 map[bool]int32 + FptrMapBoolInt32 *map[bool]int32 + FMapBoolInt64 map[bool]int64 + FptrMapBoolInt64 *map[bool]int64 + FMapBoolFloat32 map[bool]float32 + FptrMapBoolFloat32 *map[bool]float32 + FMapBoolFloat64 map[bool]float64 + FptrMapBoolFloat64 *map[bool]float64 + FMapBoolBool map[bool]bool + FptrMapBoolBool *map[bool]bool +} + +type typMbsSliceIntf []interface{} + +func (_ typMbsSliceIntf) MapBySlice() {} + +type typMbsSliceString []string + +func (_ typMbsSliceString) MapBySlice() {} + +type typMbsSliceFloat32 []float32 + +func (_ typMbsSliceFloat32) MapBySlice() {} + +type typMbsSliceFloat64 []float64 + +func (_ typMbsSliceFloat64) MapBySlice() {} + +type typMbsSliceUint []uint + +func (_ typMbsSliceUint) MapBySlice() {} + +type typMbsSliceUint8 []uint8 + +func (_ typMbsSliceUint8) MapBySlice() {} + +type typMbsSliceUint16 []uint16 + +func (_ typMbsSliceUint16) MapBySlice() {} + +type typMbsSliceUint32 []uint32 + +func (_ typMbsSliceUint32) MapBySlice() {} + +type typMbsSliceUint64 []uint64 + +func (_ typMbsSliceUint64) MapBySlice() {} + +type typMbsSliceUintptr []uintptr + +func (_ typMbsSliceUintptr) MapBySlice() {} + +type typMbsSliceInt []int + +func (_ typMbsSliceInt) MapBySlice() {} + +type typMbsSliceInt8 []int8 + +func (_ typMbsSliceInt8) MapBySlice() {} + +type typMbsSliceInt16 []int16 + +func (_ typMbsSliceInt16) MapBySlice() {} + +type typMbsSliceInt32 []int32 + +func (_ typMbsSliceInt32) MapBySlice() {} + +type typMbsSliceInt64 []int64 + +func (_ typMbsSliceInt64) MapBySlice() {} + +type typMbsSliceBool []bool + +func (_ typMbsSliceBool) MapBySlice() {} + +type typMapMapIntfIntf map[interface{}]interface{} +type typMapMapIntfString map[interface{}]string +type typMapMapIntfUint map[interface{}]uint +type typMapMapIntfUint8 map[interface{}]uint8 +type typMapMapIntfUint16 map[interface{}]uint16 +type typMapMapIntfUint32 map[interface{}]uint32 +type typMapMapIntfUint64 map[interface{}]uint64 +type typMapMapIntfUintptr map[interface{}]uintptr +type typMapMapIntfInt map[interface{}]int +type typMapMapIntfInt8 map[interface{}]int8 +type typMapMapIntfInt16 map[interface{}]int16 +type typMapMapIntfInt32 map[interface{}]int32 +type typMapMapIntfInt64 map[interface{}]int64 +type typMapMapIntfFloat32 map[interface{}]float32 +type typMapMapIntfFloat64 map[interface{}]float64 +type typMapMapIntfBool map[interface{}]bool +type typMapMapStringIntf map[string]interface{} +type typMapMapStringString map[string]string +type typMapMapStringUint map[string]uint +type typMapMapStringUint8 map[string]uint8 +type typMapMapStringUint16 map[string]uint16 +type typMapMapStringUint32 map[string]uint32 +type typMapMapStringUint64 map[string]uint64 +type typMapMapStringUintptr map[string]uintptr +type typMapMapStringInt map[string]int +type typMapMapStringInt8 map[string]int8 +type typMapMapStringInt16 map[string]int16 +type typMapMapStringInt32 map[string]int32 +type typMapMapStringInt64 map[string]int64 +type typMapMapStringFloat32 map[string]float32 +type typMapMapStringFloat64 map[string]float64 +type typMapMapStringBool map[string]bool +type typMapMapFloat32Intf map[float32]interface{} +type typMapMapFloat32String map[float32]string +type typMapMapFloat32Uint map[float32]uint +type typMapMapFloat32Uint8 map[float32]uint8 +type typMapMapFloat32Uint16 map[float32]uint16 +type typMapMapFloat32Uint32 map[float32]uint32 +type typMapMapFloat32Uint64 map[float32]uint64 +type typMapMapFloat32Uintptr map[float32]uintptr +type typMapMapFloat32Int map[float32]int +type typMapMapFloat32Int8 map[float32]int8 +type typMapMapFloat32Int16 map[float32]int16 +type typMapMapFloat32Int32 map[float32]int32 +type typMapMapFloat32Int64 map[float32]int64 +type typMapMapFloat32Float32 map[float32]float32 +type typMapMapFloat32Float64 map[float32]float64 +type typMapMapFloat32Bool map[float32]bool +type typMapMapFloat64Intf map[float64]interface{} +type typMapMapFloat64String map[float64]string +type typMapMapFloat64Uint map[float64]uint +type typMapMapFloat64Uint8 map[float64]uint8 +type typMapMapFloat64Uint16 map[float64]uint16 +type typMapMapFloat64Uint32 map[float64]uint32 +type typMapMapFloat64Uint64 map[float64]uint64 +type typMapMapFloat64Uintptr map[float64]uintptr +type typMapMapFloat64Int map[float64]int +type typMapMapFloat64Int8 map[float64]int8 +type typMapMapFloat64Int16 map[float64]int16 +type typMapMapFloat64Int32 map[float64]int32 +type typMapMapFloat64Int64 map[float64]int64 +type typMapMapFloat64Float32 map[float64]float32 +type typMapMapFloat64Float64 map[float64]float64 +type typMapMapFloat64Bool map[float64]bool +type typMapMapUintIntf map[uint]interface{} +type typMapMapUintString map[uint]string +type typMapMapUintUint map[uint]uint +type typMapMapUintUint8 map[uint]uint8 +type typMapMapUintUint16 map[uint]uint16 +type typMapMapUintUint32 map[uint]uint32 +type typMapMapUintUint64 map[uint]uint64 +type typMapMapUintUintptr map[uint]uintptr +type typMapMapUintInt map[uint]int +type typMapMapUintInt8 map[uint]int8 +type typMapMapUintInt16 map[uint]int16 +type typMapMapUintInt32 map[uint]int32 +type typMapMapUintInt64 map[uint]int64 +type typMapMapUintFloat32 map[uint]float32 +type typMapMapUintFloat64 map[uint]float64 +type typMapMapUintBool map[uint]bool +type typMapMapUint8Intf map[uint8]interface{} +type typMapMapUint8String map[uint8]string +type typMapMapUint8Uint map[uint8]uint +type typMapMapUint8Uint8 map[uint8]uint8 +type typMapMapUint8Uint16 map[uint8]uint16 +type typMapMapUint8Uint32 map[uint8]uint32 +type typMapMapUint8Uint64 map[uint8]uint64 +type typMapMapUint8Uintptr map[uint8]uintptr +type typMapMapUint8Int map[uint8]int +type typMapMapUint8Int8 map[uint8]int8 +type typMapMapUint8Int16 map[uint8]int16 +type typMapMapUint8Int32 map[uint8]int32 +type typMapMapUint8Int64 map[uint8]int64 +type typMapMapUint8Float32 map[uint8]float32 +type typMapMapUint8Float64 map[uint8]float64 +type typMapMapUint8Bool map[uint8]bool +type typMapMapUint16Intf map[uint16]interface{} +type typMapMapUint16String map[uint16]string +type typMapMapUint16Uint map[uint16]uint +type typMapMapUint16Uint8 map[uint16]uint8 +type typMapMapUint16Uint16 map[uint16]uint16 +type typMapMapUint16Uint32 map[uint16]uint32 +type typMapMapUint16Uint64 map[uint16]uint64 +type typMapMapUint16Uintptr map[uint16]uintptr +type typMapMapUint16Int map[uint16]int +type typMapMapUint16Int8 map[uint16]int8 +type typMapMapUint16Int16 map[uint16]int16 +type typMapMapUint16Int32 map[uint16]int32 +type typMapMapUint16Int64 map[uint16]int64 +type typMapMapUint16Float32 map[uint16]float32 +type typMapMapUint16Float64 map[uint16]float64 +type typMapMapUint16Bool map[uint16]bool +type typMapMapUint32Intf map[uint32]interface{} +type typMapMapUint32String map[uint32]string +type typMapMapUint32Uint map[uint32]uint +type typMapMapUint32Uint8 map[uint32]uint8 +type typMapMapUint32Uint16 map[uint32]uint16 +type typMapMapUint32Uint32 map[uint32]uint32 +type typMapMapUint32Uint64 map[uint32]uint64 +type typMapMapUint32Uintptr map[uint32]uintptr +type typMapMapUint32Int map[uint32]int +type typMapMapUint32Int8 map[uint32]int8 +type typMapMapUint32Int16 map[uint32]int16 +type typMapMapUint32Int32 map[uint32]int32 +type typMapMapUint32Int64 map[uint32]int64 +type typMapMapUint32Float32 map[uint32]float32 +type typMapMapUint32Float64 map[uint32]float64 +type typMapMapUint32Bool map[uint32]bool +type typMapMapUint64Intf map[uint64]interface{} +type typMapMapUint64String map[uint64]string +type typMapMapUint64Uint map[uint64]uint +type typMapMapUint64Uint8 map[uint64]uint8 +type typMapMapUint64Uint16 map[uint64]uint16 +type typMapMapUint64Uint32 map[uint64]uint32 +type typMapMapUint64Uint64 map[uint64]uint64 +type typMapMapUint64Uintptr map[uint64]uintptr +type typMapMapUint64Int map[uint64]int +type typMapMapUint64Int8 map[uint64]int8 +type typMapMapUint64Int16 map[uint64]int16 +type typMapMapUint64Int32 map[uint64]int32 +type typMapMapUint64Int64 map[uint64]int64 +type typMapMapUint64Float32 map[uint64]float32 +type typMapMapUint64Float64 map[uint64]float64 +type typMapMapUint64Bool map[uint64]bool +type typMapMapUintptrIntf map[uintptr]interface{} +type typMapMapUintptrString map[uintptr]string +type typMapMapUintptrUint map[uintptr]uint +type typMapMapUintptrUint8 map[uintptr]uint8 +type typMapMapUintptrUint16 map[uintptr]uint16 +type typMapMapUintptrUint32 map[uintptr]uint32 +type typMapMapUintptrUint64 map[uintptr]uint64 +type typMapMapUintptrUintptr map[uintptr]uintptr +type typMapMapUintptrInt map[uintptr]int +type typMapMapUintptrInt8 map[uintptr]int8 +type typMapMapUintptrInt16 map[uintptr]int16 +type typMapMapUintptrInt32 map[uintptr]int32 +type typMapMapUintptrInt64 map[uintptr]int64 +type typMapMapUintptrFloat32 map[uintptr]float32 +type typMapMapUintptrFloat64 map[uintptr]float64 +type typMapMapUintptrBool map[uintptr]bool +type typMapMapIntIntf map[int]interface{} +type typMapMapIntString map[int]string +type typMapMapIntUint map[int]uint +type typMapMapIntUint8 map[int]uint8 +type typMapMapIntUint16 map[int]uint16 +type typMapMapIntUint32 map[int]uint32 +type typMapMapIntUint64 map[int]uint64 +type typMapMapIntUintptr map[int]uintptr +type typMapMapIntInt map[int]int +type typMapMapIntInt8 map[int]int8 +type typMapMapIntInt16 map[int]int16 +type typMapMapIntInt32 map[int]int32 +type typMapMapIntInt64 map[int]int64 +type typMapMapIntFloat32 map[int]float32 +type typMapMapIntFloat64 map[int]float64 +type typMapMapIntBool map[int]bool +type typMapMapInt8Intf map[int8]interface{} +type typMapMapInt8String map[int8]string +type typMapMapInt8Uint map[int8]uint +type typMapMapInt8Uint8 map[int8]uint8 +type typMapMapInt8Uint16 map[int8]uint16 +type typMapMapInt8Uint32 map[int8]uint32 +type typMapMapInt8Uint64 map[int8]uint64 +type typMapMapInt8Uintptr map[int8]uintptr +type typMapMapInt8Int map[int8]int +type typMapMapInt8Int8 map[int8]int8 +type typMapMapInt8Int16 map[int8]int16 +type typMapMapInt8Int32 map[int8]int32 +type typMapMapInt8Int64 map[int8]int64 +type typMapMapInt8Float32 map[int8]float32 +type typMapMapInt8Float64 map[int8]float64 +type typMapMapInt8Bool map[int8]bool +type typMapMapInt16Intf map[int16]interface{} +type typMapMapInt16String map[int16]string +type typMapMapInt16Uint map[int16]uint +type typMapMapInt16Uint8 map[int16]uint8 +type typMapMapInt16Uint16 map[int16]uint16 +type typMapMapInt16Uint32 map[int16]uint32 +type typMapMapInt16Uint64 map[int16]uint64 +type typMapMapInt16Uintptr map[int16]uintptr +type typMapMapInt16Int map[int16]int +type typMapMapInt16Int8 map[int16]int8 +type typMapMapInt16Int16 map[int16]int16 +type typMapMapInt16Int32 map[int16]int32 +type typMapMapInt16Int64 map[int16]int64 +type typMapMapInt16Float32 map[int16]float32 +type typMapMapInt16Float64 map[int16]float64 +type typMapMapInt16Bool map[int16]bool +type typMapMapInt32Intf map[int32]interface{} +type typMapMapInt32String map[int32]string +type typMapMapInt32Uint map[int32]uint +type typMapMapInt32Uint8 map[int32]uint8 +type typMapMapInt32Uint16 map[int32]uint16 +type typMapMapInt32Uint32 map[int32]uint32 +type typMapMapInt32Uint64 map[int32]uint64 +type typMapMapInt32Uintptr map[int32]uintptr +type typMapMapInt32Int map[int32]int +type typMapMapInt32Int8 map[int32]int8 +type typMapMapInt32Int16 map[int32]int16 +type typMapMapInt32Int32 map[int32]int32 +type typMapMapInt32Int64 map[int32]int64 +type typMapMapInt32Float32 map[int32]float32 +type typMapMapInt32Float64 map[int32]float64 +type typMapMapInt32Bool map[int32]bool +type typMapMapInt64Intf map[int64]interface{} +type typMapMapInt64String map[int64]string +type typMapMapInt64Uint map[int64]uint +type typMapMapInt64Uint8 map[int64]uint8 +type typMapMapInt64Uint16 map[int64]uint16 +type typMapMapInt64Uint32 map[int64]uint32 +type typMapMapInt64Uint64 map[int64]uint64 +type typMapMapInt64Uintptr map[int64]uintptr +type typMapMapInt64Int map[int64]int +type typMapMapInt64Int8 map[int64]int8 +type typMapMapInt64Int16 map[int64]int16 +type typMapMapInt64Int32 map[int64]int32 +type typMapMapInt64Int64 map[int64]int64 +type typMapMapInt64Float32 map[int64]float32 +type typMapMapInt64Float64 map[int64]float64 +type typMapMapInt64Bool map[int64]bool +type typMapMapBoolIntf map[bool]interface{} +type typMapMapBoolString map[bool]string +type typMapMapBoolUint map[bool]uint +type typMapMapBoolUint8 map[bool]uint8 +type typMapMapBoolUint16 map[bool]uint16 +type typMapMapBoolUint32 map[bool]uint32 +type typMapMapBoolUint64 map[bool]uint64 +type typMapMapBoolUintptr map[bool]uintptr +type typMapMapBoolInt map[bool]int +type typMapMapBoolInt8 map[bool]int8 +type typMapMapBoolInt16 map[bool]int16 +type typMapMapBoolInt32 map[bool]int32 +type typMapMapBoolInt64 map[bool]int64 +type typMapMapBoolFloat32 map[bool]float32 +type typMapMapBoolFloat64 map[bool]float64 +type typMapMapBoolBool map[bool]bool + +func doTestMammothSlices(t *testing.T, h Handle) { + + var v1va [8]interface{} + for _, v := range [][]interface{}{nil, {}, {"string-is-an-interface-2", nil, nil, "string-is-an-interface"}} { + var v1v1, v1v2 []interface{} + v1v1 = v + bs1 := testMarshalErr(v1v1, h, t, "enc-slice-v1") + if v == nil { + v1v2 = nil + } else { + v1v2 = make([]interface{}, len(v)) + } + testUnmarshalErr(v1v2, bs1, h, t, "dec-slice-v1") + testDeepEqualErr(v1v1, v1v2, t, "equal-slice-v1") + if v == nil { + v1v2 = nil + } else { + v1v2 = make([]interface{}, len(v)) + } + testUnmarshalErr(reflect.ValueOf(v1v2), bs1, h, t, "dec-slice-v1-noaddr") // non-addressable value + testDeepEqualErr(v1v1, v1v2, t, "equal-slice-v1-noaddr") + // ... + bs1 = testMarshalErr(&v1v1, h, t, "enc-slice-v1-p") + v1v2 = nil + testUnmarshalErr(&v1v2, bs1, h, t, "dec-slice-v1-p") + testDeepEqualErr(v1v1, v1v2, t, "equal-slice-v1-p") + v1va = [8]interface{}{} // clear the array + v1v2 = v1va[:1:1] + testUnmarshalErr(&v1v2, bs1, h, t, "dec-slice-v1-p-1") + testDeepEqualErr(v1v1, v1v2, t, "equal-slice-v1-p-1") + v1va = [8]interface{}{} // clear the array + v1v2 = v1va[:len(v1v1):len(v1v1)] + testUnmarshalErr(&v1v2, bs1, h, t, "dec-slice-v1-p-len") + testDeepEqualErr(v1v1, v1v2, t, "equal-slice-v1-p-len") + v1va = [8]interface{}{} // clear the array + v1v2 = v1va[:] + testUnmarshalErr(&v1v2, bs1, h, t, "dec-slice-v1-p-cap") + testDeepEqualErr(v1v1, v1v2, t, "equal-slice-v1-p-cap") + if len(v1v1) > 1 { + v1va = [8]interface{}{} // clear the array + testUnmarshalErr((&v1va)[:len(v1v1)], bs1, h, t, "dec-slice-v1-p-len-noaddr") + testDeepEqualErr(v1v1, v1va[:len(v1v1)], t, "equal-slice-v1-p-len-noaddr") + v1va = [8]interface{}{} // clear the array + testUnmarshalErr((&v1va)[:], bs1, h, t, "dec-slice-v1-p-cap-noaddr") + testDeepEqualErr(v1v1, v1va[:len(v1v1)], t, "equal-slice-v1-p-cap-noaddr") + } + // ... + var v1v3, v1v4 typMbsSliceIntf + v1v2 = nil + if v != nil { + v1v2 = make([]interface{}, len(v)) + } + v1v3 = typMbsSliceIntf(v1v1) + v1v4 = typMbsSliceIntf(v1v2) + bs1 = testMarshalErr(v1v3, h, t, "enc-slice-v1-custom") + testUnmarshalErr(v1v4, bs1, h, t, "dec-slice-v1-custom") + testDeepEqualErr(v1v3, v1v4, t, "equal-slice-v1-custom") + bs1 = testMarshalErr(&v1v3, h, t, "enc-slice-v1-custom-p") + v1v2 = nil + v1v4 = typMbsSliceIntf(v1v2) + testUnmarshalErr(&v1v4, bs1, h, t, "dec-slice-v1-custom-p") + testDeepEqualErr(v1v3, v1v4, t, "equal-slice-v1-custom-p") + } + + var v19va [8]string + for _, v := range [][]string{nil, {}, {"some-string-2", "", "", "some-string"}} { + var v19v1, v19v2 []string + v19v1 = v + bs19 := testMarshalErr(v19v1, h, t, "enc-slice-v19") + if v == nil { + v19v2 = nil + } else { + v19v2 = make([]string, len(v)) + } + testUnmarshalErr(v19v2, bs19, h, t, "dec-slice-v19") + testDeepEqualErr(v19v1, v19v2, t, "equal-slice-v19") + if v == nil { + v19v2 = nil + } else { + v19v2 = make([]string, len(v)) + } + testUnmarshalErr(reflect.ValueOf(v19v2), bs19, h, t, "dec-slice-v19-noaddr") // non-addressable value + testDeepEqualErr(v19v1, v19v2, t, "equal-slice-v19-noaddr") + // ... + bs19 = testMarshalErr(&v19v1, h, t, "enc-slice-v19-p") + v19v2 = nil + testUnmarshalErr(&v19v2, bs19, h, t, "dec-slice-v19-p") + testDeepEqualErr(v19v1, v19v2, t, "equal-slice-v19-p") + v19va = [8]string{} // clear the array + v19v2 = v19va[:1:1] + testUnmarshalErr(&v19v2, bs19, h, t, "dec-slice-v19-p-1") + testDeepEqualErr(v19v1, v19v2, t, "equal-slice-v19-p-1") + v19va = [8]string{} // clear the array + v19v2 = v19va[:len(v19v1):len(v19v1)] + testUnmarshalErr(&v19v2, bs19, h, t, "dec-slice-v19-p-len") + testDeepEqualErr(v19v1, v19v2, t, "equal-slice-v19-p-len") + v19va = [8]string{} // clear the array + v19v2 = v19va[:] + testUnmarshalErr(&v19v2, bs19, h, t, "dec-slice-v19-p-cap") + testDeepEqualErr(v19v1, v19v2, t, "equal-slice-v19-p-cap") + if len(v19v1) > 1 { + v19va = [8]string{} // clear the array + testUnmarshalErr((&v19va)[:len(v19v1)], bs19, h, t, "dec-slice-v19-p-len-noaddr") + testDeepEqualErr(v19v1, v19va[:len(v19v1)], t, "equal-slice-v19-p-len-noaddr") + v19va = [8]string{} // clear the array + testUnmarshalErr((&v19va)[:], bs19, h, t, "dec-slice-v19-p-cap-noaddr") + testDeepEqualErr(v19v1, v19va[:len(v19v1)], t, "equal-slice-v19-p-cap-noaddr") + } + // ... + var v19v3, v19v4 typMbsSliceString + v19v2 = nil + if v != nil { + v19v2 = make([]string, len(v)) + } + v19v3 = typMbsSliceString(v19v1) + v19v4 = typMbsSliceString(v19v2) + bs19 = testMarshalErr(v19v3, h, t, "enc-slice-v19-custom") + testUnmarshalErr(v19v4, bs19, h, t, "dec-slice-v19-custom") + testDeepEqualErr(v19v3, v19v4, t, "equal-slice-v19-custom") + bs19 = testMarshalErr(&v19v3, h, t, "enc-slice-v19-custom-p") + v19v2 = nil + v19v4 = typMbsSliceString(v19v2) + testUnmarshalErr(&v19v4, bs19, h, t, "dec-slice-v19-custom-p") + testDeepEqualErr(v19v3, v19v4, t, "equal-slice-v19-custom-p") + } + + var v37va [8]float32 + for _, v := range [][]float32{nil, {}, {22.2, 0, 0, 11.1}} { + var v37v1, v37v2 []float32 + v37v1 = v + bs37 := testMarshalErr(v37v1, h, t, "enc-slice-v37") + if v == nil { + v37v2 = nil + } else { + v37v2 = make([]float32, len(v)) + } + testUnmarshalErr(v37v2, bs37, h, t, "dec-slice-v37") + testDeepEqualErr(v37v1, v37v2, t, "equal-slice-v37") + if v == nil { + v37v2 = nil + } else { + v37v2 = make([]float32, len(v)) + } + testUnmarshalErr(reflect.ValueOf(v37v2), bs37, h, t, "dec-slice-v37-noaddr") // non-addressable value + testDeepEqualErr(v37v1, v37v2, t, "equal-slice-v37-noaddr") + // ... + bs37 = testMarshalErr(&v37v1, h, t, "enc-slice-v37-p") + v37v2 = nil + testUnmarshalErr(&v37v2, bs37, h, t, "dec-slice-v37-p") + testDeepEqualErr(v37v1, v37v2, t, "equal-slice-v37-p") + v37va = [8]float32{} // clear the array + v37v2 = v37va[:1:1] + testUnmarshalErr(&v37v2, bs37, h, t, "dec-slice-v37-p-1") + testDeepEqualErr(v37v1, v37v2, t, "equal-slice-v37-p-1") + v37va = [8]float32{} // clear the array + v37v2 = v37va[:len(v37v1):len(v37v1)] + testUnmarshalErr(&v37v2, bs37, h, t, "dec-slice-v37-p-len") + testDeepEqualErr(v37v1, v37v2, t, "equal-slice-v37-p-len") + v37va = [8]float32{} // clear the array + v37v2 = v37va[:] + testUnmarshalErr(&v37v2, bs37, h, t, "dec-slice-v37-p-cap") + testDeepEqualErr(v37v1, v37v2, t, "equal-slice-v37-p-cap") + if len(v37v1) > 1 { + v37va = [8]float32{} // clear the array + testUnmarshalErr((&v37va)[:len(v37v1)], bs37, h, t, "dec-slice-v37-p-len-noaddr") + testDeepEqualErr(v37v1, v37va[:len(v37v1)], t, "equal-slice-v37-p-len-noaddr") + v37va = [8]float32{} // clear the array + testUnmarshalErr((&v37va)[:], bs37, h, t, "dec-slice-v37-p-cap-noaddr") + testDeepEqualErr(v37v1, v37va[:len(v37v1)], t, "equal-slice-v37-p-cap-noaddr") + } + // ... + var v37v3, v37v4 typMbsSliceFloat32 + v37v2 = nil + if v != nil { + v37v2 = make([]float32, len(v)) + } + v37v3 = typMbsSliceFloat32(v37v1) + v37v4 = typMbsSliceFloat32(v37v2) + bs37 = testMarshalErr(v37v3, h, t, "enc-slice-v37-custom") + testUnmarshalErr(v37v4, bs37, h, t, "dec-slice-v37-custom") + testDeepEqualErr(v37v3, v37v4, t, "equal-slice-v37-custom") + bs37 = testMarshalErr(&v37v3, h, t, "enc-slice-v37-custom-p") + v37v2 = nil + v37v4 = typMbsSliceFloat32(v37v2) + testUnmarshalErr(&v37v4, bs37, h, t, "dec-slice-v37-custom-p") + testDeepEqualErr(v37v3, v37v4, t, "equal-slice-v37-custom-p") + } + + var v55va [8]float64 + for _, v := range [][]float64{nil, {}, {22.2, 0, 0, 11.1}} { + var v55v1, v55v2 []float64 + v55v1 = v + bs55 := testMarshalErr(v55v1, h, t, "enc-slice-v55") + if v == nil { + v55v2 = nil + } else { + v55v2 = make([]float64, len(v)) + } + testUnmarshalErr(v55v2, bs55, h, t, "dec-slice-v55") + testDeepEqualErr(v55v1, v55v2, t, "equal-slice-v55") + if v == nil { + v55v2 = nil + } else { + v55v2 = make([]float64, len(v)) + } + testUnmarshalErr(reflect.ValueOf(v55v2), bs55, h, t, "dec-slice-v55-noaddr") // non-addressable value + testDeepEqualErr(v55v1, v55v2, t, "equal-slice-v55-noaddr") + // ... + bs55 = testMarshalErr(&v55v1, h, t, "enc-slice-v55-p") + v55v2 = nil + testUnmarshalErr(&v55v2, bs55, h, t, "dec-slice-v55-p") + testDeepEqualErr(v55v1, v55v2, t, "equal-slice-v55-p") + v55va = [8]float64{} // clear the array + v55v2 = v55va[:1:1] + testUnmarshalErr(&v55v2, bs55, h, t, "dec-slice-v55-p-1") + testDeepEqualErr(v55v1, v55v2, t, "equal-slice-v55-p-1") + v55va = [8]float64{} // clear the array + v55v2 = v55va[:len(v55v1):len(v55v1)] + testUnmarshalErr(&v55v2, bs55, h, t, "dec-slice-v55-p-len") + testDeepEqualErr(v55v1, v55v2, t, "equal-slice-v55-p-len") + v55va = [8]float64{} // clear the array + v55v2 = v55va[:] + testUnmarshalErr(&v55v2, bs55, h, t, "dec-slice-v55-p-cap") + testDeepEqualErr(v55v1, v55v2, t, "equal-slice-v55-p-cap") + if len(v55v1) > 1 { + v55va = [8]float64{} // clear the array + testUnmarshalErr((&v55va)[:len(v55v1)], bs55, h, t, "dec-slice-v55-p-len-noaddr") + testDeepEqualErr(v55v1, v55va[:len(v55v1)], t, "equal-slice-v55-p-len-noaddr") + v55va = [8]float64{} // clear the array + testUnmarshalErr((&v55va)[:], bs55, h, t, "dec-slice-v55-p-cap-noaddr") + testDeepEqualErr(v55v1, v55va[:len(v55v1)], t, "equal-slice-v55-p-cap-noaddr") + } + // ... + var v55v3, v55v4 typMbsSliceFloat64 + v55v2 = nil + if v != nil { + v55v2 = make([]float64, len(v)) + } + v55v3 = typMbsSliceFloat64(v55v1) + v55v4 = typMbsSliceFloat64(v55v2) + bs55 = testMarshalErr(v55v3, h, t, "enc-slice-v55-custom") + testUnmarshalErr(v55v4, bs55, h, t, "dec-slice-v55-custom") + testDeepEqualErr(v55v3, v55v4, t, "equal-slice-v55-custom") + bs55 = testMarshalErr(&v55v3, h, t, "enc-slice-v55-custom-p") + v55v2 = nil + v55v4 = typMbsSliceFloat64(v55v2) + testUnmarshalErr(&v55v4, bs55, h, t, "dec-slice-v55-custom-p") + testDeepEqualErr(v55v3, v55v4, t, "equal-slice-v55-custom-p") + } + + var v73va [8]uint + for _, v := range [][]uint{nil, {}, {44, 0, 0, 33}} { + var v73v1, v73v2 []uint + v73v1 = v + bs73 := testMarshalErr(v73v1, h, t, "enc-slice-v73") + if v == nil { + v73v2 = nil + } else { + v73v2 = make([]uint, len(v)) + } + testUnmarshalErr(v73v2, bs73, h, t, "dec-slice-v73") + testDeepEqualErr(v73v1, v73v2, t, "equal-slice-v73") + if v == nil { + v73v2 = nil + } else { + v73v2 = make([]uint, len(v)) + } + testUnmarshalErr(reflect.ValueOf(v73v2), bs73, h, t, "dec-slice-v73-noaddr") // non-addressable value + testDeepEqualErr(v73v1, v73v2, t, "equal-slice-v73-noaddr") + // ... + bs73 = testMarshalErr(&v73v1, h, t, "enc-slice-v73-p") + v73v2 = nil + testUnmarshalErr(&v73v2, bs73, h, t, "dec-slice-v73-p") + testDeepEqualErr(v73v1, v73v2, t, "equal-slice-v73-p") + v73va = [8]uint{} // clear the array + v73v2 = v73va[:1:1] + testUnmarshalErr(&v73v2, bs73, h, t, "dec-slice-v73-p-1") + testDeepEqualErr(v73v1, v73v2, t, "equal-slice-v73-p-1") + v73va = [8]uint{} // clear the array + v73v2 = v73va[:len(v73v1):len(v73v1)] + testUnmarshalErr(&v73v2, bs73, h, t, "dec-slice-v73-p-len") + testDeepEqualErr(v73v1, v73v2, t, "equal-slice-v73-p-len") + v73va = [8]uint{} // clear the array + v73v2 = v73va[:] + testUnmarshalErr(&v73v2, bs73, h, t, "dec-slice-v73-p-cap") + testDeepEqualErr(v73v1, v73v2, t, "equal-slice-v73-p-cap") + if len(v73v1) > 1 { + v73va = [8]uint{} // clear the array + testUnmarshalErr((&v73va)[:len(v73v1)], bs73, h, t, "dec-slice-v73-p-len-noaddr") + testDeepEqualErr(v73v1, v73va[:len(v73v1)], t, "equal-slice-v73-p-len-noaddr") + v73va = [8]uint{} // clear the array + testUnmarshalErr((&v73va)[:], bs73, h, t, "dec-slice-v73-p-cap-noaddr") + testDeepEqualErr(v73v1, v73va[:len(v73v1)], t, "equal-slice-v73-p-cap-noaddr") + } + // ... + var v73v3, v73v4 typMbsSliceUint + v73v2 = nil + if v != nil { + v73v2 = make([]uint, len(v)) + } + v73v3 = typMbsSliceUint(v73v1) + v73v4 = typMbsSliceUint(v73v2) + bs73 = testMarshalErr(v73v3, h, t, "enc-slice-v73-custom") + testUnmarshalErr(v73v4, bs73, h, t, "dec-slice-v73-custom") + testDeepEqualErr(v73v3, v73v4, t, "equal-slice-v73-custom") + bs73 = testMarshalErr(&v73v3, h, t, "enc-slice-v73-custom-p") + v73v2 = nil + v73v4 = typMbsSliceUint(v73v2) + testUnmarshalErr(&v73v4, bs73, h, t, "dec-slice-v73-custom-p") + testDeepEqualErr(v73v3, v73v4, t, "equal-slice-v73-custom-p") + } + + var v91va [8]uint8 + for _, v := range [][]uint8{nil, {}, {44, 0, 0, 33}} { + var v91v1, v91v2 []uint8 + v91v1 = v + bs91 := testMarshalErr(v91v1, h, t, "enc-slice-v91") + if v == nil { + v91v2 = nil + } else { + v91v2 = make([]uint8, len(v)) + } + testUnmarshalErr(v91v2, bs91, h, t, "dec-slice-v91") + testDeepEqualErr(v91v1, v91v2, t, "equal-slice-v91") + if v == nil { + v91v2 = nil + } else { + v91v2 = make([]uint8, len(v)) + } + testUnmarshalErr(reflect.ValueOf(v91v2), bs91, h, t, "dec-slice-v91-noaddr") // non-addressable value + testDeepEqualErr(v91v1, v91v2, t, "equal-slice-v91-noaddr") + // ... + bs91 = testMarshalErr(&v91v1, h, t, "enc-slice-v91-p") + v91v2 = nil + testUnmarshalErr(&v91v2, bs91, h, t, "dec-slice-v91-p") + testDeepEqualErr(v91v1, v91v2, t, "equal-slice-v91-p") + v91va = [8]uint8{} // clear the array + v91v2 = v91va[:1:1] + testUnmarshalErr(&v91v2, bs91, h, t, "dec-slice-v91-p-1") + testDeepEqualErr(v91v1, v91v2, t, "equal-slice-v91-p-1") + v91va = [8]uint8{} // clear the array + v91v2 = v91va[:len(v91v1):len(v91v1)] + testUnmarshalErr(&v91v2, bs91, h, t, "dec-slice-v91-p-len") + testDeepEqualErr(v91v1, v91v2, t, "equal-slice-v91-p-len") + v91va = [8]uint8{} // clear the array + v91v2 = v91va[:] + testUnmarshalErr(&v91v2, bs91, h, t, "dec-slice-v91-p-cap") + testDeepEqualErr(v91v1, v91v2, t, "equal-slice-v91-p-cap") + if len(v91v1) > 1 { + v91va = [8]uint8{} // clear the array + testUnmarshalErr((&v91va)[:len(v91v1)], bs91, h, t, "dec-slice-v91-p-len-noaddr") + testDeepEqualErr(v91v1, v91va[:len(v91v1)], t, "equal-slice-v91-p-len-noaddr") + v91va = [8]uint8{} // clear the array + testUnmarshalErr((&v91va)[:], bs91, h, t, "dec-slice-v91-p-cap-noaddr") + testDeepEqualErr(v91v1, v91va[:len(v91v1)], t, "equal-slice-v91-p-cap-noaddr") + } + // ... + var v91v3, v91v4 typMbsSliceUint8 + v91v2 = nil + if v != nil { + v91v2 = make([]uint8, len(v)) + } + v91v3 = typMbsSliceUint8(v91v1) + v91v4 = typMbsSliceUint8(v91v2) + bs91 = testMarshalErr(v91v3, h, t, "enc-slice-v91-custom") + testUnmarshalErr(v91v4, bs91, h, t, "dec-slice-v91-custom") + testDeepEqualErr(v91v3, v91v4, t, "equal-slice-v91-custom") + bs91 = testMarshalErr(&v91v3, h, t, "enc-slice-v91-custom-p") + v91v2 = nil + v91v4 = typMbsSliceUint8(v91v2) + testUnmarshalErr(&v91v4, bs91, h, t, "dec-slice-v91-custom-p") + testDeepEqualErr(v91v3, v91v4, t, "equal-slice-v91-custom-p") + } + + var v109va [8]uint16 + for _, v := range [][]uint16{nil, {}, {44, 0, 0, 33}} { + var v109v1, v109v2 []uint16 + v109v1 = v + bs109 := testMarshalErr(v109v1, h, t, "enc-slice-v109") + if v == nil { + v109v2 = nil + } else { + v109v2 = make([]uint16, len(v)) + } + testUnmarshalErr(v109v2, bs109, h, t, "dec-slice-v109") + testDeepEqualErr(v109v1, v109v2, t, "equal-slice-v109") + if v == nil { + v109v2 = nil + } else { + v109v2 = make([]uint16, len(v)) + } + testUnmarshalErr(reflect.ValueOf(v109v2), bs109, h, t, "dec-slice-v109-noaddr") // non-addressable value + testDeepEqualErr(v109v1, v109v2, t, "equal-slice-v109-noaddr") + // ... + bs109 = testMarshalErr(&v109v1, h, t, "enc-slice-v109-p") + v109v2 = nil + testUnmarshalErr(&v109v2, bs109, h, t, "dec-slice-v109-p") + testDeepEqualErr(v109v1, v109v2, t, "equal-slice-v109-p") + v109va = [8]uint16{} // clear the array + v109v2 = v109va[:1:1] + testUnmarshalErr(&v109v2, bs109, h, t, "dec-slice-v109-p-1") + testDeepEqualErr(v109v1, v109v2, t, "equal-slice-v109-p-1") + v109va = [8]uint16{} // clear the array + v109v2 = v109va[:len(v109v1):len(v109v1)] + testUnmarshalErr(&v109v2, bs109, h, t, "dec-slice-v109-p-len") + testDeepEqualErr(v109v1, v109v2, t, "equal-slice-v109-p-len") + v109va = [8]uint16{} // clear the array + v109v2 = v109va[:] + testUnmarshalErr(&v109v2, bs109, h, t, "dec-slice-v109-p-cap") + testDeepEqualErr(v109v1, v109v2, t, "equal-slice-v109-p-cap") + if len(v109v1) > 1 { + v109va = [8]uint16{} // clear the array + testUnmarshalErr((&v109va)[:len(v109v1)], bs109, h, t, "dec-slice-v109-p-len-noaddr") + testDeepEqualErr(v109v1, v109va[:len(v109v1)], t, "equal-slice-v109-p-len-noaddr") + v109va = [8]uint16{} // clear the array + testUnmarshalErr((&v109va)[:], bs109, h, t, "dec-slice-v109-p-cap-noaddr") + testDeepEqualErr(v109v1, v109va[:len(v109v1)], t, "equal-slice-v109-p-cap-noaddr") + } + // ... + var v109v3, v109v4 typMbsSliceUint16 + v109v2 = nil + if v != nil { + v109v2 = make([]uint16, len(v)) + } + v109v3 = typMbsSliceUint16(v109v1) + v109v4 = typMbsSliceUint16(v109v2) + bs109 = testMarshalErr(v109v3, h, t, "enc-slice-v109-custom") + testUnmarshalErr(v109v4, bs109, h, t, "dec-slice-v109-custom") + testDeepEqualErr(v109v3, v109v4, t, "equal-slice-v109-custom") + bs109 = testMarshalErr(&v109v3, h, t, "enc-slice-v109-custom-p") + v109v2 = nil + v109v4 = typMbsSliceUint16(v109v2) + testUnmarshalErr(&v109v4, bs109, h, t, "dec-slice-v109-custom-p") + testDeepEqualErr(v109v3, v109v4, t, "equal-slice-v109-custom-p") + } + + var v127va [8]uint32 + for _, v := range [][]uint32{nil, {}, {44, 0, 0, 33}} { + var v127v1, v127v2 []uint32 + v127v1 = v + bs127 := testMarshalErr(v127v1, h, t, "enc-slice-v127") + if v == nil { + v127v2 = nil + } else { + v127v2 = make([]uint32, len(v)) + } + testUnmarshalErr(v127v2, bs127, h, t, "dec-slice-v127") + testDeepEqualErr(v127v1, v127v2, t, "equal-slice-v127") + if v == nil { + v127v2 = nil + } else { + v127v2 = make([]uint32, len(v)) + } + testUnmarshalErr(reflect.ValueOf(v127v2), bs127, h, t, "dec-slice-v127-noaddr") // non-addressable value + testDeepEqualErr(v127v1, v127v2, t, "equal-slice-v127-noaddr") + // ... + bs127 = testMarshalErr(&v127v1, h, t, "enc-slice-v127-p") + v127v2 = nil + testUnmarshalErr(&v127v2, bs127, h, t, "dec-slice-v127-p") + testDeepEqualErr(v127v1, v127v2, t, "equal-slice-v127-p") + v127va = [8]uint32{} // clear the array + v127v2 = v127va[:1:1] + testUnmarshalErr(&v127v2, bs127, h, t, "dec-slice-v127-p-1") + testDeepEqualErr(v127v1, v127v2, t, "equal-slice-v127-p-1") + v127va = [8]uint32{} // clear the array + v127v2 = v127va[:len(v127v1):len(v127v1)] + testUnmarshalErr(&v127v2, bs127, h, t, "dec-slice-v127-p-len") + testDeepEqualErr(v127v1, v127v2, t, "equal-slice-v127-p-len") + v127va = [8]uint32{} // clear the array + v127v2 = v127va[:] + testUnmarshalErr(&v127v2, bs127, h, t, "dec-slice-v127-p-cap") + testDeepEqualErr(v127v1, v127v2, t, "equal-slice-v127-p-cap") + if len(v127v1) > 1 { + v127va = [8]uint32{} // clear the array + testUnmarshalErr((&v127va)[:len(v127v1)], bs127, h, t, "dec-slice-v127-p-len-noaddr") + testDeepEqualErr(v127v1, v127va[:len(v127v1)], t, "equal-slice-v127-p-len-noaddr") + v127va = [8]uint32{} // clear the array + testUnmarshalErr((&v127va)[:], bs127, h, t, "dec-slice-v127-p-cap-noaddr") + testDeepEqualErr(v127v1, v127va[:len(v127v1)], t, "equal-slice-v127-p-cap-noaddr") + } + // ... + var v127v3, v127v4 typMbsSliceUint32 + v127v2 = nil + if v != nil { + v127v2 = make([]uint32, len(v)) + } + v127v3 = typMbsSliceUint32(v127v1) + v127v4 = typMbsSliceUint32(v127v2) + bs127 = testMarshalErr(v127v3, h, t, "enc-slice-v127-custom") + testUnmarshalErr(v127v4, bs127, h, t, "dec-slice-v127-custom") + testDeepEqualErr(v127v3, v127v4, t, "equal-slice-v127-custom") + bs127 = testMarshalErr(&v127v3, h, t, "enc-slice-v127-custom-p") + v127v2 = nil + v127v4 = typMbsSliceUint32(v127v2) + testUnmarshalErr(&v127v4, bs127, h, t, "dec-slice-v127-custom-p") + testDeepEqualErr(v127v3, v127v4, t, "equal-slice-v127-custom-p") + } + + var v145va [8]uint64 + for _, v := range [][]uint64{nil, {}, {44, 0, 0, 33}} { + var v145v1, v145v2 []uint64 + v145v1 = v + bs145 := testMarshalErr(v145v1, h, t, "enc-slice-v145") + if v == nil { + v145v2 = nil + } else { + v145v2 = make([]uint64, len(v)) + } + testUnmarshalErr(v145v2, bs145, h, t, "dec-slice-v145") + testDeepEqualErr(v145v1, v145v2, t, "equal-slice-v145") + if v == nil { + v145v2 = nil + } else { + v145v2 = make([]uint64, len(v)) + } + testUnmarshalErr(reflect.ValueOf(v145v2), bs145, h, t, "dec-slice-v145-noaddr") // non-addressable value + testDeepEqualErr(v145v1, v145v2, t, "equal-slice-v145-noaddr") + // ... + bs145 = testMarshalErr(&v145v1, h, t, "enc-slice-v145-p") + v145v2 = nil + testUnmarshalErr(&v145v2, bs145, h, t, "dec-slice-v145-p") + testDeepEqualErr(v145v1, v145v2, t, "equal-slice-v145-p") + v145va = [8]uint64{} // clear the array + v145v2 = v145va[:1:1] + testUnmarshalErr(&v145v2, bs145, h, t, "dec-slice-v145-p-1") + testDeepEqualErr(v145v1, v145v2, t, "equal-slice-v145-p-1") + v145va = [8]uint64{} // clear the array + v145v2 = v145va[:len(v145v1):len(v145v1)] + testUnmarshalErr(&v145v2, bs145, h, t, "dec-slice-v145-p-len") + testDeepEqualErr(v145v1, v145v2, t, "equal-slice-v145-p-len") + v145va = [8]uint64{} // clear the array + v145v2 = v145va[:] + testUnmarshalErr(&v145v2, bs145, h, t, "dec-slice-v145-p-cap") + testDeepEqualErr(v145v1, v145v2, t, "equal-slice-v145-p-cap") + if len(v145v1) > 1 { + v145va = [8]uint64{} // clear the array + testUnmarshalErr((&v145va)[:len(v145v1)], bs145, h, t, "dec-slice-v145-p-len-noaddr") + testDeepEqualErr(v145v1, v145va[:len(v145v1)], t, "equal-slice-v145-p-len-noaddr") + v145va = [8]uint64{} // clear the array + testUnmarshalErr((&v145va)[:], bs145, h, t, "dec-slice-v145-p-cap-noaddr") + testDeepEqualErr(v145v1, v145va[:len(v145v1)], t, "equal-slice-v145-p-cap-noaddr") + } + // ... + var v145v3, v145v4 typMbsSliceUint64 + v145v2 = nil + if v != nil { + v145v2 = make([]uint64, len(v)) + } + v145v3 = typMbsSliceUint64(v145v1) + v145v4 = typMbsSliceUint64(v145v2) + bs145 = testMarshalErr(v145v3, h, t, "enc-slice-v145-custom") + testUnmarshalErr(v145v4, bs145, h, t, "dec-slice-v145-custom") + testDeepEqualErr(v145v3, v145v4, t, "equal-slice-v145-custom") + bs145 = testMarshalErr(&v145v3, h, t, "enc-slice-v145-custom-p") + v145v2 = nil + v145v4 = typMbsSliceUint64(v145v2) + testUnmarshalErr(&v145v4, bs145, h, t, "dec-slice-v145-custom-p") + testDeepEqualErr(v145v3, v145v4, t, "equal-slice-v145-custom-p") + } + + var v163va [8]uintptr + for _, v := range [][]uintptr{nil, {}, {44, 0, 0, 33}} { + var v163v1, v163v2 []uintptr + v163v1 = v + bs163 := testMarshalErr(v163v1, h, t, "enc-slice-v163") + if v == nil { + v163v2 = nil + } else { + v163v2 = make([]uintptr, len(v)) + } + testUnmarshalErr(v163v2, bs163, h, t, "dec-slice-v163") + testDeepEqualErr(v163v1, v163v2, t, "equal-slice-v163") + if v == nil { + v163v2 = nil + } else { + v163v2 = make([]uintptr, len(v)) + } + testUnmarshalErr(reflect.ValueOf(v163v2), bs163, h, t, "dec-slice-v163-noaddr") // non-addressable value + testDeepEqualErr(v163v1, v163v2, t, "equal-slice-v163-noaddr") + // ... + bs163 = testMarshalErr(&v163v1, h, t, "enc-slice-v163-p") + v163v2 = nil + testUnmarshalErr(&v163v2, bs163, h, t, "dec-slice-v163-p") + testDeepEqualErr(v163v1, v163v2, t, "equal-slice-v163-p") + v163va = [8]uintptr{} // clear the array + v163v2 = v163va[:1:1] + testUnmarshalErr(&v163v2, bs163, h, t, "dec-slice-v163-p-1") + testDeepEqualErr(v163v1, v163v2, t, "equal-slice-v163-p-1") + v163va = [8]uintptr{} // clear the array + v163v2 = v163va[:len(v163v1):len(v163v1)] + testUnmarshalErr(&v163v2, bs163, h, t, "dec-slice-v163-p-len") + testDeepEqualErr(v163v1, v163v2, t, "equal-slice-v163-p-len") + v163va = [8]uintptr{} // clear the array + v163v2 = v163va[:] + testUnmarshalErr(&v163v2, bs163, h, t, "dec-slice-v163-p-cap") + testDeepEqualErr(v163v1, v163v2, t, "equal-slice-v163-p-cap") + if len(v163v1) > 1 { + v163va = [8]uintptr{} // clear the array + testUnmarshalErr((&v163va)[:len(v163v1)], bs163, h, t, "dec-slice-v163-p-len-noaddr") + testDeepEqualErr(v163v1, v163va[:len(v163v1)], t, "equal-slice-v163-p-len-noaddr") + v163va = [8]uintptr{} // clear the array + testUnmarshalErr((&v163va)[:], bs163, h, t, "dec-slice-v163-p-cap-noaddr") + testDeepEqualErr(v163v1, v163va[:len(v163v1)], t, "equal-slice-v163-p-cap-noaddr") + } + // ... + var v163v3, v163v4 typMbsSliceUintptr + v163v2 = nil + if v != nil { + v163v2 = make([]uintptr, len(v)) + } + v163v3 = typMbsSliceUintptr(v163v1) + v163v4 = typMbsSliceUintptr(v163v2) + bs163 = testMarshalErr(v163v3, h, t, "enc-slice-v163-custom") + testUnmarshalErr(v163v4, bs163, h, t, "dec-slice-v163-custom") + testDeepEqualErr(v163v3, v163v4, t, "equal-slice-v163-custom") + bs163 = testMarshalErr(&v163v3, h, t, "enc-slice-v163-custom-p") + v163v2 = nil + v163v4 = typMbsSliceUintptr(v163v2) + testUnmarshalErr(&v163v4, bs163, h, t, "dec-slice-v163-custom-p") + testDeepEqualErr(v163v3, v163v4, t, "equal-slice-v163-custom-p") + } + + var v181va [8]int + for _, v := range [][]int{nil, {}, {44, 0, 0, 33}} { + var v181v1, v181v2 []int + v181v1 = v + bs181 := testMarshalErr(v181v1, h, t, "enc-slice-v181") + if v == nil { + v181v2 = nil + } else { + v181v2 = make([]int, len(v)) + } + testUnmarshalErr(v181v2, bs181, h, t, "dec-slice-v181") + testDeepEqualErr(v181v1, v181v2, t, "equal-slice-v181") + if v == nil { + v181v2 = nil + } else { + v181v2 = make([]int, len(v)) + } + testUnmarshalErr(reflect.ValueOf(v181v2), bs181, h, t, "dec-slice-v181-noaddr") // non-addressable value + testDeepEqualErr(v181v1, v181v2, t, "equal-slice-v181-noaddr") + // ... + bs181 = testMarshalErr(&v181v1, h, t, "enc-slice-v181-p") + v181v2 = nil + testUnmarshalErr(&v181v2, bs181, h, t, "dec-slice-v181-p") + testDeepEqualErr(v181v1, v181v2, t, "equal-slice-v181-p") + v181va = [8]int{} // clear the array + v181v2 = v181va[:1:1] + testUnmarshalErr(&v181v2, bs181, h, t, "dec-slice-v181-p-1") + testDeepEqualErr(v181v1, v181v2, t, "equal-slice-v181-p-1") + v181va = [8]int{} // clear the array + v181v2 = v181va[:len(v181v1):len(v181v1)] + testUnmarshalErr(&v181v2, bs181, h, t, "dec-slice-v181-p-len") + testDeepEqualErr(v181v1, v181v2, t, "equal-slice-v181-p-len") + v181va = [8]int{} // clear the array + v181v2 = v181va[:] + testUnmarshalErr(&v181v2, bs181, h, t, "dec-slice-v181-p-cap") + testDeepEqualErr(v181v1, v181v2, t, "equal-slice-v181-p-cap") + if len(v181v1) > 1 { + v181va = [8]int{} // clear the array + testUnmarshalErr((&v181va)[:len(v181v1)], bs181, h, t, "dec-slice-v181-p-len-noaddr") + testDeepEqualErr(v181v1, v181va[:len(v181v1)], t, "equal-slice-v181-p-len-noaddr") + v181va = [8]int{} // clear the array + testUnmarshalErr((&v181va)[:], bs181, h, t, "dec-slice-v181-p-cap-noaddr") + testDeepEqualErr(v181v1, v181va[:len(v181v1)], t, "equal-slice-v181-p-cap-noaddr") + } + // ... + var v181v3, v181v4 typMbsSliceInt + v181v2 = nil + if v != nil { + v181v2 = make([]int, len(v)) + } + v181v3 = typMbsSliceInt(v181v1) + v181v4 = typMbsSliceInt(v181v2) + bs181 = testMarshalErr(v181v3, h, t, "enc-slice-v181-custom") + testUnmarshalErr(v181v4, bs181, h, t, "dec-slice-v181-custom") + testDeepEqualErr(v181v3, v181v4, t, "equal-slice-v181-custom") + bs181 = testMarshalErr(&v181v3, h, t, "enc-slice-v181-custom-p") + v181v2 = nil + v181v4 = typMbsSliceInt(v181v2) + testUnmarshalErr(&v181v4, bs181, h, t, "dec-slice-v181-custom-p") + testDeepEqualErr(v181v3, v181v4, t, "equal-slice-v181-custom-p") + } + + var v199va [8]int8 + for _, v := range [][]int8{nil, {}, {44, 0, 0, 33}} { + var v199v1, v199v2 []int8 + v199v1 = v + bs199 := testMarshalErr(v199v1, h, t, "enc-slice-v199") + if v == nil { + v199v2 = nil + } else { + v199v2 = make([]int8, len(v)) + } + testUnmarshalErr(v199v2, bs199, h, t, "dec-slice-v199") + testDeepEqualErr(v199v1, v199v2, t, "equal-slice-v199") + if v == nil { + v199v2 = nil + } else { + v199v2 = make([]int8, len(v)) + } + testUnmarshalErr(reflect.ValueOf(v199v2), bs199, h, t, "dec-slice-v199-noaddr") // non-addressable value + testDeepEqualErr(v199v1, v199v2, t, "equal-slice-v199-noaddr") + // ... + bs199 = testMarshalErr(&v199v1, h, t, "enc-slice-v199-p") + v199v2 = nil + testUnmarshalErr(&v199v2, bs199, h, t, "dec-slice-v199-p") + testDeepEqualErr(v199v1, v199v2, t, "equal-slice-v199-p") + v199va = [8]int8{} // clear the array + v199v2 = v199va[:1:1] + testUnmarshalErr(&v199v2, bs199, h, t, "dec-slice-v199-p-1") + testDeepEqualErr(v199v1, v199v2, t, "equal-slice-v199-p-1") + v199va = [8]int8{} // clear the array + v199v2 = v199va[:len(v199v1):len(v199v1)] + testUnmarshalErr(&v199v2, bs199, h, t, "dec-slice-v199-p-len") + testDeepEqualErr(v199v1, v199v2, t, "equal-slice-v199-p-len") + v199va = [8]int8{} // clear the array + v199v2 = v199va[:] + testUnmarshalErr(&v199v2, bs199, h, t, "dec-slice-v199-p-cap") + testDeepEqualErr(v199v1, v199v2, t, "equal-slice-v199-p-cap") + if len(v199v1) > 1 { + v199va = [8]int8{} // clear the array + testUnmarshalErr((&v199va)[:len(v199v1)], bs199, h, t, "dec-slice-v199-p-len-noaddr") + testDeepEqualErr(v199v1, v199va[:len(v199v1)], t, "equal-slice-v199-p-len-noaddr") + v199va = [8]int8{} // clear the array + testUnmarshalErr((&v199va)[:], bs199, h, t, "dec-slice-v199-p-cap-noaddr") + testDeepEqualErr(v199v1, v199va[:len(v199v1)], t, "equal-slice-v199-p-cap-noaddr") + } + // ... + var v199v3, v199v4 typMbsSliceInt8 + v199v2 = nil + if v != nil { + v199v2 = make([]int8, len(v)) + } + v199v3 = typMbsSliceInt8(v199v1) + v199v4 = typMbsSliceInt8(v199v2) + bs199 = testMarshalErr(v199v3, h, t, "enc-slice-v199-custom") + testUnmarshalErr(v199v4, bs199, h, t, "dec-slice-v199-custom") + testDeepEqualErr(v199v3, v199v4, t, "equal-slice-v199-custom") + bs199 = testMarshalErr(&v199v3, h, t, "enc-slice-v199-custom-p") + v199v2 = nil + v199v4 = typMbsSliceInt8(v199v2) + testUnmarshalErr(&v199v4, bs199, h, t, "dec-slice-v199-custom-p") + testDeepEqualErr(v199v3, v199v4, t, "equal-slice-v199-custom-p") + } + + var v217va [8]int16 + for _, v := range [][]int16{nil, {}, {44, 0, 0, 33}} { + var v217v1, v217v2 []int16 + v217v1 = v + bs217 := testMarshalErr(v217v1, h, t, "enc-slice-v217") + if v == nil { + v217v2 = nil + } else { + v217v2 = make([]int16, len(v)) + } + testUnmarshalErr(v217v2, bs217, h, t, "dec-slice-v217") + testDeepEqualErr(v217v1, v217v2, t, "equal-slice-v217") + if v == nil { + v217v2 = nil + } else { + v217v2 = make([]int16, len(v)) + } + testUnmarshalErr(reflect.ValueOf(v217v2), bs217, h, t, "dec-slice-v217-noaddr") // non-addressable value + testDeepEqualErr(v217v1, v217v2, t, "equal-slice-v217-noaddr") + // ... + bs217 = testMarshalErr(&v217v1, h, t, "enc-slice-v217-p") + v217v2 = nil + testUnmarshalErr(&v217v2, bs217, h, t, "dec-slice-v217-p") + testDeepEqualErr(v217v1, v217v2, t, "equal-slice-v217-p") + v217va = [8]int16{} // clear the array + v217v2 = v217va[:1:1] + testUnmarshalErr(&v217v2, bs217, h, t, "dec-slice-v217-p-1") + testDeepEqualErr(v217v1, v217v2, t, "equal-slice-v217-p-1") + v217va = [8]int16{} // clear the array + v217v2 = v217va[:len(v217v1):len(v217v1)] + testUnmarshalErr(&v217v2, bs217, h, t, "dec-slice-v217-p-len") + testDeepEqualErr(v217v1, v217v2, t, "equal-slice-v217-p-len") + v217va = [8]int16{} // clear the array + v217v2 = v217va[:] + testUnmarshalErr(&v217v2, bs217, h, t, "dec-slice-v217-p-cap") + testDeepEqualErr(v217v1, v217v2, t, "equal-slice-v217-p-cap") + if len(v217v1) > 1 { + v217va = [8]int16{} // clear the array + testUnmarshalErr((&v217va)[:len(v217v1)], bs217, h, t, "dec-slice-v217-p-len-noaddr") + testDeepEqualErr(v217v1, v217va[:len(v217v1)], t, "equal-slice-v217-p-len-noaddr") + v217va = [8]int16{} // clear the array + testUnmarshalErr((&v217va)[:], bs217, h, t, "dec-slice-v217-p-cap-noaddr") + testDeepEqualErr(v217v1, v217va[:len(v217v1)], t, "equal-slice-v217-p-cap-noaddr") + } + // ... + var v217v3, v217v4 typMbsSliceInt16 + v217v2 = nil + if v != nil { + v217v2 = make([]int16, len(v)) + } + v217v3 = typMbsSliceInt16(v217v1) + v217v4 = typMbsSliceInt16(v217v2) + bs217 = testMarshalErr(v217v3, h, t, "enc-slice-v217-custom") + testUnmarshalErr(v217v4, bs217, h, t, "dec-slice-v217-custom") + testDeepEqualErr(v217v3, v217v4, t, "equal-slice-v217-custom") + bs217 = testMarshalErr(&v217v3, h, t, "enc-slice-v217-custom-p") + v217v2 = nil + v217v4 = typMbsSliceInt16(v217v2) + testUnmarshalErr(&v217v4, bs217, h, t, "dec-slice-v217-custom-p") + testDeepEqualErr(v217v3, v217v4, t, "equal-slice-v217-custom-p") + } + + var v235va [8]int32 + for _, v := range [][]int32{nil, {}, {44, 0, 0, 33}} { + var v235v1, v235v2 []int32 + v235v1 = v + bs235 := testMarshalErr(v235v1, h, t, "enc-slice-v235") + if v == nil { + v235v2 = nil + } else { + v235v2 = make([]int32, len(v)) + } + testUnmarshalErr(v235v2, bs235, h, t, "dec-slice-v235") + testDeepEqualErr(v235v1, v235v2, t, "equal-slice-v235") + if v == nil { + v235v2 = nil + } else { + v235v2 = make([]int32, len(v)) + } + testUnmarshalErr(reflect.ValueOf(v235v2), bs235, h, t, "dec-slice-v235-noaddr") // non-addressable value + testDeepEqualErr(v235v1, v235v2, t, "equal-slice-v235-noaddr") + // ... + bs235 = testMarshalErr(&v235v1, h, t, "enc-slice-v235-p") + v235v2 = nil + testUnmarshalErr(&v235v2, bs235, h, t, "dec-slice-v235-p") + testDeepEqualErr(v235v1, v235v2, t, "equal-slice-v235-p") + v235va = [8]int32{} // clear the array + v235v2 = v235va[:1:1] + testUnmarshalErr(&v235v2, bs235, h, t, "dec-slice-v235-p-1") + testDeepEqualErr(v235v1, v235v2, t, "equal-slice-v235-p-1") + v235va = [8]int32{} // clear the array + v235v2 = v235va[:len(v235v1):len(v235v1)] + testUnmarshalErr(&v235v2, bs235, h, t, "dec-slice-v235-p-len") + testDeepEqualErr(v235v1, v235v2, t, "equal-slice-v235-p-len") + v235va = [8]int32{} // clear the array + v235v2 = v235va[:] + testUnmarshalErr(&v235v2, bs235, h, t, "dec-slice-v235-p-cap") + testDeepEqualErr(v235v1, v235v2, t, "equal-slice-v235-p-cap") + if len(v235v1) > 1 { + v235va = [8]int32{} // clear the array + testUnmarshalErr((&v235va)[:len(v235v1)], bs235, h, t, "dec-slice-v235-p-len-noaddr") + testDeepEqualErr(v235v1, v235va[:len(v235v1)], t, "equal-slice-v235-p-len-noaddr") + v235va = [8]int32{} // clear the array + testUnmarshalErr((&v235va)[:], bs235, h, t, "dec-slice-v235-p-cap-noaddr") + testDeepEqualErr(v235v1, v235va[:len(v235v1)], t, "equal-slice-v235-p-cap-noaddr") + } + // ... + var v235v3, v235v4 typMbsSliceInt32 + v235v2 = nil + if v != nil { + v235v2 = make([]int32, len(v)) + } + v235v3 = typMbsSliceInt32(v235v1) + v235v4 = typMbsSliceInt32(v235v2) + bs235 = testMarshalErr(v235v3, h, t, "enc-slice-v235-custom") + testUnmarshalErr(v235v4, bs235, h, t, "dec-slice-v235-custom") + testDeepEqualErr(v235v3, v235v4, t, "equal-slice-v235-custom") + bs235 = testMarshalErr(&v235v3, h, t, "enc-slice-v235-custom-p") + v235v2 = nil + v235v4 = typMbsSliceInt32(v235v2) + testUnmarshalErr(&v235v4, bs235, h, t, "dec-slice-v235-custom-p") + testDeepEqualErr(v235v3, v235v4, t, "equal-slice-v235-custom-p") + } + + var v253va [8]int64 + for _, v := range [][]int64{nil, {}, {44, 0, 0, 33}} { + var v253v1, v253v2 []int64 + v253v1 = v + bs253 := testMarshalErr(v253v1, h, t, "enc-slice-v253") + if v == nil { + v253v2 = nil + } else { + v253v2 = make([]int64, len(v)) + } + testUnmarshalErr(v253v2, bs253, h, t, "dec-slice-v253") + testDeepEqualErr(v253v1, v253v2, t, "equal-slice-v253") + if v == nil { + v253v2 = nil + } else { + v253v2 = make([]int64, len(v)) + } + testUnmarshalErr(reflect.ValueOf(v253v2), bs253, h, t, "dec-slice-v253-noaddr") // non-addressable value + testDeepEqualErr(v253v1, v253v2, t, "equal-slice-v253-noaddr") + // ... + bs253 = testMarshalErr(&v253v1, h, t, "enc-slice-v253-p") + v253v2 = nil + testUnmarshalErr(&v253v2, bs253, h, t, "dec-slice-v253-p") + testDeepEqualErr(v253v1, v253v2, t, "equal-slice-v253-p") + v253va = [8]int64{} // clear the array + v253v2 = v253va[:1:1] + testUnmarshalErr(&v253v2, bs253, h, t, "dec-slice-v253-p-1") + testDeepEqualErr(v253v1, v253v2, t, "equal-slice-v253-p-1") + v253va = [8]int64{} // clear the array + v253v2 = v253va[:len(v253v1):len(v253v1)] + testUnmarshalErr(&v253v2, bs253, h, t, "dec-slice-v253-p-len") + testDeepEqualErr(v253v1, v253v2, t, "equal-slice-v253-p-len") + v253va = [8]int64{} // clear the array + v253v2 = v253va[:] + testUnmarshalErr(&v253v2, bs253, h, t, "dec-slice-v253-p-cap") + testDeepEqualErr(v253v1, v253v2, t, "equal-slice-v253-p-cap") + if len(v253v1) > 1 { + v253va = [8]int64{} // clear the array + testUnmarshalErr((&v253va)[:len(v253v1)], bs253, h, t, "dec-slice-v253-p-len-noaddr") + testDeepEqualErr(v253v1, v253va[:len(v253v1)], t, "equal-slice-v253-p-len-noaddr") + v253va = [8]int64{} // clear the array + testUnmarshalErr((&v253va)[:], bs253, h, t, "dec-slice-v253-p-cap-noaddr") + testDeepEqualErr(v253v1, v253va[:len(v253v1)], t, "equal-slice-v253-p-cap-noaddr") + } + // ... + var v253v3, v253v4 typMbsSliceInt64 + v253v2 = nil + if v != nil { + v253v2 = make([]int64, len(v)) + } + v253v3 = typMbsSliceInt64(v253v1) + v253v4 = typMbsSliceInt64(v253v2) + bs253 = testMarshalErr(v253v3, h, t, "enc-slice-v253-custom") + testUnmarshalErr(v253v4, bs253, h, t, "dec-slice-v253-custom") + testDeepEqualErr(v253v3, v253v4, t, "equal-slice-v253-custom") + bs253 = testMarshalErr(&v253v3, h, t, "enc-slice-v253-custom-p") + v253v2 = nil + v253v4 = typMbsSliceInt64(v253v2) + testUnmarshalErr(&v253v4, bs253, h, t, "dec-slice-v253-custom-p") + testDeepEqualErr(v253v3, v253v4, t, "equal-slice-v253-custom-p") + } + + var v271va [8]bool + for _, v := range [][]bool{nil, {}, {true, false, false, true}} { + var v271v1, v271v2 []bool + v271v1 = v + bs271 := testMarshalErr(v271v1, h, t, "enc-slice-v271") + if v == nil { + v271v2 = nil + } else { + v271v2 = make([]bool, len(v)) + } + testUnmarshalErr(v271v2, bs271, h, t, "dec-slice-v271") + testDeepEqualErr(v271v1, v271v2, t, "equal-slice-v271") + if v == nil { + v271v2 = nil + } else { + v271v2 = make([]bool, len(v)) + } + testUnmarshalErr(reflect.ValueOf(v271v2), bs271, h, t, "dec-slice-v271-noaddr") // non-addressable value + testDeepEqualErr(v271v1, v271v2, t, "equal-slice-v271-noaddr") + // ... + bs271 = testMarshalErr(&v271v1, h, t, "enc-slice-v271-p") + v271v2 = nil + testUnmarshalErr(&v271v2, bs271, h, t, "dec-slice-v271-p") + testDeepEqualErr(v271v1, v271v2, t, "equal-slice-v271-p") + v271va = [8]bool{} // clear the array + v271v2 = v271va[:1:1] + testUnmarshalErr(&v271v2, bs271, h, t, "dec-slice-v271-p-1") + testDeepEqualErr(v271v1, v271v2, t, "equal-slice-v271-p-1") + v271va = [8]bool{} // clear the array + v271v2 = v271va[:len(v271v1):len(v271v1)] + testUnmarshalErr(&v271v2, bs271, h, t, "dec-slice-v271-p-len") + testDeepEqualErr(v271v1, v271v2, t, "equal-slice-v271-p-len") + v271va = [8]bool{} // clear the array + v271v2 = v271va[:] + testUnmarshalErr(&v271v2, bs271, h, t, "dec-slice-v271-p-cap") + testDeepEqualErr(v271v1, v271v2, t, "equal-slice-v271-p-cap") + if len(v271v1) > 1 { + v271va = [8]bool{} // clear the array + testUnmarshalErr((&v271va)[:len(v271v1)], bs271, h, t, "dec-slice-v271-p-len-noaddr") + testDeepEqualErr(v271v1, v271va[:len(v271v1)], t, "equal-slice-v271-p-len-noaddr") + v271va = [8]bool{} // clear the array + testUnmarshalErr((&v271va)[:], bs271, h, t, "dec-slice-v271-p-cap-noaddr") + testDeepEqualErr(v271v1, v271va[:len(v271v1)], t, "equal-slice-v271-p-cap-noaddr") + } + // ... + var v271v3, v271v4 typMbsSliceBool + v271v2 = nil + if v != nil { + v271v2 = make([]bool, len(v)) + } + v271v3 = typMbsSliceBool(v271v1) + v271v4 = typMbsSliceBool(v271v2) + bs271 = testMarshalErr(v271v3, h, t, "enc-slice-v271-custom") + testUnmarshalErr(v271v4, bs271, h, t, "dec-slice-v271-custom") + testDeepEqualErr(v271v3, v271v4, t, "equal-slice-v271-custom") + bs271 = testMarshalErr(&v271v3, h, t, "enc-slice-v271-custom-p") + v271v2 = nil + v271v4 = typMbsSliceBool(v271v2) + testUnmarshalErr(&v271v4, bs271, h, t, "dec-slice-v271-custom-p") + testDeepEqualErr(v271v3, v271v4, t, "equal-slice-v271-custom-p") + } + +} + +func doTestMammothMaps(t *testing.T, h Handle) { + + for _, v := range []map[interface{}]interface{}{nil, {}, {"string-is-an-interface-2": nil, "string-is-an-interface": "string-is-an-interface-2"}} { + // fmt.Printf(">>>> running mammoth map v2: %v\n", v) + var v2v1, v2v2 map[interface{}]interface{} + v2v1 = v + bs2 := testMarshalErr(v2v1, h, t, "enc-map-v2") + if v == nil { + v2v2 = nil + } else { + v2v2 = make(map[interface{}]interface{}, len(v)) + } // reset map + testUnmarshalErr(v2v2, bs2, h, t, "dec-map-v2") + testDeepEqualErr(v2v1, v2v2, t, "equal-map-v2") + if v == nil { + v2v2 = nil + } else { + v2v2 = make(map[interface{}]interface{}, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v2v2), bs2, h, t, "dec-map-v2-noaddr") // decode into non-addressable map value + testDeepEqualErr(v2v1, v2v2, t, "equal-map-v2-noaddr") + if v == nil { + v2v2 = nil + } else { + v2v2 = make(map[interface{}]interface{}, len(v)) + } // reset map + testUnmarshalErr(&v2v2, bs2, h, t, "dec-map-v2-p-len") + testDeepEqualErr(v2v1, v2v2, t, "equal-map-v2-p-len") + bs2 = testMarshalErr(&v2v1, h, t, "enc-map-v2-p") + v2v2 = nil + testUnmarshalErr(&v2v2, bs2, h, t, "dec-map-v2-p-nil") + testDeepEqualErr(v2v1, v2v2, t, "equal-map-v2-p-nil") + // ... + if v == nil { + v2v2 = nil + } else { + v2v2 = make(map[interface{}]interface{}, len(v)) + } // reset map + var v2v3, v2v4 typMapMapIntfIntf + v2v3 = typMapMapIntfIntf(v2v1) + v2v4 = typMapMapIntfIntf(v2v2) + bs2 = testMarshalErr(v2v3, h, t, "enc-map-v2-custom") + testUnmarshalErr(v2v4, bs2, h, t, "dec-map-v2-p-len") + testDeepEqualErr(v2v3, v2v4, t, "equal-map-v2-p-len") + } + + for _, v := range []map[interface{}]string{nil, {}, {"string-is-an-interface": "", "string-is-an-interface-2": "some-string-2"}} { + // fmt.Printf(">>>> running mammoth map v3: %v\n", v) + var v3v1, v3v2 map[interface{}]string + v3v1 = v + bs3 := testMarshalErr(v3v1, h, t, "enc-map-v3") + if v == nil { + v3v2 = nil + } else { + v3v2 = make(map[interface{}]string, len(v)) + } // reset map + testUnmarshalErr(v3v2, bs3, h, t, "dec-map-v3") + testDeepEqualErr(v3v1, v3v2, t, "equal-map-v3") + if v == nil { + v3v2 = nil + } else { + v3v2 = make(map[interface{}]string, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v3v2), bs3, h, t, "dec-map-v3-noaddr") // decode into non-addressable map value + testDeepEqualErr(v3v1, v3v2, t, "equal-map-v3-noaddr") + if v == nil { + v3v2 = nil + } else { + v3v2 = make(map[interface{}]string, len(v)) + } // reset map + testUnmarshalErr(&v3v2, bs3, h, t, "dec-map-v3-p-len") + testDeepEqualErr(v3v1, v3v2, t, "equal-map-v3-p-len") + bs3 = testMarshalErr(&v3v1, h, t, "enc-map-v3-p") + v3v2 = nil + testUnmarshalErr(&v3v2, bs3, h, t, "dec-map-v3-p-nil") + testDeepEqualErr(v3v1, v3v2, t, "equal-map-v3-p-nil") + // ... + if v == nil { + v3v2 = nil + } else { + v3v2 = make(map[interface{}]string, len(v)) + } // reset map + var v3v3, v3v4 typMapMapIntfString + v3v3 = typMapMapIntfString(v3v1) + v3v4 = typMapMapIntfString(v3v2) + bs3 = testMarshalErr(v3v3, h, t, "enc-map-v3-custom") + testUnmarshalErr(v3v4, bs3, h, t, "dec-map-v3-p-len") + testDeepEqualErr(v3v3, v3v4, t, "equal-map-v3-p-len") + } + + for _, v := range []map[interface{}]uint{nil, {}, {"string-is-an-interface": 0, "string-is-an-interface-2": 44}} { + // fmt.Printf(">>>> running mammoth map v4: %v\n", v) + var v4v1, v4v2 map[interface{}]uint + v4v1 = v + bs4 := testMarshalErr(v4v1, h, t, "enc-map-v4") + if v == nil { + v4v2 = nil + } else { + v4v2 = make(map[interface{}]uint, len(v)) + } // reset map + testUnmarshalErr(v4v2, bs4, h, t, "dec-map-v4") + testDeepEqualErr(v4v1, v4v2, t, "equal-map-v4") + if v == nil { + v4v2 = nil + } else { + v4v2 = make(map[interface{}]uint, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v4v2), bs4, h, t, "dec-map-v4-noaddr") // decode into non-addressable map value + testDeepEqualErr(v4v1, v4v2, t, "equal-map-v4-noaddr") + if v == nil { + v4v2 = nil + } else { + v4v2 = make(map[interface{}]uint, len(v)) + } // reset map + testUnmarshalErr(&v4v2, bs4, h, t, "dec-map-v4-p-len") + testDeepEqualErr(v4v1, v4v2, t, "equal-map-v4-p-len") + bs4 = testMarshalErr(&v4v1, h, t, "enc-map-v4-p") + v4v2 = nil + testUnmarshalErr(&v4v2, bs4, h, t, "dec-map-v4-p-nil") + testDeepEqualErr(v4v1, v4v2, t, "equal-map-v4-p-nil") + // ... + if v == nil { + v4v2 = nil + } else { + v4v2 = make(map[interface{}]uint, len(v)) + } // reset map + var v4v3, v4v4 typMapMapIntfUint + v4v3 = typMapMapIntfUint(v4v1) + v4v4 = typMapMapIntfUint(v4v2) + bs4 = testMarshalErr(v4v3, h, t, "enc-map-v4-custom") + testUnmarshalErr(v4v4, bs4, h, t, "dec-map-v4-p-len") + testDeepEqualErr(v4v3, v4v4, t, "equal-map-v4-p-len") + } + + for _, v := range []map[interface{}]uint8{nil, {}, {"string-is-an-interface": 0, "string-is-an-interface-2": 33}} { + // fmt.Printf(">>>> running mammoth map v5: %v\n", v) + var v5v1, v5v2 map[interface{}]uint8 + v5v1 = v + bs5 := testMarshalErr(v5v1, h, t, "enc-map-v5") + if v == nil { + v5v2 = nil + } else { + v5v2 = make(map[interface{}]uint8, len(v)) + } // reset map + testUnmarshalErr(v5v2, bs5, h, t, "dec-map-v5") + testDeepEqualErr(v5v1, v5v2, t, "equal-map-v5") + if v == nil { + v5v2 = nil + } else { + v5v2 = make(map[interface{}]uint8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v5v2), bs5, h, t, "dec-map-v5-noaddr") // decode into non-addressable map value + testDeepEqualErr(v5v1, v5v2, t, "equal-map-v5-noaddr") + if v == nil { + v5v2 = nil + } else { + v5v2 = make(map[interface{}]uint8, len(v)) + } // reset map + testUnmarshalErr(&v5v2, bs5, h, t, "dec-map-v5-p-len") + testDeepEqualErr(v5v1, v5v2, t, "equal-map-v5-p-len") + bs5 = testMarshalErr(&v5v1, h, t, "enc-map-v5-p") + v5v2 = nil + testUnmarshalErr(&v5v2, bs5, h, t, "dec-map-v5-p-nil") + testDeepEqualErr(v5v1, v5v2, t, "equal-map-v5-p-nil") + // ... + if v == nil { + v5v2 = nil + } else { + v5v2 = make(map[interface{}]uint8, len(v)) + } // reset map + var v5v3, v5v4 typMapMapIntfUint8 + v5v3 = typMapMapIntfUint8(v5v1) + v5v4 = typMapMapIntfUint8(v5v2) + bs5 = testMarshalErr(v5v3, h, t, "enc-map-v5-custom") + testUnmarshalErr(v5v4, bs5, h, t, "dec-map-v5-p-len") + testDeepEqualErr(v5v3, v5v4, t, "equal-map-v5-p-len") + } + + for _, v := range []map[interface{}]uint16{nil, {}, {"string-is-an-interface": 0, "string-is-an-interface-2": 44}} { + // fmt.Printf(">>>> running mammoth map v6: %v\n", v) + var v6v1, v6v2 map[interface{}]uint16 + v6v1 = v + bs6 := testMarshalErr(v6v1, h, t, "enc-map-v6") + if v == nil { + v6v2 = nil + } else { + v6v2 = make(map[interface{}]uint16, len(v)) + } // reset map + testUnmarshalErr(v6v2, bs6, h, t, "dec-map-v6") + testDeepEqualErr(v6v1, v6v2, t, "equal-map-v6") + if v == nil { + v6v2 = nil + } else { + v6v2 = make(map[interface{}]uint16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v6v2), bs6, h, t, "dec-map-v6-noaddr") // decode into non-addressable map value + testDeepEqualErr(v6v1, v6v2, t, "equal-map-v6-noaddr") + if v == nil { + v6v2 = nil + } else { + v6v2 = make(map[interface{}]uint16, len(v)) + } // reset map + testUnmarshalErr(&v6v2, bs6, h, t, "dec-map-v6-p-len") + testDeepEqualErr(v6v1, v6v2, t, "equal-map-v6-p-len") + bs6 = testMarshalErr(&v6v1, h, t, "enc-map-v6-p") + v6v2 = nil + testUnmarshalErr(&v6v2, bs6, h, t, "dec-map-v6-p-nil") + testDeepEqualErr(v6v1, v6v2, t, "equal-map-v6-p-nil") + // ... + if v == nil { + v6v2 = nil + } else { + v6v2 = make(map[interface{}]uint16, len(v)) + } // reset map + var v6v3, v6v4 typMapMapIntfUint16 + v6v3 = typMapMapIntfUint16(v6v1) + v6v4 = typMapMapIntfUint16(v6v2) + bs6 = testMarshalErr(v6v3, h, t, "enc-map-v6-custom") + testUnmarshalErr(v6v4, bs6, h, t, "dec-map-v6-p-len") + testDeepEqualErr(v6v3, v6v4, t, "equal-map-v6-p-len") + } + + for _, v := range []map[interface{}]uint32{nil, {}, {"string-is-an-interface": 0, "string-is-an-interface-2": 33}} { + // fmt.Printf(">>>> running mammoth map v7: %v\n", v) + var v7v1, v7v2 map[interface{}]uint32 + v7v1 = v + bs7 := testMarshalErr(v7v1, h, t, "enc-map-v7") + if v == nil { + v7v2 = nil + } else { + v7v2 = make(map[interface{}]uint32, len(v)) + } // reset map + testUnmarshalErr(v7v2, bs7, h, t, "dec-map-v7") + testDeepEqualErr(v7v1, v7v2, t, "equal-map-v7") + if v == nil { + v7v2 = nil + } else { + v7v2 = make(map[interface{}]uint32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v7v2), bs7, h, t, "dec-map-v7-noaddr") // decode into non-addressable map value + testDeepEqualErr(v7v1, v7v2, t, "equal-map-v7-noaddr") + if v == nil { + v7v2 = nil + } else { + v7v2 = make(map[interface{}]uint32, len(v)) + } // reset map + testUnmarshalErr(&v7v2, bs7, h, t, "dec-map-v7-p-len") + testDeepEqualErr(v7v1, v7v2, t, "equal-map-v7-p-len") + bs7 = testMarshalErr(&v7v1, h, t, "enc-map-v7-p") + v7v2 = nil + testUnmarshalErr(&v7v2, bs7, h, t, "dec-map-v7-p-nil") + testDeepEqualErr(v7v1, v7v2, t, "equal-map-v7-p-nil") + // ... + if v == nil { + v7v2 = nil + } else { + v7v2 = make(map[interface{}]uint32, len(v)) + } // reset map + var v7v3, v7v4 typMapMapIntfUint32 + v7v3 = typMapMapIntfUint32(v7v1) + v7v4 = typMapMapIntfUint32(v7v2) + bs7 = testMarshalErr(v7v3, h, t, "enc-map-v7-custom") + testUnmarshalErr(v7v4, bs7, h, t, "dec-map-v7-p-len") + testDeepEqualErr(v7v3, v7v4, t, "equal-map-v7-p-len") + } + + for _, v := range []map[interface{}]uint64{nil, {}, {"string-is-an-interface": 0, "string-is-an-interface-2": 44}} { + // fmt.Printf(">>>> running mammoth map v8: %v\n", v) + var v8v1, v8v2 map[interface{}]uint64 + v8v1 = v + bs8 := testMarshalErr(v8v1, h, t, "enc-map-v8") + if v == nil { + v8v2 = nil + } else { + v8v2 = make(map[interface{}]uint64, len(v)) + } // reset map + testUnmarshalErr(v8v2, bs8, h, t, "dec-map-v8") + testDeepEqualErr(v8v1, v8v2, t, "equal-map-v8") + if v == nil { + v8v2 = nil + } else { + v8v2 = make(map[interface{}]uint64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v8v2), bs8, h, t, "dec-map-v8-noaddr") // decode into non-addressable map value + testDeepEqualErr(v8v1, v8v2, t, "equal-map-v8-noaddr") + if v == nil { + v8v2 = nil + } else { + v8v2 = make(map[interface{}]uint64, len(v)) + } // reset map + testUnmarshalErr(&v8v2, bs8, h, t, "dec-map-v8-p-len") + testDeepEqualErr(v8v1, v8v2, t, "equal-map-v8-p-len") + bs8 = testMarshalErr(&v8v1, h, t, "enc-map-v8-p") + v8v2 = nil + testUnmarshalErr(&v8v2, bs8, h, t, "dec-map-v8-p-nil") + testDeepEqualErr(v8v1, v8v2, t, "equal-map-v8-p-nil") + // ... + if v == nil { + v8v2 = nil + } else { + v8v2 = make(map[interface{}]uint64, len(v)) + } // reset map + var v8v3, v8v4 typMapMapIntfUint64 + v8v3 = typMapMapIntfUint64(v8v1) + v8v4 = typMapMapIntfUint64(v8v2) + bs8 = testMarshalErr(v8v3, h, t, "enc-map-v8-custom") + testUnmarshalErr(v8v4, bs8, h, t, "dec-map-v8-p-len") + testDeepEqualErr(v8v3, v8v4, t, "equal-map-v8-p-len") + } + + for _, v := range []map[interface{}]uintptr{nil, {}, {"string-is-an-interface": 0, "string-is-an-interface-2": 33}} { + // fmt.Printf(">>>> running mammoth map v9: %v\n", v) + var v9v1, v9v2 map[interface{}]uintptr + v9v1 = v + bs9 := testMarshalErr(v9v1, h, t, "enc-map-v9") + if v == nil { + v9v2 = nil + } else { + v9v2 = make(map[interface{}]uintptr, len(v)) + } // reset map + testUnmarshalErr(v9v2, bs9, h, t, "dec-map-v9") + testDeepEqualErr(v9v1, v9v2, t, "equal-map-v9") + if v == nil { + v9v2 = nil + } else { + v9v2 = make(map[interface{}]uintptr, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v9v2), bs9, h, t, "dec-map-v9-noaddr") // decode into non-addressable map value + testDeepEqualErr(v9v1, v9v2, t, "equal-map-v9-noaddr") + if v == nil { + v9v2 = nil + } else { + v9v2 = make(map[interface{}]uintptr, len(v)) + } // reset map + testUnmarshalErr(&v9v2, bs9, h, t, "dec-map-v9-p-len") + testDeepEqualErr(v9v1, v9v2, t, "equal-map-v9-p-len") + bs9 = testMarshalErr(&v9v1, h, t, "enc-map-v9-p") + v9v2 = nil + testUnmarshalErr(&v9v2, bs9, h, t, "dec-map-v9-p-nil") + testDeepEqualErr(v9v1, v9v2, t, "equal-map-v9-p-nil") + // ... + if v == nil { + v9v2 = nil + } else { + v9v2 = make(map[interface{}]uintptr, len(v)) + } // reset map + var v9v3, v9v4 typMapMapIntfUintptr + v9v3 = typMapMapIntfUintptr(v9v1) + v9v4 = typMapMapIntfUintptr(v9v2) + bs9 = testMarshalErr(v9v3, h, t, "enc-map-v9-custom") + testUnmarshalErr(v9v4, bs9, h, t, "dec-map-v9-p-len") + testDeepEqualErr(v9v3, v9v4, t, "equal-map-v9-p-len") + } + + for _, v := range []map[interface{}]int{nil, {}, {"string-is-an-interface": 0, "string-is-an-interface-2": 44}} { + // fmt.Printf(">>>> running mammoth map v10: %v\n", v) + var v10v1, v10v2 map[interface{}]int + v10v1 = v + bs10 := testMarshalErr(v10v1, h, t, "enc-map-v10") + if v == nil { + v10v2 = nil + } else { + v10v2 = make(map[interface{}]int, len(v)) + } // reset map + testUnmarshalErr(v10v2, bs10, h, t, "dec-map-v10") + testDeepEqualErr(v10v1, v10v2, t, "equal-map-v10") + if v == nil { + v10v2 = nil + } else { + v10v2 = make(map[interface{}]int, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v10v2), bs10, h, t, "dec-map-v10-noaddr") // decode into non-addressable map value + testDeepEqualErr(v10v1, v10v2, t, "equal-map-v10-noaddr") + if v == nil { + v10v2 = nil + } else { + v10v2 = make(map[interface{}]int, len(v)) + } // reset map + testUnmarshalErr(&v10v2, bs10, h, t, "dec-map-v10-p-len") + testDeepEqualErr(v10v1, v10v2, t, "equal-map-v10-p-len") + bs10 = testMarshalErr(&v10v1, h, t, "enc-map-v10-p") + v10v2 = nil + testUnmarshalErr(&v10v2, bs10, h, t, "dec-map-v10-p-nil") + testDeepEqualErr(v10v1, v10v2, t, "equal-map-v10-p-nil") + // ... + if v == nil { + v10v2 = nil + } else { + v10v2 = make(map[interface{}]int, len(v)) + } // reset map + var v10v3, v10v4 typMapMapIntfInt + v10v3 = typMapMapIntfInt(v10v1) + v10v4 = typMapMapIntfInt(v10v2) + bs10 = testMarshalErr(v10v3, h, t, "enc-map-v10-custom") + testUnmarshalErr(v10v4, bs10, h, t, "dec-map-v10-p-len") + testDeepEqualErr(v10v3, v10v4, t, "equal-map-v10-p-len") + } + + for _, v := range []map[interface{}]int8{nil, {}, {"string-is-an-interface": 0, "string-is-an-interface-2": 33}} { + // fmt.Printf(">>>> running mammoth map v11: %v\n", v) + var v11v1, v11v2 map[interface{}]int8 + v11v1 = v + bs11 := testMarshalErr(v11v1, h, t, "enc-map-v11") + if v == nil { + v11v2 = nil + } else { + v11v2 = make(map[interface{}]int8, len(v)) + } // reset map + testUnmarshalErr(v11v2, bs11, h, t, "dec-map-v11") + testDeepEqualErr(v11v1, v11v2, t, "equal-map-v11") + if v == nil { + v11v2 = nil + } else { + v11v2 = make(map[interface{}]int8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v11v2), bs11, h, t, "dec-map-v11-noaddr") // decode into non-addressable map value + testDeepEqualErr(v11v1, v11v2, t, "equal-map-v11-noaddr") + if v == nil { + v11v2 = nil + } else { + v11v2 = make(map[interface{}]int8, len(v)) + } // reset map + testUnmarshalErr(&v11v2, bs11, h, t, "dec-map-v11-p-len") + testDeepEqualErr(v11v1, v11v2, t, "equal-map-v11-p-len") + bs11 = testMarshalErr(&v11v1, h, t, "enc-map-v11-p") + v11v2 = nil + testUnmarshalErr(&v11v2, bs11, h, t, "dec-map-v11-p-nil") + testDeepEqualErr(v11v1, v11v2, t, "equal-map-v11-p-nil") + // ... + if v == nil { + v11v2 = nil + } else { + v11v2 = make(map[interface{}]int8, len(v)) + } // reset map + var v11v3, v11v4 typMapMapIntfInt8 + v11v3 = typMapMapIntfInt8(v11v1) + v11v4 = typMapMapIntfInt8(v11v2) + bs11 = testMarshalErr(v11v3, h, t, "enc-map-v11-custom") + testUnmarshalErr(v11v4, bs11, h, t, "dec-map-v11-p-len") + testDeepEqualErr(v11v3, v11v4, t, "equal-map-v11-p-len") + } + + for _, v := range []map[interface{}]int16{nil, {}, {"string-is-an-interface": 0, "string-is-an-interface-2": 44}} { + // fmt.Printf(">>>> running mammoth map v12: %v\n", v) + var v12v1, v12v2 map[interface{}]int16 + v12v1 = v + bs12 := testMarshalErr(v12v1, h, t, "enc-map-v12") + if v == nil { + v12v2 = nil + } else { + v12v2 = make(map[interface{}]int16, len(v)) + } // reset map + testUnmarshalErr(v12v2, bs12, h, t, "dec-map-v12") + testDeepEqualErr(v12v1, v12v2, t, "equal-map-v12") + if v == nil { + v12v2 = nil + } else { + v12v2 = make(map[interface{}]int16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v12v2), bs12, h, t, "dec-map-v12-noaddr") // decode into non-addressable map value + testDeepEqualErr(v12v1, v12v2, t, "equal-map-v12-noaddr") + if v == nil { + v12v2 = nil + } else { + v12v2 = make(map[interface{}]int16, len(v)) + } // reset map + testUnmarshalErr(&v12v2, bs12, h, t, "dec-map-v12-p-len") + testDeepEqualErr(v12v1, v12v2, t, "equal-map-v12-p-len") + bs12 = testMarshalErr(&v12v1, h, t, "enc-map-v12-p") + v12v2 = nil + testUnmarshalErr(&v12v2, bs12, h, t, "dec-map-v12-p-nil") + testDeepEqualErr(v12v1, v12v2, t, "equal-map-v12-p-nil") + // ... + if v == nil { + v12v2 = nil + } else { + v12v2 = make(map[interface{}]int16, len(v)) + } // reset map + var v12v3, v12v4 typMapMapIntfInt16 + v12v3 = typMapMapIntfInt16(v12v1) + v12v4 = typMapMapIntfInt16(v12v2) + bs12 = testMarshalErr(v12v3, h, t, "enc-map-v12-custom") + testUnmarshalErr(v12v4, bs12, h, t, "dec-map-v12-p-len") + testDeepEqualErr(v12v3, v12v4, t, "equal-map-v12-p-len") + } + + for _, v := range []map[interface{}]int32{nil, {}, {"string-is-an-interface": 0, "string-is-an-interface-2": 33}} { + // fmt.Printf(">>>> running mammoth map v13: %v\n", v) + var v13v1, v13v2 map[interface{}]int32 + v13v1 = v + bs13 := testMarshalErr(v13v1, h, t, "enc-map-v13") + if v == nil { + v13v2 = nil + } else { + v13v2 = make(map[interface{}]int32, len(v)) + } // reset map + testUnmarshalErr(v13v2, bs13, h, t, "dec-map-v13") + testDeepEqualErr(v13v1, v13v2, t, "equal-map-v13") + if v == nil { + v13v2 = nil + } else { + v13v2 = make(map[interface{}]int32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v13v2), bs13, h, t, "dec-map-v13-noaddr") // decode into non-addressable map value + testDeepEqualErr(v13v1, v13v2, t, "equal-map-v13-noaddr") + if v == nil { + v13v2 = nil + } else { + v13v2 = make(map[interface{}]int32, len(v)) + } // reset map + testUnmarshalErr(&v13v2, bs13, h, t, "dec-map-v13-p-len") + testDeepEqualErr(v13v1, v13v2, t, "equal-map-v13-p-len") + bs13 = testMarshalErr(&v13v1, h, t, "enc-map-v13-p") + v13v2 = nil + testUnmarshalErr(&v13v2, bs13, h, t, "dec-map-v13-p-nil") + testDeepEqualErr(v13v1, v13v2, t, "equal-map-v13-p-nil") + // ... + if v == nil { + v13v2 = nil + } else { + v13v2 = make(map[interface{}]int32, len(v)) + } // reset map + var v13v3, v13v4 typMapMapIntfInt32 + v13v3 = typMapMapIntfInt32(v13v1) + v13v4 = typMapMapIntfInt32(v13v2) + bs13 = testMarshalErr(v13v3, h, t, "enc-map-v13-custom") + testUnmarshalErr(v13v4, bs13, h, t, "dec-map-v13-p-len") + testDeepEqualErr(v13v3, v13v4, t, "equal-map-v13-p-len") + } + + for _, v := range []map[interface{}]int64{nil, {}, {"string-is-an-interface": 0, "string-is-an-interface-2": 44}} { + // fmt.Printf(">>>> running mammoth map v14: %v\n", v) + var v14v1, v14v2 map[interface{}]int64 + v14v1 = v + bs14 := testMarshalErr(v14v1, h, t, "enc-map-v14") + if v == nil { + v14v2 = nil + } else { + v14v2 = make(map[interface{}]int64, len(v)) + } // reset map + testUnmarshalErr(v14v2, bs14, h, t, "dec-map-v14") + testDeepEqualErr(v14v1, v14v2, t, "equal-map-v14") + if v == nil { + v14v2 = nil + } else { + v14v2 = make(map[interface{}]int64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v14v2), bs14, h, t, "dec-map-v14-noaddr") // decode into non-addressable map value + testDeepEqualErr(v14v1, v14v2, t, "equal-map-v14-noaddr") + if v == nil { + v14v2 = nil + } else { + v14v2 = make(map[interface{}]int64, len(v)) + } // reset map + testUnmarshalErr(&v14v2, bs14, h, t, "dec-map-v14-p-len") + testDeepEqualErr(v14v1, v14v2, t, "equal-map-v14-p-len") + bs14 = testMarshalErr(&v14v1, h, t, "enc-map-v14-p") + v14v2 = nil + testUnmarshalErr(&v14v2, bs14, h, t, "dec-map-v14-p-nil") + testDeepEqualErr(v14v1, v14v2, t, "equal-map-v14-p-nil") + // ... + if v == nil { + v14v2 = nil + } else { + v14v2 = make(map[interface{}]int64, len(v)) + } // reset map + var v14v3, v14v4 typMapMapIntfInt64 + v14v3 = typMapMapIntfInt64(v14v1) + v14v4 = typMapMapIntfInt64(v14v2) + bs14 = testMarshalErr(v14v3, h, t, "enc-map-v14-custom") + testUnmarshalErr(v14v4, bs14, h, t, "dec-map-v14-p-len") + testDeepEqualErr(v14v3, v14v4, t, "equal-map-v14-p-len") + } + + for _, v := range []map[interface{}]float32{nil, {}, {"string-is-an-interface": 0, "string-is-an-interface-2": 22.2}} { + // fmt.Printf(">>>> running mammoth map v15: %v\n", v) + var v15v1, v15v2 map[interface{}]float32 + v15v1 = v + bs15 := testMarshalErr(v15v1, h, t, "enc-map-v15") + if v == nil { + v15v2 = nil + } else { + v15v2 = make(map[interface{}]float32, len(v)) + } // reset map + testUnmarshalErr(v15v2, bs15, h, t, "dec-map-v15") + testDeepEqualErr(v15v1, v15v2, t, "equal-map-v15") + if v == nil { + v15v2 = nil + } else { + v15v2 = make(map[interface{}]float32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v15v2), bs15, h, t, "dec-map-v15-noaddr") // decode into non-addressable map value + testDeepEqualErr(v15v1, v15v2, t, "equal-map-v15-noaddr") + if v == nil { + v15v2 = nil + } else { + v15v2 = make(map[interface{}]float32, len(v)) + } // reset map + testUnmarshalErr(&v15v2, bs15, h, t, "dec-map-v15-p-len") + testDeepEqualErr(v15v1, v15v2, t, "equal-map-v15-p-len") + bs15 = testMarshalErr(&v15v1, h, t, "enc-map-v15-p") + v15v2 = nil + testUnmarshalErr(&v15v2, bs15, h, t, "dec-map-v15-p-nil") + testDeepEqualErr(v15v1, v15v2, t, "equal-map-v15-p-nil") + // ... + if v == nil { + v15v2 = nil + } else { + v15v2 = make(map[interface{}]float32, len(v)) + } // reset map + var v15v3, v15v4 typMapMapIntfFloat32 + v15v3 = typMapMapIntfFloat32(v15v1) + v15v4 = typMapMapIntfFloat32(v15v2) + bs15 = testMarshalErr(v15v3, h, t, "enc-map-v15-custom") + testUnmarshalErr(v15v4, bs15, h, t, "dec-map-v15-p-len") + testDeepEqualErr(v15v3, v15v4, t, "equal-map-v15-p-len") + } + + for _, v := range []map[interface{}]float64{nil, {}, {"string-is-an-interface": 0, "string-is-an-interface-2": 11.1}} { + // fmt.Printf(">>>> running mammoth map v16: %v\n", v) + var v16v1, v16v2 map[interface{}]float64 + v16v1 = v + bs16 := testMarshalErr(v16v1, h, t, "enc-map-v16") + if v == nil { + v16v2 = nil + } else { + v16v2 = make(map[interface{}]float64, len(v)) + } // reset map + testUnmarshalErr(v16v2, bs16, h, t, "dec-map-v16") + testDeepEqualErr(v16v1, v16v2, t, "equal-map-v16") + if v == nil { + v16v2 = nil + } else { + v16v2 = make(map[interface{}]float64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v16v2), bs16, h, t, "dec-map-v16-noaddr") // decode into non-addressable map value + testDeepEqualErr(v16v1, v16v2, t, "equal-map-v16-noaddr") + if v == nil { + v16v2 = nil + } else { + v16v2 = make(map[interface{}]float64, len(v)) + } // reset map + testUnmarshalErr(&v16v2, bs16, h, t, "dec-map-v16-p-len") + testDeepEqualErr(v16v1, v16v2, t, "equal-map-v16-p-len") + bs16 = testMarshalErr(&v16v1, h, t, "enc-map-v16-p") + v16v2 = nil + testUnmarshalErr(&v16v2, bs16, h, t, "dec-map-v16-p-nil") + testDeepEqualErr(v16v1, v16v2, t, "equal-map-v16-p-nil") + // ... + if v == nil { + v16v2 = nil + } else { + v16v2 = make(map[interface{}]float64, len(v)) + } // reset map + var v16v3, v16v4 typMapMapIntfFloat64 + v16v3 = typMapMapIntfFloat64(v16v1) + v16v4 = typMapMapIntfFloat64(v16v2) + bs16 = testMarshalErr(v16v3, h, t, "enc-map-v16-custom") + testUnmarshalErr(v16v4, bs16, h, t, "dec-map-v16-p-len") + testDeepEqualErr(v16v3, v16v4, t, "equal-map-v16-p-len") + } + + for _, v := range []map[interface{}]bool{nil, {}, {"string-is-an-interface": false, "string-is-an-interface-2": true}} { + // fmt.Printf(">>>> running mammoth map v17: %v\n", v) + var v17v1, v17v2 map[interface{}]bool + v17v1 = v + bs17 := testMarshalErr(v17v1, h, t, "enc-map-v17") + if v == nil { + v17v2 = nil + } else { + v17v2 = make(map[interface{}]bool, len(v)) + } // reset map + testUnmarshalErr(v17v2, bs17, h, t, "dec-map-v17") + testDeepEqualErr(v17v1, v17v2, t, "equal-map-v17") + if v == nil { + v17v2 = nil + } else { + v17v2 = make(map[interface{}]bool, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v17v2), bs17, h, t, "dec-map-v17-noaddr") // decode into non-addressable map value + testDeepEqualErr(v17v1, v17v2, t, "equal-map-v17-noaddr") + if v == nil { + v17v2 = nil + } else { + v17v2 = make(map[interface{}]bool, len(v)) + } // reset map + testUnmarshalErr(&v17v2, bs17, h, t, "dec-map-v17-p-len") + testDeepEqualErr(v17v1, v17v2, t, "equal-map-v17-p-len") + bs17 = testMarshalErr(&v17v1, h, t, "enc-map-v17-p") + v17v2 = nil + testUnmarshalErr(&v17v2, bs17, h, t, "dec-map-v17-p-nil") + testDeepEqualErr(v17v1, v17v2, t, "equal-map-v17-p-nil") + // ... + if v == nil { + v17v2 = nil + } else { + v17v2 = make(map[interface{}]bool, len(v)) + } // reset map + var v17v3, v17v4 typMapMapIntfBool + v17v3 = typMapMapIntfBool(v17v1) + v17v4 = typMapMapIntfBool(v17v2) + bs17 = testMarshalErr(v17v3, h, t, "enc-map-v17-custom") + testUnmarshalErr(v17v4, bs17, h, t, "dec-map-v17-p-len") + testDeepEqualErr(v17v3, v17v4, t, "equal-map-v17-p-len") + } + + for _, v := range []map[string]interface{}{nil, {}, {"some-string": nil, "some-string-2": "string-is-an-interface"}} { + // fmt.Printf(">>>> running mammoth map v20: %v\n", v) + var v20v1, v20v2 map[string]interface{} + v20v1 = v + bs20 := testMarshalErr(v20v1, h, t, "enc-map-v20") + if v == nil { + v20v2 = nil + } else { + v20v2 = make(map[string]interface{}, len(v)) + } // reset map + testUnmarshalErr(v20v2, bs20, h, t, "dec-map-v20") + testDeepEqualErr(v20v1, v20v2, t, "equal-map-v20") + if v == nil { + v20v2 = nil + } else { + v20v2 = make(map[string]interface{}, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v20v2), bs20, h, t, "dec-map-v20-noaddr") // decode into non-addressable map value + testDeepEqualErr(v20v1, v20v2, t, "equal-map-v20-noaddr") + if v == nil { + v20v2 = nil + } else { + v20v2 = make(map[string]interface{}, len(v)) + } // reset map + testUnmarshalErr(&v20v2, bs20, h, t, "dec-map-v20-p-len") + testDeepEqualErr(v20v1, v20v2, t, "equal-map-v20-p-len") + bs20 = testMarshalErr(&v20v1, h, t, "enc-map-v20-p") + v20v2 = nil + testUnmarshalErr(&v20v2, bs20, h, t, "dec-map-v20-p-nil") + testDeepEqualErr(v20v1, v20v2, t, "equal-map-v20-p-nil") + // ... + if v == nil { + v20v2 = nil + } else { + v20v2 = make(map[string]interface{}, len(v)) + } // reset map + var v20v3, v20v4 typMapMapStringIntf + v20v3 = typMapMapStringIntf(v20v1) + v20v4 = typMapMapStringIntf(v20v2) + bs20 = testMarshalErr(v20v3, h, t, "enc-map-v20-custom") + testUnmarshalErr(v20v4, bs20, h, t, "dec-map-v20-p-len") + testDeepEqualErr(v20v3, v20v4, t, "equal-map-v20-p-len") + } + + for _, v := range []map[string]string{nil, {}, {"some-string": "", "some-string-2": "some-string"}} { + // fmt.Printf(">>>> running mammoth map v21: %v\n", v) + var v21v1, v21v2 map[string]string + v21v1 = v + bs21 := testMarshalErr(v21v1, h, t, "enc-map-v21") + if v == nil { + v21v2 = nil + } else { + v21v2 = make(map[string]string, len(v)) + } // reset map + testUnmarshalErr(v21v2, bs21, h, t, "dec-map-v21") + testDeepEqualErr(v21v1, v21v2, t, "equal-map-v21") + if v == nil { + v21v2 = nil + } else { + v21v2 = make(map[string]string, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v21v2), bs21, h, t, "dec-map-v21-noaddr") // decode into non-addressable map value + testDeepEqualErr(v21v1, v21v2, t, "equal-map-v21-noaddr") + if v == nil { + v21v2 = nil + } else { + v21v2 = make(map[string]string, len(v)) + } // reset map + testUnmarshalErr(&v21v2, bs21, h, t, "dec-map-v21-p-len") + testDeepEqualErr(v21v1, v21v2, t, "equal-map-v21-p-len") + bs21 = testMarshalErr(&v21v1, h, t, "enc-map-v21-p") + v21v2 = nil + testUnmarshalErr(&v21v2, bs21, h, t, "dec-map-v21-p-nil") + testDeepEqualErr(v21v1, v21v2, t, "equal-map-v21-p-nil") + // ... + if v == nil { + v21v2 = nil + } else { + v21v2 = make(map[string]string, len(v)) + } // reset map + var v21v3, v21v4 typMapMapStringString + v21v3 = typMapMapStringString(v21v1) + v21v4 = typMapMapStringString(v21v2) + bs21 = testMarshalErr(v21v3, h, t, "enc-map-v21-custom") + testUnmarshalErr(v21v4, bs21, h, t, "dec-map-v21-p-len") + testDeepEqualErr(v21v3, v21v4, t, "equal-map-v21-p-len") + } + + for _, v := range []map[string]uint{nil, {}, {"some-string-2": 0, "some-string": 33}} { + // fmt.Printf(">>>> running mammoth map v22: %v\n", v) + var v22v1, v22v2 map[string]uint + v22v1 = v + bs22 := testMarshalErr(v22v1, h, t, "enc-map-v22") + if v == nil { + v22v2 = nil + } else { + v22v2 = make(map[string]uint, len(v)) + } // reset map + testUnmarshalErr(v22v2, bs22, h, t, "dec-map-v22") + testDeepEqualErr(v22v1, v22v2, t, "equal-map-v22") + if v == nil { + v22v2 = nil + } else { + v22v2 = make(map[string]uint, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v22v2), bs22, h, t, "dec-map-v22-noaddr") // decode into non-addressable map value + testDeepEqualErr(v22v1, v22v2, t, "equal-map-v22-noaddr") + if v == nil { + v22v2 = nil + } else { + v22v2 = make(map[string]uint, len(v)) + } // reset map + testUnmarshalErr(&v22v2, bs22, h, t, "dec-map-v22-p-len") + testDeepEqualErr(v22v1, v22v2, t, "equal-map-v22-p-len") + bs22 = testMarshalErr(&v22v1, h, t, "enc-map-v22-p") + v22v2 = nil + testUnmarshalErr(&v22v2, bs22, h, t, "dec-map-v22-p-nil") + testDeepEqualErr(v22v1, v22v2, t, "equal-map-v22-p-nil") + // ... + if v == nil { + v22v2 = nil + } else { + v22v2 = make(map[string]uint, len(v)) + } // reset map + var v22v3, v22v4 typMapMapStringUint + v22v3 = typMapMapStringUint(v22v1) + v22v4 = typMapMapStringUint(v22v2) + bs22 = testMarshalErr(v22v3, h, t, "enc-map-v22-custom") + testUnmarshalErr(v22v4, bs22, h, t, "dec-map-v22-p-len") + testDeepEqualErr(v22v3, v22v4, t, "equal-map-v22-p-len") + } + + for _, v := range []map[string]uint8{nil, {}, {"some-string-2": 0, "some-string": 44}} { + // fmt.Printf(">>>> running mammoth map v23: %v\n", v) + var v23v1, v23v2 map[string]uint8 + v23v1 = v + bs23 := testMarshalErr(v23v1, h, t, "enc-map-v23") + if v == nil { + v23v2 = nil + } else { + v23v2 = make(map[string]uint8, len(v)) + } // reset map + testUnmarshalErr(v23v2, bs23, h, t, "dec-map-v23") + testDeepEqualErr(v23v1, v23v2, t, "equal-map-v23") + if v == nil { + v23v2 = nil + } else { + v23v2 = make(map[string]uint8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v23v2), bs23, h, t, "dec-map-v23-noaddr") // decode into non-addressable map value + testDeepEqualErr(v23v1, v23v2, t, "equal-map-v23-noaddr") + if v == nil { + v23v2 = nil + } else { + v23v2 = make(map[string]uint8, len(v)) + } // reset map + testUnmarshalErr(&v23v2, bs23, h, t, "dec-map-v23-p-len") + testDeepEqualErr(v23v1, v23v2, t, "equal-map-v23-p-len") + bs23 = testMarshalErr(&v23v1, h, t, "enc-map-v23-p") + v23v2 = nil + testUnmarshalErr(&v23v2, bs23, h, t, "dec-map-v23-p-nil") + testDeepEqualErr(v23v1, v23v2, t, "equal-map-v23-p-nil") + // ... + if v == nil { + v23v2 = nil + } else { + v23v2 = make(map[string]uint8, len(v)) + } // reset map + var v23v3, v23v4 typMapMapStringUint8 + v23v3 = typMapMapStringUint8(v23v1) + v23v4 = typMapMapStringUint8(v23v2) + bs23 = testMarshalErr(v23v3, h, t, "enc-map-v23-custom") + testUnmarshalErr(v23v4, bs23, h, t, "dec-map-v23-p-len") + testDeepEqualErr(v23v3, v23v4, t, "equal-map-v23-p-len") + } + + for _, v := range []map[string]uint16{nil, {}, {"some-string-2": 0, "some-string": 33}} { + // fmt.Printf(">>>> running mammoth map v24: %v\n", v) + var v24v1, v24v2 map[string]uint16 + v24v1 = v + bs24 := testMarshalErr(v24v1, h, t, "enc-map-v24") + if v == nil { + v24v2 = nil + } else { + v24v2 = make(map[string]uint16, len(v)) + } // reset map + testUnmarshalErr(v24v2, bs24, h, t, "dec-map-v24") + testDeepEqualErr(v24v1, v24v2, t, "equal-map-v24") + if v == nil { + v24v2 = nil + } else { + v24v2 = make(map[string]uint16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v24v2), bs24, h, t, "dec-map-v24-noaddr") // decode into non-addressable map value + testDeepEqualErr(v24v1, v24v2, t, "equal-map-v24-noaddr") + if v == nil { + v24v2 = nil + } else { + v24v2 = make(map[string]uint16, len(v)) + } // reset map + testUnmarshalErr(&v24v2, bs24, h, t, "dec-map-v24-p-len") + testDeepEqualErr(v24v1, v24v2, t, "equal-map-v24-p-len") + bs24 = testMarshalErr(&v24v1, h, t, "enc-map-v24-p") + v24v2 = nil + testUnmarshalErr(&v24v2, bs24, h, t, "dec-map-v24-p-nil") + testDeepEqualErr(v24v1, v24v2, t, "equal-map-v24-p-nil") + // ... + if v == nil { + v24v2 = nil + } else { + v24v2 = make(map[string]uint16, len(v)) + } // reset map + var v24v3, v24v4 typMapMapStringUint16 + v24v3 = typMapMapStringUint16(v24v1) + v24v4 = typMapMapStringUint16(v24v2) + bs24 = testMarshalErr(v24v3, h, t, "enc-map-v24-custom") + testUnmarshalErr(v24v4, bs24, h, t, "dec-map-v24-p-len") + testDeepEqualErr(v24v3, v24v4, t, "equal-map-v24-p-len") + } + + for _, v := range []map[string]uint32{nil, {}, {"some-string-2": 0, "some-string": 44}} { + // fmt.Printf(">>>> running mammoth map v25: %v\n", v) + var v25v1, v25v2 map[string]uint32 + v25v1 = v + bs25 := testMarshalErr(v25v1, h, t, "enc-map-v25") + if v == nil { + v25v2 = nil + } else { + v25v2 = make(map[string]uint32, len(v)) + } // reset map + testUnmarshalErr(v25v2, bs25, h, t, "dec-map-v25") + testDeepEqualErr(v25v1, v25v2, t, "equal-map-v25") + if v == nil { + v25v2 = nil + } else { + v25v2 = make(map[string]uint32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v25v2), bs25, h, t, "dec-map-v25-noaddr") // decode into non-addressable map value + testDeepEqualErr(v25v1, v25v2, t, "equal-map-v25-noaddr") + if v == nil { + v25v2 = nil + } else { + v25v2 = make(map[string]uint32, len(v)) + } // reset map + testUnmarshalErr(&v25v2, bs25, h, t, "dec-map-v25-p-len") + testDeepEqualErr(v25v1, v25v2, t, "equal-map-v25-p-len") + bs25 = testMarshalErr(&v25v1, h, t, "enc-map-v25-p") + v25v2 = nil + testUnmarshalErr(&v25v2, bs25, h, t, "dec-map-v25-p-nil") + testDeepEqualErr(v25v1, v25v2, t, "equal-map-v25-p-nil") + // ... + if v == nil { + v25v2 = nil + } else { + v25v2 = make(map[string]uint32, len(v)) + } // reset map + var v25v3, v25v4 typMapMapStringUint32 + v25v3 = typMapMapStringUint32(v25v1) + v25v4 = typMapMapStringUint32(v25v2) + bs25 = testMarshalErr(v25v3, h, t, "enc-map-v25-custom") + testUnmarshalErr(v25v4, bs25, h, t, "dec-map-v25-p-len") + testDeepEqualErr(v25v3, v25v4, t, "equal-map-v25-p-len") + } + + for _, v := range []map[string]uint64{nil, {}, {"some-string-2": 0, "some-string": 33}} { + // fmt.Printf(">>>> running mammoth map v26: %v\n", v) + var v26v1, v26v2 map[string]uint64 + v26v1 = v + bs26 := testMarshalErr(v26v1, h, t, "enc-map-v26") + if v == nil { + v26v2 = nil + } else { + v26v2 = make(map[string]uint64, len(v)) + } // reset map + testUnmarshalErr(v26v2, bs26, h, t, "dec-map-v26") + testDeepEqualErr(v26v1, v26v2, t, "equal-map-v26") + if v == nil { + v26v2 = nil + } else { + v26v2 = make(map[string]uint64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v26v2), bs26, h, t, "dec-map-v26-noaddr") // decode into non-addressable map value + testDeepEqualErr(v26v1, v26v2, t, "equal-map-v26-noaddr") + if v == nil { + v26v2 = nil + } else { + v26v2 = make(map[string]uint64, len(v)) + } // reset map + testUnmarshalErr(&v26v2, bs26, h, t, "dec-map-v26-p-len") + testDeepEqualErr(v26v1, v26v2, t, "equal-map-v26-p-len") + bs26 = testMarshalErr(&v26v1, h, t, "enc-map-v26-p") + v26v2 = nil + testUnmarshalErr(&v26v2, bs26, h, t, "dec-map-v26-p-nil") + testDeepEqualErr(v26v1, v26v2, t, "equal-map-v26-p-nil") + // ... + if v == nil { + v26v2 = nil + } else { + v26v2 = make(map[string]uint64, len(v)) + } // reset map + var v26v3, v26v4 typMapMapStringUint64 + v26v3 = typMapMapStringUint64(v26v1) + v26v4 = typMapMapStringUint64(v26v2) + bs26 = testMarshalErr(v26v3, h, t, "enc-map-v26-custom") + testUnmarshalErr(v26v4, bs26, h, t, "dec-map-v26-p-len") + testDeepEqualErr(v26v3, v26v4, t, "equal-map-v26-p-len") + } + + for _, v := range []map[string]uintptr{nil, {}, {"some-string-2": 0, "some-string": 44}} { + // fmt.Printf(">>>> running mammoth map v27: %v\n", v) + var v27v1, v27v2 map[string]uintptr + v27v1 = v + bs27 := testMarshalErr(v27v1, h, t, "enc-map-v27") + if v == nil { + v27v2 = nil + } else { + v27v2 = make(map[string]uintptr, len(v)) + } // reset map + testUnmarshalErr(v27v2, bs27, h, t, "dec-map-v27") + testDeepEqualErr(v27v1, v27v2, t, "equal-map-v27") + if v == nil { + v27v2 = nil + } else { + v27v2 = make(map[string]uintptr, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v27v2), bs27, h, t, "dec-map-v27-noaddr") // decode into non-addressable map value + testDeepEqualErr(v27v1, v27v2, t, "equal-map-v27-noaddr") + if v == nil { + v27v2 = nil + } else { + v27v2 = make(map[string]uintptr, len(v)) + } // reset map + testUnmarshalErr(&v27v2, bs27, h, t, "dec-map-v27-p-len") + testDeepEqualErr(v27v1, v27v2, t, "equal-map-v27-p-len") + bs27 = testMarshalErr(&v27v1, h, t, "enc-map-v27-p") + v27v2 = nil + testUnmarshalErr(&v27v2, bs27, h, t, "dec-map-v27-p-nil") + testDeepEqualErr(v27v1, v27v2, t, "equal-map-v27-p-nil") + // ... + if v == nil { + v27v2 = nil + } else { + v27v2 = make(map[string]uintptr, len(v)) + } // reset map + var v27v3, v27v4 typMapMapStringUintptr + v27v3 = typMapMapStringUintptr(v27v1) + v27v4 = typMapMapStringUintptr(v27v2) + bs27 = testMarshalErr(v27v3, h, t, "enc-map-v27-custom") + testUnmarshalErr(v27v4, bs27, h, t, "dec-map-v27-p-len") + testDeepEqualErr(v27v3, v27v4, t, "equal-map-v27-p-len") + } + + for _, v := range []map[string]int{nil, {}, {"some-string-2": 0, "some-string": 33}} { + // fmt.Printf(">>>> running mammoth map v28: %v\n", v) + var v28v1, v28v2 map[string]int + v28v1 = v + bs28 := testMarshalErr(v28v1, h, t, "enc-map-v28") + if v == nil { + v28v2 = nil + } else { + v28v2 = make(map[string]int, len(v)) + } // reset map + testUnmarshalErr(v28v2, bs28, h, t, "dec-map-v28") + testDeepEqualErr(v28v1, v28v2, t, "equal-map-v28") + if v == nil { + v28v2 = nil + } else { + v28v2 = make(map[string]int, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v28v2), bs28, h, t, "dec-map-v28-noaddr") // decode into non-addressable map value + testDeepEqualErr(v28v1, v28v2, t, "equal-map-v28-noaddr") + if v == nil { + v28v2 = nil + } else { + v28v2 = make(map[string]int, len(v)) + } // reset map + testUnmarshalErr(&v28v2, bs28, h, t, "dec-map-v28-p-len") + testDeepEqualErr(v28v1, v28v2, t, "equal-map-v28-p-len") + bs28 = testMarshalErr(&v28v1, h, t, "enc-map-v28-p") + v28v2 = nil + testUnmarshalErr(&v28v2, bs28, h, t, "dec-map-v28-p-nil") + testDeepEqualErr(v28v1, v28v2, t, "equal-map-v28-p-nil") + // ... + if v == nil { + v28v2 = nil + } else { + v28v2 = make(map[string]int, len(v)) + } // reset map + var v28v3, v28v4 typMapMapStringInt + v28v3 = typMapMapStringInt(v28v1) + v28v4 = typMapMapStringInt(v28v2) + bs28 = testMarshalErr(v28v3, h, t, "enc-map-v28-custom") + testUnmarshalErr(v28v4, bs28, h, t, "dec-map-v28-p-len") + testDeepEqualErr(v28v3, v28v4, t, "equal-map-v28-p-len") + } + + for _, v := range []map[string]int8{nil, {}, {"some-string-2": 0, "some-string": 44}} { + // fmt.Printf(">>>> running mammoth map v29: %v\n", v) + var v29v1, v29v2 map[string]int8 + v29v1 = v + bs29 := testMarshalErr(v29v1, h, t, "enc-map-v29") + if v == nil { + v29v2 = nil + } else { + v29v2 = make(map[string]int8, len(v)) + } // reset map + testUnmarshalErr(v29v2, bs29, h, t, "dec-map-v29") + testDeepEqualErr(v29v1, v29v2, t, "equal-map-v29") + if v == nil { + v29v2 = nil + } else { + v29v2 = make(map[string]int8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v29v2), bs29, h, t, "dec-map-v29-noaddr") // decode into non-addressable map value + testDeepEqualErr(v29v1, v29v2, t, "equal-map-v29-noaddr") + if v == nil { + v29v2 = nil + } else { + v29v2 = make(map[string]int8, len(v)) + } // reset map + testUnmarshalErr(&v29v2, bs29, h, t, "dec-map-v29-p-len") + testDeepEqualErr(v29v1, v29v2, t, "equal-map-v29-p-len") + bs29 = testMarshalErr(&v29v1, h, t, "enc-map-v29-p") + v29v2 = nil + testUnmarshalErr(&v29v2, bs29, h, t, "dec-map-v29-p-nil") + testDeepEqualErr(v29v1, v29v2, t, "equal-map-v29-p-nil") + // ... + if v == nil { + v29v2 = nil + } else { + v29v2 = make(map[string]int8, len(v)) + } // reset map + var v29v3, v29v4 typMapMapStringInt8 + v29v3 = typMapMapStringInt8(v29v1) + v29v4 = typMapMapStringInt8(v29v2) + bs29 = testMarshalErr(v29v3, h, t, "enc-map-v29-custom") + testUnmarshalErr(v29v4, bs29, h, t, "dec-map-v29-p-len") + testDeepEqualErr(v29v3, v29v4, t, "equal-map-v29-p-len") + } + + for _, v := range []map[string]int16{nil, {}, {"some-string-2": 0, "some-string": 33}} { + // fmt.Printf(">>>> running mammoth map v30: %v\n", v) + var v30v1, v30v2 map[string]int16 + v30v1 = v + bs30 := testMarshalErr(v30v1, h, t, "enc-map-v30") + if v == nil { + v30v2 = nil + } else { + v30v2 = make(map[string]int16, len(v)) + } // reset map + testUnmarshalErr(v30v2, bs30, h, t, "dec-map-v30") + testDeepEqualErr(v30v1, v30v2, t, "equal-map-v30") + if v == nil { + v30v2 = nil + } else { + v30v2 = make(map[string]int16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v30v2), bs30, h, t, "dec-map-v30-noaddr") // decode into non-addressable map value + testDeepEqualErr(v30v1, v30v2, t, "equal-map-v30-noaddr") + if v == nil { + v30v2 = nil + } else { + v30v2 = make(map[string]int16, len(v)) + } // reset map + testUnmarshalErr(&v30v2, bs30, h, t, "dec-map-v30-p-len") + testDeepEqualErr(v30v1, v30v2, t, "equal-map-v30-p-len") + bs30 = testMarshalErr(&v30v1, h, t, "enc-map-v30-p") + v30v2 = nil + testUnmarshalErr(&v30v2, bs30, h, t, "dec-map-v30-p-nil") + testDeepEqualErr(v30v1, v30v2, t, "equal-map-v30-p-nil") + // ... + if v == nil { + v30v2 = nil + } else { + v30v2 = make(map[string]int16, len(v)) + } // reset map + var v30v3, v30v4 typMapMapStringInt16 + v30v3 = typMapMapStringInt16(v30v1) + v30v4 = typMapMapStringInt16(v30v2) + bs30 = testMarshalErr(v30v3, h, t, "enc-map-v30-custom") + testUnmarshalErr(v30v4, bs30, h, t, "dec-map-v30-p-len") + testDeepEqualErr(v30v3, v30v4, t, "equal-map-v30-p-len") + } + + for _, v := range []map[string]int32{nil, {}, {"some-string-2": 0, "some-string": 44}} { + // fmt.Printf(">>>> running mammoth map v31: %v\n", v) + var v31v1, v31v2 map[string]int32 + v31v1 = v + bs31 := testMarshalErr(v31v1, h, t, "enc-map-v31") + if v == nil { + v31v2 = nil + } else { + v31v2 = make(map[string]int32, len(v)) + } // reset map + testUnmarshalErr(v31v2, bs31, h, t, "dec-map-v31") + testDeepEqualErr(v31v1, v31v2, t, "equal-map-v31") + if v == nil { + v31v2 = nil + } else { + v31v2 = make(map[string]int32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v31v2), bs31, h, t, "dec-map-v31-noaddr") // decode into non-addressable map value + testDeepEqualErr(v31v1, v31v2, t, "equal-map-v31-noaddr") + if v == nil { + v31v2 = nil + } else { + v31v2 = make(map[string]int32, len(v)) + } // reset map + testUnmarshalErr(&v31v2, bs31, h, t, "dec-map-v31-p-len") + testDeepEqualErr(v31v1, v31v2, t, "equal-map-v31-p-len") + bs31 = testMarshalErr(&v31v1, h, t, "enc-map-v31-p") + v31v2 = nil + testUnmarshalErr(&v31v2, bs31, h, t, "dec-map-v31-p-nil") + testDeepEqualErr(v31v1, v31v2, t, "equal-map-v31-p-nil") + // ... + if v == nil { + v31v2 = nil + } else { + v31v2 = make(map[string]int32, len(v)) + } // reset map + var v31v3, v31v4 typMapMapStringInt32 + v31v3 = typMapMapStringInt32(v31v1) + v31v4 = typMapMapStringInt32(v31v2) + bs31 = testMarshalErr(v31v3, h, t, "enc-map-v31-custom") + testUnmarshalErr(v31v4, bs31, h, t, "dec-map-v31-p-len") + testDeepEqualErr(v31v3, v31v4, t, "equal-map-v31-p-len") + } + + for _, v := range []map[string]int64{nil, {}, {"some-string-2": 0, "some-string": 33}} { + // fmt.Printf(">>>> running mammoth map v32: %v\n", v) + var v32v1, v32v2 map[string]int64 + v32v1 = v + bs32 := testMarshalErr(v32v1, h, t, "enc-map-v32") + if v == nil { + v32v2 = nil + } else { + v32v2 = make(map[string]int64, len(v)) + } // reset map + testUnmarshalErr(v32v2, bs32, h, t, "dec-map-v32") + testDeepEqualErr(v32v1, v32v2, t, "equal-map-v32") + if v == nil { + v32v2 = nil + } else { + v32v2 = make(map[string]int64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v32v2), bs32, h, t, "dec-map-v32-noaddr") // decode into non-addressable map value + testDeepEqualErr(v32v1, v32v2, t, "equal-map-v32-noaddr") + if v == nil { + v32v2 = nil + } else { + v32v2 = make(map[string]int64, len(v)) + } // reset map + testUnmarshalErr(&v32v2, bs32, h, t, "dec-map-v32-p-len") + testDeepEqualErr(v32v1, v32v2, t, "equal-map-v32-p-len") + bs32 = testMarshalErr(&v32v1, h, t, "enc-map-v32-p") + v32v2 = nil + testUnmarshalErr(&v32v2, bs32, h, t, "dec-map-v32-p-nil") + testDeepEqualErr(v32v1, v32v2, t, "equal-map-v32-p-nil") + // ... + if v == nil { + v32v2 = nil + } else { + v32v2 = make(map[string]int64, len(v)) + } // reset map + var v32v3, v32v4 typMapMapStringInt64 + v32v3 = typMapMapStringInt64(v32v1) + v32v4 = typMapMapStringInt64(v32v2) + bs32 = testMarshalErr(v32v3, h, t, "enc-map-v32-custom") + testUnmarshalErr(v32v4, bs32, h, t, "dec-map-v32-p-len") + testDeepEqualErr(v32v3, v32v4, t, "equal-map-v32-p-len") + } + + for _, v := range []map[string]float32{nil, {}, {"some-string-2": 0, "some-string": 22.2}} { + // fmt.Printf(">>>> running mammoth map v33: %v\n", v) + var v33v1, v33v2 map[string]float32 + v33v1 = v + bs33 := testMarshalErr(v33v1, h, t, "enc-map-v33") + if v == nil { + v33v2 = nil + } else { + v33v2 = make(map[string]float32, len(v)) + } // reset map + testUnmarshalErr(v33v2, bs33, h, t, "dec-map-v33") + testDeepEqualErr(v33v1, v33v2, t, "equal-map-v33") + if v == nil { + v33v2 = nil + } else { + v33v2 = make(map[string]float32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v33v2), bs33, h, t, "dec-map-v33-noaddr") // decode into non-addressable map value + testDeepEqualErr(v33v1, v33v2, t, "equal-map-v33-noaddr") + if v == nil { + v33v2 = nil + } else { + v33v2 = make(map[string]float32, len(v)) + } // reset map + testUnmarshalErr(&v33v2, bs33, h, t, "dec-map-v33-p-len") + testDeepEqualErr(v33v1, v33v2, t, "equal-map-v33-p-len") + bs33 = testMarshalErr(&v33v1, h, t, "enc-map-v33-p") + v33v2 = nil + testUnmarshalErr(&v33v2, bs33, h, t, "dec-map-v33-p-nil") + testDeepEqualErr(v33v1, v33v2, t, "equal-map-v33-p-nil") + // ... + if v == nil { + v33v2 = nil + } else { + v33v2 = make(map[string]float32, len(v)) + } // reset map + var v33v3, v33v4 typMapMapStringFloat32 + v33v3 = typMapMapStringFloat32(v33v1) + v33v4 = typMapMapStringFloat32(v33v2) + bs33 = testMarshalErr(v33v3, h, t, "enc-map-v33-custom") + testUnmarshalErr(v33v4, bs33, h, t, "dec-map-v33-p-len") + testDeepEqualErr(v33v3, v33v4, t, "equal-map-v33-p-len") + } + + for _, v := range []map[string]float64{nil, {}, {"some-string-2": 0, "some-string": 11.1}} { + // fmt.Printf(">>>> running mammoth map v34: %v\n", v) + var v34v1, v34v2 map[string]float64 + v34v1 = v + bs34 := testMarshalErr(v34v1, h, t, "enc-map-v34") + if v == nil { + v34v2 = nil + } else { + v34v2 = make(map[string]float64, len(v)) + } // reset map + testUnmarshalErr(v34v2, bs34, h, t, "dec-map-v34") + testDeepEqualErr(v34v1, v34v2, t, "equal-map-v34") + if v == nil { + v34v2 = nil + } else { + v34v2 = make(map[string]float64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v34v2), bs34, h, t, "dec-map-v34-noaddr") // decode into non-addressable map value + testDeepEqualErr(v34v1, v34v2, t, "equal-map-v34-noaddr") + if v == nil { + v34v2 = nil + } else { + v34v2 = make(map[string]float64, len(v)) + } // reset map + testUnmarshalErr(&v34v2, bs34, h, t, "dec-map-v34-p-len") + testDeepEqualErr(v34v1, v34v2, t, "equal-map-v34-p-len") + bs34 = testMarshalErr(&v34v1, h, t, "enc-map-v34-p") + v34v2 = nil + testUnmarshalErr(&v34v2, bs34, h, t, "dec-map-v34-p-nil") + testDeepEqualErr(v34v1, v34v2, t, "equal-map-v34-p-nil") + // ... + if v == nil { + v34v2 = nil + } else { + v34v2 = make(map[string]float64, len(v)) + } // reset map + var v34v3, v34v4 typMapMapStringFloat64 + v34v3 = typMapMapStringFloat64(v34v1) + v34v4 = typMapMapStringFloat64(v34v2) + bs34 = testMarshalErr(v34v3, h, t, "enc-map-v34-custom") + testUnmarshalErr(v34v4, bs34, h, t, "dec-map-v34-p-len") + testDeepEqualErr(v34v3, v34v4, t, "equal-map-v34-p-len") + } + + for _, v := range []map[string]bool{nil, {}, {"some-string-2": false, "some-string": true}} { + // fmt.Printf(">>>> running mammoth map v35: %v\n", v) + var v35v1, v35v2 map[string]bool + v35v1 = v + bs35 := testMarshalErr(v35v1, h, t, "enc-map-v35") + if v == nil { + v35v2 = nil + } else { + v35v2 = make(map[string]bool, len(v)) + } // reset map + testUnmarshalErr(v35v2, bs35, h, t, "dec-map-v35") + testDeepEqualErr(v35v1, v35v2, t, "equal-map-v35") + if v == nil { + v35v2 = nil + } else { + v35v2 = make(map[string]bool, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v35v2), bs35, h, t, "dec-map-v35-noaddr") // decode into non-addressable map value + testDeepEqualErr(v35v1, v35v2, t, "equal-map-v35-noaddr") + if v == nil { + v35v2 = nil + } else { + v35v2 = make(map[string]bool, len(v)) + } // reset map + testUnmarshalErr(&v35v2, bs35, h, t, "dec-map-v35-p-len") + testDeepEqualErr(v35v1, v35v2, t, "equal-map-v35-p-len") + bs35 = testMarshalErr(&v35v1, h, t, "enc-map-v35-p") + v35v2 = nil + testUnmarshalErr(&v35v2, bs35, h, t, "dec-map-v35-p-nil") + testDeepEqualErr(v35v1, v35v2, t, "equal-map-v35-p-nil") + // ... + if v == nil { + v35v2 = nil + } else { + v35v2 = make(map[string]bool, len(v)) + } // reset map + var v35v3, v35v4 typMapMapStringBool + v35v3 = typMapMapStringBool(v35v1) + v35v4 = typMapMapStringBool(v35v2) + bs35 = testMarshalErr(v35v3, h, t, "enc-map-v35-custom") + testUnmarshalErr(v35v4, bs35, h, t, "dec-map-v35-p-len") + testDeepEqualErr(v35v3, v35v4, t, "equal-map-v35-p-len") + } + + for _, v := range []map[float32]interface{}{nil, {}, {22.2: nil, 11.1: "string-is-an-interface-2"}} { + // fmt.Printf(">>>> running mammoth map v38: %v\n", v) + var v38v1, v38v2 map[float32]interface{} + v38v1 = v + bs38 := testMarshalErr(v38v1, h, t, "enc-map-v38") + if v == nil { + v38v2 = nil + } else { + v38v2 = make(map[float32]interface{}, len(v)) + } // reset map + testUnmarshalErr(v38v2, bs38, h, t, "dec-map-v38") + testDeepEqualErr(v38v1, v38v2, t, "equal-map-v38") + if v == nil { + v38v2 = nil + } else { + v38v2 = make(map[float32]interface{}, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v38v2), bs38, h, t, "dec-map-v38-noaddr") // decode into non-addressable map value + testDeepEqualErr(v38v1, v38v2, t, "equal-map-v38-noaddr") + if v == nil { + v38v2 = nil + } else { + v38v2 = make(map[float32]interface{}, len(v)) + } // reset map + testUnmarshalErr(&v38v2, bs38, h, t, "dec-map-v38-p-len") + testDeepEqualErr(v38v1, v38v2, t, "equal-map-v38-p-len") + bs38 = testMarshalErr(&v38v1, h, t, "enc-map-v38-p") + v38v2 = nil + testUnmarshalErr(&v38v2, bs38, h, t, "dec-map-v38-p-nil") + testDeepEqualErr(v38v1, v38v2, t, "equal-map-v38-p-nil") + // ... + if v == nil { + v38v2 = nil + } else { + v38v2 = make(map[float32]interface{}, len(v)) + } // reset map + var v38v3, v38v4 typMapMapFloat32Intf + v38v3 = typMapMapFloat32Intf(v38v1) + v38v4 = typMapMapFloat32Intf(v38v2) + bs38 = testMarshalErr(v38v3, h, t, "enc-map-v38-custom") + testUnmarshalErr(v38v4, bs38, h, t, "dec-map-v38-p-len") + testDeepEqualErr(v38v3, v38v4, t, "equal-map-v38-p-len") + } + + for _, v := range []map[float32]string{nil, {}, {22.2: "", 11.1: "some-string-2"}} { + // fmt.Printf(">>>> running mammoth map v39: %v\n", v) + var v39v1, v39v2 map[float32]string + v39v1 = v + bs39 := testMarshalErr(v39v1, h, t, "enc-map-v39") + if v == nil { + v39v2 = nil + } else { + v39v2 = make(map[float32]string, len(v)) + } // reset map + testUnmarshalErr(v39v2, bs39, h, t, "dec-map-v39") + testDeepEqualErr(v39v1, v39v2, t, "equal-map-v39") + if v == nil { + v39v2 = nil + } else { + v39v2 = make(map[float32]string, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v39v2), bs39, h, t, "dec-map-v39-noaddr") // decode into non-addressable map value + testDeepEqualErr(v39v1, v39v2, t, "equal-map-v39-noaddr") + if v == nil { + v39v2 = nil + } else { + v39v2 = make(map[float32]string, len(v)) + } // reset map + testUnmarshalErr(&v39v2, bs39, h, t, "dec-map-v39-p-len") + testDeepEqualErr(v39v1, v39v2, t, "equal-map-v39-p-len") + bs39 = testMarshalErr(&v39v1, h, t, "enc-map-v39-p") + v39v2 = nil + testUnmarshalErr(&v39v2, bs39, h, t, "dec-map-v39-p-nil") + testDeepEqualErr(v39v1, v39v2, t, "equal-map-v39-p-nil") + // ... + if v == nil { + v39v2 = nil + } else { + v39v2 = make(map[float32]string, len(v)) + } // reset map + var v39v3, v39v4 typMapMapFloat32String + v39v3 = typMapMapFloat32String(v39v1) + v39v4 = typMapMapFloat32String(v39v2) + bs39 = testMarshalErr(v39v3, h, t, "enc-map-v39-custom") + testUnmarshalErr(v39v4, bs39, h, t, "dec-map-v39-p-len") + testDeepEqualErr(v39v3, v39v4, t, "equal-map-v39-p-len") + } + + for _, v := range []map[float32]uint{nil, {}, {22.2: 0, 11.1: 44}} { + // fmt.Printf(">>>> running mammoth map v40: %v\n", v) + var v40v1, v40v2 map[float32]uint + v40v1 = v + bs40 := testMarshalErr(v40v1, h, t, "enc-map-v40") + if v == nil { + v40v2 = nil + } else { + v40v2 = make(map[float32]uint, len(v)) + } // reset map + testUnmarshalErr(v40v2, bs40, h, t, "dec-map-v40") + testDeepEqualErr(v40v1, v40v2, t, "equal-map-v40") + if v == nil { + v40v2 = nil + } else { + v40v2 = make(map[float32]uint, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v40v2), bs40, h, t, "dec-map-v40-noaddr") // decode into non-addressable map value + testDeepEqualErr(v40v1, v40v2, t, "equal-map-v40-noaddr") + if v == nil { + v40v2 = nil + } else { + v40v2 = make(map[float32]uint, len(v)) + } // reset map + testUnmarshalErr(&v40v2, bs40, h, t, "dec-map-v40-p-len") + testDeepEqualErr(v40v1, v40v2, t, "equal-map-v40-p-len") + bs40 = testMarshalErr(&v40v1, h, t, "enc-map-v40-p") + v40v2 = nil + testUnmarshalErr(&v40v2, bs40, h, t, "dec-map-v40-p-nil") + testDeepEqualErr(v40v1, v40v2, t, "equal-map-v40-p-nil") + // ... + if v == nil { + v40v2 = nil + } else { + v40v2 = make(map[float32]uint, len(v)) + } // reset map + var v40v3, v40v4 typMapMapFloat32Uint + v40v3 = typMapMapFloat32Uint(v40v1) + v40v4 = typMapMapFloat32Uint(v40v2) + bs40 = testMarshalErr(v40v3, h, t, "enc-map-v40-custom") + testUnmarshalErr(v40v4, bs40, h, t, "dec-map-v40-p-len") + testDeepEqualErr(v40v3, v40v4, t, "equal-map-v40-p-len") + } + + for _, v := range []map[float32]uint8{nil, {}, {22.2: 0, 11.1: 33}} { + // fmt.Printf(">>>> running mammoth map v41: %v\n", v) + var v41v1, v41v2 map[float32]uint8 + v41v1 = v + bs41 := testMarshalErr(v41v1, h, t, "enc-map-v41") + if v == nil { + v41v2 = nil + } else { + v41v2 = make(map[float32]uint8, len(v)) + } // reset map + testUnmarshalErr(v41v2, bs41, h, t, "dec-map-v41") + testDeepEqualErr(v41v1, v41v2, t, "equal-map-v41") + if v == nil { + v41v2 = nil + } else { + v41v2 = make(map[float32]uint8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v41v2), bs41, h, t, "dec-map-v41-noaddr") // decode into non-addressable map value + testDeepEqualErr(v41v1, v41v2, t, "equal-map-v41-noaddr") + if v == nil { + v41v2 = nil + } else { + v41v2 = make(map[float32]uint8, len(v)) + } // reset map + testUnmarshalErr(&v41v2, bs41, h, t, "dec-map-v41-p-len") + testDeepEqualErr(v41v1, v41v2, t, "equal-map-v41-p-len") + bs41 = testMarshalErr(&v41v1, h, t, "enc-map-v41-p") + v41v2 = nil + testUnmarshalErr(&v41v2, bs41, h, t, "dec-map-v41-p-nil") + testDeepEqualErr(v41v1, v41v2, t, "equal-map-v41-p-nil") + // ... + if v == nil { + v41v2 = nil + } else { + v41v2 = make(map[float32]uint8, len(v)) + } // reset map + var v41v3, v41v4 typMapMapFloat32Uint8 + v41v3 = typMapMapFloat32Uint8(v41v1) + v41v4 = typMapMapFloat32Uint8(v41v2) + bs41 = testMarshalErr(v41v3, h, t, "enc-map-v41-custom") + testUnmarshalErr(v41v4, bs41, h, t, "dec-map-v41-p-len") + testDeepEqualErr(v41v3, v41v4, t, "equal-map-v41-p-len") + } + + for _, v := range []map[float32]uint16{nil, {}, {22.2: 0, 11.1: 44}} { + // fmt.Printf(">>>> running mammoth map v42: %v\n", v) + var v42v1, v42v2 map[float32]uint16 + v42v1 = v + bs42 := testMarshalErr(v42v1, h, t, "enc-map-v42") + if v == nil { + v42v2 = nil + } else { + v42v2 = make(map[float32]uint16, len(v)) + } // reset map + testUnmarshalErr(v42v2, bs42, h, t, "dec-map-v42") + testDeepEqualErr(v42v1, v42v2, t, "equal-map-v42") + if v == nil { + v42v2 = nil + } else { + v42v2 = make(map[float32]uint16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v42v2), bs42, h, t, "dec-map-v42-noaddr") // decode into non-addressable map value + testDeepEqualErr(v42v1, v42v2, t, "equal-map-v42-noaddr") + if v == nil { + v42v2 = nil + } else { + v42v2 = make(map[float32]uint16, len(v)) + } // reset map + testUnmarshalErr(&v42v2, bs42, h, t, "dec-map-v42-p-len") + testDeepEqualErr(v42v1, v42v2, t, "equal-map-v42-p-len") + bs42 = testMarshalErr(&v42v1, h, t, "enc-map-v42-p") + v42v2 = nil + testUnmarshalErr(&v42v2, bs42, h, t, "dec-map-v42-p-nil") + testDeepEqualErr(v42v1, v42v2, t, "equal-map-v42-p-nil") + // ... + if v == nil { + v42v2 = nil + } else { + v42v2 = make(map[float32]uint16, len(v)) + } // reset map + var v42v3, v42v4 typMapMapFloat32Uint16 + v42v3 = typMapMapFloat32Uint16(v42v1) + v42v4 = typMapMapFloat32Uint16(v42v2) + bs42 = testMarshalErr(v42v3, h, t, "enc-map-v42-custom") + testUnmarshalErr(v42v4, bs42, h, t, "dec-map-v42-p-len") + testDeepEqualErr(v42v3, v42v4, t, "equal-map-v42-p-len") + } + + for _, v := range []map[float32]uint32{nil, {}, {22.2: 0, 11.1: 33}} { + // fmt.Printf(">>>> running mammoth map v43: %v\n", v) + var v43v1, v43v2 map[float32]uint32 + v43v1 = v + bs43 := testMarshalErr(v43v1, h, t, "enc-map-v43") + if v == nil { + v43v2 = nil + } else { + v43v2 = make(map[float32]uint32, len(v)) + } // reset map + testUnmarshalErr(v43v2, bs43, h, t, "dec-map-v43") + testDeepEqualErr(v43v1, v43v2, t, "equal-map-v43") + if v == nil { + v43v2 = nil + } else { + v43v2 = make(map[float32]uint32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v43v2), bs43, h, t, "dec-map-v43-noaddr") // decode into non-addressable map value + testDeepEqualErr(v43v1, v43v2, t, "equal-map-v43-noaddr") + if v == nil { + v43v2 = nil + } else { + v43v2 = make(map[float32]uint32, len(v)) + } // reset map + testUnmarshalErr(&v43v2, bs43, h, t, "dec-map-v43-p-len") + testDeepEqualErr(v43v1, v43v2, t, "equal-map-v43-p-len") + bs43 = testMarshalErr(&v43v1, h, t, "enc-map-v43-p") + v43v2 = nil + testUnmarshalErr(&v43v2, bs43, h, t, "dec-map-v43-p-nil") + testDeepEqualErr(v43v1, v43v2, t, "equal-map-v43-p-nil") + // ... + if v == nil { + v43v2 = nil + } else { + v43v2 = make(map[float32]uint32, len(v)) + } // reset map + var v43v3, v43v4 typMapMapFloat32Uint32 + v43v3 = typMapMapFloat32Uint32(v43v1) + v43v4 = typMapMapFloat32Uint32(v43v2) + bs43 = testMarshalErr(v43v3, h, t, "enc-map-v43-custom") + testUnmarshalErr(v43v4, bs43, h, t, "dec-map-v43-p-len") + testDeepEqualErr(v43v3, v43v4, t, "equal-map-v43-p-len") + } + + for _, v := range []map[float32]uint64{nil, {}, {22.2: 0, 11.1: 44}} { + // fmt.Printf(">>>> running mammoth map v44: %v\n", v) + var v44v1, v44v2 map[float32]uint64 + v44v1 = v + bs44 := testMarshalErr(v44v1, h, t, "enc-map-v44") + if v == nil { + v44v2 = nil + } else { + v44v2 = make(map[float32]uint64, len(v)) + } // reset map + testUnmarshalErr(v44v2, bs44, h, t, "dec-map-v44") + testDeepEqualErr(v44v1, v44v2, t, "equal-map-v44") + if v == nil { + v44v2 = nil + } else { + v44v2 = make(map[float32]uint64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v44v2), bs44, h, t, "dec-map-v44-noaddr") // decode into non-addressable map value + testDeepEqualErr(v44v1, v44v2, t, "equal-map-v44-noaddr") + if v == nil { + v44v2 = nil + } else { + v44v2 = make(map[float32]uint64, len(v)) + } // reset map + testUnmarshalErr(&v44v2, bs44, h, t, "dec-map-v44-p-len") + testDeepEqualErr(v44v1, v44v2, t, "equal-map-v44-p-len") + bs44 = testMarshalErr(&v44v1, h, t, "enc-map-v44-p") + v44v2 = nil + testUnmarshalErr(&v44v2, bs44, h, t, "dec-map-v44-p-nil") + testDeepEqualErr(v44v1, v44v2, t, "equal-map-v44-p-nil") + // ... + if v == nil { + v44v2 = nil + } else { + v44v2 = make(map[float32]uint64, len(v)) + } // reset map + var v44v3, v44v4 typMapMapFloat32Uint64 + v44v3 = typMapMapFloat32Uint64(v44v1) + v44v4 = typMapMapFloat32Uint64(v44v2) + bs44 = testMarshalErr(v44v3, h, t, "enc-map-v44-custom") + testUnmarshalErr(v44v4, bs44, h, t, "dec-map-v44-p-len") + testDeepEqualErr(v44v3, v44v4, t, "equal-map-v44-p-len") + } + + for _, v := range []map[float32]uintptr{nil, {}, {22.2: 0, 11.1: 33}} { + // fmt.Printf(">>>> running mammoth map v45: %v\n", v) + var v45v1, v45v2 map[float32]uintptr + v45v1 = v + bs45 := testMarshalErr(v45v1, h, t, "enc-map-v45") + if v == nil { + v45v2 = nil + } else { + v45v2 = make(map[float32]uintptr, len(v)) + } // reset map + testUnmarshalErr(v45v2, bs45, h, t, "dec-map-v45") + testDeepEqualErr(v45v1, v45v2, t, "equal-map-v45") + if v == nil { + v45v2 = nil + } else { + v45v2 = make(map[float32]uintptr, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v45v2), bs45, h, t, "dec-map-v45-noaddr") // decode into non-addressable map value + testDeepEqualErr(v45v1, v45v2, t, "equal-map-v45-noaddr") + if v == nil { + v45v2 = nil + } else { + v45v2 = make(map[float32]uintptr, len(v)) + } // reset map + testUnmarshalErr(&v45v2, bs45, h, t, "dec-map-v45-p-len") + testDeepEqualErr(v45v1, v45v2, t, "equal-map-v45-p-len") + bs45 = testMarshalErr(&v45v1, h, t, "enc-map-v45-p") + v45v2 = nil + testUnmarshalErr(&v45v2, bs45, h, t, "dec-map-v45-p-nil") + testDeepEqualErr(v45v1, v45v2, t, "equal-map-v45-p-nil") + // ... + if v == nil { + v45v2 = nil + } else { + v45v2 = make(map[float32]uintptr, len(v)) + } // reset map + var v45v3, v45v4 typMapMapFloat32Uintptr + v45v3 = typMapMapFloat32Uintptr(v45v1) + v45v4 = typMapMapFloat32Uintptr(v45v2) + bs45 = testMarshalErr(v45v3, h, t, "enc-map-v45-custom") + testUnmarshalErr(v45v4, bs45, h, t, "dec-map-v45-p-len") + testDeepEqualErr(v45v3, v45v4, t, "equal-map-v45-p-len") + } + + for _, v := range []map[float32]int{nil, {}, {22.2: 0, 11.1: 44}} { + // fmt.Printf(">>>> running mammoth map v46: %v\n", v) + var v46v1, v46v2 map[float32]int + v46v1 = v + bs46 := testMarshalErr(v46v1, h, t, "enc-map-v46") + if v == nil { + v46v2 = nil + } else { + v46v2 = make(map[float32]int, len(v)) + } // reset map + testUnmarshalErr(v46v2, bs46, h, t, "dec-map-v46") + testDeepEqualErr(v46v1, v46v2, t, "equal-map-v46") + if v == nil { + v46v2 = nil + } else { + v46v2 = make(map[float32]int, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v46v2), bs46, h, t, "dec-map-v46-noaddr") // decode into non-addressable map value + testDeepEqualErr(v46v1, v46v2, t, "equal-map-v46-noaddr") + if v == nil { + v46v2 = nil + } else { + v46v2 = make(map[float32]int, len(v)) + } // reset map + testUnmarshalErr(&v46v2, bs46, h, t, "dec-map-v46-p-len") + testDeepEqualErr(v46v1, v46v2, t, "equal-map-v46-p-len") + bs46 = testMarshalErr(&v46v1, h, t, "enc-map-v46-p") + v46v2 = nil + testUnmarshalErr(&v46v2, bs46, h, t, "dec-map-v46-p-nil") + testDeepEqualErr(v46v1, v46v2, t, "equal-map-v46-p-nil") + // ... + if v == nil { + v46v2 = nil + } else { + v46v2 = make(map[float32]int, len(v)) + } // reset map + var v46v3, v46v4 typMapMapFloat32Int + v46v3 = typMapMapFloat32Int(v46v1) + v46v4 = typMapMapFloat32Int(v46v2) + bs46 = testMarshalErr(v46v3, h, t, "enc-map-v46-custom") + testUnmarshalErr(v46v4, bs46, h, t, "dec-map-v46-p-len") + testDeepEqualErr(v46v3, v46v4, t, "equal-map-v46-p-len") + } + + for _, v := range []map[float32]int8{nil, {}, {22.2: 0, 11.1: 33}} { + // fmt.Printf(">>>> running mammoth map v47: %v\n", v) + var v47v1, v47v2 map[float32]int8 + v47v1 = v + bs47 := testMarshalErr(v47v1, h, t, "enc-map-v47") + if v == nil { + v47v2 = nil + } else { + v47v2 = make(map[float32]int8, len(v)) + } // reset map + testUnmarshalErr(v47v2, bs47, h, t, "dec-map-v47") + testDeepEqualErr(v47v1, v47v2, t, "equal-map-v47") + if v == nil { + v47v2 = nil + } else { + v47v2 = make(map[float32]int8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v47v2), bs47, h, t, "dec-map-v47-noaddr") // decode into non-addressable map value + testDeepEqualErr(v47v1, v47v2, t, "equal-map-v47-noaddr") + if v == nil { + v47v2 = nil + } else { + v47v2 = make(map[float32]int8, len(v)) + } // reset map + testUnmarshalErr(&v47v2, bs47, h, t, "dec-map-v47-p-len") + testDeepEqualErr(v47v1, v47v2, t, "equal-map-v47-p-len") + bs47 = testMarshalErr(&v47v1, h, t, "enc-map-v47-p") + v47v2 = nil + testUnmarshalErr(&v47v2, bs47, h, t, "dec-map-v47-p-nil") + testDeepEqualErr(v47v1, v47v2, t, "equal-map-v47-p-nil") + // ... + if v == nil { + v47v2 = nil + } else { + v47v2 = make(map[float32]int8, len(v)) + } // reset map + var v47v3, v47v4 typMapMapFloat32Int8 + v47v3 = typMapMapFloat32Int8(v47v1) + v47v4 = typMapMapFloat32Int8(v47v2) + bs47 = testMarshalErr(v47v3, h, t, "enc-map-v47-custom") + testUnmarshalErr(v47v4, bs47, h, t, "dec-map-v47-p-len") + testDeepEqualErr(v47v3, v47v4, t, "equal-map-v47-p-len") + } + + for _, v := range []map[float32]int16{nil, {}, {22.2: 0, 11.1: 44}} { + // fmt.Printf(">>>> running mammoth map v48: %v\n", v) + var v48v1, v48v2 map[float32]int16 + v48v1 = v + bs48 := testMarshalErr(v48v1, h, t, "enc-map-v48") + if v == nil { + v48v2 = nil + } else { + v48v2 = make(map[float32]int16, len(v)) + } // reset map + testUnmarshalErr(v48v2, bs48, h, t, "dec-map-v48") + testDeepEqualErr(v48v1, v48v2, t, "equal-map-v48") + if v == nil { + v48v2 = nil + } else { + v48v2 = make(map[float32]int16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v48v2), bs48, h, t, "dec-map-v48-noaddr") // decode into non-addressable map value + testDeepEqualErr(v48v1, v48v2, t, "equal-map-v48-noaddr") + if v == nil { + v48v2 = nil + } else { + v48v2 = make(map[float32]int16, len(v)) + } // reset map + testUnmarshalErr(&v48v2, bs48, h, t, "dec-map-v48-p-len") + testDeepEqualErr(v48v1, v48v2, t, "equal-map-v48-p-len") + bs48 = testMarshalErr(&v48v1, h, t, "enc-map-v48-p") + v48v2 = nil + testUnmarshalErr(&v48v2, bs48, h, t, "dec-map-v48-p-nil") + testDeepEqualErr(v48v1, v48v2, t, "equal-map-v48-p-nil") + // ... + if v == nil { + v48v2 = nil + } else { + v48v2 = make(map[float32]int16, len(v)) + } // reset map + var v48v3, v48v4 typMapMapFloat32Int16 + v48v3 = typMapMapFloat32Int16(v48v1) + v48v4 = typMapMapFloat32Int16(v48v2) + bs48 = testMarshalErr(v48v3, h, t, "enc-map-v48-custom") + testUnmarshalErr(v48v4, bs48, h, t, "dec-map-v48-p-len") + testDeepEqualErr(v48v3, v48v4, t, "equal-map-v48-p-len") + } + + for _, v := range []map[float32]int32{nil, {}, {22.2: 0, 11.1: 33}} { + // fmt.Printf(">>>> running mammoth map v49: %v\n", v) + var v49v1, v49v2 map[float32]int32 + v49v1 = v + bs49 := testMarshalErr(v49v1, h, t, "enc-map-v49") + if v == nil { + v49v2 = nil + } else { + v49v2 = make(map[float32]int32, len(v)) + } // reset map + testUnmarshalErr(v49v2, bs49, h, t, "dec-map-v49") + testDeepEqualErr(v49v1, v49v2, t, "equal-map-v49") + if v == nil { + v49v2 = nil + } else { + v49v2 = make(map[float32]int32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v49v2), bs49, h, t, "dec-map-v49-noaddr") // decode into non-addressable map value + testDeepEqualErr(v49v1, v49v2, t, "equal-map-v49-noaddr") + if v == nil { + v49v2 = nil + } else { + v49v2 = make(map[float32]int32, len(v)) + } // reset map + testUnmarshalErr(&v49v2, bs49, h, t, "dec-map-v49-p-len") + testDeepEqualErr(v49v1, v49v2, t, "equal-map-v49-p-len") + bs49 = testMarshalErr(&v49v1, h, t, "enc-map-v49-p") + v49v2 = nil + testUnmarshalErr(&v49v2, bs49, h, t, "dec-map-v49-p-nil") + testDeepEqualErr(v49v1, v49v2, t, "equal-map-v49-p-nil") + // ... + if v == nil { + v49v2 = nil + } else { + v49v2 = make(map[float32]int32, len(v)) + } // reset map + var v49v3, v49v4 typMapMapFloat32Int32 + v49v3 = typMapMapFloat32Int32(v49v1) + v49v4 = typMapMapFloat32Int32(v49v2) + bs49 = testMarshalErr(v49v3, h, t, "enc-map-v49-custom") + testUnmarshalErr(v49v4, bs49, h, t, "dec-map-v49-p-len") + testDeepEqualErr(v49v3, v49v4, t, "equal-map-v49-p-len") + } + + for _, v := range []map[float32]int64{nil, {}, {22.2: 0, 11.1: 44}} { + // fmt.Printf(">>>> running mammoth map v50: %v\n", v) + var v50v1, v50v2 map[float32]int64 + v50v1 = v + bs50 := testMarshalErr(v50v1, h, t, "enc-map-v50") + if v == nil { + v50v2 = nil + } else { + v50v2 = make(map[float32]int64, len(v)) + } // reset map + testUnmarshalErr(v50v2, bs50, h, t, "dec-map-v50") + testDeepEqualErr(v50v1, v50v2, t, "equal-map-v50") + if v == nil { + v50v2 = nil + } else { + v50v2 = make(map[float32]int64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v50v2), bs50, h, t, "dec-map-v50-noaddr") // decode into non-addressable map value + testDeepEqualErr(v50v1, v50v2, t, "equal-map-v50-noaddr") + if v == nil { + v50v2 = nil + } else { + v50v2 = make(map[float32]int64, len(v)) + } // reset map + testUnmarshalErr(&v50v2, bs50, h, t, "dec-map-v50-p-len") + testDeepEqualErr(v50v1, v50v2, t, "equal-map-v50-p-len") + bs50 = testMarshalErr(&v50v1, h, t, "enc-map-v50-p") + v50v2 = nil + testUnmarshalErr(&v50v2, bs50, h, t, "dec-map-v50-p-nil") + testDeepEqualErr(v50v1, v50v2, t, "equal-map-v50-p-nil") + // ... + if v == nil { + v50v2 = nil + } else { + v50v2 = make(map[float32]int64, len(v)) + } // reset map + var v50v3, v50v4 typMapMapFloat32Int64 + v50v3 = typMapMapFloat32Int64(v50v1) + v50v4 = typMapMapFloat32Int64(v50v2) + bs50 = testMarshalErr(v50v3, h, t, "enc-map-v50-custom") + testUnmarshalErr(v50v4, bs50, h, t, "dec-map-v50-p-len") + testDeepEqualErr(v50v3, v50v4, t, "equal-map-v50-p-len") + } + + for _, v := range []map[float32]float32{nil, {}, {22.2: 0, 11.1: 22.2}} { + // fmt.Printf(">>>> running mammoth map v51: %v\n", v) + var v51v1, v51v2 map[float32]float32 + v51v1 = v + bs51 := testMarshalErr(v51v1, h, t, "enc-map-v51") + if v == nil { + v51v2 = nil + } else { + v51v2 = make(map[float32]float32, len(v)) + } // reset map + testUnmarshalErr(v51v2, bs51, h, t, "dec-map-v51") + testDeepEqualErr(v51v1, v51v2, t, "equal-map-v51") + if v == nil { + v51v2 = nil + } else { + v51v2 = make(map[float32]float32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v51v2), bs51, h, t, "dec-map-v51-noaddr") // decode into non-addressable map value + testDeepEqualErr(v51v1, v51v2, t, "equal-map-v51-noaddr") + if v == nil { + v51v2 = nil + } else { + v51v2 = make(map[float32]float32, len(v)) + } // reset map + testUnmarshalErr(&v51v2, bs51, h, t, "dec-map-v51-p-len") + testDeepEqualErr(v51v1, v51v2, t, "equal-map-v51-p-len") + bs51 = testMarshalErr(&v51v1, h, t, "enc-map-v51-p") + v51v2 = nil + testUnmarshalErr(&v51v2, bs51, h, t, "dec-map-v51-p-nil") + testDeepEqualErr(v51v1, v51v2, t, "equal-map-v51-p-nil") + // ... + if v == nil { + v51v2 = nil + } else { + v51v2 = make(map[float32]float32, len(v)) + } // reset map + var v51v3, v51v4 typMapMapFloat32Float32 + v51v3 = typMapMapFloat32Float32(v51v1) + v51v4 = typMapMapFloat32Float32(v51v2) + bs51 = testMarshalErr(v51v3, h, t, "enc-map-v51-custom") + testUnmarshalErr(v51v4, bs51, h, t, "dec-map-v51-p-len") + testDeepEqualErr(v51v3, v51v4, t, "equal-map-v51-p-len") + } + + for _, v := range []map[float32]float64{nil, {}, {11.1: 0, 22.2: 11.1}} { + // fmt.Printf(">>>> running mammoth map v52: %v\n", v) + var v52v1, v52v2 map[float32]float64 + v52v1 = v + bs52 := testMarshalErr(v52v1, h, t, "enc-map-v52") + if v == nil { + v52v2 = nil + } else { + v52v2 = make(map[float32]float64, len(v)) + } // reset map + testUnmarshalErr(v52v2, bs52, h, t, "dec-map-v52") + testDeepEqualErr(v52v1, v52v2, t, "equal-map-v52") + if v == nil { + v52v2 = nil + } else { + v52v2 = make(map[float32]float64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v52v2), bs52, h, t, "dec-map-v52-noaddr") // decode into non-addressable map value + testDeepEqualErr(v52v1, v52v2, t, "equal-map-v52-noaddr") + if v == nil { + v52v2 = nil + } else { + v52v2 = make(map[float32]float64, len(v)) + } // reset map + testUnmarshalErr(&v52v2, bs52, h, t, "dec-map-v52-p-len") + testDeepEqualErr(v52v1, v52v2, t, "equal-map-v52-p-len") + bs52 = testMarshalErr(&v52v1, h, t, "enc-map-v52-p") + v52v2 = nil + testUnmarshalErr(&v52v2, bs52, h, t, "dec-map-v52-p-nil") + testDeepEqualErr(v52v1, v52v2, t, "equal-map-v52-p-nil") + // ... + if v == nil { + v52v2 = nil + } else { + v52v2 = make(map[float32]float64, len(v)) + } // reset map + var v52v3, v52v4 typMapMapFloat32Float64 + v52v3 = typMapMapFloat32Float64(v52v1) + v52v4 = typMapMapFloat32Float64(v52v2) + bs52 = testMarshalErr(v52v3, h, t, "enc-map-v52-custom") + testUnmarshalErr(v52v4, bs52, h, t, "dec-map-v52-p-len") + testDeepEqualErr(v52v3, v52v4, t, "equal-map-v52-p-len") + } + + for _, v := range []map[float32]bool{nil, {}, {22.2: false, 11.1: true}} { + // fmt.Printf(">>>> running mammoth map v53: %v\n", v) + var v53v1, v53v2 map[float32]bool + v53v1 = v + bs53 := testMarshalErr(v53v1, h, t, "enc-map-v53") + if v == nil { + v53v2 = nil + } else { + v53v2 = make(map[float32]bool, len(v)) + } // reset map + testUnmarshalErr(v53v2, bs53, h, t, "dec-map-v53") + testDeepEqualErr(v53v1, v53v2, t, "equal-map-v53") + if v == nil { + v53v2 = nil + } else { + v53v2 = make(map[float32]bool, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v53v2), bs53, h, t, "dec-map-v53-noaddr") // decode into non-addressable map value + testDeepEqualErr(v53v1, v53v2, t, "equal-map-v53-noaddr") + if v == nil { + v53v2 = nil + } else { + v53v2 = make(map[float32]bool, len(v)) + } // reset map + testUnmarshalErr(&v53v2, bs53, h, t, "dec-map-v53-p-len") + testDeepEqualErr(v53v1, v53v2, t, "equal-map-v53-p-len") + bs53 = testMarshalErr(&v53v1, h, t, "enc-map-v53-p") + v53v2 = nil + testUnmarshalErr(&v53v2, bs53, h, t, "dec-map-v53-p-nil") + testDeepEqualErr(v53v1, v53v2, t, "equal-map-v53-p-nil") + // ... + if v == nil { + v53v2 = nil + } else { + v53v2 = make(map[float32]bool, len(v)) + } // reset map + var v53v3, v53v4 typMapMapFloat32Bool + v53v3 = typMapMapFloat32Bool(v53v1) + v53v4 = typMapMapFloat32Bool(v53v2) + bs53 = testMarshalErr(v53v3, h, t, "enc-map-v53-custom") + testUnmarshalErr(v53v4, bs53, h, t, "dec-map-v53-p-len") + testDeepEqualErr(v53v3, v53v4, t, "equal-map-v53-p-len") + } + + for _, v := range []map[float64]interface{}{nil, {}, {22.2: nil, 11.1: "string-is-an-interface"}} { + // fmt.Printf(">>>> running mammoth map v56: %v\n", v) + var v56v1, v56v2 map[float64]interface{} + v56v1 = v + bs56 := testMarshalErr(v56v1, h, t, "enc-map-v56") + if v == nil { + v56v2 = nil + } else { + v56v2 = make(map[float64]interface{}, len(v)) + } // reset map + testUnmarshalErr(v56v2, bs56, h, t, "dec-map-v56") + testDeepEqualErr(v56v1, v56v2, t, "equal-map-v56") + if v == nil { + v56v2 = nil + } else { + v56v2 = make(map[float64]interface{}, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v56v2), bs56, h, t, "dec-map-v56-noaddr") // decode into non-addressable map value + testDeepEqualErr(v56v1, v56v2, t, "equal-map-v56-noaddr") + if v == nil { + v56v2 = nil + } else { + v56v2 = make(map[float64]interface{}, len(v)) + } // reset map + testUnmarshalErr(&v56v2, bs56, h, t, "dec-map-v56-p-len") + testDeepEqualErr(v56v1, v56v2, t, "equal-map-v56-p-len") + bs56 = testMarshalErr(&v56v1, h, t, "enc-map-v56-p") + v56v2 = nil + testUnmarshalErr(&v56v2, bs56, h, t, "dec-map-v56-p-nil") + testDeepEqualErr(v56v1, v56v2, t, "equal-map-v56-p-nil") + // ... + if v == nil { + v56v2 = nil + } else { + v56v2 = make(map[float64]interface{}, len(v)) + } // reset map + var v56v3, v56v4 typMapMapFloat64Intf + v56v3 = typMapMapFloat64Intf(v56v1) + v56v4 = typMapMapFloat64Intf(v56v2) + bs56 = testMarshalErr(v56v3, h, t, "enc-map-v56-custom") + testUnmarshalErr(v56v4, bs56, h, t, "dec-map-v56-p-len") + testDeepEqualErr(v56v3, v56v4, t, "equal-map-v56-p-len") + } + + for _, v := range []map[float64]string{nil, {}, {22.2: "", 11.1: "some-string"}} { + // fmt.Printf(">>>> running mammoth map v57: %v\n", v) + var v57v1, v57v2 map[float64]string + v57v1 = v + bs57 := testMarshalErr(v57v1, h, t, "enc-map-v57") + if v == nil { + v57v2 = nil + } else { + v57v2 = make(map[float64]string, len(v)) + } // reset map + testUnmarshalErr(v57v2, bs57, h, t, "dec-map-v57") + testDeepEqualErr(v57v1, v57v2, t, "equal-map-v57") + if v == nil { + v57v2 = nil + } else { + v57v2 = make(map[float64]string, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v57v2), bs57, h, t, "dec-map-v57-noaddr") // decode into non-addressable map value + testDeepEqualErr(v57v1, v57v2, t, "equal-map-v57-noaddr") + if v == nil { + v57v2 = nil + } else { + v57v2 = make(map[float64]string, len(v)) + } // reset map + testUnmarshalErr(&v57v2, bs57, h, t, "dec-map-v57-p-len") + testDeepEqualErr(v57v1, v57v2, t, "equal-map-v57-p-len") + bs57 = testMarshalErr(&v57v1, h, t, "enc-map-v57-p") + v57v2 = nil + testUnmarshalErr(&v57v2, bs57, h, t, "dec-map-v57-p-nil") + testDeepEqualErr(v57v1, v57v2, t, "equal-map-v57-p-nil") + // ... + if v == nil { + v57v2 = nil + } else { + v57v2 = make(map[float64]string, len(v)) + } // reset map + var v57v3, v57v4 typMapMapFloat64String + v57v3 = typMapMapFloat64String(v57v1) + v57v4 = typMapMapFloat64String(v57v2) + bs57 = testMarshalErr(v57v3, h, t, "enc-map-v57-custom") + testUnmarshalErr(v57v4, bs57, h, t, "dec-map-v57-p-len") + testDeepEqualErr(v57v3, v57v4, t, "equal-map-v57-p-len") + } + + for _, v := range []map[float64]uint{nil, {}, {22.2: 0, 11.1: 33}} { + // fmt.Printf(">>>> running mammoth map v58: %v\n", v) + var v58v1, v58v2 map[float64]uint + v58v1 = v + bs58 := testMarshalErr(v58v1, h, t, "enc-map-v58") + if v == nil { + v58v2 = nil + } else { + v58v2 = make(map[float64]uint, len(v)) + } // reset map + testUnmarshalErr(v58v2, bs58, h, t, "dec-map-v58") + testDeepEqualErr(v58v1, v58v2, t, "equal-map-v58") + if v == nil { + v58v2 = nil + } else { + v58v2 = make(map[float64]uint, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v58v2), bs58, h, t, "dec-map-v58-noaddr") // decode into non-addressable map value + testDeepEqualErr(v58v1, v58v2, t, "equal-map-v58-noaddr") + if v == nil { + v58v2 = nil + } else { + v58v2 = make(map[float64]uint, len(v)) + } // reset map + testUnmarshalErr(&v58v2, bs58, h, t, "dec-map-v58-p-len") + testDeepEqualErr(v58v1, v58v2, t, "equal-map-v58-p-len") + bs58 = testMarshalErr(&v58v1, h, t, "enc-map-v58-p") + v58v2 = nil + testUnmarshalErr(&v58v2, bs58, h, t, "dec-map-v58-p-nil") + testDeepEqualErr(v58v1, v58v2, t, "equal-map-v58-p-nil") + // ... + if v == nil { + v58v2 = nil + } else { + v58v2 = make(map[float64]uint, len(v)) + } // reset map + var v58v3, v58v4 typMapMapFloat64Uint + v58v3 = typMapMapFloat64Uint(v58v1) + v58v4 = typMapMapFloat64Uint(v58v2) + bs58 = testMarshalErr(v58v3, h, t, "enc-map-v58-custom") + testUnmarshalErr(v58v4, bs58, h, t, "dec-map-v58-p-len") + testDeepEqualErr(v58v3, v58v4, t, "equal-map-v58-p-len") + } + + for _, v := range []map[float64]uint8{nil, {}, {22.2: 0, 11.1: 44}} { + // fmt.Printf(">>>> running mammoth map v59: %v\n", v) + var v59v1, v59v2 map[float64]uint8 + v59v1 = v + bs59 := testMarshalErr(v59v1, h, t, "enc-map-v59") + if v == nil { + v59v2 = nil + } else { + v59v2 = make(map[float64]uint8, len(v)) + } // reset map + testUnmarshalErr(v59v2, bs59, h, t, "dec-map-v59") + testDeepEqualErr(v59v1, v59v2, t, "equal-map-v59") + if v == nil { + v59v2 = nil + } else { + v59v2 = make(map[float64]uint8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v59v2), bs59, h, t, "dec-map-v59-noaddr") // decode into non-addressable map value + testDeepEqualErr(v59v1, v59v2, t, "equal-map-v59-noaddr") + if v == nil { + v59v2 = nil + } else { + v59v2 = make(map[float64]uint8, len(v)) + } // reset map + testUnmarshalErr(&v59v2, bs59, h, t, "dec-map-v59-p-len") + testDeepEqualErr(v59v1, v59v2, t, "equal-map-v59-p-len") + bs59 = testMarshalErr(&v59v1, h, t, "enc-map-v59-p") + v59v2 = nil + testUnmarshalErr(&v59v2, bs59, h, t, "dec-map-v59-p-nil") + testDeepEqualErr(v59v1, v59v2, t, "equal-map-v59-p-nil") + // ... + if v == nil { + v59v2 = nil + } else { + v59v2 = make(map[float64]uint8, len(v)) + } // reset map + var v59v3, v59v4 typMapMapFloat64Uint8 + v59v3 = typMapMapFloat64Uint8(v59v1) + v59v4 = typMapMapFloat64Uint8(v59v2) + bs59 = testMarshalErr(v59v3, h, t, "enc-map-v59-custom") + testUnmarshalErr(v59v4, bs59, h, t, "dec-map-v59-p-len") + testDeepEqualErr(v59v3, v59v4, t, "equal-map-v59-p-len") + } + + for _, v := range []map[float64]uint16{nil, {}, {22.2: 0, 11.1: 33}} { + // fmt.Printf(">>>> running mammoth map v60: %v\n", v) + var v60v1, v60v2 map[float64]uint16 + v60v1 = v + bs60 := testMarshalErr(v60v1, h, t, "enc-map-v60") + if v == nil { + v60v2 = nil + } else { + v60v2 = make(map[float64]uint16, len(v)) + } // reset map + testUnmarshalErr(v60v2, bs60, h, t, "dec-map-v60") + testDeepEqualErr(v60v1, v60v2, t, "equal-map-v60") + if v == nil { + v60v2 = nil + } else { + v60v2 = make(map[float64]uint16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v60v2), bs60, h, t, "dec-map-v60-noaddr") // decode into non-addressable map value + testDeepEqualErr(v60v1, v60v2, t, "equal-map-v60-noaddr") + if v == nil { + v60v2 = nil + } else { + v60v2 = make(map[float64]uint16, len(v)) + } // reset map + testUnmarshalErr(&v60v2, bs60, h, t, "dec-map-v60-p-len") + testDeepEqualErr(v60v1, v60v2, t, "equal-map-v60-p-len") + bs60 = testMarshalErr(&v60v1, h, t, "enc-map-v60-p") + v60v2 = nil + testUnmarshalErr(&v60v2, bs60, h, t, "dec-map-v60-p-nil") + testDeepEqualErr(v60v1, v60v2, t, "equal-map-v60-p-nil") + // ... + if v == nil { + v60v2 = nil + } else { + v60v2 = make(map[float64]uint16, len(v)) + } // reset map + var v60v3, v60v4 typMapMapFloat64Uint16 + v60v3 = typMapMapFloat64Uint16(v60v1) + v60v4 = typMapMapFloat64Uint16(v60v2) + bs60 = testMarshalErr(v60v3, h, t, "enc-map-v60-custom") + testUnmarshalErr(v60v4, bs60, h, t, "dec-map-v60-p-len") + testDeepEqualErr(v60v3, v60v4, t, "equal-map-v60-p-len") + } + + for _, v := range []map[float64]uint32{nil, {}, {22.2: 0, 11.1: 44}} { + // fmt.Printf(">>>> running mammoth map v61: %v\n", v) + var v61v1, v61v2 map[float64]uint32 + v61v1 = v + bs61 := testMarshalErr(v61v1, h, t, "enc-map-v61") + if v == nil { + v61v2 = nil + } else { + v61v2 = make(map[float64]uint32, len(v)) + } // reset map + testUnmarshalErr(v61v2, bs61, h, t, "dec-map-v61") + testDeepEqualErr(v61v1, v61v2, t, "equal-map-v61") + if v == nil { + v61v2 = nil + } else { + v61v2 = make(map[float64]uint32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v61v2), bs61, h, t, "dec-map-v61-noaddr") // decode into non-addressable map value + testDeepEqualErr(v61v1, v61v2, t, "equal-map-v61-noaddr") + if v == nil { + v61v2 = nil + } else { + v61v2 = make(map[float64]uint32, len(v)) + } // reset map + testUnmarshalErr(&v61v2, bs61, h, t, "dec-map-v61-p-len") + testDeepEqualErr(v61v1, v61v2, t, "equal-map-v61-p-len") + bs61 = testMarshalErr(&v61v1, h, t, "enc-map-v61-p") + v61v2 = nil + testUnmarshalErr(&v61v2, bs61, h, t, "dec-map-v61-p-nil") + testDeepEqualErr(v61v1, v61v2, t, "equal-map-v61-p-nil") + // ... + if v == nil { + v61v2 = nil + } else { + v61v2 = make(map[float64]uint32, len(v)) + } // reset map + var v61v3, v61v4 typMapMapFloat64Uint32 + v61v3 = typMapMapFloat64Uint32(v61v1) + v61v4 = typMapMapFloat64Uint32(v61v2) + bs61 = testMarshalErr(v61v3, h, t, "enc-map-v61-custom") + testUnmarshalErr(v61v4, bs61, h, t, "dec-map-v61-p-len") + testDeepEqualErr(v61v3, v61v4, t, "equal-map-v61-p-len") + } + + for _, v := range []map[float64]uint64{nil, {}, {22.2: 0, 11.1: 33}} { + // fmt.Printf(">>>> running mammoth map v62: %v\n", v) + var v62v1, v62v2 map[float64]uint64 + v62v1 = v + bs62 := testMarshalErr(v62v1, h, t, "enc-map-v62") + if v == nil { + v62v2 = nil + } else { + v62v2 = make(map[float64]uint64, len(v)) + } // reset map + testUnmarshalErr(v62v2, bs62, h, t, "dec-map-v62") + testDeepEqualErr(v62v1, v62v2, t, "equal-map-v62") + if v == nil { + v62v2 = nil + } else { + v62v2 = make(map[float64]uint64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v62v2), bs62, h, t, "dec-map-v62-noaddr") // decode into non-addressable map value + testDeepEqualErr(v62v1, v62v2, t, "equal-map-v62-noaddr") + if v == nil { + v62v2 = nil + } else { + v62v2 = make(map[float64]uint64, len(v)) + } // reset map + testUnmarshalErr(&v62v2, bs62, h, t, "dec-map-v62-p-len") + testDeepEqualErr(v62v1, v62v2, t, "equal-map-v62-p-len") + bs62 = testMarshalErr(&v62v1, h, t, "enc-map-v62-p") + v62v2 = nil + testUnmarshalErr(&v62v2, bs62, h, t, "dec-map-v62-p-nil") + testDeepEqualErr(v62v1, v62v2, t, "equal-map-v62-p-nil") + // ... + if v == nil { + v62v2 = nil + } else { + v62v2 = make(map[float64]uint64, len(v)) + } // reset map + var v62v3, v62v4 typMapMapFloat64Uint64 + v62v3 = typMapMapFloat64Uint64(v62v1) + v62v4 = typMapMapFloat64Uint64(v62v2) + bs62 = testMarshalErr(v62v3, h, t, "enc-map-v62-custom") + testUnmarshalErr(v62v4, bs62, h, t, "dec-map-v62-p-len") + testDeepEqualErr(v62v3, v62v4, t, "equal-map-v62-p-len") + } + + for _, v := range []map[float64]uintptr{nil, {}, {22.2: 0, 11.1: 44}} { + // fmt.Printf(">>>> running mammoth map v63: %v\n", v) + var v63v1, v63v2 map[float64]uintptr + v63v1 = v + bs63 := testMarshalErr(v63v1, h, t, "enc-map-v63") + if v == nil { + v63v2 = nil + } else { + v63v2 = make(map[float64]uintptr, len(v)) + } // reset map + testUnmarshalErr(v63v2, bs63, h, t, "dec-map-v63") + testDeepEqualErr(v63v1, v63v2, t, "equal-map-v63") + if v == nil { + v63v2 = nil + } else { + v63v2 = make(map[float64]uintptr, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v63v2), bs63, h, t, "dec-map-v63-noaddr") // decode into non-addressable map value + testDeepEqualErr(v63v1, v63v2, t, "equal-map-v63-noaddr") + if v == nil { + v63v2 = nil + } else { + v63v2 = make(map[float64]uintptr, len(v)) + } // reset map + testUnmarshalErr(&v63v2, bs63, h, t, "dec-map-v63-p-len") + testDeepEqualErr(v63v1, v63v2, t, "equal-map-v63-p-len") + bs63 = testMarshalErr(&v63v1, h, t, "enc-map-v63-p") + v63v2 = nil + testUnmarshalErr(&v63v2, bs63, h, t, "dec-map-v63-p-nil") + testDeepEqualErr(v63v1, v63v2, t, "equal-map-v63-p-nil") + // ... + if v == nil { + v63v2 = nil + } else { + v63v2 = make(map[float64]uintptr, len(v)) + } // reset map + var v63v3, v63v4 typMapMapFloat64Uintptr + v63v3 = typMapMapFloat64Uintptr(v63v1) + v63v4 = typMapMapFloat64Uintptr(v63v2) + bs63 = testMarshalErr(v63v3, h, t, "enc-map-v63-custom") + testUnmarshalErr(v63v4, bs63, h, t, "dec-map-v63-p-len") + testDeepEqualErr(v63v3, v63v4, t, "equal-map-v63-p-len") + } + + for _, v := range []map[float64]int{nil, {}, {22.2: 0, 11.1: 33}} { + // fmt.Printf(">>>> running mammoth map v64: %v\n", v) + var v64v1, v64v2 map[float64]int + v64v1 = v + bs64 := testMarshalErr(v64v1, h, t, "enc-map-v64") + if v == nil { + v64v2 = nil + } else { + v64v2 = make(map[float64]int, len(v)) + } // reset map + testUnmarshalErr(v64v2, bs64, h, t, "dec-map-v64") + testDeepEqualErr(v64v1, v64v2, t, "equal-map-v64") + if v == nil { + v64v2 = nil + } else { + v64v2 = make(map[float64]int, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v64v2), bs64, h, t, "dec-map-v64-noaddr") // decode into non-addressable map value + testDeepEqualErr(v64v1, v64v2, t, "equal-map-v64-noaddr") + if v == nil { + v64v2 = nil + } else { + v64v2 = make(map[float64]int, len(v)) + } // reset map + testUnmarshalErr(&v64v2, bs64, h, t, "dec-map-v64-p-len") + testDeepEqualErr(v64v1, v64v2, t, "equal-map-v64-p-len") + bs64 = testMarshalErr(&v64v1, h, t, "enc-map-v64-p") + v64v2 = nil + testUnmarshalErr(&v64v2, bs64, h, t, "dec-map-v64-p-nil") + testDeepEqualErr(v64v1, v64v2, t, "equal-map-v64-p-nil") + // ... + if v == nil { + v64v2 = nil + } else { + v64v2 = make(map[float64]int, len(v)) + } // reset map + var v64v3, v64v4 typMapMapFloat64Int + v64v3 = typMapMapFloat64Int(v64v1) + v64v4 = typMapMapFloat64Int(v64v2) + bs64 = testMarshalErr(v64v3, h, t, "enc-map-v64-custom") + testUnmarshalErr(v64v4, bs64, h, t, "dec-map-v64-p-len") + testDeepEqualErr(v64v3, v64v4, t, "equal-map-v64-p-len") + } + + for _, v := range []map[float64]int8{nil, {}, {22.2: 0, 11.1: 44}} { + // fmt.Printf(">>>> running mammoth map v65: %v\n", v) + var v65v1, v65v2 map[float64]int8 + v65v1 = v + bs65 := testMarshalErr(v65v1, h, t, "enc-map-v65") + if v == nil { + v65v2 = nil + } else { + v65v2 = make(map[float64]int8, len(v)) + } // reset map + testUnmarshalErr(v65v2, bs65, h, t, "dec-map-v65") + testDeepEqualErr(v65v1, v65v2, t, "equal-map-v65") + if v == nil { + v65v2 = nil + } else { + v65v2 = make(map[float64]int8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v65v2), bs65, h, t, "dec-map-v65-noaddr") // decode into non-addressable map value + testDeepEqualErr(v65v1, v65v2, t, "equal-map-v65-noaddr") + if v == nil { + v65v2 = nil + } else { + v65v2 = make(map[float64]int8, len(v)) + } // reset map + testUnmarshalErr(&v65v2, bs65, h, t, "dec-map-v65-p-len") + testDeepEqualErr(v65v1, v65v2, t, "equal-map-v65-p-len") + bs65 = testMarshalErr(&v65v1, h, t, "enc-map-v65-p") + v65v2 = nil + testUnmarshalErr(&v65v2, bs65, h, t, "dec-map-v65-p-nil") + testDeepEqualErr(v65v1, v65v2, t, "equal-map-v65-p-nil") + // ... + if v == nil { + v65v2 = nil + } else { + v65v2 = make(map[float64]int8, len(v)) + } // reset map + var v65v3, v65v4 typMapMapFloat64Int8 + v65v3 = typMapMapFloat64Int8(v65v1) + v65v4 = typMapMapFloat64Int8(v65v2) + bs65 = testMarshalErr(v65v3, h, t, "enc-map-v65-custom") + testUnmarshalErr(v65v4, bs65, h, t, "dec-map-v65-p-len") + testDeepEqualErr(v65v3, v65v4, t, "equal-map-v65-p-len") + } + + for _, v := range []map[float64]int16{nil, {}, {22.2: 0, 11.1: 33}} { + // fmt.Printf(">>>> running mammoth map v66: %v\n", v) + var v66v1, v66v2 map[float64]int16 + v66v1 = v + bs66 := testMarshalErr(v66v1, h, t, "enc-map-v66") + if v == nil { + v66v2 = nil + } else { + v66v2 = make(map[float64]int16, len(v)) + } // reset map + testUnmarshalErr(v66v2, bs66, h, t, "dec-map-v66") + testDeepEqualErr(v66v1, v66v2, t, "equal-map-v66") + if v == nil { + v66v2 = nil + } else { + v66v2 = make(map[float64]int16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v66v2), bs66, h, t, "dec-map-v66-noaddr") // decode into non-addressable map value + testDeepEqualErr(v66v1, v66v2, t, "equal-map-v66-noaddr") + if v == nil { + v66v2 = nil + } else { + v66v2 = make(map[float64]int16, len(v)) + } // reset map + testUnmarshalErr(&v66v2, bs66, h, t, "dec-map-v66-p-len") + testDeepEqualErr(v66v1, v66v2, t, "equal-map-v66-p-len") + bs66 = testMarshalErr(&v66v1, h, t, "enc-map-v66-p") + v66v2 = nil + testUnmarshalErr(&v66v2, bs66, h, t, "dec-map-v66-p-nil") + testDeepEqualErr(v66v1, v66v2, t, "equal-map-v66-p-nil") + // ... + if v == nil { + v66v2 = nil + } else { + v66v2 = make(map[float64]int16, len(v)) + } // reset map + var v66v3, v66v4 typMapMapFloat64Int16 + v66v3 = typMapMapFloat64Int16(v66v1) + v66v4 = typMapMapFloat64Int16(v66v2) + bs66 = testMarshalErr(v66v3, h, t, "enc-map-v66-custom") + testUnmarshalErr(v66v4, bs66, h, t, "dec-map-v66-p-len") + testDeepEqualErr(v66v3, v66v4, t, "equal-map-v66-p-len") + } + + for _, v := range []map[float64]int32{nil, {}, {22.2: 0, 11.1: 44}} { + // fmt.Printf(">>>> running mammoth map v67: %v\n", v) + var v67v1, v67v2 map[float64]int32 + v67v1 = v + bs67 := testMarshalErr(v67v1, h, t, "enc-map-v67") + if v == nil { + v67v2 = nil + } else { + v67v2 = make(map[float64]int32, len(v)) + } // reset map + testUnmarshalErr(v67v2, bs67, h, t, "dec-map-v67") + testDeepEqualErr(v67v1, v67v2, t, "equal-map-v67") + if v == nil { + v67v2 = nil + } else { + v67v2 = make(map[float64]int32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v67v2), bs67, h, t, "dec-map-v67-noaddr") // decode into non-addressable map value + testDeepEqualErr(v67v1, v67v2, t, "equal-map-v67-noaddr") + if v == nil { + v67v2 = nil + } else { + v67v2 = make(map[float64]int32, len(v)) + } // reset map + testUnmarshalErr(&v67v2, bs67, h, t, "dec-map-v67-p-len") + testDeepEqualErr(v67v1, v67v2, t, "equal-map-v67-p-len") + bs67 = testMarshalErr(&v67v1, h, t, "enc-map-v67-p") + v67v2 = nil + testUnmarshalErr(&v67v2, bs67, h, t, "dec-map-v67-p-nil") + testDeepEqualErr(v67v1, v67v2, t, "equal-map-v67-p-nil") + // ... + if v == nil { + v67v2 = nil + } else { + v67v2 = make(map[float64]int32, len(v)) + } // reset map + var v67v3, v67v4 typMapMapFloat64Int32 + v67v3 = typMapMapFloat64Int32(v67v1) + v67v4 = typMapMapFloat64Int32(v67v2) + bs67 = testMarshalErr(v67v3, h, t, "enc-map-v67-custom") + testUnmarshalErr(v67v4, bs67, h, t, "dec-map-v67-p-len") + testDeepEqualErr(v67v3, v67v4, t, "equal-map-v67-p-len") + } + + for _, v := range []map[float64]int64{nil, {}, {22.2: 0, 11.1: 33}} { + // fmt.Printf(">>>> running mammoth map v68: %v\n", v) + var v68v1, v68v2 map[float64]int64 + v68v1 = v + bs68 := testMarshalErr(v68v1, h, t, "enc-map-v68") + if v == nil { + v68v2 = nil + } else { + v68v2 = make(map[float64]int64, len(v)) + } // reset map + testUnmarshalErr(v68v2, bs68, h, t, "dec-map-v68") + testDeepEqualErr(v68v1, v68v2, t, "equal-map-v68") + if v == nil { + v68v2 = nil + } else { + v68v2 = make(map[float64]int64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v68v2), bs68, h, t, "dec-map-v68-noaddr") // decode into non-addressable map value + testDeepEqualErr(v68v1, v68v2, t, "equal-map-v68-noaddr") + if v == nil { + v68v2 = nil + } else { + v68v2 = make(map[float64]int64, len(v)) + } // reset map + testUnmarshalErr(&v68v2, bs68, h, t, "dec-map-v68-p-len") + testDeepEqualErr(v68v1, v68v2, t, "equal-map-v68-p-len") + bs68 = testMarshalErr(&v68v1, h, t, "enc-map-v68-p") + v68v2 = nil + testUnmarshalErr(&v68v2, bs68, h, t, "dec-map-v68-p-nil") + testDeepEqualErr(v68v1, v68v2, t, "equal-map-v68-p-nil") + // ... + if v == nil { + v68v2 = nil + } else { + v68v2 = make(map[float64]int64, len(v)) + } // reset map + var v68v3, v68v4 typMapMapFloat64Int64 + v68v3 = typMapMapFloat64Int64(v68v1) + v68v4 = typMapMapFloat64Int64(v68v2) + bs68 = testMarshalErr(v68v3, h, t, "enc-map-v68-custom") + testUnmarshalErr(v68v4, bs68, h, t, "dec-map-v68-p-len") + testDeepEqualErr(v68v3, v68v4, t, "equal-map-v68-p-len") + } + + for _, v := range []map[float64]float32{nil, {}, {22.2: 0, 11.1: 22.2}} { + // fmt.Printf(">>>> running mammoth map v69: %v\n", v) + var v69v1, v69v2 map[float64]float32 + v69v1 = v + bs69 := testMarshalErr(v69v1, h, t, "enc-map-v69") + if v == nil { + v69v2 = nil + } else { + v69v2 = make(map[float64]float32, len(v)) + } // reset map + testUnmarshalErr(v69v2, bs69, h, t, "dec-map-v69") + testDeepEqualErr(v69v1, v69v2, t, "equal-map-v69") + if v == nil { + v69v2 = nil + } else { + v69v2 = make(map[float64]float32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v69v2), bs69, h, t, "dec-map-v69-noaddr") // decode into non-addressable map value + testDeepEqualErr(v69v1, v69v2, t, "equal-map-v69-noaddr") + if v == nil { + v69v2 = nil + } else { + v69v2 = make(map[float64]float32, len(v)) + } // reset map + testUnmarshalErr(&v69v2, bs69, h, t, "dec-map-v69-p-len") + testDeepEqualErr(v69v1, v69v2, t, "equal-map-v69-p-len") + bs69 = testMarshalErr(&v69v1, h, t, "enc-map-v69-p") + v69v2 = nil + testUnmarshalErr(&v69v2, bs69, h, t, "dec-map-v69-p-nil") + testDeepEqualErr(v69v1, v69v2, t, "equal-map-v69-p-nil") + // ... + if v == nil { + v69v2 = nil + } else { + v69v2 = make(map[float64]float32, len(v)) + } // reset map + var v69v3, v69v4 typMapMapFloat64Float32 + v69v3 = typMapMapFloat64Float32(v69v1) + v69v4 = typMapMapFloat64Float32(v69v2) + bs69 = testMarshalErr(v69v3, h, t, "enc-map-v69-custom") + testUnmarshalErr(v69v4, bs69, h, t, "dec-map-v69-p-len") + testDeepEqualErr(v69v3, v69v4, t, "equal-map-v69-p-len") + } + + for _, v := range []map[float64]float64{nil, {}, {11.1: 0, 22.2: 11.1}} { + // fmt.Printf(">>>> running mammoth map v70: %v\n", v) + var v70v1, v70v2 map[float64]float64 + v70v1 = v + bs70 := testMarshalErr(v70v1, h, t, "enc-map-v70") + if v == nil { + v70v2 = nil + } else { + v70v2 = make(map[float64]float64, len(v)) + } // reset map + testUnmarshalErr(v70v2, bs70, h, t, "dec-map-v70") + testDeepEqualErr(v70v1, v70v2, t, "equal-map-v70") + if v == nil { + v70v2 = nil + } else { + v70v2 = make(map[float64]float64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v70v2), bs70, h, t, "dec-map-v70-noaddr") // decode into non-addressable map value + testDeepEqualErr(v70v1, v70v2, t, "equal-map-v70-noaddr") + if v == nil { + v70v2 = nil + } else { + v70v2 = make(map[float64]float64, len(v)) + } // reset map + testUnmarshalErr(&v70v2, bs70, h, t, "dec-map-v70-p-len") + testDeepEqualErr(v70v1, v70v2, t, "equal-map-v70-p-len") + bs70 = testMarshalErr(&v70v1, h, t, "enc-map-v70-p") + v70v2 = nil + testUnmarshalErr(&v70v2, bs70, h, t, "dec-map-v70-p-nil") + testDeepEqualErr(v70v1, v70v2, t, "equal-map-v70-p-nil") + // ... + if v == nil { + v70v2 = nil + } else { + v70v2 = make(map[float64]float64, len(v)) + } // reset map + var v70v3, v70v4 typMapMapFloat64Float64 + v70v3 = typMapMapFloat64Float64(v70v1) + v70v4 = typMapMapFloat64Float64(v70v2) + bs70 = testMarshalErr(v70v3, h, t, "enc-map-v70-custom") + testUnmarshalErr(v70v4, bs70, h, t, "dec-map-v70-p-len") + testDeepEqualErr(v70v3, v70v4, t, "equal-map-v70-p-len") + } + + for _, v := range []map[float64]bool{nil, {}, {22.2: false, 11.1: true}} { + // fmt.Printf(">>>> running mammoth map v71: %v\n", v) + var v71v1, v71v2 map[float64]bool + v71v1 = v + bs71 := testMarshalErr(v71v1, h, t, "enc-map-v71") + if v == nil { + v71v2 = nil + } else { + v71v2 = make(map[float64]bool, len(v)) + } // reset map + testUnmarshalErr(v71v2, bs71, h, t, "dec-map-v71") + testDeepEqualErr(v71v1, v71v2, t, "equal-map-v71") + if v == nil { + v71v2 = nil + } else { + v71v2 = make(map[float64]bool, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v71v2), bs71, h, t, "dec-map-v71-noaddr") // decode into non-addressable map value + testDeepEqualErr(v71v1, v71v2, t, "equal-map-v71-noaddr") + if v == nil { + v71v2 = nil + } else { + v71v2 = make(map[float64]bool, len(v)) + } // reset map + testUnmarshalErr(&v71v2, bs71, h, t, "dec-map-v71-p-len") + testDeepEqualErr(v71v1, v71v2, t, "equal-map-v71-p-len") + bs71 = testMarshalErr(&v71v1, h, t, "enc-map-v71-p") + v71v2 = nil + testUnmarshalErr(&v71v2, bs71, h, t, "dec-map-v71-p-nil") + testDeepEqualErr(v71v1, v71v2, t, "equal-map-v71-p-nil") + // ... + if v == nil { + v71v2 = nil + } else { + v71v2 = make(map[float64]bool, len(v)) + } // reset map + var v71v3, v71v4 typMapMapFloat64Bool + v71v3 = typMapMapFloat64Bool(v71v1) + v71v4 = typMapMapFloat64Bool(v71v2) + bs71 = testMarshalErr(v71v3, h, t, "enc-map-v71-custom") + testUnmarshalErr(v71v4, bs71, h, t, "dec-map-v71-p-len") + testDeepEqualErr(v71v3, v71v4, t, "equal-map-v71-p-len") + } + + for _, v := range []map[uint]interface{}{nil, {}, {44: nil, 33: "string-is-an-interface-2"}} { + // fmt.Printf(">>>> running mammoth map v74: %v\n", v) + var v74v1, v74v2 map[uint]interface{} + v74v1 = v + bs74 := testMarshalErr(v74v1, h, t, "enc-map-v74") + if v == nil { + v74v2 = nil + } else { + v74v2 = make(map[uint]interface{}, len(v)) + } // reset map + testUnmarshalErr(v74v2, bs74, h, t, "dec-map-v74") + testDeepEqualErr(v74v1, v74v2, t, "equal-map-v74") + if v == nil { + v74v2 = nil + } else { + v74v2 = make(map[uint]interface{}, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v74v2), bs74, h, t, "dec-map-v74-noaddr") // decode into non-addressable map value + testDeepEqualErr(v74v1, v74v2, t, "equal-map-v74-noaddr") + if v == nil { + v74v2 = nil + } else { + v74v2 = make(map[uint]interface{}, len(v)) + } // reset map + testUnmarshalErr(&v74v2, bs74, h, t, "dec-map-v74-p-len") + testDeepEqualErr(v74v1, v74v2, t, "equal-map-v74-p-len") + bs74 = testMarshalErr(&v74v1, h, t, "enc-map-v74-p") + v74v2 = nil + testUnmarshalErr(&v74v2, bs74, h, t, "dec-map-v74-p-nil") + testDeepEqualErr(v74v1, v74v2, t, "equal-map-v74-p-nil") + // ... + if v == nil { + v74v2 = nil + } else { + v74v2 = make(map[uint]interface{}, len(v)) + } // reset map + var v74v3, v74v4 typMapMapUintIntf + v74v3 = typMapMapUintIntf(v74v1) + v74v4 = typMapMapUintIntf(v74v2) + bs74 = testMarshalErr(v74v3, h, t, "enc-map-v74-custom") + testUnmarshalErr(v74v4, bs74, h, t, "dec-map-v74-p-len") + testDeepEqualErr(v74v3, v74v4, t, "equal-map-v74-p-len") + } + + for _, v := range []map[uint]string{nil, {}, {44: "", 33: "some-string-2"}} { + // fmt.Printf(">>>> running mammoth map v75: %v\n", v) + var v75v1, v75v2 map[uint]string + v75v1 = v + bs75 := testMarshalErr(v75v1, h, t, "enc-map-v75") + if v == nil { + v75v2 = nil + } else { + v75v2 = make(map[uint]string, len(v)) + } // reset map + testUnmarshalErr(v75v2, bs75, h, t, "dec-map-v75") + testDeepEqualErr(v75v1, v75v2, t, "equal-map-v75") + if v == nil { + v75v2 = nil + } else { + v75v2 = make(map[uint]string, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v75v2), bs75, h, t, "dec-map-v75-noaddr") // decode into non-addressable map value + testDeepEqualErr(v75v1, v75v2, t, "equal-map-v75-noaddr") + if v == nil { + v75v2 = nil + } else { + v75v2 = make(map[uint]string, len(v)) + } // reset map + testUnmarshalErr(&v75v2, bs75, h, t, "dec-map-v75-p-len") + testDeepEqualErr(v75v1, v75v2, t, "equal-map-v75-p-len") + bs75 = testMarshalErr(&v75v1, h, t, "enc-map-v75-p") + v75v2 = nil + testUnmarshalErr(&v75v2, bs75, h, t, "dec-map-v75-p-nil") + testDeepEqualErr(v75v1, v75v2, t, "equal-map-v75-p-nil") + // ... + if v == nil { + v75v2 = nil + } else { + v75v2 = make(map[uint]string, len(v)) + } // reset map + var v75v3, v75v4 typMapMapUintString + v75v3 = typMapMapUintString(v75v1) + v75v4 = typMapMapUintString(v75v2) + bs75 = testMarshalErr(v75v3, h, t, "enc-map-v75-custom") + testUnmarshalErr(v75v4, bs75, h, t, "dec-map-v75-p-len") + testDeepEqualErr(v75v3, v75v4, t, "equal-map-v75-p-len") + } + + for _, v := range []map[uint]uint{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v76: %v\n", v) + var v76v1, v76v2 map[uint]uint + v76v1 = v + bs76 := testMarshalErr(v76v1, h, t, "enc-map-v76") + if v == nil { + v76v2 = nil + } else { + v76v2 = make(map[uint]uint, len(v)) + } // reset map + testUnmarshalErr(v76v2, bs76, h, t, "dec-map-v76") + testDeepEqualErr(v76v1, v76v2, t, "equal-map-v76") + if v == nil { + v76v2 = nil + } else { + v76v2 = make(map[uint]uint, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v76v2), bs76, h, t, "dec-map-v76-noaddr") // decode into non-addressable map value + testDeepEqualErr(v76v1, v76v2, t, "equal-map-v76-noaddr") + if v == nil { + v76v2 = nil + } else { + v76v2 = make(map[uint]uint, len(v)) + } // reset map + testUnmarshalErr(&v76v2, bs76, h, t, "dec-map-v76-p-len") + testDeepEqualErr(v76v1, v76v2, t, "equal-map-v76-p-len") + bs76 = testMarshalErr(&v76v1, h, t, "enc-map-v76-p") + v76v2 = nil + testUnmarshalErr(&v76v2, bs76, h, t, "dec-map-v76-p-nil") + testDeepEqualErr(v76v1, v76v2, t, "equal-map-v76-p-nil") + // ... + if v == nil { + v76v2 = nil + } else { + v76v2 = make(map[uint]uint, len(v)) + } // reset map + var v76v3, v76v4 typMapMapUintUint + v76v3 = typMapMapUintUint(v76v1) + v76v4 = typMapMapUintUint(v76v2) + bs76 = testMarshalErr(v76v3, h, t, "enc-map-v76-custom") + testUnmarshalErr(v76v4, bs76, h, t, "dec-map-v76-p-len") + testDeepEqualErr(v76v3, v76v4, t, "equal-map-v76-p-len") + } + + for _, v := range []map[uint]uint8{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v77: %v\n", v) + var v77v1, v77v2 map[uint]uint8 + v77v1 = v + bs77 := testMarshalErr(v77v1, h, t, "enc-map-v77") + if v == nil { + v77v2 = nil + } else { + v77v2 = make(map[uint]uint8, len(v)) + } // reset map + testUnmarshalErr(v77v2, bs77, h, t, "dec-map-v77") + testDeepEqualErr(v77v1, v77v2, t, "equal-map-v77") + if v == nil { + v77v2 = nil + } else { + v77v2 = make(map[uint]uint8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v77v2), bs77, h, t, "dec-map-v77-noaddr") // decode into non-addressable map value + testDeepEqualErr(v77v1, v77v2, t, "equal-map-v77-noaddr") + if v == nil { + v77v2 = nil + } else { + v77v2 = make(map[uint]uint8, len(v)) + } // reset map + testUnmarshalErr(&v77v2, bs77, h, t, "dec-map-v77-p-len") + testDeepEqualErr(v77v1, v77v2, t, "equal-map-v77-p-len") + bs77 = testMarshalErr(&v77v1, h, t, "enc-map-v77-p") + v77v2 = nil + testUnmarshalErr(&v77v2, bs77, h, t, "dec-map-v77-p-nil") + testDeepEqualErr(v77v1, v77v2, t, "equal-map-v77-p-nil") + // ... + if v == nil { + v77v2 = nil + } else { + v77v2 = make(map[uint]uint8, len(v)) + } // reset map + var v77v3, v77v4 typMapMapUintUint8 + v77v3 = typMapMapUintUint8(v77v1) + v77v4 = typMapMapUintUint8(v77v2) + bs77 = testMarshalErr(v77v3, h, t, "enc-map-v77-custom") + testUnmarshalErr(v77v4, bs77, h, t, "dec-map-v77-p-len") + testDeepEqualErr(v77v3, v77v4, t, "equal-map-v77-p-len") + } + + for _, v := range []map[uint]uint16{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v78: %v\n", v) + var v78v1, v78v2 map[uint]uint16 + v78v1 = v + bs78 := testMarshalErr(v78v1, h, t, "enc-map-v78") + if v == nil { + v78v2 = nil + } else { + v78v2 = make(map[uint]uint16, len(v)) + } // reset map + testUnmarshalErr(v78v2, bs78, h, t, "dec-map-v78") + testDeepEqualErr(v78v1, v78v2, t, "equal-map-v78") + if v == nil { + v78v2 = nil + } else { + v78v2 = make(map[uint]uint16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v78v2), bs78, h, t, "dec-map-v78-noaddr") // decode into non-addressable map value + testDeepEqualErr(v78v1, v78v2, t, "equal-map-v78-noaddr") + if v == nil { + v78v2 = nil + } else { + v78v2 = make(map[uint]uint16, len(v)) + } // reset map + testUnmarshalErr(&v78v2, bs78, h, t, "dec-map-v78-p-len") + testDeepEqualErr(v78v1, v78v2, t, "equal-map-v78-p-len") + bs78 = testMarshalErr(&v78v1, h, t, "enc-map-v78-p") + v78v2 = nil + testUnmarshalErr(&v78v2, bs78, h, t, "dec-map-v78-p-nil") + testDeepEqualErr(v78v1, v78v2, t, "equal-map-v78-p-nil") + // ... + if v == nil { + v78v2 = nil + } else { + v78v2 = make(map[uint]uint16, len(v)) + } // reset map + var v78v3, v78v4 typMapMapUintUint16 + v78v3 = typMapMapUintUint16(v78v1) + v78v4 = typMapMapUintUint16(v78v2) + bs78 = testMarshalErr(v78v3, h, t, "enc-map-v78-custom") + testUnmarshalErr(v78v4, bs78, h, t, "dec-map-v78-p-len") + testDeepEqualErr(v78v3, v78v4, t, "equal-map-v78-p-len") + } + + for _, v := range []map[uint]uint32{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v79: %v\n", v) + var v79v1, v79v2 map[uint]uint32 + v79v1 = v + bs79 := testMarshalErr(v79v1, h, t, "enc-map-v79") + if v == nil { + v79v2 = nil + } else { + v79v2 = make(map[uint]uint32, len(v)) + } // reset map + testUnmarshalErr(v79v2, bs79, h, t, "dec-map-v79") + testDeepEqualErr(v79v1, v79v2, t, "equal-map-v79") + if v == nil { + v79v2 = nil + } else { + v79v2 = make(map[uint]uint32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v79v2), bs79, h, t, "dec-map-v79-noaddr") // decode into non-addressable map value + testDeepEqualErr(v79v1, v79v2, t, "equal-map-v79-noaddr") + if v == nil { + v79v2 = nil + } else { + v79v2 = make(map[uint]uint32, len(v)) + } // reset map + testUnmarshalErr(&v79v2, bs79, h, t, "dec-map-v79-p-len") + testDeepEqualErr(v79v1, v79v2, t, "equal-map-v79-p-len") + bs79 = testMarshalErr(&v79v1, h, t, "enc-map-v79-p") + v79v2 = nil + testUnmarshalErr(&v79v2, bs79, h, t, "dec-map-v79-p-nil") + testDeepEqualErr(v79v1, v79v2, t, "equal-map-v79-p-nil") + // ... + if v == nil { + v79v2 = nil + } else { + v79v2 = make(map[uint]uint32, len(v)) + } // reset map + var v79v3, v79v4 typMapMapUintUint32 + v79v3 = typMapMapUintUint32(v79v1) + v79v4 = typMapMapUintUint32(v79v2) + bs79 = testMarshalErr(v79v3, h, t, "enc-map-v79-custom") + testUnmarshalErr(v79v4, bs79, h, t, "dec-map-v79-p-len") + testDeepEqualErr(v79v3, v79v4, t, "equal-map-v79-p-len") + } + + for _, v := range []map[uint]uint64{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v80: %v\n", v) + var v80v1, v80v2 map[uint]uint64 + v80v1 = v + bs80 := testMarshalErr(v80v1, h, t, "enc-map-v80") + if v == nil { + v80v2 = nil + } else { + v80v2 = make(map[uint]uint64, len(v)) + } // reset map + testUnmarshalErr(v80v2, bs80, h, t, "dec-map-v80") + testDeepEqualErr(v80v1, v80v2, t, "equal-map-v80") + if v == nil { + v80v2 = nil + } else { + v80v2 = make(map[uint]uint64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v80v2), bs80, h, t, "dec-map-v80-noaddr") // decode into non-addressable map value + testDeepEqualErr(v80v1, v80v2, t, "equal-map-v80-noaddr") + if v == nil { + v80v2 = nil + } else { + v80v2 = make(map[uint]uint64, len(v)) + } // reset map + testUnmarshalErr(&v80v2, bs80, h, t, "dec-map-v80-p-len") + testDeepEqualErr(v80v1, v80v2, t, "equal-map-v80-p-len") + bs80 = testMarshalErr(&v80v1, h, t, "enc-map-v80-p") + v80v2 = nil + testUnmarshalErr(&v80v2, bs80, h, t, "dec-map-v80-p-nil") + testDeepEqualErr(v80v1, v80v2, t, "equal-map-v80-p-nil") + // ... + if v == nil { + v80v2 = nil + } else { + v80v2 = make(map[uint]uint64, len(v)) + } // reset map + var v80v3, v80v4 typMapMapUintUint64 + v80v3 = typMapMapUintUint64(v80v1) + v80v4 = typMapMapUintUint64(v80v2) + bs80 = testMarshalErr(v80v3, h, t, "enc-map-v80-custom") + testUnmarshalErr(v80v4, bs80, h, t, "dec-map-v80-p-len") + testDeepEqualErr(v80v3, v80v4, t, "equal-map-v80-p-len") + } + + for _, v := range []map[uint]uintptr{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v81: %v\n", v) + var v81v1, v81v2 map[uint]uintptr + v81v1 = v + bs81 := testMarshalErr(v81v1, h, t, "enc-map-v81") + if v == nil { + v81v2 = nil + } else { + v81v2 = make(map[uint]uintptr, len(v)) + } // reset map + testUnmarshalErr(v81v2, bs81, h, t, "dec-map-v81") + testDeepEqualErr(v81v1, v81v2, t, "equal-map-v81") + if v == nil { + v81v2 = nil + } else { + v81v2 = make(map[uint]uintptr, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v81v2), bs81, h, t, "dec-map-v81-noaddr") // decode into non-addressable map value + testDeepEqualErr(v81v1, v81v2, t, "equal-map-v81-noaddr") + if v == nil { + v81v2 = nil + } else { + v81v2 = make(map[uint]uintptr, len(v)) + } // reset map + testUnmarshalErr(&v81v2, bs81, h, t, "dec-map-v81-p-len") + testDeepEqualErr(v81v1, v81v2, t, "equal-map-v81-p-len") + bs81 = testMarshalErr(&v81v1, h, t, "enc-map-v81-p") + v81v2 = nil + testUnmarshalErr(&v81v2, bs81, h, t, "dec-map-v81-p-nil") + testDeepEqualErr(v81v1, v81v2, t, "equal-map-v81-p-nil") + // ... + if v == nil { + v81v2 = nil + } else { + v81v2 = make(map[uint]uintptr, len(v)) + } // reset map + var v81v3, v81v4 typMapMapUintUintptr + v81v3 = typMapMapUintUintptr(v81v1) + v81v4 = typMapMapUintUintptr(v81v2) + bs81 = testMarshalErr(v81v3, h, t, "enc-map-v81-custom") + testUnmarshalErr(v81v4, bs81, h, t, "dec-map-v81-p-len") + testDeepEqualErr(v81v3, v81v4, t, "equal-map-v81-p-len") + } + + for _, v := range []map[uint]int{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v82: %v\n", v) + var v82v1, v82v2 map[uint]int + v82v1 = v + bs82 := testMarshalErr(v82v1, h, t, "enc-map-v82") + if v == nil { + v82v2 = nil + } else { + v82v2 = make(map[uint]int, len(v)) + } // reset map + testUnmarshalErr(v82v2, bs82, h, t, "dec-map-v82") + testDeepEqualErr(v82v1, v82v2, t, "equal-map-v82") + if v == nil { + v82v2 = nil + } else { + v82v2 = make(map[uint]int, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v82v2), bs82, h, t, "dec-map-v82-noaddr") // decode into non-addressable map value + testDeepEqualErr(v82v1, v82v2, t, "equal-map-v82-noaddr") + if v == nil { + v82v2 = nil + } else { + v82v2 = make(map[uint]int, len(v)) + } // reset map + testUnmarshalErr(&v82v2, bs82, h, t, "dec-map-v82-p-len") + testDeepEqualErr(v82v1, v82v2, t, "equal-map-v82-p-len") + bs82 = testMarshalErr(&v82v1, h, t, "enc-map-v82-p") + v82v2 = nil + testUnmarshalErr(&v82v2, bs82, h, t, "dec-map-v82-p-nil") + testDeepEqualErr(v82v1, v82v2, t, "equal-map-v82-p-nil") + // ... + if v == nil { + v82v2 = nil + } else { + v82v2 = make(map[uint]int, len(v)) + } // reset map + var v82v3, v82v4 typMapMapUintInt + v82v3 = typMapMapUintInt(v82v1) + v82v4 = typMapMapUintInt(v82v2) + bs82 = testMarshalErr(v82v3, h, t, "enc-map-v82-custom") + testUnmarshalErr(v82v4, bs82, h, t, "dec-map-v82-p-len") + testDeepEqualErr(v82v3, v82v4, t, "equal-map-v82-p-len") + } + + for _, v := range []map[uint]int8{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v83: %v\n", v) + var v83v1, v83v2 map[uint]int8 + v83v1 = v + bs83 := testMarshalErr(v83v1, h, t, "enc-map-v83") + if v == nil { + v83v2 = nil + } else { + v83v2 = make(map[uint]int8, len(v)) + } // reset map + testUnmarshalErr(v83v2, bs83, h, t, "dec-map-v83") + testDeepEqualErr(v83v1, v83v2, t, "equal-map-v83") + if v == nil { + v83v2 = nil + } else { + v83v2 = make(map[uint]int8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v83v2), bs83, h, t, "dec-map-v83-noaddr") // decode into non-addressable map value + testDeepEqualErr(v83v1, v83v2, t, "equal-map-v83-noaddr") + if v == nil { + v83v2 = nil + } else { + v83v2 = make(map[uint]int8, len(v)) + } // reset map + testUnmarshalErr(&v83v2, bs83, h, t, "dec-map-v83-p-len") + testDeepEqualErr(v83v1, v83v2, t, "equal-map-v83-p-len") + bs83 = testMarshalErr(&v83v1, h, t, "enc-map-v83-p") + v83v2 = nil + testUnmarshalErr(&v83v2, bs83, h, t, "dec-map-v83-p-nil") + testDeepEqualErr(v83v1, v83v2, t, "equal-map-v83-p-nil") + // ... + if v == nil { + v83v2 = nil + } else { + v83v2 = make(map[uint]int8, len(v)) + } // reset map + var v83v3, v83v4 typMapMapUintInt8 + v83v3 = typMapMapUintInt8(v83v1) + v83v4 = typMapMapUintInt8(v83v2) + bs83 = testMarshalErr(v83v3, h, t, "enc-map-v83-custom") + testUnmarshalErr(v83v4, bs83, h, t, "dec-map-v83-p-len") + testDeepEqualErr(v83v3, v83v4, t, "equal-map-v83-p-len") + } + + for _, v := range []map[uint]int16{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v84: %v\n", v) + var v84v1, v84v2 map[uint]int16 + v84v1 = v + bs84 := testMarshalErr(v84v1, h, t, "enc-map-v84") + if v == nil { + v84v2 = nil + } else { + v84v2 = make(map[uint]int16, len(v)) + } // reset map + testUnmarshalErr(v84v2, bs84, h, t, "dec-map-v84") + testDeepEqualErr(v84v1, v84v2, t, "equal-map-v84") + if v == nil { + v84v2 = nil + } else { + v84v2 = make(map[uint]int16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v84v2), bs84, h, t, "dec-map-v84-noaddr") // decode into non-addressable map value + testDeepEqualErr(v84v1, v84v2, t, "equal-map-v84-noaddr") + if v == nil { + v84v2 = nil + } else { + v84v2 = make(map[uint]int16, len(v)) + } // reset map + testUnmarshalErr(&v84v2, bs84, h, t, "dec-map-v84-p-len") + testDeepEqualErr(v84v1, v84v2, t, "equal-map-v84-p-len") + bs84 = testMarshalErr(&v84v1, h, t, "enc-map-v84-p") + v84v2 = nil + testUnmarshalErr(&v84v2, bs84, h, t, "dec-map-v84-p-nil") + testDeepEqualErr(v84v1, v84v2, t, "equal-map-v84-p-nil") + // ... + if v == nil { + v84v2 = nil + } else { + v84v2 = make(map[uint]int16, len(v)) + } // reset map + var v84v3, v84v4 typMapMapUintInt16 + v84v3 = typMapMapUintInt16(v84v1) + v84v4 = typMapMapUintInt16(v84v2) + bs84 = testMarshalErr(v84v3, h, t, "enc-map-v84-custom") + testUnmarshalErr(v84v4, bs84, h, t, "dec-map-v84-p-len") + testDeepEqualErr(v84v3, v84v4, t, "equal-map-v84-p-len") + } + + for _, v := range []map[uint]int32{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v85: %v\n", v) + var v85v1, v85v2 map[uint]int32 + v85v1 = v + bs85 := testMarshalErr(v85v1, h, t, "enc-map-v85") + if v == nil { + v85v2 = nil + } else { + v85v2 = make(map[uint]int32, len(v)) + } // reset map + testUnmarshalErr(v85v2, bs85, h, t, "dec-map-v85") + testDeepEqualErr(v85v1, v85v2, t, "equal-map-v85") + if v == nil { + v85v2 = nil + } else { + v85v2 = make(map[uint]int32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v85v2), bs85, h, t, "dec-map-v85-noaddr") // decode into non-addressable map value + testDeepEqualErr(v85v1, v85v2, t, "equal-map-v85-noaddr") + if v == nil { + v85v2 = nil + } else { + v85v2 = make(map[uint]int32, len(v)) + } // reset map + testUnmarshalErr(&v85v2, bs85, h, t, "dec-map-v85-p-len") + testDeepEqualErr(v85v1, v85v2, t, "equal-map-v85-p-len") + bs85 = testMarshalErr(&v85v1, h, t, "enc-map-v85-p") + v85v2 = nil + testUnmarshalErr(&v85v2, bs85, h, t, "dec-map-v85-p-nil") + testDeepEqualErr(v85v1, v85v2, t, "equal-map-v85-p-nil") + // ... + if v == nil { + v85v2 = nil + } else { + v85v2 = make(map[uint]int32, len(v)) + } // reset map + var v85v3, v85v4 typMapMapUintInt32 + v85v3 = typMapMapUintInt32(v85v1) + v85v4 = typMapMapUintInt32(v85v2) + bs85 = testMarshalErr(v85v3, h, t, "enc-map-v85-custom") + testUnmarshalErr(v85v4, bs85, h, t, "dec-map-v85-p-len") + testDeepEqualErr(v85v3, v85v4, t, "equal-map-v85-p-len") + } + + for _, v := range []map[uint]int64{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v86: %v\n", v) + var v86v1, v86v2 map[uint]int64 + v86v1 = v + bs86 := testMarshalErr(v86v1, h, t, "enc-map-v86") + if v == nil { + v86v2 = nil + } else { + v86v2 = make(map[uint]int64, len(v)) + } // reset map + testUnmarshalErr(v86v2, bs86, h, t, "dec-map-v86") + testDeepEqualErr(v86v1, v86v2, t, "equal-map-v86") + if v == nil { + v86v2 = nil + } else { + v86v2 = make(map[uint]int64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v86v2), bs86, h, t, "dec-map-v86-noaddr") // decode into non-addressable map value + testDeepEqualErr(v86v1, v86v2, t, "equal-map-v86-noaddr") + if v == nil { + v86v2 = nil + } else { + v86v2 = make(map[uint]int64, len(v)) + } // reset map + testUnmarshalErr(&v86v2, bs86, h, t, "dec-map-v86-p-len") + testDeepEqualErr(v86v1, v86v2, t, "equal-map-v86-p-len") + bs86 = testMarshalErr(&v86v1, h, t, "enc-map-v86-p") + v86v2 = nil + testUnmarshalErr(&v86v2, bs86, h, t, "dec-map-v86-p-nil") + testDeepEqualErr(v86v1, v86v2, t, "equal-map-v86-p-nil") + // ... + if v == nil { + v86v2 = nil + } else { + v86v2 = make(map[uint]int64, len(v)) + } // reset map + var v86v3, v86v4 typMapMapUintInt64 + v86v3 = typMapMapUintInt64(v86v1) + v86v4 = typMapMapUintInt64(v86v2) + bs86 = testMarshalErr(v86v3, h, t, "enc-map-v86-custom") + testUnmarshalErr(v86v4, bs86, h, t, "dec-map-v86-p-len") + testDeepEqualErr(v86v3, v86v4, t, "equal-map-v86-p-len") + } + + for _, v := range []map[uint]float32{nil, {}, {33: 0, 44: 22.2}} { + // fmt.Printf(">>>> running mammoth map v87: %v\n", v) + var v87v1, v87v2 map[uint]float32 + v87v1 = v + bs87 := testMarshalErr(v87v1, h, t, "enc-map-v87") + if v == nil { + v87v2 = nil + } else { + v87v2 = make(map[uint]float32, len(v)) + } // reset map + testUnmarshalErr(v87v2, bs87, h, t, "dec-map-v87") + testDeepEqualErr(v87v1, v87v2, t, "equal-map-v87") + if v == nil { + v87v2 = nil + } else { + v87v2 = make(map[uint]float32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v87v2), bs87, h, t, "dec-map-v87-noaddr") // decode into non-addressable map value + testDeepEqualErr(v87v1, v87v2, t, "equal-map-v87-noaddr") + if v == nil { + v87v2 = nil + } else { + v87v2 = make(map[uint]float32, len(v)) + } // reset map + testUnmarshalErr(&v87v2, bs87, h, t, "dec-map-v87-p-len") + testDeepEqualErr(v87v1, v87v2, t, "equal-map-v87-p-len") + bs87 = testMarshalErr(&v87v1, h, t, "enc-map-v87-p") + v87v2 = nil + testUnmarshalErr(&v87v2, bs87, h, t, "dec-map-v87-p-nil") + testDeepEqualErr(v87v1, v87v2, t, "equal-map-v87-p-nil") + // ... + if v == nil { + v87v2 = nil + } else { + v87v2 = make(map[uint]float32, len(v)) + } // reset map + var v87v3, v87v4 typMapMapUintFloat32 + v87v3 = typMapMapUintFloat32(v87v1) + v87v4 = typMapMapUintFloat32(v87v2) + bs87 = testMarshalErr(v87v3, h, t, "enc-map-v87-custom") + testUnmarshalErr(v87v4, bs87, h, t, "dec-map-v87-p-len") + testDeepEqualErr(v87v3, v87v4, t, "equal-map-v87-p-len") + } + + for _, v := range []map[uint]float64{nil, {}, {33: 0, 44: 11.1}} { + // fmt.Printf(">>>> running mammoth map v88: %v\n", v) + var v88v1, v88v2 map[uint]float64 + v88v1 = v + bs88 := testMarshalErr(v88v1, h, t, "enc-map-v88") + if v == nil { + v88v2 = nil + } else { + v88v2 = make(map[uint]float64, len(v)) + } // reset map + testUnmarshalErr(v88v2, bs88, h, t, "dec-map-v88") + testDeepEqualErr(v88v1, v88v2, t, "equal-map-v88") + if v == nil { + v88v2 = nil + } else { + v88v2 = make(map[uint]float64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v88v2), bs88, h, t, "dec-map-v88-noaddr") // decode into non-addressable map value + testDeepEqualErr(v88v1, v88v2, t, "equal-map-v88-noaddr") + if v == nil { + v88v2 = nil + } else { + v88v2 = make(map[uint]float64, len(v)) + } // reset map + testUnmarshalErr(&v88v2, bs88, h, t, "dec-map-v88-p-len") + testDeepEqualErr(v88v1, v88v2, t, "equal-map-v88-p-len") + bs88 = testMarshalErr(&v88v1, h, t, "enc-map-v88-p") + v88v2 = nil + testUnmarshalErr(&v88v2, bs88, h, t, "dec-map-v88-p-nil") + testDeepEqualErr(v88v1, v88v2, t, "equal-map-v88-p-nil") + // ... + if v == nil { + v88v2 = nil + } else { + v88v2 = make(map[uint]float64, len(v)) + } // reset map + var v88v3, v88v4 typMapMapUintFloat64 + v88v3 = typMapMapUintFloat64(v88v1) + v88v4 = typMapMapUintFloat64(v88v2) + bs88 = testMarshalErr(v88v3, h, t, "enc-map-v88-custom") + testUnmarshalErr(v88v4, bs88, h, t, "dec-map-v88-p-len") + testDeepEqualErr(v88v3, v88v4, t, "equal-map-v88-p-len") + } + + for _, v := range []map[uint]bool{nil, {}, {33: false, 44: true}} { + // fmt.Printf(">>>> running mammoth map v89: %v\n", v) + var v89v1, v89v2 map[uint]bool + v89v1 = v + bs89 := testMarshalErr(v89v1, h, t, "enc-map-v89") + if v == nil { + v89v2 = nil + } else { + v89v2 = make(map[uint]bool, len(v)) + } // reset map + testUnmarshalErr(v89v2, bs89, h, t, "dec-map-v89") + testDeepEqualErr(v89v1, v89v2, t, "equal-map-v89") + if v == nil { + v89v2 = nil + } else { + v89v2 = make(map[uint]bool, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v89v2), bs89, h, t, "dec-map-v89-noaddr") // decode into non-addressable map value + testDeepEqualErr(v89v1, v89v2, t, "equal-map-v89-noaddr") + if v == nil { + v89v2 = nil + } else { + v89v2 = make(map[uint]bool, len(v)) + } // reset map + testUnmarshalErr(&v89v2, bs89, h, t, "dec-map-v89-p-len") + testDeepEqualErr(v89v1, v89v2, t, "equal-map-v89-p-len") + bs89 = testMarshalErr(&v89v1, h, t, "enc-map-v89-p") + v89v2 = nil + testUnmarshalErr(&v89v2, bs89, h, t, "dec-map-v89-p-nil") + testDeepEqualErr(v89v1, v89v2, t, "equal-map-v89-p-nil") + // ... + if v == nil { + v89v2 = nil + } else { + v89v2 = make(map[uint]bool, len(v)) + } // reset map + var v89v3, v89v4 typMapMapUintBool + v89v3 = typMapMapUintBool(v89v1) + v89v4 = typMapMapUintBool(v89v2) + bs89 = testMarshalErr(v89v3, h, t, "enc-map-v89-custom") + testUnmarshalErr(v89v4, bs89, h, t, "dec-map-v89-p-len") + testDeepEqualErr(v89v3, v89v4, t, "equal-map-v89-p-len") + } + + for _, v := range []map[uint8]interface{}{nil, {}, {33: nil, 44: "string-is-an-interface"}} { + // fmt.Printf(">>>> running mammoth map v92: %v\n", v) + var v92v1, v92v2 map[uint8]interface{} + v92v1 = v + bs92 := testMarshalErr(v92v1, h, t, "enc-map-v92") + if v == nil { + v92v2 = nil + } else { + v92v2 = make(map[uint8]interface{}, len(v)) + } // reset map + testUnmarshalErr(v92v2, bs92, h, t, "dec-map-v92") + testDeepEqualErr(v92v1, v92v2, t, "equal-map-v92") + if v == nil { + v92v2 = nil + } else { + v92v2 = make(map[uint8]interface{}, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v92v2), bs92, h, t, "dec-map-v92-noaddr") // decode into non-addressable map value + testDeepEqualErr(v92v1, v92v2, t, "equal-map-v92-noaddr") + if v == nil { + v92v2 = nil + } else { + v92v2 = make(map[uint8]interface{}, len(v)) + } // reset map + testUnmarshalErr(&v92v2, bs92, h, t, "dec-map-v92-p-len") + testDeepEqualErr(v92v1, v92v2, t, "equal-map-v92-p-len") + bs92 = testMarshalErr(&v92v1, h, t, "enc-map-v92-p") + v92v2 = nil + testUnmarshalErr(&v92v2, bs92, h, t, "dec-map-v92-p-nil") + testDeepEqualErr(v92v1, v92v2, t, "equal-map-v92-p-nil") + // ... + if v == nil { + v92v2 = nil + } else { + v92v2 = make(map[uint8]interface{}, len(v)) + } // reset map + var v92v3, v92v4 typMapMapUint8Intf + v92v3 = typMapMapUint8Intf(v92v1) + v92v4 = typMapMapUint8Intf(v92v2) + bs92 = testMarshalErr(v92v3, h, t, "enc-map-v92-custom") + testUnmarshalErr(v92v4, bs92, h, t, "dec-map-v92-p-len") + testDeepEqualErr(v92v3, v92v4, t, "equal-map-v92-p-len") + } + + for _, v := range []map[uint8]string{nil, {}, {33: "", 44: "some-string"}} { + // fmt.Printf(">>>> running mammoth map v93: %v\n", v) + var v93v1, v93v2 map[uint8]string + v93v1 = v + bs93 := testMarshalErr(v93v1, h, t, "enc-map-v93") + if v == nil { + v93v2 = nil + } else { + v93v2 = make(map[uint8]string, len(v)) + } // reset map + testUnmarshalErr(v93v2, bs93, h, t, "dec-map-v93") + testDeepEqualErr(v93v1, v93v2, t, "equal-map-v93") + if v == nil { + v93v2 = nil + } else { + v93v2 = make(map[uint8]string, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v93v2), bs93, h, t, "dec-map-v93-noaddr") // decode into non-addressable map value + testDeepEqualErr(v93v1, v93v2, t, "equal-map-v93-noaddr") + if v == nil { + v93v2 = nil + } else { + v93v2 = make(map[uint8]string, len(v)) + } // reset map + testUnmarshalErr(&v93v2, bs93, h, t, "dec-map-v93-p-len") + testDeepEqualErr(v93v1, v93v2, t, "equal-map-v93-p-len") + bs93 = testMarshalErr(&v93v1, h, t, "enc-map-v93-p") + v93v2 = nil + testUnmarshalErr(&v93v2, bs93, h, t, "dec-map-v93-p-nil") + testDeepEqualErr(v93v1, v93v2, t, "equal-map-v93-p-nil") + // ... + if v == nil { + v93v2 = nil + } else { + v93v2 = make(map[uint8]string, len(v)) + } // reset map + var v93v3, v93v4 typMapMapUint8String + v93v3 = typMapMapUint8String(v93v1) + v93v4 = typMapMapUint8String(v93v2) + bs93 = testMarshalErr(v93v3, h, t, "enc-map-v93-custom") + testUnmarshalErr(v93v4, bs93, h, t, "dec-map-v93-p-len") + testDeepEqualErr(v93v3, v93v4, t, "equal-map-v93-p-len") + } + + for _, v := range []map[uint8]uint{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v94: %v\n", v) + var v94v1, v94v2 map[uint8]uint + v94v1 = v + bs94 := testMarshalErr(v94v1, h, t, "enc-map-v94") + if v == nil { + v94v2 = nil + } else { + v94v2 = make(map[uint8]uint, len(v)) + } // reset map + testUnmarshalErr(v94v2, bs94, h, t, "dec-map-v94") + testDeepEqualErr(v94v1, v94v2, t, "equal-map-v94") + if v == nil { + v94v2 = nil + } else { + v94v2 = make(map[uint8]uint, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v94v2), bs94, h, t, "dec-map-v94-noaddr") // decode into non-addressable map value + testDeepEqualErr(v94v1, v94v2, t, "equal-map-v94-noaddr") + if v == nil { + v94v2 = nil + } else { + v94v2 = make(map[uint8]uint, len(v)) + } // reset map + testUnmarshalErr(&v94v2, bs94, h, t, "dec-map-v94-p-len") + testDeepEqualErr(v94v1, v94v2, t, "equal-map-v94-p-len") + bs94 = testMarshalErr(&v94v1, h, t, "enc-map-v94-p") + v94v2 = nil + testUnmarshalErr(&v94v2, bs94, h, t, "dec-map-v94-p-nil") + testDeepEqualErr(v94v1, v94v2, t, "equal-map-v94-p-nil") + // ... + if v == nil { + v94v2 = nil + } else { + v94v2 = make(map[uint8]uint, len(v)) + } // reset map + var v94v3, v94v4 typMapMapUint8Uint + v94v3 = typMapMapUint8Uint(v94v1) + v94v4 = typMapMapUint8Uint(v94v2) + bs94 = testMarshalErr(v94v3, h, t, "enc-map-v94-custom") + testUnmarshalErr(v94v4, bs94, h, t, "dec-map-v94-p-len") + testDeepEqualErr(v94v3, v94v4, t, "equal-map-v94-p-len") + } + + for _, v := range []map[uint8]uint8{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v95: %v\n", v) + var v95v1, v95v2 map[uint8]uint8 + v95v1 = v + bs95 := testMarshalErr(v95v1, h, t, "enc-map-v95") + if v == nil { + v95v2 = nil + } else { + v95v2 = make(map[uint8]uint8, len(v)) + } // reset map + testUnmarshalErr(v95v2, bs95, h, t, "dec-map-v95") + testDeepEqualErr(v95v1, v95v2, t, "equal-map-v95") + if v == nil { + v95v2 = nil + } else { + v95v2 = make(map[uint8]uint8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v95v2), bs95, h, t, "dec-map-v95-noaddr") // decode into non-addressable map value + testDeepEqualErr(v95v1, v95v2, t, "equal-map-v95-noaddr") + if v == nil { + v95v2 = nil + } else { + v95v2 = make(map[uint8]uint8, len(v)) + } // reset map + testUnmarshalErr(&v95v2, bs95, h, t, "dec-map-v95-p-len") + testDeepEqualErr(v95v1, v95v2, t, "equal-map-v95-p-len") + bs95 = testMarshalErr(&v95v1, h, t, "enc-map-v95-p") + v95v2 = nil + testUnmarshalErr(&v95v2, bs95, h, t, "dec-map-v95-p-nil") + testDeepEqualErr(v95v1, v95v2, t, "equal-map-v95-p-nil") + // ... + if v == nil { + v95v2 = nil + } else { + v95v2 = make(map[uint8]uint8, len(v)) + } // reset map + var v95v3, v95v4 typMapMapUint8Uint8 + v95v3 = typMapMapUint8Uint8(v95v1) + v95v4 = typMapMapUint8Uint8(v95v2) + bs95 = testMarshalErr(v95v3, h, t, "enc-map-v95-custom") + testUnmarshalErr(v95v4, bs95, h, t, "dec-map-v95-p-len") + testDeepEqualErr(v95v3, v95v4, t, "equal-map-v95-p-len") + } + + for _, v := range []map[uint8]uint16{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v96: %v\n", v) + var v96v1, v96v2 map[uint8]uint16 + v96v1 = v + bs96 := testMarshalErr(v96v1, h, t, "enc-map-v96") + if v == nil { + v96v2 = nil + } else { + v96v2 = make(map[uint8]uint16, len(v)) + } // reset map + testUnmarshalErr(v96v2, bs96, h, t, "dec-map-v96") + testDeepEqualErr(v96v1, v96v2, t, "equal-map-v96") + if v == nil { + v96v2 = nil + } else { + v96v2 = make(map[uint8]uint16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v96v2), bs96, h, t, "dec-map-v96-noaddr") // decode into non-addressable map value + testDeepEqualErr(v96v1, v96v2, t, "equal-map-v96-noaddr") + if v == nil { + v96v2 = nil + } else { + v96v2 = make(map[uint8]uint16, len(v)) + } // reset map + testUnmarshalErr(&v96v2, bs96, h, t, "dec-map-v96-p-len") + testDeepEqualErr(v96v1, v96v2, t, "equal-map-v96-p-len") + bs96 = testMarshalErr(&v96v1, h, t, "enc-map-v96-p") + v96v2 = nil + testUnmarshalErr(&v96v2, bs96, h, t, "dec-map-v96-p-nil") + testDeepEqualErr(v96v1, v96v2, t, "equal-map-v96-p-nil") + // ... + if v == nil { + v96v2 = nil + } else { + v96v2 = make(map[uint8]uint16, len(v)) + } // reset map + var v96v3, v96v4 typMapMapUint8Uint16 + v96v3 = typMapMapUint8Uint16(v96v1) + v96v4 = typMapMapUint8Uint16(v96v2) + bs96 = testMarshalErr(v96v3, h, t, "enc-map-v96-custom") + testUnmarshalErr(v96v4, bs96, h, t, "dec-map-v96-p-len") + testDeepEqualErr(v96v3, v96v4, t, "equal-map-v96-p-len") + } + + for _, v := range []map[uint8]uint32{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v97: %v\n", v) + var v97v1, v97v2 map[uint8]uint32 + v97v1 = v + bs97 := testMarshalErr(v97v1, h, t, "enc-map-v97") + if v == nil { + v97v2 = nil + } else { + v97v2 = make(map[uint8]uint32, len(v)) + } // reset map + testUnmarshalErr(v97v2, bs97, h, t, "dec-map-v97") + testDeepEqualErr(v97v1, v97v2, t, "equal-map-v97") + if v == nil { + v97v2 = nil + } else { + v97v2 = make(map[uint8]uint32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v97v2), bs97, h, t, "dec-map-v97-noaddr") // decode into non-addressable map value + testDeepEqualErr(v97v1, v97v2, t, "equal-map-v97-noaddr") + if v == nil { + v97v2 = nil + } else { + v97v2 = make(map[uint8]uint32, len(v)) + } // reset map + testUnmarshalErr(&v97v2, bs97, h, t, "dec-map-v97-p-len") + testDeepEqualErr(v97v1, v97v2, t, "equal-map-v97-p-len") + bs97 = testMarshalErr(&v97v1, h, t, "enc-map-v97-p") + v97v2 = nil + testUnmarshalErr(&v97v2, bs97, h, t, "dec-map-v97-p-nil") + testDeepEqualErr(v97v1, v97v2, t, "equal-map-v97-p-nil") + // ... + if v == nil { + v97v2 = nil + } else { + v97v2 = make(map[uint8]uint32, len(v)) + } // reset map + var v97v3, v97v4 typMapMapUint8Uint32 + v97v3 = typMapMapUint8Uint32(v97v1) + v97v4 = typMapMapUint8Uint32(v97v2) + bs97 = testMarshalErr(v97v3, h, t, "enc-map-v97-custom") + testUnmarshalErr(v97v4, bs97, h, t, "dec-map-v97-p-len") + testDeepEqualErr(v97v3, v97v4, t, "equal-map-v97-p-len") + } + + for _, v := range []map[uint8]uint64{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v98: %v\n", v) + var v98v1, v98v2 map[uint8]uint64 + v98v1 = v + bs98 := testMarshalErr(v98v1, h, t, "enc-map-v98") + if v == nil { + v98v2 = nil + } else { + v98v2 = make(map[uint8]uint64, len(v)) + } // reset map + testUnmarshalErr(v98v2, bs98, h, t, "dec-map-v98") + testDeepEqualErr(v98v1, v98v2, t, "equal-map-v98") + if v == nil { + v98v2 = nil + } else { + v98v2 = make(map[uint8]uint64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v98v2), bs98, h, t, "dec-map-v98-noaddr") // decode into non-addressable map value + testDeepEqualErr(v98v1, v98v2, t, "equal-map-v98-noaddr") + if v == nil { + v98v2 = nil + } else { + v98v2 = make(map[uint8]uint64, len(v)) + } // reset map + testUnmarshalErr(&v98v2, bs98, h, t, "dec-map-v98-p-len") + testDeepEqualErr(v98v1, v98v2, t, "equal-map-v98-p-len") + bs98 = testMarshalErr(&v98v1, h, t, "enc-map-v98-p") + v98v2 = nil + testUnmarshalErr(&v98v2, bs98, h, t, "dec-map-v98-p-nil") + testDeepEqualErr(v98v1, v98v2, t, "equal-map-v98-p-nil") + // ... + if v == nil { + v98v2 = nil + } else { + v98v2 = make(map[uint8]uint64, len(v)) + } // reset map + var v98v3, v98v4 typMapMapUint8Uint64 + v98v3 = typMapMapUint8Uint64(v98v1) + v98v4 = typMapMapUint8Uint64(v98v2) + bs98 = testMarshalErr(v98v3, h, t, "enc-map-v98-custom") + testUnmarshalErr(v98v4, bs98, h, t, "dec-map-v98-p-len") + testDeepEqualErr(v98v3, v98v4, t, "equal-map-v98-p-len") + } + + for _, v := range []map[uint8]uintptr{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v99: %v\n", v) + var v99v1, v99v2 map[uint8]uintptr + v99v1 = v + bs99 := testMarshalErr(v99v1, h, t, "enc-map-v99") + if v == nil { + v99v2 = nil + } else { + v99v2 = make(map[uint8]uintptr, len(v)) + } // reset map + testUnmarshalErr(v99v2, bs99, h, t, "dec-map-v99") + testDeepEqualErr(v99v1, v99v2, t, "equal-map-v99") + if v == nil { + v99v2 = nil + } else { + v99v2 = make(map[uint8]uintptr, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v99v2), bs99, h, t, "dec-map-v99-noaddr") // decode into non-addressable map value + testDeepEqualErr(v99v1, v99v2, t, "equal-map-v99-noaddr") + if v == nil { + v99v2 = nil + } else { + v99v2 = make(map[uint8]uintptr, len(v)) + } // reset map + testUnmarshalErr(&v99v2, bs99, h, t, "dec-map-v99-p-len") + testDeepEqualErr(v99v1, v99v2, t, "equal-map-v99-p-len") + bs99 = testMarshalErr(&v99v1, h, t, "enc-map-v99-p") + v99v2 = nil + testUnmarshalErr(&v99v2, bs99, h, t, "dec-map-v99-p-nil") + testDeepEqualErr(v99v1, v99v2, t, "equal-map-v99-p-nil") + // ... + if v == nil { + v99v2 = nil + } else { + v99v2 = make(map[uint8]uintptr, len(v)) + } // reset map + var v99v3, v99v4 typMapMapUint8Uintptr + v99v3 = typMapMapUint8Uintptr(v99v1) + v99v4 = typMapMapUint8Uintptr(v99v2) + bs99 = testMarshalErr(v99v3, h, t, "enc-map-v99-custom") + testUnmarshalErr(v99v4, bs99, h, t, "dec-map-v99-p-len") + testDeepEqualErr(v99v3, v99v4, t, "equal-map-v99-p-len") + } + + for _, v := range []map[uint8]int{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v100: %v\n", v) + var v100v1, v100v2 map[uint8]int + v100v1 = v + bs100 := testMarshalErr(v100v1, h, t, "enc-map-v100") + if v == nil { + v100v2 = nil + } else { + v100v2 = make(map[uint8]int, len(v)) + } // reset map + testUnmarshalErr(v100v2, bs100, h, t, "dec-map-v100") + testDeepEqualErr(v100v1, v100v2, t, "equal-map-v100") + if v == nil { + v100v2 = nil + } else { + v100v2 = make(map[uint8]int, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v100v2), bs100, h, t, "dec-map-v100-noaddr") // decode into non-addressable map value + testDeepEqualErr(v100v1, v100v2, t, "equal-map-v100-noaddr") + if v == nil { + v100v2 = nil + } else { + v100v2 = make(map[uint8]int, len(v)) + } // reset map + testUnmarshalErr(&v100v2, bs100, h, t, "dec-map-v100-p-len") + testDeepEqualErr(v100v1, v100v2, t, "equal-map-v100-p-len") + bs100 = testMarshalErr(&v100v1, h, t, "enc-map-v100-p") + v100v2 = nil + testUnmarshalErr(&v100v2, bs100, h, t, "dec-map-v100-p-nil") + testDeepEqualErr(v100v1, v100v2, t, "equal-map-v100-p-nil") + // ... + if v == nil { + v100v2 = nil + } else { + v100v2 = make(map[uint8]int, len(v)) + } // reset map + var v100v3, v100v4 typMapMapUint8Int + v100v3 = typMapMapUint8Int(v100v1) + v100v4 = typMapMapUint8Int(v100v2) + bs100 = testMarshalErr(v100v3, h, t, "enc-map-v100-custom") + testUnmarshalErr(v100v4, bs100, h, t, "dec-map-v100-p-len") + testDeepEqualErr(v100v3, v100v4, t, "equal-map-v100-p-len") + } + + for _, v := range []map[uint8]int8{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v101: %v\n", v) + var v101v1, v101v2 map[uint8]int8 + v101v1 = v + bs101 := testMarshalErr(v101v1, h, t, "enc-map-v101") + if v == nil { + v101v2 = nil + } else { + v101v2 = make(map[uint8]int8, len(v)) + } // reset map + testUnmarshalErr(v101v2, bs101, h, t, "dec-map-v101") + testDeepEqualErr(v101v1, v101v2, t, "equal-map-v101") + if v == nil { + v101v2 = nil + } else { + v101v2 = make(map[uint8]int8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v101v2), bs101, h, t, "dec-map-v101-noaddr") // decode into non-addressable map value + testDeepEqualErr(v101v1, v101v2, t, "equal-map-v101-noaddr") + if v == nil { + v101v2 = nil + } else { + v101v2 = make(map[uint8]int8, len(v)) + } // reset map + testUnmarshalErr(&v101v2, bs101, h, t, "dec-map-v101-p-len") + testDeepEqualErr(v101v1, v101v2, t, "equal-map-v101-p-len") + bs101 = testMarshalErr(&v101v1, h, t, "enc-map-v101-p") + v101v2 = nil + testUnmarshalErr(&v101v2, bs101, h, t, "dec-map-v101-p-nil") + testDeepEqualErr(v101v1, v101v2, t, "equal-map-v101-p-nil") + // ... + if v == nil { + v101v2 = nil + } else { + v101v2 = make(map[uint8]int8, len(v)) + } // reset map + var v101v3, v101v4 typMapMapUint8Int8 + v101v3 = typMapMapUint8Int8(v101v1) + v101v4 = typMapMapUint8Int8(v101v2) + bs101 = testMarshalErr(v101v3, h, t, "enc-map-v101-custom") + testUnmarshalErr(v101v4, bs101, h, t, "dec-map-v101-p-len") + testDeepEqualErr(v101v3, v101v4, t, "equal-map-v101-p-len") + } + + for _, v := range []map[uint8]int16{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v102: %v\n", v) + var v102v1, v102v2 map[uint8]int16 + v102v1 = v + bs102 := testMarshalErr(v102v1, h, t, "enc-map-v102") + if v == nil { + v102v2 = nil + } else { + v102v2 = make(map[uint8]int16, len(v)) + } // reset map + testUnmarshalErr(v102v2, bs102, h, t, "dec-map-v102") + testDeepEqualErr(v102v1, v102v2, t, "equal-map-v102") + if v == nil { + v102v2 = nil + } else { + v102v2 = make(map[uint8]int16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v102v2), bs102, h, t, "dec-map-v102-noaddr") // decode into non-addressable map value + testDeepEqualErr(v102v1, v102v2, t, "equal-map-v102-noaddr") + if v == nil { + v102v2 = nil + } else { + v102v2 = make(map[uint8]int16, len(v)) + } // reset map + testUnmarshalErr(&v102v2, bs102, h, t, "dec-map-v102-p-len") + testDeepEqualErr(v102v1, v102v2, t, "equal-map-v102-p-len") + bs102 = testMarshalErr(&v102v1, h, t, "enc-map-v102-p") + v102v2 = nil + testUnmarshalErr(&v102v2, bs102, h, t, "dec-map-v102-p-nil") + testDeepEqualErr(v102v1, v102v2, t, "equal-map-v102-p-nil") + // ... + if v == nil { + v102v2 = nil + } else { + v102v2 = make(map[uint8]int16, len(v)) + } // reset map + var v102v3, v102v4 typMapMapUint8Int16 + v102v3 = typMapMapUint8Int16(v102v1) + v102v4 = typMapMapUint8Int16(v102v2) + bs102 = testMarshalErr(v102v3, h, t, "enc-map-v102-custom") + testUnmarshalErr(v102v4, bs102, h, t, "dec-map-v102-p-len") + testDeepEqualErr(v102v3, v102v4, t, "equal-map-v102-p-len") + } + + for _, v := range []map[uint8]int32{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v103: %v\n", v) + var v103v1, v103v2 map[uint8]int32 + v103v1 = v + bs103 := testMarshalErr(v103v1, h, t, "enc-map-v103") + if v == nil { + v103v2 = nil + } else { + v103v2 = make(map[uint8]int32, len(v)) + } // reset map + testUnmarshalErr(v103v2, bs103, h, t, "dec-map-v103") + testDeepEqualErr(v103v1, v103v2, t, "equal-map-v103") + if v == nil { + v103v2 = nil + } else { + v103v2 = make(map[uint8]int32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v103v2), bs103, h, t, "dec-map-v103-noaddr") // decode into non-addressable map value + testDeepEqualErr(v103v1, v103v2, t, "equal-map-v103-noaddr") + if v == nil { + v103v2 = nil + } else { + v103v2 = make(map[uint8]int32, len(v)) + } // reset map + testUnmarshalErr(&v103v2, bs103, h, t, "dec-map-v103-p-len") + testDeepEqualErr(v103v1, v103v2, t, "equal-map-v103-p-len") + bs103 = testMarshalErr(&v103v1, h, t, "enc-map-v103-p") + v103v2 = nil + testUnmarshalErr(&v103v2, bs103, h, t, "dec-map-v103-p-nil") + testDeepEqualErr(v103v1, v103v2, t, "equal-map-v103-p-nil") + // ... + if v == nil { + v103v2 = nil + } else { + v103v2 = make(map[uint8]int32, len(v)) + } // reset map + var v103v3, v103v4 typMapMapUint8Int32 + v103v3 = typMapMapUint8Int32(v103v1) + v103v4 = typMapMapUint8Int32(v103v2) + bs103 = testMarshalErr(v103v3, h, t, "enc-map-v103-custom") + testUnmarshalErr(v103v4, bs103, h, t, "dec-map-v103-p-len") + testDeepEqualErr(v103v3, v103v4, t, "equal-map-v103-p-len") + } + + for _, v := range []map[uint8]int64{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v104: %v\n", v) + var v104v1, v104v2 map[uint8]int64 + v104v1 = v + bs104 := testMarshalErr(v104v1, h, t, "enc-map-v104") + if v == nil { + v104v2 = nil + } else { + v104v2 = make(map[uint8]int64, len(v)) + } // reset map + testUnmarshalErr(v104v2, bs104, h, t, "dec-map-v104") + testDeepEqualErr(v104v1, v104v2, t, "equal-map-v104") + if v == nil { + v104v2 = nil + } else { + v104v2 = make(map[uint8]int64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v104v2), bs104, h, t, "dec-map-v104-noaddr") // decode into non-addressable map value + testDeepEqualErr(v104v1, v104v2, t, "equal-map-v104-noaddr") + if v == nil { + v104v2 = nil + } else { + v104v2 = make(map[uint8]int64, len(v)) + } // reset map + testUnmarshalErr(&v104v2, bs104, h, t, "dec-map-v104-p-len") + testDeepEqualErr(v104v1, v104v2, t, "equal-map-v104-p-len") + bs104 = testMarshalErr(&v104v1, h, t, "enc-map-v104-p") + v104v2 = nil + testUnmarshalErr(&v104v2, bs104, h, t, "dec-map-v104-p-nil") + testDeepEqualErr(v104v1, v104v2, t, "equal-map-v104-p-nil") + // ... + if v == nil { + v104v2 = nil + } else { + v104v2 = make(map[uint8]int64, len(v)) + } // reset map + var v104v3, v104v4 typMapMapUint8Int64 + v104v3 = typMapMapUint8Int64(v104v1) + v104v4 = typMapMapUint8Int64(v104v2) + bs104 = testMarshalErr(v104v3, h, t, "enc-map-v104-custom") + testUnmarshalErr(v104v4, bs104, h, t, "dec-map-v104-p-len") + testDeepEqualErr(v104v3, v104v4, t, "equal-map-v104-p-len") + } + + for _, v := range []map[uint8]float32{nil, {}, {44: 0, 33: 22.2}} { + // fmt.Printf(">>>> running mammoth map v105: %v\n", v) + var v105v1, v105v2 map[uint8]float32 + v105v1 = v + bs105 := testMarshalErr(v105v1, h, t, "enc-map-v105") + if v == nil { + v105v2 = nil + } else { + v105v2 = make(map[uint8]float32, len(v)) + } // reset map + testUnmarshalErr(v105v2, bs105, h, t, "dec-map-v105") + testDeepEqualErr(v105v1, v105v2, t, "equal-map-v105") + if v == nil { + v105v2 = nil + } else { + v105v2 = make(map[uint8]float32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v105v2), bs105, h, t, "dec-map-v105-noaddr") // decode into non-addressable map value + testDeepEqualErr(v105v1, v105v2, t, "equal-map-v105-noaddr") + if v == nil { + v105v2 = nil + } else { + v105v2 = make(map[uint8]float32, len(v)) + } // reset map + testUnmarshalErr(&v105v2, bs105, h, t, "dec-map-v105-p-len") + testDeepEqualErr(v105v1, v105v2, t, "equal-map-v105-p-len") + bs105 = testMarshalErr(&v105v1, h, t, "enc-map-v105-p") + v105v2 = nil + testUnmarshalErr(&v105v2, bs105, h, t, "dec-map-v105-p-nil") + testDeepEqualErr(v105v1, v105v2, t, "equal-map-v105-p-nil") + // ... + if v == nil { + v105v2 = nil + } else { + v105v2 = make(map[uint8]float32, len(v)) + } // reset map + var v105v3, v105v4 typMapMapUint8Float32 + v105v3 = typMapMapUint8Float32(v105v1) + v105v4 = typMapMapUint8Float32(v105v2) + bs105 = testMarshalErr(v105v3, h, t, "enc-map-v105-custom") + testUnmarshalErr(v105v4, bs105, h, t, "dec-map-v105-p-len") + testDeepEqualErr(v105v3, v105v4, t, "equal-map-v105-p-len") + } + + for _, v := range []map[uint8]float64{nil, {}, {44: 0, 33: 11.1}} { + // fmt.Printf(">>>> running mammoth map v106: %v\n", v) + var v106v1, v106v2 map[uint8]float64 + v106v1 = v + bs106 := testMarshalErr(v106v1, h, t, "enc-map-v106") + if v == nil { + v106v2 = nil + } else { + v106v2 = make(map[uint8]float64, len(v)) + } // reset map + testUnmarshalErr(v106v2, bs106, h, t, "dec-map-v106") + testDeepEqualErr(v106v1, v106v2, t, "equal-map-v106") + if v == nil { + v106v2 = nil + } else { + v106v2 = make(map[uint8]float64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v106v2), bs106, h, t, "dec-map-v106-noaddr") // decode into non-addressable map value + testDeepEqualErr(v106v1, v106v2, t, "equal-map-v106-noaddr") + if v == nil { + v106v2 = nil + } else { + v106v2 = make(map[uint8]float64, len(v)) + } // reset map + testUnmarshalErr(&v106v2, bs106, h, t, "dec-map-v106-p-len") + testDeepEqualErr(v106v1, v106v2, t, "equal-map-v106-p-len") + bs106 = testMarshalErr(&v106v1, h, t, "enc-map-v106-p") + v106v2 = nil + testUnmarshalErr(&v106v2, bs106, h, t, "dec-map-v106-p-nil") + testDeepEqualErr(v106v1, v106v2, t, "equal-map-v106-p-nil") + // ... + if v == nil { + v106v2 = nil + } else { + v106v2 = make(map[uint8]float64, len(v)) + } // reset map + var v106v3, v106v4 typMapMapUint8Float64 + v106v3 = typMapMapUint8Float64(v106v1) + v106v4 = typMapMapUint8Float64(v106v2) + bs106 = testMarshalErr(v106v3, h, t, "enc-map-v106-custom") + testUnmarshalErr(v106v4, bs106, h, t, "dec-map-v106-p-len") + testDeepEqualErr(v106v3, v106v4, t, "equal-map-v106-p-len") + } + + for _, v := range []map[uint8]bool{nil, {}, {44: false, 33: true}} { + // fmt.Printf(">>>> running mammoth map v107: %v\n", v) + var v107v1, v107v2 map[uint8]bool + v107v1 = v + bs107 := testMarshalErr(v107v1, h, t, "enc-map-v107") + if v == nil { + v107v2 = nil + } else { + v107v2 = make(map[uint8]bool, len(v)) + } // reset map + testUnmarshalErr(v107v2, bs107, h, t, "dec-map-v107") + testDeepEqualErr(v107v1, v107v2, t, "equal-map-v107") + if v == nil { + v107v2 = nil + } else { + v107v2 = make(map[uint8]bool, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v107v2), bs107, h, t, "dec-map-v107-noaddr") // decode into non-addressable map value + testDeepEqualErr(v107v1, v107v2, t, "equal-map-v107-noaddr") + if v == nil { + v107v2 = nil + } else { + v107v2 = make(map[uint8]bool, len(v)) + } // reset map + testUnmarshalErr(&v107v2, bs107, h, t, "dec-map-v107-p-len") + testDeepEqualErr(v107v1, v107v2, t, "equal-map-v107-p-len") + bs107 = testMarshalErr(&v107v1, h, t, "enc-map-v107-p") + v107v2 = nil + testUnmarshalErr(&v107v2, bs107, h, t, "dec-map-v107-p-nil") + testDeepEqualErr(v107v1, v107v2, t, "equal-map-v107-p-nil") + // ... + if v == nil { + v107v2 = nil + } else { + v107v2 = make(map[uint8]bool, len(v)) + } // reset map + var v107v3, v107v4 typMapMapUint8Bool + v107v3 = typMapMapUint8Bool(v107v1) + v107v4 = typMapMapUint8Bool(v107v2) + bs107 = testMarshalErr(v107v3, h, t, "enc-map-v107-custom") + testUnmarshalErr(v107v4, bs107, h, t, "dec-map-v107-p-len") + testDeepEqualErr(v107v3, v107v4, t, "equal-map-v107-p-len") + } + + for _, v := range []map[uint16]interface{}{nil, {}, {44: nil, 33: "string-is-an-interface-2"}} { + // fmt.Printf(">>>> running mammoth map v110: %v\n", v) + var v110v1, v110v2 map[uint16]interface{} + v110v1 = v + bs110 := testMarshalErr(v110v1, h, t, "enc-map-v110") + if v == nil { + v110v2 = nil + } else { + v110v2 = make(map[uint16]interface{}, len(v)) + } // reset map + testUnmarshalErr(v110v2, bs110, h, t, "dec-map-v110") + testDeepEqualErr(v110v1, v110v2, t, "equal-map-v110") + if v == nil { + v110v2 = nil + } else { + v110v2 = make(map[uint16]interface{}, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v110v2), bs110, h, t, "dec-map-v110-noaddr") // decode into non-addressable map value + testDeepEqualErr(v110v1, v110v2, t, "equal-map-v110-noaddr") + if v == nil { + v110v2 = nil + } else { + v110v2 = make(map[uint16]interface{}, len(v)) + } // reset map + testUnmarshalErr(&v110v2, bs110, h, t, "dec-map-v110-p-len") + testDeepEqualErr(v110v1, v110v2, t, "equal-map-v110-p-len") + bs110 = testMarshalErr(&v110v1, h, t, "enc-map-v110-p") + v110v2 = nil + testUnmarshalErr(&v110v2, bs110, h, t, "dec-map-v110-p-nil") + testDeepEqualErr(v110v1, v110v2, t, "equal-map-v110-p-nil") + // ... + if v == nil { + v110v2 = nil + } else { + v110v2 = make(map[uint16]interface{}, len(v)) + } // reset map + var v110v3, v110v4 typMapMapUint16Intf + v110v3 = typMapMapUint16Intf(v110v1) + v110v4 = typMapMapUint16Intf(v110v2) + bs110 = testMarshalErr(v110v3, h, t, "enc-map-v110-custom") + testUnmarshalErr(v110v4, bs110, h, t, "dec-map-v110-p-len") + testDeepEqualErr(v110v3, v110v4, t, "equal-map-v110-p-len") + } + + for _, v := range []map[uint16]string{nil, {}, {44: "", 33: "some-string-2"}} { + // fmt.Printf(">>>> running mammoth map v111: %v\n", v) + var v111v1, v111v2 map[uint16]string + v111v1 = v + bs111 := testMarshalErr(v111v1, h, t, "enc-map-v111") + if v == nil { + v111v2 = nil + } else { + v111v2 = make(map[uint16]string, len(v)) + } // reset map + testUnmarshalErr(v111v2, bs111, h, t, "dec-map-v111") + testDeepEqualErr(v111v1, v111v2, t, "equal-map-v111") + if v == nil { + v111v2 = nil + } else { + v111v2 = make(map[uint16]string, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v111v2), bs111, h, t, "dec-map-v111-noaddr") // decode into non-addressable map value + testDeepEqualErr(v111v1, v111v2, t, "equal-map-v111-noaddr") + if v == nil { + v111v2 = nil + } else { + v111v2 = make(map[uint16]string, len(v)) + } // reset map + testUnmarshalErr(&v111v2, bs111, h, t, "dec-map-v111-p-len") + testDeepEqualErr(v111v1, v111v2, t, "equal-map-v111-p-len") + bs111 = testMarshalErr(&v111v1, h, t, "enc-map-v111-p") + v111v2 = nil + testUnmarshalErr(&v111v2, bs111, h, t, "dec-map-v111-p-nil") + testDeepEqualErr(v111v1, v111v2, t, "equal-map-v111-p-nil") + // ... + if v == nil { + v111v2 = nil + } else { + v111v2 = make(map[uint16]string, len(v)) + } // reset map + var v111v3, v111v4 typMapMapUint16String + v111v3 = typMapMapUint16String(v111v1) + v111v4 = typMapMapUint16String(v111v2) + bs111 = testMarshalErr(v111v3, h, t, "enc-map-v111-custom") + testUnmarshalErr(v111v4, bs111, h, t, "dec-map-v111-p-len") + testDeepEqualErr(v111v3, v111v4, t, "equal-map-v111-p-len") + } + + for _, v := range []map[uint16]uint{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v112: %v\n", v) + var v112v1, v112v2 map[uint16]uint + v112v1 = v + bs112 := testMarshalErr(v112v1, h, t, "enc-map-v112") + if v == nil { + v112v2 = nil + } else { + v112v2 = make(map[uint16]uint, len(v)) + } // reset map + testUnmarshalErr(v112v2, bs112, h, t, "dec-map-v112") + testDeepEqualErr(v112v1, v112v2, t, "equal-map-v112") + if v == nil { + v112v2 = nil + } else { + v112v2 = make(map[uint16]uint, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v112v2), bs112, h, t, "dec-map-v112-noaddr") // decode into non-addressable map value + testDeepEqualErr(v112v1, v112v2, t, "equal-map-v112-noaddr") + if v == nil { + v112v2 = nil + } else { + v112v2 = make(map[uint16]uint, len(v)) + } // reset map + testUnmarshalErr(&v112v2, bs112, h, t, "dec-map-v112-p-len") + testDeepEqualErr(v112v1, v112v2, t, "equal-map-v112-p-len") + bs112 = testMarshalErr(&v112v1, h, t, "enc-map-v112-p") + v112v2 = nil + testUnmarshalErr(&v112v2, bs112, h, t, "dec-map-v112-p-nil") + testDeepEqualErr(v112v1, v112v2, t, "equal-map-v112-p-nil") + // ... + if v == nil { + v112v2 = nil + } else { + v112v2 = make(map[uint16]uint, len(v)) + } // reset map + var v112v3, v112v4 typMapMapUint16Uint + v112v3 = typMapMapUint16Uint(v112v1) + v112v4 = typMapMapUint16Uint(v112v2) + bs112 = testMarshalErr(v112v3, h, t, "enc-map-v112-custom") + testUnmarshalErr(v112v4, bs112, h, t, "dec-map-v112-p-len") + testDeepEqualErr(v112v3, v112v4, t, "equal-map-v112-p-len") + } + + for _, v := range []map[uint16]uint8{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v113: %v\n", v) + var v113v1, v113v2 map[uint16]uint8 + v113v1 = v + bs113 := testMarshalErr(v113v1, h, t, "enc-map-v113") + if v == nil { + v113v2 = nil + } else { + v113v2 = make(map[uint16]uint8, len(v)) + } // reset map + testUnmarshalErr(v113v2, bs113, h, t, "dec-map-v113") + testDeepEqualErr(v113v1, v113v2, t, "equal-map-v113") + if v == nil { + v113v2 = nil + } else { + v113v2 = make(map[uint16]uint8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v113v2), bs113, h, t, "dec-map-v113-noaddr") // decode into non-addressable map value + testDeepEqualErr(v113v1, v113v2, t, "equal-map-v113-noaddr") + if v == nil { + v113v2 = nil + } else { + v113v2 = make(map[uint16]uint8, len(v)) + } // reset map + testUnmarshalErr(&v113v2, bs113, h, t, "dec-map-v113-p-len") + testDeepEqualErr(v113v1, v113v2, t, "equal-map-v113-p-len") + bs113 = testMarshalErr(&v113v1, h, t, "enc-map-v113-p") + v113v2 = nil + testUnmarshalErr(&v113v2, bs113, h, t, "dec-map-v113-p-nil") + testDeepEqualErr(v113v1, v113v2, t, "equal-map-v113-p-nil") + // ... + if v == nil { + v113v2 = nil + } else { + v113v2 = make(map[uint16]uint8, len(v)) + } // reset map + var v113v3, v113v4 typMapMapUint16Uint8 + v113v3 = typMapMapUint16Uint8(v113v1) + v113v4 = typMapMapUint16Uint8(v113v2) + bs113 = testMarshalErr(v113v3, h, t, "enc-map-v113-custom") + testUnmarshalErr(v113v4, bs113, h, t, "dec-map-v113-p-len") + testDeepEqualErr(v113v3, v113v4, t, "equal-map-v113-p-len") + } + + for _, v := range []map[uint16]uint16{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v114: %v\n", v) + var v114v1, v114v2 map[uint16]uint16 + v114v1 = v + bs114 := testMarshalErr(v114v1, h, t, "enc-map-v114") + if v == nil { + v114v2 = nil + } else { + v114v2 = make(map[uint16]uint16, len(v)) + } // reset map + testUnmarshalErr(v114v2, bs114, h, t, "dec-map-v114") + testDeepEqualErr(v114v1, v114v2, t, "equal-map-v114") + if v == nil { + v114v2 = nil + } else { + v114v2 = make(map[uint16]uint16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v114v2), bs114, h, t, "dec-map-v114-noaddr") // decode into non-addressable map value + testDeepEqualErr(v114v1, v114v2, t, "equal-map-v114-noaddr") + if v == nil { + v114v2 = nil + } else { + v114v2 = make(map[uint16]uint16, len(v)) + } // reset map + testUnmarshalErr(&v114v2, bs114, h, t, "dec-map-v114-p-len") + testDeepEqualErr(v114v1, v114v2, t, "equal-map-v114-p-len") + bs114 = testMarshalErr(&v114v1, h, t, "enc-map-v114-p") + v114v2 = nil + testUnmarshalErr(&v114v2, bs114, h, t, "dec-map-v114-p-nil") + testDeepEqualErr(v114v1, v114v2, t, "equal-map-v114-p-nil") + // ... + if v == nil { + v114v2 = nil + } else { + v114v2 = make(map[uint16]uint16, len(v)) + } // reset map + var v114v3, v114v4 typMapMapUint16Uint16 + v114v3 = typMapMapUint16Uint16(v114v1) + v114v4 = typMapMapUint16Uint16(v114v2) + bs114 = testMarshalErr(v114v3, h, t, "enc-map-v114-custom") + testUnmarshalErr(v114v4, bs114, h, t, "dec-map-v114-p-len") + testDeepEqualErr(v114v3, v114v4, t, "equal-map-v114-p-len") + } + + for _, v := range []map[uint16]uint32{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v115: %v\n", v) + var v115v1, v115v2 map[uint16]uint32 + v115v1 = v + bs115 := testMarshalErr(v115v1, h, t, "enc-map-v115") + if v == nil { + v115v2 = nil + } else { + v115v2 = make(map[uint16]uint32, len(v)) + } // reset map + testUnmarshalErr(v115v2, bs115, h, t, "dec-map-v115") + testDeepEqualErr(v115v1, v115v2, t, "equal-map-v115") + if v == nil { + v115v2 = nil + } else { + v115v2 = make(map[uint16]uint32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v115v2), bs115, h, t, "dec-map-v115-noaddr") // decode into non-addressable map value + testDeepEqualErr(v115v1, v115v2, t, "equal-map-v115-noaddr") + if v == nil { + v115v2 = nil + } else { + v115v2 = make(map[uint16]uint32, len(v)) + } // reset map + testUnmarshalErr(&v115v2, bs115, h, t, "dec-map-v115-p-len") + testDeepEqualErr(v115v1, v115v2, t, "equal-map-v115-p-len") + bs115 = testMarshalErr(&v115v1, h, t, "enc-map-v115-p") + v115v2 = nil + testUnmarshalErr(&v115v2, bs115, h, t, "dec-map-v115-p-nil") + testDeepEqualErr(v115v1, v115v2, t, "equal-map-v115-p-nil") + // ... + if v == nil { + v115v2 = nil + } else { + v115v2 = make(map[uint16]uint32, len(v)) + } // reset map + var v115v3, v115v4 typMapMapUint16Uint32 + v115v3 = typMapMapUint16Uint32(v115v1) + v115v4 = typMapMapUint16Uint32(v115v2) + bs115 = testMarshalErr(v115v3, h, t, "enc-map-v115-custom") + testUnmarshalErr(v115v4, bs115, h, t, "dec-map-v115-p-len") + testDeepEqualErr(v115v3, v115v4, t, "equal-map-v115-p-len") + } + + for _, v := range []map[uint16]uint64{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v116: %v\n", v) + var v116v1, v116v2 map[uint16]uint64 + v116v1 = v + bs116 := testMarshalErr(v116v1, h, t, "enc-map-v116") + if v == nil { + v116v2 = nil + } else { + v116v2 = make(map[uint16]uint64, len(v)) + } // reset map + testUnmarshalErr(v116v2, bs116, h, t, "dec-map-v116") + testDeepEqualErr(v116v1, v116v2, t, "equal-map-v116") + if v == nil { + v116v2 = nil + } else { + v116v2 = make(map[uint16]uint64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v116v2), bs116, h, t, "dec-map-v116-noaddr") // decode into non-addressable map value + testDeepEqualErr(v116v1, v116v2, t, "equal-map-v116-noaddr") + if v == nil { + v116v2 = nil + } else { + v116v2 = make(map[uint16]uint64, len(v)) + } // reset map + testUnmarshalErr(&v116v2, bs116, h, t, "dec-map-v116-p-len") + testDeepEqualErr(v116v1, v116v2, t, "equal-map-v116-p-len") + bs116 = testMarshalErr(&v116v1, h, t, "enc-map-v116-p") + v116v2 = nil + testUnmarshalErr(&v116v2, bs116, h, t, "dec-map-v116-p-nil") + testDeepEqualErr(v116v1, v116v2, t, "equal-map-v116-p-nil") + // ... + if v == nil { + v116v2 = nil + } else { + v116v2 = make(map[uint16]uint64, len(v)) + } // reset map + var v116v3, v116v4 typMapMapUint16Uint64 + v116v3 = typMapMapUint16Uint64(v116v1) + v116v4 = typMapMapUint16Uint64(v116v2) + bs116 = testMarshalErr(v116v3, h, t, "enc-map-v116-custom") + testUnmarshalErr(v116v4, bs116, h, t, "dec-map-v116-p-len") + testDeepEqualErr(v116v3, v116v4, t, "equal-map-v116-p-len") + } + + for _, v := range []map[uint16]uintptr{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v117: %v\n", v) + var v117v1, v117v2 map[uint16]uintptr + v117v1 = v + bs117 := testMarshalErr(v117v1, h, t, "enc-map-v117") + if v == nil { + v117v2 = nil + } else { + v117v2 = make(map[uint16]uintptr, len(v)) + } // reset map + testUnmarshalErr(v117v2, bs117, h, t, "dec-map-v117") + testDeepEqualErr(v117v1, v117v2, t, "equal-map-v117") + if v == nil { + v117v2 = nil + } else { + v117v2 = make(map[uint16]uintptr, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v117v2), bs117, h, t, "dec-map-v117-noaddr") // decode into non-addressable map value + testDeepEqualErr(v117v1, v117v2, t, "equal-map-v117-noaddr") + if v == nil { + v117v2 = nil + } else { + v117v2 = make(map[uint16]uintptr, len(v)) + } // reset map + testUnmarshalErr(&v117v2, bs117, h, t, "dec-map-v117-p-len") + testDeepEqualErr(v117v1, v117v2, t, "equal-map-v117-p-len") + bs117 = testMarshalErr(&v117v1, h, t, "enc-map-v117-p") + v117v2 = nil + testUnmarshalErr(&v117v2, bs117, h, t, "dec-map-v117-p-nil") + testDeepEqualErr(v117v1, v117v2, t, "equal-map-v117-p-nil") + // ... + if v == nil { + v117v2 = nil + } else { + v117v2 = make(map[uint16]uintptr, len(v)) + } // reset map + var v117v3, v117v4 typMapMapUint16Uintptr + v117v3 = typMapMapUint16Uintptr(v117v1) + v117v4 = typMapMapUint16Uintptr(v117v2) + bs117 = testMarshalErr(v117v3, h, t, "enc-map-v117-custom") + testUnmarshalErr(v117v4, bs117, h, t, "dec-map-v117-p-len") + testDeepEqualErr(v117v3, v117v4, t, "equal-map-v117-p-len") + } + + for _, v := range []map[uint16]int{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v118: %v\n", v) + var v118v1, v118v2 map[uint16]int + v118v1 = v + bs118 := testMarshalErr(v118v1, h, t, "enc-map-v118") + if v == nil { + v118v2 = nil + } else { + v118v2 = make(map[uint16]int, len(v)) + } // reset map + testUnmarshalErr(v118v2, bs118, h, t, "dec-map-v118") + testDeepEqualErr(v118v1, v118v2, t, "equal-map-v118") + if v == nil { + v118v2 = nil + } else { + v118v2 = make(map[uint16]int, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v118v2), bs118, h, t, "dec-map-v118-noaddr") // decode into non-addressable map value + testDeepEqualErr(v118v1, v118v2, t, "equal-map-v118-noaddr") + if v == nil { + v118v2 = nil + } else { + v118v2 = make(map[uint16]int, len(v)) + } // reset map + testUnmarshalErr(&v118v2, bs118, h, t, "dec-map-v118-p-len") + testDeepEqualErr(v118v1, v118v2, t, "equal-map-v118-p-len") + bs118 = testMarshalErr(&v118v1, h, t, "enc-map-v118-p") + v118v2 = nil + testUnmarshalErr(&v118v2, bs118, h, t, "dec-map-v118-p-nil") + testDeepEqualErr(v118v1, v118v2, t, "equal-map-v118-p-nil") + // ... + if v == nil { + v118v2 = nil + } else { + v118v2 = make(map[uint16]int, len(v)) + } // reset map + var v118v3, v118v4 typMapMapUint16Int + v118v3 = typMapMapUint16Int(v118v1) + v118v4 = typMapMapUint16Int(v118v2) + bs118 = testMarshalErr(v118v3, h, t, "enc-map-v118-custom") + testUnmarshalErr(v118v4, bs118, h, t, "dec-map-v118-p-len") + testDeepEqualErr(v118v3, v118v4, t, "equal-map-v118-p-len") + } + + for _, v := range []map[uint16]int8{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v119: %v\n", v) + var v119v1, v119v2 map[uint16]int8 + v119v1 = v + bs119 := testMarshalErr(v119v1, h, t, "enc-map-v119") + if v == nil { + v119v2 = nil + } else { + v119v2 = make(map[uint16]int8, len(v)) + } // reset map + testUnmarshalErr(v119v2, bs119, h, t, "dec-map-v119") + testDeepEqualErr(v119v1, v119v2, t, "equal-map-v119") + if v == nil { + v119v2 = nil + } else { + v119v2 = make(map[uint16]int8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v119v2), bs119, h, t, "dec-map-v119-noaddr") // decode into non-addressable map value + testDeepEqualErr(v119v1, v119v2, t, "equal-map-v119-noaddr") + if v == nil { + v119v2 = nil + } else { + v119v2 = make(map[uint16]int8, len(v)) + } // reset map + testUnmarshalErr(&v119v2, bs119, h, t, "dec-map-v119-p-len") + testDeepEqualErr(v119v1, v119v2, t, "equal-map-v119-p-len") + bs119 = testMarshalErr(&v119v1, h, t, "enc-map-v119-p") + v119v2 = nil + testUnmarshalErr(&v119v2, bs119, h, t, "dec-map-v119-p-nil") + testDeepEqualErr(v119v1, v119v2, t, "equal-map-v119-p-nil") + // ... + if v == nil { + v119v2 = nil + } else { + v119v2 = make(map[uint16]int8, len(v)) + } // reset map + var v119v3, v119v4 typMapMapUint16Int8 + v119v3 = typMapMapUint16Int8(v119v1) + v119v4 = typMapMapUint16Int8(v119v2) + bs119 = testMarshalErr(v119v3, h, t, "enc-map-v119-custom") + testUnmarshalErr(v119v4, bs119, h, t, "dec-map-v119-p-len") + testDeepEqualErr(v119v3, v119v4, t, "equal-map-v119-p-len") + } + + for _, v := range []map[uint16]int16{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v120: %v\n", v) + var v120v1, v120v2 map[uint16]int16 + v120v1 = v + bs120 := testMarshalErr(v120v1, h, t, "enc-map-v120") + if v == nil { + v120v2 = nil + } else { + v120v2 = make(map[uint16]int16, len(v)) + } // reset map + testUnmarshalErr(v120v2, bs120, h, t, "dec-map-v120") + testDeepEqualErr(v120v1, v120v2, t, "equal-map-v120") + if v == nil { + v120v2 = nil + } else { + v120v2 = make(map[uint16]int16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v120v2), bs120, h, t, "dec-map-v120-noaddr") // decode into non-addressable map value + testDeepEqualErr(v120v1, v120v2, t, "equal-map-v120-noaddr") + if v == nil { + v120v2 = nil + } else { + v120v2 = make(map[uint16]int16, len(v)) + } // reset map + testUnmarshalErr(&v120v2, bs120, h, t, "dec-map-v120-p-len") + testDeepEqualErr(v120v1, v120v2, t, "equal-map-v120-p-len") + bs120 = testMarshalErr(&v120v1, h, t, "enc-map-v120-p") + v120v2 = nil + testUnmarshalErr(&v120v2, bs120, h, t, "dec-map-v120-p-nil") + testDeepEqualErr(v120v1, v120v2, t, "equal-map-v120-p-nil") + // ... + if v == nil { + v120v2 = nil + } else { + v120v2 = make(map[uint16]int16, len(v)) + } // reset map + var v120v3, v120v4 typMapMapUint16Int16 + v120v3 = typMapMapUint16Int16(v120v1) + v120v4 = typMapMapUint16Int16(v120v2) + bs120 = testMarshalErr(v120v3, h, t, "enc-map-v120-custom") + testUnmarshalErr(v120v4, bs120, h, t, "dec-map-v120-p-len") + testDeepEqualErr(v120v3, v120v4, t, "equal-map-v120-p-len") + } + + for _, v := range []map[uint16]int32{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v121: %v\n", v) + var v121v1, v121v2 map[uint16]int32 + v121v1 = v + bs121 := testMarshalErr(v121v1, h, t, "enc-map-v121") + if v == nil { + v121v2 = nil + } else { + v121v2 = make(map[uint16]int32, len(v)) + } // reset map + testUnmarshalErr(v121v2, bs121, h, t, "dec-map-v121") + testDeepEqualErr(v121v1, v121v2, t, "equal-map-v121") + if v == nil { + v121v2 = nil + } else { + v121v2 = make(map[uint16]int32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v121v2), bs121, h, t, "dec-map-v121-noaddr") // decode into non-addressable map value + testDeepEqualErr(v121v1, v121v2, t, "equal-map-v121-noaddr") + if v == nil { + v121v2 = nil + } else { + v121v2 = make(map[uint16]int32, len(v)) + } // reset map + testUnmarshalErr(&v121v2, bs121, h, t, "dec-map-v121-p-len") + testDeepEqualErr(v121v1, v121v2, t, "equal-map-v121-p-len") + bs121 = testMarshalErr(&v121v1, h, t, "enc-map-v121-p") + v121v2 = nil + testUnmarshalErr(&v121v2, bs121, h, t, "dec-map-v121-p-nil") + testDeepEqualErr(v121v1, v121v2, t, "equal-map-v121-p-nil") + // ... + if v == nil { + v121v2 = nil + } else { + v121v2 = make(map[uint16]int32, len(v)) + } // reset map + var v121v3, v121v4 typMapMapUint16Int32 + v121v3 = typMapMapUint16Int32(v121v1) + v121v4 = typMapMapUint16Int32(v121v2) + bs121 = testMarshalErr(v121v3, h, t, "enc-map-v121-custom") + testUnmarshalErr(v121v4, bs121, h, t, "dec-map-v121-p-len") + testDeepEqualErr(v121v3, v121v4, t, "equal-map-v121-p-len") + } + + for _, v := range []map[uint16]int64{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v122: %v\n", v) + var v122v1, v122v2 map[uint16]int64 + v122v1 = v + bs122 := testMarshalErr(v122v1, h, t, "enc-map-v122") + if v == nil { + v122v2 = nil + } else { + v122v2 = make(map[uint16]int64, len(v)) + } // reset map + testUnmarshalErr(v122v2, bs122, h, t, "dec-map-v122") + testDeepEqualErr(v122v1, v122v2, t, "equal-map-v122") + if v == nil { + v122v2 = nil + } else { + v122v2 = make(map[uint16]int64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v122v2), bs122, h, t, "dec-map-v122-noaddr") // decode into non-addressable map value + testDeepEqualErr(v122v1, v122v2, t, "equal-map-v122-noaddr") + if v == nil { + v122v2 = nil + } else { + v122v2 = make(map[uint16]int64, len(v)) + } // reset map + testUnmarshalErr(&v122v2, bs122, h, t, "dec-map-v122-p-len") + testDeepEqualErr(v122v1, v122v2, t, "equal-map-v122-p-len") + bs122 = testMarshalErr(&v122v1, h, t, "enc-map-v122-p") + v122v2 = nil + testUnmarshalErr(&v122v2, bs122, h, t, "dec-map-v122-p-nil") + testDeepEqualErr(v122v1, v122v2, t, "equal-map-v122-p-nil") + // ... + if v == nil { + v122v2 = nil + } else { + v122v2 = make(map[uint16]int64, len(v)) + } // reset map + var v122v3, v122v4 typMapMapUint16Int64 + v122v3 = typMapMapUint16Int64(v122v1) + v122v4 = typMapMapUint16Int64(v122v2) + bs122 = testMarshalErr(v122v3, h, t, "enc-map-v122-custom") + testUnmarshalErr(v122v4, bs122, h, t, "dec-map-v122-p-len") + testDeepEqualErr(v122v3, v122v4, t, "equal-map-v122-p-len") + } + + for _, v := range []map[uint16]float32{nil, {}, {33: 0, 44: 22.2}} { + // fmt.Printf(">>>> running mammoth map v123: %v\n", v) + var v123v1, v123v2 map[uint16]float32 + v123v1 = v + bs123 := testMarshalErr(v123v1, h, t, "enc-map-v123") + if v == nil { + v123v2 = nil + } else { + v123v2 = make(map[uint16]float32, len(v)) + } // reset map + testUnmarshalErr(v123v2, bs123, h, t, "dec-map-v123") + testDeepEqualErr(v123v1, v123v2, t, "equal-map-v123") + if v == nil { + v123v2 = nil + } else { + v123v2 = make(map[uint16]float32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v123v2), bs123, h, t, "dec-map-v123-noaddr") // decode into non-addressable map value + testDeepEqualErr(v123v1, v123v2, t, "equal-map-v123-noaddr") + if v == nil { + v123v2 = nil + } else { + v123v2 = make(map[uint16]float32, len(v)) + } // reset map + testUnmarshalErr(&v123v2, bs123, h, t, "dec-map-v123-p-len") + testDeepEqualErr(v123v1, v123v2, t, "equal-map-v123-p-len") + bs123 = testMarshalErr(&v123v1, h, t, "enc-map-v123-p") + v123v2 = nil + testUnmarshalErr(&v123v2, bs123, h, t, "dec-map-v123-p-nil") + testDeepEqualErr(v123v1, v123v2, t, "equal-map-v123-p-nil") + // ... + if v == nil { + v123v2 = nil + } else { + v123v2 = make(map[uint16]float32, len(v)) + } // reset map + var v123v3, v123v4 typMapMapUint16Float32 + v123v3 = typMapMapUint16Float32(v123v1) + v123v4 = typMapMapUint16Float32(v123v2) + bs123 = testMarshalErr(v123v3, h, t, "enc-map-v123-custom") + testUnmarshalErr(v123v4, bs123, h, t, "dec-map-v123-p-len") + testDeepEqualErr(v123v3, v123v4, t, "equal-map-v123-p-len") + } + + for _, v := range []map[uint16]float64{nil, {}, {33: 0, 44: 11.1}} { + // fmt.Printf(">>>> running mammoth map v124: %v\n", v) + var v124v1, v124v2 map[uint16]float64 + v124v1 = v + bs124 := testMarshalErr(v124v1, h, t, "enc-map-v124") + if v == nil { + v124v2 = nil + } else { + v124v2 = make(map[uint16]float64, len(v)) + } // reset map + testUnmarshalErr(v124v2, bs124, h, t, "dec-map-v124") + testDeepEqualErr(v124v1, v124v2, t, "equal-map-v124") + if v == nil { + v124v2 = nil + } else { + v124v2 = make(map[uint16]float64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v124v2), bs124, h, t, "dec-map-v124-noaddr") // decode into non-addressable map value + testDeepEqualErr(v124v1, v124v2, t, "equal-map-v124-noaddr") + if v == nil { + v124v2 = nil + } else { + v124v2 = make(map[uint16]float64, len(v)) + } // reset map + testUnmarshalErr(&v124v2, bs124, h, t, "dec-map-v124-p-len") + testDeepEqualErr(v124v1, v124v2, t, "equal-map-v124-p-len") + bs124 = testMarshalErr(&v124v1, h, t, "enc-map-v124-p") + v124v2 = nil + testUnmarshalErr(&v124v2, bs124, h, t, "dec-map-v124-p-nil") + testDeepEqualErr(v124v1, v124v2, t, "equal-map-v124-p-nil") + // ... + if v == nil { + v124v2 = nil + } else { + v124v2 = make(map[uint16]float64, len(v)) + } // reset map + var v124v3, v124v4 typMapMapUint16Float64 + v124v3 = typMapMapUint16Float64(v124v1) + v124v4 = typMapMapUint16Float64(v124v2) + bs124 = testMarshalErr(v124v3, h, t, "enc-map-v124-custom") + testUnmarshalErr(v124v4, bs124, h, t, "dec-map-v124-p-len") + testDeepEqualErr(v124v3, v124v4, t, "equal-map-v124-p-len") + } + + for _, v := range []map[uint16]bool{nil, {}, {33: false, 44: true}} { + // fmt.Printf(">>>> running mammoth map v125: %v\n", v) + var v125v1, v125v2 map[uint16]bool + v125v1 = v + bs125 := testMarshalErr(v125v1, h, t, "enc-map-v125") + if v == nil { + v125v2 = nil + } else { + v125v2 = make(map[uint16]bool, len(v)) + } // reset map + testUnmarshalErr(v125v2, bs125, h, t, "dec-map-v125") + testDeepEqualErr(v125v1, v125v2, t, "equal-map-v125") + if v == nil { + v125v2 = nil + } else { + v125v2 = make(map[uint16]bool, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v125v2), bs125, h, t, "dec-map-v125-noaddr") // decode into non-addressable map value + testDeepEqualErr(v125v1, v125v2, t, "equal-map-v125-noaddr") + if v == nil { + v125v2 = nil + } else { + v125v2 = make(map[uint16]bool, len(v)) + } // reset map + testUnmarshalErr(&v125v2, bs125, h, t, "dec-map-v125-p-len") + testDeepEqualErr(v125v1, v125v2, t, "equal-map-v125-p-len") + bs125 = testMarshalErr(&v125v1, h, t, "enc-map-v125-p") + v125v2 = nil + testUnmarshalErr(&v125v2, bs125, h, t, "dec-map-v125-p-nil") + testDeepEqualErr(v125v1, v125v2, t, "equal-map-v125-p-nil") + // ... + if v == nil { + v125v2 = nil + } else { + v125v2 = make(map[uint16]bool, len(v)) + } // reset map + var v125v3, v125v4 typMapMapUint16Bool + v125v3 = typMapMapUint16Bool(v125v1) + v125v4 = typMapMapUint16Bool(v125v2) + bs125 = testMarshalErr(v125v3, h, t, "enc-map-v125-custom") + testUnmarshalErr(v125v4, bs125, h, t, "dec-map-v125-p-len") + testDeepEqualErr(v125v3, v125v4, t, "equal-map-v125-p-len") + } + + for _, v := range []map[uint32]interface{}{nil, {}, {33: nil, 44: "string-is-an-interface"}} { + // fmt.Printf(">>>> running mammoth map v128: %v\n", v) + var v128v1, v128v2 map[uint32]interface{} + v128v1 = v + bs128 := testMarshalErr(v128v1, h, t, "enc-map-v128") + if v == nil { + v128v2 = nil + } else { + v128v2 = make(map[uint32]interface{}, len(v)) + } // reset map + testUnmarshalErr(v128v2, bs128, h, t, "dec-map-v128") + testDeepEqualErr(v128v1, v128v2, t, "equal-map-v128") + if v == nil { + v128v2 = nil + } else { + v128v2 = make(map[uint32]interface{}, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v128v2), bs128, h, t, "dec-map-v128-noaddr") // decode into non-addressable map value + testDeepEqualErr(v128v1, v128v2, t, "equal-map-v128-noaddr") + if v == nil { + v128v2 = nil + } else { + v128v2 = make(map[uint32]interface{}, len(v)) + } // reset map + testUnmarshalErr(&v128v2, bs128, h, t, "dec-map-v128-p-len") + testDeepEqualErr(v128v1, v128v2, t, "equal-map-v128-p-len") + bs128 = testMarshalErr(&v128v1, h, t, "enc-map-v128-p") + v128v2 = nil + testUnmarshalErr(&v128v2, bs128, h, t, "dec-map-v128-p-nil") + testDeepEqualErr(v128v1, v128v2, t, "equal-map-v128-p-nil") + // ... + if v == nil { + v128v2 = nil + } else { + v128v2 = make(map[uint32]interface{}, len(v)) + } // reset map + var v128v3, v128v4 typMapMapUint32Intf + v128v3 = typMapMapUint32Intf(v128v1) + v128v4 = typMapMapUint32Intf(v128v2) + bs128 = testMarshalErr(v128v3, h, t, "enc-map-v128-custom") + testUnmarshalErr(v128v4, bs128, h, t, "dec-map-v128-p-len") + testDeepEqualErr(v128v3, v128v4, t, "equal-map-v128-p-len") + } + + for _, v := range []map[uint32]string{nil, {}, {33: "", 44: "some-string"}} { + // fmt.Printf(">>>> running mammoth map v129: %v\n", v) + var v129v1, v129v2 map[uint32]string + v129v1 = v + bs129 := testMarshalErr(v129v1, h, t, "enc-map-v129") + if v == nil { + v129v2 = nil + } else { + v129v2 = make(map[uint32]string, len(v)) + } // reset map + testUnmarshalErr(v129v2, bs129, h, t, "dec-map-v129") + testDeepEqualErr(v129v1, v129v2, t, "equal-map-v129") + if v == nil { + v129v2 = nil + } else { + v129v2 = make(map[uint32]string, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v129v2), bs129, h, t, "dec-map-v129-noaddr") // decode into non-addressable map value + testDeepEqualErr(v129v1, v129v2, t, "equal-map-v129-noaddr") + if v == nil { + v129v2 = nil + } else { + v129v2 = make(map[uint32]string, len(v)) + } // reset map + testUnmarshalErr(&v129v2, bs129, h, t, "dec-map-v129-p-len") + testDeepEqualErr(v129v1, v129v2, t, "equal-map-v129-p-len") + bs129 = testMarshalErr(&v129v1, h, t, "enc-map-v129-p") + v129v2 = nil + testUnmarshalErr(&v129v2, bs129, h, t, "dec-map-v129-p-nil") + testDeepEqualErr(v129v1, v129v2, t, "equal-map-v129-p-nil") + // ... + if v == nil { + v129v2 = nil + } else { + v129v2 = make(map[uint32]string, len(v)) + } // reset map + var v129v3, v129v4 typMapMapUint32String + v129v3 = typMapMapUint32String(v129v1) + v129v4 = typMapMapUint32String(v129v2) + bs129 = testMarshalErr(v129v3, h, t, "enc-map-v129-custom") + testUnmarshalErr(v129v4, bs129, h, t, "dec-map-v129-p-len") + testDeepEqualErr(v129v3, v129v4, t, "equal-map-v129-p-len") + } + + for _, v := range []map[uint32]uint{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v130: %v\n", v) + var v130v1, v130v2 map[uint32]uint + v130v1 = v + bs130 := testMarshalErr(v130v1, h, t, "enc-map-v130") + if v == nil { + v130v2 = nil + } else { + v130v2 = make(map[uint32]uint, len(v)) + } // reset map + testUnmarshalErr(v130v2, bs130, h, t, "dec-map-v130") + testDeepEqualErr(v130v1, v130v2, t, "equal-map-v130") + if v == nil { + v130v2 = nil + } else { + v130v2 = make(map[uint32]uint, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v130v2), bs130, h, t, "dec-map-v130-noaddr") // decode into non-addressable map value + testDeepEqualErr(v130v1, v130v2, t, "equal-map-v130-noaddr") + if v == nil { + v130v2 = nil + } else { + v130v2 = make(map[uint32]uint, len(v)) + } // reset map + testUnmarshalErr(&v130v2, bs130, h, t, "dec-map-v130-p-len") + testDeepEqualErr(v130v1, v130v2, t, "equal-map-v130-p-len") + bs130 = testMarshalErr(&v130v1, h, t, "enc-map-v130-p") + v130v2 = nil + testUnmarshalErr(&v130v2, bs130, h, t, "dec-map-v130-p-nil") + testDeepEqualErr(v130v1, v130v2, t, "equal-map-v130-p-nil") + // ... + if v == nil { + v130v2 = nil + } else { + v130v2 = make(map[uint32]uint, len(v)) + } // reset map + var v130v3, v130v4 typMapMapUint32Uint + v130v3 = typMapMapUint32Uint(v130v1) + v130v4 = typMapMapUint32Uint(v130v2) + bs130 = testMarshalErr(v130v3, h, t, "enc-map-v130-custom") + testUnmarshalErr(v130v4, bs130, h, t, "dec-map-v130-p-len") + testDeepEqualErr(v130v3, v130v4, t, "equal-map-v130-p-len") + } + + for _, v := range []map[uint32]uint8{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v131: %v\n", v) + var v131v1, v131v2 map[uint32]uint8 + v131v1 = v + bs131 := testMarshalErr(v131v1, h, t, "enc-map-v131") + if v == nil { + v131v2 = nil + } else { + v131v2 = make(map[uint32]uint8, len(v)) + } // reset map + testUnmarshalErr(v131v2, bs131, h, t, "dec-map-v131") + testDeepEqualErr(v131v1, v131v2, t, "equal-map-v131") + if v == nil { + v131v2 = nil + } else { + v131v2 = make(map[uint32]uint8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v131v2), bs131, h, t, "dec-map-v131-noaddr") // decode into non-addressable map value + testDeepEqualErr(v131v1, v131v2, t, "equal-map-v131-noaddr") + if v == nil { + v131v2 = nil + } else { + v131v2 = make(map[uint32]uint8, len(v)) + } // reset map + testUnmarshalErr(&v131v2, bs131, h, t, "dec-map-v131-p-len") + testDeepEqualErr(v131v1, v131v2, t, "equal-map-v131-p-len") + bs131 = testMarshalErr(&v131v1, h, t, "enc-map-v131-p") + v131v2 = nil + testUnmarshalErr(&v131v2, bs131, h, t, "dec-map-v131-p-nil") + testDeepEqualErr(v131v1, v131v2, t, "equal-map-v131-p-nil") + // ... + if v == nil { + v131v2 = nil + } else { + v131v2 = make(map[uint32]uint8, len(v)) + } // reset map + var v131v3, v131v4 typMapMapUint32Uint8 + v131v3 = typMapMapUint32Uint8(v131v1) + v131v4 = typMapMapUint32Uint8(v131v2) + bs131 = testMarshalErr(v131v3, h, t, "enc-map-v131-custom") + testUnmarshalErr(v131v4, bs131, h, t, "dec-map-v131-p-len") + testDeepEqualErr(v131v3, v131v4, t, "equal-map-v131-p-len") + } + + for _, v := range []map[uint32]uint16{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v132: %v\n", v) + var v132v1, v132v2 map[uint32]uint16 + v132v1 = v + bs132 := testMarshalErr(v132v1, h, t, "enc-map-v132") + if v == nil { + v132v2 = nil + } else { + v132v2 = make(map[uint32]uint16, len(v)) + } // reset map + testUnmarshalErr(v132v2, bs132, h, t, "dec-map-v132") + testDeepEqualErr(v132v1, v132v2, t, "equal-map-v132") + if v == nil { + v132v2 = nil + } else { + v132v2 = make(map[uint32]uint16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v132v2), bs132, h, t, "dec-map-v132-noaddr") // decode into non-addressable map value + testDeepEqualErr(v132v1, v132v2, t, "equal-map-v132-noaddr") + if v == nil { + v132v2 = nil + } else { + v132v2 = make(map[uint32]uint16, len(v)) + } // reset map + testUnmarshalErr(&v132v2, bs132, h, t, "dec-map-v132-p-len") + testDeepEqualErr(v132v1, v132v2, t, "equal-map-v132-p-len") + bs132 = testMarshalErr(&v132v1, h, t, "enc-map-v132-p") + v132v2 = nil + testUnmarshalErr(&v132v2, bs132, h, t, "dec-map-v132-p-nil") + testDeepEqualErr(v132v1, v132v2, t, "equal-map-v132-p-nil") + // ... + if v == nil { + v132v2 = nil + } else { + v132v2 = make(map[uint32]uint16, len(v)) + } // reset map + var v132v3, v132v4 typMapMapUint32Uint16 + v132v3 = typMapMapUint32Uint16(v132v1) + v132v4 = typMapMapUint32Uint16(v132v2) + bs132 = testMarshalErr(v132v3, h, t, "enc-map-v132-custom") + testUnmarshalErr(v132v4, bs132, h, t, "dec-map-v132-p-len") + testDeepEqualErr(v132v3, v132v4, t, "equal-map-v132-p-len") + } + + for _, v := range []map[uint32]uint32{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v133: %v\n", v) + var v133v1, v133v2 map[uint32]uint32 + v133v1 = v + bs133 := testMarshalErr(v133v1, h, t, "enc-map-v133") + if v == nil { + v133v2 = nil + } else { + v133v2 = make(map[uint32]uint32, len(v)) + } // reset map + testUnmarshalErr(v133v2, bs133, h, t, "dec-map-v133") + testDeepEqualErr(v133v1, v133v2, t, "equal-map-v133") + if v == nil { + v133v2 = nil + } else { + v133v2 = make(map[uint32]uint32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v133v2), bs133, h, t, "dec-map-v133-noaddr") // decode into non-addressable map value + testDeepEqualErr(v133v1, v133v2, t, "equal-map-v133-noaddr") + if v == nil { + v133v2 = nil + } else { + v133v2 = make(map[uint32]uint32, len(v)) + } // reset map + testUnmarshalErr(&v133v2, bs133, h, t, "dec-map-v133-p-len") + testDeepEqualErr(v133v1, v133v2, t, "equal-map-v133-p-len") + bs133 = testMarshalErr(&v133v1, h, t, "enc-map-v133-p") + v133v2 = nil + testUnmarshalErr(&v133v2, bs133, h, t, "dec-map-v133-p-nil") + testDeepEqualErr(v133v1, v133v2, t, "equal-map-v133-p-nil") + // ... + if v == nil { + v133v2 = nil + } else { + v133v2 = make(map[uint32]uint32, len(v)) + } // reset map + var v133v3, v133v4 typMapMapUint32Uint32 + v133v3 = typMapMapUint32Uint32(v133v1) + v133v4 = typMapMapUint32Uint32(v133v2) + bs133 = testMarshalErr(v133v3, h, t, "enc-map-v133-custom") + testUnmarshalErr(v133v4, bs133, h, t, "dec-map-v133-p-len") + testDeepEqualErr(v133v3, v133v4, t, "equal-map-v133-p-len") + } + + for _, v := range []map[uint32]uint64{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v134: %v\n", v) + var v134v1, v134v2 map[uint32]uint64 + v134v1 = v + bs134 := testMarshalErr(v134v1, h, t, "enc-map-v134") + if v == nil { + v134v2 = nil + } else { + v134v2 = make(map[uint32]uint64, len(v)) + } // reset map + testUnmarshalErr(v134v2, bs134, h, t, "dec-map-v134") + testDeepEqualErr(v134v1, v134v2, t, "equal-map-v134") + if v == nil { + v134v2 = nil + } else { + v134v2 = make(map[uint32]uint64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v134v2), bs134, h, t, "dec-map-v134-noaddr") // decode into non-addressable map value + testDeepEqualErr(v134v1, v134v2, t, "equal-map-v134-noaddr") + if v == nil { + v134v2 = nil + } else { + v134v2 = make(map[uint32]uint64, len(v)) + } // reset map + testUnmarshalErr(&v134v2, bs134, h, t, "dec-map-v134-p-len") + testDeepEqualErr(v134v1, v134v2, t, "equal-map-v134-p-len") + bs134 = testMarshalErr(&v134v1, h, t, "enc-map-v134-p") + v134v2 = nil + testUnmarshalErr(&v134v2, bs134, h, t, "dec-map-v134-p-nil") + testDeepEqualErr(v134v1, v134v2, t, "equal-map-v134-p-nil") + // ... + if v == nil { + v134v2 = nil + } else { + v134v2 = make(map[uint32]uint64, len(v)) + } // reset map + var v134v3, v134v4 typMapMapUint32Uint64 + v134v3 = typMapMapUint32Uint64(v134v1) + v134v4 = typMapMapUint32Uint64(v134v2) + bs134 = testMarshalErr(v134v3, h, t, "enc-map-v134-custom") + testUnmarshalErr(v134v4, bs134, h, t, "dec-map-v134-p-len") + testDeepEqualErr(v134v3, v134v4, t, "equal-map-v134-p-len") + } + + for _, v := range []map[uint32]uintptr{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v135: %v\n", v) + var v135v1, v135v2 map[uint32]uintptr + v135v1 = v + bs135 := testMarshalErr(v135v1, h, t, "enc-map-v135") + if v == nil { + v135v2 = nil + } else { + v135v2 = make(map[uint32]uintptr, len(v)) + } // reset map + testUnmarshalErr(v135v2, bs135, h, t, "dec-map-v135") + testDeepEqualErr(v135v1, v135v2, t, "equal-map-v135") + if v == nil { + v135v2 = nil + } else { + v135v2 = make(map[uint32]uintptr, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v135v2), bs135, h, t, "dec-map-v135-noaddr") // decode into non-addressable map value + testDeepEqualErr(v135v1, v135v2, t, "equal-map-v135-noaddr") + if v == nil { + v135v2 = nil + } else { + v135v2 = make(map[uint32]uintptr, len(v)) + } // reset map + testUnmarshalErr(&v135v2, bs135, h, t, "dec-map-v135-p-len") + testDeepEqualErr(v135v1, v135v2, t, "equal-map-v135-p-len") + bs135 = testMarshalErr(&v135v1, h, t, "enc-map-v135-p") + v135v2 = nil + testUnmarshalErr(&v135v2, bs135, h, t, "dec-map-v135-p-nil") + testDeepEqualErr(v135v1, v135v2, t, "equal-map-v135-p-nil") + // ... + if v == nil { + v135v2 = nil + } else { + v135v2 = make(map[uint32]uintptr, len(v)) + } // reset map + var v135v3, v135v4 typMapMapUint32Uintptr + v135v3 = typMapMapUint32Uintptr(v135v1) + v135v4 = typMapMapUint32Uintptr(v135v2) + bs135 = testMarshalErr(v135v3, h, t, "enc-map-v135-custom") + testUnmarshalErr(v135v4, bs135, h, t, "dec-map-v135-p-len") + testDeepEqualErr(v135v3, v135v4, t, "equal-map-v135-p-len") + } + + for _, v := range []map[uint32]int{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v136: %v\n", v) + var v136v1, v136v2 map[uint32]int + v136v1 = v + bs136 := testMarshalErr(v136v1, h, t, "enc-map-v136") + if v == nil { + v136v2 = nil + } else { + v136v2 = make(map[uint32]int, len(v)) + } // reset map + testUnmarshalErr(v136v2, bs136, h, t, "dec-map-v136") + testDeepEqualErr(v136v1, v136v2, t, "equal-map-v136") + if v == nil { + v136v2 = nil + } else { + v136v2 = make(map[uint32]int, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v136v2), bs136, h, t, "dec-map-v136-noaddr") // decode into non-addressable map value + testDeepEqualErr(v136v1, v136v2, t, "equal-map-v136-noaddr") + if v == nil { + v136v2 = nil + } else { + v136v2 = make(map[uint32]int, len(v)) + } // reset map + testUnmarshalErr(&v136v2, bs136, h, t, "dec-map-v136-p-len") + testDeepEqualErr(v136v1, v136v2, t, "equal-map-v136-p-len") + bs136 = testMarshalErr(&v136v1, h, t, "enc-map-v136-p") + v136v2 = nil + testUnmarshalErr(&v136v2, bs136, h, t, "dec-map-v136-p-nil") + testDeepEqualErr(v136v1, v136v2, t, "equal-map-v136-p-nil") + // ... + if v == nil { + v136v2 = nil + } else { + v136v2 = make(map[uint32]int, len(v)) + } // reset map + var v136v3, v136v4 typMapMapUint32Int + v136v3 = typMapMapUint32Int(v136v1) + v136v4 = typMapMapUint32Int(v136v2) + bs136 = testMarshalErr(v136v3, h, t, "enc-map-v136-custom") + testUnmarshalErr(v136v4, bs136, h, t, "dec-map-v136-p-len") + testDeepEqualErr(v136v3, v136v4, t, "equal-map-v136-p-len") + } + + for _, v := range []map[uint32]int8{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v137: %v\n", v) + var v137v1, v137v2 map[uint32]int8 + v137v1 = v + bs137 := testMarshalErr(v137v1, h, t, "enc-map-v137") + if v == nil { + v137v2 = nil + } else { + v137v2 = make(map[uint32]int8, len(v)) + } // reset map + testUnmarshalErr(v137v2, bs137, h, t, "dec-map-v137") + testDeepEqualErr(v137v1, v137v2, t, "equal-map-v137") + if v == nil { + v137v2 = nil + } else { + v137v2 = make(map[uint32]int8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v137v2), bs137, h, t, "dec-map-v137-noaddr") // decode into non-addressable map value + testDeepEqualErr(v137v1, v137v2, t, "equal-map-v137-noaddr") + if v == nil { + v137v2 = nil + } else { + v137v2 = make(map[uint32]int8, len(v)) + } // reset map + testUnmarshalErr(&v137v2, bs137, h, t, "dec-map-v137-p-len") + testDeepEqualErr(v137v1, v137v2, t, "equal-map-v137-p-len") + bs137 = testMarshalErr(&v137v1, h, t, "enc-map-v137-p") + v137v2 = nil + testUnmarshalErr(&v137v2, bs137, h, t, "dec-map-v137-p-nil") + testDeepEqualErr(v137v1, v137v2, t, "equal-map-v137-p-nil") + // ... + if v == nil { + v137v2 = nil + } else { + v137v2 = make(map[uint32]int8, len(v)) + } // reset map + var v137v3, v137v4 typMapMapUint32Int8 + v137v3 = typMapMapUint32Int8(v137v1) + v137v4 = typMapMapUint32Int8(v137v2) + bs137 = testMarshalErr(v137v3, h, t, "enc-map-v137-custom") + testUnmarshalErr(v137v4, bs137, h, t, "dec-map-v137-p-len") + testDeepEqualErr(v137v3, v137v4, t, "equal-map-v137-p-len") + } + + for _, v := range []map[uint32]int16{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v138: %v\n", v) + var v138v1, v138v2 map[uint32]int16 + v138v1 = v + bs138 := testMarshalErr(v138v1, h, t, "enc-map-v138") + if v == nil { + v138v2 = nil + } else { + v138v2 = make(map[uint32]int16, len(v)) + } // reset map + testUnmarshalErr(v138v2, bs138, h, t, "dec-map-v138") + testDeepEqualErr(v138v1, v138v2, t, "equal-map-v138") + if v == nil { + v138v2 = nil + } else { + v138v2 = make(map[uint32]int16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v138v2), bs138, h, t, "dec-map-v138-noaddr") // decode into non-addressable map value + testDeepEqualErr(v138v1, v138v2, t, "equal-map-v138-noaddr") + if v == nil { + v138v2 = nil + } else { + v138v2 = make(map[uint32]int16, len(v)) + } // reset map + testUnmarshalErr(&v138v2, bs138, h, t, "dec-map-v138-p-len") + testDeepEqualErr(v138v1, v138v2, t, "equal-map-v138-p-len") + bs138 = testMarshalErr(&v138v1, h, t, "enc-map-v138-p") + v138v2 = nil + testUnmarshalErr(&v138v2, bs138, h, t, "dec-map-v138-p-nil") + testDeepEqualErr(v138v1, v138v2, t, "equal-map-v138-p-nil") + // ... + if v == nil { + v138v2 = nil + } else { + v138v2 = make(map[uint32]int16, len(v)) + } // reset map + var v138v3, v138v4 typMapMapUint32Int16 + v138v3 = typMapMapUint32Int16(v138v1) + v138v4 = typMapMapUint32Int16(v138v2) + bs138 = testMarshalErr(v138v3, h, t, "enc-map-v138-custom") + testUnmarshalErr(v138v4, bs138, h, t, "dec-map-v138-p-len") + testDeepEqualErr(v138v3, v138v4, t, "equal-map-v138-p-len") + } + + for _, v := range []map[uint32]int32{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v139: %v\n", v) + var v139v1, v139v2 map[uint32]int32 + v139v1 = v + bs139 := testMarshalErr(v139v1, h, t, "enc-map-v139") + if v == nil { + v139v2 = nil + } else { + v139v2 = make(map[uint32]int32, len(v)) + } // reset map + testUnmarshalErr(v139v2, bs139, h, t, "dec-map-v139") + testDeepEqualErr(v139v1, v139v2, t, "equal-map-v139") + if v == nil { + v139v2 = nil + } else { + v139v2 = make(map[uint32]int32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v139v2), bs139, h, t, "dec-map-v139-noaddr") // decode into non-addressable map value + testDeepEqualErr(v139v1, v139v2, t, "equal-map-v139-noaddr") + if v == nil { + v139v2 = nil + } else { + v139v2 = make(map[uint32]int32, len(v)) + } // reset map + testUnmarshalErr(&v139v2, bs139, h, t, "dec-map-v139-p-len") + testDeepEqualErr(v139v1, v139v2, t, "equal-map-v139-p-len") + bs139 = testMarshalErr(&v139v1, h, t, "enc-map-v139-p") + v139v2 = nil + testUnmarshalErr(&v139v2, bs139, h, t, "dec-map-v139-p-nil") + testDeepEqualErr(v139v1, v139v2, t, "equal-map-v139-p-nil") + // ... + if v == nil { + v139v2 = nil + } else { + v139v2 = make(map[uint32]int32, len(v)) + } // reset map + var v139v3, v139v4 typMapMapUint32Int32 + v139v3 = typMapMapUint32Int32(v139v1) + v139v4 = typMapMapUint32Int32(v139v2) + bs139 = testMarshalErr(v139v3, h, t, "enc-map-v139-custom") + testUnmarshalErr(v139v4, bs139, h, t, "dec-map-v139-p-len") + testDeepEqualErr(v139v3, v139v4, t, "equal-map-v139-p-len") + } + + for _, v := range []map[uint32]int64{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v140: %v\n", v) + var v140v1, v140v2 map[uint32]int64 + v140v1 = v + bs140 := testMarshalErr(v140v1, h, t, "enc-map-v140") + if v == nil { + v140v2 = nil + } else { + v140v2 = make(map[uint32]int64, len(v)) + } // reset map + testUnmarshalErr(v140v2, bs140, h, t, "dec-map-v140") + testDeepEqualErr(v140v1, v140v2, t, "equal-map-v140") + if v == nil { + v140v2 = nil + } else { + v140v2 = make(map[uint32]int64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v140v2), bs140, h, t, "dec-map-v140-noaddr") // decode into non-addressable map value + testDeepEqualErr(v140v1, v140v2, t, "equal-map-v140-noaddr") + if v == nil { + v140v2 = nil + } else { + v140v2 = make(map[uint32]int64, len(v)) + } // reset map + testUnmarshalErr(&v140v2, bs140, h, t, "dec-map-v140-p-len") + testDeepEqualErr(v140v1, v140v2, t, "equal-map-v140-p-len") + bs140 = testMarshalErr(&v140v1, h, t, "enc-map-v140-p") + v140v2 = nil + testUnmarshalErr(&v140v2, bs140, h, t, "dec-map-v140-p-nil") + testDeepEqualErr(v140v1, v140v2, t, "equal-map-v140-p-nil") + // ... + if v == nil { + v140v2 = nil + } else { + v140v2 = make(map[uint32]int64, len(v)) + } // reset map + var v140v3, v140v4 typMapMapUint32Int64 + v140v3 = typMapMapUint32Int64(v140v1) + v140v4 = typMapMapUint32Int64(v140v2) + bs140 = testMarshalErr(v140v3, h, t, "enc-map-v140-custom") + testUnmarshalErr(v140v4, bs140, h, t, "dec-map-v140-p-len") + testDeepEqualErr(v140v3, v140v4, t, "equal-map-v140-p-len") + } + + for _, v := range []map[uint32]float32{nil, {}, {44: 0, 33: 22.2}} { + // fmt.Printf(">>>> running mammoth map v141: %v\n", v) + var v141v1, v141v2 map[uint32]float32 + v141v1 = v + bs141 := testMarshalErr(v141v1, h, t, "enc-map-v141") + if v == nil { + v141v2 = nil + } else { + v141v2 = make(map[uint32]float32, len(v)) + } // reset map + testUnmarshalErr(v141v2, bs141, h, t, "dec-map-v141") + testDeepEqualErr(v141v1, v141v2, t, "equal-map-v141") + if v == nil { + v141v2 = nil + } else { + v141v2 = make(map[uint32]float32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v141v2), bs141, h, t, "dec-map-v141-noaddr") // decode into non-addressable map value + testDeepEqualErr(v141v1, v141v2, t, "equal-map-v141-noaddr") + if v == nil { + v141v2 = nil + } else { + v141v2 = make(map[uint32]float32, len(v)) + } // reset map + testUnmarshalErr(&v141v2, bs141, h, t, "dec-map-v141-p-len") + testDeepEqualErr(v141v1, v141v2, t, "equal-map-v141-p-len") + bs141 = testMarshalErr(&v141v1, h, t, "enc-map-v141-p") + v141v2 = nil + testUnmarshalErr(&v141v2, bs141, h, t, "dec-map-v141-p-nil") + testDeepEqualErr(v141v1, v141v2, t, "equal-map-v141-p-nil") + // ... + if v == nil { + v141v2 = nil + } else { + v141v2 = make(map[uint32]float32, len(v)) + } // reset map + var v141v3, v141v4 typMapMapUint32Float32 + v141v3 = typMapMapUint32Float32(v141v1) + v141v4 = typMapMapUint32Float32(v141v2) + bs141 = testMarshalErr(v141v3, h, t, "enc-map-v141-custom") + testUnmarshalErr(v141v4, bs141, h, t, "dec-map-v141-p-len") + testDeepEqualErr(v141v3, v141v4, t, "equal-map-v141-p-len") + } + + for _, v := range []map[uint32]float64{nil, {}, {44: 0, 33: 11.1}} { + // fmt.Printf(">>>> running mammoth map v142: %v\n", v) + var v142v1, v142v2 map[uint32]float64 + v142v1 = v + bs142 := testMarshalErr(v142v1, h, t, "enc-map-v142") + if v == nil { + v142v2 = nil + } else { + v142v2 = make(map[uint32]float64, len(v)) + } // reset map + testUnmarshalErr(v142v2, bs142, h, t, "dec-map-v142") + testDeepEqualErr(v142v1, v142v2, t, "equal-map-v142") + if v == nil { + v142v2 = nil + } else { + v142v2 = make(map[uint32]float64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v142v2), bs142, h, t, "dec-map-v142-noaddr") // decode into non-addressable map value + testDeepEqualErr(v142v1, v142v2, t, "equal-map-v142-noaddr") + if v == nil { + v142v2 = nil + } else { + v142v2 = make(map[uint32]float64, len(v)) + } // reset map + testUnmarshalErr(&v142v2, bs142, h, t, "dec-map-v142-p-len") + testDeepEqualErr(v142v1, v142v2, t, "equal-map-v142-p-len") + bs142 = testMarshalErr(&v142v1, h, t, "enc-map-v142-p") + v142v2 = nil + testUnmarshalErr(&v142v2, bs142, h, t, "dec-map-v142-p-nil") + testDeepEqualErr(v142v1, v142v2, t, "equal-map-v142-p-nil") + // ... + if v == nil { + v142v2 = nil + } else { + v142v2 = make(map[uint32]float64, len(v)) + } // reset map + var v142v3, v142v4 typMapMapUint32Float64 + v142v3 = typMapMapUint32Float64(v142v1) + v142v4 = typMapMapUint32Float64(v142v2) + bs142 = testMarshalErr(v142v3, h, t, "enc-map-v142-custom") + testUnmarshalErr(v142v4, bs142, h, t, "dec-map-v142-p-len") + testDeepEqualErr(v142v3, v142v4, t, "equal-map-v142-p-len") + } + + for _, v := range []map[uint32]bool{nil, {}, {44: false, 33: true}} { + // fmt.Printf(">>>> running mammoth map v143: %v\n", v) + var v143v1, v143v2 map[uint32]bool + v143v1 = v + bs143 := testMarshalErr(v143v1, h, t, "enc-map-v143") + if v == nil { + v143v2 = nil + } else { + v143v2 = make(map[uint32]bool, len(v)) + } // reset map + testUnmarshalErr(v143v2, bs143, h, t, "dec-map-v143") + testDeepEqualErr(v143v1, v143v2, t, "equal-map-v143") + if v == nil { + v143v2 = nil + } else { + v143v2 = make(map[uint32]bool, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v143v2), bs143, h, t, "dec-map-v143-noaddr") // decode into non-addressable map value + testDeepEqualErr(v143v1, v143v2, t, "equal-map-v143-noaddr") + if v == nil { + v143v2 = nil + } else { + v143v2 = make(map[uint32]bool, len(v)) + } // reset map + testUnmarshalErr(&v143v2, bs143, h, t, "dec-map-v143-p-len") + testDeepEqualErr(v143v1, v143v2, t, "equal-map-v143-p-len") + bs143 = testMarshalErr(&v143v1, h, t, "enc-map-v143-p") + v143v2 = nil + testUnmarshalErr(&v143v2, bs143, h, t, "dec-map-v143-p-nil") + testDeepEqualErr(v143v1, v143v2, t, "equal-map-v143-p-nil") + // ... + if v == nil { + v143v2 = nil + } else { + v143v2 = make(map[uint32]bool, len(v)) + } // reset map + var v143v3, v143v4 typMapMapUint32Bool + v143v3 = typMapMapUint32Bool(v143v1) + v143v4 = typMapMapUint32Bool(v143v2) + bs143 = testMarshalErr(v143v3, h, t, "enc-map-v143-custom") + testUnmarshalErr(v143v4, bs143, h, t, "dec-map-v143-p-len") + testDeepEqualErr(v143v3, v143v4, t, "equal-map-v143-p-len") + } + + for _, v := range []map[uint64]interface{}{nil, {}, {44: nil, 33: "string-is-an-interface-2"}} { + // fmt.Printf(">>>> running mammoth map v146: %v\n", v) + var v146v1, v146v2 map[uint64]interface{} + v146v1 = v + bs146 := testMarshalErr(v146v1, h, t, "enc-map-v146") + if v == nil { + v146v2 = nil + } else { + v146v2 = make(map[uint64]interface{}, len(v)) + } // reset map + testUnmarshalErr(v146v2, bs146, h, t, "dec-map-v146") + testDeepEqualErr(v146v1, v146v2, t, "equal-map-v146") + if v == nil { + v146v2 = nil + } else { + v146v2 = make(map[uint64]interface{}, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v146v2), bs146, h, t, "dec-map-v146-noaddr") // decode into non-addressable map value + testDeepEqualErr(v146v1, v146v2, t, "equal-map-v146-noaddr") + if v == nil { + v146v2 = nil + } else { + v146v2 = make(map[uint64]interface{}, len(v)) + } // reset map + testUnmarshalErr(&v146v2, bs146, h, t, "dec-map-v146-p-len") + testDeepEqualErr(v146v1, v146v2, t, "equal-map-v146-p-len") + bs146 = testMarshalErr(&v146v1, h, t, "enc-map-v146-p") + v146v2 = nil + testUnmarshalErr(&v146v2, bs146, h, t, "dec-map-v146-p-nil") + testDeepEqualErr(v146v1, v146v2, t, "equal-map-v146-p-nil") + // ... + if v == nil { + v146v2 = nil + } else { + v146v2 = make(map[uint64]interface{}, len(v)) + } // reset map + var v146v3, v146v4 typMapMapUint64Intf + v146v3 = typMapMapUint64Intf(v146v1) + v146v4 = typMapMapUint64Intf(v146v2) + bs146 = testMarshalErr(v146v3, h, t, "enc-map-v146-custom") + testUnmarshalErr(v146v4, bs146, h, t, "dec-map-v146-p-len") + testDeepEqualErr(v146v3, v146v4, t, "equal-map-v146-p-len") + } + + for _, v := range []map[uint64]string{nil, {}, {44: "", 33: "some-string-2"}} { + // fmt.Printf(">>>> running mammoth map v147: %v\n", v) + var v147v1, v147v2 map[uint64]string + v147v1 = v + bs147 := testMarshalErr(v147v1, h, t, "enc-map-v147") + if v == nil { + v147v2 = nil + } else { + v147v2 = make(map[uint64]string, len(v)) + } // reset map + testUnmarshalErr(v147v2, bs147, h, t, "dec-map-v147") + testDeepEqualErr(v147v1, v147v2, t, "equal-map-v147") + if v == nil { + v147v2 = nil + } else { + v147v2 = make(map[uint64]string, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v147v2), bs147, h, t, "dec-map-v147-noaddr") // decode into non-addressable map value + testDeepEqualErr(v147v1, v147v2, t, "equal-map-v147-noaddr") + if v == nil { + v147v2 = nil + } else { + v147v2 = make(map[uint64]string, len(v)) + } // reset map + testUnmarshalErr(&v147v2, bs147, h, t, "dec-map-v147-p-len") + testDeepEqualErr(v147v1, v147v2, t, "equal-map-v147-p-len") + bs147 = testMarshalErr(&v147v1, h, t, "enc-map-v147-p") + v147v2 = nil + testUnmarshalErr(&v147v2, bs147, h, t, "dec-map-v147-p-nil") + testDeepEqualErr(v147v1, v147v2, t, "equal-map-v147-p-nil") + // ... + if v == nil { + v147v2 = nil + } else { + v147v2 = make(map[uint64]string, len(v)) + } // reset map + var v147v3, v147v4 typMapMapUint64String + v147v3 = typMapMapUint64String(v147v1) + v147v4 = typMapMapUint64String(v147v2) + bs147 = testMarshalErr(v147v3, h, t, "enc-map-v147-custom") + testUnmarshalErr(v147v4, bs147, h, t, "dec-map-v147-p-len") + testDeepEqualErr(v147v3, v147v4, t, "equal-map-v147-p-len") + } + + for _, v := range []map[uint64]uint{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v148: %v\n", v) + var v148v1, v148v2 map[uint64]uint + v148v1 = v + bs148 := testMarshalErr(v148v1, h, t, "enc-map-v148") + if v == nil { + v148v2 = nil + } else { + v148v2 = make(map[uint64]uint, len(v)) + } // reset map + testUnmarshalErr(v148v2, bs148, h, t, "dec-map-v148") + testDeepEqualErr(v148v1, v148v2, t, "equal-map-v148") + if v == nil { + v148v2 = nil + } else { + v148v2 = make(map[uint64]uint, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v148v2), bs148, h, t, "dec-map-v148-noaddr") // decode into non-addressable map value + testDeepEqualErr(v148v1, v148v2, t, "equal-map-v148-noaddr") + if v == nil { + v148v2 = nil + } else { + v148v2 = make(map[uint64]uint, len(v)) + } // reset map + testUnmarshalErr(&v148v2, bs148, h, t, "dec-map-v148-p-len") + testDeepEqualErr(v148v1, v148v2, t, "equal-map-v148-p-len") + bs148 = testMarshalErr(&v148v1, h, t, "enc-map-v148-p") + v148v2 = nil + testUnmarshalErr(&v148v2, bs148, h, t, "dec-map-v148-p-nil") + testDeepEqualErr(v148v1, v148v2, t, "equal-map-v148-p-nil") + // ... + if v == nil { + v148v2 = nil + } else { + v148v2 = make(map[uint64]uint, len(v)) + } // reset map + var v148v3, v148v4 typMapMapUint64Uint + v148v3 = typMapMapUint64Uint(v148v1) + v148v4 = typMapMapUint64Uint(v148v2) + bs148 = testMarshalErr(v148v3, h, t, "enc-map-v148-custom") + testUnmarshalErr(v148v4, bs148, h, t, "dec-map-v148-p-len") + testDeepEqualErr(v148v3, v148v4, t, "equal-map-v148-p-len") + } + + for _, v := range []map[uint64]uint8{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v149: %v\n", v) + var v149v1, v149v2 map[uint64]uint8 + v149v1 = v + bs149 := testMarshalErr(v149v1, h, t, "enc-map-v149") + if v == nil { + v149v2 = nil + } else { + v149v2 = make(map[uint64]uint8, len(v)) + } // reset map + testUnmarshalErr(v149v2, bs149, h, t, "dec-map-v149") + testDeepEqualErr(v149v1, v149v2, t, "equal-map-v149") + if v == nil { + v149v2 = nil + } else { + v149v2 = make(map[uint64]uint8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v149v2), bs149, h, t, "dec-map-v149-noaddr") // decode into non-addressable map value + testDeepEqualErr(v149v1, v149v2, t, "equal-map-v149-noaddr") + if v == nil { + v149v2 = nil + } else { + v149v2 = make(map[uint64]uint8, len(v)) + } // reset map + testUnmarshalErr(&v149v2, bs149, h, t, "dec-map-v149-p-len") + testDeepEqualErr(v149v1, v149v2, t, "equal-map-v149-p-len") + bs149 = testMarshalErr(&v149v1, h, t, "enc-map-v149-p") + v149v2 = nil + testUnmarshalErr(&v149v2, bs149, h, t, "dec-map-v149-p-nil") + testDeepEqualErr(v149v1, v149v2, t, "equal-map-v149-p-nil") + // ... + if v == nil { + v149v2 = nil + } else { + v149v2 = make(map[uint64]uint8, len(v)) + } // reset map + var v149v3, v149v4 typMapMapUint64Uint8 + v149v3 = typMapMapUint64Uint8(v149v1) + v149v4 = typMapMapUint64Uint8(v149v2) + bs149 = testMarshalErr(v149v3, h, t, "enc-map-v149-custom") + testUnmarshalErr(v149v4, bs149, h, t, "dec-map-v149-p-len") + testDeepEqualErr(v149v3, v149v4, t, "equal-map-v149-p-len") + } + + for _, v := range []map[uint64]uint16{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v150: %v\n", v) + var v150v1, v150v2 map[uint64]uint16 + v150v1 = v + bs150 := testMarshalErr(v150v1, h, t, "enc-map-v150") + if v == nil { + v150v2 = nil + } else { + v150v2 = make(map[uint64]uint16, len(v)) + } // reset map + testUnmarshalErr(v150v2, bs150, h, t, "dec-map-v150") + testDeepEqualErr(v150v1, v150v2, t, "equal-map-v150") + if v == nil { + v150v2 = nil + } else { + v150v2 = make(map[uint64]uint16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v150v2), bs150, h, t, "dec-map-v150-noaddr") // decode into non-addressable map value + testDeepEqualErr(v150v1, v150v2, t, "equal-map-v150-noaddr") + if v == nil { + v150v2 = nil + } else { + v150v2 = make(map[uint64]uint16, len(v)) + } // reset map + testUnmarshalErr(&v150v2, bs150, h, t, "dec-map-v150-p-len") + testDeepEqualErr(v150v1, v150v2, t, "equal-map-v150-p-len") + bs150 = testMarshalErr(&v150v1, h, t, "enc-map-v150-p") + v150v2 = nil + testUnmarshalErr(&v150v2, bs150, h, t, "dec-map-v150-p-nil") + testDeepEqualErr(v150v1, v150v2, t, "equal-map-v150-p-nil") + // ... + if v == nil { + v150v2 = nil + } else { + v150v2 = make(map[uint64]uint16, len(v)) + } // reset map + var v150v3, v150v4 typMapMapUint64Uint16 + v150v3 = typMapMapUint64Uint16(v150v1) + v150v4 = typMapMapUint64Uint16(v150v2) + bs150 = testMarshalErr(v150v3, h, t, "enc-map-v150-custom") + testUnmarshalErr(v150v4, bs150, h, t, "dec-map-v150-p-len") + testDeepEqualErr(v150v3, v150v4, t, "equal-map-v150-p-len") + } + + for _, v := range []map[uint64]uint32{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v151: %v\n", v) + var v151v1, v151v2 map[uint64]uint32 + v151v1 = v + bs151 := testMarshalErr(v151v1, h, t, "enc-map-v151") + if v == nil { + v151v2 = nil + } else { + v151v2 = make(map[uint64]uint32, len(v)) + } // reset map + testUnmarshalErr(v151v2, bs151, h, t, "dec-map-v151") + testDeepEqualErr(v151v1, v151v2, t, "equal-map-v151") + if v == nil { + v151v2 = nil + } else { + v151v2 = make(map[uint64]uint32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v151v2), bs151, h, t, "dec-map-v151-noaddr") // decode into non-addressable map value + testDeepEqualErr(v151v1, v151v2, t, "equal-map-v151-noaddr") + if v == nil { + v151v2 = nil + } else { + v151v2 = make(map[uint64]uint32, len(v)) + } // reset map + testUnmarshalErr(&v151v2, bs151, h, t, "dec-map-v151-p-len") + testDeepEqualErr(v151v1, v151v2, t, "equal-map-v151-p-len") + bs151 = testMarshalErr(&v151v1, h, t, "enc-map-v151-p") + v151v2 = nil + testUnmarshalErr(&v151v2, bs151, h, t, "dec-map-v151-p-nil") + testDeepEqualErr(v151v1, v151v2, t, "equal-map-v151-p-nil") + // ... + if v == nil { + v151v2 = nil + } else { + v151v2 = make(map[uint64]uint32, len(v)) + } // reset map + var v151v3, v151v4 typMapMapUint64Uint32 + v151v3 = typMapMapUint64Uint32(v151v1) + v151v4 = typMapMapUint64Uint32(v151v2) + bs151 = testMarshalErr(v151v3, h, t, "enc-map-v151-custom") + testUnmarshalErr(v151v4, bs151, h, t, "dec-map-v151-p-len") + testDeepEqualErr(v151v3, v151v4, t, "equal-map-v151-p-len") + } + + for _, v := range []map[uint64]uint64{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v152: %v\n", v) + var v152v1, v152v2 map[uint64]uint64 + v152v1 = v + bs152 := testMarshalErr(v152v1, h, t, "enc-map-v152") + if v == nil { + v152v2 = nil + } else { + v152v2 = make(map[uint64]uint64, len(v)) + } // reset map + testUnmarshalErr(v152v2, bs152, h, t, "dec-map-v152") + testDeepEqualErr(v152v1, v152v2, t, "equal-map-v152") + if v == nil { + v152v2 = nil + } else { + v152v2 = make(map[uint64]uint64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v152v2), bs152, h, t, "dec-map-v152-noaddr") // decode into non-addressable map value + testDeepEqualErr(v152v1, v152v2, t, "equal-map-v152-noaddr") + if v == nil { + v152v2 = nil + } else { + v152v2 = make(map[uint64]uint64, len(v)) + } // reset map + testUnmarshalErr(&v152v2, bs152, h, t, "dec-map-v152-p-len") + testDeepEqualErr(v152v1, v152v2, t, "equal-map-v152-p-len") + bs152 = testMarshalErr(&v152v1, h, t, "enc-map-v152-p") + v152v2 = nil + testUnmarshalErr(&v152v2, bs152, h, t, "dec-map-v152-p-nil") + testDeepEqualErr(v152v1, v152v2, t, "equal-map-v152-p-nil") + // ... + if v == nil { + v152v2 = nil + } else { + v152v2 = make(map[uint64]uint64, len(v)) + } // reset map + var v152v3, v152v4 typMapMapUint64Uint64 + v152v3 = typMapMapUint64Uint64(v152v1) + v152v4 = typMapMapUint64Uint64(v152v2) + bs152 = testMarshalErr(v152v3, h, t, "enc-map-v152-custom") + testUnmarshalErr(v152v4, bs152, h, t, "dec-map-v152-p-len") + testDeepEqualErr(v152v3, v152v4, t, "equal-map-v152-p-len") + } + + for _, v := range []map[uint64]uintptr{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v153: %v\n", v) + var v153v1, v153v2 map[uint64]uintptr + v153v1 = v + bs153 := testMarshalErr(v153v1, h, t, "enc-map-v153") + if v == nil { + v153v2 = nil + } else { + v153v2 = make(map[uint64]uintptr, len(v)) + } // reset map + testUnmarshalErr(v153v2, bs153, h, t, "dec-map-v153") + testDeepEqualErr(v153v1, v153v2, t, "equal-map-v153") + if v == nil { + v153v2 = nil + } else { + v153v2 = make(map[uint64]uintptr, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v153v2), bs153, h, t, "dec-map-v153-noaddr") // decode into non-addressable map value + testDeepEqualErr(v153v1, v153v2, t, "equal-map-v153-noaddr") + if v == nil { + v153v2 = nil + } else { + v153v2 = make(map[uint64]uintptr, len(v)) + } // reset map + testUnmarshalErr(&v153v2, bs153, h, t, "dec-map-v153-p-len") + testDeepEqualErr(v153v1, v153v2, t, "equal-map-v153-p-len") + bs153 = testMarshalErr(&v153v1, h, t, "enc-map-v153-p") + v153v2 = nil + testUnmarshalErr(&v153v2, bs153, h, t, "dec-map-v153-p-nil") + testDeepEqualErr(v153v1, v153v2, t, "equal-map-v153-p-nil") + // ... + if v == nil { + v153v2 = nil + } else { + v153v2 = make(map[uint64]uintptr, len(v)) + } // reset map + var v153v3, v153v4 typMapMapUint64Uintptr + v153v3 = typMapMapUint64Uintptr(v153v1) + v153v4 = typMapMapUint64Uintptr(v153v2) + bs153 = testMarshalErr(v153v3, h, t, "enc-map-v153-custom") + testUnmarshalErr(v153v4, bs153, h, t, "dec-map-v153-p-len") + testDeepEqualErr(v153v3, v153v4, t, "equal-map-v153-p-len") + } + + for _, v := range []map[uint64]int{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v154: %v\n", v) + var v154v1, v154v2 map[uint64]int + v154v1 = v + bs154 := testMarshalErr(v154v1, h, t, "enc-map-v154") + if v == nil { + v154v2 = nil + } else { + v154v2 = make(map[uint64]int, len(v)) + } // reset map + testUnmarshalErr(v154v2, bs154, h, t, "dec-map-v154") + testDeepEqualErr(v154v1, v154v2, t, "equal-map-v154") + if v == nil { + v154v2 = nil + } else { + v154v2 = make(map[uint64]int, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v154v2), bs154, h, t, "dec-map-v154-noaddr") // decode into non-addressable map value + testDeepEqualErr(v154v1, v154v2, t, "equal-map-v154-noaddr") + if v == nil { + v154v2 = nil + } else { + v154v2 = make(map[uint64]int, len(v)) + } // reset map + testUnmarshalErr(&v154v2, bs154, h, t, "dec-map-v154-p-len") + testDeepEqualErr(v154v1, v154v2, t, "equal-map-v154-p-len") + bs154 = testMarshalErr(&v154v1, h, t, "enc-map-v154-p") + v154v2 = nil + testUnmarshalErr(&v154v2, bs154, h, t, "dec-map-v154-p-nil") + testDeepEqualErr(v154v1, v154v2, t, "equal-map-v154-p-nil") + // ... + if v == nil { + v154v2 = nil + } else { + v154v2 = make(map[uint64]int, len(v)) + } // reset map + var v154v3, v154v4 typMapMapUint64Int + v154v3 = typMapMapUint64Int(v154v1) + v154v4 = typMapMapUint64Int(v154v2) + bs154 = testMarshalErr(v154v3, h, t, "enc-map-v154-custom") + testUnmarshalErr(v154v4, bs154, h, t, "dec-map-v154-p-len") + testDeepEqualErr(v154v3, v154v4, t, "equal-map-v154-p-len") + } + + for _, v := range []map[uint64]int8{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v155: %v\n", v) + var v155v1, v155v2 map[uint64]int8 + v155v1 = v + bs155 := testMarshalErr(v155v1, h, t, "enc-map-v155") + if v == nil { + v155v2 = nil + } else { + v155v2 = make(map[uint64]int8, len(v)) + } // reset map + testUnmarshalErr(v155v2, bs155, h, t, "dec-map-v155") + testDeepEqualErr(v155v1, v155v2, t, "equal-map-v155") + if v == nil { + v155v2 = nil + } else { + v155v2 = make(map[uint64]int8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v155v2), bs155, h, t, "dec-map-v155-noaddr") // decode into non-addressable map value + testDeepEqualErr(v155v1, v155v2, t, "equal-map-v155-noaddr") + if v == nil { + v155v2 = nil + } else { + v155v2 = make(map[uint64]int8, len(v)) + } // reset map + testUnmarshalErr(&v155v2, bs155, h, t, "dec-map-v155-p-len") + testDeepEqualErr(v155v1, v155v2, t, "equal-map-v155-p-len") + bs155 = testMarshalErr(&v155v1, h, t, "enc-map-v155-p") + v155v2 = nil + testUnmarshalErr(&v155v2, bs155, h, t, "dec-map-v155-p-nil") + testDeepEqualErr(v155v1, v155v2, t, "equal-map-v155-p-nil") + // ... + if v == nil { + v155v2 = nil + } else { + v155v2 = make(map[uint64]int8, len(v)) + } // reset map + var v155v3, v155v4 typMapMapUint64Int8 + v155v3 = typMapMapUint64Int8(v155v1) + v155v4 = typMapMapUint64Int8(v155v2) + bs155 = testMarshalErr(v155v3, h, t, "enc-map-v155-custom") + testUnmarshalErr(v155v4, bs155, h, t, "dec-map-v155-p-len") + testDeepEqualErr(v155v3, v155v4, t, "equal-map-v155-p-len") + } + + for _, v := range []map[uint64]int16{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v156: %v\n", v) + var v156v1, v156v2 map[uint64]int16 + v156v1 = v + bs156 := testMarshalErr(v156v1, h, t, "enc-map-v156") + if v == nil { + v156v2 = nil + } else { + v156v2 = make(map[uint64]int16, len(v)) + } // reset map + testUnmarshalErr(v156v2, bs156, h, t, "dec-map-v156") + testDeepEqualErr(v156v1, v156v2, t, "equal-map-v156") + if v == nil { + v156v2 = nil + } else { + v156v2 = make(map[uint64]int16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v156v2), bs156, h, t, "dec-map-v156-noaddr") // decode into non-addressable map value + testDeepEqualErr(v156v1, v156v2, t, "equal-map-v156-noaddr") + if v == nil { + v156v2 = nil + } else { + v156v2 = make(map[uint64]int16, len(v)) + } // reset map + testUnmarshalErr(&v156v2, bs156, h, t, "dec-map-v156-p-len") + testDeepEqualErr(v156v1, v156v2, t, "equal-map-v156-p-len") + bs156 = testMarshalErr(&v156v1, h, t, "enc-map-v156-p") + v156v2 = nil + testUnmarshalErr(&v156v2, bs156, h, t, "dec-map-v156-p-nil") + testDeepEqualErr(v156v1, v156v2, t, "equal-map-v156-p-nil") + // ... + if v == nil { + v156v2 = nil + } else { + v156v2 = make(map[uint64]int16, len(v)) + } // reset map + var v156v3, v156v4 typMapMapUint64Int16 + v156v3 = typMapMapUint64Int16(v156v1) + v156v4 = typMapMapUint64Int16(v156v2) + bs156 = testMarshalErr(v156v3, h, t, "enc-map-v156-custom") + testUnmarshalErr(v156v4, bs156, h, t, "dec-map-v156-p-len") + testDeepEqualErr(v156v3, v156v4, t, "equal-map-v156-p-len") + } + + for _, v := range []map[uint64]int32{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v157: %v\n", v) + var v157v1, v157v2 map[uint64]int32 + v157v1 = v + bs157 := testMarshalErr(v157v1, h, t, "enc-map-v157") + if v == nil { + v157v2 = nil + } else { + v157v2 = make(map[uint64]int32, len(v)) + } // reset map + testUnmarshalErr(v157v2, bs157, h, t, "dec-map-v157") + testDeepEqualErr(v157v1, v157v2, t, "equal-map-v157") + if v == nil { + v157v2 = nil + } else { + v157v2 = make(map[uint64]int32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v157v2), bs157, h, t, "dec-map-v157-noaddr") // decode into non-addressable map value + testDeepEqualErr(v157v1, v157v2, t, "equal-map-v157-noaddr") + if v == nil { + v157v2 = nil + } else { + v157v2 = make(map[uint64]int32, len(v)) + } // reset map + testUnmarshalErr(&v157v2, bs157, h, t, "dec-map-v157-p-len") + testDeepEqualErr(v157v1, v157v2, t, "equal-map-v157-p-len") + bs157 = testMarshalErr(&v157v1, h, t, "enc-map-v157-p") + v157v2 = nil + testUnmarshalErr(&v157v2, bs157, h, t, "dec-map-v157-p-nil") + testDeepEqualErr(v157v1, v157v2, t, "equal-map-v157-p-nil") + // ... + if v == nil { + v157v2 = nil + } else { + v157v2 = make(map[uint64]int32, len(v)) + } // reset map + var v157v3, v157v4 typMapMapUint64Int32 + v157v3 = typMapMapUint64Int32(v157v1) + v157v4 = typMapMapUint64Int32(v157v2) + bs157 = testMarshalErr(v157v3, h, t, "enc-map-v157-custom") + testUnmarshalErr(v157v4, bs157, h, t, "dec-map-v157-p-len") + testDeepEqualErr(v157v3, v157v4, t, "equal-map-v157-p-len") + } + + for _, v := range []map[uint64]int64{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v158: %v\n", v) + var v158v1, v158v2 map[uint64]int64 + v158v1 = v + bs158 := testMarshalErr(v158v1, h, t, "enc-map-v158") + if v == nil { + v158v2 = nil + } else { + v158v2 = make(map[uint64]int64, len(v)) + } // reset map + testUnmarshalErr(v158v2, bs158, h, t, "dec-map-v158") + testDeepEqualErr(v158v1, v158v2, t, "equal-map-v158") + if v == nil { + v158v2 = nil + } else { + v158v2 = make(map[uint64]int64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v158v2), bs158, h, t, "dec-map-v158-noaddr") // decode into non-addressable map value + testDeepEqualErr(v158v1, v158v2, t, "equal-map-v158-noaddr") + if v == nil { + v158v2 = nil + } else { + v158v2 = make(map[uint64]int64, len(v)) + } // reset map + testUnmarshalErr(&v158v2, bs158, h, t, "dec-map-v158-p-len") + testDeepEqualErr(v158v1, v158v2, t, "equal-map-v158-p-len") + bs158 = testMarshalErr(&v158v1, h, t, "enc-map-v158-p") + v158v2 = nil + testUnmarshalErr(&v158v2, bs158, h, t, "dec-map-v158-p-nil") + testDeepEqualErr(v158v1, v158v2, t, "equal-map-v158-p-nil") + // ... + if v == nil { + v158v2 = nil + } else { + v158v2 = make(map[uint64]int64, len(v)) + } // reset map + var v158v3, v158v4 typMapMapUint64Int64 + v158v3 = typMapMapUint64Int64(v158v1) + v158v4 = typMapMapUint64Int64(v158v2) + bs158 = testMarshalErr(v158v3, h, t, "enc-map-v158-custom") + testUnmarshalErr(v158v4, bs158, h, t, "dec-map-v158-p-len") + testDeepEqualErr(v158v3, v158v4, t, "equal-map-v158-p-len") + } + + for _, v := range []map[uint64]float32{nil, {}, {33: 0, 44: 22.2}} { + // fmt.Printf(">>>> running mammoth map v159: %v\n", v) + var v159v1, v159v2 map[uint64]float32 + v159v1 = v + bs159 := testMarshalErr(v159v1, h, t, "enc-map-v159") + if v == nil { + v159v2 = nil + } else { + v159v2 = make(map[uint64]float32, len(v)) + } // reset map + testUnmarshalErr(v159v2, bs159, h, t, "dec-map-v159") + testDeepEqualErr(v159v1, v159v2, t, "equal-map-v159") + if v == nil { + v159v2 = nil + } else { + v159v2 = make(map[uint64]float32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v159v2), bs159, h, t, "dec-map-v159-noaddr") // decode into non-addressable map value + testDeepEqualErr(v159v1, v159v2, t, "equal-map-v159-noaddr") + if v == nil { + v159v2 = nil + } else { + v159v2 = make(map[uint64]float32, len(v)) + } // reset map + testUnmarshalErr(&v159v2, bs159, h, t, "dec-map-v159-p-len") + testDeepEqualErr(v159v1, v159v2, t, "equal-map-v159-p-len") + bs159 = testMarshalErr(&v159v1, h, t, "enc-map-v159-p") + v159v2 = nil + testUnmarshalErr(&v159v2, bs159, h, t, "dec-map-v159-p-nil") + testDeepEqualErr(v159v1, v159v2, t, "equal-map-v159-p-nil") + // ... + if v == nil { + v159v2 = nil + } else { + v159v2 = make(map[uint64]float32, len(v)) + } // reset map + var v159v3, v159v4 typMapMapUint64Float32 + v159v3 = typMapMapUint64Float32(v159v1) + v159v4 = typMapMapUint64Float32(v159v2) + bs159 = testMarshalErr(v159v3, h, t, "enc-map-v159-custom") + testUnmarshalErr(v159v4, bs159, h, t, "dec-map-v159-p-len") + testDeepEqualErr(v159v3, v159v4, t, "equal-map-v159-p-len") + } + + for _, v := range []map[uint64]float64{nil, {}, {33: 0, 44: 11.1}} { + // fmt.Printf(">>>> running mammoth map v160: %v\n", v) + var v160v1, v160v2 map[uint64]float64 + v160v1 = v + bs160 := testMarshalErr(v160v1, h, t, "enc-map-v160") + if v == nil { + v160v2 = nil + } else { + v160v2 = make(map[uint64]float64, len(v)) + } // reset map + testUnmarshalErr(v160v2, bs160, h, t, "dec-map-v160") + testDeepEqualErr(v160v1, v160v2, t, "equal-map-v160") + if v == nil { + v160v2 = nil + } else { + v160v2 = make(map[uint64]float64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v160v2), bs160, h, t, "dec-map-v160-noaddr") // decode into non-addressable map value + testDeepEqualErr(v160v1, v160v2, t, "equal-map-v160-noaddr") + if v == nil { + v160v2 = nil + } else { + v160v2 = make(map[uint64]float64, len(v)) + } // reset map + testUnmarshalErr(&v160v2, bs160, h, t, "dec-map-v160-p-len") + testDeepEqualErr(v160v1, v160v2, t, "equal-map-v160-p-len") + bs160 = testMarshalErr(&v160v1, h, t, "enc-map-v160-p") + v160v2 = nil + testUnmarshalErr(&v160v2, bs160, h, t, "dec-map-v160-p-nil") + testDeepEqualErr(v160v1, v160v2, t, "equal-map-v160-p-nil") + // ... + if v == nil { + v160v2 = nil + } else { + v160v2 = make(map[uint64]float64, len(v)) + } // reset map + var v160v3, v160v4 typMapMapUint64Float64 + v160v3 = typMapMapUint64Float64(v160v1) + v160v4 = typMapMapUint64Float64(v160v2) + bs160 = testMarshalErr(v160v3, h, t, "enc-map-v160-custom") + testUnmarshalErr(v160v4, bs160, h, t, "dec-map-v160-p-len") + testDeepEqualErr(v160v3, v160v4, t, "equal-map-v160-p-len") + } + + for _, v := range []map[uint64]bool{nil, {}, {33: false, 44: true}} { + // fmt.Printf(">>>> running mammoth map v161: %v\n", v) + var v161v1, v161v2 map[uint64]bool + v161v1 = v + bs161 := testMarshalErr(v161v1, h, t, "enc-map-v161") + if v == nil { + v161v2 = nil + } else { + v161v2 = make(map[uint64]bool, len(v)) + } // reset map + testUnmarshalErr(v161v2, bs161, h, t, "dec-map-v161") + testDeepEqualErr(v161v1, v161v2, t, "equal-map-v161") + if v == nil { + v161v2 = nil + } else { + v161v2 = make(map[uint64]bool, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v161v2), bs161, h, t, "dec-map-v161-noaddr") // decode into non-addressable map value + testDeepEqualErr(v161v1, v161v2, t, "equal-map-v161-noaddr") + if v == nil { + v161v2 = nil + } else { + v161v2 = make(map[uint64]bool, len(v)) + } // reset map + testUnmarshalErr(&v161v2, bs161, h, t, "dec-map-v161-p-len") + testDeepEqualErr(v161v1, v161v2, t, "equal-map-v161-p-len") + bs161 = testMarshalErr(&v161v1, h, t, "enc-map-v161-p") + v161v2 = nil + testUnmarshalErr(&v161v2, bs161, h, t, "dec-map-v161-p-nil") + testDeepEqualErr(v161v1, v161v2, t, "equal-map-v161-p-nil") + // ... + if v == nil { + v161v2 = nil + } else { + v161v2 = make(map[uint64]bool, len(v)) + } // reset map + var v161v3, v161v4 typMapMapUint64Bool + v161v3 = typMapMapUint64Bool(v161v1) + v161v4 = typMapMapUint64Bool(v161v2) + bs161 = testMarshalErr(v161v3, h, t, "enc-map-v161-custom") + testUnmarshalErr(v161v4, bs161, h, t, "dec-map-v161-p-len") + testDeepEqualErr(v161v3, v161v4, t, "equal-map-v161-p-len") + } + + for _, v := range []map[uintptr]interface{}{nil, {}, {33: nil, 44: "string-is-an-interface"}} { + // fmt.Printf(">>>> running mammoth map v164: %v\n", v) + var v164v1, v164v2 map[uintptr]interface{} + v164v1 = v + bs164 := testMarshalErr(v164v1, h, t, "enc-map-v164") + if v == nil { + v164v2 = nil + } else { + v164v2 = make(map[uintptr]interface{}, len(v)) + } // reset map + testUnmarshalErr(v164v2, bs164, h, t, "dec-map-v164") + testDeepEqualErr(v164v1, v164v2, t, "equal-map-v164") + if v == nil { + v164v2 = nil + } else { + v164v2 = make(map[uintptr]interface{}, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v164v2), bs164, h, t, "dec-map-v164-noaddr") // decode into non-addressable map value + testDeepEqualErr(v164v1, v164v2, t, "equal-map-v164-noaddr") + if v == nil { + v164v2 = nil + } else { + v164v2 = make(map[uintptr]interface{}, len(v)) + } // reset map + testUnmarshalErr(&v164v2, bs164, h, t, "dec-map-v164-p-len") + testDeepEqualErr(v164v1, v164v2, t, "equal-map-v164-p-len") + bs164 = testMarshalErr(&v164v1, h, t, "enc-map-v164-p") + v164v2 = nil + testUnmarshalErr(&v164v2, bs164, h, t, "dec-map-v164-p-nil") + testDeepEqualErr(v164v1, v164v2, t, "equal-map-v164-p-nil") + // ... + if v == nil { + v164v2 = nil + } else { + v164v2 = make(map[uintptr]interface{}, len(v)) + } // reset map + var v164v3, v164v4 typMapMapUintptrIntf + v164v3 = typMapMapUintptrIntf(v164v1) + v164v4 = typMapMapUintptrIntf(v164v2) + bs164 = testMarshalErr(v164v3, h, t, "enc-map-v164-custom") + testUnmarshalErr(v164v4, bs164, h, t, "dec-map-v164-p-len") + testDeepEqualErr(v164v3, v164v4, t, "equal-map-v164-p-len") + } + + for _, v := range []map[uintptr]string{nil, {}, {33: "", 44: "some-string"}} { + // fmt.Printf(">>>> running mammoth map v165: %v\n", v) + var v165v1, v165v2 map[uintptr]string + v165v1 = v + bs165 := testMarshalErr(v165v1, h, t, "enc-map-v165") + if v == nil { + v165v2 = nil + } else { + v165v2 = make(map[uintptr]string, len(v)) + } // reset map + testUnmarshalErr(v165v2, bs165, h, t, "dec-map-v165") + testDeepEqualErr(v165v1, v165v2, t, "equal-map-v165") + if v == nil { + v165v2 = nil + } else { + v165v2 = make(map[uintptr]string, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v165v2), bs165, h, t, "dec-map-v165-noaddr") // decode into non-addressable map value + testDeepEqualErr(v165v1, v165v2, t, "equal-map-v165-noaddr") + if v == nil { + v165v2 = nil + } else { + v165v2 = make(map[uintptr]string, len(v)) + } // reset map + testUnmarshalErr(&v165v2, bs165, h, t, "dec-map-v165-p-len") + testDeepEqualErr(v165v1, v165v2, t, "equal-map-v165-p-len") + bs165 = testMarshalErr(&v165v1, h, t, "enc-map-v165-p") + v165v2 = nil + testUnmarshalErr(&v165v2, bs165, h, t, "dec-map-v165-p-nil") + testDeepEqualErr(v165v1, v165v2, t, "equal-map-v165-p-nil") + // ... + if v == nil { + v165v2 = nil + } else { + v165v2 = make(map[uintptr]string, len(v)) + } // reset map + var v165v3, v165v4 typMapMapUintptrString + v165v3 = typMapMapUintptrString(v165v1) + v165v4 = typMapMapUintptrString(v165v2) + bs165 = testMarshalErr(v165v3, h, t, "enc-map-v165-custom") + testUnmarshalErr(v165v4, bs165, h, t, "dec-map-v165-p-len") + testDeepEqualErr(v165v3, v165v4, t, "equal-map-v165-p-len") + } + + for _, v := range []map[uintptr]uint{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v166: %v\n", v) + var v166v1, v166v2 map[uintptr]uint + v166v1 = v + bs166 := testMarshalErr(v166v1, h, t, "enc-map-v166") + if v == nil { + v166v2 = nil + } else { + v166v2 = make(map[uintptr]uint, len(v)) + } // reset map + testUnmarshalErr(v166v2, bs166, h, t, "dec-map-v166") + testDeepEqualErr(v166v1, v166v2, t, "equal-map-v166") + if v == nil { + v166v2 = nil + } else { + v166v2 = make(map[uintptr]uint, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v166v2), bs166, h, t, "dec-map-v166-noaddr") // decode into non-addressable map value + testDeepEqualErr(v166v1, v166v2, t, "equal-map-v166-noaddr") + if v == nil { + v166v2 = nil + } else { + v166v2 = make(map[uintptr]uint, len(v)) + } // reset map + testUnmarshalErr(&v166v2, bs166, h, t, "dec-map-v166-p-len") + testDeepEqualErr(v166v1, v166v2, t, "equal-map-v166-p-len") + bs166 = testMarshalErr(&v166v1, h, t, "enc-map-v166-p") + v166v2 = nil + testUnmarshalErr(&v166v2, bs166, h, t, "dec-map-v166-p-nil") + testDeepEqualErr(v166v1, v166v2, t, "equal-map-v166-p-nil") + // ... + if v == nil { + v166v2 = nil + } else { + v166v2 = make(map[uintptr]uint, len(v)) + } // reset map + var v166v3, v166v4 typMapMapUintptrUint + v166v3 = typMapMapUintptrUint(v166v1) + v166v4 = typMapMapUintptrUint(v166v2) + bs166 = testMarshalErr(v166v3, h, t, "enc-map-v166-custom") + testUnmarshalErr(v166v4, bs166, h, t, "dec-map-v166-p-len") + testDeepEqualErr(v166v3, v166v4, t, "equal-map-v166-p-len") + } + + for _, v := range []map[uintptr]uint8{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v167: %v\n", v) + var v167v1, v167v2 map[uintptr]uint8 + v167v1 = v + bs167 := testMarshalErr(v167v1, h, t, "enc-map-v167") + if v == nil { + v167v2 = nil + } else { + v167v2 = make(map[uintptr]uint8, len(v)) + } // reset map + testUnmarshalErr(v167v2, bs167, h, t, "dec-map-v167") + testDeepEqualErr(v167v1, v167v2, t, "equal-map-v167") + if v == nil { + v167v2 = nil + } else { + v167v2 = make(map[uintptr]uint8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v167v2), bs167, h, t, "dec-map-v167-noaddr") // decode into non-addressable map value + testDeepEqualErr(v167v1, v167v2, t, "equal-map-v167-noaddr") + if v == nil { + v167v2 = nil + } else { + v167v2 = make(map[uintptr]uint8, len(v)) + } // reset map + testUnmarshalErr(&v167v2, bs167, h, t, "dec-map-v167-p-len") + testDeepEqualErr(v167v1, v167v2, t, "equal-map-v167-p-len") + bs167 = testMarshalErr(&v167v1, h, t, "enc-map-v167-p") + v167v2 = nil + testUnmarshalErr(&v167v2, bs167, h, t, "dec-map-v167-p-nil") + testDeepEqualErr(v167v1, v167v2, t, "equal-map-v167-p-nil") + // ... + if v == nil { + v167v2 = nil + } else { + v167v2 = make(map[uintptr]uint8, len(v)) + } // reset map + var v167v3, v167v4 typMapMapUintptrUint8 + v167v3 = typMapMapUintptrUint8(v167v1) + v167v4 = typMapMapUintptrUint8(v167v2) + bs167 = testMarshalErr(v167v3, h, t, "enc-map-v167-custom") + testUnmarshalErr(v167v4, bs167, h, t, "dec-map-v167-p-len") + testDeepEqualErr(v167v3, v167v4, t, "equal-map-v167-p-len") + } + + for _, v := range []map[uintptr]uint16{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v168: %v\n", v) + var v168v1, v168v2 map[uintptr]uint16 + v168v1 = v + bs168 := testMarshalErr(v168v1, h, t, "enc-map-v168") + if v == nil { + v168v2 = nil + } else { + v168v2 = make(map[uintptr]uint16, len(v)) + } // reset map + testUnmarshalErr(v168v2, bs168, h, t, "dec-map-v168") + testDeepEqualErr(v168v1, v168v2, t, "equal-map-v168") + if v == nil { + v168v2 = nil + } else { + v168v2 = make(map[uintptr]uint16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v168v2), bs168, h, t, "dec-map-v168-noaddr") // decode into non-addressable map value + testDeepEqualErr(v168v1, v168v2, t, "equal-map-v168-noaddr") + if v == nil { + v168v2 = nil + } else { + v168v2 = make(map[uintptr]uint16, len(v)) + } // reset map + testUnmarshalErr(&v168v2, bs168, h, t, "dec-map-v168-p-len") + testDeepEqualErr(v168v1, v168v2, t, "equal-map-v168-p-len") + bs168 = testMarshalErr(&v168v1, h, t, "enc-map-v168-p") + v168v2 = nil + testUnmarshalErr(&v168v2, bs168, h, t, "dec-map-v168-p-nil") + testDeepEqualErr(v168v1, v168v2, t, "equal-map-v168-p-nil") + // ... + if v == nil { + v168v2 = nil + } else { + v168v2 = make(map[uintptr]uint16, len(v)) + } // reset map + var v168v3, v168v4 typMapMapUintptrUint16 + v168v3 = typMapMapUintptrUint16(v168v1) + v168v4 = typMapMapUintptrUint16(v168v2) + bs168 = testMarshalErr(v168v3, h, t, "enc-map-v168-custom") + testUnmarshalErr(v168v4, bs168, h, t, "dec-map-v168-p-len") + testDeepEqualErr(v168v3, v168v4, t, "equal-map-v168-p-len") + } + + for _, v := range []map[uintptr]uint32{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v169: %v\n", v) + var v169v1, v169v2 map[uintptr]uint32 + v169v1 = v + bs169 := testMarshalErr(v169v1, h, t, "enc-map-v169") + if v == nil { + v169v2 = nil + } else { + v169v2 = make(map[uintptr]uint32, len(v)) + } // reset map + testUnmarshalErr(v169v2, bs169, h, t, "dec-map-v169") + testDeepEqualErr(v169v1, v169v2, t, "equal-map-v169") + if v == nil { + v169v2 = nil + } else { + v169v2 = make(map[uintptr]uint32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v169v2), bs169, h, t, "dec-map-v169-noaddr") // decode into non-addressable map value + testDeepEqualErr(v169v1, v169v2, t, "equal-map-v169-noaddr") + if v == nil { + v169v2 = nil + } else { + v169v2 = make(map[uintptr]uint32, len(v)) + } // reset map + testUnmarshalErr(&v169v2, bs169, h, t, "dec-map-v169-p-len") + testDeepEqualErr(v169v1, v169v2, t, "equal-map-v169-p-len") + bs169 = testMarshalErr(&v169v1, h, t, "enc-map-v169-p") + v169v2 = nil + testUnmarshalErr(&v169v2, bs169, h, t, "dec-map-v169-p-nil") + testDeepEqualErr(v169v1, v169v2, t, "equal-map-v169-p-nil") + // ... + if v == nil { + v169v2 = nil + } else { + v169v2 = make(map[uintptr]uint32, len(v)) + } // reset map + var v169v3, v169v4 typMapMapUintptrUint32 + v169v3 = typMapMapUintptrUint32(v169v1) + v169v4 = typMapMapUintptrUint32(v169v2) + bs169 = testMarshalErr(v169v3, h, t, "enc-map-v169-custom") + testUnmarshalErr(v169v4, bs169, h, t, "dec-map-v169-p-len") + testDeepEqualErr(v169v3, v169v4, t, "equal-map-v169-p-len") + } + + for _, v := range []map[uintptr]uint64{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v170: %v\n", v) + var v170v1, v170v2 map[uintptr]uint64 + v170v1 = v + bs170 := testMarshalErr(v170v1, h, t, "enc-map-v170") + if v == nil { + v170v2 = nil + } else { + v170v2 = make(map[uintptr]uint64, len(v)) + } // reset map + testUnmarshalErr(v170v2, bs170, h, t, "dec-map-v170") + testDeepEqualErr(v170v1, v170v2, t, "equal-map-v170") + if v == nil { + v170v2 = nil + } else { + v170v2 = make(map[uintptr]uint64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v170v2), bs170, h, t, "dec-map-v170-noaddr") // decode into non-addressable map value + testDeepEqualErr(v170v1, v170v2, t, "equal-map-v170-noaddr") + if v == nil { + v170v2 = nil + } else { + v170v2 = make(map[uintptr]uint64, len(v)) + } // reset map + testUnmarshalErr(&v170v2, bs170, h, t, "dec-map-v170-p-len") + testDeepEqualErr(v170v1, v170v2, t, "equal-map-v170-p-len") + bs170 = testMarshalErr(&v170v1, h, t, "enc-map-v170-p") + v170v2 = nil + testUnmarshalErr(&v170v2, bs170, h, t, "dec-map-v170-p-nil") + testDeepEqualErr(v170v1, v170v2, t, "equal-map-v170-p-nil") + // ... + if v == nil { + v170v2 = nil + } else { + v170v2 = make(map[uintptr]uint64, len(v)) + } // reset map + var v170v3, v170v4 typMapMapUintptrUint64 + v170v3 = typMapMapUintptrUint64(v170v1) + v170v4 = typMapMapUintptrUint64(v170v2) + bs170 = testMarshalErr(v170v3, h, t, "enc-map-v170-custom") + testUnmarshalErr(v170v4, bs170, h, t, "dec-map-v170-p-len") + testDeepEqualErr(v170v3, v170v4, t, "equal-map-v170-p-len") + } + + for _, v := range []map[uintptr]uintptr{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v171: %v\n", v) + var v171v1, v171v2 map[uintptr]uintptr + v171v1 = v + bs171 := testMarshalErr(v171v1, h, t, "enc-map-v171") + if v == nil { + v171v2 = nil + } else { + v171v2 = make(map[uintptr]uintptr, len(v)) + } // reset map + testUnmarshalErr(v171v2, bs171, h, t, "dec-map-v171") + testDeepEqualErr(v171v1, v171v2, t, "equal-map-v171") + if v == nil { + v171v2 = nil + } else { + v171v2 = make(map[uintptr]uintptr, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v171v2), bs171, h, t, "dec-map-v171-noaddr") // decode into non-addressable map value + testDeepEqualErr(v171v1, v171v2, t, "equal-map-v171-noaddr") + if v == nil { + v171v2 = nil + } else { + v171v2 = make(map[uintptr]uintptr, len(v)) + } // reset map + testUnmarshalErr(&v171v2, bs171, h, t, "dec-map-v171-p-len") + testDeepEqualErr(v171v1, v171v2, t, "equal-map-v171-p-len") + bs171 = testMarshalErr(&v171v1, h, t, "enc-map-v171-p") + v171v2 = nil + testUnmarshalErr(&v171v2, bs171, h, t, "dec-map-v171-p-nil") + testDeepEqualErr(v171v1, v171v2, t, "equal-map-v171-p-nil") + // ... + if v == nil { + v171v2 = nil + } else { + v171v2 = make(map[uintptr]uintptr, len(v)) + } // reset map + var v171v3, v171v4 typMapMapUintptrUintptr + v171v3 = typMapMapUintptrUintptr(v171v1) + v171v4 = typMapMapUintptrUintptr(v171v2) + bs171 = testMarshalErr(v171v3, h, t, "enc-map-v171-custom") + testUnmarshalErr(v171v4, bs171, h, t, "dec-map-v171-p-len") + testDeepEqualErr(v171v3, v171v4, t, "equal-map-v171-p-len") + } + + for _, v := range []map[uintptr]int{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v172: %v\n", v) + var v172v1, v172v2 map[uintptr]int + v172v1 = v + bs172 := testMarshalErr(v172v1, h, t, "enc-map-v172") + if v == nil { + v172v2 = nil + } else { + v172v2 = make(map[uintptr]int, len(v)) + } // reset map + testUnmarshalErr(v172v2, bs172, h, t, "dec-map-v172") + testDeepEqualErr(v172v1, v172v2, t, "equal-map-v172") + if v == nil { + v172v2 = nil + } else { + v172v2 = make(map[uintptr]int, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v172v2), bs172, h, t, "dec-map-v172-noaddr") // decode into non-addressable map value + testDeepEqualErr(v172v1, v172v2, t, "equal-map-v172-noaddr") + if v == nil { + v172v2 = nil + } else { + v172v2 = make(map[uintptr]int, len(v)) + } // reset map + testUnmarshalErr(&v172v2, bs172, h, t, "dec-map-v172-p-len") + testDeepEqualErr(v172v1, v172v2, t, "equal-map-v172-p-len") + bs172 = testMarshalErr(&v172v1, h, t, "enc-map-v172-p") + v172v2 = nil + testUnmarshalErr(&v172v2, bs172, h, t, "dec-map-v172-p-nil") + testDeepEqualErr(v172v1, v172v2, t, "equal-map-v172-p-nil") + // ... + if v == nil { + v172v2 = nil + } else { + v172v2 = make(map[uintptr]int, len(v)) + } // reset map + var v172v3, v172v4 typMapMapUintptrInt + v172v3 = typMapMapUintptrInt(v172v1) + v172v4 = typMapMapUintptrInt(v172v2) + bs172 = testMarshalErr(v172v3, h, t, "enc-map-v172-custom") + testUnmarshalErr(v172v4, bs172, h, t, "dec-map-v172-p-len") + testDeepEqualErr(v172v3, v172v4, t, "equal-map-v172-p-len") + } + + for _, v := range []map[uintptr]int8{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v173: %v\n", v) + var v173v1, v173v2 map[uintptr]int8 + v173v1 = v + bs173 := testMarshalErr(v173v1, h, t, "enc-map-v173") + if v == nil { + v173v2 = nil + } else { + v173v2 = make(map[uintptr]int8, len(v)) + } // reset map + testUnmarshalErr(v173v2, bs173, h, t, "dec-map-v173") + testDeepEqualErr(v173v1, v173v2, t, "equal-map-v173") + if v == nil { + v173v2 = nil + } else { + v173v2 = make(map[uintptr]int8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v173v2), bs173, h, t, "dec-map-v173-noaddr") // decode into non-addressable map value + testDeepEqualErr(v173v1, v173v2, t, "equal-map-v173-noaddr") + if v == nil { + v173v2 = nil + } else { + v173v2 = make(map[uintptr]int8, len(v)) + } // reset map + testUnmarshalErr(&v173v2, bs173, h, t, "dec-map-v173-p-len") + testDeepEqualErr(v173v1, v173v2, t, "equal-map-v173-p-len") + bs173 = testMarshalErr(&v173v1, h, t, "enc-map-v173-p") + v173v2 = nil + testUnmarshalErr(&v173v2, bs173, h, t, "dec-map-v173-p-nil") + testDeepEqualErr(v173v1, v173v2, t, "equal-map-v173-p-nil") + // ... + if v == nil { + v173v2 = nil + } else { + v173v2 = make(map[uintptr]int8, len(v)) + } // reset map + var v173v3, v173v4 typMapMapUintptrInt8 + v173v3 = typMapMapUintptrInt8(v173v1) + v173v4 = typMapMapUintptrInt8(v173v2) + bs173 = testMarshalErr(v173v3, h, t, "enc-map-v173-custom") + testUnmarshalErr(v173v4, bs173, h, t, "dec-map-v173-p-len") + testDeepEqualErr(v173v3, v173v4, t, "equal-map-v173-p-len") + } + + for _, v := range []map[uintptr]int16{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v174: %v\n", v) + var v174v1, v174v2 map[uintptr]int16 + v174v1 = v + bs174 := testMarshalErr(v174v1, h, t, "enc-map-v174") + if v == nil { + v174v2 = nil + } else { + v174v2 = make(map[uintptr]int16, len(v)) + } // reset map + testUnmarshalErr(v174v2, bs174, h, t, "dec-map-v174") + testDeepEqualErr(v174v1, v174v2, t, "equal-map-v174") + if v == nil { + v174v2 = nil + } else { + v174v2 = make(map[uintptr]int16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v174v2), bs174, h, t, "dec-map-v174-noaddr") // decode into non-addressable map value + testDeepEqualErr(v174v1, v174v2, t, "equal-map-v174-noaddr") + if v == nil { + v174v2 = nil + } else { + v174v2 = make(map[uintptr]int16, len(v)) + } // reset map + testUnmarshalErr(&v174v2, bs174, h, t, "dec-map-v174-p-len") + testDeepEqualErr(v174v1, v174v2, t, "equal-map-v174-p-len") + bs174 = testMarshalErr(&v174v1, h, t, "enc-map-v174-p") + v174v2 = nil + testUnmarshalErr(&v174v2, bs174, h, t, "dec-map-v174-p-nil") + testDeepEqualErr(v174v1, v174v2, t, "equal-map-v174-p-nil") + // ... + if v == nil { + v174v2 = nil + } else { + v174v2 = make(map[uintptr]int16, len(v)) + } // reset map + var v174v3, v174v4 typMapMapUintptrInt16 + v174v3 = typMapMapUintptrInt16(v174v1) + v174v4 = typMapMapUintptrInt16(v174v2) + bs174 = testMarshalErr(v174v3, h, t, "enc-map-v174-custom") + testUnmarshalErr(v174v4, bs174, h, t, "dec-map-v174-p-len") + testDeepEqualErr(v174v3, v174v4, t, "equal-map-v174-p-len") + } + + for _, v := range []map[uintptr]int32{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v175: %v\n", v) + var v175v1, v175v2 map[uintptr]int32 + v175v1 = v + bs175 := testMarshalErr(v175v1, h, t, "enc-map-v175") + if v == nil { + v175v2 = nil + } else { + v175v2 = make(map[uintptr]int32, len(v)) + } // reset map + testUnmarshalErr(v175v2, bs175, h, t, "dec-map-v175") + testDeepEqualErr(v175v1, v175v2, t, "equal-map-v175") + if v == nil { + v175v2 = nil + } else { + v175v2 = make(map[uintptr]int32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v175v2), bs175, h, t, "dec-map-v175-noaddr") // decode into non-addressable map value + testDeepEqualErr(v175v1, v175v2, t, "equal-map-v175-noaddr") + if v == nil { + v175v2 = nil + } else { + v175v2 = make(map[uintptr]int32, len(v)) + } // reset map + testUnmarshalErr(&v175v2, bs175, h, t, "dec-map-v175-p-len") + testDeepEqualErr(v175v1, v175v2, t, "equal-map-v175-p-len") + bs175 = testMarshalErr(&v175v1, h, t, "enc-map-v175-p") + v175v2 = nil + testUnmarshalErr(&v175v2, bs175, h, t, "dec-map-v175-p-nil") + testDeepEqualErr(v175v1, v175v2, t, "equal-map-v175-p-nil") + // ... + if v == nil { + v175v2 = nil + } else { + v175v2 = make(map[uintptr]int32, len(v)) + } // reset map + var v175v3, v175v4 typMapMapUintptrInt32 + v175v3 = typMapMapUintptrInt32(v175v1) + v175v4 = typMapMapUintptrInt32(v175v2) + bs175 = testMarshalErr(v175v3, h, t, "enc-map-v175-custom") + testUnmarshalErr(v175v4, bs175, h, t, "dec-map-v175-p-len") + testDeepEqualErr(v175v3, v175v4, t, "equal-map-v175-p-len") + } + + for _, v := range []map[uintptr]int64{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v176: %v\n", v) + var v176v1, v176v2 map[uintptr]int64 + v176v1 = v + bs176 := testMarshalErr(v176v1, h, t, "enc-map-v176") + if v == nil { + v176v2 = nil + } else { + v176v2 = make(map[uintptr]int64, len(v)) + } // reset map + testUnmarshalErr(v176v2, bs176, h, t, "dec-map-v176") + testDeepEqualErr(v176v1, v176v2, t, "equal-map-v176") + if v == nil { + v176v2 = nil + } else { + v176v2 = make(map[uintptr]int64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v176v2), bs176, h, t, "dec-map-v176-noaddr") // decode into non-addressable map value + testDeepEqualErr(v176v1, v176v2, t, "equal-map-v176-noaddr") + if v == nil { + v176v2 = nil + } else { + v176v2 = make(map[uintptr]int64, len(v)) + } // reset map + testUnmarshalErr(&v176v2, bs176, h, t, "dec-map-v176-p-len") + testDeepEqualErr(v176v1, v176v2, t, "equal-map-v176-p-len") + bs176 = testMarshalErr(&v176v1, h, t, "enc-map-v176-p") + v176v2 = nil + testUnmarshalErr(&v176v2, bs176, h, t, "dec-map-v176-p-nil") + testDeepEqualErr(v176v1, v176v2, t, "equal-map-v176-p-nil") + // ... + if v == nil { + v176v2 = nil + } else { + v176v2 = make(map[uintptr]int64, len(v)) + } // reset map + var v176v3, v176v4 typMapMapUintptrInt64 + v176v3 = typMapMapUintptrInt64(v176v1) + v176v4 = typMapMapUintptrInt64(v176v2) + bs176 = testMarshalErr(v176v3, h, t, "enc-map-v176-custom") + testUnmarshalErr(v176v4, bs176, h, t, "dec-map-v176-p-len") + testDeepEqualErr(v176v3, v176v4, t, "equal-map-v176-p-len") + } + + for _, v := range []map[uintptr]float32{nil, {}, {44: 0, 33: 22.2}} { + // fmt.Printf(">>>> running mammoth map v177: %v\n", v) + var v177v1, v177v2 map[uintptr]float32 + v177v1 = v + bs177 := testMarshalErr(v177v1, h, t, "enc-map-v177") + if v == nil { + v177v2 = nil + } else { + v177v2 = make(map[uintptr]float32, len(v)) + } // reset map + testUnmarshalErr(v177v2, bs177, h, t, "dec-map-v177") + testDeepEqualErr(v177v1, v177v2, t, "equal-map-v177") + if v == nil { + v177v2 = nil + } else { + v177v2 = make(map[uintptr]float32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v177v2), bs177, h, t, "dec-map-v177-noaddr") // decode into non-addressable map value + testDeepEqualErr(v177v1, v177v2, t, "equal-map-v177-noaddr") + if v == nil { + v177v2 = nil + } else { + v177v2 = make(map[uintptr]float32, len(v)) + } // reset map + testUnmarshalErr(&v177v2, bs177, h, t, "dec-map-v177-p-len") + testDeepEqualErr(v177v1, v177v2, t, "equal-map-v177-p-len") + bs177 = testMarshalErr(&v177v1, h, t, "enc-map-v177-p") + v177v2 = nil + testUnmarshalErr(&v177v2, bs177, h, t, "dec-map-v177-p-nil") + testDeepEqualErr(v177v1, v177v2, t, "equal-map-v177-p-nil") + // ... + if v == nil { + v177v2 = nil + } else { + v177v2 = make(map[uintptr]float32, len(v)) + } // reset map + var v177v3, v177v4 typMapMapUintptrFloat32 + v177v3 = typMapMapUintptrFloat32(v177v1) + v177v4 = typMapMapUintptrFloat32(v177v2) + bs177 = testMarshalErr(v177v3, h, t, "enc-map-v177-custom") + testUnmarshalErr(v177v4, bs177, h, t, "dec-map-v177-p-len") + testDeepEqualErr(v177v3, v177v4, t, "equal-map-v177-p-len") + } + + for _, v := range []map[uintptr]float64{nil, {}, {44: 0, 33: 11.1}} { + // fmt.Printf(">>>> running mammoth map v178: %v\n", v) + var v178v1, v178v2 map[uintptr]float64 + v178v1 = v + bs178 := testMarshalErr(v178v1, h, t, "enc-map-v178") + if v == nil { + v178v2 = nil + } else { + v178v2 = make(map[uintptr]float64, len(v)) + } // reset map + testUnmarshalErr(v178v2, bs178, h, t, "dec-map-v178") + testDeepEqualErr(v178v1, v178v2, t, "equal-map-v178") + if v == nil { + v178v2 = nil + } else { + v178v2 = make(map[uintptr]float64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v178v2), bs178, h, t, "dec-map-v178-noaddr") // decode into non-addressable map value + testDeepEqualErr(v178v1, v178v2, t, "equal-map-v178-noaddr") + if v == nil { + v178v2 = nil + } else { + v178v2 = make(map[uintptr]float64, len(v)) + } // reset map + testUnmarshalErr(&v178v2, bs178, h, t, "dec-map-v178-p-len") + testDeepEqualErr(v178v1, v178v2, t, "equal-map-v178-p-len") + bs178 = testMarshalErr(&v178v1, h, t, "enc-map-v178-p") + v178v2 = nil + testUnmarshalErr(&v178v2, bs178, h, t, "dec-map-v178-p-nil") + testDeepEqualErr(v178v1, v178v2, t, "equal-map-v178-p-nil") + // ... + if v == nil { + v178v2 = nil + } else { + v178v2 = make(map[uintptr]float64, len(v)) + } // reset map + var v178v3, v178v4 typMapMapUintptrFloat64 + v178v3 = typMapMapUintptrFloat64(v178v1) + v178v4 = typMapMapUintptrFloat64(v178v2) + bs178 = testMarshalErr(v178v3, h, t, "enc-map-v178-custom") + testUnmarshalErr(v178v4, bs178, h, t, "dec-map-v178-p-len") + testDeepEqualErr(v178v3, v178v4, t, "equal-map-v178-p-len") + } + + for _, v := range []map[uintptr]bool{nil, {}, {44: false, 33: true}} { + // fmt.Printf(">>>> running mammoth map v179: %v\n", v) + var v179v1, v179v2 map[uintptr]bool + v179v1 = v + bs179 := testMarshalErr(v179v1, h, t, "enc-map-v179") + if v == nil { + v179v2 = nil + } else { + v179v2 = make(map[uintptr]bool, len(v)) + } // reset map + testUnmarshalErr(v179v2, bs179, h, t, "dec-map-v179") + testDeepEqualErr(v179v1, v179v2, t, "equal-map-v179") + if v == nil { + v179v2 = nil + } else { + v179v2 = make(map[uintptr]bool, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v179v2), bs179, h, t, "dec-map-v179-noaddr") // decode into non-addressable map value + testDeepEqualErr(v179v1, v179v2, t, "equal-map-v179-noaddr") + if v == nil { + v179v2 = nil + } else { + v179v2 = make(map[uintptr]bool, len(v)) + } // reset map + testUnmarshalErr(&v179v2, bs179, h, t, "dec-map-v179-p-len") + testDeepEqualErr(v179v1, v179v2, t, "equal-map-v179-p-len") + bs179 = testMarshalErr(&v179v1, h, t, "enc-map-v179-p") + v179v2 = nil + testUnmarshalErr(&v179v2, bs179, h, t, "dec-map-v179-p-nil") + testDeepEqualErr(v179v1, v179v2, t, "equal-map-v179-p-nil") + // ... + if v == nil { + v179v2 = nil + } else { + v179v2 = make(map[uintptr]bool, len(v)) + } // reset map + var v179v3, v179v4 typMapMapUintptrBool + v179v3 = typMapMapUintptrBool(v179v1) + v179v4 = typMapMapUintptrBool(v179v2) + bs179 = testMarshalErr(v179v3, h, t, "enc-map-v179-custom") + testUnmarshalErr(v179v4, bs179, h, t, "dec-map-v179-p-len") + testDeepEqualErr(v179v3, v179v4, t, "equal-map-v179-p-len") + } + + for _, v := range []map[int]interface{}{nil, {}, {44: nil, 33: "string-is-an-interface-2"}} { + // fmt.Printf(">>>> running mammoth map v182: %v\n", v) + var v182v1, v182v2 map[int]interface{} + v182v1 = v + bs182 := testMarshalErr(v182v1, h, t, "enc-map-v182") + if v == nil { + v182v2 = nil + } else { + v182v2 = make(map[int]interface{}, len(v)) + } // reset map + testUnmarshalErr(v182v2, bs182, h, t, "dec-map-v182") + testDeepEqualErr(v182v1, v182v2, t, "equal-map-v182") + if v == nil { + v182v2 = nil + } else { + v182v2 = make(map[int]interface{}, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v182v2), bs182, h, t, "dec-map-v182-noaddr") // decode into non-addressable map value + testDeepEqualErr(v182v1, v182v2, t, "equal-map-v182-noaddr") + if v == nil { + v182v2 = nil + } else { + v182v2 = make(map[int]interface{}, len(v)) + } // reset map + testUnmarshalErr(&v182v2, bs182, h, t, "dec-map-v182-p-len") + testDeepEqualErr(v182v1, v182v2, t, "equal-map-v182-p-len") + bs182 = testMarshalErr(&v182v1, h, t, "enc-map-v182-p") + v182v2 = nil + testUnmarshalErr(&v182v2, bs182, h, t, "dec-map-v182-p-nil") + testDeepEqualErr(v182v1, v182v2, t, "equal-map-v182-p-nil") + // ... + if v == nil { + v182v2 = nil + } else { + v182v2 = make(map[int]interface{}, len(v)) + } // reset map + var v182v3, v182v4 typMapMapIntIntf + v182v3 = typMapMapIntIntf(v182v1) + v182v4 = typMapMapIntIntf(v182v2) + bs182 = testMarshalErr(v182v3, h, t, "enc-map-v182-custom") + testUnmarshalErr(v182v4, bs182, h, t, "dec-map-v182-p-len") + testDeepEqualErr(v182v3, v182v4, t, "equal-map-v182-p-len") + } + + for _, v := range []map[int]string{nil, {}, {44: "", 33: "some-string-2"}} { + // fmt.Printf(">>>> running mammoth map v183: %v\n", v) + var v183v1, v183v2 map[int]string + v183v1 = v + bs183 := testMarshalErr(v183v1, h, t, "enc-map-v183") + if v == nil { + v183v2 = nil + } else { + v183v2 = make(map[int]string, len(v)) + } // reset map + testUnmarshalErr(v183v2, bs183, h, t, "dec-map-v183") + testDeepEqualErr(v183v1, v183v2, t, "equal-map-v183") + if v == nil { + v183v2 = nil + } else { + v183v2 = make(map[int]string, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v183v2), bs183, h, t, "dec-map-v183-noaddr") // decode into non-addressable map value + testDeepEqualErr(v183v1, v183v2, t, "equal-map-v183-noaddr") + if v == nil { + v183v2 = nil + } else { + v183v2 = make(map[int]string, len(v)) + } // reset map + testUnmarshalErr(&v183v2, bs183, h, t, "dec-map-v183-p-len") + testDeepEqualErr(v183v1, v183v2, t, "equal-map-v183-p-len") + bs183 = testMarshalErr(&v183v1, h, t, "enc-map-v183-p") + v183v2 = nil + testUnmarshalErr(&v183v2, bs183, h, t, "dec-map-v183-p-nil") + testDeepEqualErr(v183v1, v183v2, t, "equal-map-v183-p-nil") + // ... + if v == nil { + v183v2 = nil + } else { + v183v2 = make(map[int]string, len(v)) + } // reset map + var v183v3, v183v4 typMapMapIntString + v183v3 = typMapMapIntString(v183v1) + v183v4 = typMapMapIntString(v183v2) + bs183 = testMarshalErr(v183v3, h, t, "enc-map-v183-custom") + testUnmarshalErr(v183v4, bs183, h, t, "dec-map-v183-p-len") + testDeepEqualErr(v183v3, v183v4, t, "equal-map-v183-p-len") + } + + for _, v := range []map[int]uint{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v184: %v\n", v) + var v184v1, v184v2 map[int]uint + v184v1 = v + bs184 := testMarshalErr(v184v1, h, t, "enc-map-v184") + if v == nil { + v184v2 = nil + } else { + v184v2 = make(map[int]uint, len(v)) + } // reset map + testUnmarshalErr(v184v2, bs184, h, t, "dec-map-v184") + testDeepEqualErr(v184v1, v184v2, t, "equal-map-v184") + if v == nil { + v184v2 = nil + } else { + v184v2 = make(map[int]uint, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v184v2), bs184, h, t, "dec-map-v184-noaddr") // decode into non-addressable map value + testDeepEqualErr(v184v1, v184v2, t, "equal-map-v184-noaddr") + if v == nil { + v184v2 = nil + } else { + v184v2 = make(map[int]uint, len(v)) + } // reset map + testUnmarshalErr(&v184v2, bs184, h, t, "dec-map-v184-p-len") + testDeepEqualErr(v184v1, v184v2, t, "equal-map-v184-p-len") + bs184 = testMarshalErr(&v184v1, h, t, "enc-map-v184-p") + v184v2 = nil + testUnmarshalErr(&v184v2, bs184, h, t, "dec-map-v184-p-nil") + testDeepEqualErr(v184v1, v184v2, t, "equal-map-v184-p-nil") + // ... + if v == nil { + v184v2 = nil + } else { + v184v2 = make(map[int]uint, len(v)) + } // reset map + var v184v3, v184v4 typMapMapIntUint + v184v3 = typMapMapIntUint(v184v1) + v184v4 = typMapMapIntUint(v184v2) + bs184 = testMarshalErr(v184v3, h, t, "enc-map-v184-custom") + testUnmarshalErr(v184v4, bs184, h, t, "dec-map-v184-p-len") + testDeepEqualErr(v184v3, v184v4, t, "equal-map-v184-p-len") + } + + for _, v := range []map[int]uint8{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v185: %v\n", v) + var v185v1, v185v2 map[int]uint8 + v185v1 = v + bs185 := testMarshalErr(v185v1, h, t, "enc-map-v185") + if v == nil { + v185v2 = nil + } else { + v185v2 = make(map[int]uint8, len(v)) + } // reset map + testUnmarshalErr(v185v2, bs185, h, t, "dec-map-v185") + testDeepEqualErr(v185v1, v185v2, t, "equal-map-v185") + if v == nil { + v185v2 = nil + } else { + v185v2 = make(map[int]uint8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v185v2), bs185, h, t, "dec-map-v185-noaddr") // decode into non-addressable map value + testDeepEqualErr(v185v1, v185v2, t, "equal-map-v185-noaddr") + if v == nil { + v185v2 = nil + } else { + v185v2 = make(map[int]uint8, len(v)) + } // reset map + testUnmarshalErr(&v185v2, bs185, h, t, "dec-map-v185-p-len") + testDeepEqualErr(v185v1, v185v2, t, "equal-map-v185-p-len") + bs185 = testMarshalErr(&v185v1, h, t, "enc-map-v185-p") + v185v2 = nil + testUnmarshalErr(&v185v2, bs185, h, t, "dec-map-v185-p-nil") + testDeepEqualErr(v185v1, v185v2, t, "equal-map-v185-p-nil") + // ... + if v == nil { + v185v2 = nil + } else { + v185v2 = make(map[int]uint8, len(v)) + } // reset map + var v185v3, v185v4 typMapMapIntUint8 + v185v3 = typMapMapIntUint8(v185v1) + v185v4 = typMapMapIntUint8(v185v2) + bs185 = testMarshalErr(v185v3, h, t, "enc-map-v185-custom") + testUnmarshalErr(v185v4, bs185, h, t, "dec-map-v185-p-len") + testDeepEqualErr(v185v3, v185v4, t, "equal-map-v185-p-len") + } + + for _, v := range []map[int]uint16{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v186: %v\n", v) + var v186v1, v186v2 map[int]uint16 + v186v1 = v + bs186 := testMarshalErr(v186v1, h, t, "enc-map-v186") + if v == nil { + v186v2 = nil + } else { + v186v2 = make(map[int]uint16, len(v)) + } // reset map + testUnmarshalErr(v186v2, bs186, h, t, "dec-map-v186") + testDeepEqualErr(v186v1, v186v2, t, "equal-map-v186") + if v == nil { + v186v2 = nil + } else { + v186v2 = make(map[int]uint16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v186v2), bs186, h, t, "dec-map-v186-noaddr") // decode into non-addressable map value + testDeepEqualErr(v186v1, v186v2, t, "equal-map-v186-noaddr") + if v == nil { + v186v2 = nil + } else { + v186v2 = make(map[int]uint16, len(v)) + } // reset map + testUnmarshalErr(&v186v2, bs186, h, t, "dec-map-v186-p-len") + testDeepEqualErr(v186v1, v186v2, t, "equal-map-v186-p-len") + bs186 = testMarshalErr(&v186v1, h, t, "enc-map-v186-p") + v186v2 = nil + testUnmarshalErr(&v186v2, bs186, h, t, "dec-map-v186-p-nil") + testDeepEqualErr(v186v1, v186v2, t, "equal-map-v186-p-nil") + // ... + if v == nil { + v186v2 = nil + } else { + v186v2 = make(map[int]uint16, len(v)) + } // reset map + var v186v3, v186v4 typMapMapIntUint16 + v186v3 = typMapMapIntUint16(v186v1) + v186v4 = typMapMapIntUint16(v186v2) + bs186 = testMarshalErr(v186v3, h, t, "enc-map-v186-custom") + testUnmarshalErr(v186v4, bs186, h, t, "dec-map-v186-p-len") + testDeepEqualErr(v186v3, v186v4, t, "equal-map-v186-p-len") + } + + for _, v := range []map[int]uint32{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v187: %v\n", v) + var v187v1, v187v2 map[int]uint32 + v187v1 = v + bs187 := testMarshalErr(v187v1, h, t, "enc-map-v187") + if v == nil { + v187v2 = nil + } else { + v187v2 = make(map[int]uint32, len(v)) + } // reset map + testUnmarshalErr(v187v2, bs187, h, t, "dec-map-v187") + testDeepEqualErr(v187v1, v187v2, t, "equal-map-v187") + if v == nil { + v187v2 = nil + } else { + v187v2 = make(map[int]uint32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v187v2), bs187, h, t, "dec-map-v187-noaddr") // decode into non-addressable map value + testDeepEqualErr(v187v1, v187v2, t, "equal-map-v187-noaddr") + if v == nil { + v187v2 = nil + } else { + v187v2 = make(map[int]uint32, len(v)) + } // reset map + testUnmarshalErr(&v187v2, bs187, h, t, "dec-map-v187-p-len") + testDeepEqualErr(v187v1, v187v2, t, "equal-map-v187-p-len") + bs187 = testMarshalErr(&v187v1, h, t, "enc-map-v187-p") + v187v2 = nil + testUnmarshalErr(&v187v2, bs187, h, t, "dec-map-v187-p-nil") + testDeepEqualErr(v187v1, v187v2, t, "equal-map-v187-p-nil") + // ... + if v == nil { + v187v2 = nil + } else { + v187v2 = make(map[int]uint32, len(v)) + } // reset map + var v187v3, v187v4 typMapMapIntUint32 + v187v3 = typMapMapIntUint32(v187v1) + v187v4 = typMapMapIntUint32(v187v2) + bs187 = testMarshalErr(v187v3, h, t, "enc-map-v187-custom") + testUnmarshalErr(v187v4, bs187, h, t, "dec-map-v187-p-len") + testDeepEqualErr(v187v3, v187v4, t, "equal-map-v187-p-len") + } + + for _, v := range []map[int]uint64{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v188: %v\n", v) + var v188v1, v188v2 map[int]uint64 + v188v1 = v + bs188 := testMarshalErr(v188v1, h, t, "enc-map-v188") + if v == nil { + v188v2 = nil + } else { + v188v2 = make(map[int]uint64, len(v)) + } // reset map + testUnmarshalErr(v188v2, bs188, h, t, "dec-map-v188") + testDeepEqualErr(v188v1, v188v2, t, "equal-map-v188") + if v == nil { + v188v2 = nil + } else { + v188v2 = make(map[int]uint64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v188v2), bs188, h, t, "dec-map-v188-noaddr") // decode into non-addressable map value + testDeepEqualErr(v188v1, v188v2, t, "equal-map-v188-noaddr") + if v == nil { + v188v2 = nil + } else { + v188v2 = make(map[int]uint64, len(v)) + } // reset map + testUnmarshalErr(&v188v2, bs188, h, t, "dec-map-v188-p-len") + testDeepEqualErr(v188v1, v188v2, t, "equal-map-v188-p-len") + bs188 = testMarshalErr(&v188v1, h, t, "enc-map-v188-p") + v188v2 = nil + testUnmarshalErr(&v188v2, bs188, h, t, "dec-map-v188-p-nil") + testDeepEqualErr(v188v1, v188v2, t, "equal-map-v188-p-nil") + // ... + if v == nil { + v188v2 = nil + } else { + v188v2 = make(map[int]uint64, len(v)) + } // reset map + var v188v3, v188v4 typMapMapIntUint64 + v188v3 = typMapMapIntUint64(v188v1) + v188v4 = typMapMapIntUint64(v188v2) + bs188 = testMarshalErr(v188v3, h, t, "enc-map-v188-custom") + testUnmarshalErr(v188v4, bs188, h, t, "dec-map-v188-p-len") + testDeepEqualErr(v188v3, v188v4, t, "equal-map-v188-p-len") + } + + for _, v := range []map[int]uintptr{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v189: %v\n", v) + var v189v1, v189v2 map[int]uintptr + v189v1 = v + bs189 := testMarshalErr(v189v1, h, t, "enc-map-v189") + if v == nil { + v189v2 = nil + } else { + v189v2 = make(map[int]uintptr, len(v)) + } // reset map + testUnmarshalErr(v189v2, bs189, h, t, "dec-map-v189") + testDeepEqualErr(v189v1, v189v2, t, "equal-map-v189") + if v == nil { + v189v2 = nil + } else { + v189v2 = make(map[int]uintptr, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v189v2), bs189, h, t, "dec-map-v189-noaddr") // decode into non-addressable map value + testDeepEqualErr(v189v1, v189v2, t, "equal-map-v189-noaddr") + if v == nil { + v189v2 = nil + } else { + v189v2 = make(map[int]uintptr, len(v)) + } // reset map + testUnmarshalErr(&v189v2, bs189, h, t, "dec-map-v189-p-len") + testDeepEqualErr(v189v1, v189v2, t, "equal-map-v189-p-len") + bs189 = testMarshalErr(&v189v1, h, t, "enc-map-v189-p") + v189v2 = nil + testUnmarshalErr(&v189v2, bs189, h, t, "dec-map-v189-p-nil") + testDeepEqualErr(v189v1, v189v2, t, "equal-map-v189-p-nil") + // ... + if v == nil { + v189v2 = nil + } else { + v189v2 = make(map[int]uintptr, len(v)) + } // reset map + var v189v3, v189v4 typMapMapIntUintptr + v189v3 = typMapMapIntUintptr(v189v1) + v189v4 = typMapMapIntUintptr(v189v2) + bs189 = testMarshalErr(v189v3, h, t, "enc-map-v189-custom") + testUnmarshalErr(v189v4, bs189, h, t, "dec-map-v189-p-len") + testDeepEqualErr(v189v3, v189v4, t, "equal-map-v189-p-len") + } + + for _, v := range []map[int]int{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v190: %v\n", v) + var v190v1, v190v2 map[int]int + v190v1 = v + bs190 := testMarshalErr(v190v1, h, t, "enc-map-v190") + if v == nil { + v190v2 = nil + } else { + v190v2 = make(map[int]int, len(v)) + } // reset map + testUnmarshalErr(v190v2, bs190, h, t, "dec-map-v190") + testDeepEqualErr(v190v1, v190v2, t, "equal-map-v190") + if v == nil { + v190v2 = nil + } else { + v190v2 = make(map[int]int, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v190v2), bs190, h, t, "dec-map-v190-noaddr") // decode into non-addressable map value + testDeepEqualErr(v190v1, v190v2, t, "equal-map-v190-noaddr") + if v == nil { + v190v2 = nil + } else { + v190v2 = make(map[int]int, len(v)) + } // reset map + testUnmarshalErr(&v190v2, bs190, h, t, "dec-map-v190-p-len") + testDeepEqualErr(v190v1, v190v2, t, "equal-map-v190-p-len") + bs190 = testMarshalErr(&v190v1, h, t, "enc-map-v190-p") + v190v2 = nil + testUnmarshalErr(&v190v2, bs190, h, t, "dec-map-v190-p-nil") + testDeepEqualErr(v190v1, v190v2, t, "equal-map-v190-p-nil") + // ... + if v == nil { + v190v2 = nil + } else { + v190v2 = make(map[int]int, len(v)) + } // reset map + var v190v3, v190v4 typMapMapIntInt + v190v3 = typMapMapIntInt(v190v1) + v190v4 = typMapMapIntInt(v190v2) + bs190 = testMarshalErr(v190v3, h, t, "enc-map-v190-custom") + testUnmarshalErr(v190v4, bs190, h, t, "dec-map-v190-p-len") + testDeepEqualErr(v190v3, v190v4, t, "equal-map-v190-p-len") + } + + for _, v := range []map[int]int8{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v191: %v\n", v) + var v191v1, v191v2 map[int]int8 + v191v1 = v + bs191 := testMarshalErr(v191v1, h, t, "enc-map-v191") + if v == nil { + v191v2 = nil + } else { + v191v2 = make(map[int]int8, len(v)) + } // reset map + testUnmarshalErr(v191v2, bs191, h, t, "dec-map-v191") + testDeepEqualErr(v191v1, v191v2, t, "equal-map-v191") + if v == nil { + v191v2 = nil + } else { + v191v2 = make(map[int]int8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v191v2), bs191, h, t, "dec-map-v191-noaddr") // decode into non-addressable map value + testDeepEqualErr(v191v1, v191v2, t, "equal-map-v191-noaddr") + if v == nil { + v191v2 = nil + } else { + v191v2 = make(map[int]int8, len(v)) + } // reset map + testUnmarshalErr(&v191v2, bs191, h, t, "dec-map-v191-p-len") + testDeepEqualErr(v191v1, v191v2, t, "equal-map-v191-p-len") + bs191 = testMarshalErr(&v191v1, h, t, "enc-map-v191-p") + v191v2 = nil + testUnmarshalErr(&v191v2, bs191, h, t, "dec-map-v191-p-nil") + testDeepEqualErr(v191v1, v191v2, t, "equal-map-v191-p-nil") + // ... + if v == nil { + v191v2 = nil + } else { + v191v2 = make(map[int]int8, len(v)) + } // reset map + var v191v3, v191v4 typMapMapIntInt8 + v191v3 = typMapMapIntInt8(v191v1) + v191v4 = typMapMapIntInt8(v191v2) + bs191 = testMarshalErr(v191v3, h, t, "enc-map-v191-custom") + testUnmarshalErr(v191v4, bs191, h, t, "dec-map-v191-p-len") + testDeepEqualErr(v191v3, v191v4, t, "equal-map-v191-p-len") + } + + for _, v := range []map[int]int16{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v192: %v\n", v) + var v192v1, v192v2 map[int]int16 + v192v1 = v + bs192 := testMarshalErr(v192v1, h, t, "enc-map-v192") + if v == nil { + v192v2 = nil + } else { + v192v2 = make(map[int]int16, len(v)) + } // reset map + testUnmarshalErr(v192v2, bs192, h, t, "dec-map-v192") + testDeepEqualErr(v192v1, v192v2, t, "equal-map-v192") + if v == nil { + v192v2 = nil + } else { + v192v2 = make(map[int]int16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v192v2), bs192, h, t, "dec-map-v192-noaddr") // decode into non-addressable map value + testDeepEqualErr(v192v1, v192v2, t, "equal-map-v192-noaddr") + if v == nil { + v192v2 = nil + } else { + v192v2 = make(map[int]int16, len(v)) + } // reset map + testUnmarshalErr(&v192v2, bs192, h, t, "dec-map-v192-p-len") + testDeepEqualErr(v192v1, v192v2, t, "equal-map-v192-p-len") + bs192 = testMarshalErr(&v192v1, h, t, "enc-map-v192-p") + v192v2 = nil + testUnmarshalErr(&v192v2, bs192, h, t, "dec-map-v192-p-nil") + testDeepEqualErr(v192v1, v192v2, t, "equal-map-v192-p-nil") + // ... + if v == nil { + v192v2 = nil + } else { + v192v2 = make(map[int]int16, len(v)) + } // reset map + var v192v3, v192v4 typMapMapIntInt16 + v192v3 = typMapMapIntInt16(v192v1) + v192v4 = typMapMapIntInt16(v192v2) + bs192 = testMarshalErr(v192v3, h, t, "enc-map-v192-custom") + testUnmarshalErr(v192v4, bs192, h, t, "dec-map-v192-p-len") + testDeepEqualErr(v192v3, v192v4, t, "equal-map-v192-p-len") + } + + for _, v := range []map[int]int32{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v193: %v\n", v) + var v193v1, v193v2 map[int]int32 + v193v1 = v + bs193 := testMarshalErr(v193v1, h, t, "enc-map-v193") + if v == nil { + v193v2 = nil + } else { + v193v2 = make(map[int]int32, len(v)) + } // reset map + testUnmarshalErr(v193v2, bs193, h, t, "dec-map-v193") + testDeepEqualErr(v193v1, v193v2, t, "equal-map-v193") + if v == nil { + v193v2 = nil + } else { + v193v2 = make(map[int]int32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v193v2), bs193, h, t, "dec-map-v193-noaddr") // decode into non-addressable map value + testDeepEqualErr(v193v1, v193v2, t, "equal-map-v193-noaddr") + if v == nil { + v193v2 = nil + } else { + v193v2 = make(map[int]int32, len(v)) + } // reset map + testUnmarshalErr(&v193v2, bs193, h, t, "dec-map-v193-p-len") + testDeepEqualErr(v193v1, v193v2, t, "equal-map-v193-p-len") + bs193 = testMarshalErr(&v193v1, h, t, "enc-map-v193-p") + v193v2 = nil + testUnmarshalErr(&v193v2, bs193, h, t, "dec-map-v193-p-nil") + testDeepEqualErr(v193v1, v193v2, t, "equal-map-v193-p-nil") + // ... + if v == nil { + v193v2 = nil + } else { + v193v2 = make(map[int]int32, len(v)) + } // reset map + var v193v3, v193v4 typMapMapIntInt32 + v193v3 = typMapMapIntInt32(v193v1) + v193v4 = typMapMapIntInt32(v193v2) + bs193 = testMarshalErr(v193v3, h, t, "enc-map-v193-custom") + testUnmarshalErr(v193v4, bs193, h, t, "dec-map-v193-p-len") + testDeepEqualErr(v193v3, v193v4, t, "equal-map-v193-p-len") + } + + for _, v := range []map[int]int64{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v194: %v\n", v) + var v194v1, v194v2 map[int]int64 + v194v1 = v + bs194 := testMarshalErr(v194v1, h, t, "enc-map-v194") + if v == nil { + v194v2 = nil + } else { + v194v2 = make(map[int]int64, len(v)) + } // reset map + testUnmarshalErr(v194v2, bs194, h, t, "dec-map-v194") + testDeepEqualErr(v194v1, v194v2, t, "equal-map-v194") + if v == nil { + v194v2 = nil + } else { + v194v2 = make(map[int]int64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v194v2), bs194, h, t, "dec-map-v194-noaddr") // decode into non-addressable map value + testDeepEqualErr(v194v1, v194v2, t, "equal-map-v194-noaddr") + if v == nil { + v194v2 = nil + } else { + v194v2 = make(map[int]int64, len(v)) + } // reset map + testUnmarshalErr(&v194v2, bs194, h, t, "dec-map-v194-p-len") + testDeepEqualErr(v194v1, v194v2, t, "equal-map-v194-p-len") + bs194 = testMarshalErr(&v194v1, h, t, "enc-map-v194-p") + v194v2 = nil + testUnmarshalErr(&v194v2, bs194, h, t, "dec-map-v194-p-nil") + testDeepEqualErr(v194v1, v194v2, t, "equal-map-v194-p-nil") + // ... + if v == nil { + v194v2 = nil + } else { + v194v2 = make(map[int]int64, len(v)) + } // reset map + var v194v3, v194v4 typMapMapIntInt64 + v194v3 = typMapMapIntInt64(v194v1) + v194v4 = typMapMapIntInt64(v194v2) + bs194 = testMarshalErr(v194v3, h, t, "enc-map-v194-custom") + testUnmarshalErr(v194v4, bs194, h, t, "dec-map-v194-p-len") + testDeepEqualErr(v194v3, v194v4, t, "equal-map-v194-p-len") + } + + for _, v := range []map[int]float32{nil, {}, {33: 0, 44: 22.2}} { + // fmt.Printf(">>>> running mammoth map v195: %v\n", v) + var v195v1, v195v2 map[int]float32 + v195v1 = v + bs195 := testMarshalErr(v195v1, h, t, "enc-map-v195") + if v == nil { + v195v2 = nil + } else { + v195v2 = make(map[int]float32, len(v)) + } // reset map + testUnmarshalErr(v195v2, bs195, h, t, "dec-map-v195") + testDeepEqualErr(v195v1, v195v2, t, "equal-map-v195") + if v == nil { + v195v2 = nil + } else { + v195v2 = make(map[int]float32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v195v2), bs195, h, t, "dec-map-v195-noaddr") // decode into non-addressable map value + testDeepEqualErr(v195v1, v195v2, t, "equal-map-v195-noaddr") + if v == nil { + v195v2 = nil + } else { + v195v2 = make(map[int]float32, len(v)) + } // reset map + testUnmarshalErr(&v195v2, bs195, h, t, "dec-map-v195-p-len") + testDeepEqualErr(v195v1, v195v2, t, "equal-map-v195-p-len") + bs195 = testMarshalErr(&v195v1, h, t, "enc-map-v195-p") + v195v2 = nil + testUnmarshalErr(&v195v2, bs195, h, t, "dec-map-v195-p-nil") + testDeepEqualErr(v195v1, v195v2, t, "equal-map-v195-p-nil") + // ... + if v == nil { + v195v2 = nil + } else { + v195v2 = make(map[int]float32, len(v)) + } // reset map + var v195v3, v195v4 typMapMapIntFloat32 + v195v3 = typMapMapIntFloat32(v195v1) + v195v4 = typMapMapIntFloat32(v195v2) + bs195 = testMarshalErr(v195v3, h, t, "enc-map-v195-custom") + testUnmarshalErr(v195v4, bs195, h, t, "dec-map-v195-p-len") + testDeepEqualErr(v195v3, v195v4, t, "equal-map-v195-p-len") + } + + for _, v := range []map[int]float64{nil, {}, {33: 0, 44: 11.1}} { + // fmt.Printf(">>>> running mammoth map v196: %v\n", v) + var v196v1, v196v2 map[int]float64 + v196v1 = v + bs196 := testMarshalErr(v196v1, h, t, "enc-map-v196") + if v == nil { + v196v2 = nil + } else { + v196v2 = make(map[int]float64, len(v)) + } // reset map + testUnmarshalErr(v196v2, bs196, h, t, "dec-map-v196") + testDeepEqualErr(v196v1, v196v2, t, "equal-map-v196") + if v == nil { + v196v2 = nil + } else { + v196v2 = make(map[int]float64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v196v2), bs196, h, t, "dec-map-v196-noaddr") // decode into non-addressable map value + testDeepEqualErr(v196v1, v196v2, t, "equal-map-v196-noaddr") + if v == nil { + v196v2 = nil + } else { + v196v2 = make(map[int]float64, len(v)) + } // reset map + testUnmarshalErr(&v196v2, bs196, h, t, "dec-map-v196-p-len") + testDeepEqualErr(v196v1, v196v2, t, "equal-map-v196-p-len") + bs196 = testMarshalErr(&v196v1, h, t, "enc-map-v196-p") + v196v2 = nil + testUnmarshalErr(&v196v2, bs196, h, t, "dec-map-v196-p-nil") + testDeepEqualErr(v196v1, v196v2, t, "equal-map-v196-p-nil") + // ... + if v == nil { + v196v2 = nil + } else { + v196v2 = make(map[int]float64, len(v)) + } // reset map + var v196v3, v196v4 typMapMapIntFloat64 + v196v3 = typMapMapIntFloat64(v196v1) + v196v4 = typMapMapIntFloat64(v196v2) + bs196 = testMarshalErr(v196v3, h, t, "enc-map-v196-custom") + testUnmarshalErr(v196v4, bs196, h, t, "dec-map-v196-p-len") + testDeepEqualErr(v196v3, v196v4, t, "equal-map-v196-p-len") + } + + for _, v := range []map[int]bool{nil, {}, {33: false, 44: true}} { + // fmt.Printf(">>>> running mammoth map v197: %v\n", v) + var v197v1, v197v2 map[int]bool + v197v1 = v + bs197 := testMarshalErr(v197v1, h, t, "enc-map-v197") + if v == nil { + v197v2 = nil + } else { + v197v2 = make(map[int]bool, len(v)) + } // reset map + testUnmarshalErr(v197v2, bs197, h, t, "dec-map-v197") + testDeepEqualErr(v197v1, v197v2, t, "equal-map-v197") + if v == nil { + v197v2 = nil + } else { + v197v2 = make(map[int]bool, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v197v2), bs197, h, t, "dec-map-v197-noaddr") // decode into non-addressable map value + testDeepEqualErr(v197v1, v197v2, t, "equal-map-v197-noaddr") + if v == nil { + v197v2 = nil + } else { + v197v2 = make(map[int]bool, len(v)) + } // reset map + testUnmarshalErr(&v197v2, bs197, h, t, "dec-map-v197-p-len") + testDeepEqualErr(v197v1, v197v2, t, "equal-map-v197-p-len") + bs197 = testMarshalErr(&v197v1, h, t, "enc-map-v197-p") + v197v2 = nil + testUnmarshalErr(&v197v2, bs197, h, t, "dec-map-v197-p-nil") + testDeepEqualErr(v197v1, v197v2, t, "equal-map-v197-p-nil") + // ... + if v == nil { + v197v2 = nil + } else { + v197v2 = make(map[int]bool, len(v)) + } // reset map + var v197v3, v197v4 typMapMapIntBool + v197v3 = typMapMapIntBool(v197v1) + v197v4 = typMapMapIntBool(v197v2) + bs197 = testMarshalErr(v197v3, h, t, "enc-map-v197-custom") + testUnmarshalErr(v197v4, bs197, h, t, "dec-map-v197-p-len") + testDeepEqualErr(v197v3, v197v4, t, "equal-map-v197-p-len") + } + + for _, v := range []map[int8]interface{}{nil, {}, {33: nil, 44: "string-is-an-interface"}} { + // fmt.Printf(">>>> running mammoth map v200: %v\n", v) + var v200v1, v200v2 map[int8]interface{} + v200v1 = v + bs200 := testMarshalErr(v200v1, h, t, "enc-map-v200") + if v == nil { + v200v2 = nil + } else { + v200v2 = make(map[int8]interface{}, len(v)) + } // reset map + testUnmarshalErr(v200v2, bs200, h, t, "dec-map-v200") + testDeepEqualErr(v200v1, v200v2, t, "equal-map-v200") + if v == nil { + v200v2 = nil + } else { + v200v2 = make(map[int8]interface{}, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v200v2), bs200, h, t, "dec-map-v200-noaddr") // decode into non-addressable map value + testDeepEqualErr(v200v1, v200v2, t, "equal-map-v200-noaddr") + if v == nil { + v200v2 = nil + } else { + v200v2 = make(map[int8]interface{}, len(v)) + } // reset map + testUnmarshalErr(&v200v2, bs200, h, t, "dec-map-v200-p-len") + testDeepEqualErr(v200v1, v200v2, t, "equal-map-v200-p-len") + bs200 = testMarshalErr(&v200v1, h, t, "enc-map-v200-p") + v200v2 = nil + testUnmarshalErr(&v200v2, bs200, h, t, "dec-map-v200-p-nil") + testDeepEqualErr(v200v1, v200v2, t, "equal-map-v200-p-nil") + // ... + if v == nil { + v200v2 = nil + } else { + v200v2 = make(map[int8]interface{}, len(v)) + } // reset map + var v200v3, v200v4 typMapMapInt8Intf + v200v3 = typMapMapInt8Intf(v200v1) + v200v4 = typMapMapInt8Intf(v200v2) + bs200 = testMarshalErr(v200v3, h, t, "enc-map-v200-custom") + testUnmarshalErr(v200v4, bs200, h, t, "dec-map-v200-p-len") + testDeepEqualErr(v200v3, v200v4, t, "equal-map-v200-p-len") + } + + for _, v := range []map[int8]string{nil, {}, {33: "", 44: "some-string"}} { + // fmt.Printf(">>>> running mammoth map v201: %v\n", v) + var v201v1, v201v2 map[int8]string + v201v1 = v + bs201 := testMarshalErr(v201v1, h, t, "enc-map-v201") + if v == nil { + v201v2 = nil + } else { + v201v2 = make(map[int8]string, len(v)) + } // reset map + testUnmarshalErr(v201v2, bs201, h, t, "dec-map-v201") + testDeepEqualErr(v201v1, v201v2, t, "equal-map-v201") + if v == nil { + v201v2 = nil + } else { + v201v2 = make(map[int8]string, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v201v2), bs201, h, t, "dec-map-v201-noaddr") // decode into non-addressable map value + testDeepEqualErr(v201v1, v201v2, t, "equal-map-v201-noaddr") + if v == nil { + v201v2 = nil + } else { + v201v2 = make(map[int8]string, len(v)) + } // reset map + testUnmarshalErr(&v201v2, bs201, h, t, "dec-map-v201-p-len") + testDeepEqualErr(v201v1, v201v2, t, "equal-map-v201-p-len") + bs201 = testMarshalErr(&v201v1, h, t, "enc-map-v201-p") + v201v2 = nil + testUnmarshalErr(&v201v2, bs201, h, t, "dec-map-v201-p-nil") + testDeepEqualErr(v201v1, v201v2, t, "equal-map-v201-p-nil") + // ... + if v == nil { + v201v2 = nil + } else { + v201v2 = make(map[int8]string, len(v)) + } // reset map + var v201v3, v201v4 typMapMapInt8String + v201v3 = typMapMapInt8String(v201v1) + v201v4 = typMapMapInt8String(v201v2) + bs201 = testMarshalErr(v201v3, h, t, "enc-map-v201-custom") + testUnmarshalErr(v201v4, bs201, h, t, "dec-map-v201-p-len") + testDeepEqualErr(v201v3, v201v4, t, "equal-map-v201-p-len") + } + + for _, v := range []map[int8]uint{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v202: %v\n", v) + var v202v1, v202v2 map[int8]uint + v202v1 = v + bs202 := testMarshalErr(v202v1, h, t, "enc-map-v202") + if v == nil { + v202v2 = nil + } else { + v202v2 = make(map[int8]uint, len(v)) + } // reset map + testUnmarshalErr(v202v2, bs202, h, t, "dec-map-v202") + testDeepEqualErr(v202v1, v202v2, t, "equal-map-v202") + if v == nil { + v202v2 = nil + } else { + v202v2 = make(map[int8]uint, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v202v2), bs202, h, t, "dec-map-v202-noaddr") // decode into non-addressable map value + testDeepEqualErr(v202v1, v202v2, t, "equal-map-v202-noaddr") + if v == nil { + v202v2 = nil + } else { + v202v2 = make(map[int8]uint, len(v)) + } // reset map + testUnmarshalErr(&v202v2, bs202, h, t, "dec-map-v202-p-len") + testDeepEqualErr(v202v1, v202v2, t, "equal-map-v202-p-len") + bs202 = testMarshalErr(&v202v1, h, t, "enc-map-v202-p") + v202v2 = nil + testUnmarshalErr(&v202v2, bs202, h, t, "dec-map-v202-p-nil") + testDeepEqualErr(v202v1, v202v2, t, "equal-map-v202-p-nil") + // ... + if v == nil { + v202v2 = nil + } else { + v202v2 = make(map[int8]uint, len(v)) + } // reset map + var v202v3, v202v4 typMapMapInt8Uint + v202v3 = typMapMapInt8Uint(v202v1) + v202v4 = typMapMapInt8Uint(v202v2) + bs202 = testMarshalErr(v202v3, h, t, "enc-map-v202-custom") + testUnmarshalErr(v202v4, bs202, h, t, "dec-map-v202-p-len") + testDeepEqualErr(v202v3, v202v4, t, "equal-map-v202-p-len") + } + + for _, v := range []map[int8]uint8{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v203: %v\n", v) + var v203v1, v203v2 map[int8]uint8 + v203v1 = v + bs203 := testMarshalErr(v203v1, h, t, "enc-map-v203") + if v == nil { + v203v2 = nil + } else { + v203v2 = make(map[int8]uint8, len(v)) + } // reset map + testUnmarshalErr(v203v2, bs203, h, t, "dec-map-v203") + testDeepEqualErr(v203v1, v203v2, t, "equal-map-v203") + if v == nil { + v203v2 = nil + } else { + v203v2 = make(map[int8]uint8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v203v2), bs203, h, t, "dec-map-v203-noaddr") // decode into non-addressable map value + testDeepEqualErr(v203v1, v203v2, t, "equal-map-v203-noaddr") + if v == nil { + v203v2 = nil + } else { + v203v2 = make(map[int8]uint8, len(v)) + } // reset map + testUnmarshalErr(&v203v2, bs203, h, t, "dec-map-v203-p-len") + testDeepEqualErr(v203v1, v203v2, t, "equal-map-v203-p-len") + bs203 = testMarshalErr(&v203v1, h, t, "enc-map-v203-p") + v203v2 = nil + testUnmarshalErr(&v203v2, bs203, h, t, "dec-map-v203-p-nil") + testDeepEqualErr(v203v1, v203v2, t, "equal-map-v203-p-nil") + // ... + if v == nil { + v203v2 = nil + } else { + v203v2 = make(map[int8]uint8, len(v)) + } // reset map + var v203v3, v203v4 typMapMapInt8Uint8 + v203v3 = typMapMapInt8Uint8(v203v1) + v203v4 = typMapMapInt8Uint8(v203v2) + bs203 = testMarshalErr(v203v3, h, t, "enc-map-v203-custom") + testUnmarshalErr(v203v4, bs203, h, t, "dec-map-v203-p-len") + testDeepEqualErr(v203v3, v203v4, t, "equal-map-v203-p-len") + } + + for _, v := range []map[int8]uint16{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v204: %v\n", v) + var v204v1, v204v2 map[int8]uint16 + v204v1 = v + bs204 := testMarshalErr(v204v1, h, t, "enc-map-v204") + if v == nil { + v204v2 = nil + } else { + v204v2 = make(map[int8]uint16, len(v)) + } // reset map + testUnmarshalErr(v204v2, bs204, h, t, "dec-map-v204") + testDeepEqualErr(v204v1, v204v2, t, "equal-map-v204") + if v == nil { + v204v2 = nil + } else { + v204v2 = make(map[int8]uint16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v204v2), bs204, h, t, "dec-map-v204-noaddr") // decode into non-addressable map value + testDeepEqualErr(v204v1, v204v2, t, "equal-map-v204-noaddr") + if v == nil { + v204v2 = nil + } else { + v204v2 = make(map[int8]uint16, len(v)) + } // reset map + testUnmarshalErr(&v204v2, bs204, h, t, "dec-map-v204-p-len") + testDeepEqualErr(v204v1, v204v2, t, "equal-map-v204-p-len") + bs204 = testMarshalErr(&v204v1, h, t, "enc-map-v204-p") + v204v2 = nil + testUnmarshalErr(&v204v2, bs204, h, t, "dec-map-v204-p-nil") + testDeepEqualErr(v204v1, v204v2, t, "equal-map-v204-p-nil") + // ... + if v == nil { + v204v2 = nil + } else { + v204v2 = make(map[int8]uint16, len(v)) + } // reset map + var v204v3, v204v4 typMapMapInt8Uint16 + v204v3 = typMapMapInt8Uint16(v204v1) + v204v4 = typMapMapInt8Uint16(v204v2) + bs204 = testMarshalErr(v204v3, h, t, "enc-map-v204-custom") + testUnmarshalErr(v204v4, bs204, h, t, "dec-map-v204-p-len") + testDeepEqualErr(v204v3, v204v4, t, "equal-map-v204-p-len") + } + + for _, v := range []map[int8]uint32{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v205: %v\n", v) + var v205v1, v205v2 map[int8]uint32 + v205v1 = v + bs205 := testMarshalErr(v205v1, h, t, "enc-map-v205") + if v == nil { + v205v2 = nil + } else { + v205v2 = make(map[int8]uint32, len(v)) + } // reset map + testUnmarshalErr(v205v2, bs205, h, t, "dec-map-v205") + testDeepEqualErr(v205v1, v205v2, t, "equal-map-v205") + if v == nil { + v205v2 = nil + } else { + v205v2 = make(map[int8]uint32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v205v2), bs205, h, t, "dec-map-v205-noaddr") // decode into non-addressable map value + testDeepEqualErr(v205v1, v205v2, t, "equal-map-v205-noaddr") + if v == nil { + v205v2 = nil + } else { + v205v2 = make(map[int8]uint32, len(v)) + } // reset map + testUnmarshalErr(&v205v2, bs205, h, t, "dec-map-v205-p-len") + testDeepEqualErr(v205v1, v205v2, t, "equal-map-v205-p-len") + bs205 = testMarshalErr(&v205v1, h, t, "enc-map-v205-p") + v205v2 = nil + testUnmarshalErr(&v205v2, bs205, h, t, "dec-map-v205-p-nil") + testDeepEqualErr(v205v1, v205v2, t, "equal-map-v205-p-nil") + // ... + if v == nil { + v205v2 = nil + } else { + v205v2 = make(map[int8]uint32, len(v)) + } // reset map + var v205v3, v205v4 typMapMapInt8Uint32 + v205v3 = typMapMapInt8Uint32(v205v1) + v205v4 = typMapMapInt8Uint32(v205v2) + bs205 = testMarshalErr(v205v3, h, t, "enc-map-v205-custom") + testUnmarshalErr(v205v4, bs205, h, t, "dec-map-v205-p-len") + testDeepEqualErr(v205v3, v205v4, t, "equal-map-v205-p-len") + } + + for _, v := range []map[int8]uint64{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v206: %v\n", v) + var v206v1, v206v2 map[int8]uint64 + v206v1 = v + bs206 := testMarshalErr(v206v1, h, t, "enc-map-v206") + if v == nil { + v206v2 = nil + } else { + v206v2 = make(map[int8]uint64, len(v)) + } // reset map + testUnmarshalErr(v206v2, bs206, h, t, "dec-map-v206") + testDeepEqualErr(v206v1, v206v2, t, "equal-map-v206") + if v == nil { + v206v2 = nil + } else { + v206v2 = make(map[int8]uint64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v206v2), bs206, h, t, "dec-map-v206-noaddr") // decode into non-addressable map value + testDeepEqualErr(v206v1, v206v2, t, "equal-map-v206-noaddr") + if v == nil { + v206v2 = nil + } else { + v206v2 = make(map[int8]uint64, len(v)) + } // reset map + testUnmarshalErr(&v206v2, bs206, h, t, "dec-map-v206-p-len") + testDeepEqualErr(v206v1, v206v2, t, "equal-map-v206-p-len") + bs206 = testMarshalErr(&v206v1, h, t, "enc-map-v206-p") + v206v2 = nil + testUnmarshalErr(&v206v2, bs206, h, t, "dec-map-v206-p-nil") + testDeepEqualErr(v206v1, v206v2, t, "equal-map-v206-p-nil") + // ... + if v == nil { + v206v2 = nil + } else { + v206v2 = make(map[int8]uint64, len(v)) + } // reset map + var v206v3, v206v4 typMapMapInt8Uint64 + v206v3 = typMapMapInt8Uint64(v206v1) + v206v4 = typMapMapInt8Uint64(v206v2) + bs206 = testMarshalErr(v206v3, h, t, "enc-map-v206-custom") + testUnmarshalErr(v206v4, bs206, h, t, "dec-map-v206-p-len") + testDeepEqualErr(v206v3, v206v4, t, "equal-map-v206-p-len") + } + + for _, v := range []map[int8]uintptr{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v207: %v\n", v) + var v207v1, v207v2 map[int8]uintptr + v207v1 = v + bs207 := testMarshalErr(v207v1, h, t, "enc-map-v207") + if v == nil { + v207v2 = nil + } else { + v207v2 = make(map[int8]uintptr, len(v)) + } // reset map + testUnmarshalErr(v207v2, bs207, h, t, "dec-map-v207") + testDeepEqualErr(v207v1, v207v2, t, "equal-map-v207") + if v == nil { + v207v2 = nil + } else { + v207v2 = make(map[int8]uintptr, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v207v2), bs207, h, t, "dec-map-v207-noaddr") // decode into non-addressable map value + testDeepEqualErr(v207v1, v207v2, t, "equal-map-v207-noaddr") + if v == nil { + v207v2 = nil + } else { + v207v2 = make(map[int8]uintptr, len(v)) + } // reset map + testUnmarshalErr(&v207v2, bs207, h, t, "dec-map-v207-p-len") + testDeepEqualErr(v207v1, v207v2, t, "equal-map-v207-p-len") + bs207 = testMarshalErr(&v207v1, h, t, "enc-map-v207-p") + v207v2 = nil + testUnmarshalErr(&v207v2, bs207, h, t, "dec-map-v207-p-nil") + testDeepEqualErr(v207v1, v207v2, t, "equal-map-v207-p-nil") + // ... + if v == nil { + v207v2 = nil + } else { + v207v2 = make(map[int8]uintptr, len(v)) + } // reset map + var v207v3, v207v4 typMapMapInt8Uintptr + v207v3 = typMapMapInt8Uintptr(v207v1) + v207v4 = typMapMapInt8Uintptr(v207v2) + bs207 = testMarshalErr(v207v3, h, t, "enc-map-v207-custom") + testUnmarshalErr(v207v4, bs207, h, t, "dec-map-v207-p-len") + testDeepEqualErr(v207v3, v207v4, t, "equal-map-v207-p-len") + } + + for _, v := range []map[int8]int{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v208: %v\n", v) + var v208v1, v208v2 map[int8]int + v208v1 = v + bs208 := testMarshalErr(v208v1, h, t, "enc-map-v208") + if v == nil { + v208v2 = nil + } else { + v208v2 = make(map[int8]int, len(v)) + } // reset map + testUnmarshalErr(v208v2, bs208, h, t, "dec-map-v208") + testDeepEqualErr(v208v1, v208v2, t, "equal-map-v208") + if v == nil { + v208v2 = nil + } else { + v208v2 = make(map[int8]int, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v208v2), bs208, h, t, "dec-map-v208-noaddr") // decode into non-addressable map value + testDeepEqualErr(v208v1, v208v2, t, "equal-map-v208-noaddr") + if v == nil { + v208v2 = nil + } else { + v208v2 = make(map[int8]int, len(v)) + } // reset map + testUnmarshalErr(&v208v2, bs208, h, t, "dec-map-v208-p-len") + testDeepEqualErr(v208v1, v208v2, t, "equal-map-v208-p-len") + bs208 = testMarshalErr(&v208v1, h, t, "enc-map-v208-p") + v208v2 = nil + testUnmarshalErr(&v208v2, bs208, h, t, "dec-map-v208-p-nil") + testDeepEqualErr(v208v1, v208v2, t, "equal-map-v208-p-nil") + // ... + if v == nil { + v208v2 = nil + } else { + v208v2 = make(map[int8]int, len(v)) + } // reset map + var v208v3, v208v4 typMapMapInt8Int + v208v3 = typMapMapInt8Int(v208v1) + v208v4 = typMapMapInt8Int(v208v2) + bs208 = testMarshalErr(v208v3, h, t, "enc-map-v208-custom") + testUnmarshalErr(v208v4, bs208, h, t, "dec-map-v208-p-len") + testDeepEqualErr(v208v3, v208v4, t, "equal-map-v208-p-len") + } + + for _, v := range []map[int8]int8{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v209: %v\n", v) + var v209v1, v209v2 map[int8]int8 + v209v1 = v + bs209 := testMarshalErr(v209v1, h, t, "enc-map-v209") + if v == nil { + v209v2 = nil + } else { + v209v2 = make(map[int8]int8, len(v)) + } // reset map + testUnmarshalErr(v209v2, bs209, h, t, "dec-map-v209") + testDeepEqualErr(v209v1, v209v2, t, "equal-map-v209") + if v == nil { + v209v2 = nil + } else { + v209v2 = make(map[int8]int8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v209v2), bs209, h, t, "dec-map-v209-noaddr") // decode into non-addressable map value + testDeepEqualErr(v209v1, v209v2, t, "equal-map-v209-noaddr") + if v == nil { + v209v2 = nil + } else { + v209v2 = make(map[int8]int8, len(v)) + } // reset map + testUnmarshalErr(&v209v2, bs209, h, t, "dec-map-v209-p-len") + testDeepEqualErr(v209v1, v209v2, t, "equal-map-v209-p-len") + bs209 = testMarshalErr(&v209v1, h, t, "enc-map-v209-p") + v209v2 = nil + testUnmarshalErr(&v209v2, bs209, h, t, "dec-map-v209-p-nil") + testDeepEqualErr(v209v1, v209v2, t, "equal-map-v209-p-nil") + // ... + if v == nil { + v209v2 = nil + } else { + v209v2 = make(map[int8]int8, len(v)) + } // reset map + var v209v3, v209v4 typMapMapInt8Int8 + v209v3 = typMapMapInt8Int8(v209v1) + v209v4 = typMapMapInt8Int8(v209v2) + bs209 = testMarshalErr(v209v3, h, t, "enc-map-v209-custom") + testUnmarshalErr(v209v4, bs209, h, t, "dec-map-v209-p-len") + testDeepEqualErr(v209v3, v209v4, t, "equal-map-v209-p-len") + } + + for _, v := range []map[int8]int16{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v210: %v\n", v) + var v210v1, v210v2 map[int8]int16 + v210v1 = v + bs210 := testMarshalErr(v210v1, h, t, "enc-map-v210") + if v == nil { + v210v2 = nil + } else { + v210v2 = make(map[int8]int16, len(v)) + } // reset map + testUnmarshalErr(v210v2, bs210, h, t, "dec-map-v210") + testDeepEqualErr(v210v1, v210v2, t, "equal-map-v210") + if v == nil { + v210v2 = nil + } else { + v210v2 = make(map[int8]int16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v210v2), bs210, h, t, "dec-map-v210-noaddr") // decode into non-addressable map value + testDeepEqualErr(v210v1, v210v2, t, "equal-map-v210-noaddr") + if v == nil { + v210v2 = nil + } else { + v210v2 = make(map[int8]int16, len(v)) + } // reset map + testUnmarshalErr(&v210v2, bs210, h, t, "dec-map-v210-p-len") + testDeepEqualErr(v210v1, v210v2, t, "equal-map-v210-p-len") + bs210 = testMarshalErr(&v210v1, h, t, "enc-map-v210-p") + v210v2 = nil + testUnmarshalErr(&v210v2, bs210, h, t, "dec-map-v210-p-nil") + testDeepEqualErr(v210v1, v210v2, t, "equal-map-v210-p-nil") + // ... + if v == nil { + v210v2 = nil + } else { + v210v2 = make(map[int8]int16, len(v)) + } // reset map + var v210v3, v210v4 typMapMapInt8Int16 + v210v3 = typMapMapInt8Int16(v210v1) + v210v4 = typMapMapInt8Int16(v210v2) + bs210 = testMarshalErr(v210v3, h, t, "enc-map-v210-custom") + testUnmarshalErr(v210v4, bs210, h, t, "dec-map-v210-p-len") + testDeepEqualErr(v210v3, v210v4, t, "equal-map-v210-p-len") + } + + for _, v := range []map[int8]int32{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v211: %v\n", v) + var v211v1, v211v2 map[int8]int32 + v211v1 = v + bs211 := testMarshalErr(v211v1, h, t, "enc-map-v211") + if v == nil { + v211v2 = nil + } else { + v211v2 = make(map[int8]int32, len(v)) + } // reset map + testUnmarshalErr(v211v2, bs211, h, t, "dec-map-v211") + testDeepEqualErr(v211v1, v211v2, t, "equal-map-v211") + if v == nil { + v211v2 = nil + } else { + v211v2 = make(map[int8]int32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v211v2), bs211, h, t, "dec-map-v211-noaddr") // decode into non-addressable map value + testDeepEqualErr(v211v1, v211v2, t, "equal-map-v211-noaddr") + if v == nil { + v211v2 = nil + } else { + v211v2 = make(map[int8]int32, len(v)) + } // reset map + testUnmarshalErr(&v211v2, bs211, h, t, "dec-map-v211-p-len") + testDeepEqualErr(v211v1, v211v2, t, "equal-map-v211-p-len") + bs211 = testMarshalErr(&v211v1, h, t, "enc-map-v211-p") + v211v2 = nil + testUnmarshalErr(&v211v2, bs211, h, t, "dec-map-v211-p-nil") + testDeepEqualErr(v211v1, v211v2, t, "equal-map-v211-p-nil") + // ... + if v == nil { + v211v2 = nil + } else { + v211v2 = make(map[int8]int32, len(v)) + } // reset map + var v211v3, v211v4 typMapMapInt8Int32 + v211v3 = typMapMapInt8Int32(v211v1) + v211v4 = typMapMapInt8Int32(v211v2) + bs211 = testMarshalErr(v211v3, h, t, "enc-map-v211-custom") + testUnmarshalErr(v211v4, bs211, h, t, "dec-map-v211-p-len") + testDeepEqualErr(v211v3, v211v4, t, "equal-map-v211-p-len") + } + + for _, v := range []map[int8]int64{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v212: %v\n", v) + var v212v1, v212v2 map[int8]int64 + v212v1 = v + bs212 := testMarshalErr(v212v1, h, t, "enc-map-v212") + if v == nil { + v212v2 = nil + } else { + v212v2 = make(map[int8]int64, len(v)) + } // reset map + testUnmarshalErr(v212v2, bs212, h, t, "dec-map-v212") + testDeepEqualErr(v212v1, v212v2, t, "equal-map-v212") + if v == nil { + v212v2 = nil + } else { + v212v2 = make(map[int8]int64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v212v2), bs212, h, t, "dec-map-v212-noaddr") // decode into non-addressable map value + testDeepEqualErr(v212v1, v212v2, t, "equal-map-v212-noaddr") + if v == nil { + v212v2 = nil + } else { + v212v2 = make(map[int8]int64, len(v)) + } // reset map + testUnmarshalErr(&v212v2, bs212, h, t, "dec-map-v212-p-len") + testDeepEqualErr(v212v1, v212v2, t, "equal-map-v212-p-len") + bs212 = testMarshalErr(&v212v1, h, t, "enc-map-v212-p") + v212v2 = nil + testUnmarshalErr(&v212v2, bs212, h, t, "dec-map-v212-p-nil") + testDeepEqualErr(v212v1, v212v2, t, "equal-map-v212-p-nil") + // ... + if v == nil { + v212v2 = nil + } else { + v212v2 = make(map[int8]int64, len(v)) + } // reset map + var v212v3, v212v4 typMapMapInt8Int64 + v212v3 = typMapMapInt8Int64(v212v1) + v212v4 = typMapMapInt8Int64(v212v2) + bs212 = testMarshalErr(v212v3, h, t, "enc-map-v212-custom") + testUnmarshalErr(v212v4, bs212, h, t, "dec-map-v212-p-len") + testDeepEqualErr(v212v3, v212v4, t, "equal-map-v212-p-len") + } + + for _, v := range []map[int8]float32{nil, {}, {44: 0, 33: 22.2}} { + // fmt.Printf(">>>> running mammoth map v213: %v\n", v) + var v213v1, v213v2 map[int8]float32 + v213v1 = v + bs213 := testMarshalErr(v213v1, h, t, "enc-map-v213") + if v == nil { + v213v2 = nil + } else { + v213v2 = make(map[int8]float32, len(v)) + } // reset map + testUnmarshalErr(v213v2, bs213, h, t, "dec-map-v213") + testDeepEqualErr(v213v1, v213v2, t, "equal-map-v213") + if v == nil { + v213v2 = nil + } else { + v213v2 = make(map[int8]float32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v213v2), bs213, h, t, "dec-map-v213-noaddr") // decode into non-addressable map value + testDeepEqualErr(v213v1, v213v2, t, "equal-map-v213-noaddr") + if v == nil { + v213v2 = nil + } else { + v213v2 = make(map[int8]float32, len(v)) + } // reset map + testUnmarshalErr(&v213v2, bs213, h, t, "dec-map-v213-p-len") + testDeepEqualErr(v213v1, v213v2, t, "equal-map-v213-p-len") + bs213 = testMarshalErr(&v213v1, h, t, "enc-map-v213-p") + v213v2 = nil + testUnmarshalErr(&v213v2, bs213, h, t, "dec-map-v213-p-nil") + testDeepEqualErr(v213v1, v213v2, t, "equal-map-v213-p-nil") + // ... + if v == nil { + v213v2 = nil + } else { + v213v2 = make(map[int8]float32, len(v)) + } // reset map + var v213v3, v213v4 typMapMapInt8Float32 + v213v3 = typMapMapInt8Float32(v213v1) + v213v4 = typMapMapInt8Float32(v213v2) + bs213 = testMarshalErr(v213v3, h, t, "enc-map-v213-custom") + testUnmarshalErr(v213v4, bs213, h, t, "dec-map-v213-p-len") + testDeepEqualErr(v213v3, v213v4, t, "equal-map-v213-p-len") + } + + for _, v := range []map[int8]float64{nil, {}, {44: 0, 33: 11.1}} { + // fmt.Printf(">>>> running mammoth map v214: %v\n", v) + var v214v1, v214v2 map[int8]float64 + v214v1 = v + bs214 := testMarshalErr(v214v1, h, t, "enc-map-v214") + if v == nil { + v214v2 = nil + } else { + v214v2 = make(map[int8]float64, len(v)) + } // reset map + testUnmarshalErr(v214v2, bs214, h, t, "dec-map-v214") + testDeepEqualErr(v214v1, v214v2, t, "equal-map-v214") + if v == nil { + v214v2 = nil + } else { + v214v2 = make(map[int8]float64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v214v2), bs214, h, t, "dec-map-v214-noaddr") // decode into non-addressable map value + testDeepEqualErr(v214v1, v214v2, t, "equal-map-v214-noaddr") + if v == nil { + v214v2 = nil + } else { + v214v2 = make(map[int8]float64, len(v)) + } // reset map + testUnmarshalErr(&v214v2, bs214, h, t, "dec-map-v214-p-len") + testDeepEqualErr(v214v1, v214v2, t, "equal-map-v214-p-len") + bs214 = testMarshalErr(&v214v1, h, t, "enc-map-v214-p") + v214v2 = nil + testUnmarshalErr(&v214v2, bs214, h, t, "dec-map-v214-p-nil") + testDeepEqualErr(v214v1, v214v2, t, "equal-map-v214-p-nil") + // ... + if v == nil { + v214v2 = nil + } else { + v214v2 = make(map[int8]float64, len(v)) + } // reset map + var v214v3, v214v4 typMapMapInt8Float64 + v214v3 = typMapMapInt8Float64(v214v1) + v214v4 = typMapMapInt8Float64(v214v2) + bs214 = testMarshalErr(v214v3, h, t, "enc-map-v214-custom") + testUnmarshalErr(v214v4, bs214, h, t, "dec-map-v214-p-len") + testDeepEqualErr(v214v3, v214v4, t, "equal-map-v214-p-len") + } + + for _, v := range []map[int8]bool{nil, {}, {44: false, 33: true}} { + // fmt.Printf(">>>> running mammoth map v215: %v\n", v) + var v215v1, v215v2 map[int8]bool + v215v1 = v + bs215 := testMarshalErr(v215v1, h, t, "enc-map-v215") + if v == nil { + v215v2 = nil + } else { + v215v2 = make(map[int8]bool, len(v)) + } // reset map + testUnmarshalErr(v215v2, bs215, h, t, "dec-map-v215") + testDeepEqualErr(v215v1, v215v2, t, "equal-map-v215") + if v == nil { + v215v2 = nil + } else { + v215v2 = make(map[int8]bool, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v215v2), bs215, h, t, "dec-map-v215-noaddr") // decode into non-addressable map value + testDeepEqualErr(v215v1, v215v2, t, "equal-map-v215-noaddr") + if v == nil { + v215v2 = nil + } else { + v215v2 = make(map[int8]bool, len(v)) + } // reset map + testUnmarshalErr(&v215v2, bs215, h, t, "dec-map-v215-p-len") + testDeepEqualErr(v215v1, v215v2, t, "equal-map-v215-p-len") + bs215 = testMarshalErr(&v215v1, h, t, "enc-map-v215-p") + v215v2 = nil + testUnmarshalErr(&v215v2, bs215, h, t, "dec-map-v215-p-nil") + testDeepEqualErr(v215v1, v215v2, t, "equal-map-v215-p-nil") + // ... + if v == nil { + v215v2 = nil + } else { + v215v2 = make(map[int8]bool, len(v)) + } // reset map + var v215v3, v215v4 typMapMapInt8Bool + v215v3 = typMapMapInt8Bool(v215v1) + v215v4 = typMapMapInt8Bool(v215v2) + bs215 = testMarshalErr(v215v3, h, t, "enc-map-v215-custom") + testUnmarshalErr(v215v4, bs215, h, t, "dec-map-v215-p-len") + testDeepEqualErr(v215v3, v215v4, t, "equal-map-v215-p-len") + } + + for _, v := range []map[int16]interface{}{nil, {}, {44: nil, 33: "string-is-an-interface-2"}} { + // fmt.Printf(">>>> running mammoth map v218: %v\n", v) + var v218v1, v218v2 map[int16]interface{} + v218v1 = v + bs218 := testMarshalErr(v218v1, h, t, "enc-map-v218") + if v == nil { + v218v2 = nil + } else { + v218v2 = make(map[int16]interface{}, len(v)) + } // reset map + testUnmarshalErr(v218v2, bs218, h, t, "dec-map-v218") + testDeepEqualErr(v218v1, v218v2, t, "equal-map-v218") + if v == nil { + v218v2 = nil + } else { + v218v2 = make(map[int16]interface{}, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v218v2), bs218, h, t, "dec-map-v218-noaddr") // decode into non-addressable map value + testDeepEqualErr(v218v1, v218v2, t, "equal-map-v218-noaddr") + if v == nil { + v218v2 = nil + } else { + v218v2 = make(map[int16]interface{}, len(v)) + } // reset map + testUnmarshalErr(&v218v2, bs218, h, t, "dec-map-v218-p-len") + testDeepEqualErr(v218v1, v218v2, t, "equal-map-v218-p-len") + bs218 = testMarshalErr(&v218v1, h, t, "enc-map-v218-p") + v218v2 = nil + testUnmarshalErr(&v218v2, bs218, h, t, "dec-map-v218-p-nil") + testDeepEqualErr(v218v1, v218v2, t, "equal-map-v218-p-nil") + // ... + if v == nil { + v218v2 = nil + } else { + v218v2 = make(map[int16]interface{}, len(v)) + } // reset map + var v218v3, v218v4 typMapMapInt16Intf + v218v3 = typMapMapInt16Intf(v218v1) + v218v4 = typMapMapInt16Intf(v218v2) + bs218 = testMarshalErr(v218v3, h, t, "enc-map-v218-custom") + testUnmarshalErr(v218v4, bs218, h, t, "dec-map-v218-p-len") + testDeepEqualErr(v218v3, v218v4, t, "equal-map-v218-p-len") + } + + for _, v := range []map[int16]string{nil, {}, {44: "", 33: "some-string-2"}} { + // fmt.Printf(">>>> running mammoth map v219: %v\n", v) + var v219v1, v219v2 map[int16]string + v219v1 = v + bs219 := testMarshalErr(v219v1, h, t, "enc-map-v219") + if v == nil { + v219v2 = nil + } else { + v219v2 = make(map[int16]string, len(v)) + } // reset map + testUnmarshalErr(v219v2, bs219, h, t, "dec-map-v219") + testDeepEqualErr(v219v1, v219v2, t, "equal-map-v219") + if v == nil { + v219v2 = nil + } else { + v219v2 = make(map[int16]string, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v219v2), bs219, h, t, "dec-map-v219-noaddr") // decode into non-addressable map value + testDeepEqualErr(v219v1, v219v2, t, "equal-map-v219-noaddr") + if v == nil { + v219v2 = nil + } else { + v219v2 = make(map[int16]string, len(v)) + } // reset map + testUnmarshalErr(&v219v2, bs219, h, t, "dec-map-v219-p-len") + testDeepEqualErr(v219v1, v219v2, t, "equal-map-v219-p-len") + bs219 = testMarshalErr(&v219v1, h, t, "enc-map-v219-p") + v219v2 = nil + testUnmarshalErr(&v219v2, bs219, h, t, "dec-map-v219-p-nil") + testDeepEqualErr(v219v1, v219v2, t, "equal-map-v219-p-nil") + // ... + if v == nil { + v219v2 = nil + } else { + v219v2 = make(map[int16]string, len(v)) + } // reset map + var v219v3, v219v4 typMapMapInt16String + v219v3 = typMapMapInt16String(v219v1) + v219v4 = typMapMapInt16String(v219v2) + bs219 = testMarshalErr(v219v3, h, t, "enc-map-v219-custom") + testUnmarshalErr(v219v4, bs219, h, t, "dec-map-v219-p-len") + testDeepEqualErr(v219v3, v219v4, t, "equal-map-v219-p-len") + } + + for _, v := range []map[int16]uint{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v220: %v\n", v) + var v220v1, v220v2 map[int16]uint + v220v1 = v + bs220 := testMarshalErr(v220v1, h, t, "enc-map-v220") + if v == nil { + v220v2 = nil + } else { + v220v2 = make(map[int16]uint, len(v)) + } // reset map + testUnmarshalErr(v220v2, bs220, h, t, "dec-map-v220") + testDeepEqualErr(v220v1, v220v2, t, "equal-map-v220") + if v == nil { + v220v2 = nil + } else { + v220v2 = make(map[int16]uint, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v220v2), bs220, h, t, "dec-map-v220-noaddr") // decode into non-addressable map value + testDeepEqualErr(v220v1, v220v2, t, "equal-map-v220-noaddr") + if v == nil { + v220v2 = nil + } else { + v220v2 = make(map[int16]uint, len(v)) + } // reset map + testUnmarshalErr(&v220v2, bs220, h, t, "dec-map-v220-p-len") + testDeepEqualErr(v220v1, v220v2, t, "equal-map-v220-p-len") + bs220 = testMarshalErr(&v220v1, h, t, "enc-map-v220-p") + v220v2 = nil + testUnmarshalErr(&v220v2, bs220, h, t, "dec-map-v220-p-nil") + testDeepEqualErr(v220v1, v220v2, t, "equal-map-v220-p-nil") + // ... + if v == nil { + v220v2 = nil + } else { + v220v2 = make(map[int16]uint, len(v)) + } // reset map + var v220v3, v220v4 typMapMapInt16Uint + v220v3 = typMapMapInt16Uint(v220v1) + v220v4 = typMapMapInt16Uint(v220v2) + bs220 = testMarshalErr(v220v3, h, t, "enc-map-v220-custom") + testUnmarshalErr(v220v4, bs220, h, t, "dec-map-v220-p-len") + testDeepEqualErr(v220v3, v220v4, t, "equal-map-v220-p-len") + } + + for _, v := range []map[int16]uint8{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v221: %v\n", v) + var v221v1, v221v2 map[int16]uint8 + v221v1 = v + bs221 := testMarshalErr(v221v1, h, t, "enc-map-v221") + if v == nil { + v221v2 = nil + } else { + v221v2 = make(map[int16]uint8, len(v)) + } // reset map + testUnmarshalErr(v221v2, bs221, h, t, "dec-map-v221") + testDeepEqualErr(v221v1, v221v2, t, "equal-map-v221") + if v == nil { + v221v2 = nil + } else { + v221v2 = make(map[int16]uint8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v221v2), bs221, h, t, "dec-map-v221-noaddr") // decode into non-addressable map value + testDeepEqualErr(v221v1, v221v2, t, "equal-map-v221-noaddr") + if v == nil { + v221v2 = nil + } else { + v221v2 = make(map[int16]uint8, len(v)) + } // reset map + testUnmarshalErr(&v221v2, bs221, h, t, "dec-map-v221-p-len") + testDeepEqualErr(v221v1, v221v2, t, "equal-map-v221-p-len") + bs221 = testMarshalErr(&v221v1, h, t, "enc-map-v221-p") + v221v2 = nil + testUnmarshalErr(&v221v2, bs221, h, t, "dec-map-v221-p-nil") + testDeepEqualErr(v221v1, v221v2, t, "equal-map-v221-p-nil") + // ... + if v == nil { + v221v2 = nil + } else { + v221v2 = make(map[int16]uint8, len(v)) + } // reset map + var v221v3, v221v4 typMapMapInt16Uint8 + v221v3 = typMapMapInt16Uint8(v221v1) + v221v4 = typMapMapInt16Uint8(v221v2) + bs221 = testMarshalErr(v221v3, h, t, "enc-map-v221-custom") + testUnmarshalErr(v221v4, bs221, h, t, "dec-map-v221-p-len") + testDeepEqualErr(v221v3, v221v4, t, "equal-map-v221-p-len") + } + + for _, v := range []map[int16]uint16{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v222: %v\n", v) + var v222v1, v222v2 map[int16]uint16 + v222v1 = v + bs222 := testMarshalErr(v222v1, h, t, "enc-map-v222") + if v == nil { + v222v2 = nil + } else { + v222v2 = make(map[int16]uint16, len(v)) + } // reset map + testUnmarshalErr(v222v2, bs222, h, t, "dec-map-v222") + testDeepEqualErr(v222v1, v222v2, t, "equal-map-v222") + if v == nil { + v222v2 = nil + } else { + v222v2 = make(map[int16]uint16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v222v2), bs222, h, t, "dec-map-v222-noaddr") // decode into non-addressable map value + testDeepEqualErr(v222v1, v222v2, t, "equal-map-v222-noaddr") + if v == nil { + v222v2 = nil + } else { + v222v2 = make(map[int16]uint16, len(v)) + } // reset map + testUnmarshalErr(&v222v2, bs222, h, t, "dec-map-v222-p-len") + testDeepEqualErr(v222v1, v222v2, t, "equal-map-v222-p-len") + bs222 = testMarshalErr(&v222v1, h, t, "enc-map-v222-p") + v222v2 = nil + testUnmarshalErr(&v222v2, bs222, h, t, "dec-map-v222-p-nil") + testDeepEqualErr(v222v1, v222v2, t, "equal-map-v222-p-nil") + // ... + if v == nil { + v222v2 = nil + } else { + v222v2 = make(map[int16]uint16, len(v)) + } // reset map + var v222v3, v222v4 typMapMapInt16Uint16 + v222v3 = typMapMapInt16Uint16(v222v1) + v222v4 = typMapMapInt16Uint16(v222v2) + bs222 = testMarshalErr(v222v3, h, t, "enc-map-v222-custom") + testUnmarshalErr(v222v4, bs222, h, t, "dec-map-v222-p-len") + testDeepEqualErr(v222v3, v222v4, t, "equal-map-v222-p-len") + } + + for _, v := range []map[int16]uint32{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v223: %v\n", v) + var v223v1, v223v2 map[int16]uint32 + v223v1 = v + bs223 := testMarshalErr(v223v1, h, t, "enc-map-v223") + if v == nil { + v223v2 = nil + } else { + v223v2 = make(map[int16]uint32, len(v)) + } // reset map + testUnmarshalErr(v223v2, bs223, h, t, "dec-map-v223") + testDeepEqualErr(v223v1, v223v2, t, "equal-map-v223") + if v == nil { + v223v2 = nil + } else { + v223v2 = make(map[int16]uint32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v223v2), bs223, h, t, "dec-map-v223-noaddr") // decode into non-addressable map value + testDeepEqualErr(v223v1, v223v2, t, "equal-map-v223-noaddr") + if v == nil { + v223v2 = nil + } else { + v223v2 = make(map[int16]uint32, len(v)) + } // reset map + testUnmarshalErr(&v223v2, bs223, h, t, "dec-map-v223-p-len") + testDeepEqualErr(v223v1, v223v2, t, "equal-map-v223-p-len") + bs223 = testMarshalErr(&v223v1, h, t, "enc-map-v223-p") + v223v2 = nil + testUnmarshalErr(&v223v2, bs223, h, t, "dec-map-v223-p-nil") + testDeepEqualErr(v223v1, v223v2, t, "equal-map-v223-p-nil") + // ... + if v == nil { + v223v2 = nil + } else { + v223v2 = make(map[int16]uint32, len(v)) + } // reset map + var v223v3, v223v4 typMapMapInt16Uint32 + v223v3 = typMapMapInt16Uint32(v223v1) + v223v4 = typMapMapInt16Uint32(v223v2) + bs223 = testMarshalErr(v223v3, h, t, "enc-map-v223-custom") + testUnmarshalErr(v223v4, bs223, h, t, "dec-map-v223-p-len") + testDeepEqualErr(v223v3, v223v4, t, "equal-map-v223-p-len") + } + + for _, v := range []map[int16]uint64{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v224: %v\n", v) + var v224v1, v224v2 map[int16]uint64 + v224v1 = v + bs224 := testMarshalErr(v224v1, h, t, "enc-map-v224") + if v == nil { + v224v2 = nil + } else { + v224v2 = make(map[int16]uint64, len(v)) + } // reset map + testUnmarshalErr(v224v2, bs224, h, t, "dec-map-v224") + testDeepEqualErr(v224v1, v224v2, t, "equal-map-v224") + if v == nil { + v224v2 = nil + } else { + v224v2 = make(map[int16]uint64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v224v2), bs224, h, t, "dec-map-v224-noaddr") // decode into non-addressable map value + testDeepEqualErr(v224v1, v224v2, t, "equal-map-v224-noaddr") + if v == nil { + v224v2 = nil + } else { + v224v2 = make(map[int16]uint64, len(v)) + } // reset map + testUnmarshalErr(&v224v2, bs224, h, t, "dec-map-v224-p-len") + testDeepEqualErr(v224v1, v224v2, t, "equal-map-v224-p-len") + bs224 = testMarshalErr(&v224v1, h, t, "enc-map-v224-p") + v224v2 = nil + testUnmarshalErr(&v224v2, bs224, h, t, "dec-map-v224-p-nil") + testDeepEqualErr(v224v1, v224v2, t, "equal-map-v224-p-nil") + // ... + if v == nil { + v224v2 = nil + } else { + v224v2 = make(map[int16]uint64, len(v)) + } // reset map + var v224v3, v224v4 typMapMapInt16Uint64 + v224v3 = typMapMapInt16Uint64(v224v1) + v224v4 = typMapMapInt16Uint64(v224v2) + bs224 = testMarshalErr(v224v3, h, t, "enc-map-v224-custom") + testUnmarshalErr(v224v4, bs224, h, t, "dec-map-v224-p-len") + testDeepEqualErr(v224v3, v224v4, t, "equal-map-v224-p-len") + } + + for _, v := range []map[int16]uintptr{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v225: %v\n", v) + var v225v1, v225v2 map[int16]uintptr + v225v1 = v + bs225 := testMarshalErr(v225v1, h, t, "enc-map-v225") + if v == nil { + v225v2 = nil + } else { + v225v2 = make(map[int16]uintptr, len(v)) + } // reset map + testUnmarshalErr(v225v2, bs225, h, t, "dec-map-v225") + testDeepEqualErr(v225v1, v225v2, t, "equal-map-v225") + if v == nil { + v225v2 = nil + } else { + v225v2 = make(map[int16]uintptr, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v225v2), bs225, h, t, "dec-map-v225-noaddr") // decode into non-addressable map value + testDeepEqualErr(v225v1, v225v2, t, "equal-map-v225-noaddr") + if v == nil { + v225v2 = nil + } else { + v225v2 = make(map[int16]uintptr, len(v)) + } // reset map + testUnmarshalErr(&v225v2, bs225, h, t, "dec-map-v225-p-len") + testDeepEqualErr(v225v1, v225v2, t, "equal-map-v225-p-len") + bs225 = testMarshalErr(&v225v1, h, t, "enc-map-v225-p") + v225v2 = nil + testUnmarshalErr(&v225v2, bs225, h, t, "dec-map-v225-p-nil") + testDeepEqualErr(v225v1, v225v2, t, "equal-map-v225-p-nil") + // ... + if v == nil { + v225v2 = nil + } else { + v225v2 = make(map[int16]uintptr, len(v)) + } // reset map + var v225v3, v225v4 typMapMapInt16Uintptr + v225v3 = typMapMapInt16Uintptr(v225v1) + v225v4 = typMapMapInt16Uintptr(v225v2) + bs225 = testMarshalErr(v225v3, h, t, "enc-map-v225-custom") + testUnmarshalErr(v225v4, bs225, h, t, "dec-map-v225-p-len") + testDeepEqualErr(v225v3, v225v4, t, "equal-map-v225-p-len") + } + + for _, v := range []map[int16]int{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v226: %v\n", v) + var v226v1, v226v2 map[int16]int + v226v1 = v + bs226 := testMarshalErr(v226v1, h, t, "enc-map-v226") + if v == nil { + v226v2 = nil + } else { + v226v2 = make(map[int16]int, len(v)) + } // reset map + testUnmarshalErr(v226v2, bs226, h, t, "dec-map-v226") + testDeepEqualErr(v226v1, v226v2, t, "equal-map-v226") + if v == nil { + v226v2 = nil + } else { + v226v2 = make(map[int16]int, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v226v2), bs226, h, t, "dec-map-v226-noaddr") // decode into non-addressable map value + testDeepEqualErr(v226v1, v226v2, t, "equal-map-v226-noaddr") + if v == nil { + v226v2 = nil + } else { + v226v2 = make(map[int16]int, len(v)) + } // reset map + testUnmarshalErr(&v226v2, bs226, h, t, "dec-map-v226-p-len") + testDeepEqualErr(v226v1, v226v2, t, "equal-map-v226-p-len") + bs226 = testMarshalErr(&v226v1, h, t, "enc-map-v226-p") + v226v2 = nil + testUnmarshalErr(&v226v2, bs226, h, t, "dec-map-v226-p-nil") + testDeepEqualErr(v226v1, v226v2, t, "equal-map-v226-p-nil") + // ... + if v == nil { + v226v2 = nil + } else { + v226v2 = make(map[int16]int, len(v)) + } // reset map + var v226v3, v226v4 typMapMapInt16Int + v226v3 = typMapMapInt16Int(v226v1) + v226v4 = typMapMapInt16Int(v226v2) + bs226 = testMarshalErr(v226v3, h, t, "enc-map-v226-custom") + testUnmarshalErr(v226v4, bs226, h, t, "dec-map-v226-p-len") + testDeepEqualErr(v226v3, v226v4, t, "equal-map-v226-p-len") + } + + for _, v := range []map[int16]int8{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v227: %v\n", v) + var v227v1, v227v2 map[int16]int8 + v227v1 = v + bs227 := testMarshalErr(v227v1, h, t, "enc-map-v227") + if v == nil { + v227v2 = nil + } else { + v227v2 = make(map[int16]int8, len(v)) + } // reset map + testUnmarshalErr(v227v2, bs227, h, t, "dec-map-v227") + testDeepEqualErr(v227v1, v227v2, t, "equal-map-v227") + if v == nil { + v227v2 = nil + } else { + v227v2 = make(map[int16]int8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v227v2), bs227, h, t, "dec-map-v227-noaddr") // decode into non-addressable map value + testDeepEqualErr(v227v1, v227v2, t, "equal-map-v227-noaddr") + if v == nil { + v227v2 = nil + } else { + v227v2 = make(map[int16]int8, len(v)) + } // reset map + testUnmarshalErr(&v227v2, bs227, h, t, "dec-map-v227-p-len") + testDeepEqualErr(v227v1, v227v2, t, "equal-map-v227-p-len") + bs227 = testMarshalErr(&v227v1, h, t, "enc-map-v227-p") + v227v2 = nil + testUnmarshalErr(&v227v2, bs227, h, t, "dec-map-v227-p-nil") + testDeepEqualErr(v227v1, v227v2, t, "equal-map-v227-p-nil") + // ... + if v == nil { + v227v2 = nil + } else { + v227v2 = make(map[int16]int8, len(v)) + } // reset map + var v227v3, v227v4 typMapMapInt16Int8 + v227v3 = typMapMapInt16Int8(v227v1) + v227v4 = typMapMapInt16Int8(v227v2) + bs227 = testMarshalErr(v227v3, h, t, "enc-map-v227-custom") + testUnmarshalErr(v227v4, bs227, h, t, "dec-map-v227-p-len") + testDeepEqualErr(v227v3, v227v4, t, "equal-map-v227-p-len") + } + + for _, v := range []map[int16]int16{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v228: %v\n", v) + var v228v1, v228v2 map[int16]int16 + v228v1 = v + bs228 := testMarshalErr(v228v1, h, t, "enc-map-v228") + if v == nil { + v228v2 = nil + } else { + v228v2 = make(map[int16]int16, len(v)) + } // reset map + testUnmarshalErr(v228v2, bs228, h, t, "dec-map-v228") + testDeepEqualErr(v228v1, v228v2, t, "equal-map-v228") + if v == nil { + v228v2 = nil + } else { + v228v2 = make(map[int16]int16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v228v2), bs228, h, t, "dec-map-v228-noaddr") // decode into non-addressable map value + testDeepEqualErr(v228v1, v228v2, t, "equal-map-v228-noaddr") + if v == nil { + v228v2 = nil + } else { + v228v2 = make(map[int16]int16, len(v)) + } // reset map + testUnmarshalErr(&v228v2, bs228, h, t, "dec-map-v228-p-len") + testDeepEqualErr(v228v1, v228v2, t, "equal-map-v228-p-len") + bs228 = testMarshalErr(&v228v1, h, t, "enc-map-v228-p") + v228v2 = nil + testUnmarshalErr(&v228v2, bs228, h, t, "dec-map-v228-p-nil") + testDeepEqualErr(v228v1, v228v2, t, "equal-map-v228-p-nil") + // ... + if v == nil { + v228v2 = nil + } else { + v228v2 = make(map[int16]int16, len(v)) + } // reset map + var v228v3, v228v4 typMapMapInt16Int16 + v228v3 = typMapMapInt16Int16(v228v1) + v228v4 = typMapMapInt16Int16(v228v2) + bs228 = testMarshalErr(v228v3, h, t, "enc-map-v228-custom") + testUnmarshalErr(v228v4, bs228, h, t, "dec-map-v228-p-len") + testDeepEqualErr(v228v3, v228v4, t, "equal-map-v228-p-len") + } + + for _, v := range []map[int16]int32{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v229: %v\n", v) + var v229v1, v229v2 map[int16]int32 + v229v1 = v + bs229 := testMarshalErr(v229v1, h, t, "enc-map-v229") + if v == nil { + v229v2 = nil + } else { + v229v2 = make(map[int16]int32, len(v)) + } // reset map + testUnmarshalErr(v229v2, bs229, h, t, "dec-map-v229") + testDeepEqualErr(v229v1, v229v2, t, "equal-map-v229") + if v == nil { + v229v2 = nil + } else { + v229v2 = make(map[int16]int32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v229v2), bs229, h, t, "dec-map-v229-noaddr") // decode into non-addressable map value + testDeepEqualErr(v229v1, v229v2, t, "equal-map-v229-noaddr") + if v == nil { + v229v2 = nil + } else { + v229v2 = make(map[int16]int32, len(v)) + } // reset map + testUnmarshalErr(&v229v2, bs229, h, t, "dec-map-v229-p-len") + testDeepEqualErr(v229v1, v229v2, t, "equal-map-v229-p-len") + bs229 = testMarshalErr(&v229v1, h, t, "enc-map-v229-p") + v229v2 = nil + testUnmarshalErr(&v229v2, bs229, h, t, "dec-map-v229-p-nil") + testDeepEqualErr(v229v1, v229v2, t, "equal-map-v229-p-nil") + // ... + if v == nil { + v229v2 = nil + } else { + v229v2 = make(map[int16]int32, len(v)) + } // reset map + var v229v3, v229v4 typMapMapInt16Int32 + v229v3 = typMapMapInt16Int32(v229v1) + v229v4 = typMapMapInt16Int32(v229v2) + bs229 = testMarshalErr(v229v3, h, t, "enc-map-v229-custom") + testUnmarshalErr(v229v4, bs229, h, t, "dec-map-v229-p-len") + testDeepEqualErr(v229v3, v229v4, t, "equal-map-v229-p-len") + } + + for _, v := range []map[int16]int64{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v230: %v\n", v) + var v230v1, v230v2 map[int16]int64 + v230v1 = v + bs230 := testMarshalErr(v230v1, h, t, "enc-map-v230") + if v == nil { + v230v2 = nil + } else { + v230v2 = make(map[int16]int64, len(v)) + } // reset map + testUnmarshalErr(v230v2, bs230, h, t, "dec-map-v230") + testDeepEqualErr(v230v1, v230v2, t, "equal-map-v230") + if v == nil { + v230v2 = nil + } else { + v230v2 = make(map[int16]int64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v230v2), bs230, h, t, "dec-map-v230-noaddr") // decode into non-addressable map value + testDeepEqualErr(v230v1, v230v2, t, "equal-map-v230-noaddr") + if v == nil { + v230v2 = nil + } else { + v230v2 = make(map[int16]int64, len(v)) + } // reset map + testUnmarshalErr(&v230v2, bs230, h, t, "dec-map-v230-p-len") + testDeepEqualErr(v230v1, v230v2, t, "equal-map-v230-p-len") + bs230 = testMarshalErr(&v230v1, h, t, "enc-map-v230-p") + v230v2 = nil + testUnmarshalErr(&v230v2, bs230, h, t, "dec-map-v230-p-nil") + testDeepEqualErr(v230v1, v230v2, t, "equal-map-v230-p-nil") + // ... + if v == nil { + v230v2 = nil + } else { + v230v2 = make(map[int16]int64, len(v)) + } // reset map + var v230v3, v230v4 typMapMapInt16Int64 + v230v3 = typMapMapInt16Int64(v230v1) + v230v4 = typMapMapInt16Int64(v230v2) + bs230 = testMarshalErr(v230v3, h, t, "enc-map-v230-custom") + testUnmarshalErr(v230v4, bs230, h, t, "dec-map-v230-p-len") + testDeepEqualErr(v230v3, v230v4, t, "equal-map-v230-p-len") + } + + for _, v := range []map[int16]float32{nil, {}, {33: 0, 44: 22.2}} { + // fmt.Printf(">>>> running mammoth map v231: %v\n", v) + var v231v1, v231v2 map[int16]float32 + v231v1 = v + bs231 := testMarshalErr(v231v1, h, t, "enc-map-v231") + if v == nil { + v231v2 = nil + } else { + v231v2 = make(map[int16]float32, len(v)) + } // reset map + testUnmarshalErr(v231v2, bs231, h, t, "dec-map-v231") + testDeepEqualErr(v231v1, v231v2, t, "equal-map-v231") + if v == nil { + v231v2 = nil + } else { + v231v2 = make(map[int16]float32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v231v2), bs231, h, t, "dec-map-v231-noaddr") // decode into non-addressable map value + testDeepEqualErr(v231v1, v231v2, t, "equal-map-v231-noaddr") + if v == nil { + v231v2 = nil + } else { + v231v2 = make(map[int16]float32, len(v)) + } // reset map + testUnmarshalErr(&v231v2, bs231, h, t, "dec-map-v231-p-len") + testDeepEqualErr(v231v1, v231v2, t, "equal-map-v231-p-len") + bs231 = testMarshalErr(&v231v1, h, t, "enc-map-v231-p") + v231v2 = nil + testUnmarshalErr(&v231v2, bs231, h, t, "dec-map-v231-p-nil") + testDeepEqualErr(v231v1, v231v2, t, "equal-map-v231-p-nil") + // ... + if v == nil { + v231v2 = nil + } else { + v231v2 = make(map[int16]float32, len(v)) + } // reset map + var v231v3, v231v4 typMapMapInt16Float32 + v231v3 = typMapMapInt16Float32(v231v1) + v231v4 = typMapMapInt16Float32(v231v2) + bs231 = testMarshalErr(v231v3, h, t, "enc-map-v231-custom") + testUnmarshalErr(v231v4, bs231, h, t, "dec-map-v231-p-len") + testDeepEqualErr(v231v3, v231v4, t, "equal-map-v231-p-len") + } + + for _, v := range []map[int16]float64{nil, {}, {33: 0, 44: 11.1}} { + // fmt.Printf(">>>> running mammoth map v232: %v\n", v) + var v232v1, v232v2 map[int16]float64 + v232v1 = v + bs232 := testMarshalErr(v232v1, h, t, "enc-map-v232") + if v == nil { + v232v2 = nil + } else { + v232v2 = make(map[int16]float64, len(v)) + } // reset map + testUnmarshalErr(v232v2, bs232, h, t, "dec-map-v232") + testDeepEqualErr(v232v1, v232v2, t, "equal-map-v232") + if v == nil { + v232v2 = nil + } else { + v232v2 = make(map[int16]float64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v232v2), bs232, h, t, "dec-map-v232-noaddr") // decode into non-addressable map value + testDeepEqualErr(v232v1, v232v2, t, "equal-map-v232-noaddr") + if v == nil { + v232v2 = nil + } else { + v232v2 = make(map[int16]float64, len(v)) + } // reset map + testUnmarshalErr(&v232v2, bs232, h, t, "dec-map-v232-p-len") + testDeepEqualErr(v232v1, v232v2, t, "equal-map-v232-p-len") + bs232 = testMarshalErr(&v232v1, h, t, "enc-map-v232-p") + v232v2 = nil + testUnmarshalErr(&v232v2, bs232, h, t, "dec-map-v232-p-nil") + testDeepEqualErr(v232v1, v232v2, t, "equal-map-v232-p-nil") + // ... + if v == nil { + v232v2 = nil + } else { + v232v2 = make(map[int16]float64, len(v)) + } // reset map + var v232v3, v232v4 typMapMapInt16Float64 + v232v3 = typMapMapInt16Float64(v232v1) + v232v4 = typMapMapInt16Float64(v232v2) + bs232 = testMarshalErr(v232v3, h, t, "enc-map-v232-custom") + testUnmarshalErr(v232v4, bs232, h, t, "dec-map-v232-p-len") + testDeepEqualErr(v232v3, v232v4, t, "equal-map-v232-p-len") + } + + for _, v := range []map[int16]bool{nil, {}, {33: false, 44: true}} { + // fmt.Printf(">>>> running mammoth map v233: %v\n", v) + var v233v1, v233v2 map[int16]bool + v233v1 = v + bs233 := testMarshalErr(v233v1, h, t, "enc-map-v233") + if v == nil { + v233v2 = nil + } else { + v233v2 = make(map[int16]bool, len(v)) + } // reset map + testUnmarshalErr(v233v2, bs233, h, t, "dec-map-v233") + testDeepEqualErr(v233v1, v233v2, t, "equal-map-v233") + if v == nil { + v233v2 = nil + } else { + v233v2 = make(map[int16]bool, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v233v2), bs233, h, t, "dec-map-v233-noaddr") // decode into non-addressable map value + testDeepEqualErr(v233v1, v233v2, t, "equal-map-v233-noaddr") + if v == nil { + v233v2 = nil + } else { + v233v2 = make(map[int16]bool, len(v)) + } // reset map + testUnmarshalErr(&v233v2, bs233, h, t, "dec-map-v233-p-len") + testDeepEqualErr(v233v1, v233v2, t, "equal-map-v233-p-len") + bs233 = testMarshalErr(&v233v1, h, t, "enc-map-v233-p") + v233v2 = nil + testUnmarshalErr(&v233v2, bs233, h, t, "dec-map-v233-p-nil") + testDeepEqualErr(v233v1, v233v2, t, "equal-map-v233-p-nil") + // ... + if v == nil { + v233v2 = nil + } else { + v233v2 = make(map[int16]bool, len(v)) + } // reset map + var v233v3, v233v4 typMapMapInt16Bool + v233v3 = typMapMapInt16Bool(v233v1) + v233v4 = typMapMapInt16Bool(v233v2) + bs233 = testMarshalErr(v233v3, h, t, "enc-map-v233-custom") + testUnmarshalErr(v233v4, bs233, h, t, "dec-map-v233-p-len") + testDeepEqualErr(v233v3, v233v4, t, "equal-map-v233-p-len") + } + + for _, v := range []map[int32]interface{}{nil, {}, {33: nil, 44: "string-is-an-interface"}} { + // fmt.Printf(">>>> running mammoth map v236: %v\n", v) + var v236v1, v236v2 map[int32]interface{} + v236v1 = v + bs236 := testMarshalErr(v236v1, h, t, "enc-map-v236") + if v == nil { + v236v2 = nil + } else { + v236v2 = make(map[int32]interface{}, len(v)) + } // reset map + testUnmarshalErr(v236v2, bs236, h, t, "dec-map-v236") + testDeepEqualErr(v236v1, v236v2, t, "equal-map-v236") + if v == nil { + v236v2 = nil + } else { + v236v2 = make(map[int32]interface{}, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v236v2), bs236, h, t, "dec-map-v236-noaddr") // decode into non-addressable map value + testDeepEqualErr(v236v1, v236v2, t, "equal-map-v236-noaddr") + if v == nil { + v236v2 = nil + } else { + v236v2 = make(map[int32]interface{}, len(v)) + } // reset map + testUnmarshalErr(&v236v2, bs236, h, t, "dec-map-v236-p-len") + testDeepEqualErr(v236v1, v236v2, t, "equal-map-v236-p-len") + bs236 = testMarshalErr(&v236v1, h, t, "enc-map-v236-p") + v236v2 = nil + testUnmarshalErr(&v236v2, bs236, h, t, "dec-map-v236-p-nil") + testDeepEqualErr(v236v1, v236v2, t, "equal-map-v236-p-nil") + // ... + if v == nil { + v236v2 = nil + } else { + v236v2 = make(map[int32]interface{}, len(v)) + } // reset map + var v236v3, v236v4 typMapMapInt32Intf + v236v3 = typMapMapInt32Intf(v236v1) + v236v4 = typMapMapInt32Intf(v236v2) + bs236 = testMarshalErr(v236v3, h, t, "enc-map-v236-custom") + testUnmarshalErr(v236v4, bs236, h, t, "dec-map-v236-p-len") + testDeepEqualErr(v236v3, v236v4, t, "equal-map-v236-p-len") + } + + for _, v := range []map[int32]string{nil, {}, {33: "", 44: "some-string"}} { + // fmt.Printf(">>>> running mammoth map v237: %v\n", v) + var v237v1, v237v2 map[int32]string + v237v1 = v + bs237 := testMarshalErr(v237v1, h, t, "enc-map-v237") + if v == nil { + v237v2 = nil + } else { + v237v2 = make(map[int32]string, len(v)) + } // reset map + testUnmarshalErr(v237v2, bs237, h, t, "dec-map-v237") + testDeepEqualErr(v237v1, v237v2, t, "equal-map-v237") + if v == nil { + v237v2 = nil + } else { + v237v2 = make(map[int32]string, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v237v2), bs237, h, t, "dec-map-v237-noaddr") // decode into non-addressable map value + testDeepEqualErr(v237v1, v237v2, t, "equal-map-v237-noaddr") + if v == nil { + v237v2 = nil + } else { + v237v2 = make(map[int32]string, len(v)) + } // reset map + testUnmarshalErr(&v237v2, bs237, h, t, "dec-map-v237-p-len") + testDeepEqualErr(v237v1, v237v2, t, "equal-map-v237-p-len") + bs237 = testMarshalErr(&v237v1, h, t, "enc-map-v237-p") + v237v2 = nil + testUnmarshalErr(&v237v2, bs237, h, t, "dec-map-v237-p-nil") + testDeepEqualErr(v237v1, v237v2, t, "equal-map-v237-p-nil") + // ... + if v == nil { + v237v2 = nil + } else { + v237v2 = make(map[int32]string, len(v)) + } // reset map + var v237v3, v237v4 typMapMapInt32String + v237v3 = typMapMapInt32String(v237v1) + v237v4 = typMapMapInt32String(v237v2) + bs237 = testMarshalErr(v237v3, h, t, "enc-map-v237-custom") + testUnmarshalErr(v237v4, bs237, h, t, "dec-map-v237-p-len") + testDeepEqualErr(v237v3, v237v4, t, "equal-map-v237-p-len") + } + + for _, v := range []map[int32]uint{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v238: %v\n", v) + var v238v1, v238v2 map[int32]uint + v238v1 = v + bs238 := testMarshalErr(v238v1, h, t, "enc-map-v238") + if v == nil { + v238v2 = nil + } else { + v238v2 = make(map[int32]uint, len(v)) + } // reset map + testUnmarshalErr(v238v2, bs238, h, t, "dec-map-v238") + testDeepEqualErr(v238v1, v238v2, t, "equal-map-v238") + if v == nil { + v238v2 = nil + } else { + v238v2 = make(map[int32]uint, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v238v2), bs238, h, t, "dec-map-v238-noaddr") // decode into non-addressable map value + testDeepEqualErr(v238v1, v238v2, t, "equal-map-v238-noaddr") + if v == nil { + v238v2 = nil + } else { + v238v2 = make(map[int32]uint, len(v)) + } // reset map + testUnmarshalErr(&v238v2, bs238, h, t, "dec-map-v238-p-len") + testDeepEqualErr(v238v1, v238v2, t, "equal-map-v238-p-len") + bs238 = testMarshalErr(&v238v1, h, t, "enc-map-v238-p") + v238v2 = nil + testUnmarshalErr(&v238v2, bs238, h, t, "dec-map-v238-p-nil") + testDeepEqualErr(v238v1, v238v2, t, "equal-map-v238-p-nil") + // ... + if v == nil { + v238v2 = nil + } else { + v238v2 = make(map[int32]uint, len(v)) + } // reset map + var v238v3, v238v4 typMapMapInt32Uint + v238v3 = typMapMapInt32Uint(v238v1) + v238v4 = typMapMapInt32Uint(v238v2) + bs238 = testMarshalErr(v238v3, h, t, "enc-map-v238-custom") + testUnmarshalErr(v238v4, bs238, h, t, "dec-map-v238-p-len") + testDeepEqualErr(v238v3, v238v4, t, "equal-map-v238-p-len") + } + + for _, v := range []map[int32]uint8{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v239: %v\n", v) + var v239v1, v239v2 map[int32]uint8 + v239v1 = v + bs239 := testMarshalErr(v239v1, h, t, "enc-map-v239") + if v == nil { + v239v2 = nil + } else { + v239v2 = make(map[int32]uint8, len(v)) + } // reset map + testUnmarshalErr(v239v2, bs239, h, t, "dec-map-v239") + testDeepEqualErr(v239v1, v239v2, t, "equal-map-v239") + if v == nil { + v239v2 = nil + } else { + v239v2 = make(map[int32]uint8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v239v2), bs239, h, t, "dec-map-v239-noaddr") // decode into non-addressable map value + testDeepEqualErr(v239v1, v239v2, t, "equal-map-v239-noaddr") + if v == nil { + v239v2 = nil + } else { + v239v2 = make(map[int32]uint8, len(v)) + } // reset map + testUnmarshalErr(&v239v2, bs239, h, t, "dec-map-v239-p-len") + testDeepEqualErr(v239v1, v239v2, t, "equal-map-v239-p-len") + bs239 = testMarshalErr(&v239v1, h, t, "enc-map-v239-p") + v239v2 = nil + testUnmarshalErr(&v239v2, bs239, h, t, "dec-map-v239-p-nil") + testDeepEqualErr(v239v1, v239v2, t, "equal-map-v239-p-nil") + // ... + if v == nil { + v239v2 = nil + } else { + v239v2 = make(map[int32]uint8, len(v)) + } // reset map + var v239v3, v239v4 typMapMapInt32Uint8 + v239v3 = typMapMapInt32Uint8(v239v1) + v239v4 = typMapMapInt32Uint8(v239v2) + bs239 = testMarshalErr(v239v3, h, t, "enc-map-v239-custom") + testUnmarshalErr(v239v4, bs239, h, t, "dec-map-v239-p-len") + testDeepEqualErr(v239v3, v239v4, t, "equal-map-v239-p-len") + } + + for _, v := range []map[int32]uint16{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v240: %v\n", v) + var v240v1, v240v2 map[int32]uint16 + v240v1 = v + bs240 := testMarshalErr(v240v1, h, t, "enc-map-v240") + if v == nil { + v240v2 = nil + } else { + v240v2 = make(map[int32]uint16, len(v)) + } // reset map + testUnmarshalErr(v240v2, bs240, h, t, "dec-map-v240") + testDeepEqualErr(v240v1, v240v2, t, "equal-map-v240") + if v == nil { + v240v2 = nil + } else { + v240v2 = make(map[int32]uint16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v240v2), bs240, h, t, "dec-map-v240-noaddr") // decode into non-addressable map value + testDeepEqualErr(v240v1, v240v2, t, "equal-map-v240-noaddr") + if v == nil { + v240v2 = nil + } else { + v240v2 = make(map[int32]uint16, len(v)) + } // reset map + testUnmarshalErr(&v240v2, bs240, h, t, "dec-map-v240-p-len") + testDeepEqualErr(v240v1, v240v2, t, "equal-map-v240-p-len") + bs240 = testMarshalErr(&v240v1, h, t, "enc-map-v240-p") + v240v2 = nil + testUnmarshalErr(&v240v2, bs240, h, t, "dec-map-v240-p-nil") + testDeepEqualErr(v240v1, v240v2, t, "equal-map-v240-p-nil") + // ... + if v == nil { + v240v2 = nil + } else { + v240v2 = make(map[int32]uint16, len(v)) + } // reset map + var v240v3, v240v4 typMapMapInt32Uint16 + v240v3 = typMapMapInt32Uint16(v240v1) + v240v4 = typMapMapInt32Uint16(v240v2) + bs240 = testMarshalErr(v240v3, h, t, "enc-map-v240-custom") + testUnmarshalErr(v240v4, bs240, h, t, "dec-map-v240-p-len") + testDeepEqualErr(v240v3, v240v4, t, "equal-map-v240-p-len") + } + + for _, v := range []map[int32]uint32{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v241: %v\n", v) + var v241v1, v241v2 map[int32]uint32 + v241v1 = v + bs241 := testMarshalErr(v241v1, h, t, "enc-map-v241") + if v == nil { + v241v2 = nil + } else { + v241v2 = make(map[int32]uint32, len(v)) + } // reset map + testUnmarshalErr(v241v2, bs241, h, t, "dec-map-v241") + testDeepEqualErr(v241v1, v241v2, t, "equal-map-v241") + if v == nil { + v241v2 = nil + } else { + v241v2 = make(map[int32]uint32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v241v2), bs241, h, t, "dec-map-v241-noaddr") // decode into non-addressable map value + testDeepEqualErr(v241v1, v241v2, t, "equal-map-v241-noaddr") + if v == nil { + v241v2 = nil + } else { + v241v2 = make(map[int32]uint32, len(v)) + } // reset map + testUnmarshalErr(&v241v2, bs241, h, t, "dec-map-v241-p-len") + testDeepEqualErr(v241v1, v241v2, t, "equal-map-v241-p-len") + bs241 = testMarshalErr(&v241v1, h, t, "enc-map-v241-p") + v241v2 = nil + testUnmarshalErr(&v241v2, bs241, h, t, "dec-map-v241-p-nil") + testDeepEqualErr(v241v1, v241v2, t, "equal-map-v241-p-nil") + // ... + if v == nil { + v241v2 = nil + } else { + v241v2 = make(map[int32]uint32, len(v)) + } // reset map + var v241v3, v241v4 typMapMapInt32Uint32 + v241v3 = typMapMapInt32Uint32(v241v1) + v241v4 = typMapMapInt32Uint32(v241v2) + bs241 = testMarshalErr(v241v3, h, t, "enc-map-v241-custom") + testUnmarshalErr(v241v4, bs241, h, t, "dec-map-v241-p-len") + testDeepEqualErr(v241v3, v241v4, t, "equal-map-v241-p-len") + } + + for _, v := range []map[int32]uint64{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v242: %v\n", v) + var v242v1, v242v2 map[int32]uint64 + v242v1 = v + bs242 := testMarshalErr(v242v1, h, t, "enc-map-v242") + if v == nil { + v242v2 = nil + } else { + v242v2 = make(map[int32]uint64, len(v)) + } // reset map + testUnmarshalErr(v242v2, bs242, h, t, "dec-map-v242") + testDeepEqualErr(v242v1, v242v2, t, "equal-map-v242") + if v == nil { + v242v2 = nil + } else { + v242v2 = make(map[int32]uint64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v242v2), bs242, h, t, "dec-map-v242-noaddr") // decode into non-addressable map value + testDeepEqualErr(v242v1, v242v2, t, "equal-map-v242-noaddr") + if v == nil { + v242v2 = nil + } else { + v242v2 = make(map[int32]uint64, len(v)) + } // reset map + testUnmarshalErr(&v242v2, bs242, h, t, "dec-map-v242-p-len") + testDeepEqualErr(v242v1, v242v2, t, "equal-map-v242-p-len") + bs242 = testMarshalErr(&v242v1, h, t, "enc-map-v242-p") + v242v2 = nil + testUnmarshalErr(&v242v2, bs242, h, t, "dec-map-v242-p-nil") + testDeepEqualErr(v242v1, v242v2, t, "equal-map-v242-p-nil") + // ... + if v == nil { + v242v2 = nil + } else { + v242v2 = make(map[int32]uint64, len(v)) + } // reset map + var v242v3, v242v4 typMapMapInt32Uint64 + v242v3 = typMapMapInt32Uint64(v242v1) + v242v4 = typMapMapInt32Uint64(v242v2) + bs242 = testMarshalErr(v242v3, h, t, "enc-map-v242-custom") + testUnmarshalErr(v242v4, bs242, h, t, "dec-map-v242-p-len") + testDeepEqualErr(v242v3, v242v4, t, "equal-map-v242-p-len") + } + + for _, v := range []map[int32]uintptr{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v243: %v\n", v) + var v243v1, v243v2 map[int32]uintptr + v243v1 = v + bs243 := testMarshalErr(v243v1, h, t, "enc-map-v243") + if v == nil { + v243v2 = nil + } else { + v243v2 = make(map[int32]uintptr, len(v)) + } // reset map + testUnmarshalErr(v243v2, bs243, h, t, "dec-map-v243") + testDeepEqualErr(v243v1, v243v2, t, "equal-map-v243") + if v == nil { + v243v2 = nil + } else { + v243v2 = make(map[int32]uintptr, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v243v2), bs243, h, t, "dec-map-v243-noaddr") // decode into non-addressable map value + testDeepEqualErr(v243v1, v243v2, t, "equal-map-v243-noaddr") + if v == nil { + v243v2 = nil + } else { + v243v2 = make(map[int32]uintptr, len(v)) + } // reset map + testUnmarshalErr(&v243v2, bs243, h, t, "dec-map-v243-p-len") + testDeepEqualErr(v243v1, v243v2, t, "equal-map-v243-p-len") + bs243 = testMarshalErr(&v243v1, h, t, "enc-map-v243-p") + v243v2 = nil + testUnmarshalErr(&v243v2, bs243, h, t, "dec-map-v243-p-nil") + testDeepEqualErr(v243v1, v243v2, t, "equal-map-v243-p-nil") + // ... + if v == nil { + v243v2 = nil + } else { + v243v2 = make(map[int32]uintptr, len(v)) + } // reset map + var v243v3, v243v4 typMapMapInt32Uintptr + v243v3 = typMapMapInt32Uintptr(v243v1) + v243v4 = typMapMapInt32Uintptr(v243v2) + bs243 = testMarshalErr(v243v3, h, t, "enc-map-v243-custom") + testUnmarshalErr(v243v4, bs243, h, t, "dec-map-v243-p-len") + testDeepEqualErr(v243v3, v243v4, t, "equal-map-v243-p-len") + } + + for _, v := range []map[int32]int{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v244: %v\n", v) + var v244v1, v244v2 map[int32]int + v244v1 = v + bs244 := testMarshalErr(v244v1, h, t, "enc-map-v244") + if v == nil { + v244v2 = nil + } else { + v244v2 = make(map[int32]int, len(v)) + } // reset map + testUnmarshalErr(v244v2, bs244, h, t, "dec-map-v244") + testDeepEqualErr(v244v1, v244v2, t, "equal-map-v244") + if v == nil { + v244v2 = nil + } else { + v244v2 = make(map[int32]int, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v244v2), bs244, h, t, "dec-map-v244-noaddr") // decode into non-addressable map value + testDeepEqualErr(v244v1, v244v2, t, "equal-map-v244-noaddr") + if v == nil { + v244v2 = nil + } else { + v244v2 = make(map[int32]int, len(v)) + } // reset map + testUnmarshalErr(&v244v2, bs244, h, t, "dec-map-v244-p-len") + testDeepEqualErr(v244v1, v244v2, t, "equal-map-v244-p-len") + bs244 = testMarshalErr(&v244v1, h, t, "enc-map-v244-p") + v244v2 = nil + testUnmarshalErr(&v244v2, bs244, h, t, "dec-map-v244-p-nil") + testDeepEqualErr(v244v1, v244v2, t, "equal-map-v244-p-nil") + // ... + if v == nil { + v244v2 = nil + } else { + v244v2 = make(map[int32]int, len(v)) + } // reset map + var v244v3, v244v4 typMapMapInt32Int + v244v3 = typMapMapInt32Int(v244v1) + v244v4 = typMapMapInt32Int(v244v2) + bs244 = testMarshalErr(v244v3, h, t, "enc-map-v244-custom") + testUnmarshalErr(v244v4, bs244, h, t, "dec-map-v244-p-len") + testDeepEqualErr(v244v3, v244v4, t, "equal-map-v244-p-len") + } + + for _, v := range []map[int32]int8{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v245: %v\n", v) + var v245v1, v245v2 map[int32]int8 + v245v1 = v + bs245 := testMarshalErr(v245v1, h, t, "enc-map-v245") + if v == nil { + v245v2 = nil + } else { + v245v2 = make(map[int32]int8, len(v)) + } // reset map + testUnmarshalErr(v245v2, bs245, h, t, "dec-map-v245") + testDeepEqualErr(v245v1, v245v2, t, "equal-map-v245") + if v == nil { + v245v2 = nil + } else { + v245v2 = make(map[int32]int8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v245v2), bs245, h, t, "dec-map-v245-noaddr") // decode into non-addressable map value + testDeepEqualErr(v245v1, v245v2, t, "equal-map-v245-noaddr") + if v == nil { + v245v2 = nil + } else { + v245v2 = make(map[int32]int8, len(v)) + } // reset map + testUnmarshalErr(&v245v2, bs245, h, t, "dec-map-v245-p-len") + testDeepEqualErr(v245v1, v245v2, t, "equal-map-v245-p-len") + bs245 = testMarshalErr(&v245v1, h, t, "enc-map-v245-p") + v245v2 = nil + testUnmarshalErr(&v245v2, bs245, h, t, "dec-map-v245-p-nil") + testDeepEqualErr(v245v1, v245v2, t, "equal-map-v245-p-nil") + // ... + if v == nil { + v245v2 = nil + } else { + v245v2 = make(map[int32]int8, len(v)) + } // reset map + var v245v3, v245v4 typMapMapInt32Int8 + v245v3 = typMapMapInt32Int8(v245v1) + v245v4 = typMapMapInt32Int8(v245v2) + bs245 = testMarshalErr(v245v3, h, t, "enc-map-v245-custom") + testUnmarshalErr(v245v4, bs245, h, t, "dec-map-v245-p-len") + testDeepEqualErr(v245v3, v245v4, t, "equal-map-v245-p-len") + } + + for _, v := range []map[int32]int16{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v246: %v\n", v) + var v246v1, v246v2 map[int32]int16 + v246v1 = v + bs246 := testMarshalErr(v246v1, h, t, "enc-map-v246") + if v == nil { + v246v2 = nil + } else { + v246v2 = make(map[int32]int16, len(v)) + } // reset map + testUnmarshalErr(v246v2, bs246, h, t, "dec-map-v246") + testDeepEqualErr(v246v1, v246v2, t, "equal-map-v246") + if v == nil { + v246v2 = nil + } else { + v246v2 = make(map[int32]int16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v246v2), bs246, h, t, "dec-map-v246-noaddr") // decode into non-addressable map value + testDeepEqualErr(v246v1, v246v2, t, "equal-map-v246-noaddr") + if v == nil { + v246v2 = nil + } else { + v246v2 = make(map[int32]int16, len(v)) + } // reset map + testUnmarshalErr(&v246v2, bs246, h, t, "dec-map-v246-p-len") + testDeepEqualErr(v246v1, v246v2, t, "equal-map-v246-p-len") + bs246 = testMarshalErr(&v246v1, h, t, "enc-map-v246-p") + v246v2 = nil + testUnmarshalErr(&v246v2, bs246, h, t, "dec-map-v246-p-nil") + testDeepEqualErr(v246v1, v246v2, t, "equal-map-v246-p-nil") + // ... + if v == nil { + v246v2 = nil + } else { + v246v2 = make(map[int32]int16, len(v)) + } // reset map + var v246v3, v246v4 typMapMapInt32Int16 + v246v3 = typMapMapInt32Int16(v246v1) + v246v4 = typMapMapInt32Int16(v246v2) + bs246 = testMarshalErr(v246v3, h, t, "enc-map-v246-custom") + testUnmarshalErr(v246v4, bs246, h, t, "dec-map-v246-p-len") + testDeepEqualErr(v246v3, v246v4, t, "equal-map-v246-p-len") + } + + for _, v := range []map[int32]int32{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v247: %v\n", v) + var v247v1, v247v2 map[int32]int32 + v247v1 = v + bs247 := testMarshalErr(v247v1, h, t, "enc-map-v247") + if v == nil { + v247v2 = nil + } else { + v247v2 = make(map[int32]int32, len(v)) + } // reset map + testUnmarshalErr(v247v2, bs247, h, t, "dec-map-v247") + testDeepEqualErr(v247v1, v247v2, t, "equal-map-v247") + if v == nil { + v247v2 = nil + } else { + v247v2 = make(map[int32]int32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v247v2), bs247, h, t, "dec-map-v247-noaddr") // decode into non-addressable map value + testDeepEqualErr(v247v1, v247v2, t, "equal-map-v247-noaddr") + if v == nil { + v247v2 = nil + } else { + v247v2 = make(map[int32]int32, len(v)) + } // reset map + testUnmarshalErr(&v247v2, bs247, h, t, "dec-map-v247-p-len") + testDeepEqualErr(v247v1, v247v2, t, "equal-map-v247-p-len") + bs247 = testMarshalErr(&v247v1, h, t, "enc-map-v247-p") + v247v2 = nil + testUnmarshalErr(&v247v2, bs247, h, t, "dec-map-v247-p-nil") + testDeepEqualErr(v247v1, v247v2, t, "equal-map-v247-p-nil") + // ... + if v == nil { + v247v2 = nil + } else { + v247v2 = make(map[int32]int32, len(v)) + } // reset map + var v247v3, v247v4 typMapMapInt32Int32 + v247v3 = typMapMapInt32Int32(v247v1) + v247v4 = typMapMapInt32Int32(v247v2) + bs247 = testMarshalErr(v247v3, h, t, "enc-map-v247-custom") + testUnmarshalErr(v247v4, bs247, h, t, "dec-map-v247-p-len") + testDeepEqualErr(v247v3, v247v4, t, "equal-map-v247-p-len") + } + + for _, v := range []map[int32]int64{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v248: %v\n", v) + var v248v1, v248v2 map[int32]int64 + v248v1 = v + bs248 := testMarshalErr(v248v1, h, t, "enc-map-v248") + if v == nil { + v248v2 = nil + } else { + v248v2 = make(map[int32]int64, len(v)) + } // reset map + testUnmarshalErr(v248v2, bs248, h, t, "dec-map-v248") + testDeepEqualErr(v248v1, v248v2, t, "equal-map-v248") + if v == nil { + v248v2 = nil + } else { + v248v2 = make(map[int32]int64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v248v2), bs248, h, t, "dec-map-v248-noaddr") // decode into non-addressable map value + testDeepEqualErr(v248v1, v248v2, t, "equal-map-v248-noaddr") + if v == nil { + v248v2 = nil + } else { + v248v2 = make(map[int32]int64, len(v)) + } // reset map + testUnmarshalErr(&v248v2, bs248, h, t, "dec-map-v248-p-len") + testDeepEqualErr(v248v1, v248v2, t, "equal-map-v248-p-len") + bs248 = testMarshalErr(&v248v1, h, t, "enc-map-v248-p") + v248v2 = nil + testUnmarshalErr(&v248v2, bs248, h, t, "dec-map-v248-p-nil") + testDeepEqualErr(v248v1, v248v2, t, "equal-map-v248-p-nil") + // ... + if v == nil { + v248v2 = nil + } else { + v248v2 = make(map[int32]int64, len(v)) + } // reset map + var v248v3, v248v4 typMapMapInt32Int64 + v248v3 = typMapMapInt32Int64(v248v1) + v248v4 = typMapMapInt32Int64(v248v2) + bs248 = testMarshalErr(v248v3, h, t, "enc-map-v248-custom") + testUnmarshalErr(v248v4, bs248, h, t, "dec-map-v248-p-len") + testDeepEqualErr(v248v3, v248v4, t, "equal-map-v248-p-len") + } + + for _, v := range []map[int32]float32{nil, {}, {44: 0, 33: 22.2}} { + // fmt.Printf(">>>> running mammoth map v249: %v\n", v) + var v249v1, v249v2 map[int32]float32 + v249v1 = v + bs249 := testMarshalErr(v249v1, h, t, "enc-map-v249") + if v == nil { + v249v2 = nil + } else { + v249v2 = make(map[int32]float32, len(v)) + } // reset map + testUnmarshalErr(v249v2, bs249, h, t, "dec-map-v249") + testDeepEqualErr(v249v1, v249v2, t, "equal-map-v249") + if v == nil { + v249v2 = nil + } else { + v249v2 = make(map[int32]float32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v249v2), bs249, h, t, "dec-map-v249-noaddr") // decode into non-addressable map value + testDeepEqualErr(v249v1, v249v2, t, "equal-map-v249-noaddr") + if v == nil { + v249v2 = nil + } else { + v249v2 = make(map[int32]float32, len(v)) + } // reset map + testUnmarshalErr(&v249v2, bs249, h, t, "dec-map-v249-p-len") + testDeepEqualErr(v249v1, v249v2, t, "equal-map-v249-p-len") + bs249 = testMarshalErr(&v249v1, h, t, "enc-map-v249-p") + v249v2 = nil + testUnmarshalErr(&v249v2, bs249, h, t, "dec-map-v249-p-nil") + testDeepEqualErr(v249v1, v249v2, t, "equal-map-v249-p-nil") + // ... + if v == nil { + v249v2 = nil + } else { + v249v2 = make(map[int32]float32, len(v)) + } // reset map + var v249v3, v249v4 typMapMapInt32Float32 + v249v3 = typMapMapInt32Float32(v249v1) + v249v4 = typMapMapInt32Float32(v249v2) + bs249 = testMarshalErr(v249v3, h, t, "enc-map-v249-custom") + testUnmarshalErr(v249v4, bs249, h, t, "dec-map-v249-p-len") + testDeepEqualErr(v249v3, v249v4, t, "equal-map-v249-p-len") + } + + for _, v := range []map[int32]float64{nil, {}, {44: 0, 33: 11.1}} { + // fmt.Printf(">>>> running mammoth map v250: %v\n", v) + var v250v1, v250v2 map[int32]float64 + v250v1 = v + bs250 := testMarshalErr(v250v1, h, t, "enc-map-v250") + if v == nil { + v250v2 = nil + } else { + v250v2 = make(map[int32]float64, len(v)) + } // reset map + testUnmarshalErr(v250v2, bs250, h, t, "dec-map-v250") + testDeepEqualErr(v250v1, v250v2, t, "equal-map-v250") + if v == nil { + v250v2 = nil + } else { + v250v2 = make(map[int32]float64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v250v2), bs250, h, t, "dec-map-v250-noaddr") // decode into non-addressable map value + testDeepEqualErr(v250v1, v250v2, t, "equal-map-v250-noaddr") + if v == nil { + v250v2 = nil + } else { + v250v2 = make(map[int32]float64, len(v)) + } // reset map + testUnmarshalErr(&v250v2, bs250, h, t, "dec-map-v250-p-len") + testDeepEqualErr(v250v1, v250v2, t, "equal-map-v250-p-len") + bs250 = testMarshalErr(&v250v1, h, t, "enc-map-v250-p") + v250v2 = nil + testUnmarshalErr(&v250v2, bs250, h, t, "dec-map-v250-p-nil") + testDeepEqualErr(v250v1, v250v2, t, "equal-map-v250-p-nil") + // ... + if v == nil { + v250v2 = nil + } else { + v250v2 = make(map[int32]float64, len(v)) + } // reset map + var v250v3, v250v4 typMapMapInt32Float64 + v250v3 = typMapMapInt32Float64(v250v1) + v250v4 = typMapMapInt32Float64(v250v2) + bs250 = testMarshalErr(v250v3, h, t, "enc-map-v250-custom") + testUnmarshalErr(v250v4, bs250, h, t, "dec-map-v250-p-len") + testDeepEqualErr(v250v3, v250v4, t, "equal-map-v250-p-len") + } + + for _, v := range []map[int32]bool{nil, {}, {44: false, 33: true}} { + // fmt.Printf(">>>> running mammoth map v251: %v\n", v) + var v251v1, v251v2 map[int32]bool + v251v1 = v + bs251 := testMarshalErr(v251v1, h, t, "enc-map-v251") + if v == nil { + v251v2 = nil + } else { + v251v2 = make(map[int32]bool, len(v)) + } // reset map + testUnmarshalErr(v251v2, bs251, h, t, "dec-map-v251") + testDeepEqualErr(v251v1, v251v2, t, "equal-map-v251") + if v == nil { + v251v2 = nil + } else { + v251v2 = make(map[int32]bool, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v251v2), bs251, h, t, "dec-map-v251-noaddr") // decode into non-addressable map value + testDeepEqualErr(v251v1, v251v2, t, "equal-map-v251-noaddr") + if v == nil { + v251v2 = nil + } else { + v251v2 = make(map[int32]bool, len(v)) + } // reset map + testUnmarshalErr(&v251v2, bs251, h, t, "dec-map-v251-p-len") + testDeepEqualErr(v251v1, v251v2, t, "equal-map-v251-p-len") + bs251 = testMarshalErr(&v251v1, h, t, "enc-map-v251-p") + v251v2 = nil + testUnmarshalErr(&v251v2, bs251, h, t, "dec-map-v251-p-nil") + testDeepEqualErr(v251v1, v251v2, t, "equal-map-v251-p-nil") + // ... + if v == nil { + v251v2 = nil + } else { + v251v2 = make(map[int32]bool, len(v)) + } // reset map + var v251v3, v251v4 typMapMapInt32Bool + v251v3 = typMapMapInt32Bool(v251v1) + v251v4 = typMapMapInt32Bool(v251v2) + bs251 = testMarshalErr(v251v3, h, t, "enc-map-v251-custom") + testUnmarshalErr(v251v4, bs251, h, t, "dec-map-v251-p-len") + testDeepEqualErr(v251v3, v251v4, t, "equal-map-v251-p-len") + } + + for _, v := range []map[int64]interface{}{nil, {}, {44: nil, 33: "string-is-an-interface-2"}} { + // fmt.Printf(">>>> running mammoth map v254: %v\n", v) + var v254v1, v254v2 map[int64]interface{} + v254v1 = v + bs254 := testMarshalErr(v254v1, h, t, "enc-map-v254") + if v == nil { + v254v2 = nil + } else { + v254v2 = make(map[int64]interface{}, len(v)) + } // reset map + testUnmarshalErr(v254v2, bs254, h, t, "dec-map-v254") + testDeepEqualErr(v254v1, v254v2, t, "equal-map-v254") + if v == nil { + v254v2 = nil + } else { + v254v2 = make(map[int64]interface{}, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v254v2), bs254, h, t, "dec-map-v254-noaddr") // decode into non-addressable map value + testDeepEqualErr(v254v1, v254v2, t, "equal-map-v254-noaddr") + if v == nil { + v254v2 = nil + } else { + v254v2 = make(map[int64]interface{}, len(v)) + } // reset map + testUnmarshalErr(&v254v2, bs254, h, t, "dec-map-v254-p-len") + testDeepEqualErr(v254v1, v254v2, t, "equal-map-v254-p-len") + bs254 = testMarshalErr(&v254v1, h, t, "enc-map-v254-p") + v254v2 = nil + testUnmarshalErr(&v254v2, bs254, h, t, "dec-map-v254-p-nil") + testDeepEqualErr(v254v1, v254v2, t, "equal-map-v254-p-nil") + // ... + if v == nil { + v254v2 = nil + } else { + v254v2 = make(map[int64]interface{}, len(v)) + } // reset map + var v254v3, v254v4 typMapMapInt64Intf + v254v3 = typMapMapInt64Intf(v254v1) + v254v4 = typMapMapInt64Intf(v254v2) + bs254 = testMarshalErr(v254v3, h, t, "enc-map-v254-custom") + testUnmarshalErr(v254v4, bs254, h, t, "dec-map-v254-p-len") + testDeepEqualErr(v254v3, v254v4, t, "equal-map-v254-p-len") + } + + for _, v := range []map[int64]string{nil, {}, {44: "", 33: "some-string-2"}} { + // fmt.Printf(">>>> running mammoth map v255: %v\n", v) + var v255v1, v255v2 map[int64]string + v255v1 = v + bs255 := testMarshalErr(v255v1, h, t, "enc-map-v255") + if v == nil { + v255v2 = nil + } else { + v255v2 = make(map[int64]string, len(v)) + } // reset map + testUnmarshalErr(v255v2, bs255, h, t, "dec-map-v255") + testDeepEqualErr(v255v1, v255v2, t, "equal-map-v255") + if v == nil { + v255v2 = nil + } else { + v255v2 = make(map[int64]string, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v255v2), bs255, h, t, "dec-map-v255-noaddr") // decode into non-addressable map value + testDeepEqualErr(v255v1, v255v2, t, "equal-map-v255-noaddr") + if v == nil { + v255v2 = nil + } else { + v255v2 = make(map[int64]string, len(v)) + } // reset map + testUnmarshalErr(&v255v2, bs255, h, t, "dec-map-v255-p-len") + testDeepEqualErr(v255v1, v255v2, t, "equal-map-v255-p-len") + bs255 = testMarshalErr(&v255v1, h, t, "enc-map-v255-p") + v255v2 = nil + testUnmarshalErr(&v255v2, bs255, h, t, "dec-map-v255-p-nil") + testDeepEqualErr(v255v1, v255v2, t, "equal-map-v255-p-nil") + // ... + if v == nil { + v255v2 = nil + } else { + v255v2 = make(map[int64]string, len(v)) + } // reset map + var v255v3, v255v4 typMapMapInt64String + v255v3 = typMapMapInt64String(v255v1) + v255v4 = typMapMapInt64String(v255v2) + bs255 = testMarshalErr(v255v3, h, t, "enc-map-v255-custom") + testUnmarshalErr(v255v4, bs255, h, t, "dec-map-v255-p-len") + testDeepEqualErr(v255v3, v255v4, t, "equal-map-v255-p-len") + } + + for _, v := range []map[int64]uint{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v256: %v\n", v) + var v256v1, v256v2 map[int64]uint + v256v1 = v + bs256 := testMarshalErr(v256v1, h, t, "enc-map-v256") + if v == nil { + v256v2 = nil + } else { + v256v2 = make(map[int64]uint, len(v)) + } // reset map + testUnmarshalErr(v256v2, bs256, h, t, "dec-map-v256") + testDeepEqualErr(v256v1, v256v2, t, "equal-map-v256") + if v == nil { + v256v2 = nil + } else { + v256v2 = make(map[int64]uint, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v256v2), bs256, h, t, "dec-map-v256-noaddr") // decode into non-addressable map value + testDeepEqualErr(v256v1, v256v2, t, "equal-map-v256-noaddr") + if v == nil { + v256v2 = nil + } else { + v256v2 = make(map[int64]uint, len(v)) + } // reset map + testUnmarshalErr(&v256v2, bs256, h, t, "dec-map-v256-p-len") + testDeepEqualErr(v256v1, v256v2, t, "equal-map-v256-p-len") + bs256 = testMarshalErr(&v256v1, h, t, "enc-map-v256-p") + v256v2 = nil + testUnmarshalErr(&v256v2, bs256, h, t, "dec-map-v256-p-nil") + testDeepEqualErr(v256v1, v256v2, t, "equal-map-v256-p-nil") + // ... + if v == nil { + v256v2 = nil + } else { + v256v2 = make(map[int64]uint, len(v)) + } // reset map + var v256v3, v256v4 typMapMapInt64Uint + v256v3 = typMapMapInt64Uint(v256v1) + v256v4 = typMapMapInt64Uint(v256v2) + bs256 = testMarshalErr(v256v3, h, t, "enc-map-v256-custom") + testUnmarshalErr(v256v4, bs256, h, t, "dec-map-v256-p-len") + testDeepEqualErr(v256v3, v256v4, t, "equal-map-v256-p-len") + } + + for _, v := range []map[int64]uint8{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v257: %v\n", v) + var v257v1, v257v2 map[int64]uint8 + v257v1 = v + bs257 := testMarshalErr(v257v1, h, t, "enc-map-v257") + if v == nil { + v257v2 = nil + } else { + v257v2 = make(map[int64]uint8, len(v)) + } // reset map + testUnmarshalErr(v257v2, bs257, h, t, "dec-map-v257") + testDeepEqualErr(v257v1, v257v2, t, "equal-map-v257") + if v == nil { + v257v2 = nil + } else { + v257v2 = make(map[int64]uint8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v257v2), bs257, h, t, "dec-map-v257-noaddr") // decode into non-addressable map value + testDeepEqualErr(v257v1, v257v2, t, "equal-map-v257-noaddr") + if v == nil { + v257v2 = nil + } else { + v257v2 = make(map[int64]uint8, len(v)) + } // reset map + testUnmarshalErr(&v257v2, bs257, h, t, "dec-map-v257-p-len") + testDeepEqualErr(v257v1, v257v2, t, "equal-map-v257-p-len") + bs257 = testMarshalErr(&v257v1, h, t, "enc-map-v257-p") + v257v2 = nil + testUnmarshalErr(&v257v2, bs257, h, t, "dec-map-v257-p-nil") + testDeepEqualErr(v257v1, v257v2, t, "equal-map-v257-p-nil") + // ... + if v == nil { + v257v2 = nil + } else { + v257v2 = make(map[int64]uint8, len(v)) + } // reset map + var v257v3, v257v4 typMapMapInt64Uint8 + v257v3 = typMapMapInt64Uint8(v257v1) + v257v4 = typMapMapInt64Uint8(v257v2) + bs257 = testMarshalErr(v257v3, h, t, "enc-map-v257-custom") + testUnmarshalErr(v257v4, bs257, h, t, "dec-map-v257-p-len") + testDeepEqualErr(v257v3, v257v4, t, "equal-map-v257-p-len") + } + + for _, v := range []map[int64]uint16{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v258: %v\n", v) + var v258v1, v258v2 map[int64]uint16 + v258v1 = v + bs258 := testMarshalErr(v258v1, h, t, "enc-map-v258") + if v == nil { + v258v2 = nil + } else { + v258v2 = make(map[int64]uint16, len(v)) + } // reset map + testUnmarshalErr(v258v2, bs258, h, t, "dec-map-v258") + testDeepEqualErr(v258v1, v258v2, t, "equal-map-v258") + if v == nil { + v258v2 = nil + } else { + v258v2 = make(map[int64]uint16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v258v2), bs258, h, t, "dec-map-v258-noaddr") // decode into non-addressable map value + testDeepEqualErr(v258v1, v258v2, t, "equal-map-v258-noaddr") + if v == nil { + v258v2 = nil + } else { + v258v2 = make(map[int64]uint16, len(v)) + } // reset map + testUnmarshalErr(&v258v2, bs258, h, t, "dec-map-v258-p-len") + testDeepEqualErr(v258v1, v258v2, t, "equal-map-v258-p-len") + bs258 = testMarshalErr(&v258v1, h, t, "enc-map-v258-p") + v258v2 = nil + testUnmarshalErr(&v258v2, bs258, h, t, "dec-map-v258-p-nil") + testDeepEqualErr(v258v1, v258v2, t, "equal-map-v258-p-nil") + // ... + if v == nil { + v258v2 = nil + } else { + v258v2 = make(map[int64]uint16, len(v)) + } // reset map + var v258v3, v258v4 typMapMapInt64Uint16 + v258v3 = typMapMapInt64Uint16(v258v1) + v258v4 = typMapMapInt64Uint16(v258v2) + bs258 = testMarshalErr(v258v3, h, t, "enc-map-v258-custom") + testUnmarshalErr(v258v4, bs258, h, t, "dec-map-v258-p-len") + testDeepEqualErr(v258v3, v258v4, t, "equal-map-v258-p-len") + } + + for _, v := range []map[int64]uint32{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v259: %v\n", v) + var v259v1, v259v2 map[int64]uint32 + v259v1 = v + bs259 := testMarshalErr(v259v1, h, t, "enc-map-v259") + if v == nil { + v259v2 = nil + } else { + v259v2 = make(map[int64]uint32, len(v)) + } // reset map + testUnmarshalErr(v259v2, bs259, h, t, "dec-map-v259") + testDeepEqualErr(v259v1, v259v2, t, "equal-map-v259") + if v == nil { + v259v2 = nil + } else { + v259v2 = make(map[int64]uint32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v259v2), bs259, h, t, "dec-map-v259-noaddr") // decode into non-addressable map value + testDeepEqualErr(v259v1, v259v2, t, "equal-map-v259-noaddr") + if v == nil { + v259v2 = nil + } else { + v259v2 = make(map[int64]uint32, len(v)) + } // reset map + testUnmarshalErr(&v259v2, bs259, h, t, "dec-map-v259-p-len") + testDeepEqualErr(v259v1, v259v2, t, "equal-map-v259-p-len") + bs259 = testMarshalErr(&v259v1, h, t, "enc-map-v259-p") + v259v2 = nil + testUnmarshalErr(&v259v2, bs259, h, t, "dec-map-v259-p-nil") + testDeepEqualErr(v259v1, v259v2, t, "equal-map-v259-p-nil") + // ... + if v == nil { + v259v2 = nil + } else { + v259v2 = make(map[int64]uint32, len(v)) + } // reset map + var v259v3, v259v4 typMapMapInt64Uint32 + v259v3 = typMapMapInt64Uint32(v259v1) + v259v4 = typMapMapInt64Uint32(v259v2) + bs259 = testMarshalErr(v259v3, h, t, "enc-map-v259-custom") + testUnmarshalErr(v259v4, bs259, h, t, "dec-map-v259-p-len") + testDeepEqualErr(v259v3, v259v4, t, "equal-map-v259-p-len") + } + + for _, v := range []map[int64]uint64{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v260: %v\n", v) + var v260v1, v260v2 map[int64]uint64 + v260v1 = v + bs260 := testMarshalErr(v260v1, h, t, "enc-map-v260") + if v == nil { + v260v2 = nil + } else { + v260v2 = make(map[int64]uint64, len(v)) + } // reset map + testUnmarshalErr(v260v2, bs260, h, t, "dec-map-v260") + testDeepEqualErr(v260v1, v260v2, t, "equal-map-v260") + if v == nil { + v260v2 = nil + } else { + v260v2 = make(map[int64]uint64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v260v2), bs260, h, t, "dec-map-v260-noaddr") // decode into non-addressable map value + testDeepEqualErr(v260v1, v260v2, t, "equal-map-v260-noaddr") + if v == nil { + v260v2 = nil + } else { + v260v2 = make(map[int64]uint64, len(v)) + } // reset map + testUnmarshalErr(&v260v2, bs260, h, t, "dec-map-v260-p-len") + testDeepEqualErr(v260v1, v260v2, t, "equal-map-v260-p-len") + bs260 = testMarshalErr(&v260v1, h, t, "enc-map-v260-p") + v260v2 = nil + testUnmarshalErr(&v260v2, bs260, h, t, "dec-map-v260-p-nil") + testDeepEqualErr(v260v1, v260v2, t, "equal-map-v260-p-nil") + // ... + if v == nil { + v260v2 = nil + } else { + v260v2 = make(map[int64]uint64, len(v)) + } // reset map + var v260v3, v260v4 typMapMapInt64Uint64 + v260v3 = typMapMapInt64Uint64(v260v1) + v260v4 = typMapMapInt64Uint64(v260v2) + bs260 = testMarshalErr(v260v3, h, t, "enc-map-v260-custom") + testUnmarshalErr(v260v4, bs260, h, t, "dec-map-v260-p-len") + testDeepEqualErr(v260v3, v260v4, t, "equal-map-v260-p-len") + } + + for _, v := range []map[int64]uintptr{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v261: %v\n", v) + var v261v1, v261v2 map[int64]uintptr + v261v1 = v + bs261 := testMarshalErr(v261v1, h, t, "enc-map-v261") + if v == nil { + v261v2 = nil + } else { + v261v2 = make(map[int64]uintptr, len(v)) + } // reset map + testUnmarshalErr(v261v2, bs261, h, t, "dec-map-v261") + testDeepEqualErr(v261v1, v261v2, t, "equal-map-v261") + if v == nil { + v261v2 = nil + } else { + v261v2 = make(map[int64]uintptr, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v261v2), bs261, h, t, "dec-map-v261-noaddr") // decode into non-addressable map value + testDeepEqualErr(v261v1, v261v2, t, "equal-map-v261-noaddr") + if v == nil { + v261v2 = nil + } else { + v261v2 = make(map[int64]uintptr, len(v)) + } // reset map + testUnmarshalErr(&v261v2, bs261, h, t, "dec-map-v261-p-len") + testDeepEqualErr(v261v1, v261v2, t, "equal-map-v261-p-len") + bs261 = testMarshalErr(&v261v1, h, t, "enc-map-v261-p") + v261v2 = nil + testUnmarshalErr(&v261v2, bs261, h, t, "dec-map-v261-p-nil") + testDeepEqualErr(v261v1, v261v2, t, "equal-map-v261-p-nil") + // ... + if v == nil { + v261v2 = nil + } else { + v261v2 = make(map[int64]uintptr, len(v)) + } // reset map + var v261v3, v261v4 typMapMapInt64Uintptr + v261v3 = typMapMapInt64Uintptr(v261v1) + v261v4 = typMapMapInt64Uintptr(v261v2) + bs261 = testMarshalErr(v261v3, h, t, "enc-map-v261-custom") + testUnmarshalErr(v261v4, bs261, h, t, "dec-map-v261-p-len") + testDeepEqualErr(v261v3, v261v4, t, "equal-map-v261-p-len") + } + + for _, v := range []map[int64]int{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v262: %v\n", v) + var v262v1, v262v2 map[int64]int + v262v1 = v + bs262 := testMarshalErr(v262v1, h, t, "enc-map-v262") + if v == nil { + v262v2 = nil + } else { + v262v2 = make(map[int64]int, len(v)) + } // reset map + testUnmarshalErr(v262v2, bs262, h, t, "dec-map-v262") + testDeepEqualErr(v262v1, v262v2, t, "equal-map-v262") + if v == nil { + v262v2 = nil + } else { + v262v2 = make(map[int64]int, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v262v2), bs262, h, t, "dec-map-v262-noaddr") // decode into non-addressable map value + testDeepEqualErr(v262v1, v262v2, t, "equal-map-v262-noaddr") + if v == nil { + v262v2 = nil + } else { + v262v2 = make(map[int64]int, len(v)) + } // reset map + testUnmarshalErr(&v262v2, bs262, h, t, "dec-map-v262-p-len") + testDeepEqualErr(v262v1, v262v2, t, "equal-map-v262-p-len") + bs262 = testMarshalErr(&v262v1, h, t, "enc-map-v262-p") + v262v2 = nil + testUnmarshalErr(&v262v2, bs262, h, t, "dec-map-v262-p-nil") + testDeepEqualErr(v262v1, v262v2, t, "equal-map-v262-p-nil") + // ... + if v == nil { + v262v2 = nil + } else { + v262v2 = make(map[int64]int, len(v)) + } // reset map + var v262v3, v262v4 typMapMapInt64Int + v262v3 = typMapMapInt64Int(v262v1) + v262v4 = typMapMapInt64Int(v262v2) + bs262 = testMarshalErr(v262v3, h, t, "enc-map-v262-custom") + testUnmarshalErr(v262v4, bs262, h, t, "dec-map-v262-p-len") + testDeepEqualErr(v262v3, v262v4, t, "equal-map-v262-p-len") + } + + for _, v := range []map[int64]int8{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v263: %v\n", v) + var v263v1, v263v2 map[int64]int8 + v263v1 = v + bs263 := testMarshalErr(v263v1, h, t, "enc-map-v263") + if v == nil { + v263v2 = nil + } else { + v263v2 = make(map[int64]int8, len(v)) + } // reset map + testUnmarshalErr(v263v2, bs263, h, t, "dec-map-v263") + testDeepEqualErr(v263v1, v263v2, t, "equal-map-v263") + if v == nil { + v263v2 = nil + } else { + v263v2 = make(map[int64]int8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v263v2), bs263, h, t, "dec-map-v263-noaddr") // decode into non-addressable map value + testDeepEqualErr(v263v1, v263v2, t, "equal-map-v263-noaddr") + if v == nil { + v263v2 = nil + } else { + v263v2 = make(map[int64]int8, len(v)) + } // reset map + testUnmarshalErr(&v263v2, bs263, h, t, "dec-map-v263-p-len") + testDeepEqualErr(v263v1, v263v2, t, "equal-map-v263-p-len") + bs263 = testMarshalErr(&v263v1, h, t, "enc-map-v263-p") + v263v2 = nil + testUnmarshalErr(&v263v2, bs263, h, t, "dec-map-v263-p-nil") + testDeepEqualErr(v263v1, v263v2, t, "equal-map-v263-p-nil") + // ... + if v == nil { + v263v2 = nil + } else { + v263v2 = make(map[int64]int8, len(v)) + } // reset map + var v263v3, v263v4 typMapMapInt64Int8 + v263v3 = typMapMapInt64Int8(v263v1) + v263v4 = typMapMapInt64Int8(v263v2) + bs263 = testMarshalErr(v263v3, h, t, "enc-map-v263-custom") + testUnmarshalErr(v263v4, bs263, h, t, "dec-map-v263-p-len") + testDeepEqualErr(v263v3, v263v4, t, "equal-map-v263-p-len") + } + + for _, v := range []map[int64]int16{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v264: %v\n", v) + var v264v1, v264v2 map[int64]int16 + v264v1 = v + bs264 := testMarshalErr(v264v1, h, t, "enc-map-v264") + if v == nil { + v264v2 = nil + } else { + v264v2 = make(map[int64]int16, len(v)) + } // reset map + testUnmarshalErr(v264v2, bs264, h, t, "dec-map-v264") + testDeepEqualErr(v264v1, v264v2, t, "equal-map-v264") + if v == nil { + v264v2 = nil + } else { + v264v2 = make(map[int64]int16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v264v2), bs264, h, t, "dec-map-v264-noaddr") // decode into non-addressable map value + testDeepEqualErr(v264v1, v264v2, t, "equal-map-v264-noaddr") + if v == nil { + v264v2 = nil + } else { + v264v2 = make(map[int64]int16, len(v)) + } // reset map + testUnmarshalErr(&v264v2, bs264, h, t, "dec-map-v264-p-len") + testDeepEqualErr(v264v1, v264v2, t, "equal-map-v264-p-len") + bs264 = testMarshalErr(&v264v1, h, t, "enc-map-v264-p") + v264v2 = nil + testUnmarshalErr(&v264v2, bs264, h, t, "dec-map-v264-p-nil") + testDeepEqualErr(v264v1, v264v2, t, "equal-map-v264-p-nil") + // ... + if v == nil { + v264v2 = nil + } else { + v264v2 = make(map[int64]int16, len(v)) + } // reset map + var v264v3, v264v4 typMapMapInt64Int16 + v264v3 = typMapMapInt64Int16(v264v1) + v264v4 = typMapMapInt64Int16(v264v2) + bs264 = testMarshalErr(v264v3, h, t, "enc-map-v264-custom") + testUnmarshalErr(v264v4, bs264, h, t, "dec-map-v264-p-len") + testDeepEqualErr(v264v3, v264v4, t, "equal-map-v264-p-len") + } + + for _, v := range []map[int64]int32{nil, {}, {33: 0, 44: 33}} { + // fmt.Printf(">>>> running mammoth map v265: %v\n", v) + var v265v1, v265v2 map[int64]int32 + v265v1 = v + bs265 := testMarshalErr(v265v1, h, t, "enc-map-v265") + if v == nil { + v265v2 = nil + } else { + v265v2 = make(map[int64]int32, len(v)) + } // reset map + testUnmarshalErr(v265v2, bs265, h, t, "dec-map-v265") + testDeepEqualErr(v265v1, v265v2, t, "equal-map-v265") + if v == nil { + v265v2 = nil + } else { + v265v2 = make(map[int64]int32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v265v2), bs265, h, t, "dec-map-v265-noaddr") // decode into non-addressable map value + testDeepEqualErr(v265v1, v265v2, t, "equal-map-v265-noaddr") + if v == nil { + v265v2 = nil + } else { + v265v2 = make(map[int64]int32, len(v)) + } // reset map + testUnmarshalErr(&v265v2, bs265, h, t, "dec-map-v265-p-len") + testDeepEqualErr(v265v1, v265v2, t, "equal-map-v265-p-len") + bs265 = testMarshalErr(&v265v1, h, t, "enc-map-v265-p") + v265v2 = nil + testUnmarshalErr(&v265v2, bs265, h, t, "dec-map-v265-p-nil") + testDeepEqualErr(v265v1, v265v2, t, "equal-map-v265-p-nil") + // ... + if v == nil { + v265v2 = nil + } else { + v265v2 = make(map[int64]int32, len(v)) + } // reset map + var v265v3, v265v4 typMapMapInt64Int32 + v265v3 = typMapMapInt64Int32(v265v1) + v265v4 = typMapMapInt64Int32(v265v2) + bs265 = testMarshalErr(v265v3, h, t, "enc-map-v265-custom") + testUnmarshalErr(v265v4, bs265, h, t, "dec-map-v265-p-len") + testDeepEqualErr(v265v3, v265v4, t, "equal-map-v265-p-len") + } + + for _, v := range []map[int64]int64{nil, {}, {44: 0, 33: 44}} { + // fmt.Printf(">>>> running mammoth map v266: %v\n", v) + var v266v1, v266v2 map[int64]int64 + v266v1 = v + bs266 := testMarshalErr(v266v1, h, t, "enc-map-v266") + if v == nil { + v266v2 = nil + } else { + v266v2 = make(map[int64]int64, len(v)) + } // reset map + testUnmarshalErr(v266v2, bs266, h, t, "dec-map-v266") + testDeepEqualErr(v266v1, v266v2, t, "equal-map-v266") + if v == nil { + v266v2 = nil + } else { + v266v2 = make(map[int64]int64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v266v2), bs266, h, t, "dec-map-v266-noaddr") // decode into non-addressable map value + testDeepEqualErr(v266v1, v266v2, t, "equal-map-v266-noaddr") + if v == nil { + v266v2 = nil + } else { + v266v2 = make(map[int64]int64, len(v)) + } // reset map + testUnmarshalErr(&v266v2, bs266, h, t, "dec-map-v266-p-len") + testDeepEqualErr(v266v1, v266v2, t, "equal-map-v266-p-len") + bs266 = testMarshalErr(&v266v1, h, t, "enc-map-v266-p") + v266v2 = nil + testUnmarshalErr(&v266v2, bs266, h, t, "dec-map-v266-p-nil") + testDeepEqualErr(v266v1, v266v2, t, "equal-map-v266-p-nil") + // ... + if v == nil { + v266v2 = nil + } else { + v266v2 = make(map[int64]int64, len(v)) + } // reset map + var v266v3, v266v4 typMapMapInt64Int64 + v266v3 = typMapMapInt64Int64(v266v1) + v266v4 = typMapMapInt64Int64(v266v2) + bs266 = testMarshalErr(v266v3, h, t, "enc-map-v266-custom") + testUnmarshalErr(v266v4, bs266, h, t, "dec-map-v266-p-len") + testDeepEqualErr(v266v3, v266v4, t, "equal-map-v266-p-len") + } + + for _, v := range []map[int64]float32{nil, {}, {33: 0, 44: 22.2}} { + // fmt.Printf(">>>> running mammoth map v267: %v\n", v) + var v267v1, v267v2 map[int64]float32 + v267v1 = v + bs267 := testMarshalErr(v267v1, h, t, "enc-map-v267") + if v == nil { + v267v2 = nil + } else { + v267v2 = make(map[int64]float32, len(v)) + } // reset map + testUnmarshalErr(v267v2, bs267, h, t, "dec-map-v267") + testDeepEqualErr(v267v1, v267v2, t, "equal-map-v267") + if v == nil { + v267v2 = nil + } else { + v267v2 = make(map[int64]float32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v267v2), bs267, h, t, "dec-map-v267-noaddr") // decode into non-addressable map value + testDeepEqualErr(v267v1, v267v2, t, "equal-map-v267-noaddr") + if v == nil { + v267v2 = nil + } else { + v267v2 = make(map[int64]float32, len(v)) + } // reset map + testUnmarshalErr(&v267v2, bs267, h, t, "dec-map-v267-p-len") + testDeepEqualErr(v267v1, v267v2, t, "equal-map-v267-p-len") + bs267 = testMarshalErr(&v267v1, h, t, "enc-map-v267-p") + v267v2 = nil + testUnmarshalErr(&v267v2, bs267, h, t, "dec-map-v267-p-nil") + testDeepEqualErr(v267v1, v267v2, t, "equal-map-v267-p-nil") + // ... + if v == nil { + v267v2 = nil + } else { + v267v2 = make(map[int64]float32, len(v)) + } // reset map + var v267v3, v267v4 typMapMapInt64Float32 + v267v3 = typMapMapInt64Float32(v267v1) + v267v4 = typMapMapInt64Float32(v267v2) + bs267 = testMarshalErr(v267v3, h, t, "enc-map-v267-custom") + testUnmarshalErr(v267v4, bs267, h, t, "dec-map-v267-p-len") + testDeepEqualErr(v267v3, v267v4, t, "equal-map-v267-p-len") + } + + for _, v := range []map[int64]float64{nil, {}, {33: 0, 44: 11.1}} { + // fmt.Printf(">>>> running mammoth map v268: %v\n", v) + var v268v1, v268v2 map[int64]float64 + v268v1 = v + bs268 := testMarshalErr(v268v1, h, t, "enc-map-v268") + if v == nil { + v268v2 = nil + } else { + v268v2 = make(map[int64]float64, len(v)) + } // reset map + testUnmarshalErr(v268v2, bs268, h, t, "dec-map-v268") + testDeepEqualErr(v268v1, v268v2, t, "equal-map-v268") + if v == nil { + v268v2 = nil + } else { + v268v2 = make(map[int64]float64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v268v2), bs268, h, t, "dec-map-v268-noaddr") // decode into non-addressable map value + testDeepEqualErr(v268v1, v268v2, t, "equal-map-v268-noaddr") + if v == nil { + v268v2 = nil + } else { + v268v2 = make(map[int64]float64, len(v)) + } // reset map + testUnmarshalErr(&v268v2, bs268, h, t, "dec-map-v268-p-len") + testDeepEqualErr(v268v1, v268v2, t, "equal-map-v268-p-len") + bs268 = testMarshalErr(&v268v1, h, t, "enc-map-v268-p") + v268v2 = nil + testUnmarshalErr(&v268v2, bs268, h, t, "dec-map-v268-p-nil") + testDeepEqualErr(v268v1, v268v2, t, "equal-map-v268-p-nil") + // ... + if v == nil { + v268v2 = nil + } else { + v268v2 = make(map[int64]float64, len(v)) + } // reset map + var v268v3, v268v4 typMapMapInt64Float64 + v268v3 = typMapMapInt64Float64(v268v1) + v268v4 = typMapMapInt64Float64(v268v2) + bs268 = testMarshalErr(v268v3, h, t, "enc-map-v268-custom") + testUnmarshalErr(v268v4, bs268, h, t, "dec-map-v268-p-len") + testDeepEqualErr(v268v3, v268v4, t, "equal-map-v268-p-len") + } + + for _, v := range []map[int64]bool{nil, {}, {33: false, 44: true}} { + // fmt.Printf(">>>> running mammoth map v269: %v\n", v) + var v269v1, v269v2 map[int64]bool + v269v1 = v + bs269 := testMarshalErr(v269v1, h, t, "enc-map-v269") + if v == nil { + v269v2 = nil + } else { + v269v2 = make(map[int64]bool, len(v)) + } // reset map + testUnmarshalErr(v269v2, bs269, h, t, "dec-map-v269") + testDeepEqualErr(v269v1, v269v2, t, "equal-map-v269") + if v == nil { + v269v2 = nil + } else { + v269v2 = make(map[int64]bool, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v269v2), bs269, h, t, "dec-map-v269-noaddr") // decode into non-addressable map value + testDeepEqualErr(v269v1, v269v2, t, "equal-map-v269-noaddr") + if v == nil { + v269v2 = nil + } else { + v269v2 = make(map[int64]bool, len(v)) + } // reset map + testUnmarshalErr(&v269v2, bs269, h, t, "dec-map-v269-p-len") + testDeepEqualErr(v269v1, v269v2, t, "equal-map-v269-p-len") + bs269 = testMarshalErr(&v269v1, h, t, "enc-map-v269-p") + v269v2 = nil + testUnmarshalErr(&v269v2, bs269, h, t, "dec-map-v269-p-nil") + testDeepEqualErr(v269v1, v269v2, t, "equal-map-v269-p-nil") + // ... + if v == nil { + v269v2 = nil + } else { + v269v2 = make(map[int64]bool, len(v)) + } // reset map + var v269v3, v269v4 typMapMapInt64Bool + v269v3 = typMapMapInt64Bool(v269v1) + v269v4 = typMapMapInt64Bool(v269v2) + bs269 = testMarshalErr(v269v3, h, t, "enc-map-v269-custom") + testUnmarshalErr(v269v4, bs269, h, t, "dec-map-v269-p-len") + testDeepEqualErr(v269v3, v269v4, t, "equal-map-v269-p-len") + } + + for _, v := range []map[bool]interface{}{nil, {}, {true: nil}} { + // fmt.Printf(">>>> running mammoth map v272: %v\n", v) + var v272v1, v272v2 map[bool]interface{} + v272v1 = v + bs272 := testMarshalErr(v272v1, h, t, "enc-map-v272") + if v == nil { + v272v2 = nil + } else { + v272v2 = make(map[bool]interface{}, len(v)) + } // reset map + testUnmarshalErr(v272v2, bs272, h, t, "dec-map-v272") + testDeepEqualErr(v272v1, v272v2, t, "equal-map-v272") + if v == nil { + v272v2 = nil + } else { + v272v2 = make(map[bool]interface{}, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v272v2), bs272, h, t, "dec-map-v272-noaddr") // decode into non-addressable map value + testDeepEqualErr(v272v1, v272v2, t, "equal-map-v272-noaddr") + if v == nil { + v272v2 = nil + } else { + v272v2 = make(map[bool]interface{}, len(v)) + } // reset map + testUnmarshalErr(&v272v2, bs272, h, t, "dec-map-v272-p-len") + testDeepEqualErr(v272v1, v272v2, t, "equal-map-v272-p-len") + bs272 = testMarshalErr(&v272v1, h, t, "enc-map-v272-p") + v272v2 = nil + testUnmarshalErr(&v272v2, bs272, h, t, "dec-map-v272-p-nil") + testDeepEqualErr(v272v1, v272v2, t, "equal-map-v272-p-nil") + // ... + if v == nil { + v272v2 = nil + } else { + v272v2 = make(map[bool]interface{}, len(v)) + } // reset map + var v272v3, v272v4 typMapMapBoolIntf + v272v3 = typMapMapBoolIntf(v272v1) + v272v4 = typMapMapBoolIntf(v272v2) + bs272 = testMarshalErr(v272v3, h, t, "enc-map-v272-custom") + testUnmarshalErr(v272v4, bs272, h, t, "dec-map-v272-p-len") + testDeepEqualErr(v272v3, v272v4, t, "equal-map-v272-p-len") + } + + for _, v := range []map[bool]string{nil, {}, {true: ""}} { + // fmt.Printf(">>>> running mammoth map v273: %v\n", v) + var v273v1, v273v2 map[bool]string + v273v1 = v + bs273 := testMarshalErr(v273v1, h, t, "enc-map-v273") + if v == nil { + v273v2 = nil + } else { + v273v2 = make(map[bool]string, len(v)) + } // reset map + testUnmarshalErr(v273v2, bs273, h, t, "dec-map-v273") + testDeepEqualErr(v273v1, v273v2, t, "equal-map-v273") + if v == nil { + v273v2 = nil + } else { + v273v2 = make(map[bool]string, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v273v2), bs273, h, t, "dec-map-v273-noaddr") // decode into non-addressable map value + testDeepEqualErr(v273v1, v273v2, t, "equal-map-v273-noaddr") + if v == nil { + v273v2 = nil + } else { + v273v2 = make(map[bool]string, len(v)) + } // reset map + testUnmarshalErr(&v273v2, bs273, h, t, "dec-map-v273-p-len") + testDeepEqualErr(v273v1, v273v2, t, "equal-map-v273-p-len") + bs273 = testMarshalErr(&v273v1, h, t, "enc-map-v273-p") + v273v2 = nil + testUnmarshalErr(&v273v2, bs273, h, t, "dec-map-v273-p-nil") + testDeepEqualErr(v273v1, v273v2, t, "equal-map-v273-p-nil") + // ... + if v == nil { + v273v2 = nil + } else { + v273v2 = make(map[bool]string, len(v)) + } // reset map + var v273v3, v273v4 typMapMapBoolString + v273v3 = typMapMapBoolString(v273v1) + v273v4 = typMapMapBoolString(v273v2) + bs273 = testMarshalErr(v273v3, h, t, "enc-map-v273-custom") + testUnmarshalErr(v273v4, bs273, h, t, "dec-map-v273-p-len") + testDeepEqualErr(v273v3, v273v4, t, "equal-map-v273-p-len") + } + + for _, v := range []map[bool]uint{nil, {}, {true: 0}} { + // fmt.Printf(">>>> running mammoth map v274: %v\n", v) + var v274v1, v274v2 map[bool]uint + v274v1 = v + bs274 := testMarshalErr(v274v1, h, t, "enc-map-v274") + if v == nil { + v274v2 = nil + } else { + v274v2 = make(map[bool]uint, len(v)) + } // reset map + testUnmarshalErr(v274v2, bs274, h, t, "dec-map-v274") + testDeepEqualErr(v274v1, v274v2, t, "equal-map-v274") + if v == nil { + v274v2 = nil + } else { + v274v2 = make(map[bool]uint, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v274v2), bs274, h, t, "dec-map-v274-noaddr") // decode into non-addressable map value + testDeepEqualErr(v274v1, v274v2, t, "equal-map-v274-noaddr") + if v == nil { + v274v2 = nil + } else { + v274v2 = make(map[bool]uint, len(v)) + } // reset map + testUnmarshalErr(&v274v2, bs274, h, t, "dec-map-v274-p-len") + testDeepEqualErr(v274v1, v274v2, t, "equal-map-v274-p-len") + bs274 = testMarshalErr(&v274v1, h, t, "enc-map-v274-p") + v274v2 = nil + testUnmarshalErr(&v274v2, bs274, h, t, "dec-map-v274-p-nil") + testDeepEqualErr(v274v1, v274v2, t, "equal-map-v274-p-nil") + // ... + if v == nil { + v274v2 = nil + } else { + v274v2 = make(map[bool]uint, len(v)) + } // reset map + var v274v3, v274v4 typMapMapBoolUint + v274v3 = typMapMapBoolUint(v274v1) + v274v4 = typMapMapBoolUint(v274v2) + bs274 = testMarshalErr(v274v3, h, t, "enc-map-v274-custom") + testUnmarshalErr(v274v4, bs274, h, t, "dec-map-v274-p-len") + testDeepEqualErr(v274v3, v274v4, t, "equal-map-v274-p-len") + } + + for _, v := range []map[bool]uint8{nil, {}, {true: 0}} { + // fmt.Printf(">>>> running mammoth map v275: %v\n", v) + var v275v1, v275v2 map[bool]uint8 + v275v1 = v + bs275 := testMarshalErr(v275v1, h, t, "enc-map-v275") + if v == nil { + v275v2 = nil + } else { + v275v2 = make(map[bool]uint8, len(v)) + } // reset map + testUnmarshalErr(v275v2, bs275, h, t, "dec-map-v275") + testDeepEqualErr(v275v1, v275v2, t, "equal-map-v275") + if v == nil { + v275v2 = nil + } else { + v275v2 = make(map[bool]uint8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v275v2), bs275, h, t, "dec-map-v275-noaddr") // decode into non-addressable map value + testDeepEqualErr(v275v1, v275v2, t, "equal-map-v275-noaddr") + if v == nil { + v275v2 = nil + } else { + v275v2 = make(map[bool]uint8, len(v)) + } // reset map + testUnmarshalErr(&v275v2, bs275, h, t, "dec-map-v275-p-len") + testDeepEqualErr(v275v1, v275v2, t, "equal-map-v275-p-len") + bs275 = testMarshalErr(&v275v1, h, t, "enc-map-v275-p") + v275v2 = nil + testUnmarshalErr(&v275v2, bs275, h, t, "dec-map-v275-p-nil") + testDeepEqualErr(v275v1, v275v2, t, "equal-map-v275-p-nil") + // ... + if v == nil { + v275v2 = nil + } else { + v275v2 = make(map[bool]uint8, len(v)) + } // reset map + var v275v3, v275v4 typMapMapBoolUint8 + v275v3 = typMapMapBoolUint8(v275v1) + v275v4 = typMapMapBoolUint8(v275v2) + bs275 = testMarshalErr(v275v3, h, t, "enc-map-v275-custom") + testUnmarshalErr(v275v4, bs275, h, t, "dec-map-v275-p-len") + testDeepEqualErr(v275v3, v275v4, t, "equal-map-v275-p-len") + } + + for _, v := range []map[bool]uint16{nil, {}, {true: 0}} { + // fmt.Printf(">>>> running mammoth map v276: %v\n", v) + var v276v1, v276v2 map[bool]uint16 + v276v1 = v + bs276 := testMarshalErr(v276v1, h, t, "enc-map-v276") + if v == nil { + v276v2 = nil + } else { + v276v2 = make(map[bool]uint16, len(v)) + } // reset map + testUnmarshalErr(v276v2, bs276, h, t, "dec-map-v276") + testDeepEqualErr(v276v1, v276v2, t, "equal-map-v276") + if v == nil { + v276v2 = nil + } else { + v276v2 = make(map[bool]uint16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v276v2), bs276, h, t, "dec-map-v276-noaddr") // decode into non-addressable map value + testDeepEqualErr(v276v1, v276v2, t, "equal-map-v276-noaddr") + if v == nil { + v276v2 = nil + } else { + v276v2 = make(map[bool]uint16, len(v)) + } // reset map + testUnmarshalErr(&v276v2, bs276, h, t, "dec-map-v276-p-len") + testDeepEqualErr(v276v1, v276v2, t, "equal-map-v276-p-len") + bs276 = testMarshalErr(&v276v1, h, t, "enc-map-v276-p") + v276v2 = nil + testUnmarshalErr(&v276v2, bs276, h, t, "dec-map-v276-p-nil") + testDeepEqualErr(v276v1, v276v2, t, "equal-map-v276-p-nil") + // ... + if v == nil { + v276v2 = nil + } else { + v276v2 = make(map[bool]uint16, len(v)) + } // reset map + var v276v3, v276v4 typMapMapBoolUint16 + v276v3 = typMapMapBoolUint16(v276v1) + v276v4 = typMapMapBoolUint16(v276v2) + bs276 = testMarshalErr(v276v3, h, t, "enc-map-v276-custom") + testUnmarshalErr(v276v4, bs276, h, t, "dec-map-v276-p-len") + testDeepEqualErr(v276v3, v276v4, t, "equal-map-v276-p-len") + } + + for _, v := range []map[bool]uint32{nil, {}, {true: 0}} { + // fmt.Printf(">>>> running mammoth map v277: %v\n", v) + var v277v1, v277v2 map[bool]uint32 + v277v1 = v + bs277 := testMarshalErr(v277v1, h, t, "enc-map-v277") + if v == nil { + v277v2 = nil + } else { + v277v2 = make(map[bool]uint32, len(v)) + } // reset map + testUnmarshalErr(v277v2, bs277, h, t, "dec-map-v277") + testDeepEqualErr(v277v1, v277v2, t, "equal-map-v277") + if v == nil { + v277v2 = nil + } else { + v277v2 = make(map[bool]uint32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v277v2), bs277, h, t, "dec-map-v277-noaddr") // decode into non-addressable map value + testDeepEqualErr(v277v1, v277v2, t, "equal-map-v277-noaddr") + if v == nil { + v277v2 = nil + } else { + v277v2 = make(map[bool]uint32, len(v)) + } // reset map + testUnmarshalErr(&v277v2, bs277, h, t, "dec-map-v277-p-len") + testDeepEqualErr(v277v1, v277v2, t, "equal-map-v277-p-len") + bs277 = testMarshalErr(&v277v1, h, t, "enc-map-v277-p") + v277v2 = nil + testUnmarshalErr(&v277v2, bs277, h, t, "dec-map-v277-p-nil") + testDeepEqualErr(v277v1, v277v2, t, "equal-map-v277-p-nil") + // ... + if v == nil { + v277v2 = nil + } else { + v277v2 = make(map[bool]uint32, len(v)) + } // reset map + var v277v3, v277v4 typMapMapBoolUint32 + v277v3 = typMapMapBoolUint32(v277v1) + v277v4 = typMapMapBoolUint32(v277v2) + bs277 = testMarshalErr(v277v3, h, t, "enc-map-v277-custom") + testUnmarshalErr(v277v4, bs277, h, t, "dec-map-v277-p-len") + testDeepEqualErr(v277v3, v277v4, t, "equal-map-v277-p-len") + } + + for _, v := range []map[bool]uint64{nil, {}, {true: 0}} { + // fmt.Printf(">>>> running mammoth map v278: %v\n", v) + var v278v1, v278v2 map[bool]uint64 + v278v1 = v + bs278 := testMarshalErr(v278v1, h, t, "enc-map-v278") + if v == nil { + v278v2 = nil + } else { + v278v2 = make(map[bool]uint64, len(v)) + } // reset map + testUnmarshalErr(v278v2, bs278, h, t, "dec-map-v278") + testDeepEqualErr(v278v1, v278v2, t, "equal-map-v278") + if v == nil { + v278v2 = nil + } else { + v278v2 = make(map[bool]uint64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v278v2), bs278, h, t, "dec-map-v278-noaddr") // decode into non-addressable map value + testDeepEqualErr(v278v1, v278v2, t, "equal-map-v278-noaddr") + if v == nil { + v278v2 = nil + } else { + v278v2 = make(map[bool]uint64, len(v)) + } // reset map + testUnmarshalErr(&v278v2, bs278, h, t, "dec-map-v278-p-len") + testDeepEqualErr(v278v1, v278v2, t, "equal-map-v278-p-len") + bs278 = testMarshalErr(&v278v1, h, t, "enc-map-v278-p") + v278v2 = nil + testUnmarshalErr(&v278v2, bs278, h, t, "dec-map-v278-p-nil") + testDeepEqualErr(v278v1, v278v2, t, "equal-map-v278-p-nil") + // ... + if v == nil { + v278v2 = nil + } else { + v278v2 = make(map[bool]uint64, len(v)) + } // reset map + var v278v3, v278v4 typMapMapBoolUint64 + v278v3 = typMapMapBoolUint64(v278v1) + v278v4 = typMapMapBoolUint64(v278v2) + bs278 = testMarshalErr(v278v3, h, t, "enc-map-v278-custom") + testUnmarshalErr(v278v4, bs278, h, t, "dec-map-v278-p-len") + testDeepEqualErr(v278v3, v278v4, t, "equal-map-v278-p-len") + } + + for _, v := range []map[bool]uintptr{nil, {}, {true: 0}} { + // fmt.Printf(">>>> running mammoth map v279: %v\n", v) + var v279v1, v279v2 map[bool]uintptr + v279v1 = v + bs279 := testMarshalErr(v279v1, h, t, "enc-map-v279") + if v == nil { + v279v2 = nil + } else { + v279v2 = make(map[bool]uintptr, len(v)) + } // reset map + testUnmarshalErr(v279v2, bs279, h, t, "dec-map-v279") + testDeepEqualErr(v279v1, v279v2, t, "equal-map-v279") + if v == nil { + v279v2 = nil + } else { + v279v2 = make(map[bool]uintptr, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v279v2), bs279, h, t, "dec-map-v279-noaddr") // decode into non-addressable map value + testDeepEqualErr(v279v1, v279v2, t, "equal-map-v279-noaddr") + if v == nil { + v279v2 = nil + } else { + v279v2 = make(map[bool]uintptr, len(v)) + } // reset map + testUnmarshalErr(&v279v2, bs279, h, t, "dec-map-v279-p-len") + testDeepEqualErr(v279v1, v279v2, t, "equal-map-v279-p-len") + bs279 = testMarshalErr(&v279v1, h, t, "enc-map-v279-p") + v279v2 = nil + testUnmarshalErr(&v279v2, bs279, h, t, "dec-map-v279-p-nil") + testDeepEqualErr(v279v1, v279v2, t, "equal-map-v279-p-nil") + // ... + if v == nil { + v279v2 = nil + } else { + v279v2 = make(map[bool]uintptr, len(v)) + } // reset map + var v279v3, v279v4 typMapMapBoolUintptr + v279v3 = typMapMapBoolUintptr(v279v1) + v279v4 = typMapMapBoolUintptr(v279v2) + bs279 = testMarshalErr(v279v3, h, t, "enc-map-v279-custom") + testUnmarshalErr(v279v4, bs279, h, t, "dec-map-v279-p-len") + testDeepEqualErr(v279v3, v279v4, t, "equal-map-v279-p-len") + } + + for _, v := range []map[bool]int{nil, {}, {true: 0}} { + // fmt.Printf(">>>> running mammoth map v280: %v\n", v) + var v280v1, v280v2 map[bool]int + v280v1 = v + bs280 := testMarshalErr(v280v1, h, t, "enc-map-v280") + if v == nil { + v280v2 = nil + } else { + v280v2 = make(map[bool]int, len(v)) + } // reset map + testUnmarshalErr(v280v2, bs280, h, t, "dec-map-v280") + testDeepEqualErr(v280v1, v280v2, t, "equal-map-v280") + if v == nil { + v280v2 = nil + } else { + v280v2 = make(map[bool]int, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v280v2), bs280, h, t, "dec-map-v280-noaddr") // decode into non-addressable map value + testDeepEqualErr(v280v1, v280v2, t, "equal-map-v280-noaddr") + if v == nil { + v280v2 = nil + } else { + v280v2 = make(map[bool]int, len(v)) + } // reset map + testUnmarshalErr(&v280v2, bs280, h, t, "dec-map-v280-p-len") + testDeepEqualErr(v280v1, v280v2, t, "equal-map-v280-p-len") + bs280 = testMarshalErr(&v280v1, h, t, "enc-map-v280-p") + v280v2 = nil + testUnmarshalErr(&v280v2, bs280, h, t, "dec-map-v280-p-nil") + testDeepEqualErr(v280v1, v280v2, t, "equal-map-v280-p-nil") + // ... + if v == nil { + v280v2 = nil + } else { + v280v2 = make(map[bool]int, len(v)) + } // reset map + var v280v3, v280v4 typMapMapBoolInt + v280v3 = typMapMapBoolInt(v280v1) + v280v4 = typMapMapBoolInt(v280v2) + bs280 = testMarshalErr(v280v3, h, t, "enc-map-v280-custom") + testUnmarshalErr(v280v4, bs280, h, t, "dec-map-v280-p-len") + testDeepEqualErr(v280v3, v280v4, t, "equal-map-v280-p-len") + } + + for _, v := range []map[bool]int8{nil, {}, {true: 0}} { + // fmt.Printf(">>>> running mammoth map v281: %v\n", v) + var v281v1, v281v2 map[bool]int8 + v281v1 = v + bs281 := testMarshalErr(v281v1, h, t, "enc-map-v281") + if v == nil { + v281v2 = nil + } else { + v281v2 = make(map[bool]int8, len(v)) + } // reset map + testUnmarshalErr(v281v2, bs281, h, t, "dec-map-v281") + testDeepEqualErr(v281v1, v281v2, t, "equal-map-v281") + if v == nil { + v281v2 = nil + } else { + v281v2 = make(map[bool]int8, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v281v2), bs281, h, t, "dec-map-v281-noaddr") // decode into non-addressable map value + testDeepEqualErr(v281v1, v281v2, t, "equal-map-v281-noaddr") + if v == nil { + v281v2 = nil + } else { + v281v2 = make(map[bool]int8, len(v)) + } // reset map + testUnmarshalErr(&v281v2, bs281, h, t, "dec-map-v281-p-len") + testDeepEqualErr(v281v1, v281v2, t, "equal-map-v281-p-len") + bs281 = testMarshalErr(&v281v1, h, t, "enc-map-v281-p") + v281v2 = nil + testUnmarshalErr(&v281v2, bs281, h, t, "dec-map-v281-p-nil") + testDeepEqualErr(v281v1, v281v2, t, "equal-map-v281-p-nil") + // ... + if v == nil { + v281v2 = nil + } else { + v281v2 = make(map[bool]int8, len(v)) + } // reset map + var v281v3, v281v4 typMapMapBoolInt8 + v281v3 = typMapMapBoolInt8(v281v1) + v281v4 = typMapMapBoolInt8(v281v2) + bs281 = testMarshalErr(v281v3, h, t, "enc-map-v281-custom") + testUnmarshalErr(v281v4, bs281, h, t, "dec-map-v281-p-len") + testDeepEqualErr(v281v3, v281v4, t, "equal-map-v281-p-len") + } + + for _, v := range []map[bool]int16{nil, {}, {true: 0}} { + // fmt.Printf(">>>> running mammoth map v282: %v\n", v) + var v282v1, v282v2 map[bool]int16 + v282v1 = v + bs282 := testMarshalErr(v282v1, h, t, "enc-map-v282") + if v == nil { + v282v2 = nil + } else { + v282v2 = make(map[bool]int16, len(v)) + } // reset map + testUnmarshalErr(v282v2, bs282, h, t, "dec-map-v282") + testDeepEqualErr(v282v1, v282v2, t, "equal-map-v282") + if v == nil { + v282v2 = nil + } else { + v282v2 = make(map[bool]int16, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v282v2), bs282, h, t, "dec-map-v282-noaddr") // decode into non-addressable map value + testDeepEqualErr(v282v1, v282v2, t, "equal-map-v282-noaddr") + if v == nil { + v282v2 = nil + } else { + v282v2 = make(map[bool]int16, len(v)) + } // reset map + testUnmarshalErr(&v282v2, bs282, h, t, "dec-map-v282-p-len") + testDeepEqualErr(v282v1, v282v2, t, "equal-map-v282-p-len") + bs282 = testMarshalErr(&v282v1, h, t, "enc-map-v282-p") + v282v2 = nil + testUnmarshalErr(&v282v2, bs282, h, t, "dec-map-v282-p-nil") + testDeepEqualErr(v282v1, v282v2, t, "equal-map-v282-p-nil") + // ... + if v == nil { + v282v2 = nil + } else { + v282v2 = make(map[bool]int16, len(v)) + } // reset map + var v282v3, v282v4 typMapMapBoolInt16 + v282v3 = typMapMapBoolInt16(v282v1) + v282v4 = typMapMapBoolInt16(v282v2) + bs282 = testMarshalErr(v282v3, h, t, "enc-map-v282-custom") + testUnmarshalErr(v282v4, bs282, h, t, "dec-map-v282-p-len") + testDeepEqualErr(v282v3, v282v4, t, "equal-map-v282-p-len") + } + + for _, v := range []map[bool]int32{nil, {}, {true: 0}} { + // fmt.Printf(">>>> running mammoth map v283: %v\n", v) + var v283v1, v283v2 map[bool]int32 + v283v1 = v + bs283 := testMarshalErr(v283v1, h, t, "enc-map-v283") + if v == nil { + v283v2 = nil + } else { + v283v2 = make(map[bool]int32, len(v)) + } // reset map + testUnmarshalErr(v283v2, bs283, h, t, "dec-map-v283") + testDeepEqualErr(v283v1, v283v2, t, "equal-map-v283") + if v == nil { + v283v2 = nil + } else { + v283v2 = make(map[bool]int32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v283v2), bs283, h, t, "dec-map-v283-noaddr") // decode into non-addressable map value + testDeepEqualErr(v283v1, v283v2, t, "equal-map-v283-noaddr") + if v == nil { + v283v2 = nil + } else { + v283v2 = make(map[bool]int32, len(v)) + } // reset map + testUnmarshalErr(&v283v2, bs283, h, t, "dec-map-v283-p-len") + testDeepEqualErr(v283v1, v283v2, t, "equal-map-v283-p-len") + bs283 = testMarshalErr(&v283v1, h, t, "enc-map-v283-p") + v283v2 = nil + testUnmarshalErr(&v283v2, bs283, h, t, "dec-map-v283-p-nil") + testDeepEqualErr(v283v1, v283v2, t, "equal-map-v283-p-nil") + // ... + if v == nil { + v283v2 = nil + } else { + v283v2 = make(map[bool]int32, len(v)) + } // reset map + var v283v3, v283v4 typMapMapBoolInt32 + v283v3 = typMapMapBoolInt32(v283v1) + v283v4 = typMapMapBoolInt32(v283v2) + bs283 = testMarshalErr(v283v3, h, t, "enc-map-v283-custom") + testUnmarshalErr(v283v4, bs283, h, t, "dec-map-v283-p-len") + testDeepEqualErr(v283v3, v283v4, t, "equal-map-v283-p-len") + } + + for _, v := range []map[bool]int64{nil, {}, {true: 0}} { + // fmt.Printf(">>>> running mammoth map v284: %v\n", v) + var v284v1, v284v2 map[bool]int64 + v284v1 = v + bs284 := testMarshalErr(v284v1, h, t, "enc-map-v284") + if v == nil { + v284v2 = nil + } else { + v284v2 = make(map[bool]int64, len(v)) + } // reset map + testUnmarshalErr(v284v2, bs284, h, t, "dec-map-v284") + testDeepEqualErr(v284v1, v284v2, t, "equal-map-v284") + if v == nil { + v284v2 = nil + } else { + v284v2 = make(map[bool]int64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v284v2), bs284, h, t, "dec-map-v284-noaddr") // decode into non-addressable map value + testDeepEqualErr(v284v1, v284v2, t, "equal-map-v284-noaddr") + if v == nil { + v284v2 = nil + } else { + v284v2 = make(map[bool]int64, len(v)) + } // reset map + testUnmarshalErr(&v284v2, bs284, h, t, "dec-map-v284-p-len") + testDeepEqualErr(v284v1, v284v2, t, "equal-map-v284-p-len") + bs284 = testMarshalErr(&v284v1, h, t, "enc-map-v284-p") + v284v2 = nil + testUnmarshalErr(&v284v2, bs284, h, t, "dec-map-v284-p-nil") + testDeepEqualErr(v284v1, v284v2, t, "equal-map-v284-p-nil") + // ... + if v == nil { + v284v2 = nil + } else { + v284v2 = make(map[bool]int64, len(v)) + } // reset map + var v284v3, v284v4 typMapMapBoolInt64 + v284v3 = typMapMapBoolInt64(v284v1) + v284v4 = typMapMapBoolInt64(v284v2) + bs284 = testMarshalErr(v284v3, h, t, "enc-map-v284-custom") + testUnmarshalErr(v284v4, bs284, h, t, "dec-map-v284-p-len") + testDeepEqualErr(v284v3, v284v4, t, "equal-map-v284-p-len") + } + + for _, v := range []map[bool]float32{nil, {}, {true: 0}} { + // fmt.Printf(">>>> running mammoth map v285: %v\n", v) + var v285v1, v285v2 map[bool]float32 + v285v1 = v + bs285 := testMarshalErr(v285v1, h, t, "enc-map-v285") + if v == nil { + v285v2 = nil + } else { + v285v2 = make(map[bool]float32, len(v)) + } // reset map + testUnmarshalErr(v285v2, bs285, h, t, "dec-map-v285") + testDeepEqualErr(v285v1, v285v2, t, "equal-map-v285") + if v == nil { + v285v2 = nil + } else { + v285v2 = make(map[bool]float32, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v285v2), bs285, h, t, "dec-map-v285-noaddr") // decode into non-addressable map value + testDeepEqualErr(v285v1, v285v2, t, "equal-map-v285-noaddr") + if v == nil { + v285v2 = nil + } else { + v285v2 = make(map[bool]float32, len(v)) + } // reset map + testUnmarshalErr(&v285v2, bs285, h, t, "dec-map-v285-p-len") + testDeepEqualErr(v285v1, v285v2, t, "equal-map-v285-p-len") + bs285 = testMarshalErr(&v285v1, h, t, "enc-map-v285-p") + v285v2 = nil + testUnmarshalErr(&v285v2, bs285, h, t, "dec-map-v285-p-nil") + testDeepEqualErr(v285v1, v285v2, t, "equal-map-v285-p-nil") + // ... + if v == nil { + v285v2 = nil + } else { + v285v2 = make(map[bool]float32, len(v)) + } // reset map + var v285v3, v285v4 typMapMapBoolFloat32 + v285v3 = typMapMapBoolFloat32(v285v1) + v285v4 = typMapMapBoolFloat32(v285v2) + bs285 = testMarshalErr(v285v3, h, t, "enc-map-v285-custom") + testUnmarshalErr(v285v4, bs285, h, t, "dec-map-v285-p-len") + testDeepEqualErr(v285v3, v285v4, t, "equal-map-v285-p-len") + } + + for _, v := range []map[bool]float64{nil, {}, {true: 0}} { + // fmt.Printf(">>>> running mammoth map v286: %v\n", v) + var v286v1, v286v2 map[bool]float64 + v286v1 = v + bs286 := testMarshalErr(v286v1, h, t, "enc-map-v286") + if v == nil { + v286v2 = nil + } else { + v286v2 = make(map[bool]float64, len(v)) + } // reset map + testUnmarshalErr(v286v2, bs286, h, t, "dec-map-v286") + testDeepEqualErr(v286v1, v286v2, t, "equal-map-v286") + if v == nil { + v286v2 = nil + } else { + v286v2 = make(map[bool]float64, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v286v2), bs286, h, t, "dec-map-v286-noaddr") // decode into non-addressable map value + testDeepEqualErr(v286v1, v286v2, t, "equal-map-v286-noaddr") + if v == nil { + v286v2 = nil + } else { + v286v2 = make(map[bool]float64, len(v)) + } // reset map + testUnmarshalErr(&v286v2, bs286, h, t, "dec-map-v286-p-len") + testDeepEqualErr(v286v1, v286v2, t, "equal-map-v286-p-len") + bs286 = testMarshalErr(&v286v1, h, t, "enc-map-v286-p") + v286v2 = nil + testUnmarshalErr(&v286v2, bs286, h, t, "dec-map-v286-p-nil") + testDeepEqualErr(v286v1, v286v2, t, "equal-map-v286-p-nil") + // ... + if v == nil { + v286v2 = nil + } else { + v286v2 = make(map[bool]float64, len(v)) + } // reset map + var v286v3, v286v4 typMapMapBoolFloat64 + v286v3 = typMapMapBoolFloat64(v286v1) + v286v4 = typMapMapBoolFloat64(v286v2) + bs286 = testMarshalErr(v286v3, h, t, "enc-map-v286-custom") + testUnmarshalErr(v286v4, bs286, h, t, "dec-map-v286-p-len") + testDeepEqualErr(v286v3, v286v4, t, "equal-map-v286-p-len") + } + + for _, v := range []map[bool]bool{nil, {}, {true: false}} { + // fmt.Printf(">>>> running mammoth map v287: %v\n", v) + var v287v1, v287v2 map[bool]bool + v287v1 = v + bs287 := testMarshalErr(v287v1, h, t, "enc-map-v287") + if v == nil { + v287v2 = nil + } else { + v287v2 = make(map[bool]bool, len(v)) + } // reset map + testUnmarshalErr(v287v2, bs287, h, t, "dec-map-v287") + testDeepEqualErr(v287v1, v287v2, t, "equal-map-v287") + if v == nil { + v287v2 = nil + } else { + v287v2 = make(map[bool]bool, len(v)) + } // reset map + testUnmarshalErr(reflect.ValueOf(v287v2), bs287, h, t, "dec-map-v287-noaddr") // decode into non-addressable map value + testDeepEqualErr(v287v1, v287v2, t, "equal-map-v287-noaddr") + if v == nil { + v287v2 = nil + } else { + v287v2 = make(map[bool]bool, len(v)) + } // reset map + testUnmarshalErr(&v287v2, bs287, h, t, "dec-map-v287-p-len") + testDeepEqualErr(v287v1, v287v2, t, "equal-map-v287-p-len") + bs287 = testMarshalErr(&v287v1, h, t, "enc-map-v287-p") + v287v2 = nil + testUnmarshalErr(&v287v2, bs287, h, t, "dec-map-v287-p-nil") + testDeepEqualErr(v287v1, v287v2, t, "equal-map-v287-p-nil") + // ... + if v == nil { + v287v2 = nil + } else { + v287v2 = make(map[bool]bool, len(v)) + } // reset map + var v287v3, v287v4 typMapMapBoolBool + v287v3 = typMapMapBoolBool(v287v1) + v287v4 = typMapMapBoolBool(v287v2) + bs287 = testMarshalErr(v287v3, h, t, "enc-map-v287-custom") + testUnmarshalErr(v287v4, bs287, h, t, "dec-map-v287-p-len") + testDeepEqualErr(v287v3, v287v4, t, "equal-map-v287-p-len") + } + +} + +func doTestMammothMapsAndSlices(t *testing.T, h Handle) { + doTestMammothSlices(t, h) + doTestMammothMaps(t, h) +} diff --git a/vendor/github.com/ugorji/go/codec/msgpack.go b/vendor/github.com/ugorji/go/codec/msgpack.go index da0500d19..85c71f22f 100644 --- a/vendor/github.com/ugorji/go/codec/msgpack.go +++ b/vendor/github.com/ugorji/go/codec/msgpack.go @@ -1,5 +1,5 @@ -// Copyright (c) 2012, 2013 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. /* MSGPACK @@ -15,8 +15,8 @@ For compatibility with behaviour of msgpack-c reference implementation: - Go intX (<0) IS ENCODED AS msgpack -ve fixnum, signed - */ + package codec import ( @@ -24,59 +24,144 @@ import ( "io" "math" "net/rpc" + "reflect" + "time" ) const ( mpPosFixNumMin byte = 0x00 - mpPosFixNumMax = 0x7f - mpFixMapMin = 0x80 - mpFixMapMax = 0x8f - mpFixArrayMin = 0x90 - mpFixArrayMax = 0x9f - mpFixStrMin = 0xa0 - mpFixStrMax = 0xbf - mpNil = 0xc0 - _ = 0xc1 - mpFalse = 0xc2 - mpTrue = 0xc3 - mpFloat = 0xca - mpDouble = 0xcb - mpUint8 = 0xcc - mpUint16 = 0xcd - mpUint32 = 0xce - mpUint64 = 0xcf - mpInt8 = 0xd0 - mpInt16 = 0xd1 - mpInt32 = 0xd2 - mpInt64 = 0xd3 + mpPosFixNumMax byte = 0x7f + mpFixMapMin byte = 0x80 + mpFixMapMax byte = 0x8f + mpFixArrayMin byte = 0x90 + mpFixArrayMax byte = 0x9f + mpFixStrMin byte = 0xa0 + mpFixStrMax byte = 0xbf + mpNil byte = 0xc0 + _ byte = 0xc1 + mpFalse byte = 0xc2 + mpTrue byte = 0xc3 + mpFloat byte = 0xca + mpDouble byte = 0xcb + mpUint8 byte = 0xcc + mpUint16 byte = 0xcd + mpUint32 byte = 0xce + mpUint64 byte = 0xcf + mpInt8 byte = 0xd0 + mpInt16 byte = 0xd1 + mpInt32 byte = 0xd2 + mpInt64 byte = 0xd3 // extensions below - mpBin8 = 0xc4 - mpBin16 = 0xc5 - mpBin32 = 0xc6 - mpExt8 = 0xc7 - mpExt16 = 0xc8 - mpExt32 = 0xc9 - mpFixExt1 = 0xd4 - mpFixExt2 = 0xd5 - mpFixExt4 = 0xd6 - mpFixExt8 = 0xd7 - mpFixExt16 = 0xd8 - - mpStr8 = 0xd9 // new - mpStr16 = 0xda - mpStr32 = 0xdb - - mpArray16 = 0xdc - mpArray32 = 0xdd - - mpMap16 = 0xde - mpMap32 = 0xdf - - mpNegFixNumMin = 0xe0 - mpNegFixNumMax = 0xff + mpBin8 byte = 0xc4 + mpBin16 byte = 0xc5 + mpBin32 byte = 0xc6 + mpExt8 byte = 0xc7 + mpExt16 byte = 0xc8 + mpExt32 byte = 0xc9 + mpFixExt1 byte = 0xd4 + mpFixExt2 byte = 0xd5 + mpFixExt4 byte = 0xd6 + mpFixExt8 byte = 0xd7 + mpFixExt16 byte = 0xd8 + + mpStr8 byte = 0xd9 // new + mpStr16 byte = 0xda + mpStr32 byte = 0xdb + + mpArray16 byte = 0xdc + mpArray32 byte = 0xdd + + mpMap16 byte = 0xde + mpMap32 byte = 0xdf + + mpNegFixNumMin byte = 0xe0 + mpNegFixNumMax byte = 0xff ) +var mpTimeExtTag int8 = -1 +var mpTimeExtTagU = uint8(mpTimeExtTag) + +// var mpdesc = map[byte]string{ +// mpPosFixNumMin: "PosFixNumMin", +// mpPosFixNumMax: "PosFixNumMax", +// mpFixMapMin: "FixMapMin", +// mpFixMapMax: "FixMapMax", +// mpFixArrayMin: "FixArrayMin", +// mpFixArrayMax: "FixArrayMax", +// mpFixStrMin: "FixStrMin", +// mpFixStrMax: "FixStrMax", +// mpNil: "Nil", +// mpFalse: "False", +// mpTrue: "True", +// mpFloat: "Float", +// mpDouble: "Double", +// mpUint8: "Uint8", +// mpUint16: "Uint16", +// mpUint32: "Uint32", +// mpUint64: "Uint64", +// mpInt8: "Int8", +// mpInt16: "Int16", +// mpInt32: "Int32", +// mpInt64: "Int64", +// mpBin8: "Bin8", +// mpBin16: "Bin16", +// mpBin32: "Bin32", +// mpExt8: "Ext8", +// mpExt16: "Ext16", +// mpExt32: "Ext32", +// mpFixExt1: "FixExt1", +// mpFixExt2: "FixExt2", +// mpFixExt4: "FixExt4", +// mpFixExt8: "FixExt8", +// mpFixExt16: "FixExt16", +// mpStr8: "Str8", +// mpStr16: "Str16", +// mpStr32: "Str32", +// mpArray16: "Array16", +// mpArray32: "Array32", +// mpMap16: "Map16", +// mpMap32: "Map32", +// mpNegFixNumMin: "NegFixNumMin", +// mpNegFixNumMax: "NegFixNumMax", +// } + +func mpdesc(bd byte) string { + switch bd { + case mpNil: + return "nil" + case mpFalse: + return "false" + case mpTrue: + return "true" + case mpFloat, mpDouble: + return "float" + case mpUint8, mpUint16, mpUint32, mpUint64: + return "uint" + case mpInt8, mpInt16, mpInt32, mpInt64: + return "int" + default: + switch { + case bd >= mpPosFixNumMin && bd <= mpPosFixNumMax: + return "int" + case bd >= mpNegFixNumMin && bd <= mpNegFixNumMax: + return "int" + case bd == mpStr8, bd == mpStr16, bd == mpStr32, bd >= mpFixStrMin && bd <= mpFixStrMax: + return "string|bytes" + case bd == mpBin8, bd == mpBin16, bd == mpBin32: + return "bytes" + case bd == mpArray16, bd == mpArray32, bd >= mpFixArrayMin && bd <= mpFixArrayMax: + return "array" + case bd == mpMap16, bd == mpMap32, bd >= mpFixMapMin && bd <= mpFixMapMax: + return "map" + case bd >= mpFixExt1 && bd <= mpFixExt16, bd >= mpExt8 && bd <= mpExt32: + return "ext" + default: + return "unknown" + } + } +} + // MsgpackSpecRpcMultiArgs is a special type which signifies to the MsgpackSpecRpcCodec // that the backend RPC service takes multiple arguments, which have been arranged // in sequence in the slice. @@ -87,76 +172,102 @@ type MsgpackSpecRpcMultiArgs []interface{} // A MsgpackContainer type specifies the different types of msgpackContainers. type msgpackContainerType struct { - fixCutoff int - bFixMin, b8, b16, b32 byte - hasFixMin, has8, has8Always bool + fixCutoff uint8 + bFixMin, b8, b16, b32 byte + // hasFixMin, has8, has8Always bool } var ( - msgpackContainerStr = msgpackContainerType{32, mpFixStrMin, mpStr8, mpStr16, mpStr32, true, true, false} - msgpackContainerBin = msgpackContainerType{0, 0, mpBin8, mpBin16, mpBin32, false, true, true} - msgpackContainerList = msgpackContainerType{16, mpFixArrayMin, 0, mpArray16, mpArray32, true, false, false} - msgpackContainerMap = msgpackContainerType{16, mpFixMapMin, 0, mpMap16, mpMap32, true, false, false} + msgpackContainerRawLegacy = msgpackContainerType{ + 32, mpFixStrMin, 0, mpStr16, mpStr32, + } + msgpackContainerStr = msgpackContainerType{ + 32, mpFixStrMin, mpStr8, mpStr16, mpStr32, // true, true, false, + } + msgpackContainerBin = msgpackContainerType{ + 0, 0, mpBin8, mpBin16, mpBin32, // false, true, true, + } + msgpackContainerList = msgpackContainerType{ + 16, mpFixArrayMin, 0, mpArray16, mpArray32, // true, false, false, + } + msgpackContainerMap = msgpackContainerType{ + 16, mpFixMapMin, 0, mpMap16, mpMap32, // true, false, false, + } ) //--------------------------------------------- type msgpackEncDriver struct { - w encWriter + noBuiltInTypes + encDriverNoopContainerWriter + // encNoSeparator + e *Encoder + w *encWriterSwitch h *MsgpackHandle + x [8]byte + // _ [3]uint64 // padding } -func (e *msgpackEncDriver) isBuiltinType(rt uintptr) bool { - //no builtin types. All encodings are based on kinds. Types supported as extensions. - return false -} - -func (e *msgpackEncDriver) encodeBuiltin(rt uintptr, v interface{}) {} - -func (e *msgpackEncDriver) encodeNil() { +func (e *msgpackEncDriver) EncodeNil() { e.w.writen1(mpNil) } -func (e *msgpackEncDriver) encodeInt(i int64) { - - switch { - case i >= 0: - e.encodeUint(uint64(i)) - case i >= -32: - e.w.writen1(byte(i)) - case i >= math.MinInt8: +func (e *msgpackEncDriver) EncodeInt(i int64) { + if e.h.PositiveIntUnsigned && i >= 0 { + e.EncodeUint(uint64(i)) + } else if i > math.MaxInt8 { + if i <= math.MaxInt16 { + e.w.writen1(mpInt16) + bigenHelper{e.x[:2], e.w}.writeUint16(uint16(i)) + } else if i <= math.MaxInt32 { + e.w.writen1(mpInt32) + bigenHelper{e.x[:4], e.w}.writeUint32(uint32(i)) + } else { + e.w.writen1(mpInt64) + bigenHelper{e.x[:8], e.w}.writeUint64(uint64(i)) + } + } else if i >= -32 { + if e.h.NoFixedNum { + e.w.writen2(mpInt8, byte(i)) + } else { + e.w.writen1(byte(i)) + } + } else if i >= math.MinInt8 { e.w.writen2(mpInt8, byte(i)) - case i >= math.MinInt16: + } else if i >= math.MinInt16 { e.w.writen1(mpInt16) - e.w.writeUint16(uint16(i)) - case i >= math.MinInt32: + bigenHelper{e.x[:2], e.w}.writeUint16(uint16(i)) + } else if i >= math.MinInt32 { e.w.writen1(mpInt32) - e.w.writeUint32(uint32(i)) - default: + bigenHelper{e.x[:4], e.w}.writeUint32(uint32(i)) + } else { e.w.writen1(mpInt64) - e.w.writeUint64(uint64(i)) + bigenHelper{e.x[:8], e.w}.writeUint64(uint64(i)) } } -func (e *msgpackEncDriver) encodeUint(i uint64) { - switch { - case i <= math.MaxInt8: - e.w.writen1(byte(i)) - case i <= math.MaxUint8: +func (e *msgpackEncDriver) EncodeUint(i uint64) { + if i <= math.MaxInt8 { + if e.h.NoFixedNum { + e.w.writen2(mpUint8, byte(i)) + } else { + e.w.writen1(byte(i)) + } + } else if i <= math.MaxUint8 { e.w.writen2(mpUint8, byte(i)) - case i <= math.MaxUint16: + } else if i <= math.MaxUint16 { e.w.writen1(mpUint16) - e.w.writeUint16(uint16(i)) - case i <= math.MaxUint32: + bigenHelper{e.x[:2], e.w}.writeUint16(uint16(i)) + } else if i <= math.MaxUint32 { e.w.writen1(mpUint32) - e.w.writeUint32(uint32(i)) - default: + bigenHelper{e.x[:4], e.w}.writeUint32(uint32(i)) + } else { e.w.writen1(mpUint64) - e.w.writeUint64(uint64(i)) + bigenHelper{e.x[:8], e.w}.writeUint64(uint64(i)) } } -func (e *msgpackEncDriver) encodeBool(b bool) { +func (e *msgpackEncDriver) EncodeBool(b bool) { if b { e.w.writen1(mpTrue) } else { @@ -164,229 +275,314 @@ func (e *msgpackEncDriver) encodeBool(b bool) { } } -func (e *msgpackEncDriver) encodeFloat32(f float32) { +func (e *msgpackEncDriver) EncodeFloat32(f float32) { e.w.writen1(mpFloat) - e.w.writeUint32(math.Float32bits(f)) + bigenHelper{e.x[:4], e.w}.writeUint32(math.Float32bits(f)) } -func (e *msgpackEncDriver) encodeFloat64(f float64) { +func (e *msgpackEncDriver) EncodeFloat64(f float64) { e.w.writen1(mpDouble) - e.w.writeUint64(math.Float64bits(f)) + bigenHelper{e.x[:8], e.w}.writeUint64(math.Float64bits(f)) +} + +func (e *msgpackEncDriver) EncodeTime(t time.Time) { + if t.IsZero() { + e.EncodeNil() + return + } + t = t.UTC() + sec, nsec := t.Unix(), uint64(t.Nanosecond()) + var data64 uint64 + var l = 4 + if sec >= 0 && sec>>34 == 0 { + data64 = (nsec << 34) | uint64(sec) + if data64&0xffffffff00000000 != 0 { + l = 8 + } + } else { + l = 12 + } + if e.h.WriteExt { + e.encodeExtPreamble(mpTimeExtTagU, l) + } else { + e.writeContainerLen(msgpackContainerRawLegacy, l) + } + switch l { + case 4: + bigenHelper{e.x[:4], e.w}.writeUint32(uint32(data64)) + case 8: + bigenHelper{e.x[:8], e.w}.writeUint64(data64) + case 12: + bigenHelper{e.x[:4], e.w}.writeUint32(uint32(nsec)) + bigenHelper{e.x[:8], e.w}.writeUint64(uint64(sec)) + } +} + +func (e *msgpackEncDriver) EncodeExt(v interface{}, xtag uint64, ext Ext, _ *Encoder) { + bs := ext.WriteExt(v) + if bs == nil { + e.EncodeNil() + return + } + if e.h.WriteExt { + e.encodeExtPreamble(uint8(xtag), len(bs)) + e.w.writeb(bs) + } else { + e.EncodeStringBytesRaw(bs) + } +} + +func (e *msgpackEncDriver) EncodeRawExt(re *RawExt, _ *Encoder) { + e.encodeExtPreamble(uint8(re.Tag), len(re.Data)) + e.w.writeb(re.Data) } func (e *msgpackEncDriver) encodeExtPreamble(xtag byte, l int) { - switch { - case l == 1: + if l == 1 { e.w.writen2(mpFixExt1, xtag) - case l == 2: + } else if l == 2 { e.w.writen2(mpFixExt2, xtag) - case l == 4: + } else if l == 4 { e.w.writen2(mpFixExt4, xtag) - case l == 8: + } else if l == 8 { e.w.writen2(mpFixExt8, xtag) - case l == 16: + } else if l == 16 { e.w.writen2(mpFixExt16, xtag) - case l < 256: + } else if l < 256 { e.w.writen2(mpExt8, byte(l)) e.w.writen1(xtag) - case l < 65536: + } else if l < 65536 { e.w.writen1(mpExt16) - e.w.writeUint16(uint16(l)) + bigenHelper{e.x[:2], e.w}.writeUint16(uint16(l)) e.w.writen1(xtag) - default: + } else { e.w.writen1(mpExt32) - e.w.writeUint32(uint32(l)) + bigenHelper{e.x[:4], e.w}.writeUint32(uint32(l)) e.w.writen1(xtag) } } -func (e *msgpackEncDriver) encodeArrayPreamble(length int) { +func (e *msgpackEncDriver) WriteArrayStart(length int) { e.writeContainerLen(msgpackContainerList, length) } -func (e *msgpackEncDriver) encodeMapPreamble(length int) { +func (e *msgpackEncDriver) WriteMapStart(length int) { e.writeContainerLen(msgpackContainerMap, length) } -func (e *msgpackEncDriver) encodeString(c charEncoding, s string) { - if c == c_RAW && e.h.WriteExt { - e.writeContainerLen(msgpackContainerBin, len(s)) +func (e *msgpackEncDriver) EncodeString(c charEncoding, s string) { + slen := len(s) + if c == cRAW && e.h.WriteExt { + e.writeContainerLen(msgpackContainerBin, slen) } else { - e.writeContainerLen(msgpackContainerStr, len(s)) + e.writeContainerLen(msgpackContainerRawLegacy, slen) } - if len(s) > 0 { + if slen > 0 { e.w.writestr(s) } } -func (e *msgpackEncDriver) encodeSymbol(v string) { - e.encodeString(c_UTF8, v) +func (e *msgpackEncDriver) EncodeStringEnc(c charEncoding, s string) { + slen := len(s) + e.writeContainerLen(msgpackContainerStr, slen) + if slen > 0 { + e.w.writestr(s) + } +} + +func (e *msgpackEncDriver) EncodeStringBytes(c charEncoding, bs []byte) { + if bs == nil { + e.EncodeNil() + return + } + slen := len(bs) + if c == cRAW && e.h.WriteExt { + e.writeContainerLen(msgpackContainerBin, slen) + } else { + e.writeContainerLen(msgpackContainerRawLegacy, slen) + } + if slen > 0 { + e.w.writeb(bs) + } } -func (e *msgpackEncDriver) encodeStringBytes(c charEncoding, bs []byte) { - if c == c_RAW && e.h.WriteExt { - e.writeContainerLen(msgpackContainerBin, len(bs)) +func (e *msgpackEncDriver) EncodeStringBytesRaw(bs []byte) { + if bs == nil { + e.EncodeNil() + return + } + slen := len(bs) + if e.h.WriteExt { + e.writeContainerLen(msgpackContainerBin, slen) } else { - e.writeContainerLen(msgpackContainerStr, len(bs)) + e.writeContainerLen(msgpackContainerRawLegacy, slen) } - if len(bs) > 0 { + if slen > 0 { e.w.writeb(bs) } } func (e *msgpackEncDriver) writeContainerLen(ct msgpackContainerType, l int) { - switch { - case ct.hasFixMin && l < ct.fixCutoff: + if ct.fixCutoff > 0 && l < int(ct.fixCutoff) { e.w.writen1(ct.bFixMin | byte(l)) - case ct.has8 && l < 256 && (ct.has8Always || e.h.WriteExt): + } else if ct.b8 > 0 && l < 256 { e.w.writen2(ct.b8, uint8(l)) - case l < 65536: + } else if l < 65536 { e.w.writen1(ct.b16) - e.w.writeUint16(uint16(l)) - default: + bigenHelper{e.x[:2], e.w}.writeUint16(uint16(l)) + } else { e.w.writen1(ct.b32) - e.w.writeUint32(uint32(l)) + bigenHelper{e.x[:4], e.w}.writeUint32(uint32(l)) } } //--------------------------------------------- type msgpackDecDriver struct { - r decReader - h *MsgpackHandle + d *Decoder + r *decReaderSwitch + h *MsgpackHandle + // b [scratchByteArrayLen]byte bd byte bdRead bool - bdType valueType -} - -func (d *msgpackDecDriver) isBuiltinType(rt uintptr) bool { - //no builtin types. All encodings are based on kinds. Types supported as extensions. - return false + br bool // bytes reader + noBuiltInTypes + // noStreamingCodec + // decNoSeparator + decDriverNoopContainerReader + // _ [3]uint64 // padding } -func (d *msgpackDecDriver) decodeBuiltin(rt uintptr, v interface{}) {} - // Note: This returns either a primitive (int, bool, etc) for non-containers, // or a containerType, or a specific type denoting nil or extension. // It is called when a nil interface{} is passed, leaving it up to the DecDriver // to introspect the stream and decide how best to decode. // It deciphers the value by looking at the stream first. -func (d *msgpackDecDriver) decodeNaked() (v interface{}, vt valueType, decodeFurther bool) { - d.initReadNext() +func (d *msgpackDecDriver) DecodeNaked() { + if !d.bdRead { + d.readNextBd() + } bd := d.bd + n := d.d.naked() + var decodeFurther bool switch bd { case mpNil: - vt = valueTypeNil + n.v = valueTypeNil d.bdRead = false case mpFalse: - vt = valueTypeBool - v = false + n.v = valueTypeBool + n.b = false case mpTrue: - vt = valueTypeBool - v = true + n.v = valueTypeBool + n.b = true case mpFloat: - vt = valueTypeFloat - v = float64(math.Float32frombits(d.r.readUint32())) + n.v = valueTypeFloat + n.f = float64(math.Float32frombits(bigen.Uint32(d.r.readx(4)))) case mpDouble: - vt = valueTypeFloat - v = math.Float64frombits(d.r.readUint64()) + n.v = valueTypeFloat + n.f = math.Float64frombits(bigen.Uint64(d.r.readx(8))) case mpUint8: - vt = valueTypeUint - v = uint64(d.r.readn1()) + n.v = valueTypeUint + n.u = uint64(d.r.readn1()) case mpUint16: - vt = valueTypeUint - v = uint64(d.r.readUint16()) + n.v = valueTypeUint + n.u = uint64(bigen.Uint16(d.r.readx(2))) case mpUint32: - vt = valueTypeUint - v = uint64(d.r.readUint32()) + n.v = valueTypeUint + n.u = uint64(bigen.Uint32(d.r.readx(4))) case mpUint64: - vt = valueTypeUint - v = uint64(d.r.readUint64()) + n.v = valueTypeUint + n.u = uint64(bigen.Uint64(d.r.readx(8))) case mpInt8: - vt = valueTypeInt - v = int64(int8(d.r.readn1())) + n.v = valueTypeInt + n.i = int64(int8(d.r.readn1())) case mpInt16: - vt = valueTypeInt - v = int64(int16(d.r.readUint16())) + n.v = valueTypeInt + n.i = int64(int16(bigen.Uint16(d.r.readx(2)))) case mpInt32: - vt = valueTypeInt - v = int64(int32(d.r.readUint32())) + n.v = valueTypeInt + n.i = int64(int32(bigen.Uint32(d.r.readx(4)))) case mpInt64: - vt = valueTypeInt - v = int64(int64(d.r.readUint64())) + n.v = valueTypeInt + n.i = int64(int64(bigen.Uint64(d.r.readx(8)))) default: switch { case bd >= mpPosFixNumMin && bd <= mpPosFixNumMax: // positive fixnum (always signed) - vt = valueTypeInt - v = int64(int8(bd)) + n.v = valueTypeInt + n.i = int64(int8(bd)) case bd >= mpNegFixNumMin && bd <= mpNegFixNumMax: // negative fixnum - vt = valueTypeInt - v = int64(int8(bd)) + n.v = valueTypeInt + n.i = int64(int8(bd)) case bd == mpStr8, bd == mpStr16, bd == mpStr32, bd >= mpFixStrMin && bd <= mpFixStrMax: - if d.h.RawToString { - var rvm string - vt = valueTypeString - v = &rvm + if d.h.WriteExt { + n.v = valueTypeString + n.s = d.DecodeString() } else { - var rvm = []byte{} - vt = valueTypeBytes - v = &rvm + n.v = valueTypeBytes + n.l = d.DecodeBytes(nil, false) } - decodeFurther = true case bd == mpBin8, bd == mpBin16, bd == mpBin32: - var rvm = []byte{} - vt = valueTypeBytes - v = &rvm - decodeFurther = true + decNakedReadRawBytes(d, d.d, n, d.h.RawToString) case bd == mpArray16, bd == mpArray32, bd >= mpFixArrayMin && bd <= mpFixArrayMax: - vt = valueTypeArray + n.v = valueTypeArray decodeFurther = true case bd == mpMap16, bd == mpMap32, bd >= mpFixMapMin && bd <= mpFixMapMax: - vt = valueTypeMap + n.v = valueTypeMap decodeFurther = true case bd >= mpFixExt1 && bd <= mpFixExt16, bd >= mpExt8 && bd <= mpExt32: + n.v = valueTypeExt clen := d.readExtLen() - var re RawExt - re.Tag = d.r.readn1() - re.Data = d.r.readn(clen) - v = &re - vt = valueTypeExt + n.u = uint64(d.r.readn1()) + if n.u == uint64(mpTimeExtTagU) { + n.v = valueTypeTime + n.t = d.decodeTime(clen) + } else if d.br { + n.l = d.r.readx(uint(clen)) + } else { + n.l = decByteSlice(d.r, clen, d.d.h.MaxInitLen, d.d.b[:]) + } default: - decErr("Nil-Deciphered DecodeValue: %s: hex: %x, dec: %d", msgBadDesc, bd, bd) + d.d.errorf("cannot infer value: %s: Ox%x/%d/%s", msgBadDesc, bd, bd, mpdesc(bd)) } } if !decodeFurther { d.bdRead = false } - return + if n.v == valueTypeUint && d.h.SignedInteger { + n.v = valueTypeInt + n.i = int64(n.u) + } } // int can be decoded from msgpack type: intXXX or uintXXX -func (d *msgpackDecDriver) decodeInt(bitsize uint8) (i int64) { +func (d *msgpackDecDriver) DecodeInt64() (i int64) { + if !d.bdRead { + d.readNextBd() + } switch d.bd { case mpUint8: i = int64(uint64(d.r.readn1())) case mpUint16: - i = int64(uint64(d.r.readUint16())) + i = int64(uint64(bigen.Uint16(d.r.readx(2)))) case mpUint32: - i = int64(uint64(d.r.readUint32())) + i = int64(uint64(bigen.Uint32(d.r.readx(4)))) case mpUint64: - i = int64(d.r.readUint64()) + i = int64(bigen.Uint64(d.r.readx(8))) case mpInt8: i = int64(int8(d.r.readn1())) case mpInt16: - i = int64(int16(d.r.readUint16())) + i = int64(int16(bigen.Uint16(d.r.readx(2)))) case mpInt32: - i = int64(int32(d.r.readUint32())) + i = int64(int32(bigen.Uint32(d.r.readx(4)))) case mpInt64: - i = int64(d.r.readUint64()) + i = int64(bigen.Uint64(d.r.readx(8))) default: switch { case d.bd >= mpPosFixNumMin && d.bd <= mpPosFixNumMax: @@ -394,13 +590,8 @@ func (d *msgpackDecDriver) decodeInt(bitsize uint8) (i int64) { case d.bd >= mpNegFixNumMin && d.bd <= mpNegFixNumMax: i = int64(int8(d.bd)) default: - decErr("Unhandled single-byte unsigned integer value: %s: %x", msgBadDesc, d.bd) - } - } - // check overflow (logic adapted from std pkg reflect/value.go OverflowUint() - if bitsize > 0 { - if trunc := (i << (64 - bitsize)) >> (64 - bitsize); i != trunc { - decErr("Overflow int value: %v", i) + d.d.errorf("cannot decode signed integer: %s: %x/%s", msgBadDesc, d.bd, mpdesc(d.bd)) + return } } d.bdRead = false @@ -408,54 +599,57 @@ func (d *msgpackDecDriver) decodeInt(bitsize uint8) (i int64) { } // uint can be decoded from msgpack type: intXXX or uintXXX -func (d *msgpackDecDriver) decodeUint(bitsize uint8) (ui uint64) { +func (d *msgpackDecDriver) DecodeUint64() (ui uint64) { + if !d.bdRead { + d.readNextBd() + } switch d.bd { case mpUint8: ui = uint64(d.r.readn1()) case mpUint16: - ui = uint64(d.r.readUint16()) + ui = uint64(bigen.Uint16(d.r.readx(2))) case mpUint32: - ui = uint64(d.r.readUint32()) + ui = uint64(bigen.Uint32(d.r.readx(4))) case mpUint64: - ui = d.r.readUint64() + ui = bigen.Uint64(d.r.readx(8)) case mpInt8: if i := int64(int8(d.r.readn1())); i >= 0 { ui = uint64(i) } else { - decErr("Assigning negative signed value: %v, to unsigned type", i) + d.d.errorf("assigning negative signed value: %v, to unsigned type", i) + return } case mpInt16: - if i := int64(int16(d.r.readUint16())); i >= 0 { + if i := int64(int16(bigen.Uint16(d.r.readx(2)))); i >= 0 { ui = uint64(i) } else { - decErr("Assigning negative signed value: %v, to unsigned type", i) + d.d.errorf("assigning negative signed value: %v, to unsigned type", i) + return } case mpInt32: - if i := int64(int32(d.r.readUint32())); i >= 0 { + if i := int64(int32(bigen.Uint32(d.r.readx(4)))); i >= 0 { ui = uint64(i) } else { - decErr("Assigning negative signed value: %v, to unsigned type", i) + d.d.errorf("assigning negative signed value: %v, to unsigned type", i) + return } case mpInt64: - if i := int64(d.r.readUint64()); i >= 0 { + if i := int64(bigen.Uint64(d.r.readx(8))); i >= 0 { ui = uint64(i) } else { - decErr("Assigning negative signed value: %v, to unsigned type", i) + d.d.errorf("assigning negative signed value: %v, to unsigned type", i) + return } default: switch { case d.bd >= mpPosFixNumMin && d.bd <= mpPosFixNumMax: ui = uint64(d.bd) case d.bd >= mpNegFixNumMin && d.bd <= mpNegFixNumMax: - decErr("Assigning negative signed value: %v, to unsigned type", int(d.bd)) + d.d.errorf("assigning negative signed value: %v, to unsigned type", int(d.bd)) + return default: - decErr("Unhandled single-byte unsigned integer value: %s: %x", msgBadDesc, d.bd) - } - } - // check overflow (logic adapted from std pkg reflect/value.go OverflowUint() - if bitsize > 0 { - if trunc := (ui << (64 - bitsize)) >> (64 - bitsize); ui != trunc { - decErr("Overflow uint value: %v", ui) + d.d.errorf("cannot decode unsigned integer: %s: %x/%s", msgBadDesc, d.bd, mpdesc(d.bd)) + return } } d.bdRead = false @@ -463,160 +657,173 @@ func (d *msgpackDecDriver) decodeUint(bitsize uint8) (ui uint64) { } // float can either be decoded from msgpack type: float, double or intX -func (d *msgpackDecDriver) decodeFloat(chkOverflow32 bool) (f float64) { - switch d.bd { - case mpFloat: - f = float64(math.Float32frombits(d.r.readUint32())) - case mpDouble: - f = math.Float64frombits(d.r.readUint64()) - default: - f = float64(d.decodeInt(0)) +func (d *msgpackDecDriver) DecodeFloat64() (f float64) { + if !d.bdRead { + d.readNextBd() + } + if d.bd == mpFloat { + f = float64(math.Float32frombits(bigen.Uint32(d.r.readx(4)))) + } else if d.bd == mpDouble { + f = math.Float64frombits(bigen.Uint64(d.r.readx(8))) + } else { + f = float64(d.DecodeInt64()) } - checkOverflowFloat32(f, chkOverflow32) d.bdRead = false return } // bool can be decoded from bool, fixnum 0 or 1. -func (d *msgpackDecDriver) decodeBool() (b bool) { - switch d.bd { - case mpFalse, 0: +func (d *msgpackDecDriver) DecodeBool() (b bool) { + if !d.bdRead { + d.readNextBd() + } + if d.bd == mpFalse || d.bd == 0 { // b = false - case mpTrue, 1: + } else if d.bd == mpTrue || d.bd == 1 { b = true - default: - decErr("Invalid single-byte value for bool: %s: %x", msgBadDesc, d.bd) + } else { + d.d.errorf("cannot decode bool: %s: %x/%s", msgBadDesc, d.bd, mpdesc(d.bd)) + return } d.bdRead = false return } -func (d *msgpackDecDriver) decodeString() (s string) { - clen := d.readContainerLen(msgpackContainerStr) - if clen > 0 { - s = string(d.r.readn(clen)) +func (d *msgpackDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) { + if !d.bdRead { + d.readNextBd() } - d.bdRead = false - return -} -// Callers must check if changed=true (to decide whether to replace the one they have) -func (d *msgpackDecDriver) decodeBytes(bs []byte) (bsOut []byte, changed bool) { - // bytes can be decoded from msgpackContainerStr or msgpackContainerBin + bd := d.bd var clen int - switch d.bd { - case mpBin8, mpBin16, mpBin32: - clen = d.readContainerLen(msgpackContainerBin) - default: - clen = d.readContainerLen(msgpackContainerStr) - } - // if clen < 0 { - // changed = true - // panic("length cannot be zero. this cannot be nil.") - // } - if clen > 0 { - // if no contents in stream, don't update the passed byteslice - if len(bs) != clen { - // Return changed=true if length of passed slice diff from length of bytes in stream - if len(bs) > clen { - bs = bs[:clen] - } else { - bs = make([]byte, clen) - } - bsOut = bs - changed = true + if bd == mpNil { + d.bdRead = false + return + } else if bd == mpBin8 || bd == mpBin16 || bd == mpBin32 { + clen = d.readContainerLen(msgpackContainerBin) // binary + } else if bd == mpStr8 || bd == mpStr16 || bd == mpStr32 || (bd >= mpFixStrMin && bd <= mpFixStrMax) { + clen = d.readContainerLen(msgpackContainerStr) // string/raw + } else if bd == mpArray16 || bd == mpArray32 || (bd >= mpFixArrayMin && bd <= mpFixArrayMax) { + // check if an "array" of uint8's + if zerocopy && len(bs) == 0 { + bs = d.d.b[:] } - d.r.readb(bs) + bsOut, _ = fastpathTV.DecSliceUint8V(bs, true, d.d) + return + } else { + d.d.errorf("invalid byte descriptor for decoding bytes, got: 0x%x", d.bd) + return } + d.bdRead = false - return + if zerocopy { + if d.br { + return d.r.readx(uint(clen)) + } else if len(bs) == 0 { + bs = d.d.b[:] + } + } + return decByteSlice(d.r, clen, d.h.MaxInitLen, bs) } -// Every top-level decode funcs (i.e. decodeValue, decode) must call this first. -func (d *msgpackDecDriver) initReadNext() { - if d.bdRead { - return - } +func (d *msgpackDecDriver) DecodeString() (s string) { + return string(d.DecodeBytes(d.d.b[:], true)) +} + +func (d *msgpackDecDriver) DecodeStringAsBytes() (s []byte) { + return d.DecodeBytes(d.d.b[:], true) +} + +func (d *msgpackDecDriver) readNextBd() { d.bd = d.r.readn1() d.bdRead = true - d.bdType = valueTypeUnset -} - -func (d *msgpackDecDriver) currentEncodedType() valueType { - if d.bdType == valueTypeUnset { - bd := d.bd - switch bd { - case mpNil: - d.bdType = valueTypeNil - case mpFalse, mpTrue: - d.bdType = valueTypeBool - case mpFloat, mpDouble: - d.bdType = valueTypeFloat - case mpUint8, mpUint16, mpUint32, mpUint64: - d.bdType = valueTypeUint - case mpInt8, mpInt16, mpInt32, mpInt64: - d.bdType = valueTypeInt - default: - switch { - case bd >= mpPosFixNumMin && bd <= mpPosFixNumMax: - d.bdType = valueTypeInt - case bd >= mpNegFixNumMin && bd <= mpNegFixNumMax: - d.bdType = valueTypeInt - case bd == mpStr8, bd == mpStr16, bd == mpStr32, bd >= mpFixStrMin && bd <= mpFixStrMax: - if d.h.RawToString { - d.bdType = valueTypeString - } else { - d.bdType = valueTypeBytes - } - case bd == mpBin8, bd == mpBin16, bd == mpBin32: - d.bdType = valueTypeBytes - case bd == mpArray16, bd == mpArray32, bd >= mpFixArrayMin && bd <= mpFixArrayMax: - d.bdType = valueTypeArray - case bd == mpMap16, bd == mpMap32, bd >= mpFixMapMin && bd <= mpFixMapMax: - d.bdType = valueTypeMap - case bd >= mpFixExt1 && bd <= mpFixExt16, bd >= mpExt8 && bd <= mpExt32: - d.bdType = valueTypeExt - default: - decErr("currentEncodedType: Undeciphered descriptor: %s: hex: %x, dec: %d", msgBadDesc, bd, bd) - } +} + +func (d *msgpackDecDriver) uncacheRead() { + if d.bdRead { + d.r.unreadn1() + d.bdRead = false + } +} + +func (d *msgpackDecDriver) ContainerType() (vt valueType) { + if !d.bdRead { + d.readNextBd() + } + bd := d.bd + // if bd == mpNil { + // // nil + // } else if bd == mpBin8 || bd == mpBin16 || bd == mpBin32 { + // // binary + // } else if bd == mpStr8 || bd == mpStr16 || bd == mpStr32 || (bd >= mpFixStrMin && bd <= mpFixStrMax) { + // // string/raw + // } else if bd == mpArray16 || bd == mpArray32 || (bd >= mpFixArrayMin && bd <= mpFixArrayMax) { + // // array + // } else if bd == mpMap16 || bd == mpMap32 || (bd >= mpFixMapMin && bd <= mpFixMapMax) { + // // map + // } + if bd == mpNil { + return valueTypeNil + } else if bd == mpBin8 || bd == mpBin16 || bd == mpBin32 { + return valueTypeBytes + } else if bd == mpStr8 || bd == mpStr16 || bd == mpStr32 || (bd >= mpFixStrMin && bd <= mpFixStrMax) { + if d.h.WriteExt { // UTF-8 string (new spec) + return valueTypeString } + return valueTypeBytes // raw (old spec) + } else if bd == mpArray16 || bd == mpArray32 || (bd >= mpFixArrayMin && bd <= mpFixArrayMax) { + return valueTypeArray + } else if bd == mpMap16 || bd == mpMap32 || (bd >= mpFixMapMin && bd <= mpFixMapMax) { + return valueTypeMap } - return d.bdType + // else { + // d.d.errorf("isContainerType: unsupported parameter: %v", vt) + // } + return valueTypeUnset } -func (d *msgpackDecDriver) tryDecodeAsNil() bool { +func (d *msgpackDecDriver) TryDecodeAsNil() (v bool) { + if !d.bdRead { + d.readNextBd() + } if d.bd == mpNil { d.bdRead = false return true } - return false + return } func (d *msgpackDecDriver) readContainerLen(ct msgpackContainerType) (clen int) { bd := d.bd - switch { - case bd == mpNil: + if bd == mpNil { clen = -1 // to represent nil - case bd == ct.b8: + } else if bd == ct.b8 { clen = int(d.r.readn1()) - case bd == ct.b16: - clen = int(d.r.readUint16()) - case bd == ct.b32: - clen = int(d.r.readUint32()) - case (ct.bFixMin & bd) == ct.bFixMin: + } else if bd == ct.b16 { + clen = int(bigen.Uint16(d.r.readx(2))) + } else if bd == ct.b32 { + clen = int(bigen.Uint32(d.r.readx(4))) + } else if (ct.bFixMin & bd) == ct.bFixMin { clen = int(ct.bFixMin ^ bd) - default: - decErr("readContainerLen: %s: hex: %x, dec: %d", msgBadDesc, bd, bd) + } else { + d.d.errorf("cannot read container length: %s: hex: %x, decimal: %d", msgBadDesc, bd, bd) + return } d.bdRead = false return } -func (d *msgpackDecDriver) readMapLen() int { +func (d *msgpackDecDriver) ReadMapStart() int { + if !d.bdRead { + d.readNextBd() + } return d.readContainerLen(msgpackContainerMap) } -func (d *msgpackDecDriver) readArrayLen() int { +func (d *msgpackDecDriver) ReadArrayStart() int { + if !d.bdRead { + d.readNextBd() + } return d.readContainerLen(msgpackContainerList) } @@ -637,30 +844,107 @@ func (d *msgpackDecDriver) readExtLen() (clen int) { case mpExt8: clen = int(d.r.readn1()) case mpExt16: - clen = int(d.r.readUint16()) + clen = int(bigen.Uint16(d.r.readx(2))) case mpExt32: - clen = int(d.r.readUint32()) + clen = int(bigen.Uint32(d.r.readx(4))) default: - decErr("decoding ext bytes: found unexpected byte: %x", d.bd) + d.d.errorf("decoding ext bytes: found unexpected byte: %x", d.bd) + return } return } -func (d *msgpackDecDriver) decodeExt(verifyTag bool, tag byte) (xtag byte, xbs []byte) { - xbd := d.bd - switch { - case xbd == mpBin8, xbd == mpBin16, xbd == mpBin32: - xbs, _ = d.decodeBytes(nil) - case xbd == mpStr8, xbd == mpStr16, xbd == mpStr32, - xbd >= mpFixStrMin && xbd <= mpFixStrMax: - xbs = []byte(d.decodeString()) +func (d *msgpackDecDriver) DecodeTime() (t time.Time) { + // decode time from string bytes or ext + if !d.bdRead { + d.readNextBd() + } + bd := d.bd + var clen int + if bd == mpNil { + d.bdRead = false + return + } else if bd == mpBin8 || bd == mpBin16 || bd == mpBin32 { + clen = d.readContainerLen(msgpackContainerBin) // binary + } else if bd == mpStr8 || bd == mpStr16 || bd == mpStr32 || (bd >= mpFixStrMin && bd <= mpFixStrMax) { + clen = d.readContainerLen(msgpackContainerStr) // string/raw + } else { + // expect to see mpFixExt4,-1 OR mpFixExt8,-1 OR mpExt8,12,-1 + d.bdRead = false + b2 := d.r.readn1() + if d.bd == mpFixExt4 && b2 == mpTimeExtTagU { + clen = 4 + } else if d.bd == mpFixExt8 && b2 == mpTimeExtTagU { + clen = 8 + } else if d.bd == mpExt8 && b2 == 12 && d.r.readn1() == mpTimeExtTagU { + clen = 12 + } else { + d.d.errorf("invalid stream for decoding time as extension: got 0x%x, 0x%x", d.bd, b2) + return + } + } + return d.decodeTime(clen) +} + +func (d *msgpackDecDriver) decodeTime(clen int) (t time.Time) { + // bs = d.r.readx(clen) + d.bdRead = false + switch clen { + case 4: + t = time.Unix(int64(bigen.Uint32(d.r.readx(4))), 0).UTC() + case 8: + tv := bigen.Uint64(d.r.readx(8)) + t = time.Unix(int64(tv&0x00000003ffffffff), int64(tv>>34)).UTC() + case 12: + nsec := bigen.Uint32(d.r.readx(4)) + sec := bigen.Uint64(d.r.readx(8)) + t = time.Unix(int64(sec), int64(nsec)).UTC() default: + d.d.errorf("invalid length of bytes for decoding time - expecting 4 or 8 or 12, got %d", clen) + return + } + return +} + +func (d *msgpackDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) (realxtag uint64) { + if xtag > 0xff { + d.d.errorf("ext: tag must be <= 0xff; got: %v", xtag) + return + } + realxtag1, xbs := d.decodeExtV(ext != nil, uint8(xtag)) + realxtag = uint64(realxtag1) + if ext == nil { + re := rv.(*RawExt) + re.Tag = realxtag + re.Data = detachZeroCopyBytes(d.br, re.Data, xbs) + } else { + ext.ReadExt(rv, xbs) + } + return +} + +func (d *msgpackDecDriver) decodeExtV(verifyTag bool, tag byte) (xtag byte, xbs []byte) { + if !d.bdRead { + d.readNextBd() + } + xbd := d.bd + if xbd == mpBin8 || xbd == mpBin16 || xbd == mpBin32 { + xbs = d.DecodeBytes(nil, true) + } else if xbd == mpStr8 || xbd == mpStr16 || xbd == mpStr32 || + (xbd >= mpFixStrMin && xbd <= mpFixStrMax) { + xbs = d.DecodeStringAsBytes() + } else { clen := d.readExtLen() xtag = d.r.readn1() if verifyTag && xtag != tag { - decErr("Wrong extension tag. Got %b. Expecting: %v", xtag, tag) + d.d.errorf("wrong extension tag - got %b, expecting %v", xtag, tag) + return + } + if d.br { + xbs = d.r.readx(uint(clen)) + } else { + xbs = decByteSlice(d.r, clen, d.d.h.MaxInitLen, d.d.b[:]) } - xbs = d.r.readn(clen) } d.bdRead = false return @@ -672,35 +956,55 @@ func (d *msgpackDecDriver) decodeExt(verifyTag bool, tag byte) (xtag byte, xbs [ type MsgpackHandle struct { BasicHandle - // RawToString controls how raw bytes are decoded into a nil interface{}. - RawToString bool - // WriteExt flag supports encoding configured extensions with extension tags. - // It also controls whether other elements of the new spec are encoded (ie Str8). + // NoFixedNum says to output all signed integers as 2-bytes, never as 1-byte fixednum. + NoFixedNum bool + + // WriteExt controls whether the new spec is honored. + // + // With WriteExt=true, we can encode configured extensions with extension tags + // and encode string/[]byte/extensions in a way compatible with the new spec + // but incompatible with the old spec. // - // With WriteExt=false, configured extensions are serialized as raw bytes - // and Str8 is not encoded. + // For compatibility with the old spec, set WriteExt=false. // - // A stream can still be decoded into a typed value, provided an appropriate value - // is provided, but the type cannot be inferred from the stream. If no appropriate - // type is provided (e.g. decoding into a nil interface{}), you get back - // a []byte or string based on the setting of RawToString. + // With WriteExt=false: + // configured extensions are serialized as raw bytes (not msgpack extensions). + // reserved byte descriptors like Str8 and those enabling the new msgpack Binary type + // are not encoded. WriteExt bool + + // PositiveIntUnsigned says to encode positive integers as unsigned. + PositiveIntUnsigned bool + + binaryEncodingType + noElemSeparators + + // _ [1]uint64 // padding } -func (h *MsgpackHandle) newEncDriver(w encWriter) encDriver { - return &msgpackEncDriver{w: w, h: h} +// Name returns the name of the handle: msgpack +func (h *MsgpackHandle) Name() string { return "msgpack" } + +// SetBytesExt sets an extension +func (h *MsgpackHandle) SetBytesExt(rt reflect.Type, tag uint64, ext BytesExt) (err error) { + return h.SetExt(rt, tag, &extWrapper{ext, interfaceExtFailer{}}) } -func (h *MsgpackHandle) newDecDriver(r decReader) decDriver { - return &msgpackDecDriver{r: r, h: h} +func (h *MsgpackHandle) newEncDriver(e *Encoder) encDriver { + return &msgpackEncDriver{e: e, w: e.w, h: h} } -func (h *MsgpackHandle) writeExt() bool { - return h.WriteExt +func (h *MsgpackHandle) newDecDriver(d *Decoder) decDriver { + return &msgpackDecDriver{d: d, h: h, r: d.r, br: d.bytes} } -func (h *MsgpackHandle) getBasicHandle() *BasicHandle { - return &h.BasicHandle +func (e *msgpackEncDriver) reset() { + e.w = e.e.w +} + +func (d *msgpackDecDriver) reset() { + d.r, d.br = d.d.r, d.d.bytes + d.bd, d.bdRead = 0, false } //-------------------------------------------------- @@ -721,7 +1025,7 @@ func (c *msgpackSpecRpcCodec) WriteRequest(r *rpc.Request, body interface{}) err bodyArr = []interface{}{body} } r2 := []interface{}{0, uint32(r.Seq), r.ServiceMethod, bodyArr} - return c.write(r2, nil, false, true) + return c.write(r2, nil, false) } func (c *msgpackSpecRpcCodec) WriteResponse(r *rpc.Response, body interface{}) error { @@ -733,7 +1037,7 @@ func (c *msgpackSpecRpcCodec) WriteResponse(r *rpc.Response, body interface{}) e body = nil } r2 := []interface{}{1, uint32(r.Seq), moe, body} - return c.write(r2, nil, false, true) + return c.write(r2, nil, false) } func (c *msgpackSpecRpcCodec) ReadResponseHeader(r *rpc.Response) error { @@ -753,8 +1057,7 @@ func (c *msgpackSpecRpcCodec) ReadRequestBody(body interface{}) error { } func (c *msgpackSpecRpcCodec) parseCustomHeader(expectTypeByte byte, msgid *uint64, methodOrError *string) (err error) { - - if c.cls { + if cls := c.cls.load(); cls.closed { return io.EOF } @@ -767,28 +1070,34 @@ func (c *msgpackSpecRpcCodec) parseCustomHeader(expectTypeByte byte, msgid *uint // err = fmt.Errorf("Unexpected value for array descriptor: Expecting %v. Received %v", fia, bs1) // return // } - var b byte - b, err = c.br.ReadByte() - if err != nil { - return - } - if b != fia { - err = fmt.Errorf("Unexpected value for array descriptor: Expecting %v. Received %v", fia, b) - return + var ba [1]byte + var n int + for { + n, err = c.r.Read(ba[:]) + if err != nil { + return + } + if n == 1 { + break + } } - if err = c.read(&b); err != nil { - return - } - if b != expectTypeByte { - err = fmt.Errorf("Unexpected byte descriptor in header. Expecting %v. Received %v", expectTypeByte, b) - return - } - if err = c.read(msgid); err != nil { - return - } - if err = c.read(methodOrError); err != nil { - return + var b = ba[0] + if b != fia { + err = fmt.Errorf("not array - %s %x/%s", msgBadDesc, b, mpdesc(b)) + } else { + err = c.read(&b) + if err == nil { + if b != expectTypeByte { + err = fmt.Errorf("%s - expecting %v but got %x/%s", + msgBadDesc, expectTypeByte, b, mpdesc(b)) + } else { + err = c.read(msgid) + if err == nil { + err = c.read(methodOrError) + } + } + } } return } @@ -801,7 +1110,8 @@ type msgpackSpecRpc struct{} // MsgpackSpecRpc implements Rpc using the communication protocol defined in // the msgpack spec at https://github.com/msgpack-rpc/msgpack-rpc/blob/master/spec.md . -// Its methods (ServerCodec and ClientCodec) return values that implement RpcCodecBuffered. +// +// See GoRpc documentation, for information on buffering for better performance. var MsgpackSpecRpc msgpackSpecRpc func (x msgpackSpecRpc) ServerCodec(conn io.ReadWriteCloser, h Handle) rpc.ServerCodec { diff --git a/vendor/github.com/ugorji/go/codec/py_test.go b/vendor/github.com/ugorji/go/codec/py_test.go new file mode 100644 index 000000000..d5ff6d259 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/py_test.go @@ -0,0 +1,30 @@ +// +build x + +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +package codec + +// These tests are used to verify msgpack and cbor implementations against their python libraries. +// If you have the library installed, you can enable the tests back by running: go test -tags=x . +// Look at test.py for how to setup your environment. + +import ( + "testing" +) + +func TestMsgpackPythonGenStreams(t *testing.T) { + doTestPythonGenStreams(t, "msgpack", testMsgpackH) +} + +func TestCborPythonGenStreams(t *testing.T) { + doTestPythonGenStreams(t, "cbor", testCborH) +} + +func TestMsgpackRpcSpecGoClientToPythonSvc(t *testing.T) { + doTestMsgpackRpcSpecGoClientToPythonSvc(t) +} + +func TestMsgpackRpcSpecPythonClientToGoSvc(t *testing.T) { + doTestMsgpackRpcSpecPythonClientToGoSvc(t) +} diff --git a/vendor/github.com/ugorji/go/codec/rpc.go b/vendor/github.com/ugorji/go/codec/rpc.go index d014dbdcc..392508815 100644 --- a/vendor/github.com/ugorji/go/codec/rpc.go +++ b/vendor/github.com/ugorji/go/codec/rpc.go @@ -1,99 +1,150 @@ -// Copyright (c) 2012, 2013 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. package codec import ( "bufio" + "errors" "io" "net/rpc" - "sync" ) +var errRpcJsonNeedsTermWhitespace = errors.New("rpc requires JsonHandle with TermWhitespace=true") + // Rpc provides a rpc Server or Client Codec for rpc communication. type Rpc interface { ServerCodec(conn io.ReadWriteCloser, h Handle) rpc.ServerCodec ClientCodec(conn io.ReadWriteCloser, h Handle) rpc.ClientCodec } -// RpcCodecBuffered allows access to the underlying bufio.Reader/Writer -// used by the rpc connection. It accomodates use-cases where the connection -// should be used by rpc and non-rpc functions, e.g. streaming a file after -// sending an rpc response. -type RpcCodecBuffered interface { - BufferedReader() *bufio.Reader - BufferedWriter() *bufio.Writer +// RPCOptions holds options specific to rpc functionality +type RPCOptions struct { + // RPCNoBuffer configures whether we attempt to buffer reads and writes during RPC calls. + // + // Set RPCNoBuffer=true to turn buffering off. + // Buffering can still be done if buffered connections are passed in, or + // buffering is configured on the handle. + RPCNoBuffer bool } -// ------------------------------------- - // rpcCodec defines the struct members and common methods. type rpcCodec struct { - rwc io.ReadWriteCloser + c io.Closer + r io.Reader + w io.Writer + f ioFlusher + dec *Decoder enc *Encoder - bw *bufio.Writer - br *bufio.Reader - mu sync.Mutex - cls bool -} + // bw *bufio.Writer + // br *bufio.Reader + h Handle -func newRPCCodec(conn io.ReadWriteCloser, h Handle) rpcCodec { - bw := bufio.NewWriter(conn) - br := bufio.NewReader(conn) - return rpcCodec{ - rwc: conn, - bw: bw, - br: br, - enc: NewEncoder(bw, h), - dec: NewDecoder(br, h), - } + cls atomicClsErr } -func (c *rpcCodec) BufferedReader() *bufio.Reader { - return c.br +func newRPCCodec(conn io.ReadWriteCloser, h Handle) rpcCodec { + // return newRPCCodec2(bufio.NewReader(conn), bufio.NewWriter(conn), conn, h) + return newRPCCodec2(conn, conn, conn, h) } -func (c *rpcCodec) BufferedWriter() *bufio.Writer { - return c.bw +func newRPCCodec2(r io.Reader, w io.Writer, c io.Closer, h Handle) rpcCodec { + // defensive: ensure that jsonH has TermWhitespace turned on. + if jsonH, ok := h.(*JsonHandle); ok && !jsonH.TermWhitespace { + panic(errRpcJsonNeedsTermWhitespace) + } + // always ensure that we use a flusher, and always flush what was written to the connection. + // we lose nothing by using a buffered writer internally. + f, ok := w.(ioFlusher) + bh := basicHandle(h) + if !bh.RPCNoBuffer { + if bh.WriterBufferSize <= 0 { + if !ok { + bw := bufio.NewWriter(w) + f, w = bw, bw + } + } + if bh.ReaderBufferSize <= 0 { + if _, ok = w.(ioPeeker); !ok { + if _, ok = w.(ioBuffered); !ok { + br := bufio.NewReader(r) + r = br + } + } + } + } + return rpcCodec{ + c: c, + w: w, + r: r, + f: f, + h: h, + enc: NewEncoder(w, h), + dec: NewDecoder(r, h), + } } -func (c *rpcCodec) write(obj1, obj2 interface{}, writeObj2, doFlush bool) (err error) { - if c.cls { - return io.EOF - } - if err = c.enc.Encode(obj1); err != nil { - return +func (c *rpcCodec) write(obj1, obj2 interface{}, writeObj2 bool) (err error) { + if c.c != nil { + cls := c.cls.load() + if cls.closed { + return cls.errClosed + } } - if writeObj2 { - if err = c.enc.Encode(obj2); err != nil { - return + err = c.enc.Encode(obj1) + if err == nil { + if writeObj2 { + err = c.enc.Encode(obj2) } + // if err == nil && c.f != nil { + // err = c.f.Flush() + // } } - if doFlush && c.bw != nil { - return c.bw.Flush() + if c.f != nil { + if err == nil { + err = c.f.Flush() + } else { + _ = c.f.Flush() // swallow flush error, so we maintain prior error on write + } } return } +func (c *rpcCodec) swallow(err *error) { + defer panicToErr(c.dec, err) + c.dec.swallow() +} + func (c *rpcCodec) read(obj interface{}) (err error) { - if c.cls { - return io.EOF + if c.c != nil { + cls := c.cls.load() + if cls.closed { + return cls.errClosed + } } - //If nil is passed in, we should still attempt to read content to nowhere. + //If nil is passed in, we should read and discard if obj == nil { - var obj2 interface{} - return c.dec.Decode(&obj2) + // var obj2 interface{} + // return c.dec.Decode(&obj2) + c.swallow(&err) + return } return c.dec.Decode(obj) } func (c *rpcCodec) Close() error { - if c.cls { - return io.EOF + if c.c == nil { + return nil + } + cls := c.cls.load() + if cls.closed { + return cls.errClosed } - c.cls = true - return c.rwc.Close() + cls.errClosed = c.c.Close() + cls.closed = true + c.cls.store(cls) + return cls.errClosed } func (c *rpcCodec) ReadResponseBody(body interface{}) error { @@ -107,16 +158,11 @@ type goRpcCodec struct { } func (c *goRpcCodec) WriteRequest(r *rpc.Request, body interface{}) error { - // Must protect for concurrent access as per API - c.mu.Lock() - defer c.mu.Unlock() - return c.write(r, body, true, true) + return c.write(r, body, true) } func (c *goRpcCodec) WriteResponse(r *rpc.Response, body interface{}) error { - c.mu.Lock() - defer c.mu.Unlock() - return c.write(r, body, true, true) + return c.write(r, body, true) } func (c *goRpcCodec) ReadResponseHeader(r *rpc.Response) error { @@ -138,7 +184,36 @@ func (c *goRpcCodec) ReadRequestBody(body interface{}) error { type goRpc struct{} // GoRpc implements Rpc using the communication protocol defined in net/rpc package. -// Its methods (ServerCodec and ClientCodec) return values that implement RpcCodecBuffered. +// +// Note: network connection (from net.Dial, of type io.ReadWriteCloser) is not buffered. +// +// For performance, you should configure WriterBufferSize and ReaderBufferSize on the handle. +// This ensures we use an adequate buffer during reading and writing. +// If not configured, we will internally initialize and use a buffer during reads and writes. +// This can be turned off via the RPCNoBuffer option on the Handle. +// var handle codec.JsonHandle +// handle.RPCNoBuffer = true // turns off attempt by rpc module to initialize a buffer +// +// Example 1: one way of configuring buffering explicitly: +// var handle codec.JsonHandle // codec handle +// handle.ReaderBufferSize = 1024 +// handle.WriterBufferSize = 1024 +// var conn io.ReadWriteCloser // connection got from a socket +// var serverCodec = GoRpc.ServerCodec(conn, handle) +// var clientCodec = GoRpc.ClientCodec(conn, handle) +// +// Example 2: you can also explicitly create a buffered connection yourself, +// and not worry about configuring the buffer sizes in the Handle. +// var handle codec.Handle // codec handle +// var conn io.ReadWriteCloser // connection got from a socket +// var bufconn = struct { // bufconn here is a buffered io.ReadWriteCloser +// io.Closer +// *bufio.Reader +// *bufio.Writer +// }{conn, bufio.NewReader(conn), bufio.NewWriter(conn)} +// var serverCodec = GoRpc.ServerCodec(bufconn, handle) +// var clientCodec = GoRpc.ClientCodec(bufconn, handle) +// var GoRpc goRpc func (x goRpc) ServerCodec(conn io.ReadWriteCloser, h Handle) rpc.ServerCodec { @@ -148,5 +223,3 @@ func (x goRpc) ServerCodec(conn io.ReadWriteCloser, h Handle) rpc.ServerCodec { func (x goRpc) ClientCodec(conn io.ReadWriteCloser, h Handle) rpc.ClientCodec { return &goRpcCodec{newRPCCodec(conn, h)} } - -var _ RpcCodecBuffered = (*rpcCodec)(nil) // ensure *rpcCodec implements RpcCodecBuffered diff --git a/vendor/github.com/ugorji/go/codec/shared_test.go b/vendor/github.com/ugorji/go/codec/shared_test.go new file mode 100644 index 000000000..568d246db --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/shared_test.go @@ -0,0 +1,316 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +package codec + +// This file sets up the variables used, including testInitFns. +// Each file should add initialization that should be performed +// after flags are parsed. +// +// init is a multi-step process: +// - setup vars (handled by init functions in each file) +// - parse flags +// - setup derived vars (handled by pre-init registered functions - registered in init function) +// - post init (handled by post-init registered functions - registered in init function) +// This way, no one has to manage carefully control the initialization +// using file names, etc. +// +// Tests which require external dependencies need the -tag=x parameter. +// They should be run as: +// go test -tags=x -run=. +// Benchmarks should also take this parameter, to include the sereal, xdr, etc. +// To run against codecgen, etc, make sure you pass extra parameters. +// Example usage: +// go test "-tags=x codecgen" -bench=. +// +// To fully test everything: +// go test -tags=x -benchtime=100ms -tv -bg -bi -brw -bu -v -run=. -bench=. + +// Handling flags +// codec_test.go will define a set of global flags for testing, including: +// - Use Reset +// - Use IO reader/writer (vs direct bytes) +// - Set Canonical +// - Set InternStrings +// - Use Symbols +// +// This way, we can test them all by running same set of tests with a different +// set of flags. +// +// Following this, all the benchmarks will utilize flags set by codec_test.go +// and will not redefine these "global" flags. + +import ( + "bytes" + "flag" + "fmt" + "io" + "io/ioutil" + "log" + "sync" + "testing" +) + +// DO NOT REMOVE - replacement line for go-codec-bench import declaration tag // + +type testHED struct { + H Handle + E *Encoder + D *Decoder +} + +type ioReaderWrapper struct { + r io.Reader +} + +func (x ioReaderWrapper) Read(p []byte) (n int, err error) { + return x.r.Read(p) +} + +type ioWriterWrapper struct { + w io.Writer +} + +func (x ioWriterWrapper) Write(p []byte) (n int, err error) { + return x.w.Write(p) +} + +var ( + // testNoopH = NoopHandle(8) + testMsgpackH = &MsgpackHandle{} + testBincH = &BincHandle{} + testSimpleH = &SimpleHandle{} + testCborH = &CborHandle{} + testJsonH = &JsonHandle{} + + testHandles []Handle + testPreInitFns []func() + testPostInitFns []func() + + testOnce sync.Once + + testHEDs []testHED +) + +// flag variables used by tests (and bench) +var ( + testDepth int + + testVerbose bool + testInitDebug bool + testStructToArray bool + testCanonical bool + testUseReset bool + testSkipIntf bool + testInternStr bool + testUseMust bool + testCheckCircRef bool + + testUseIoEncDec int + testUseIoWrapper bool + + testMaxInitLen int + + testNumRepeatString int + + testRpcBufsize int +) + +// variables that are not flags, but which can configure the handles +var ( + testEncodeOptions EncodeOptions + testDecodeOptions DecodeOptions +) + +// flag variables used by bench +var ( + benchDoInitBench bool + benchVerify bool + benchUnscientificRes bool = false + benchMapStringKeyOnly bool + //depth of 0 maps to ~400bytes json-encoded string, 1 maps to ~1400 bytes, etc + //For depth>1, we likely trigger stack growth for encoders, making benchmarking unreliable. + benchDepth int + benchInitDebug bool +) + +func init() { + log.SetOutput(ioutil.Discard) // don't allow things log to standard out/err + testHEDs = make([]testHED, 0, 32) + testHandles = append(testHandles, + // testNoopH, + testMsgpackH, testBincH, testSimpleH, testCborH, testJsonH) + // set ExplicitRelease on each handle + testMsgpackH.ExplicitRelease = true + testBincH.ExplicitRelease = true + testSimpleH.ExplicitRelease = true + testCborH.ExplicitRelease = true + testJsonH.ExplicitRelease = true + + testInitFlags() + benchInitFlags() +} + +func testInitFlags() { + // delete(testDecOpts.ExtFuncs, timeTyp) + flag.IntVar(&testDepth, "tsd", 0, "Test Struc Depth") + flag.BoolVar(&testVerbose, "tv", false, "Test Verbose (no longer used - here for compatibility)") + flag.BoolVar(&testInitDebug, "tg", false, "Test Init Debug") + flag.IntVar(&testUseIoEncDec, "ti", -1, "Use IO Reader/Writer for Marshal/Unmarshal ie >= 0") + flag.BoolVar(&testUseIoWrapper, "tiw", false, "Wrap the IO Reader/Writer with a base pass-through reader/writer") + flag.BoolVar(&testStructToArray, "ts", false, "Set StructToArray option") + flag.BoolVar(&testCanonical, "tc", false, "Set Canonical option") + flag.BoolVar(&testInternStr, "te", false, "Set InternStr option") + flag.BoolVar(&testSkipIntf, "tf", false, "Skip Interfaces") + flag.BoolVar(&testUseReset, "tr", false, "Use Reset") + flag.IntVar(&testNumRepeatString, "trs", 8, "Create string variables by repeating a string N times") + flag.IntVar(&testMaxInitLen, "tx", 0, "Max Init Len") + flag.BoolVar(&testUseMust, "tm", true, "Use Must(En|De)code") + flag.BoolVar(&testCheckCircRef, "tl", false, "Use Check Circular Ref") +} + +func benchInitFlags() { + flag.BoolVar(&benchMapStringKeyOnly, "bs", false, "Bench use maps with string keys only") + flag.BoolVar(&benchInitDebug, "bg", false, "Bench Debug") + flag.IntVar(&benchDepth, "bd", 1, "Bench Depth") + flag.BoolVar(&benchDoInitBench, "bi", false, "Run Bench Init") + flag.BoolVar(&benchVerify, "bv", false, "Verify Decoded Value during Benchmark") + flag.BoolVar(&benchUnscientificRes, "bu", false, "Show Unscientific Results during Benchmark") +} + +func testHEDGet(h Handle) *testHED { + for i := range testHEDs { + v := &testHEDs[i] + if v.H == h { + return v + } + } + testHEDs = append(testHEDs, testHED{h, NewEncoder(nil, h), NewDecoder(nil, h)}) + return &testHEDs[len(testHEDs)-1] +} + +func testReinit() { + testOnce = sync.Once{} + testHEDs = nil +} + +func testInitAll() { + // only parse it once. + if !flag.Parsed() { + flag.Parse() + } + for _, f := range testPreInitFns { + f() + } + for _, f := range testPostInitFns { + f() + } +} + +func sTestCodecEncode(ts interface{}, bsIn []byte, fn func([]byte) *bytes.Buffer, + h Handle, bh *BasicHandle) (bs []byte, err error) { + // bs = make([]byte, 0, approxSize) + var e *Encoder + var buf *bytes.Buffer + if testUseReset { + e = testHEDGet(h).E + } else { + e = NewEncoder(nil, h) + } + var oldWriteBufferSize int + if testUseIoEncDec >= 0 { + buf = fn(bsIn) + // set the encode options for using a buffer + oldWriteBufferSize = bh.WriterBufferSize + bh.WriterBufferSize = testUseIoEncDec + if testUseIoWrapper { + e.Reset(ioWriterWrapper{buf}) + } else { + e.Reset(buf) + } + } else { + bs = bsIn + e.ResetBytes(&bs) + } + if testUseMust { + e.MustEncode(ts) + } else { + err = e.Encode(ts) + } + if testUseIoEncDec >= 0 { + bs = buf.Bytes() + bh.WriterBufferSize = oldWriteBufferSize + } + if !testUseReset { + e.Release() + } + return +} + +func sTestCodecDecode(bs []byte, ts interface{}, h Handle, bh *BasicHandle) (err error) { + var d *Decoder + // var buf *bytes.Reader + if testUseReset { + d = testHEDGet(h).D + } else { + d = NewDecoder(nil, h) + } + var oldReadBufferSize int + if testUseIoEncDec >= 0 { + buf := bytes.NewReader(bs) + oldReadBufferSize = bh.ReaderBufferSize + bh.ReaderBufferSize = testUseIoEncDec + if testUseIoWrapper { + d.Reset(ioReaderWrapper{buf}) + } else { + d.Reset(buf) + } + } else { + d.ResetBytes(bs) + } + if testUseMust { + d.MustDecode(ts) + } else { + err = d.Decode(ts) + } + if testUseIoEncDec >= 0 { + bh.ReaderBufferSize = oldReadBufferSize + } + if !testUseReset { + d.Release() + } + return +} + +// --- functions below are used by both benchmarks and tests + +func logT(x interface{}, format string, args ...interface{}) { + if t, ok := x.(*testing.T); ok && t != nil { + t.Logf(format, args...) + } else if b, ok := x.(*testing.B); ok && b != nil { + b.Logf(format, args...) + } else { // if testing.Verbose() { // if testVerbose { + if len(format) == 0 || format[len(format)-1] != '\n' { + format = format + "\n" + } + fmt.Printf(format, args...) + } +} + +// --- functions below are used only by benchmarks alone + +func fnBenchmarkByteBuf(bsIn []byte) (buf *bytes.Buffer) { + // var buf bytes.Buffer + // buf.Grow(approxSize) + buf = bytes.NewBuffer(bsIn) + buf.Truncate(0) + return +} + +// func benchFnCodecEncode(ts interface{}, bsIn []byte, h Handle) (bs []byte, err error) { +// return testCodecEncode(ts, bsIn, fnBenchmarkByteBuf, h) +// } + +// func benchFnCodecDecode(bs []byte, ts interface{}, h Handle) (err error) { +// return testCodecDecode(bs, ts, h) +// } diff --git a/vendor/github.com/ugorji/go/codec/simple.go b/vendor/github.com/ugorji/go/codec/simple.go index 9e4d148a2..a3257c1a7 100644 --- a/vendor/github.com/ugorji/go/codec/simple.go +++ b/vendor/github.com/ugorji/go/codec/simple.go @@ -1,9 +1,13 @@ -// Copyright (c) 2012, 2013 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. package codec -import "math" +import ( + "math" + "reflect" + "time" +) const ( _ uint8 = iota @@ -17,6 +21,8 @@ const ( simpleVdPosInt = 8 simpleVdNegInt = 12 + simpleVdTime = 24 + // containers: each lasts for 4 (ie n, n+1, n+2, ... n+7) simpleVdString = 216 simpleVdByteArray = 224 @@ -26,23 +32,27 @@ const ( ) type simpleEncDriver struct { + noBuiltInTypes + // encNoSeparator + e *Encoder h *SimpleHandle - w encWriter - //b [8]byte -} - -func (e *simpleEncDriver) isBuiltinType(rt uintptr) bool { - return false + w *encWriterSwitch + b [8]byte + // c containerState + encDriverTrackContainerWriter + // encDriverNoopContainerWriter + _ [3]uint64 // padding } -func (e *simpleEncDriver) encodeBuiltin(rt uintptr, v interface{}) { -} - -func (e *simpleEncDriver) encodeNil() { +func (e *simpleEncDriver) EncodeNil() { e.w.writen1(simpleVdNil) } -func (e *simpleEncDriver) encodeBool(b bool) { +func (e *simpleEncDriver) EncodeBool(b bool) { + if e.h.EncZeroValuesAsNil && e.c != containerMapKey && !b { + e.EncodeNil() + return + } if b { e.w.writen1(simpleVdTrue) } else { @@ -50,17 +60,25 @@ func (e *simpleEncDriver) encodeBool(b bool) { } } -func (e *simpleEncDriver) encodeFloat32(f float32) { +func (e *simpleEncDriver) EncodeFloat32(f float32) { + if e.h.EncZeroValuesAsNil && e.c != containerMapKey && f == 0.0 { + e.EncodeNil() + return + } e.w.writen1(simpleVdFloat32) - e.w.writeUint32(math.Float32bits(f)) + bigenHelper{e.b[:4], e.w}.writeUint32(math.Float32bits(f)) } -func (e *simpleEncDriver) encodeFloat64(f float64) { +func (e *simpleEncDriver) EncodeFloat64(f float64) { + if e.h.EncZeroValuesAsNil && e.c != containerMapKey && f == 0.0 { + e.EncodeNil() + return + } e.w.writen1(simpleVdFloat64) - e.w.writeUint64(math.Float64bits(f)) + bigenHelper{e.b[:8], e.w}.writeUint64(math.Float64bits(f)) } -func (e *simpleEncDriver) encodeInt(v int64) { +func (e *simpleEncDriver) EncodeInt(v int64) { if v < 0 { e.encUint(uint64(-v), simpleVdNegInt) } else { @@ -68,236 +86,323 @@ func (e *simpleEncDriver) encodeInt(v int64) { } } -func (e *simpleEncDriver) encodeUint(v uint64) { +func (e *simpleEncDriver) EncodeUint(v uint64) { e.encUint(v, simpleVdPosInt) } func (e *simpleEncDriver) encUint(v uint64, bd uint8) { - switch { - case v <= math.MaxUint8: + if e.h.EncZeroValuesAsNil && e.c != containerMapKey && v == 0 { + e.EncodeNil() + return + } + if v <= math.MaxUint8 { e.w.writen2(bd, uint8(v)) - case v <= math.MaxUint16: + } else if v <= math.MaxUint16 { e.w.writen1(bd + 1) - e.w.writeUint16(uint16(v)) - case v <= math.MaxUint32: + bigenHelper{e.b[:2], e.w}.writeUint16(uint16(v)) + } else if v <= math.MaxUint32 { e.w.writen1(bd + 2) - e.w.writeUint32(uint32(v)) - case v <= math.MaxUint64: + bigenHelper{e.b[:4], e.w}.writeUint32(uint32(v)) + } else { // if v <= math.MaxUint64 { e.w.writen1(bd + 3) - e.w.writeUint64(v) + bigenHelper{e.b[:8], e.w}.writeUint64(v) } } func (e *simpleEncDriver) encLen(bd byte, length int) { - switch { - case length == 0: + if length == 0 { e.w.writen1(bd) - case length <= math.MaxUint8: + } else if length <= math.MaxUint8 { e.w.writen1(bd + 1) e.w.writen1(uint8(length)) - case length <= math.MaxUint16: + } else if length <= math.MaxUint16 { e.w.writen1(bd + 2) - e.w.writeUint16(uint16(length)) - case int64(length) <= math.MaxUint32: + bigenHelper{e.b[:2], e.w}.writeUint16(uint16(length)) + } else if int64(length) <= math.MaxUint32 { e.w.writen1(bd + 3) - e.w.writeUint32(uint32(length)) - default: + bigenHelper{e.b[:4], e.w}.writeUint32(uint32(length)) + } else { e.w.writen1(bd + 4) - e.w.writeUint64(uint64(length)) + bigenHelper{e.b[:8], e.w}.writeUint64(uint64(length)) } } +func (e *simpleEncDriver) EncodeExt(rv interface{}, xtag uint64, ext Ext, _ *Encoder) { + bs := ext.WriteExt(rv) + if bs == nil { + e.EncodeNil() + return + } + e.encodeExtPreamble(uint8(xtag), len(bs)) + e.w.writeb(bs) +} + +func (e *simpleEncDriver) EncodeRawExt(re *RawExt, _ *Encoder) { + e.encodeExtPreamble(uint8(re.Tag), len(re.Data)) + e.w.writeb(re.Data) +} + func (e *simpleEncDriver) encodeExtPreamble(xtag byte, length int) { e.encLen(simpleVdExt, length) e.w.writen1(xtag) } -func (e *simpleEncDriver) encodeArrayPreamble(length int) { +func (e *simpleEncDriver) WriteArrayStart(length int) { + e.c = containerArrayStart e.encLen(simpleVdArray, length) } -func (e *simpleEncDriver) encodeMapPreamble(length int) { +func (e *simpleEncDriver) WriteMapStart(length int) { + e.c = containerMapStart e.encLen(simpleVdMap, length) } -func (e *simpleEncDriver) encodeString(c charEncoding, v string) { +// func (e *simpleEncDriver) EncodeSymbol(v string) { +// e.EncodeStringEnc(cUTF8, v) +// } + +func (e *simpleEncDriver) EncodeStringEnc(c charEncoding, v string) { + if false && e.h.EncZeroValuesAsNil && e.c != containerMapKey && v == "" { + e.EncodeNil() + return + } e.encLen(simpleVdString, len(v)) e.w.writestr(v) } -func (e *simpleEncDriver) encodeSymbol(v string) { - e.encodeString(c_UTF8, v) +func (e *simpleEncDriver) EncodeString(c charEncoding, v string) { + e.EncodeStringEnc(c, v) } -func (e *simpleEncDriver) encodeStringBytes(c charEncoding, v []byte) { +func (e *simpleEncDriver) EncodeStringBytes(c charEncoding, v []byte) { + e.EncodeStringBytesRaw(v) +} + +func (e *simpleEncDriver) EncodeStringBytesRaw(v []byte) { + // if e.h.EncZeroValuesAsNil && e.c != containerMapKey && v == nil { + if v == nil { + e.EncodeNil() + return + } e.encLen(simpleVdByteArray, len(v)) e.w.writeb(v) } +func (e *simpleEncDriver) EncodeTime(t time.Time) { + // if e.h.EncZeroValuesAsNil && e.c != containerMapKey && t.IsZero() { + if t.IsZero() { + e.EncodeNil() + return + } + v, err := t.MarshalBinary() + if err != nil { + e.e.errorv(err) + return + } + // time.Time marshalbinary takes about 14 bytes. + e.w.writen2(simpleVdTime, uint8(len(v))) + e.w.writeb(v) +} + //------------------------------------ type simpleDecDriver struct { + d *Decoder h *SimpleHandle - r decReader + r *decReaderSwitch bdRead bool - bdType valueType bd byte - //b [8]byte + br bool // a bytes reader? + c containerState + // b [scratchByteArrayLen]byte + noBuiltInTypes + // noStreamingCodec + decDriverNoopContainerReader + // _ [3]uint64 // padding } -func (d *simpleDecDriver) initReadNext() { - if d.bdRead { - return - } +func (d *simpleDecDriver) readNextBd() { d.bd = d.r.readn1() d.bdRead = true - d.bdType = valueTypeUnset -} - -func (d *simpleDecDriver) currentEncodedType() valueType { - if d.bdType == valueTypeUnset { - switch d.bd { - case simpleVdNil: - d.bdType = valueTypeNil - case simpleVdTrue, simpleVdFalse: - d.bdType = valueTypeBool - case simpleVdPosInt, simpleVdPosInt + 1, simpleVdPosInt + 2, simpleVdPosInt + 3: - d.bdType = valueTypeUint - case simpleVdNegInt, simpleVdNegInt + 1, simpleVdNegInt + 2, simpleVdNegInt + 3: - d.bdType = valueTypeInt - case simpleVdFloat32, simpleVdFloat64: - d.bdType = valueTypeFloat - case simpleVdString, simpleVdString + 1, simpleVdString + 2, simpleVdString + 3, simpleVdString + 4: - d.bdType = valueTypeString - case simpleVdByteArray, simpleVdByteArray + 1, simpleVdByteArray + 2, simpleVdByteArray + 3, simpleVdByteArray + 4: - d.bdType = valueTypeBytes - case simpleVdExt, simpleVdExt + 1, simpleVdExt + 2, simpleVdExt + 3, simpleVdExt + 4: - d.bdType = valueTypeExt - case simpleVdArray, simpleVdArray + 1, simpleVdArray + 2, simpleVdArray + 3, simpleVdArray + 4: - d.bdType = valueTypeArray - case simpleVdMap, simpleVdMap + 1, simpleVdMap + 2, simpleVdMap + 3, simpleVdMap + 4: - d.bdType = valueTypeMap - default: - decErr("currentEncodedType: Unrecognized d.vd: 0x%x", d.bd) - } - } - return d.bdType } -func (d *simpleDecDriver) tryDecodeAsNil() bool { - if d.bd == simpleVdNil { +func (d *simpleDecDriver) uncacheRead() { + if d.bdRead { + d.r.unreadn1() d.bdRead = false - return true } - return false } -func (d *simpleDecDriver) isBuiltinType(rt uintptr) bool { - return false +func (d *simpleDecDriver) ContainerType() (vt valueType) { + if !d.bdRead { + d.readNextBd() + } + switch d.bd { + case simpleVdNil: + return valueTypeNil + case simpleVdByteArray, simpleVdByteArray + 1, + simpleVdByteArray + 2, simpleVdByteArray + 3, simpleVdByteArray + 4: + return valueTypeBytes + case simpleVdString, simpleVdString + 1, + simpleVdString + 2, simpleVdString + 3, simpleVdString + 4: + return valueTypeString + case simpleVdArray, simpleVdArray + 1, + simpleVdArray + 2, simpleVdArray + 3, simpleVdArray + 4: + return valueTypeArray + case simpleVdMap, simpleVdMap + 1, + simpleVdMap + 2, simpleVdMap + 3, simpleVdMap + 4: + return valueTypeMap + // case simpleVdTime: + // return valueTypeTime + } + // else { + // d.d.errorf("isContainerType: unsupported parameter: %v", vt) + // } + return valueTypeUnset } -func (d *simpleDecDriver) decodeBuiltin(rt uintptr, v interface{}) { +func (d *simpleDecDriver) TryDecodeAsNil() bool { + if !d.bdRead { + d.readNextBd() + } + if d.bd == simpleVdNil { + d.bdRead = false + return true + } + return false } -func (d *simpleDecDriver) decIntAny() (ui uint64, i int64, neg bool) { +func (d *simpleDecDriver) decCheckInteger() (ui uint64, neg bool) { + if !d.bdRead { + d.readNextBd() + } switch d.bd { case simpleVdPosInt: ui = uint64(d.r.readn1()) - i = int64(ui) case simpleVdPosInt + 1: - ui = uint64(d.r.readUint16()) - i = int64(ui) + ui = uint64(bigen.Uint16(d.r.readx(2))) case simpleVdPosInt + 2: - ui = uint64(d.r.readUint32()) - i = int64(ui) + ui = uint64(bigen.Uint32(d.r.readx(4))) case simpleVdPosInt + 3: - ui = uint64(d.r.readUint64()) - i = int64(ui) + ui = uint64(bigen.Uint64(d.r.readx(8))) case simpleVdNegInt: ui = uint64(d.r.readn1()) - i = -(int64(ui)) neg = true case simpleVdNegInt + 1: - ui = uint64(d.r.readUint16()) - i = -(int64(ui)) + ui = uint64(bigen.Uint16(d.r.readx(2))) neg = true case simpleVdNegInt + 2: - ui = uint64(d.r.readUint32()) - i = -(int64(ui)) + ui = uint64(bigen.Uint32(d.r.readx(4))) neg = true case simpleVdNegInt + 3: - ui = uint64(d.r.readUint64()) - i = -(int64(ui)) + ui = uint64(bigen.Uint64(d.r.readx(8))) neg = true default: - decErr("decIntAny: Integer only valid from pos/neg integer1..8. Invalid descriptor: %v", d.bd) + d.d.errorf("integer only valid from pos/neg integer1..8. Invalid descriptor: %v", d.bd) + return } // don't do this check, because callers may only want the unsigned value. // if ui > math.MaxInt64 { - // decErr("decIntAny: Integer out of range for signed int64: %v", ui) + // d.d.errorf("decIntAny: Integer out of range for signed int64: %v", ui) + // return // } return } -func (d *simpleDecDriver) decodeInt(bitsize uint8) (i int64) { - _, i, _ = d.decIntAny() - checkOverflow(0, i, bitsize) +func (d *simpleDecDriver) DecodeInt64() (i int64) { + ui, neg := d.decCheckInteger() + i = chkOvf.SignedIntV(ui) + if neg { + i = -i + } d.bdRead = false return } -func (d *simpleDecDriver) decodeUint(bitsize uint8) (ui uint64) { - ui, i, neg := d.decIntAny() +func (d *simpleDecDriver) DecodeUint64() (ui uint64) { + ui, neg := d.decCheckInteger() if neg { - decErr("Assigning negative signed value: %v, to unsigned type", i) + d.d.errorf("assigning negative signed value to unsigned type") + return } - checkOverflow(ui, 0, bitsize) d.bdRead = false return } -func (d *simpleDecDriver) decodeFloat(chkOverflow32 bool) (f float64) { - switch d.bd { - case simpleVdFloat32: - f = float64(math.Float32frombits(d.r.readUint32())) - case simpleVdFloat64: - f = math.Float64frombits(d.r.readUint64()) - default: +func (d *simpleDecDriver) DecodeFloat64() (f float64) { + if !d.bdRead { + d.readNextBd() + } + if d.bd == simpleVdFloat32 { + f = float64(math.Float32frombits(bigen.Uint32(d.r.readx(4)))) + } else if d.bd == simpleVdFloat64 { + f = math.Float64frombits(bigen.Uint64(d.r.readx(8))) + } else { if d.bd >= simpleVdPosInt && d.bd <= simpleVdNegInt+3 { - _, i, _ := d.decIntAny() - f = float64(i) + f = float64(d.DecodeInt64()) } else { - decErr("Float only valid from float32/64: Invalid descriptor: %v", d.bd) + d.d.errorf("float only valid from float32/64: Invalid descriptor: %v", d.bd) + return } } - checkOverflowFloat32(f, chkOverflow32) d.bdRead = false return } // bool can be decoded from bool only (single byte). -func (d *simpleDecDriver) decodeBool() (b bool) { - switch d.bd { - case simpleVdTrue: +func (d *simpleDecDriver) DecodeBool() (b bool) { + if !d.bdRead { + d.readNextBd() + } + if d.bd == simpleVdTrue { b = true - case simpleVdFalse: - default: - decErr("Invalid single-byte value for bool: %s: %x", msgBadDesc, d.bd) + } else if d.bd == simpleVdFalse { + } else { + d.d.errorf("cannot decode bool - %s: %x", msgBadDesc, d.bd) + return } d.bdRead = false return } -func (d *simpleDecDriver) readMapLen() (length int) { +func (d *simpleDecDriver) ReadMapStart() (length int) { + if !d.bdRead { + d.readNextBd() + } d.bdRead = false + d.c = containerMapStart return d.decLen() } -func (d *simpleDecDriver) readArrayLen() (length int) { +func (d *simpleDecDriver) ReadArrayStart() (length int) { + if !d.bdRead { + d.readNextBd() + } d.bdRead = false + d.c = containerArrayStart return d.decLen() } +func (d *simpleDecDriver) ReadArrayElem() { + d.c = containerArrayElem +} + +func (d *simpleDecDriver) ReadArrayEnd() { + d.c = containerArrayEnd +} + +func (d *simpleDecDriver) ReadMapElemKey() { + d.c = containerMapKey +} + +func (d *simpleDecDriver) ReadMapElemValue() { + d.c = containerMapValue +} + +func (d *simpleDecDriver) ReadMapEnd() { + d.c = containerMapEnd +} + func (d *simpleDecDriver) decLen() int { switch d.bd % 8 { case 0: @@ -305,116 +410,196 @@ func (d *simpleDecDriver) decLen() int { case 1: return int(d.r.readn1()) case 2: - return int(d.r.readUint16()) + return int(bigen.Uint16(d.r.readx(2))) case 3: - ui := uint64(d.r.readUint32()) - checkOverflow(ui, 0, intBitsize) + ui := uint64(bigen.Uint32(d.r.readx(4))) + if chkOvf.Uint(ui, intBitsize) { + d.d.errorf("overflow integer: %v", ui) + return 0 + } return int(ui) case 4: - ui := d.r.readUint64() - checkOverflow(ui, 0, intBitsize) + ui := bigen.Uint64(d.r.readx(8)) + if chkOvf.Uint(ui, intBitsize) { + d.d.errorf("overflow integer: %v", ui) + return 0 + } return int(ui) } - decErr("decLen: Cannot read length: bd%8 must be in range 0..4. Got: %d", d.bd%8) + d.d.errorf("cannot read length: bd%%8 must be in range 0..4. Got: %d", d.bd%8) return -1 } -func (d *simpleDecDriver) decodeString() (s string) { - s = string(d.r.readn(d.decLen())) - d.bdRead = false - return +func (d *simpleDecDriver) DecodeString() (s string) { + return string(d.DecodeBytes(d.d.b[:], true)) +} + +func (d *simpleDecDriver) DecodeStringAsBytes() (s []byte) { + return d.DecodeBytes(d.d.b[:], true) } -func (d *simpleDecDriver) decodeBytes(bs []byte) (bsOut []byte, changed bool) { - if clen := d.decLen(); clen > 0 { - // if no contents in stream, don't update the passed byteslice - if len(bs) != clen { - if len(bs) > clen { - bs = bs[:clen] - } else { - bs = make([]byte, clen) - } - bsOut = bs - changed = true +func (d *simpleDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) { + if !d.bdRead { + d.readNextBd() + } + if d.bd == simpleVdNil { + d.bdRead = false + return + } + // check if an "array" of uint8's (see ContainerType for how to infer if an array) + if d.bd >= simpleVdArray && d.bd <= simpleVdMap+4 { + if len(bs) == 0 && zerocopy { + bs = d.d.b[:] + } + bsOut, _ = fastpathTV.DecSliceUint8V(bs, true, d.d) + return + } + + clen := d.decLen() + d.bdRead = false + if zerocopy { + if d.br { + return d.r.readx(uint(clen)) + } else if len(bs) == 0 { + bs = d.d.b[:] } - d.r.readb(bs) + } + return decByteSlice(d.r, clen, d.d.h.MaxInitLen, bs) +} + +func (d *simpleDecDriver) DecodeTime() (t time.Time) { + if !d.bdRead { + d.readNextBd() + } + if d.bd == simpleVdNil { + d.bdRead = false + return + } + if d.bd != simpleVdTime { + d.d.errorf("invalid descriptor for time.Time - expect 0x%x, received 0x%x", simpleVdTime, d.bd) + return } d.bdRead = false + clen := int(d.r.readn1()) + b := d.r.readx(uint(clen)) + if err := (&t).UnmarshalBinary(b); err != nil { + d.d.errorv(err) + } + return +} + +func (d *simpleDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) (realxtag uint64) { + if xtag > 0xff { + d.d.errorf("ext: tag must be <= 0xff; got: %v", xtag) + return + } + realxtag1, xbs := d.decodeExtV(ext != nil, uint8(xtag)) + realxtag = uint64(realxtag1) + if ext == nil { + re := rv.(*RawExt) + re.Tag = realxtag + re.Data = detachZeroCopyBytes(d.br, re.Data, xbs) + } else { + ext.ReadExt(rv, xbs) + } return } -func (d *simpleDecDriver) decodeExt(verifyTag bool, tag byte) (xtag byte, xbs []byte) { +func (d *simpleDecDriver) decodeExtV(verifyTag bool, tag byte) (xtag byte, xbs []byte) { + if !d.bdRead { + d.readNextBd() + } switch d.bd { case simpleVdExt, simpleVdExt + 1, simpleVdExt + 2, simpleVdExt + 3, simpleVdExt + 4: l := d.decLen() xtag = d.r.readn1() if verifyTag && xtag != tag { - decErr("Wrong extension tag. Got %b. Expecting: %v", xtag, tag) + d.d.errorf("wrong extension tag. Got %b. Expecting: %v", xtag, tag) + return } - xbs = d.r.readn(l) - case simpleVdByteArray, simpleVdByteArray + 1, simpleVdByteArray + 2, simpleVdByteArray + 3, simpleVdByteArray + 4: - xbs, _ = d.decodeBytes(nil) + if d.br { + xbs = d.r.readx(uint(l)) + } else { + xbs = decByteSlice(d.r, l, d.d.h.MaxInitLen, d.d.b[:]) + } + case simpleVdByteArray, simpleVdByteArray + 1, + simpleVdByteArray + 2, simpleVdByteArray + 3, simpleVdByteArray + 4: + xbs = d.DecodeBytes(nil, true) default: - decErr("Invalid d.vd for extensions (Expecting extensions or byte array). Got: 0x%x", d.bd) + d.d.errorf("ext - %s - expecting extensions/bytearray, got: 0x%x", msgBadDesc, d.bd) + return } d.bdRead = false return } -func (d *simpleDecDriver) decodeNaked() (v interface{}, vt valueType, decodeFurther bool) { - d.initReadNext() +func (d *simpleDecDriver) DecodeNaked() { + if !d.bdRead { + d.readNextBd() + } + + n := d.d.naked() + var decodeFurther bool switch d.bd { case simpleVdNil: - vt = valueTypeNil + n.v = valueTypeNil case simpleVdFalse: - vt = valueTypeBool - v = false + n.v = valueTypeBool + n.b = false case simpleVdTrue: - vt = valueTypeBool - v = true + n.v = valueTypeBool + n.b = true case simpleVdPosInt, simpleVdPosInt + 1, simpleVdPosInt + 2, simpleVdPosInt + 3: - vt = valueTypeUint - ui, _, _ := d.decIntAny() - v = ui + if d.h.SignedInteger { + n.v = valueTypeInt + n.i = d.DecodeInt64() + } else { + n.v = valueTypeUint + n.u = d.DecodeUint64() + } case simpleVdNegInt, simpleVdNegInt + 1, simpleVdNegInt + 2, simpleVdNegInt + 3: - vt = valueTypeInt - _, i, _ := d.decIntAny() - v = i + n.v = valueTypeInt + n.i = d.DecodeInt64() case simpleVdFloat32: - vt = valueTypeFloat - v = d.decodeFloat(true) + n.v = valueTypeFloat + n.f = d.DecodeFloat64() case simpleVdFloat64: - vt = valueTypeFloat - v = d.decodeFloat(false) - case simpleVdString, simpleVdString + 1, simpleVdString + 2, simpleVdString + 3, simpleVdString + 4: - vt = valueTypeString - v = d.decodeString() - case simpleVdByteArray, simpleVdByteArray + 1, simpleVdByteArray + 2, simpleVdByteArray + 3, simpleVdByteArray + 4: - vt = valueTypeBytes - v, _ = d.decodeBytes(nil) + n.v = valueTypeFloat + n.f = d.DecodeFloat64() + case simpleVdTime: + n.v = valueTypeTime + n.t = d.DecodeTime() + case simpleVdString, simpleVdString + 1, + simpleVdString + 2, simpleVdString + 3, simpleVdString + 4: + n.v = valueTypeString + n.s = d.DecodeString() + case simpleVdByteArray, simpleVdByteArray + 1, + simpleVdByteArray + 2, simpleVdByteArray + 3, simpleVdByteArray + 4: + decNakedReadRawBytes(d, d.d, n, d.h.RawToString) case simpleVdExt, simpleVdExt + 1, simpleVdExt + 2, simpleVdExt + 3, simpleVdExt + 4: - vt = valueTypeExt + n.v = valueTypeExt l := d.decLen() - var re RawExt - re.Tag = d.r.readn1() - re.Data = d.r.readn(l) - v = &re - vt = valueTypeExt - case simpleVdArray, simpleVdArray + 1, simpleVdArray + 2, simpleVdArray + 3, simpleVdArray + 4: - vt = valueTypeArray + n.u = uint64(d.r.readn1()) + if d.br { + n.l = d.r.readx(uint(l)) + } else { + n.l = decByteSlice(d.r, l, d.d.h.MaxInitLen, d.d.b[:]) + } + case simpleVdArray, simpleVdArray + 1, simpleVdArray + 2, + simpleVdArray + 3, simpleVdArray + 4: + n.v = valueTypeArray decodeFurther = true case simpleVdMap, simpleVdMap + 1, simpleVdMap + 2, simpleVdMap + 3, simpleVdMap + 4: - vt = valueTypeMap + n.v = valueTypeMap decodeFurther = true default: - decErr("decodeNaked: Unrecognized d.vd: 0x%x", d.bd) + d.d.errorf("cannot infer value - %s 0x%x", msgBadDesc, d.bd) } if !decodeFurther { d.bdRead = false } - return } //------------------------------------ @@ -422,12 +607,12 @@ func (d *simpleDecDriver) decodeNaked() (v interface{}, vt valueType, decodeFurt // SimpleHandle is a Handle for a very simple encoding format. // // simple is a simplistic codec similar to binc, but not as compact. -// - Encoding of a value is always preceeded by the descriptor byte (bd) +// - Encoding of a value is always preceded by the descriptor byte (bd) // - True, false, nil are encoded fully in 1 byte (the descriptor) // - Integers (intXXX, uintXXX) are encoded in 1, 2, 4 or 8 bytes (plus a descriptor byte). // There are positive (uintXXX and intXXX >= 0) and negative (intXXX < 0) integers. // - Floats are encoded in 4 or 8 bytes (plus a descriptor byte) -// - Lenght of containers (strings, bytes, array, map, extensions) +// - Length of containers (strings, bytes, array, map, extensions) // are encoded in 0, 1, 2, 4 or 8 bytes. // Zero-length containers have no length encoded. // For others, the number of bytes is given by pow(2, bd%3) @@ -435,26 +620,46 @@ func (d *simpleDecDriver) decodeNaked() (v interface{}, vt valueType, decodeFurt // - arrays are encoded as [bd] [length] [value]... // - extensions are encoded as [bd] [length] [tag] [byte]... // - strings/bytearrays are encoded as [bd] [length] [byte]... +// - time.Time are encoded as [bd] [length] [byte]... // // The full spec will be published soon. type SimpleHandle struct { BasicHandle + binaryEncodingType + noElemSeparators + // EncZeroValuesAsNil says to encode zero values for numbers, bool, string, etc as nil + EncZeroValuesAsNil bool + + // _ [1]uint64 // padding } -func (h *SimpleHandle) newEncDriver(w encWriter) encDriver { - return &simpleEncDriver{w: w, h: h} +// Name returns the name of the handle: simple +func (h *SimpleHandle) Name() string { return "simple" } + +// SetBytesExt sets an extension +func (h *SimpleHandle) SetBytesExt(rt reflect.Type, tag uint64, ext BytesExt) (err error) { + return h.SetExt(rt, tag, &extWrapper{ext, interfaceExtFailer{}}) +} + +func (h *SimpleHandle) hasElemSeparators() bool { return true } // as it implements Write(Map|Array)XXX + +func (h *SimpleHandle) newEncDriver(e *Encoder) encDriver { + return &simpleEncDriver{e: e, w: e.w, h: h} } -func (h *SimpleHandle) newDecDriver(r decReader) decDriver { - return &simpleDecDriver{r: r, h: h} +func (h *SimpleHandle) newDecDriver(d *Decoder) decDriver { + return &simpleDecDriver{d: d, h: h, r: d.r, br: d.bytes} } -func (_ *SimpleHandle) writeExt() bool { - return true +func (e *simpleEncDriver) reset() { + e.c = 0 + e.w = e.e.w } -func (h *SimpleHandle) getBasicHandle() *BasicHandle { - return &h.BasicHandle +func (d *simpleDecDriver) reset() { + d.c = 0 + d.r, d.br = d.d.r, d.d.bytes + d.bd, d.bdRead = 0, false } var _ decDriver = (*simpleDecDriver)(nil) diff --git a/vendor/github.com/ugorji/go/codec/test-cbor-goldens.json b/vendor/github.com/ugorji/go/codec/test-cbor-goldens.json new file mode 100644 index 000000000..902858671 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/test-cbor-goldens.json @@ -0,0 +1,639 @@ +[ + { + "cbor": "AA==", + "hex": "00", + "roundtrip": true, + "decoded": 0 + }, + { + "cbor": "AQ==", + "hex": "01", + "roundtrip": true, + "decoded": 1 + }, + { + "cbor": "Cg==", + "hex": "0a", + "roundtrip": true, + "decoded": 10 + }, + { + "cbor": "Fw==", + "hex": "17", + "roundtrip": true, + "decoded": 23 + }, + { + "cbor": "GBg=", + "hex": "1818", + "roundtrip": true, + "decoded": 24 + }, + { + "cbor": "GBk=", + "hex": "1819", + "roundtrip": true, + "decoded": 25 + }, + { + "cbor": "GGQ=", + "hex": "1864", + "roundtrip": true, + "decoded": 100 + }, + { + "cbor": "GQPo", + "hex": "1903e8", + "roundtrip": true, + "decoded": 1000 + }, + { + "cbor": "GgAPQkA=", + "hex": "1a000f4240", + "roundtrip": true, + "decoded": 1000000 + }, + { + "cbor": "GwAAAOjUpRAA", + "hex": "1b000000e8d4a51000", + "roundtrip": true, + "decoded": 1000000000000 + }, + { + "cbor": "G///////////", + "hex": "1bffffffffffffffff", + "roundtrip": true, + "decoded": 18446744073709551615 + }, + { + "cbor": "wkkBAAAAAAAAAAA=", + "hex": "c249010000000000000000", + "roundtrip": true, + "decoded": 18446744073709551616 + }, + { + "cbor": "O///////////", + "hex": "3bffffffffffffffff", + "roundtrip": true, + "decoded": -18446744073709551616, + "skip": true + }, + { + "cbor": "w0kBAAAAAAAAAAA=", + "hex": "c349010000000000000000", + "roundtrip": true, + "decoded": -18446744073709551617 + }, + { + "cbor": "IA==", + "hex": "20", + "roundtrip": true, + "decoded": -1 + }, + { + "cbor": "KQ==", + "hex": "29", + "roundtrip": true, + "decoded": -10 + }, + { + "cbor": "OGM=", + "hex": "3863", + "roundtrip": true, + "decoded": -100 + }, + { + "cbor": "OQPn", + "hex": "3903e7", + "roundtrip": true, + "decoded": -1000 + }, + { + "cbor": "+QAA", + "hex": "f90000", + "roundtrip": true, + "decoded": 0.0 + }, + { + "cbor": "+YAA", + "hex": "f98000", + "roundtrip": true, + "decoded": -0.0 + }, + { + "cbor": "+TwA", + "hex": "f93c00", + "roundtrip": true, + "decoded": 1.0 + }, + { + "cbor": "+z/xmZmZmZma", + "hex": "fb3ff199999999999a", + "roundtrip": true, + "decoded": 1.1 + }, + { + "cbor": "+T4A", + "hex": "f93e00", + "roundtrip": true, + "decoded": 1.5 + }, + { + "cbor": "+Xv/", + "hex": "f97bff", + "roundtrip": true, + "decoded": 65504.0 + }, + { + "cbor": "+kfDUAA=", + "hex": "fa47c35000", + "roundtrip": true, + "decoded": 100000.0 + }, + { + "cbor": "+n9///8=", + "hex": "fa7f7fffff", + "roundtrip": true, + "decoded": 3.4028234663852886e+38 + }, + { + "cbor": "+3435DyIAHWc", + "hex": "fb7e37e43c8800759c", + "roundtrip": true, + "decoded": 1.0e+300 + }, + { + "cbor": "+QAB", + "hex": "f90001", + "roundtrip": true, + "decoded": 5.960464477539063e-08 + }, + { + "cbor": "+QQA", + "hex": "f90400", + "roundtrip": true, + "decoded": 6.103515625e-05 + }, + { + "cbor": "+cQA", + "hex": "f9c400", + "roundtrip": true, + "decoded": -4.0 + }, + { + "cbor": "+8AQZmZmZmZm", + "hex": "fbc010666666666666", + "roundtrip": true, + "decoded": -4.1 + }, + { + "cbor": "+XwA", + "hex": "f97c00", + "roundtrip": true, + "diagnostic": "Infinity" + }, + { + "cbor": "+X4A", + "hex": "f97e00", + "roundtrip": true, + "diagnostic": "NaN" + }, + { + "cbor": "+fwA", + "hex": "f9fc00", + "roundtrip": true, + "diagnostic": "-Infinity" + }, + { + "cbor": "+n+AAAA=", + "hex": "fa7f800000", + "roundtrip": false, + "diagnostic": "Infinity" + }, + { + "cbor": "+n/AAAA=", + "hex": "fa7fc00000", + "roundtrip": false, + "diagnostic": "NaN" + }, + { + "cbor": "+v+AAAA=", + "hex": "faff800000", + "roundtrip": false, + "diagnostic": "-Infinity" + }, + { + "cbor": "+3/wAAAAAAAA", + "hex": "fb7ff0000000000000", + "roundtrip": false, + "diagnostic": "Infinity" + }, + { + "cbor": "+3/4AAAAAAAA", + "hex": "fb7ff8000000000000", + "roundtrip": false, + "diagnostic": "NaN" + }, + { + "cbor": "+//wAAAAAAAA", + "hex": "fbfff0000000000000", + "roundtrip": false, + "diagnostic": "-Infinity" + }, + { + "cbor": "9A==", + "hex": "f4", + "roundtrip": true, + "decoded": false + }, + { + "cbor": "9Q==", + "hex": "f5", + "roundtrip": true, + "decoded": true + }, + { + "cbor": "9g==", + "hex": "f6", + "roundtrip": true, + "decoded": null + }, + { + "cbor": "9w==", + "hex": "f7", + "roundtrip": true, + "diagnostic": "undefined" + }, + { + "cbor": "8A==", + "hex": "f0", + "roundtrip": true, + "diagnostic": "simple(16)" + }, + { + "cbor": "+Bg=", + "hex": "f818", + "roundtrip": true, + "diagnostic": "simple(24)" + }, + { + "cbor": "+P8=", + "hex": "f8ff", + "roundtrip": true, + "diagnostic": "simple(255)" + }, + { + "cbor": "wHQyMDEzLTAzLTIxVDIwOjA0OjAwWg==", + "hex": "c074323031332d30332d32315432303a30343a30305a", + "roundtrip": true, + "diagnostic": "0(\"2013-03-21T20:04:00Z\")" + }, + { + "cbor": "wRpRS2ew", + "hex": "c11a514b67b0", + "roundtrip": true, + "diagnostic": "1(1363896240)" + }, + { + "cbor": "wftB1FLZ7CAAAA==", + "hex": "c1fb41d452d9ec200000", + "roundtrip": true, + "diagnostic": "1(1363896240.5)" + }, + { + "cbor": "10QBAgME", + "hex": "d74401020304", + "roundtrip": true, + "diagnostic": "23(h'01020304')" + }, + { + "cbor": "2BhFZElFVEY=", + "hex": "d818456449455446", + "roundtrip": true, + "diagnostic": "24(h'6449455446')" + }, + { + "cbor": "2CB2aHR0cDovL3d3dy5leGFtcGxlLmNvbQ==", + "hex": "d82076687474703a2f2f7777772e6578616d706c652e636f6d", + "roundtrip": true, + "diagnostic": "32(\"http://www.example.com\")" + }, + { + "cbor": "QA==", + "hex": "40", + "roundtrip": true, + "diagnostic": "h''" + }, + { + "cbor": "RAECAwQ=", + "hex": "4401020304", + "roundtrip": true, + "diagnostic": "h'01020304'" + }, + { + "cbor": "YA==", + "hex": "60", + "roundtrip": true, + "decoded": "" + }, + { + "cbor": "YWE=", + "hex": "6161", + "roundtrip": true, + "decoded": "a" + }, + { + "cbor": "ZElFVEY=", + "hex": "6449455446", + "roundtrip": true, + "decoded": "IETF" + }, + { + "cbor": "YiJc", + "hex": "62225c", + "roundtrip": true, + "decoded": "\"\\" + }, + { + "cbor": "YsO8", + "hex": "62c3bc", + "roundtrip": true, + "decoded": "ü" + }, + { + "cbor": "Y+awtA==", + "hex": "63e6b0b4", + "roundtrip": true, + "decoded": "水" + }, + { + "cbor": "ZPCQhZE=", + "hex": "64f0908591", + "roundtrip": true, + "decoded": "𐅑" + }, + { + "cbor": "gA==", + "hex": "80", + "roundtrip": true, + "decoded": [ + + ] + }, + { + "cbor": "gwECAw==", + "hex": "83010203", + "roundtrip": true, + "decoded": [ + 1, + 2, + 3 + ] + }, + { + "cbor": "gwGCAgOCBAU=", + "hex": "8301820203820405", + "roundtrip": true, + "decoded": [ + 1, + [ + 2, + 3 + ], + [ + 4, + 5 + ] + ] + }, + { + "cbor": "mBkBAgMEBQYHCAkKCwwNDg8QERITFBUWFxgYGBk=", + "hex": "98190102030405060708090a0b0c0d0e0f101112131415161718181819", + "roundtrip": true, + "decoded": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25 + ] + }, + { + "cbor": "oA==", + "hex": "a0", + "roundtrip": true, + "decoded": { + } + }, + { + "cbor": "ogECAwQ=", + "hex": "a201020304", + "roundtrip": true, + "skip": true, + "diagnostic": "{1: 2, 3: 4}" + }, + { + "cbor": "omFhAWFiggID", + "hex": "a26161016162820203", + "roundtrip": true, + "decoded": { + "a": 1, + "b": [ + 2, + 3 + ] + } + }, + { + "cbor": "gmFhoWFiYWM=", + "hex": "826161a161626163", + "roundtrip": true, + "decoded": [ + "a", + { + "b": "c" + } + ] + }, + { + "cbor": "pWFhYUFhYmFCYWNhQ2FkYURhZWFF", + "hex": "a56161614161626142616361436164614461656145", + "roundtrip": true, + "decoded": { + "a": "A", + "b": "B", + "c": "C", + "d": "D", + "e": "E" + } + }, + { + "cbor": "X0IBAkMDBAX/", + "hex": "5f42010243030405ff", + "roundtrip": false, + "skip": true, + "diagnostic": "(_ h'0102', h'030405')" + }, + { + "cbor": "f2VzdHJlYWRtaW5n/w==", + "hex": "7f657374726561646d696e67ff", + "roundtrip": false, + "decoded": "streaming" + }, + { + "cbor": "n/8=", + "hex": "9fff", + "roundtrip": false, + "decoded": [ + + ] + }, + { + "cbor": "nwGCAgOfBAX//w==", + "hex": "9f018202039f0405ffff", + "roundtrip": false, + "decoded": [ + 1, + [ + 2, + 3 + ], + [ + 4, + 5 + ] + ] + }, + { + "cbor": "nwGCAgOCBAX/", + "hex": "9f01820203820405ff", + "roundtrip": false, + "decoded": [ + 1, + [ + 2, + 3 + ], + [ + 4, + 5 + ] + ] + }, + { + "cbor": "gwGCAgOfBAX/", + "hex": "83018202039f0405ff", + "roundtrip": false, + "decoded": [ + 1, + [ + 2, + 3 + ], + [ + 4, + 5 + ] + ] + }, + { + "cbor": "gwGfAgP/ggQF", + "hex": "83019f0203ff820405", + "roundtrip": false, + "decoded": [ + 1, + [ + 2, + 3 + ], + [ + 4, + 5 + ] + ] + }, + { + "cbor": "nwECAwQFBgcICQoLDA0ODxAREhMUFRYXGBgYGf8=", + "hex": "9f0102030405060708090a0b0c0d0e0f101112131415161718181819ff", + "roundtrip": false, + "decoded": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25 + ] + }, + { + "cbor": "v2FhAWFinwID//8=", + "hex": "bf61610161629f0203ffff", + "roundtrip": false, + "decoded": { + "a": 1, + "b": [ + 2, + 3 + ] + } + }, + { + "cbor": "gmFhv2FiYWP/", + "hex": "826161bf61626163ff", + "roundtrip": false, + "decoded": [ + "a", + { + "b": "c" + } + ] + }, + { + "cbor": "v2NGdW71Y0FtdCH/", + "hex": "bf6346756ef563416d7421ff", + "roundtrip": false, + "decoded": { + "Fun": true, + "Amt": -2 + } + } +] diff --git a/vendor/github.com/ugorji/go/codec/msgpack_test.py b/vendor/github.com/ugorji/go/codec/test.py similarity index 69% rename from vendor/github.com/ugorji/go/codec/msgpack_test.py rename to vendor/github.com/ugorji/go/codec/test.py index e933838c5..800376f68 100755 --- a/vendor/github.com/ugorji/go/codec/msgpack_test.py +++ b/vendor/github.com/ugorji/go/codec/test.py @@ -4,7 +4,14 @@ # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). -import msgpack, msgpackrpc, sys, os, threading +# Ensure msgpack-python and cbor are installed first, using: +# sudo apt-get install python-dev +# sudo apt-get install python-pip +# pip install --user msgpack-python msgpack-rpc-python cbor + +# Ensure all "string" keys are utf strings (else encoded as bytes) + +import cbor, msgpack, msgpackrpc, sys, os, threading def get_test_data_list(): # get list with all primitive types, and a combo type @@ -21,43 +28,52 @@ def get_test_data_list(): -3232.0, -6464646464.0, 3232.0, + 6464.0, 6464646464.0, False, True, + u"null", None, - "someday", - "", - "bytestring", + u"some&day>some 0 @@ -80,14 +96,14 @@ def myStopRpcServer(): server.start() def doRpcClientToPythonSvc(port): - address = msgpackrpc.Address('localhost', port) + address = msgpackrpc.Address('127.0.0.1', port) client = msgpackrpc.Client(address, unpack_encoding='utf-8') print client.call("Echo123", "A1", "B2", "C3") print client.call("EchoStruct", {"A" :"Aa", "B":"Bb", "C":"Cc"}) def doRpcClientToGoSvc(port): # print ">>>> port: ", port, " <<<<<" - address = msgpackrpc.Address('localhost', port) + address = msgpackrpc.Address('127.0.0.1', port) client = msgpackrpc.Client(address, unpack_encoding='utf-8') print client.call("TestRpcInt.Echo123", ["A1", "B2", "C3"]) print client.call("TestRpcInt.EchoStruct", {"A" :"Aa", "B":"Bb", "C":"Cc"}) @@ -102,7 +118,7 @@ def doMain(args): elif len(args) == 2 and args[0] == "rpc-client-go-service": doRpcClientToGoSvc(int(args[1])) else: - print("Usage: msgpack_test.py " + + print("Usage: test.py " + "[testdata|rpc-server|rpc-client-python-service|rpc-client-go-service] ...") if __name__ == "__main__": diff --git a/vendor/github.com/ugorji/go/codec/time.go b/vendor/github.com/ugorji/go/codec/time.go deleted file mode 100644 index c86d65328..000000000 --- a/vendor/github.com/ugorji/go/codec/time.go +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) 2012, 2013 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. - -package codec - -import ( - "time" -) - -var ( - timeDigits = [...]byte{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} -) - -// EncodeTime encodes a time.Time as a []byte, including -// information on the instant in time and UTC offset. -// -// Format Description -// -// A timestamp is composed of 3 components: -// -// - secs: signed integer representing seconds since unix epoch -// - nsces: unsigned integer representing fractional seconds as a -// nanosecond offset within secs, in the range 0 <= nsecs < 1e9 -// - tz: signed integer representing timezone offset in minutes east of UTC, -// and a dst (daylight savings time) flag -// -// When encoding a timestamp, the first byte is the descriptor, which -// defines which components are encoded and how many bytes are used to -// encode secs and nsecs components. *If secs/nsecs is 0 or tz is UTC, it -// is not encoded in the byte array explicitly*. -// -// Descriptor 8 bits are of the form `A B C DDD EE`: -// A: Is secs component encoded? 1 = true -// B: Is nsecs component encoded? 1 = true -// C: Is tz component encoded? 1 = true -// DDD: Number of extra bytes for secs (range 0-7). -// If A = 1, secs encoded in DDD+1 bytes. -// If A = 0, secs is not encoded, and is assumed to be 0. -// If A = 1, then we need at least 1 byte to encode secs. -// DDD says the number of extra bytes beyond that 1. -// E.g. if DDD=0, then secs is represented in 1 byte. -// if DDD=2, then secs is represented in 3 bytes. -// EE: Number of extra bytes for nsecs (range 0-3). -// If B = 1, nsecs encoded in EE+1 bytes (similar to secs/DDD above) -// -// Following the descriptor bytes, subsequent bytes are: -// -// secs component encoded in `DDD + 1` bytes (if A == 1) -// nsecs component encoded in `EE + 1` bytes (if B == 1) -// tz component encoded in 2 bytes (if C == 1) -// -// secs and nsecs components are integers encoded in a BigEndian -// 2-complement encoding format. -// -// tz component is encoded as 2 bytes (16 bits). Most significant bit 15 to -// Least significant bit 0 are described below: -// -// Timezone offset has a range of -12:00 to +14:00 (ie -720 to +840 minutes). -// Bit 15 = have\_dst: set to 1 if we set the dst flag. -// Bit 14 = dst\_on: set to 1 if dst is in effect at the time, or 0 if not. -// Bits 13..0 = timezone offset in minutes. It is a signed integer in Big Endian format. -// -func encodeTime(t time.Time) []byte { - //t := rv.Interface().(time.Time) - tsecs, tnsecs := t.Unix(), t.Nanosecond() - var ( - bd byte - btmp [8]byte - bs [16]byte - i int = 1 - ) - l := t.Location() - if l == time.UTC { - l = nil - } - if tsecs != 0 { - bd = bd | 0x80 - bigen.PutUint64(btmp[:], uint64(tsecs)) - f := pruneSignExt(btmp[:], tsecs >= 0) - bd = bd | (byte(7-f) << 2) - copy(bs[i:], btmp[f:]) - i = i + (8 - f) - } - if tnsecs != 0 { - bd = bd | 0x40 - bigen.PutUint32(btmp[:4], uint32(tnsecs)) - f := pruneSignExt(btmp[:4], true) - bd = bd | byte(3-f) - copy(bs[i:], btmp[f:4]) - i = i + (4 - f) - } - if l != nil { - bd = bd | 0x20 - // Note that Go Libs do not give access to dst flag. - _, zoneOffset := t.Zone() - //zoneName, zoneOffset := t.Zone() - zoneOffset /= 60 - z := uint16(zoneOffset) - bigen.PutUint16(btmp[:2], z) - // clear dst flags - bs[i] = btmp[0] & 0x3f - bs[i+1] = btmp[1] - i = i + 2 - } - bs[0] = bd - return bs[0:i] -} - -// DecodeTime decodes a []byte into a time.Time. -func decodeTime(bs []byte) (tt time.Time, err error) { - bd := bs[0] - var ( - tsec int64 - tnsec uint32 - tz uint16 - i byte = 1 - i2 byte - n byte - ) - if bd&(1<<7) != 0 { - var btmp [8]byte - n = ((bd >> 2) & 0x7) + 1 - i2 = i + n - copy(btmp[8-n:], bs[i:i2]) - //if first bit of bs[i] is set, then fill btmp[0..8-n] with 0xff (ie sign extend it) - if bs[i]&(1<<7) != 0 { - copy(btmp[0:8-n], bsAll0xff) - //for j,k := byte(0), 8-n; j < k; j++ { btmp[j] = 0xff } - } - i = i2 - tsec = int64(bigen.Uint64(btmp[:])) - } - if bd&(1<<6) != 0 { - var btmp [4]byte - n = (bd & 0x3) + 1 - i2 = i + n - copy(btmp[4-n:], bs[i:i2]) - i = i2 - tnsec = bigen.Uint32(btmp[:]) - } - if bd&(1<<5) == 0 { - tt = time.Unix(tsec, int64(tnsec)).UTC() - return - } - // In stdlib time.Parse, when a date is parsed without a zone name, it uses "" as zone name. - // However, we need name here, so it can be shown when time is printed. - // Zone name is in form: UTC-08:00. - // Note that Go Libs do not give access to dst flag, so we ignore dst bits - - i2 = i + 2 - tz = bigen.Uint16(bs[i:i2]) - i = i2 - // sign extend sign bit into top 2 MSB (which were dst bits): - if tz&(1<<13) == 0 { // positive - tz = tz & 0x3fff //clear 2 MSBs: dst bits - } else { // negative - tz = tz | 0xc000 //set 2 MSBs: dst bits - //tzname[3] = '-' (TODO: verify. this works here) - } - tzint := int16(tz) - if tzint == 0 { - tt = time.Unix(tsec, int64(tnsec)).UTC() - } else { - // For Go Time, do not use a descriptive timezone. - // It's unnecessary, and makes it harder to do a reflect.DeepEqual. - // The Offset already tells what the offset should be, if not on UTC and unknown zone name. - // var zoneName = timeLocUTCName(tzint) - tt = time.Unix(tsec, int64(tnsec)).In(time.FixedZone("", int(tzint)*60)) - } - return -} - -func timeLocUTCName(tzint int16) string { - if tzint == 0 { - return "UTC" - } - var tzname = []byte("UTC+00:00") - //tzname := fmt.Sprintf("UTC%s%02d:%02d", tzsign, tz/60, tz%60) //perf issue using Sprintf. inline below. - //tzhr, tzmin := tz/60, tz%60 //faster if u convert to int first - var tzhr, tzmin int16 - if tzint < 0 { - tzname[3] = '-' // (TODO: verify. this works here) - tzhr, tzmin = -tzint/60, (-tzint)%60 - } else { - tzhr, tzmin = tzint/60, tzint%60 - } - tzname[4] = timeDigits[tzhr/10] - tzname[5] = timeDigits[tzhr%10] - tzname[7] = timeDigits[tzmin/10] - tzname[8] = timeDigits[tzmin%10] - return string(tzname) - //return time.FixedZone(string(tzname), int(tzint)*60) -} diff --git a/vendor/github.com/ugorji/go/codec/values_flex_test.go b/vendor/github.com/ugorji/go/codec/values_flex_test.go new file mode 100644 index 000000000..b048506ac --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/values_flex_test.go @@ -0,0 +1,243 @@ +// comment this out // // + build testing + +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +package codec + +import ( + "strings" + "time" +) + +const teststrucflexChanCap = 64 + +// This file contains values used by tests alone. +// This is where we may try out different things, +// that other engines may not support or may barf upon +// e.g. custom extensions for wrapped types, maps with non-string keys, etc. + +// Some unused types just stored here +type Bbool bool +type Aarray [1]string +type Sstring string +type Sstructsmall struct { + A int +} + +type Sstructbig struct { + A int + B bool + c string + // Sval Sstruct + Ssmallptr *Sstructsmall + Ssmall *Sstructsmall + Sptr *Sstructbig +} + +type SstructbigMapBySlice struct { + _struct struct{} `codec:",toarray"` + A int + B bool + c string + // Sval Sstruct + Ssmallptr *Sstructsmall + Ssmall *Sstructsmall + Sptr *Sstructbig +} + +// small struct for testing that codecgen works for unexported types +type tLowerFirstLetter struct { + I int + u uint64 + S string + b []byte +} + +// Some used types +type wrapInt64 int64 +type wrapUint8 uint8 +type wrapBytes []uint8 + +type AnonInTestStrucIntf struct { + Islice []interface{} + Ms map[string]interface{} + Nintf interface{} //don't set this, so we can test for nil + T time.Time + Tptr *time.Time +} + +type missingFielderT1 struct { + S string + B bool + f float64 + i int64 +} + +func (t *missingFielderT1) CodecMissingField(field []byte, value interface{}) bool { + // xdebugf(">> calling CodecMissingField with field: %s, value: %v", field, value) + switch string(field) { + case "F": + t.f = value.(float64) + case "I": + t.i = value.(int64) + default: + return false + } + return true +} + +func (t *missingFielderT1) CodecMissingFields() map[string]interface{} { + return map[string]interface{}{"F": t.f, "I": t.i} +} + +type missingFielderT2 struct { + S string + B bool + F float64 + I int64 +} + +var testWRepeated512 wrapBytes +var testStrucTime = time.Date(2012, 2, 2, 2, 2, 2, 2000, time.UTC).UTC() + +func init() { + var testARepeated512 [512]byte + for i := range testARepeated512 { + testARepeated512[i] = 'A' + } + testWRepeated512 = wrapBytes(testARepeated512[:]) +} + +type TestStrucFlex struct { + _struct struct{} `codec:",omitempty"` //set omitempty for every field + TestStrucCommon + + Chstr chan string + + Mis map[int]string + Mbu64 map[bool]struct{} + Miwu64s map[int]wrapUint64Slice + Mfwss map[float64]wrapStringSlice + Mf32wss map[float32]wrapStringSlice + Mui2wss map[uint64]wrapStringSlice + Msu2wss map[stringUint64T]wrapStringSlice + + Ci64 wrapInt64 + Swrapbytes []wrapBytes + Swrapuint8 []wrapUint8 + + ArrStrUi64T [4]stringUint64T + + Ui64array [4]uint64 + Ui64slicearray []*[4]uint64 + + SintfAarray []interface{} + + // make this a ptr, so that it could be set or not. + // for comparison (e.g. with msgp), give it a struct tag (so it is not inlined), + // make this one omitempty (so it is excluded if nil). + *AnonInTestStrucIntf `json:",omitempty"` + + //M map[interface{}]interface{} `json:"-",bson:"-"` + Mtsptr map[string]*TestStrucFlex + Mts map[string]TestStrucFlex + Its []*TestStrucFlex + Nteststruc *TestStrucFlex +} + +func emptyTestStrucFlex() *TestStrucFlex { + var ts TestStrucFlex + // we initialize and start draining the chan, so that we can decode into it without it blocking due to no consumer + ts.Chstr = make(chan string, teststrucflexChanCap) + go func() { + for range ts.Chstr { + } + }() // drain it + return &ts +} + +func newTestStrucFlex(depth, n int, bench, useInterface, useStringKeyOnly bool) (ts *TestStrucFlex) { + ts = &TestStrucFlex{ + Chstr: make(chan string, teststrucflexChanCap), + + Miwu64s: map[int]wrapUint64Slice{ + 5: []wrapUint64{1, 2, 3, 4, 5}, + 3: []wrapUint64{1, 2, 3}, + }, + + Mf32wss: map[float32]wrapStringSlice{ + 5.0: []wrapString{"1.0", "2.0", "3.0", "4.0", "5.0"}, + 3.0: []wrapString{"1.0", "2.0", "3.0"}, + }, + + Mui2wss: map[uint64]wrapStringSlice{ + 5: []wrapString{"1.0", "2.0", "3.0", "4.0", "5.0"}, + 3: []wrapString{"1.0", "2.0", "3.0"}, + }, + + Mfwss: map[float64]wrapStringSlice{ + 5.0: []wrapString{"1.0", "2.0", "3.0", "4.0", "5.0"}, + 3.0: []wrapString{"1.0", "2.0", "3.0"}, + }, + Mis: map[int]string{ + 1: "one", + 22: "twenty two", + -44: "minus forty four", + }, + Mbu64: map[bool]struct{}{false: {}, true: {}}, + + Ci64: -22, + Swrapbytes: []wrapBytes{ // lengths of 1, 2, 4, 8, 16, 32, 64, 128, 256, + testWRepeated512[:1], + testWRepeated512[:2], + testWRepeated512[:4], + testWRepeated512[:8], + testWRepeated512[:16], + testWRepeated512[:32], + testWRepeated512[:64], + testWRepeated512[:128], + testWRepeated512[:256], + testWRepeated512[:512], + }, + Swrapuint8: []wrapUint8{ + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', + }, + Ui64array: [4]uint64{4, 16, 64, 256}, + ArrStrUi64T: [4]stringUint64T{{"4", 4}, {"3", 3}, {"2", 2}, {"1", 1}}, + SintfAarray: []interface{}{Aarray{"s"}}, + } + + numChanSend := cap(ts.Chstr) / 4 // 8 + for i := 0; i < numChanSend; i++ { + ts.Chstr <- strings.Repeat("A", i+1) + } + + ts.Ui64slicearray = []*[4]uint64{&ts.Ui64array, &ts.Ui64array} + + if useInterface { + ts.AnonInTestStrucIntf = &AnonInTestStrucIntf{ + Islice: []interface{}{strRpt(n, "true"), true, strRpt(n, "no"), false, uint64(288), float64(0.4)}, + Ms: map[string]interface{}{ + strRpt(n, "true"): strRpt(n, "true"), + strRpt(n, "int64(9)"): false, + }, + T: testStrucTime, + } + } + + populateTestStrucCommon(&ts.TestStrucCommon, n, bench, useInterface, useStringKeyOnly) + if depth > 0 { + depth-- + if ts.Mtsptr == nil { + ts.Mtsptr = make(map[string]*TestStrucFlex) + } + if ts.Mts == nil { + ts.Mts = make(map[string]TestStrucFlex) + } + ts.Mtsptr["0"] = newTestStrucFlex(depth, n, bench, useInterface, useStringKeyOnly) + ts.Mts["0"] = *(ts.Mtsptr["0"]) + ts.Its = append(ts.Its, ts.Mtsptr["0"]) + } + return +} diff --git a/vendor/github.com/ugorji/go/codec/values_test.go b/vendor/github.com/ugorji/go/codec/values_test.go new file mode 100644 index 000000000..536e852cb --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/values_test.go @@ -0,0 +1,401 @@ +// comment this out // + build testing + +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +package codec + +// This file contains values used by tests and benchmarks. +// The benchmarks will test performance against other libraries +// (encoding/json, json-iterator, bson, gob, etc). +// Consequently, we only use values that will parse well in all engines, +// and only leverage features that work across multiple libraries for a truer comparison. +// For example, +// - JSON/BSON do not like maps with keys that are not strings, +// so we only use maps with string keys here. +// - _struct options are not honored by other libraries, +// so we don't use them in this file. + +import ( + "math" + "strings" +) + +// func init() { +// rt := reflect.TypeOf((*TestStruc)(nil)).Elem() +// defTypeInfos.get(rt2id(rt), rt) +// } + +type wrapSliceUint64 []uint64 +type wrapSliceString []string +type wrapUint64 uint64 +type wrapString string +type wrapUint64Slice []wrapUint64 +type wrapStringSlice []wrapString + +type stringUint64T struct { + S string + U uint64 +} + +type AnonInTestStruc struct { + AS string + AI64 int64 + AI16 int16 + AUi64 uint64 + ASslice []string + AI64slice []int64 + AUi64slice []uint64 + AF64slice []float64 + AF32slice []float32 + + // AMI32U32 map[int32]uint32 + // AMU32F64 map[uint32]float64 // json/bson do not like it + AMSU16 map[string]uint16 + + // use these to test 0-len or nil slices/maps/arrays + AI64arr0 [0]int64 + A164slice0 []int64 + AUi64sliceN []uint64 + AMSU16N map[string]uint16 + AMSU16E map[string]uint16 +} + +// testSimpleFields is a sub-set of TestStrucCommon +type testSimpleFields struct { + S string + + I64 int64 + I8 int8 + + Ui64 uint64 + Ui8 uint8 + + F64 float64 + F32 float32 + + B bool + + Sslice []string + I16slice []int16 + Ui64slice []uint64 + Ui8slice []uint8 + Bslice []bool + + Iptrslice []*int64 + + WrapSliceInt64 wrapSliceUint64 + WrapSliceString wrapSliceString + + Msi64 map[string]int64 +} + +type TestStrucCommon struct { + S string + + I64 int64 + I32 int32 + I16 int16 + I8 int8 + + I64n int64 + I32n int32 + I16n int16 + I8n int8 + + Ui64 uint64 + Ui32 uint32 + Ui16 uint16 + Ui8 uint8 + + F64 float64 + F32 float32 + + B bool + By uint8 // byte: msgp doesn't like byte + + Sslice []string + I64slice []int64 + I16slice []int16 + Ui64slice []uint64 + Ui8slice []uint8 + Bslice []bool + Byslice []byte + + Iptrslice []*int64 + + WrapSliceInt64 wrapSliceUint64 + WrapSliceString wrapSliceString + + Msi64 map[string]int64 + + Simplef testSimpleFields + + SstrUi64T []stringUint64T + + AnonInTestStruc + + NotAnon AnonInTestStruc + + // R Raw // Testing Raw must be explicitly turned on, so use standalone test + // Rext RawExt // Testing RawExt is tricky, so use standalone test + + Nmap map[string]bool //don't set this, so we can test for nil + Nslice []byte //don't set this, so we can test for nil + Nint64 *int64 //don't set this, so we can test for nil +} + +type TestStruc struct { + // _struct struct{} `json:",omitempty"` //set omitempty for every field + + TestStrucCommon + + Mtsptr map[string]*TestStruc + Mts map[string]TestStruc + Its []*TestStruc + Nteststruc *TestStruc +} + +func populateTestStrucCommon(ts *TestStrucCommon, n int, bench, useInterface, useStringKeyOnly bool) { + var i64a, i64b, i64c, i64d int64 = 64, 6464, 646464, 64646464 + + // if bench, do not use uint64 values > math.MaxInt64, as bson, etc cannot decode them + + var a = AnonInTestStruc{ + // There's more leeway in altering this. + AS: strRpt(n, "A-String"), + AI64: -64646464, + AI16: 1616, + AUi64: 64646464, + // (U+1D11E)G-clef character may be represented in json as "\uD834\uDD1E". + // single reverse solidus character may be represented in json as "\u005C". + // include these in ASslice below. + ASslice: []string{ + strRpt(n, "Aone"), + strRpt(n, "Atwo"), + strRpt(n, "Athree"), + strRpt(n, "Afour.reverse_solidus.\u005c"), + strRpt(n, "Afive.Gclef.\U0001d11E\"ugorji\"done.")}, + AI64slice: []int64{ + 0, 1, -1, -22, 333, -4444, 55555, -666666, + // msgpack ones + -48, -32, -24, -8, 32, 127, 192, 255, + // standard ones + 0, -1, 1, + math.MaxInt8, math.MaxInt8 + 4, math.MaxInt8 - 4, + math.MaxInt16, math.MaxInt16 + 4, math.MaxInt16 - 4, + math.MaxInt32, math.MaxInt32 + 4, math.MaxInt32 - 4, + math.MaxInt64, math.MaxInt64 - 4, + math.MinInt8, math.MinInt8 + 4, math.MinInt8 - 4, + math.MinInt16, math.MinInt16 + 4, math.MinInt16 - 4, + math.MinInt32, math.MinInt32 + 4, math.MinInt32 - 4, + math.MinInt64, math.MinInt64 + 4, + }, + AUi64slice: []uint64{ + 0, 1, 22, 333, 4444, 55555, 666666, + // standard ones + math.MaxUint8, math.MaxUint8 + 4, math.MaxUint8 - 4, + math.MaxUint16, math.MaxUint16 + 4, math.MaxUint16 - 4, + math.MaxUint32, math.MaxUint32 + 4, math.MaxUint32 - 4, + }, + AMSU16: map[string]uint16{strRpt(n, "1"): 1, strRpt(n, "22"): 2, strRpt(n, "333"): 3, strRpt(n, "4444"): 4}, + + // Note: +/- inf, NaN, and other non-representable numbers should not be explicitly tested here + + AF64slice: []float64{ + 11.11e-11, -11.11e+11, + 2.222E+12, -2.222E-12, + -555.55E-5, 555.55E+5, + 666.66E-6, -666.66E+6, + 7777.7777E-7, -7777.7777E-7, + -8888.8888E+8, 8888.8888E+8, + -99999.9999E+9, 99999.9999E+9, + // these below are hairy enough to need strconv.ParseFloat + 33.33E-33, -33.33E+33, + 44.44e+44, -44.44e-44, + // standard ones + 0, -1, 1, + // math.Inf(1), math.Inf(-1), + math.Pi, math.Phi, math.E, + math.MaxFloat64, math.SmallestNonzeroFloat64, + }, + AF32slice: []float32{ + 11.11e-11, -11.11e+11, + 2.222E+12, -2.222E-12, + -555.55E-5, 555.55E+5, + 666.66E-6, -666.66E+6, + 7777.7777E-7, -7777.7777E-7, + -8888.8888E+8, 8888.8888E+8, + -99999.9999E+9, 99999.9999E+9, + // these below are hairy enough to need strconv.ParseFloat + 33.33E-33, -33.33E+33, + // standard ones + 0, -1, 1, + // math.Float32frombits(0x7FF00000), math.Float32frombits(0xFFF00000), //+inf and -inf + math.MaxFloat32, math.SmallestNonzeroFloat32, + }, + + A164slice0: []int64{}, + AUi64sliceN: nil, + AMSU16N: nil, + AMSU16E: map[string]uint16{}, + } + + if !bench { + a.AUi64slice = append(a.AUi64slice, math.MaxUint64, math.MaxUint64-4) + } + *ts = TestStrucCommon{ + S: strRpt(n, `some really really cool names that are nigerian and american like "ugorji melody nwoke" - get it? `), + + // set the numbers close to the limits + I8: math.MaxInt8 * 2 / 3, // 8, + I8n: math.MinInt8 * 2 / 3, // 8, + I16: math.MaxInt16 * 2 / 3, // 16, + I16n: math.MinInt16 * 2 / 3, // 16, + I32: math.MaxInt32 * 2 / 3, // 32, + I32n: math.MinInt32 * 2 / 3, // 32, + I64: math.MaxInt64 * 2 / 3, // 64, + I64n: math.MinInt64 * 2 / 3, // 64, + + Ui64: math.MaxUint64 * 2 / 3, // 64 + Ui32: math.MaxUint32 * 2 / 3, // 32 + Ui16: math.MaxUint16 * 2 / 3, // 16 + Ui8: math.MaxUint8 * 2 / 3, // 8 + + F32: 3.402823e+38, // max representable float32 without losing precision + F64: 3.40281991833838838338e+53, + + B: true, + By: 5, + + Sslice: []string{strRpt(n, "one"), strRpt(n, "two"), strRpt(n, "three")}, + I64slice: []int64{1111, 2222, 3333}, + I16slice: []int16{44, 55, 66}, + Ui64slice: []uint64{12121212, 34343434, 56565656}, + Ui8slice: []uint8{210, 211, 212}, + Bslice: []bool{true, false, true, false}, + Byslice: []byte{13, 14, 15}, + + Msi64: map[string]int64{ + strRpt(n, "one"): 1, + strRpt(n, "two"): 2, + strRpt(n, "\"three\""): 3, + }, + + WrapSliceInt64: []uint64{4, 16, 64, 256}, + WrapSliceString: []string{strRpt(n, "4"), strRpt(n, "16"), strRpt(n, "64"), strRpt(n, "256")}, + + // R: Raw([]byte("goodbye")), + // Rext: RawExt{ 120, []byte("hello"), }, // TODO: don't set this - it's hard to test + + // DecodeNaked bombs here, because the stringUint64T is decoded as a map, + // and a map cannot be the key type of a map. + // Thus, don't initialize this here. + // Msu2wss: map[stringUint64T]wrapStringSlice{ + // {"5", 5}: []wrapString{"1", "2", "3", "4", "5"}, + // {"3", 3}: []wrapString{"1", "2", "3"}, + // }, + + // make Simplef same as top-level + // TODO: should this have slightly different values??? + Simplef: testSimpleFields{ + S: strRpt(n, `some really really cool names that are nigerian and american like "ugorji melody nwoke" - get it? `), + + // set the numbers close to the limits + I8: math.MaxInt8 * 2 / 3, // 8, + I64: math.MaxInt64 * 2 / 3, // 64, + + Ui64: math.MaxUint64 * 2 / 3, // 64 + Ui8: math.MaxUint8 * 2 / 3, // 8 + + F32: 3.402823e+38, // max representable float32 without losing precision + F64: 3.40281991833838838338e+53, + + B: true, + + Sslice: []string{strRpt(n, "one"), strRpt(n, "two"), strRpt(n, "three")}, + I16slice: []int16{44, 55, 66}, + Ui64slice: []uint64{12121212, 34343434, 56565656}, + Ui8slice: []uint8{210, 211, 212}, + Bslice: []bool{true, false, true, false}, + + Msi64: map[string]int64{ + strRpt(n, "one"): 1, + strRpt(n, "two"): 2, + strRpt(n, "\"three\""): 3, + }, + + WrapSliceInt64: []uint64{4, 16, 64, 256}, + WrapSliceString: []string{strRpt(n, "4"), strRpt(n, "16"), strRpt(n, "64"), strRpt(n, "256")}, + }, + + SstrUi64T: []stringUint64T{{"1", 1}, {"2", 2}, {"3", 3}, {"4", 4}}, + AnonInTestStruc: a, + NotAnon: a, + } + + if bench { + ts.Ui64 = math.MaxInt64 * 2 / 3 + ts.Simplef.Ui64 = ts.Ui64 + } + + //For benchmarks, some things will not work. + if !bench { + //json and bson require string keys in maps + //ts.M = map[interface{}]interface{}{ + // true: "true", + // int8(9): false, + //} + //gob cannot encode nil in element in array (encodeArray: nil element) + ts.Iptrslice = []*int64{nil, &i64a, nil, &i64b, nil, &i64c, nil, &i64d, nil} + // ts.Iptrslice = nil + } + if !useStringKeyOnly { + var _ byte = 0 // so this empty branch doesn't flag a warning + // ts.AnonInTestStruc.AMU32F64 = map[uint32]float64{1: 1, 2: 2, 3: 3} // Json/Bson barf + } +} + +func newTestStruc(depth, n int, bench, useInterface, useStringKeyOnly bool) (ts *TestStruc) { + ts = &TestStruc{} + populateTestStrucCommon(&ts.TestStrucCommon, n, bench, useInterface, useStringKeyOnly) + if depth > 0 { + depth-- + if ts.Mtsptr == nil { + ts.Mtsptr = make(map[string]*TestStruc) + } + if ts.Mts == nil { + ts.Mts = make(map[string]TestStruc) + } + ts.Mtsptr[strRpt(n, "0")] = newTestStruc(depth, n, bench, useInterface, useStringKeyOnly) + ts.Mts[strRpt(n, "0")] = *(ts.Mtsptr[strRpt(n, "0")]) + ts.Its = append(ts.Its, ts.Mtsptr[strRpt(n, "0")]) + } + return +} + +var testStrRptMap = make(map[int]map[string]string) + +func strRpt(n int, s string) string { + if false { + // fmt.Printf(">>>> calling strings.Repeat on n: %d, key: %s\n", n, s) + return strings.Repeat(s, n) + } + m1, ok := testStrRptMap[n] + if !ok { + // fmt.Printf(">>>> making new map for n: %v\n", n) + m1 = make(map[string]string) + testStrRptMap[n] = m1 + } + v1, ok := m1[s] + if !ok { + // fmt.Printf(">>>> creating new entry for key: %s\n", s) + v1 = strings.Repeat(s, n) + m1[s] = v1 + } + return v1 +} + +// func wstrRpt(n int, s string) wrapBytes { +// return wrapBytes(bytes.Repeat([]byte(s), n)) +// } diff --git a/vendor/github.com/ugorji/go/codec/xml.go b/vendor/github.com/ugorji/go/codec/xml.go new file mode 100644 index 000000000..19fc36caf --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/xml.go @@ -0,0 +1,508 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +// +build ignore + +package codec + +import "reflect" + +/* + +A strict Non-validating namespace-aware XML 1.0 parser and (en|de)coder. + +We are attempting this due to perceived issues with encoding/xml: + - Complicated. It tried to do too much, and is not as simple to use as json. + - Due to over-engineering, reflection is over-used AND performance suffers: + java is 6X faster:http://fabsk.eu/blog/category/informatique/dev/golang/ + even PYTHON performs better: http://outgoing.typepad.com/outgoing/2014/07/exploring-golang.html + +codec framework will offer the following benefits + - VASTLY improved performance (when using reflection-mode or codecgen) + - simplicity and consistency: with the rest of the supported formats + - all other benefits of codec framework (streaming, codegeneration, etc) + +codec is not a drop-in replacement for encoding/xml. +It is a replacement, based on the simplicity and performance of codec. +Look at it like JAXB for Go. + +Challenges: + - Need to output XML preamble, with all namespaces at the right location in the output. + - Each "end" block is dynamic, so we need to maintain a context-aware stack + - How to decide when to use an attribute VS an element + - How to handle chardata, attr, comment EXPLICITLY. + - Should it output fragments? + e.g. encoding a bool should just output true OR false, which is not well-formed XML. + +Extend the struct tag. See representative example: + type X struct { + ID uint8 `codec:"http://ugorji.net/x-namespace xid id,omitempty,toarray,attr,cdata"` + // format: [namespace-uri ][namespace-prefix ]local-name, ... + } + +Based on this, we encode + - fields as elements, BUT + encode as attributes if struct tag contains ",attr" and is a scalar (bool, number or string) + - text as entity-escaped text, BUT encode as CDATA if struct tag contains ",cdata". + +To handle namespaces: + - XMLHandle is denoted as being namespace-aware. + Consequently, we WILL use the ns:name pair to encode and decode if defined, else use the plain name. + - *Encoder and *Decoder know whether the Handle "prefers" namespaces. + - add *Encoder.getEncName(*structFieldInfo). + No one calls *structFieldInfo.indexForEncName directly anymore + - OR better yet: indexForEncName is namespace-aware, and helper.go is all namespace-aware + indexForEncName takes a parameter of the form namespace:local-name OR local-name + - add *Decoder.getStructFieldInfo(encName string) // encName here is either like abc, or h1:nsabc + by being a method on *Decoder, or maybe a method on the Handle itself. + No one accesses .encName anymore + - let encode.go and decode.go use these (for consistency) + - only problem exists for gen.go, where we create a big switch on encName. + Now, we also have to add a switch on strings.endsWith(kName, encNsName) + - gen.go will need to have many more methods, and then double-on the 2 switch loops like: + switch k { + case "abc" : x.abc() + case "def" : x.def() + default { + switch { + case !nsAware: panic(...) + case strings.endsWith(":abc"): x.abc() + case strings.endsWith(":def"): x.def() + default: panic(...) + } + } + } + +The structure below accommodates this: + + type typeInfo struct { + sfi []*structFieldInfo // sorted by encName + sfins // sorted by namespace + sfia // sorted, to have those with attributes at the top. Needed to write XML appropriately. + sfip // unsorted + } + type structFieldInfo struct { + encName + nsEncName + ns string + attr bool + cdata bool + } + +indexForEncName is now an internal helper function that takes a sorted array +(one of ti.sfins or ti.sfi). It is only used by *Encoder.getStructFieldInfo(...) + +There will be a separate parser from the builder. +The parser will have a method: next() xmlToken method. It has lookahead support, +so you can pop multiple tokens, make a determination, and push them back in the order popped. +This will be needed to determine whether we are "nakedly" decoding a container or not. +The stack will be implemented using a slice and push/pop happens at the [0] element. + +xmlToken has fields: + - type uint8: 0 | ElementStart | ElementEnd | AttrKey | AttrVal | Text + - value string + - ns string + +SEE: http://www.xml.com/pub/a/98/10/guide0.html?page=3#ENTDECL + +The following are skipped when parsing: + - External Entities (from external file) + - Notation Declaration e.g. + - Entity Declarations & References + - XML Declaration (assume UTF-8) + - XML Directive i.e. + - Other Declarations: Notation, etc. + - Comment + - Processing Instruction + - schema / DTD for validation: + We are not a VALIDATING parser. Validation is done elsewhere. + However, some parts of the DTD internal subset are used (SEE BELOW). + For Attribute List Declarations e.g. + + We considered using the ATTLIST to get "default" value, but not to validate the contents. (VETOED) + +The following XML features are supported + - Namespace + - Element + - Attribute + - cdata + - Unicode escape + +The following DTD (when as an internal sub-set) features are supported: + - Internal Entities e.g. + AND entities for the set: [<>&"'] + - Parameter entities e.g. + + +At decode time, a structure containing the following is kept + - namespace mapping + - default attribute values + - all internal entities (<>&"' and others written in the document) + +When decode starts, it parses XML namespace declarations and creates a map in the +xmlDecDriver. While parsing, that map continuously gets updated. +The only problem happens when a namespace declaration happens on the node that it defines. +e.g. +To handle this, each Element must be fully parsed at a time, +even if it amounts to multiple tokens which are returned one at a time on request. + +xmlns is a special attribute name. + - It is used to define namespaces, including the default + - It is never returned as an AttrKey or AttrVal. + *We may decide later to allow user to use it e.g. you want to parse the xmlns mappings into a field.* + +Number, bool, null, mapKey, etc can all be decoded from any xmlToken. +This accommodates map[int]string for example. + +It should be possible to create a schema from the types, +or vice versa (generate types from schema with appropriate tags). +This is however out-of-scope from this parsing project. + +We should write all namespace information at the first point that it is referenced in the tree, +and use the mapping for all child nodes and attributes. This means that state is maintained +at a point in the tree. This also means that calls to Decode or MustDecode will reset some state. + +When decoding, it is important to keep track of entity references and default attribute values. +It seems these can only be stored in the DTD components. We should honor them when decoding. + +Configuration for XMLHandle will look like this: + + XMLHandle + DefaultNS string + // Encoding: + NS map[string]string // ns URI to key, used for encoding + // Decoding: in case ENTITY declared in external schema or dtd, store info needed here + Entities map[string]string // map of entity rep to character + + +During encode, if a namespace mapping is not defined for a namespace found on a struct, +then we create a mapping for it using nsN (where N is 1..1000000, and doesn't conflict +with any other namespace mapping). + +Note that different fields in a struct can have different namespaces. +However, all fields will default to the namespace on the _struct field (if defined). + +An XML document is a name, a map of attributes and a list of children. +Consequently, we cannot "DecodeNaked" into a map[string]interface{} (for example). +We have to "DecodeNaked" into something that resembles XML data. + +To support DecodeNaked (decode into nil interface{}), we have to define some "supporting" types: + type Name struct { // Preferred. Less allocations due to conversions. + Local string + Space string + } + type Element struct { + Name Name + Attrs map[Name]string + Children []interface{} // each child is either *Element or string + } +Only two "supporting" types are exposed for XML: Name and Element. + +// ------------------ + +We considered 'type Name string' where Name is like "Space Local" (space-separated). +We decided against it, because each creation of a name would lead to +double allocation (first convert []byte to string, then concatenate them into a string). +The benefit is that it is faster to read Attrs from a map. But given that Element is a value +object, we want to eschew methods and have public exposed variables. + +We also considered the following, where xml types were not value objects, and we used +intelligent accessor methods to extract information and for performance. +*** WE DECIDED AGAINST THIS. *** + type Attr struct { + Name Name + Value string + } + // Element is a ValueObject: There are no accessor methods. + // Make element self-contained. + type Element struct { + Name Name + attrsMap map[string]string // where key is "Space Local" + attrs []Attr + childrenT []string + childrenE []Element + childrenI []int // each child is a index into T or E. + } + func (x *Element) child(i) interface{} // returns string or *Element + +// ------------------ + +Per XML spec and our default handling, white space is always treated as +insignificant between elements, except in a text node. The xml:space='preserve' +attribute is ignored. + +**Note: there is no xml: namespace. The xml: attributes were defined before namespaces.** +**So treat them as just "directives" that should be interpreted to mean something**. + +On encoding, we support indenting aka prettifying markup in the same way we support it for json. + +A document or element can only be encoded/decoded from/to a struct. In this mode: + - struct name maps to element name (or tag-info from _struct field) + - fields are mapped to child elements or attributes + +A map is either encoded as attributes on current element, or as a set of child elements. +Maps are encoded as attributes iff their keys and values are primitives (number, bool, string). + +A list is encoded as a set of child elements. + +Primitives (number, bool, string) are encoded as an element, attribute or text +depending on the context. + +Extensions must encode themselves as a text string. + +Encoding is tough, specifically when encoding mappings, because we need to encode +as either attribute or element. To do this, we need to default to encoding as attributes, +and then let Encoder inform the Handle when to start encoding as nodes. +i.e. Encoder does something like: + + h.EncodeMapStart() + h.Encode(), h.Encode(), ... + h.EncodeMapNotAttrSignal() // this is not a bool, because it's a signal + h.Encode(), h.Encode(), ... + h.EncodeEnd() + +Only XMLHandle understands this, and will set itself to start encoding as elements. + +This support extends to maps. For example, if a struct field is a map, and it has +the struct tag signifying it should be attr, then all its fields are encoded as attributes. +e.g. + + type X struct { + M map[string]int `codec:"m,attr"` // encode keys as attributes named + } + +Question: + - if encoding a map, what if map keys have spaces in them??? + Then they cannot be attributes or child elements. Error. + +Options to consider adding later: + - For attribute values, normalize by trimming beginning and ending white space, + and converting every white space sequence to a single space. + - ATTLIST restrictions are enforced. + e.g. default value of xml:space, skipping xml:XYZ style attributes, etc. + - Consider supporting NON-STRICT mode (e.g. to handle HTML parsing). + Some elements e.g. br, hr, etc need not close and should be auto-closed + ... (see http://www.w3.org/TR/html4/loose.dtd) + An expansive set of entities are pre-defined. + - Have easy way to create a HTML parser: + add a HTML() method to XMLHandle, that will set Strict=false, specify AutoClose, + and add HTML Entities to the list. + - Support validating element/attribute XMLName before writing it. + Keep this behind a flag, which is set to false by default (for performance). + type XMLHandle struct { + CheckName bool + } + +Misc: + +ROADMAP (1 weeks): + - build encoder (1 day) + - build decoder (based off xmlParser) (1 day) + - implement xmlParser (2 days). + Look at encoding/xml for inspiration. + - integrate and TEST (1 days) + - write article and post it (1 day) + +// ---------- MORE NOTES FROM 2017-11-30 ------------ + +when parsing +- parse the attributes first +- then parse the nodes + +basically: +- if encoding a field: we use the field name for the wrapper +- if encoding a non-field, then just use the element type name + + map[string]string ==> abcval... or + val... OR + val1val2... <- PREFERED + []string ==> v1v2... + string v1 ==> v1 + bool true ==> true + float 1.0 ==> 1.0 + ... + + F1 map[string]string ==> abcval... OR + val... OR + val... <- PREFERED + F2 []string ==> v1v2... + F3 bool ==> true + ... + +- a scalar is encoded as: + (value) of type T ==> + (value) of field F ==> +- A kv-pair is encoded as: + (key,value) ==> OR + (key,value) of field F ==> OR +- A map or struct is just a list of kv-pairs +- A list is encoded as sequences of same node e.g. + + + value21 + value22 +- we may have to singularize the field name, when entering into xml, + and pluralize them when encoding. +- bi-directional encode->decode->encode is not a MUST. + even encoding/xml cannot decode correctly what was encoded: + + see https://play.golang.org/p/224V_nyhMS + func main() { + fmt.Println("Hello, playground") + v := []interface{}{"hello", 1, true, nil, time.Now()} + s, err := xml.Marshal(v) + fmt.Printf("err: %v, \ns: %s\n", err, s) + var v2 []interface{} + err = xml.Unmarshal(s, &v2) + fmt.Printf("err: %v, \nv2: %v\n", err, v2) + type T struct { + V []interface{} + } + v3 := T{V: v} + s, err = xml.Marshal(v3) + fmt.Printf("err: %v, \ns: %s\n", err, s) + var v4 T + err = xml.Unmarshal(s, &v4) + fmt.Printf("err: %v, \nv4: %v\n", err, v4) + } + Output: + err: , + s: hello1true + err: , + v2: [] + err: , + s: hello1true2009-11-10T23:00:00Z + err: , + v4: {[ ]} +- +*/ + +// ----------- PARSER ------------------- + +type xmlTokenType uint8 + +const ( + _ xmlTokenType = iota << 1 + xmlTokenElemStart + xmlTokenElemEnd + xmlTokenAttrKey + xmlTokenAttrVal + xmlTokenText +) + +type xmlToken struct { + Type xmlTokenType + Value string + Namespace string // blank for AttrVal and Text +} + +type xmlParser struct { + r decReader + toks []xmlToken // list of tokens. + ptr int // ptr into the toks slice + done bool // nothing else to parse. r now returns EOF. +} + +func (x *xmlParser) next() (t *xmlToken) { + // once x.done, or x.ptr == len(x.toks) == 0, then return nil (to signify finish) + if !x.done && len(x.toks) == 0 { + x.nextTag() + } + // parses one element at a time (into possible many tokens) + if x.ptr < len(x.toks) { + t = &(x.toks[x.ptr]) + x.ptr++ + if x.ptr == len(x.toks) { + x.ptr = 0 + x.toks = x.toks[:0] + } + } + return +} + +// nextTag will parses the next element and fill up toks. +// It set done flag if/once EOF is reached. +func (x *xmlParser) nextTag() { + // TODO: implement. +} + +// ----------- ENCODER ------------------- + +type xmlEncDriver struct { + e *Encoder + w encWriter + h *XMLHandle + b [64]byte // scratch + bs []byte // scratch + // s jsonStack + noBuiltInTypes +} + +// ----------- DECODER ------------------- + +type xmlDecDriver struct { + d *Decoder + h *XMLHandle + 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 + + // wsSkipped bool // whitespace skipped + + // s jsonStack + + noBuiltInTypes +} + +// DecodeNaked will decode into an XMLNode + +// XMLName is a value object representing a namespace-aware NAME +type XMLName struct { + Local string + Space string +} + +// XMLNode represents a "union" of the different types of XML Nodes. +// Only one of fields (Text or *Element) is set. +type XMLNode struct { + Element *Element + Text string +} + +// XMLElement is a value object representing an fully-parsed XML element. +type XMLElement struct { + Name Name + Attrs map[XMLName]string + // Children is a list of child nodes, each being a *XMLElement or string + Children []XMLNode +} + +// ----------- HANDLE ------------------- + +type XMLHandle struct { + BasicHandle + textEncodingType + + DefaultNS string + NS map[string]string // ns URI to key, for encoding + Entities map[string]string // entity representation to string, for encoding. +} + +func (h *XMLHandle) newEncDriver(e *Encoder) encDriver { + return &xmlEncDriver{e: e, w: e.w, h: h} +} + +func (h *XMLHandle) newDecDriver(d *Decoder) decDriver { + // d := xmlDecDriver{r: r.(*bytesDecReader), h: h} + hd := xmlDecDriver{d: d, r: d.r, h: h} + hd.n.bytes = d.b[:] + return &hd +} + +func (h *XMLHandle) SetInterfaceExt(rt reflect.Type, tag uint64, ext InterfaceExt) (err error) { + return h.SetExt(rt, tag, &extWrapper{bytesExtFailer{}, ext}) +} + +var _ decDriver = (*xmlDecDriver)(nil) +var _ encDriver = (*xmlEncDriver)(nil) diff --git a/vendor/github.com/ugorji/go/codec/z_all_test.go b/vendor/github.com/ugorji/go/codec/z_all_test.go new file mode 100644 index 000000000..cb8445c99 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/z_all_test.go @@ -0,0 +1,410 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +// +build alltests +// +build go1.7 + +package codec + +// Run this using: +// go test -tags=alltests -run=Suite -coverprofile=cov.out +// go tool cover -html=cov.out +// +// Because build tags are a build time parameter, we will have to test out the +// different tags separately. +// Tags: x codecgen safe appengine notfastpath +// +// These tags should be added to alltests, e.g. +// go test '-tags=alltests x codecgen' -run=Suite -coverprofile=cov.out +// +// To run all tests before submitting code, run: +// a=( "" "safe" "codecgen" "notfastpath" "codecgen notfastpath" "codecgen safe" "safe notfastpath" ) +// for i in "${a[@]}"; do echo ">>>> TAGS: $i"; go test "-tags=alltests $i" -run=Suite; done +// +// This only works on go1.7 and above. This is when subtests and suites were supported. + +import "testing" + +// func TestMain(m *testing.M) { +// println("calling TestMain") +// // set some parameters +// exitcode := m.Run() +// os.Exit(exitcode) +// } + +func testGroupResetFlags() { + testUseMust = false + testCanonical = false + testUseMust = false + testInternStr = false + testUseIoEncDec = -1 + testStructToArray = false + testCheckCircRef = false + testUseReset = false + testMaxInitLen = 0 + testUseIoWrapper = false + testNumRepeatString = 8 + testEncodeOptions.RecursiveEmptyCheck = false + testDecodeOptions.MapValueReset = false + testUseIoEncDec = -1 + testDepth = 0 +} + +func testSuite(t *testing.T, f func(t *testing.T)) { + // find . -name "*_test.go" | xargs grep -e 'flag.' | cut -d '&' -f 2 | cut -d ',' -f 1 | grep -e '^test' + // Disregard the following: testInitDebug, testSkipIntf, testJsonIndent (Need a test for it) + + testReinit() // so flag.Parse() is called first, and never called again + + testDecodeOptions = DecodeOptions{} + testEncodeOptions = EncodeOptions{} + + testGroupResetFlags() + + testReinit() + t.Run("optionsFalse", f) + + testCanonical = true + testUseMust = true + testInternStr = true + testUseIoEncDec = 0 + // xdebugf("setting StructToArray=true") + testStructToArray = true + testCheckCircRef = true + testUseReset = true + testDecodeOptions.MapValueReset = true + testEncodeOptions.RecursiveEmptyCheck = true + testReinit() + t.Run("optionsTrue", f) + + // xdebugf("setting StructToArray=false") + testStructToArray = false + testDepth = 6 + testReinit() + t.Run("optionsTrue-deepstruct", f) + testDepth = 0 + + // testEncodeOptions.AsSymbols = AsSymbolAll + testUseIoWrapper = true + testReinit() + t.Run("optionsTrue-ioWrapper", f) + + testUseIoEncDec = -1 + + // make buffer small enough so that we have to re-fill multiple times. + testSkipRPCTests = true + testUseIoEncDec = 128 + // testDecodeOptions.ReaderBufferSize = 128 + // testEncodeOptions.WriterBufferSize = 128 + testReinit() + t.Run("optionsTrue-bufio", f) + // testDecodeOptions.ReaderBufferSize = 0 + // testEncodeOptions.WriterBufferSize = 0 + testUseIoEncDec = -1 + testSkipRPCTests = false + + testNumRepeatString = 32 + testReinit() + t.Run("optionsTrue-largestrings", f) + + // The following here MUST be tested individually, as they create + // side effects i.e. the decoded value is different. + // testDecodeOptions.MapValueReset = true // ok - no side effects + // testDecodeOptions.InterfaceReset = true // error??? because we do deepEquals to verify + // testDecodeOptions.ErrorIfNoField = true // error, as expected, as fields not there + // testDecodeOptions.ErrorIfNoArrayExpand = true // no error, but no error case either + // testDecodeOptions.PreferArrayOverSlice = true // error??? because slice != array. + // .... however, update deepEqual to take this option + // testReinit() + // t.Run("optionsTrue-resetOptions", f) + + testGroupResetFlags() +} + +/* +find . -name "codec_test.go" | xargs grep -e '^func Test' | \ + cut -d '(' -f 1 | cut -d ' ' -f 2 | \ + while read f; do echo "t.Run(\"$f\", $f)"; done +*/ + +func testCodecGroup(t *testing.T) { + // println("running testcodecsuite") + // + + testJsonGroup(t) + testBincGroup(t) + testCborGroup(t) + testMsgpackGroup(t) + testSimpleGroup(t) + // testSimpleMammothGroup(t) + // testRpcGroup(t) + testNonHandlesGroup(t) + + // +} + +func testJsonGroup(t *testing.T) { + t.Run("TestJsonCodecsTable", TestJsonCodecsTable) + t.Run("TestJsonCodecsMisc", TestJsonCodecsMisc) + t.Run("TestJsonCodecsEmbeddedPointer", TestJsonCodecsEmbeddedPointer) + t.Run("TestJsonCodecChan", TestJsonCodecChan) + t.Run("TestJsonStdEncIntf", TestJsonStdEncIntf) + t.Run("TestJsonMammoth", TestJsonMammoth) + t.Run("TestJsonRaw", TestJsonRaw) + t.Run("TestJsonRpcGo", TestJsonRpcGo) + t.Run("TestJsonLargeInteger", TestJsonLargeInteger) + t.Run("TestJsonDecodeNonStringScalarInStringContext", TestJsonDecodeNonStringScalarInStringContext) + t.Run("TestJsonEncodeIndent", TestJsonEncodeIndent) + + t.Run("TestJsonSwallowAndZero", TestJsonSwallowAndZero) + t.Run("TestJsonRawExt", TestJsonRawExt) + t.Run("TestJsonMapStructKey", TestJsonMapStructKey) + t.Run("TestJsonDecodeNilMapValue", TestJsonDecodeNilMapValue) + t.Run("TestJsonEmbeddedFieldPrecedence", TestJsonEmbeddedFieldPrecedence) + t.Run("TestJsonLargeContainerLen", TestJsonLargeContainerLen) + t.Run("TestJsonMammothMapsAndSlices", TestJsonMammothMapsAndSlices) + t.Run("TestJsonTime", TestJsonTime) + t.Run("TestJsonUintToInt", TestJsonUintToInt) + t.Run("TestJsonDifferentMapOrSliceType", TestJsonDifferentMapOrSliceType) + t.Run("TestJsonScalars", TestJsonScalars) + t.Run("TestJsonOmitempty", TestJsonOmitempty) + t.Run("TestJsonIntfMapping", TestJsonIntfMapping) + t.Run("TestJsonMissingFields", TestJsonMissingFields) + t.Run("TestJsonMaxDepth", TestJsonMaxDepth) + + t.Run("TestJsonInvalidUnicode", TestJsonInvalidUnicode) +} + +func testBincGroup(t *testing.T) { + t.Run("TestBincCodecsTable", TestBincCodecsTable) + t.Run("TestBincCodecsMisc", TestBincCodecsMisc) + t.Run("TestBincCodecsEmbeddedPointer", TestBincCodecsEmbeddedPointer) + t.Run("TestBincStdEncIntf", TestBincStdEncIntf) + t.Run("TestBincMammoth", TestBincMammoth) + t.Run("TestBincRaw", TestBincRaw) + t.Run("TestBincRpcGo", TestBincRpcGo) + t.Run("TestBincUnderlyingType", TestBincUnderlyingType) + + t.Run("TestBincSwallowAndZero", TestBincSwallowAndZero) + t.Run("TestBincRawExt", TestBincRawExt) + t.Run("TestBincMapStructKey", TestBincMapStructKey) + t.Run("TestBincDecodeNilMapValue", TestBincDecodeNilMapValue) + t.Run("TestBincEmbeddedFieldPrecedence", TestBincEmbeddedFieldPrecedence) + t.Run("TestBincLargeContainerLen", TestBincLargeContainerLen) + t.Run("TestBincMammothMapsAndSlices", TestBincMammothMapsAndSlices) + t.Run("TestBincTime", TestBincTime) + t.Run("TestBincUintToInt", TestBincUintToInt) + t.Run("TestBincDifferentMapOrSliceType", TestBincDifferentMapOrSliceType) + t.Run("TestBincScalars", TestBincScalars) + t.Run("TestBincOmitempty", TestBincOmitempty) + t.Run("TestBincIntfMapping", TestBincIntfMapping) + t.Run("TestBincMissingFields", TestBincMissingFields) + t.Run("TestBincMaxDepth", TestBincMaxDepth) +} + +func testCborGroup(t *testing.T) { + t.Run("TestCborCodecsTable", TestCborCodecsTable) + t.Run("TestCborCodecsMisc", TestCborCodecsMisc) + t.Run("TestCborCodecsEmbeddedPointer", TestCborCodecsEmbeddedPointer) + t.Run("TestCborMapEncodeForCanonical", TestCborMapEncodeForCanonical) + t.Run("TestCborCodecChan", TestCborCodecChan) + t.Run("TestCborStdEncIntf", TestCborStdEncIntf) + t.Run("TestCborMammoth", TestCborMammoth) + t.Run("TestCborRaw", TestCborRaw) + t.Run("TestCborRpcGo", TestCborRpcGo) + + t.Run("TestCborSwallowAndZero", TestCborSwallowAndZero) + t.Run("TestCborRawExt", TestCborRawExt) + t.Run("TestCborMapStructKey", TestCborMapStructKey) + t.Run("TestCborDecodeNilMapValue", TestCborDecodeNilMapValue) + t.Run("TestCborEmbeddedFieldPrecedence", TestCborEmbeddedFieldPrecedence) + t.Run("TestCborLargeContainerLen", TestCborLargeContainerLen) + t.Run("TestCborMammothMapsAndSlices", TestCborMammothMapsAndSlices) + t.Run("TestCborTime", TestCborTime) + t.Run("TestCborUintToInt", TestCborUintToInt) + t.Run("TestCborDifferentMapOrSliceType", TestCborDifferentMapOrSliceType) + t.Run("TestCborScalars", TestCborScalars) + t.Run("TestCborOmitempty", TestCborOmitempty) + t.Run("TestCborIntfMapping", TestCborIntfMapping) + t.Run("TestCborMissingFields", TestCborMissingFields) + t.Run("TestCborMaxDepth", TestCborMaxDepth) + + t.Run("TestCborHalfFloat", TestCborHalfFloat) +} + +func testMsgpackGroup(t *testing.T) { + t.Run("TestMsgpackCodecsTable", TestMsgpackCodecsTable) + t.Run("TestMsgpackCodecsMisc", TestMsgpackCodecsMisc) + t.Run("TestMsgpackCodecsEmbeddedPointer", TestMsgpackCodecsEmbeddedPointer) + t.Run("TestMsgpackStdEncIntf", TestMsgpackStdEncIntf) + t.Run("TestMsgpackMammoth", TestMsgpackMammoth) + t.Run("TestMsgpackRaw", TestMsgpackRaw) + t.Run("TestMsgpackRpcGo", TestMsgpackRpcGo) + t.Run("TestMsgpackRpcSpec", TestMsgpackRpcSpec) + t.Run("TestMsgpackSwallowAndZero", TestMsgpackSwallowAndZero) + t.Run("TestMsgpackRawExt", TestMsgpackRawExt) + t.Run("TestMsgpackMapStructKey", TestMsgpackMapStructKey) + t.Run("TestMsgpackDecodeNilMapValue", TestMsgpackDecodeNilMapValue) + t.Run("TestMsgpackEmbeddedFieldPrecedence", TestMsgpackEmbeddedFieldPrecedence) + t.Run("TestMsgpackLargeContainerLen", TestMsgpackLargeContainerLen) + t.Run("TestMsgpackMammothMapsAndSlices", TestMsgpackMammothMapsAndSlices) + t.Run("TestMsgpackTime", TestMsgpackTime) + t.Run("TestMsgpackUintToInt", TestMsgpackUintToInt) + t.Run("TestMsgpackDifferentMapOrSliceType", TestMsgpackDifferentMapOrSliceType) + t.Run("TestMsgpackScalars", TestMsgpackScalars) + t.Run("TestMsgpackOmitempty", TestMsgpackOmitempty) + t.Run("TestMsgpackIntfMapping", TestMsgpackIntfMapping) + t.Run("TestMsgpackMissingFields", TestMsgpackMissingFields) + t.Run("TestMsgpackMaxDepth", TestMsgpackMaxDepth) + + t.Run("TestMsgpackDecodeMapAndExtSizeMismatch", TestMsgpackDecodeMapAndExtSizeMismatch) +} + +func testSimpleGroup(t *testing.T) { + t.Run("TestSimpleCodecsTable", TestSimpleCodecsTable) + t.Run("TestSimpleCodecsMisc", TestSimpleCodecsMisc) + t.Run("TestSimpleCodecsEmbeddedPointer", TestSimpleCodecsEmbeddedPointer) + t.Run("TestSimpleStdEncIntf", TestSimpleStdEncIntf) + t.Run("TestSimpleMammoth", TestSimpleMammoth) + t.Run("TestSimpleRaw", TestSimpleRaw) + t.Run("TestSimpleRpcGo", TestSimpleRpcGo) + t.Run("TestSimpleSwallowAndZero", TestSimpleSwallowAndZero) + t.Run("TestSimpleRawExt", TestSimpleRawExt) + t.Run("TestSimpleMapStructKey", TestSimpleMapStructKey) + t.Run("TestSimpleDecodeNilMapValue", TestSimpleDecodeNilMapValue) + t.Run("TestSimpleEmbeddedFieldPrecedence", TestSimpleEmbeddedFieldPrecedence) + t.Run("TestSimpleLargeContainerLen", TestSimpleLargeContainerLen) + t.Run("TestSimpleMammothMapsAndSlices", TestSimpleMammothMapsAndSlices) + t.Run("TestSimpleTime", TestSimpleTime) + t.Run("TestSimpleUintToInt", TestSimpleUintToInt) + t.Run("TestSimpleDifferentMapOrSliceType", TestSimpleDifferentMapOrSliceType) + t.Run("TestSimpleScalars", TestSimpleScalars) + t.Run("TestSimpleOmitempty", TestSimpleOmitempty) + t.Run("TestSimpleIntfMapping", TestSimpleIntfMapping) + t.Run("TestSimpleMissingFields", TestSimpleMissingFields) + t.Run("TestSimpleMaxDepth", TestSimpleMaxDepth) +} + +func testSimpleMammothGroup(t *testing.T) { + t.Run("TestSimpleMammothMapsAndSlices", TestSimpleMammothMapsAndSlices) +} + +func testRpcGroup(t *testing.T) { + t.Run("TestBincRpcGo", TestBincRpcGo) + t.Run("TestSimpleRpcGo", TestSimpleRpcGo) + t.Run("TestMsgpackRpcGo", TestMsgpackRpcGo) + t.Run("TestCborRpcGo", TestCborRpcGo) + t.Run("TestJsonRpcGo", TestJsonRpcGo) + t.Run("TestMsgpackRpcSpec", TestMsgpackRpcSpec) +} + +func testNonHandlesGroup(t *testing.T) { + // grep "func Test" codec_test.go | grep -v -E '(Cbor|Json|Simple|Msgpack|Binc)' + t.Run("TestBufioDecReader", TestBufioDecReader) + t.Run("TestAtomic", TestAtomic) + t.Run("TestAllEncCircularRef", TestAllEncCircularRef) + t.Run("TestAllAnonCycle", TestAllAnonCycle) + t.Run("TestMultipleEncDec", TestMultipleEncDec) + t.Run("TestAllErrWriter", TestAllErrWriter) +} + +func TestCodecSuite(t *testing.T) { + testSuite(t, testCodecGroup) + + testGroupResetFlags() + + oldIndent, oldCharsAsis, oldPreferFloat, oldMapKeyAsString := + testJsonH.Indent, testJsonH.HTMLCharsAsIs, testJsonH.PreferFloat, testJsonH.MapKeyAsString + + testMaxInitLen = 10 + testJsonH.Indent = 8 + testJsonH.HTMLCharsAsIs = true + testJsonH.MapKeyAsString = true + // testJsonH.PreferFloat = true + testReinit() + t.Run("json-spaces-htmlcharsasis-initLen10", testJsonGroup) + + testMaxInitLen = 10 + testJsonH.Indent = -1 + testJsonH.HTMLCharsAsIs = false + testJsonH.MapKeyAsString = true + // testJsonH.PreferFloat = false + testReinit() + t.Run("json-tabs-initLen10", testJsonGroup) + + testJsonH.Indent, testJsonH.HTMLCharsAsIs, testJsonH.PreferFloat, testJsonH.MapKeyAsString = + oldIndent, oldCharsAsis, oldPreferFloat, oldMapKeyAsString + + oldIndefLen := testCborH.IndefiniteLength + + testCborH.IndefiniteLength = true + testReinit() + t.Run("cbor-indefinitelength", testCborGroup) + + testCborH.IndefiniteLength = oldIndefLen + + oldTimeRFC3339 := testCborH.TimeRFC3339 + testCborH.TimeRFC3339 = !testCborH.TimeRFC3339 + testReinit() + t.Run("cbor-rfc3339", testCborGroup) + testCborH.TimeRFC3339 = oldTimeRFC3339 + + oldSymbols := testBincH.AsSymbols + + testBincH.AsSymbols = 2 // AsSymbolNone + testReinit() + t.Run("binc-no-symbols", testBincGroup) + + testBincH.AsSymbols = 1 // AsSymbolAll + testReinit() + t.Run("binc-all-symbols", testBincGroup) + + testBincH.AsSymbols = oldSymbols + + oldWriteExt := testMsgpackH.WriteExt + oldNoFixedNum := testMsgpackH.NoFixedNum + + testMsgpackH.WriteExt = !testMsgpackH.WriteExt + testReinit() + t.Run("msgpack-inverse-writeext", testMsgpackGroup) + + testMsgpackH.WriteExt = oldWriteExt + + testMsgpackH.NoFixedNum = !testMsgpackH.NoFixedNum + testReinit() + t.Run("msgpack-fixednum", testMsgpackGroup) + + testMsgpackH.NoFixedNum = oldNoFixedNum + + oldEncZeroValuesAsNil := testSimpleH.EncZeroValuesAsNil + testSimpleH.EncZeroValuesAsNil = !testSimpleH.EncZeroValuesAsNil + testUseMust = true + testReinit() + t.Run("simple-enczeroasnil", testSimpleMammothGroup) // testSimpleGroup + testSimpleH.EncZeroValuesAsNil = oldEncZeroValuesAsNil + + oldRpcBufsize := testRpcBufsize + testRpcBufsize = 0 + t.Run("rpc-buf-0", testRpcGroup) + testRpcBufsize = 0 + t.Run("rpc-buf-00", testRpcGroup) + testRpcBufsize = 0 + t.Run("rpc-buf-000", testRpcGroup) + testRpcBufsize = 16 + t.Run("rpc-buf-16", testRpcGroup) + testRpcBufsize = 2048 + t.Run("rpc-buf-2048", testRpcGroup) + testRpcBufsize = oldRpcBufsize + + testGroupResetFlags() +} + +// func TestCodecSuite(t *testing.T) { +// testReinit() // so flag.Parse() is called first, and never called again +// testDecodeOptions, testEncodeOptions = DecodeOptions{}, EncodeOptions{} +// testGroupResetFlags() +// testReinit() +// t.Run("optionsFalse", func(t *testing.T) { +// t.Run("TestJsonMammothMapsAndSlices", TestJsonMammothMapsAndSlices) +// }) +// } diff --git a/vendor/github.com/ugorji/go/codec/z_helper_test.go b/vendor/github.com/ugorji/go/codec/z_helper_test.go deleted file mode 100644 index 2e9b3a0f0..000000000 --- a/vendor/github.com/ugorji/go/codec/z_helper_test.go +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) 2012, 2013 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a BSD-style license found in the LICENSE file. - -package codec - -// All non-std package dependencies related to testing live in this file, -// so porting to different environment is easy (just update functions). -// -// Also, this file is called z_helper_test, to give a "hint" to compiler -// that its init() function should be called last. (not guaranteed by spec) - -import ( - "errors" - "reflect" - "flag" - "testing" -) - -var ( - testLogToT = true - failNowOnFail = true -) - -func init() { - testInitFlags() - benchInitFlags() - flag.Parse() - testInit() - benchInit() -} - -func checkErrT(t *testing.T, err error) { - if err != nil { - logT(t, err.Error()) - failT(t) - } -} - -func checkEqualT(t *testing.T, v1 interface{}, v2 interface{}, desc string) (err error) { - if err = deepEqual(v1, v2); err != nil { - logT(t, "Not Equal: %s: %v. v1: %v, v2: %v", desc, err, v1, v2) - failT(t) - } - return -} - -func logT(x interface{}, format string, args ...interface{}) { - if t, ok := x.(*testing.T); ok && t != nil && testLogToT { - t.Logf(format, args...) - } else if b, ok := x.(*testing.B); ok && b != nil && testLogToT { - b.Logf(format, args...) - } else { - debugf(format, args...) - } -} - -func failT(t *testing.T) { - if failNowOnFail { - t.FailNow() - } else { - t.Fail() - } -} - -func deepEqual(v1, v2 interface{}) (err error) { - if !reflect.DeepEqual(v1, v2) { - err = errors.New("Not Match") - } - return -} - -func approxDataSize(rv reflect.Value) (sum int) { - switch rk := rv.Kind(); rk { - case reflect.Invalid: - case reflect.Ptr, reflect.Interface: - sum += int(rv.Type().Size()) - sum += approxDataSize(rv.Elem()) - case reflect.Slice: - sum += int(rv.Type().Size()) - for j := 0; j < rv.Len(); j++ { - sum += approxDataSize(rv.Index(j)) - } - case reflect.String: - sum += int(rv.Type().Size()) - sum += rv.Len() - case reflect.Map: - sum += int(rv.Type().Size()) - for _, mk := range rv.MapKeys() { - sum += approxDataSize(mk) - sum += approxDataSize(rv.MapIndex(mk)) - } - case reflect.Struct: - //struct size already includes the full data size. - //sum += int(rv.Type().Size()) - for j := 0; j < rv.NumField(); j++ { - sum += approxDataSize(rv.Field(j)) - } - default: - //pure value types - sum += int(rv.Type().Size()) - } - return -} diff --git a/vendor/github.com/ugorji/go/go.mod b/vendor/github.com/ugorji/go/go.mod new file mode 100644 index 000000000..a53550eca --- /dev/null +++ b/vendor/github.com/ugorji/go/go.mod @@ -0,0 +1,2 @@ +module github.com/ugorji/go +