From 2ff56553d939f63625a79498f8ff3fd778ceadf4 Mon Sep 17 00:00:00 2001 From: Maciej Lisiewski Date: Thu, 23 Nov 2017 20:11:56 -0500 Subject: [PATCH] Dep for dependency management, newer go in CI, dependency updates (#325) * Use Dep instead of Glide for managing dependencies * Run tests on the latest two versions of go * Use older goleveldb * Don't test vendor (default in go 1.9+) * Drop Go 1.6 from tests - it's old and I really don't want to deal with it. * Stop testing with Go 1.7 --- .travis.yml | 6 +- Gopkg.lock | 86 + Gopkg.toml | 56 + Makefile | 27 +- .../pelletier/go-buffruneio/buffruneio.go | 117 - .../github.com/ugorji/go/codec/decode.go | 2019 - .../github.com/ugorji/go/codec/encode.go | 1422 - .../ugorji/go/codec/fast-path.generated.go | 39352 -------------- .../ugorji/go/codec/gen.generated.go | 175 - .../ugorji/go/codec/helper_not_unsafe.go | 20 - .../ugorji/go/codec/helper_unsafe.go | 49 - .../vendor/github.com/ugorji/go/codec/json.go | 1213 - .../github.com/ugorji/go/codec/prebuild.go | 3 - .../vendor/github.com/ugorji/go/codec/rpc.go | 180 - glide.lock | 65 - glide.yaml | 39 - vendor/github.com/cupcake/rdb/.gitignore | 25 + vendor/github.com/cupcake/rdb/.travis.yml | 6 + .../github.com/cupcake/rdb/LICENCE | 0 vendor/github.com/cupcake/rdb/README.md | 17 + .../github.com/cupcake/rdb/crc64/crc64.go | 0 .../github.com/cupcake/rdb/decoder.go | 0 vendor/github.com/cupcake/rdb/decoder_test.go | 347 + .../github.com/cupcake/rdb/encoder.go | 0 vendor/github.com/cupcake/rdb/encoder_test.go | 43 + .../cupcake/rdb/nopdecoder/nop_decoder.go | 0 .../github.com/cupcake/rdb/slice_buffer.go | 0 vendor/github.com/edsrzf/mmap-go/.gitignore | 8 + .../github.com/edsrzf/mmap-go/LICENSE | 0 vendor/github.com/edsrzf/mmap-go/README.md | 12 + .../github.com/edsrzf/mmap-go/mmap.go | 4 + vendor/github.com/edsrzf/mmap-go/mmap_test.go | 152 + .../github.com/edsrzf/mmap-go/mmap_unix.go | 0 .../github.com/edsrzf/mmap-go/mmap_windows.go | 0 .../github.com/edsrzf/mmap-go/msync_netbsd.go | 0 .../github.com/edsrzf/mmap-go/msync_unix.go | 0 .../github.com/glendc/gopher-json/LICENSE | 0 .../github.com/glendc/gopher-json/README.md | 7 + .../github.com/glendc/gopher-json/api.go | 0 .../github.com/glendc/gopher-json/cjson.go | 0 .../github.com/glendc/gopher-json/doc.go | 0 .../github.com/glendc/gopher-json/json.go | 0 .../glendc/gopher-json/json_test.go | 75 + .../github.com/glendc/gopher-json/util.go | 0 vendor/github.com/golang/snappy/.gitignore | 16 + vendor/github.com/golang/snappy/AUTHORS | 15 + vendor/github.com/golang/snappy/CONTRIBUTORS | 37 + .../github.com/golang/snappy/LICENSE | 0 vendor/github.com/golang/snappy/README | 107 + .../github.com/golang/snappy/decode.go | 0 .../github.com/golang/snappy/decode_amd64.go | 0 .../github.com/golang/snappy/decode_amd64.s | 0 .../github.com/golang/snappy/decode_other.go | 0 .../github.com/golang/snappy/encode.go | 0 .../github.com/golang/snappy/encode_amd64.go | 0 .../github.com/golang/snappy/encode_amd64.s | 0 .../github.com/golang/snappy/encode_other.go | 0 .../github.com/golang/snappy/golden_test.go | 1965 + .../github.com/golang/snappy/snappy.go | 0 .../github.com/golang/snappy/snappy_test.go | 1353 + .../github.com/pelletier/go-toml/.gitignore | 1 + .../github.com/pelletier/go-toml/.travis.yml | 23 + .../github.com/pelletier/go-toml/LICENSE | 0 vendor/github.com/pelletier/go-toml/README.md | 119 + .../pelletier/go-toml/benchmark.json | 164 + .../github.com/pelletier/go-toml/benchmark.sh | 32 + .../pelletier/go-toml/benchmark.toml | 244 + .../pelletier/go-toml/benchmark.yml | 121 + .../pelletier/go-toml/benchmark_test.go | 192 + .../github.com/pelletier/go-toml/doc.go | 0 .../github.com/pelletier/go-toml/doc_test.go | 100 + .../pelletier/go-toml/example-crlf.toml | 29 + .../github.com/pelletier/go-toml/example.toml | 29 + .../pelletier/go-toml/keysparsing.go | 0 .../pelletier/go-toml/keysparsing_test.go | 56 + .../github.com/pelletier/go-toml/lexer.go | 87 +- .../pelletier/go-toml/lexer_test.go | 750 + .../github.com/pelletier/go-toml/marshal.go | 11 +- .../pelletier/go-toml/marshal_test.go | 600 + .../pelletier/go-toml/marshal_test.toml | 38 + .../github.com/pelletier/go-toml/parser.go | 30 +- .../pelletier/go-toml/parser_test.go | 785 + .../github.com/pelletier/go-toml/position.go | 0 .../pelletier/go-toml/position_test.go | 29 + vendor/github.com/pelletier/go-toml/test.sh | 90 + .../github.com/pelletier/go-toml/token.go | 0 .../pelletier/go-toml/token_test.go | 67 + .../github.com/pelletier/go-toml/toml.go | 19 +- .../github.com/pelletier/go-toml/toml_test.go | 106 + .../pelletier/go-toml/tomltree_create.go | 0 .../pelletier/go-toml/tomltree_create_test.go | 126 + .../pelletier/go-toml/tomltree_write.go | 21 +- .../pelletier/go-toml/tomltree_write_test.go | 358 + .../github.com/peterh/liner/COPYING | 0 vendor/github.com/peterh/liner/README.md | 100 + .../github.com/peterh/liner/bsdinput.go | 0 .../github.com/peterh/liner/common.go | 7 +- .../github.com/peterh/liner/fallbackinput.go | 0 .../github.com/peterh/liner/input.go | 7 +- .../github.com/peterh/liner/input_darwin.go | 0 .../github.com/peterh/liner/input_linux.go | 0 vendor/github.com/peterh/liner/input_test.go | 61 + .../github.com/peterh/liner/input_windows.go | 4 + .../github.com/peterh/liner/line.go | 117 +- vendor/github.com/peterh/liner/line_test.go | 146 + .../github.com/peterh/liner/output.go | 0 .../github.com/peterh/liner/output_windows.go | 0 vendor/github.com/peterh/liner/prefix_test.go | 37 + vendor/github.com/peterh/liner/race_test.go | 44 + .../github.com/peterh/liner/unixmode.go | 0 .../github.com/peterh/liner/width.go | 0 vendor/github.com/peterh/liner/width_test.go | 102 + .../github.com/siddontang/go/LICENSE | 0 vendor/github.com/siddontang/go/README.md | 4 + .../github.com/siddontang/go/bson/LICENSE | 0 .../github.com/siddontang/go/bson/bson.go | 0 .../siddontang/go/bson/bson_test.go | 1472 + .../github.com/siddontang/go/bson/decode.go | 0 .../github.com/siddontang/go/bson/encode.go | 0 .../github.com/siddontang/go/filelock/LICENSE | 0 .../go/filelock/file_lock_generic.go | 0 .../go/filelock/file_lock_solaris.go | 0 .../siddontang/go/filelock/file_lock_test.go | 77 + .../siddontang/go/filelock/file_lock_unix.go | 0 .../go/filelock/file_lock_windows.go | 0 .../github.com/siddontang/go/hack/hack.go | 0 .../siddontang/go/hack/hack_test.go | 36 + .../siddontang/go/ioutil2/ioutil.go | 2 +- .../siddontang/go/ioutil2/sectionwriter.go | 0 .../go/ioutil2/sectionwriter_test.go | 56 + .../github.com/siddontang/go/log/doc.go | 0 .../siddontang/go/log/filehandler.go | 0 .../github.com/siddontang/go/log/handler.go | 0 .../github.com/siddontang/go/log/log.go | 0 .../github.com/siddontang/go/log/log_test.go | 68 + .../siddontang/go/log/sockethandler.go | 0 .../github.com/siddontang/go/num/bytes.go | 0 .../github.com/siddontang/go/num/cmp.go | 0 .../github.com/siddontang/go/num/num_test.go | 209 + .../github.com/siddontang/go/num/str.go | 0 .../github.com/siddontang/go/snappy/LICENSE | 0 .../github.com/siddontang/go/snappy/decode.go | 0 .../github.com/siddontang/go/snappy/encode.go | 0 .../github.com/siddontang/go/snappy/snappy.go | 0 .../siddontang/go/snappy/snappy_test.go | 261 + .../github.com/siddontang/go/sync2/atomic.go | 2 +- .../siddontang/go/sync2/atomic_test.go | 51 + .../siddontang/go/sync2/semaphore.go | 0 .../siddontang/go/sync2/semaphore_test.go | 41 + .../github.com/siddontang/go/vitess_license | 28 + .../github.com/siddontang/goredis/LICENSE | 0 .../github.com/siddontang/goredis/client.go | 0 .../github.com/siddontang/goredis/conn.go | 0 .../github.com/siddontang/goredis/doc.go | 0 .../siddontang/goredis/garyburd_license | 13 + .../siddontang/goredis/goredis_test.go | 39 + .../github.com/siddontang/goredis/reply.go | 0 .../github.com/siddontang/goredis/resp.go | 0 .../siddontang/goredis/resp_test.go | 81 + .../github.com/siddontang/rdb/LICENSE | 0 vendor/github.com/siddontang/rdb/README.md | 3 + .../github.com/siddontang/rdb/decode.go | 0 .../github.com/siddontang/rdb/digest.go | 0 .../github.com/siddontang/rdb/encode.go | 0 .../github.com/siddontang/rdb/loader.go | 0 .../github.com/siddontang/rdb/loader_test.go | 373 + vendor/github.com/siddontang/rdb/rdb_test.go | 23 + .../github.com/siddontang/rdb/reader.go | 0 .../siddontang/rdb/wandoujia-license | 21 + .../github.com/syndtr/goleveldb/.travis.yml | 11 + .../github.com/syndtr/goleveldb/LICENSE | 0 vendor/github.com/syndtr/goleveldb/README.md | 105 + .../syndtr/goleveldb/leveldb/batch.go | 0 .../syndtr/goleveldb/leveldb/batch_test.go | 123 + .../syndtr/goleveldb/leveldb/bench_test.go | 509 + .../goleveldb/leveldb/cache/bench_test.go | 29 + .../syndtr/goleveldb/leveldb/cache/cache.go | 0 .../goleveldb/leveldb/cache/cache_test.go | 553 + .../syndtr/goleveldb/leveldb/cache/lru.go | 0 .../syndtr/goleveldb/leveldb/comparer.go | 0 .../leveldb/comparer/bytes_comparer.go | 0 .../goleveldb/leveldb/comparer/comparer.go | 0 .../syndtr/goleveldb/leveldb/corrupt_test.go | 496 + .../github.com/syndtr/goleveldb/leveldb/db.go | 0 .../syndtr/goleveldb/leveldb/db_compaction.go | 0 .../syndtr/goleveldb/leveldb/db_iter.go | 0 .../syndtr/goleveldb/leveldb/db_snapshot.go | 0 .../syndtr/goleveldb/leveldb/db_state.go | 0 .../syndtr/goleveldb/leveldb/db_test.go | 2829 + .../goleveldb/leveldb/db_transaction.go | 0 .../syndtr/goleveldb/leveldb/db_util.go | 0 .../syndtr/goleveldb/leveldb/db_write.go | 0 .../syndtr/goleveldb/leveldb/doc.go | 0 .../syndtr/goleveldb/leveldb/errors.go | 0 .../syndtr/goleveldb/leveldb/errors/errors.go | 0 .../syndtr/goleveldb/leveldb/external_test.go | 117 + .../syndtr/goleveldb/leveldb/filter.go | 0 .../syndtr/goleveldb/leveldb/filter/bloom.go | 0 .../goleveldb/leveldb/filter/bloom_test.go | 142 + .../syndtr/goleveldb/leveldb/filter/filter.go | 0 .../goleveldb/leveldb/iterator/array_iter.go | 0 .../leveldb/iterator/array_iter_test.go | 30 + .../leveldb/iterator/indexed_iter.go | 0 .../leveldb/iterator/indexed_iter_test.go | 83 + .../syndtr/goleveldb/leveldb/iterator/iter.go | 0 .../leveldb/iterator/iter_suite_test.go | 11 + .../goleveldb/leveldb/iterator/merged_iter.go | 0 .../leveldb/iterator/merged_iter_test.go | 60 + .../goleveldb/leveldb/journal/journal.go | 0 .../goleveldb/leveldb/journal/journal_test.go | 818 + .../syndtr/goleveldb/leveldb/key.go | 0 .../syndtr/goleveldb/leveldb/key_test.go | 133 + .../goleveldb/leveldb/leveldb_suite_test.go | 11 + .../goleveldb/leveldb/memdb/bench_test.go | 75 + .../syndtr/goleveldb/leveldb/memdb/memdb.go | 0 .../leveldb/memdb/memdb_suite_test.go | 11 + .../goleveldb/leveldb/memdb/memdb_test.go | 135 + .../syndtr/goleveldb/leveldb/opt/options.go | 0 .../syndtr/goleveldb/leveldb/options.go | 0 .../syndtr/goleveldb/leveldb/session.go | 0 .../goleveldb/leveldb/session_compaction.go | 0 .../goleveldb/leveldb/session_record.go | 0 .../goleveldb/leveldb/session_record_test.go | 62 + .../syndtr/goleveldb/leveldb/session_util.go | 0 .../goleveldb/leveldb/storage/file_storage.go | 0 .../leveldb/storage/file_storage_plan9.go | 0 .../leveldb/storage/file_storage_solaris.go | 0 .../leveldb/storage/file_storage_test.go | 176 + .../leveldb/storage/file_storage_unix.go | 0 .../leveldb/storage/file_storage_windows.go | 0 .../goleveldb/leveldb/storage/mem_storage.go | 0 .../leveldb/storage/mem_storage_test.go | 65 + .../goleveldb/leveldb/storage/storage.go | 0 .../syndtr/goleveldb/leveldb/table.go | 0 .../goleveldb/leveldb/table/block_test.go | 139 + .../syndtr/goleveldb/leveldb/table/reader.go | 0 .../syndtr/goleveldb/leveldb/table/table.go | 0 .../leveldb/table/table_suite_test.go | 11 + .../goleveldb/leveldb/table/table_test.go | 123 + .../syndtr/goleveldb/leveldb/table/writer.go | 0 .../syndtr/goleveldb/leveldb/testutil_test.go | 91 + .../syndtr/goleveldb/leveldb/util.go | 0 .../syndtr/goleveldb/leveldb/util/buffer.go | 0 .../goleveldb/leveldb/util/buffer_pool.go | 0 .../goleveldb/leveldb/util/buffer_test.go | 369 + .../syndtr/goleveldb/leveldb/util/crc32.go | 0 .../syndtr/goleveldb/leveldb/util/hash.go | 0 .../goleveldb/leveldb/util/hash_test.go | 46 + .../syndtr/goleveldb/leveldb/util/range.go | 0 .../syndtr/goleveldb/leveldb/util/util.go | 0 .../syndtr/goleveldb/leveldb/version.go | 0 .../syndtr/goleveldb/leveldb/version_test.go | 181 + vendor/github.com/ugorji/go/.travis.yml | 11 + .../github.com/ugorji/go/LICENSE | 0 vendor/github.com/ugorji/go/README.md | 27 + .../github.com/ugorji/go/codec/0doc.go | 129 +- vendor/github.com/ugorji/go/codec/README.md | 201 + .../github.com/ugorji/go/codec/binc.go | 179 +- .../github.com/ugorji/go/codec/cbor.go | 238 +- .../github.com/ugorji/go/codec/cbor_test.go | 230 + .../github.com/ugorji/go/codec/codec_test.go | 2907 + vendor/github.com/ugorji/go/codec/decode.go | 2435 + vendor/github.com/ugorji/go/codec/encode.go | 1362 + .../ugorji/go/codec/fast-path.generated.go | 33002 ++++++++++++ .../ugorji/go/codec/fast-path.go.tmpl | 490 + .../ugorji/go/codec/fast-path.not.go | 14 +- .../ugorji/go/codec/gen-dec-array.go.tmpl | 77 + .../ugorji/go/codec/gen-dec-map.go.tmpl | 42 + .../ugorji/go/codec/gen-helper.generated.go | 157 +- .../ugorji/go/codec/gen-helper.go.tmpl | 244 + .../ugorji/go/codec/gen.generated.go | 134 + .../github.com/ugorji/go/codec/gen.go | 556 +- .../go/codec/goversion_arrayof_gte_go15.go | 14 + .../go/codec/goversion_arrayof_lt_go15.go | 14 + .../go/codec/goversion_makemap_gte_go19.go | 15 + .../go/codec/goversion_makemap_lt_go19.go | 12 + ...version_unexportedembeddedptr_gte_go110.go | 8 + ...oversion_unexportedembeddedptr_lt_go110.go | 8 + .../go/codec/goversion_unsupported_lt_go14.go | 17 + .../go/codec/goversion_vendor_eq_go15.go | 4 +- .../go/codec/goversion_vendor_eq_go16.go | 6 +- .../go/codec/goversion_vendor_gte_go17.go | 8 + .../go/codec/goversion_vendor_lt_go15.go | 8 + .../github.com/ugorji/go/codec/helper.go | 1279 +- .../ugorji/go/codec/helper_internal.go | 89 +- .../ugorji/go/codec/helper_not_unsafe.go | 235 + .../github.com/ugorji/go/codec/helper_test.go | 54 + .../ugorji/go/codec/helper_unsafe.go | 534 + vendor/github.com/ugorji/go/codec/json.go | 1210 + .../ugorji/go/codec/mammoth-test.go.tmpl | 154 + .../ugorji/go/codec/mammoth2-test.go.tmpl | 94 + .../codec/mammoth2_codecgen_generated_test.go | 44995 ++++++++++++++++ .../go/codec/mammoth2_generated_test.go | 658 + .../ugorji/go/codec/mammoth_generated_test.go | 13188 +++++ .../github.com/ugorji/go/codec/msgpack.go | 311 +- .../github.com/ugorji/go/codec/noop.go | 7 +- vendor/github.com/ugorji/go/codec/py_test.go | 30 + vendor/github.com/ugorji/go/codec/rpc.go | 197 + .../github.com/ugorji/go/codec/shared_test.go | 304 + .../github.com/ugorji/go/codec/simple.go | 224 +- .../ugorji/go/codec/test-cbor-goldens.json | 639 + vendor/github.com/ugorji/go/codec/test.py | 126 + .../github.com/ugorji/go/codec/time.go | 93 +- .../ugorji/go/codec/values_flex_test.go | 186 + .../github.com/ugorji/go/codec/values_test.go | 416 + vendor/github.com/ugorji/go/codec/xml.go | 432 + .../github.com/ugorji/go/codec/z_all_test.go | 464 + vendor/github.com/ugorji/go/msgpack.org.md | 47 + vendor/github.com/yuin/gopher-lua/.travis.yml | 15 + .../github.com/yuin/gopher-lua/LICENSE | 0 vendor/github.com/yuin/gopher-lua/Makefile | 10 + vendor/github.com/yuin/gopher-lua/README.rst | 801 + .../github.com/yuin/gopher-lua/_state.go | 4 +- .../github.com/yuin/gopher-lua/_vm.go | 0 .../github.com/yuin/gopher-lua/alloc.go | 0 .../github.com/yuin/gopher-lua/ast/ast.go | 0 .../github.com/yuin/gopher-lua/ast/expr.go | 0 .../github.com/yuin/gopher-lua/ast/misc.go | 0 .../github.com/yuin/gopher-lua/ast/stmt.go | 0 .../github.com/yuin/gopher-lua/ast/token.go | 0 .../github.com/yuin/gopher-lua/auxlib.go | 0 .../github.com/yuin/gopher-lua/auxlib_test.go | 333 + .../github.com/yuin/gopher-lua/baselib.go | 5 + .../github.com/yuin/gopher-lua/channellib.go | 0 .../yuin/gopher-lua/channellib_test.go | 261 + .../github.com/yuin/gopher-lua/compile.go | 0 .../github.com/yuin/gopher-lua/config.go | 0 .../yuin/gopher-lua/coroutinelib.go | 0 .../github.com/yuin/gopher-lua/debuglib.go | 0 .../github.com/yuin/gopher-lua/function.go | 0 .../github.com/yuin/gopher-lua/iolib.go | 0 .../github.com/yuin/gopher-lua/linit.go | 0 .../github.com/yuin/gopher-lua/loadlib.go | 0 .../github.com/yuin/gopher-lua/mathlib.go | 0 .../github.com/yuin/gopher-lua/opcode.go | 0 .../github.com/yuin/gopher-lua/oslib.go | 2 +- .../github.com/yuin/gopher-lua/package.go | 0 .../github.com/yuin/gopher-lua/parse/Makefile | 4 + .../github.com/yuin/gopher-lua/parse/lexer.go | 16 +- .../yuin/gopher-lua/parse/parser.go | 0 .../yuin/gopher-lua/parse/parser.go.y | 524 + .../github.com/yuin/gopher-lua/pm/pm.go | 0 .../github.com/yuin/gopher-lua/script_test.go | 87 + .../github.com/yuin/gopher-lua/state.go | 4 +- .../github.com/yuin/gopher-lua/state_test.go | 433 + .../github.com/yuin/gopher-lua/stringlib.go | 0 .../github.com/yuin/gopher-lua/table.go | 63 +- .../github.com/yuin/gopher-lua/table_test.go | 187 + .../github.com/yuin/gopher-lua/tablelib.go | 0 .../yuin/gopher-lua/testutils_test.go | 78 + .../github.com/yuin/gopher-lua/utils.go | 0 .../github.com/yuin/gopher-lua/value.go | 2 +- .../github.com/yuin/gopher-lua/vm.go | 0 vendor/golang.org/x/net/.gitattributes | 10 + vendor/golang.org/x/net/.gitignore | 2 + vendor/golang.org/x/net/AUTHORS | 3 + vendor/golang.org/x/net/CONTRIBUTING.md | 31 + vendor/golang.org/x/net/CONTRIBUTORS | 3 + .../golang.org/x/net/LICENSE | 0 .../golang.org/x/net/PATENTS | 0 vendor/golang.org/x/net/README.md | 16 + vendor/golang.org/x/net/codereview.cfg | 1 + .../golang.org/x/net/context/context.go | 2 + .../golang.org/x/net/context/context_test.go | 583 + .../golang.org/x/net/context/go17.go | 0 .../golang.org/x/net/context/go19.go | 0 .../golang.org/x/net/context/pre_go17.go | 0 .../golang.org/x/net/context/pre_go19.go | 0 .../x/net/context/withtimeout_test.go | 31 + 369 files changed, 130417 insertions(+), 45883 deletions(-) create mode 100644 Gopkg.lock create mode 100644 Gopkg.toml delete mode 100644 _vendor/vendor/github.com/pelletier/go-buffruneio/buffruneio.go delete mode 100644 _vendor/vendor/github.com/ugorji/go/codec/decode.go delete mode 100644 _vendor/vendor/github.com/ugorji/go/codec/encode.go delete mode 100644 _vendor/vendor/github.com/ugorji/go/codec/fast-path.generated.go delete mode 100644 _vendor/vendor/github.com/ugorji/go/codec/gen.generated.go delete mode 100644 _vendor/vendor/github.com/ugorji/go/codec/helper_not_unsafe.go delete mode 100644 _vendor/vendor/github.com/ugorji/go/codec/helper_unsafe.go delete mode 100644 _vendor/vendor/github.com/ugorji/go/codec/json.go delete mode 100644 _vendor/vendor/github.com/ugorji/go/codec/prebuild.go delete mode 100644 _vendor/vendor/github.com/ugorji/go/codec/rpc.go delete mode 100644 glide.lock delete mode 100644 glide.yaml create mode 100644 vendor/github.com/cupcake/rdb/.gitignore create mode 100644 vendor/github.com/cupcake/rdb/.travis.yml rename {_vendor/vendor => vendor}/github.com/cupcake/rdb/LICENCE (100%) create mode 100644 vendor/github.com/cupcake/rdb/README.md rename {_vendor/vendor => vendor}/github.com/cupcake/rdb/crc64/crc64.go (100%) rename {_vendor/vendor => vendor}/github.com/cupcake/rdb/decoder.go (100%) create mode 100644 vendor/github.com/cupcake/rdb/decoder_test.go rename {_vendor/vendor => vendor}/github.com/cupcake/rdb/encoder.go (100%) create mode 100644 vendor/github.com/cupcake/rdb/encoder_test.go rename {_vendor/vendor => vendor}/github.com/cupcake/rdb/nopdecoder/nop_decoder.go (100%) rename {_vendor/vendor => vendor}/github.com/cupcake/rdb/slice_buffer.go (100%) create mode 100644 vendor/github.com/edsrzf/mmap-go/.gitignore rename {_vendor/vendor => vendor}/github.com/edsrzf/mmap-go/LICENSE (100%) create mode 100644 vendor/github.com/edsrzf/mmap-go/README.md rename {_vendor/vendor => vendor}/github.com/edsrzf/mmap-go/mmap.go (96%) create mode 100644 vendor/github.com/edsrzf/mmap-go/mmap_test.go rename {_vendor/vendor => vendor}/github.com/edsrzf/mmap-go/mmap_unix.go (100%) rename {_vendor/vendor => vendor}/github.com/edsrzf/mmap-go/mmap_windows.go (100%) rename {_vendor/vendor => vendor}/github.com/edsrzf/mmap-go/msync_netbsd.go (100%) rename {_vendor/vendor => vendor}/github.com/edsrzf/mmap-go/msync_unix.go (100%) rename {_vendor/vendor => vendor}/github.com/glendc/gopher-json/LICENSE (100%) create mode 100644 vendor/github.com/glendc/gopher-json/README.md rename {_vendor/vendor => vendor}/github.com/glendc/gopher-json/api.go (100%) rename {_vendor/vendor => vendor}/github.com/glendc/gopher-json/cjson.go (100%) rename {_vendor/vendor => vendor}/github.com/glendc/gopher-json/doc.go (100%) rename {_vendor/vendor => vendor}/github.com/glendc/gopher-json/json.go (100%) create mode 100644 vendor/github.com/glendc/gopher-json/json_test.go rename {_vendor/vendor => vendor}/github.com/glendc/gopher-json/util.go (100%) create mode 100644 vendor/github.com/golang/snappy/.gitignore create mode 100644 vendor/github.com/golang/snappy/AUTHORS create mode 100644 vendor/github.com/golang/snappy/CONTRIBUTORS rename {_vendor/vendor => vendor}/github.com/golang/snappy/LICENSE (100%) create mode 100644 vendor/github.com/golang/snappy/README rename {_vendor/vendor => vendor}/github.com/golang/snappy/decode.go (100%) rename {_vendor/vendor => vendor}/github.com/golang/snappy/decode_amd64.go (100%) rename {_vendor/vendor => vendor}/github.com/golang/snappy/decode_amd64.s (100%) rename {_vendor/vendor => vendor}/github.com/golang/snappy/decode_other.go (100%) rename {_vendor/vendor => vendor}/github.com/golang/snappy/encode.go (100%) rename {_vendor/vendor => vendor}/github.com/golang/snappy/encode_amd64.go (100%) rename {_vendor/vendor => vendor}/github.com/golang/snappy/encode_amd64.s (100%) rename {_vendor/vendor => vendor}/github.com/golang/snappy/encode_other.go (100%) create mode 100644 vendor/github.com/golang/snappy/golden_test.go rename {_vendor/vendor => vendor}/github.com/golang/snappy/snappy.go (100%) create mode 100644 vendor/github.com/golang/snappy/snappy_test.go create mode 100644 vendor/github.com/pelletier/go-toml/.gitignore create mode 100644 vendor/github.com/pelletier/go-toml/.travis.yml rename {_vendor/vendor => vendor}/github.com/pelletier/go-toml/LICENSE (100%) create mode 100644 vendor/github.com/pelletier/go-toml/README.md create mode 100644 vendor/github.com/pelletier/go-toml/benchmark.json create mode 100755 vendor/github.com/pelletier/go-toml/benchmark.sh create mode 100644 vendor/github.com/pelletier/go-toml/benchmark.toml create mode 100644 vendor/github.com/pelletier/go-toml/benchmark.yml create mode 100644 vendor/github.com/pelletier/go-toml/benchmark_test.go rename {_vendor/vendor => vendor}/github.com/pelletier/go-toml/doc.go (100%) create mode 100644 vendor/github.com/pelletier/go-toml/doc_test.go create mode 100644 vendor/github.com/pelletier/go-toml/example-crlf.toml create mode 100644 vendor/github.com/pelletier/go-toml/example.toml rename {_vendor/vendor => vendor}/github.com/pelletier/go-toml/keysparsing.go (100%) create mode 100644 vendor/github.com/pelletier/go-toml/keysparsing_test.go rename {_vendor/vendor => vendor}/github.com/pelletier/go-toml/lexer.go (90%) create mode 100644 vendor/github.com/pelletier/go-toml/lexer_test.go rename {_vendor/vendor => vendor}/github.com/pelletier/go-toml/marshal.go (98%) create mode 100644 vendor/github.com/pelletier/go-toml/marshal_test.go create mode 100644 vendor/github.com/pelletier/go-toml/marshal_test.toml rename {_vendor/vendor => vendor}/github.com/pelletier/go-toml/parser.go (95%) create mode 100644 vendor/github.com/pelletier/go-toml/parser_test.go rename {_vendor/vendor => vendor}/github.com/pelletier/go-toml/position.go (100%) create mode 100644 vendor/github.com/pelletier/go-toml/position_test.go create mode 100755 vendor/github.com/pelletier/go-toml/test.sh rename {_vendor/vendor => vendor}/github.com/pelletier/go-toml/token.go (100%) create mode 100644 vendor/github.com/pelletier/go-toml/token_test.go rename {_vendor/vendor => vendor}/github.com/pelletier/go-toml/toml.go (95%) create mode 100644 vendor/github.com/pelletier/go-toml/toml_test.go rename {_vendor/vendor => vendor}/github.com/pelletier/go-toml/tomltree_create.go (100%) create mode 100644 vendor/github.com/pelletier/go-toml/tomltree_create_test.go rename {_vendor/vendor => vendor}/github.com/pelletier/go-toml/tomltree_write.go (92%) create mode 100644 vendor/github.com/pelletier/go-toml/tomltree_write_test.go rename {_vendor/vendor => vendor}/github.com/peterh/liner/COPYING (100%) create mode 100644 vendor/github.com/peterh/liner/README.md rename {_vendor/vendor => vendor}/github.com/peterh/liner/bsdinput.go (100%) rename {_vendor/vendor => vendor}/github.com/peterh/liner/common.go (96%) rename {_vendor/vendor => vendor}/github.com/peterh/liner/fallbackinput.go (100%) rename {_vendor/vendor => vendor}/github.com/peterh/liner/input.go (98%) rename {_vendor/vendor => vendor}/github.com/peterh/liner/input_darwin.go (100%) rename {_vendor/vendor => vendor}/github.com/peterh/liner/input_linux.go (100%) create mode 100644 vendor/github.com/peterh/liner/input_test.go rename {_vendor/vendor => vendor}/github.com/peterh/liner/input_windows.go (97%) rename {_vendor/vendor => vendor}/github.com/peterh/liner/line.go (90%) create mode 100644 vendor/github.com/peterh/liner/line_test.go rename {_vendor/vendor => vendor}/github.com/peterh/liner/output.go (100%) rename {_vendor/vendor => vendor}/github.com/peterh/liner/output_windows.go (100%) create mode 100644 vendor/github.com/peterh/liner/prefix_test.go create mode 100644 vendor/github.com/peterh/liner/race_test.go rename {_vendor/vendor => vendor}/github.com/peterh/liner/unixmode.go (100%) rename {_vendor/vendor => vendor}/github.com/peterh/liner/width.go (100%) create mode 100644 vendor/github.com/peterh/liner/width_test.go rename {_vendor/vendor => vendor}/github.com/siddontang/go/LICENSE (100%) create mode 100644 vendor/github.com/siddontang/go/README.md rename {_vendor/vendor => vendor}/github.com/siddontang/go/bson/LICENSE (100%) rename {_vendor/vendor => vendor}/github.com/siddontang/go/bson/bson.go (100%) create mode 100644 vendor/github.com/siddontang/go/bson/bson_test.go rename {_vendor/vendor => vendor}/github.com/siddontang/go/bson/decode.go (100%) rename {_vendor/vendor => vendor}/github.com/siddontang/go/bson/encode.go (100%) rename {_vendor/vendor => vendor}/github.com/siddontang/go/filelock/LICENSE (100%) rename {_vendor/vendor => vendor}/github.com/siddontang/go/filelock/file_lock_generic.go (100%) rename {_vendor/vendor => vendor}/github.com/siddontang/go/filelock/file_lock_solaris.go (100%) create mode 100644 vendor/github.com/siddontang/go/filelock/file_lock_test.go rename {_vendor/vendor => vendor}/github.com/siddontang/go/filelock/file_lock_unix.go (100%) rename {_vendor/vendor => vendor}/github.com/siddontang/go/filelock/file_lock_windows.go (100%) rename {_vendor/vendor => vendor}/github.com/siddontang/go/hack/hack.go (100%) create mode 100644 vendor/github.com/siddontang/go/hack/hack_test.go rename {_vendor/vendor => vendor}/github.com/siddontang/go/ioutil2/ioutil.go (93%) rename {_vendor/vendor => vendor}/github.com/siddontang/go/ioutil2/sectionwriter.go (100%) create mode 100644 vendor/github.com/siddontang/go/ioutil2/sectionwriter_test.go rename {_vendor/vendor => vendor}/github.com/siddontang/go/log/doc.go (100%) rename {_vendor/vendor => vendor}/github.com/siddontang/go/log/filehandler.go (100%) rename {_vendor/vendor => vendor}/github.com/siddontang/go/log/handler.go (100%) rename {_vendor/vendor => vendor}/github.com/siddontang/go/log/log.go (100%) create mode 100644 vendor/github.com/siddontang/go/log/log_test.go rename {_vendor/vendor => vendor}/github.com/siddontang/go/log/sockethandler.go (100%) rename {_vendor/vendor => vendor}/github.com/siddontang/go/num/bytes.go (100%) rename {_vendor/vendor => vendor}/github.com/siddontang/go/num/cmp.go (100%) create mode 100644 vendor/github.com/siddontang/go/num/num_test.go rename {_vendor/vendor => vendor}/github.com/siddontang/go/num/str.go (100%) rename {_vendor/vendor => vendor}/github.com/siddontang/go/snappy/LICENSE (100%) rename {_vendor/vendor => vendor}/github.com/siddontang/go/snappy/decode.go (100%) rename {_vendor/vendor => vendor}/github.com/siddontang/go/snappy/encode.go (100%) rename {_vendor/vendor => vendor}/github.com/siddontang/go/snappy/snappy.go (100%) create mode 100644 vendor/github.com/siddontang/go/snappy/snappy_test.go rename {_vendor/vendor => vendor}/github.com/siddontang/go/sync2/atomic.go (99%) create mode 100644 vendor/github.com/siddontang/go/sync2/atomic_test.go rename {_vendor/vendor => vendor}/github.com/siddontang/go/sync2/semaphore.go (100%) create mode 100644 vendor/github.com/siddontang/go/sync2/semaphore_test.go create mode 100644 vendor/github.com/siddontang/go/vitess_license rename {_vendor/vendor => vendor}/github.com/siddontang/goredis/LICENSE (100%) rename {_vendor/vendor => vendor}/github.com/siddontang/goredis/client.go (100%) rename {_vendor/vendor => vendor}/github.com/siddontang/goredis/conn.go (100%) rename {_vendor/vendor => vendor}/github.com/siddontang/goredis/doc.go (100%) create mode 100644 vendor/github.com/siddontang/goredis/garyburd_license create mode 100644 vendor/github.com/siddontang/goredis/goredis_test.go rename {_vendor/vendor => vendor}/github.com/siddontang/goredis/reply.go (100%) rename {_vendor/vendor => vendor}/github.com/siddontang/goredis/resp.go (100%) create mode 100644 vendor/github.com/siddontang/goredis/resp_test.go rename {_vendor/vendor => vendor}/github.com/siddontang/rdb/LICENSE (100%) create mode 100644 vendor/github.com/siddontang/rdb/README.md rename {_vendor/vendor => vendor}/github.com/siddontang/rdb/decode.go (100%) rename {_vendor/vendor => vendor}/github.com/siddontang/rdb/digest.go (100%) rename {_vendor/vendor => vendor}/github.com/siddontang/rdb/encode.go (100%) rename {_vendor/vendor => vendor}/github.com/siddontang/rdb/loader.go (100%) create mode 100644 vendor/github.com/siddontang/rdb/loader_test.go create mode 100644 vendor/github.com/siddontang/rdb/rdb_test.go rename {_vendor/vendor => vendor}/github.com/siddontang/rdb/reader.go (100%) create mode 100644 vendor/github.com/siddontang/rdb/wandoujia-license create mode 100644 vendor/github.com/syndtr/goleveldb/.travis.yml rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/LICENSE (100%) create mode 100644 vendor/github.com/syndtr/goleveldb/README.md rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/batch.go (100%) create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/batch_test.go create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/bench_test.go create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/cache/bench_test.go rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/cache/cache.go (100%) create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/cache/cache_test.go rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/cache/lru.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/comparer.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/comparer/bytes_comparer.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/comparer/comparer.go (100%) create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/corrupt_test.go rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/db.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/db_compaction.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/db_iter.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/db_snapshot.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/db_state.go (100%) create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/db_test.go rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/db_transaction.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/db_util.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/db_write.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/doc.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/errors.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/errors/errors.go (100%) create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/external_test.go rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/filter.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/filter/bloom.go (100%) create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/filter/bloom_test.go rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/filter/filter.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/iterator/array_iter.go (100%) create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/iterator/array_iter_test.go rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/iterator/indexed_iter.go (100%) create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/iterator/indexed_iter_test.go rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/iterator/iter.go (100%) create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/iterator/iter_suite_test.go rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/iterator/merged_iter.go (100%) create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/iterator/merged_iter_test.go rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/journal/journal.go (100%) create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/journal/journal_test.go rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/key.go (100%) create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/key_test.go create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/leveldb_suite_test.go create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/memdb/bench_test.go rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/memdb/memdb.go (100%) create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/memdb/memdb_suite_test.go create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/memdb/memdb_test.go rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/opt/options.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/options.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/session.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/session_compaction.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/session_record.go (100%) create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/session_record_test.go rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/session_util.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/storage/file_storage.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/storage/file_storage_plan9.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/storage/file_storage_solaris.go (100%) create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_test.go rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/storage/file_storage_unix.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/storage/file_storage_windows.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/storage/mem_storage.go (100%) create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/storage/mem_storage_test.go rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/storage/storage.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/table.go (100%) create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/table/block_test.go rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/table/reader.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/table/table.go (100%) create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/table/table_suite_test.go create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/table/table_test.go rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/table/writer.go (100%) create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/testutil_test.go rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/util.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/util/buffer.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/util/buffer_pool.go (100%) create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/util/buffer_test.go rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/util/crc32.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/util/hash.go (100%) create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/util/hash_test.go rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/util/range.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/util/util.go (100%) rename {_vendor/vendor => vendor}/github.com/syndtr/goleveldb/leveldb/version.go (100%) create mode 100644 vendor/github.com/syndtr/goleveldb/leveldb/version_test.go create mode 100644 vendor/github.com/ugorji/go/.travis.yml rename {_vendor/vendor => vendor}/github.com/ugorji/go/LICENSE (100%) create mode 100644 vendor/github.com/ugorji/go/README.md rename {_vendor/vendor => vendor}/github.com/ugorji/go/codec/0doc.go (65%) create mode 100644 vendor/github.com/ugorji/go/codec/README.md rename {_vendor/vendor => vendor}/github.com/ugorji/go/codec/binc.go (86%) rename {_vendor/vendor => vendor}/github.com/ugorji/go/codec/cbor.go (71%) create mode 100644 vendor/github.com/ugorji/go/codec/cbor_test.go create mode 100644 vendor/github.com/ugorji/go/codec/codec_test.go create mode 100644 vendor/github.com/ugorji/go/codec/decode.go create mode 100644 vendor/github.com/ugorji/go/codec/encode.go create mode 100644 vendor/github.com/ugorji/go/codec/fast-path.generated.go create mode 100644 vendor/github.com/ugorji/go/codec/fast-path.go.tmpl rename {_vendor/vendor => vendor}/github.com/ugorji/go/codec/fast-path.not.go (67%) create mode 100644 vendor/github.com/ugorji/go/codec/gen-dec-array.go.tmpl create mode 100644 vendor/github.com/ugorji/go/codec/gen-dec-map.go.tmpl rename {_vendor/vendor => vendor}/github.com/ugorji/go/codec/gen-helper.generated.go (62%) create mode 100644 vendor/github.com/ugorji/go/codec/gen-helper.go.tmpl create mode 100644 vendor/github.com/ugorji/go/codec/gen.generated.go rename {_vendor/vendor => vendor}/github.com/ugorji/go/codec/gen.go (78%) create mode 100644 vendor/github.com/ugorji/go/codec/goversion_arrayof_gte_go15.go create mode 100644 vendor/github.com/ugorji/go/codec/goversion_arrayof_lt_go15.go create mode 100644 vendor/github.com/ugorji/go/codec/goversion_makemap_gte_go19.go create mode 100644 vendor/github.com/ugorji/go/codec/goversion_makemap_lt_go19.go create mode 100644 vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_gte_go110.go create mode 100644 vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_lt_go110.go create mode 100644 vendor/github.com/ugorji/go/codec/goversion_unsupported_lt_go14.go rename _vendor/vendor/github.com/ugorji/go/codec/gen_15.go => vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go15.go (72%) rename _vendor/vendor/github.com/ugorji/go/codec/gen_16.go => vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go16.go (65%) create mode 100644 vendor/github.com/ugorji/go/codec/goversion_vendor_gte_go17.go create mode 100644 vendor/github.com/ugorji/go/codec/goversion_vendor_lt_go15.go rename {_vendor/vendor => vendor}/github.com/ugorji/go/codec/helper.go (50%) rename {_vendor/vendor => vendor}/github.com/ugorji/go/codec/helper_internal.go (72%) create mode 100644 vendor/github.com/ugorji/go/codec/helper_not_unsafe.go create mode 100644 vendor/github.com/ugorji/go/codec/helper_test.go create mode 100644 vendor/github.com/ugorji/go/codec/helper_unsafe.go create mode 100644 vendor/github.com/ugorji/go/codec/json.go create mode 100644 vendor/github.com/ugorji/go/codec/mammoth-test.go.tmpl create mode 100644 vendor/github.com/ugorji/go/codec/mammoth2-test.go.tmpl create mode 100644 vendor/github.com/ugorji/go/codec/mammoth2_codecgen_generated_test.go create mode 100644 vendor/github.com/ugorji/go/codec/mammoth2_generated_test.go create mode 100644 vendor/github.com/ugorji/go/codec/mammoth_generated_test.go rename {_vendor/vendor => vendor}/github.com/ugorji/go/codec/msgpack.go (77%) rename {_vendor/vendor => vendor}/github.com/ugorji/go/codec/noop.go (96%) create mode 100644 vendor/github.com/ugorji/go/codec/py_test.go create mode 100644 vendor/github.com/ugorji/go/codec/rpc.go create mode 100644 vendor/github.com/ugorji/go/codec/shared_test.go rename {_vendor/vendor => vendor}/github.com/ugorji/go/codec/simple.go (71%) create mode 100644 vendor/github.com/ugorji/go/codec/test-cbor-goldens.json create mode 100755 vendor/github.com/ugorji/go/codec/test.py rename {_vendor/vendor => vendor}/github.com/ugorji/go/codec/time.go (75%) create mode 100644 vendor/github.com/ugorji/go/codec/values_flex_test.go create mode 100644 vendor/github.com/ugorji/go/codec/values_test.go create mode 100644 vendor/github.com/ugorji/go/codec/xml.go create mode 100644 vendor/github.com/ugorji/go/codec/z_all_test.go create mode 100644 vendor/github.com/ugorji/go/msgpack.org.md create mode 100644 vendor/github.com/yuin/gopher-lua/.travis.yml rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/LICENSE (100%) create mode 100644 vendor/github.com/yuin/gopher-lua/Makefile create mode 100644 vendor/github.com/yuin/gopher-lua/README.rst rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/_state.go (99%) rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/_vm.go (100%) rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/alloc.go (100%) rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/ast/ast.go (100%) rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/ast/expr.go (100%) rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/ast/misc.go (100%) rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/ast/stmt.go (100%) rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/ast/token.go (100%) rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/auxlib.go (100%) create mode 100644 vendor/github.com/yuin/gopher-lua/auxlib_test.go rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/baselib.go (98%) rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/channellib.go (100%) create mode 100644 vendor/github.com/yuin/gopher-lua/channellib_test.go rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/compile.go (100%) rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/config.go (100%) rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/coroutinelib.go (100%) rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/debuglib.go (100%) rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/function.go (100%) rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/iolib.go (100%) rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/linit.go (100%) rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/loadlib.go (100%) rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/mathlib.go (100%) rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/opcode.go (100%) rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/oslib.go (98%) rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/package.go (100%) create mode 100644 vendor/github.com/yuin/gopher-lua/parse/Makefile rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/parse/lexer.go (97%) rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/parse/parser.go (100%) create mode 100644 vendor/github.com/yuin/gopher-lua/parse/parser.go.y rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/pm/pm.go (100%) create mode 100644 vendor/github.com/yuin/gopher-lua/script_test.go rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/state.go (99%) create mode 100644 vendor/github.com/yuin/gopher-lua/state_test.go rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/stringlib.go (100%) rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/table.go (91%) create mode 100644 vendor/github.com/yuin/gopher-lua/table_test.go rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/tablelib.go (100%) create mode 100644 vendor/github.com/yuin/gopher-lua/testutils_test.go rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/utils.go (100%) rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/value.go (99%) rename {_vendor/vendor => vendor}/github.com/yuin/gopher-lua/vm.go (100%) create mode 100644 vendor/golang.org/x/net/.gitattributes create mode 100644 vendor/golang.org/x/net/.gitignore create mode 100644 vendor/golang.org/x/net/AUTHORS create mode 100644 vendor/golang.org/x/net/CONTRIBUTING.md create mode 100644 vendor/golang.org/x/net/CONTRIBUTORS rename {_vendor/vendor => vendor}/golang.org/x/net/LICENSE (100%) rename {_vendor/vendor => vendor}/golang.org/x/net/PATENTS (100%) create mode 100644 vendor/golang.org/x/net/README.md create mode 100644 vendor/golang.org/x/net/codereview.cfg rename {_vendor/vendor => vendor}/golang.org/x/net/context/context.go (94%) create mode 100644 vendor/golang.org/x/net/context/context_test.go rename {_vendor/vendor => vendor}/golang.org/x/net/context/go17.go (100%) rename {_vendor/vendor => vendor}/golang.org/x/net/context/go19.go (100%) rename {_vendor/vendor => vendor}/golang.org/x/net/context/pre_go17.go (100%) rename {_vendor/vendor => vendor}/golang.org/x/net/context/pre_go19.go (100%) create mode 100644 vendor/golang.org/x/net/context/withtimeout_test.go diff --git a/.travis.yml b/.travis.yml index e82e576..156c1dd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: go -go: - - 1.6 - - 1.7 +go: + - 1.8 + - 1.9 script: - make test diff --git a/Gopkg.lock b/Gopkg.lock new file mode 100644 index 0000000..d8be274 --- /dev/null +++ b/Gopkg.lock @@ -0,0 +1,86 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + branch = "master" + name = "github.com/cupcake/rdb" + packages = [".","crc64","nopdecoder"] + revision = "43ba34106c765f2111c0dc7b74cdf8ee437411e0" + +[[projects]] + branch = "master" + name = "github.com/edsrzf/mmap-go" + packages = ["."] + revision = "0bce6a6887123b67a60366d2c9fe2dfb74289d2e" + +[[projects]] + name = "github.com/glendc/gopher-json" + packages = ["."] + revision = "dc4743023d0c166c1b844da8fc688e57ec65fe0b" + version = "0.1.0" + +[[projects]] + branch = "master" + name = "github.com/golang/snappy" + packages = ["."] + revision = "553a641470496b2327abcac10b36396bd98e45c9" + +[[projects]] + name = "github.com/pelletier/go-toml" + packages = ["."] + revision = "16398bac157da96aa88f98a2df640c7f32af1da2" + version = "v1.0.1" + +[[projects]] + branch = "master" + name = "github.com/peterh/liner" + packages = ["."] + revision = "3681c2a912330352991ecdd642f257efe5b85518" + +[[projects]] + branch = "master" + name = "github.com/siddontang/go" + packages = ["bson","filelock","hack","ioutil2","log","num","snappy","sync2"] + revision = "cb568a3e5cc06256f91a2da5a87455f717eb33f4" + +[[projects]] + branch = "master" + name = "github.com/siddontang/goredis" + packages = ["."] + revision = "760763f78400635ed7b9b115511b8ed06035e908" + +[[projects]] + branch = "master" + name = "github.com/siddontang/rdb" + packages = ["."] + revision = "fc89ed2e418d27e3ea76e708e54276d2b44ae9cf" + +[[projects]] + name = "github.com/syndtr/goleveldb" + packages = ["leveldb","leveldb/cache","leveldb/comparer","leveldb/errors","leveldb/filter","leveldb/iterator","leveldb/journal","leveldb/memdb","leveldb/opt","leveldb/storage","leveldb/table","leveldb/util"] + revision = "cfa635847112c5dc4782e128fa7e0d05fdbfb394" + +[[projects]] + branch = "master" + name = "github.com/ugorji/go" + packages = ["codec"] + revision = "84cb69a8af8316eed8cf4a3c9368a56977850062" + +[[projects]] + branch = "master" + name = "github.com/yuin/gopher-lua" + packages = [".","ast","parse","pm"] + revision = "609c9cd2697344dec90fe0543c6493e3b8da3435" + +[[projects]] + branch = "master" + name = "golang.org/x/net" + packages = ["context"] + revision = "fb018015d54fd2e3bfd5362a041991d350fde9d7" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "f11307c5e37b6809e5ced4d0ed85e2c52d7d6ee04c098c3644518596b62c7280" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml new file mode 100644 index 0000000..4009bf9 --- /dev/null +++ b/Gopkg.toml @@ -0,0 +1,56 @@ + +# Gopkg.toml example +# +# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md +# for detailed Gopkg.toml documentation. +# +# required = ["github.com/user/thing/cmd/thing"] +# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] +# +# [[constraint]] +# name = "github.com/user/project" +# version = "1.0.0" +# +# [[constraint]] +# name = "github.com/user/project2" +# branch = "dev" +# source = "github.com/myfork/project2" +# +# [[override]] +# name = "github.com/x/y" +# version = "2.4.0" + + +[[constraint]] + name = "github.com/edsrzf/mmap-go" + +[[constraint]] + name = "github.com/glendc/gopher-json" + +[[constraint]] + name = "github.com/pelletier/go-toml" + +[[constraint]] + name = "github.com/peterh/liner" + +[[constraint]] + name = "github.com/siddontang/go" + +[[constraint]] + name = "github.com/siddontang/goredis" + +[[constraint]] + name = "github.com/siddontang/rdb" + +[[constraint]] + name = "github.com/syndtr/goleveldb" + revision = "cfa635847112c5dc4782e128fa7e0d05fdbfb394" + +[[constraint]] + name = "github.com/ugorji/go" + +[[constraint]] + name = "github.com/yuin/gopher-lua" + +[[constraint]] + name = "golang.org/x/net" diff --git a/Makefile b/Makefile index c188110..705a011 100644 --- a/Makefile +++ b/Makefile @@ -14,38 +14,27 @@ export GO_BUILD_TAGS all: build build: - rm -rf vendor && ln -s _vendor/vendor vendor go build -o bin/ledis-server -tags '$(GO_BUILD_TAGS)' cmd/ledis-server/* go build -o bin/ledis-cli -tags '$(GO_BUILD_TAGS)' cmd/ledis-cli/* go build -o bin/ledis-benchmark -tags '$(GO_BUILD_TAGS)' cmd/ledis-benchmark/* go build -o bin/ledis-dump -tags '$(GO_BUILD_TAGS)' cmd/ledis-dump/* go build -o bin/ledis-load -tags '$(GO_BUILD_TAGS)' cmd/ledis-load/* go build -o bin/ledis-repair -tags '$(GO_BUILD_TAGS)' cmd/ledis-repair/* - rm -rf vendor test: - rm -rf vendor && ln -s _vendor/vendor vendor - go test --race -tags '$(GO_BUILD_TAGS)' -timeout 2m ./... - rm -rf vendor + go test --race -tags '$(GO_BUILD_TAGS)' -timeout 2m $$(go list ./... | grep -v -e /vendor/) clean: go clean -i ./... fmt: - gofmt -w -s . 2>&1 | grep -vE 'vendor' | awk '{print} END{if(NR>0) {exit 1}}' + gofmt -w -s . 2>&1 | grep -vE 'vendor' | awk '{print} END{if(NR>0) {exit 1}}' + +sync_vendor: + @which dep >/dev/null || go get -u github.com/golang/dep/cmd/dep + dep ensure && dep prune update_vendor: - which glide >/dev/null || curl https://glide.sh/get | sh - which glide-vc || go get -v -u github.com/sgotti/glide-vc - rm -r vendor && mv _vendor/vendor vendor || true - rm -rf _vendor -ifdef PKG - glide get --strip-vendor --skip-test ${PKG} -else - glide update --strip-vendor --skip-test -endif - @echo "removing test files" - glide vc --only-code --no-tests - mkdir -p _vendor - mv vendor _vendor/vendor \ No newline at end of file + @which dep >/dev/null || go get -u github.com/golang/dep/cmd/dep + dep ensure -update && dep prune \ No newline at end of file diff --git a/_vendor/vendor/github.com/pelletier/go-buffruneio/buffruneio.go b/_vendor/vendor/github.com/pelletier/go-buffruneio/buffruneio.go deleted file mode 100644 index 4e6d6ea..0000000 --- a/_vendor/vendor/github.com/pelletier/go-buffruneio/buffruneio.go +++ /dev/null @@ -1,117 +0,0 @@ -// Package buffruneio is a wrapper around bufio to provide buffered runes access with unlimited unreads. -package buffruneio - -import ( - "bufio" - "container/list" - "errors" - "io" -) - -// Rune to indicate end of file. -const ( - EOF = -(iota + 1) -) - -// ErrNoRuneToUnread is returned by UnreadRune() when the read index is already at the beginning of the buffer. -var ErrNoRuneToUnread = errors.New("no rune to unwind") - -// Reader implements runes buffering for an io.Reader object. -type Reader struct { - buffer *list.List - current *list.Element - input *bufio.Reader -} - -// NewReader returns a new Reader. -func NewReader(rd io.Reader) *Reader { - return &Reader{ - buffer: list.New(), - input: bufio.NewReader(rd), - } -} - -type runeWithSize struct { - r rune - size int -} - -func (rd *Reader) feedBuffer() error { - r, size, err := rd.input.ReadRune() - - if err != nil { - if err != io.EOF { - return err - } - r = EOF - } - - newRuneWithSize := runeWithSize{r, size} - - rd.buffer.PushBack(newRuneWithSize) - if rd.current == nil { - rd.current = rd.buffer.Back() - } - return nil -} - -// ReadRune reads the next rune from buffer, or from the underlying reader if needed. -func (rd *Reader) ReadRune() (rune, int, error) { - if rd.current == rd.buffer.Back() || rd.current == nil { - err := rd.feedBuffer() - if err != nil { - return EOF, 0, err - } - } - - runeWithSize := rd.current.Value.(runeWithSize) - rd.current = rd.current.Next() - return runeWithSize.r, runeWithSize.size, nil -} - -// UnreadRune pushes back the previously read rune in the buffer, extending it if needed. -func (rd *Reader) UnreadRune() error { - if rd.current == rd.buffer.Front() { - return ErrNoRuneToUnread - } - if rd.current == nil { - rd.current = rd.buffer.Back() - } else { - rd.current = rd.current.Prev() - } - return nil -} - -// Forget removes runes stored before the current stream position index. -func (rd *Reader) Forget() { - if rd.current == nil { - rd.current = rd.buffer.Back() - } - for ; rd.current != rd.buffer.Front(); rd.buffer.Remove(rd.current.Prev()) { - } -} - -// PeekRune returns at most the next n runes, reading from the uderlying source if -// needed. Does not move the current index. It includes EOF if reached. -func (rd *Reader) PeekRunes(n int) []rune { - res := make([]rune, 0, n) - cursor := rd.current - for i := 0; i < n; i++ { - if cursor == nil { - err := rd.feedBuffer() - if err != nil { - return res - } - cursor = rd.buffer.Back() - } - if cursor != nil { - r := cursor.Value.(runeWithSize).r - res = append(res, r) - if r == EOF { - return res - } - cursor = cursor.Next() - } - } - return res -} diff --git a/_vendor/vendor/github.com/ugorji/go/codec/decode.go b/_vendor/vendor/github.com/ugorji/go/codec/decode.go deleted file mode 100644 index b87ea63..0000000 --- a/_vendor/vendor/github.com/ugorji/go/codec/decode.go +++ /dev/null @@ -1,2019 +0,0 @@ -// 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 - -import ( - "encoding" - "errors" - "fmt" - "io" - "reflect" - "time" -) - -// Some tagging information for error messages. -const ( - msgBadDesc = "Unrecognized descriptor byte" - msgDecCannotExpandArr = "cannot expand go array from %v to stream length: %v" -) - -var ( - onlyMapOrArrayCanDecodeIntoStructErr = errors.New("only encoded map or array can be decoded into a struct") - cannotDecodeIntoNilErr = errors.New("cannot decode into nil") -) - -// decReader abstracts the reading source, allowing implementations that can -// read from an io.Reader or directly off a byte slice with zero-copying. -type decReader interface { - 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 - readn1eof() (v uint8, eof bool) - numread() int // number of bytes read - track() - stopTrack() []byte -} - -type decReaderByteScanner interface { - io.Reader - io.ByteScanner -} - -type decDriver interface { - // this will check if the next token is a break. - CheckBreak() bool - TryDecodeAsNil() bool - // vt is one of: Bytes, String, Nil, Slice or Map. Return unSet if not known. - ContainerType() (vt valueType) - IsBuiltinType(rt uintptr) bool - DecodeBuiltin(rt uintptr, v interface{}) - - // 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() - DecodeInt(bitsize uint8) (i int64) - DecodeUint(bitsize uint8) (ui uint64) - DecodeFloat(chkOverflow32 bool) (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) - - // DecodeBytes may be called directly, without going through reflection. - // Consequently, it must be designed to handle possible nil. - 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) - ReadMapStart() int - ReadArrayStart() int - - reset() - uncacheRead() -} - -type decNoSeparator struct{} - -func (_ decNoSeparator) ReadEnd() {} -func (_ decNoSeparator) uncacheRead() {} - -type DecodeOptions struct { - // MapType specifies type to use during schema-less decoding of a map in the stream. - // If nil, we use map[interface{}]interface{} - MapType reflect.Type - - // SliceType specifies type to use during schema-less decoding of an array in the stream. - // If nil, we use []interface{} - SliceType reflect.Type - - // MaxInitLen defines the initial length that we "make" a collection (slice, chan or map) with. - // If 0 or negative, we default to a sensible value based on the size of an element in the collection. - // - // For example, when decoding, a stream may say that it has MAX_UINT elements. - // We should not auto-matically provision a slice of that length, to prevent Out-Of-Memory crash. - // Instead, we provision up to MaxInitLen, fill that up, and start appending after that. - MaxInitLen int - - // If ErrorIfNoField, return an error when decoding a map - // from a codec stream into a struct, and no matching struct field is found. - ErrorIfNoField bool - - // 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 - - // InterfaceReset controls how we decode into an interface. - // - // By default, when we see a field that is an interface{...}, - // or a map with interface{...} value, we will attempt decoding into the - // "contained" value. - // - // However, this prevents us from reading a string into an interface{} - // that formerly contained a number. - // - // If true, we will decode into a new "blank" value, and set that in the interface. - // If false, we will decode into whatever is contained in the interface. - InterfaceReset bool - - // InternString controls interning of strings during decoding. - // - // Some handles, e.g. json, typically will read map keys as strings. - // If the set of keys are finite, it may help reduce allocation to - // look them up from a map (than to allocate them afresh). - // - // Note: Handles will be smart when using the intern functionality. - // So everything will not be interned. - InternString bool -} - -// ------------------------------------ - -// ioDecByteScanner implements Read(), ReadByte(...), UnreadByte(...) methods -// of io.Reader, io.ByteScanner. -type ioDecByteScanner struct { - r io.Reader - l byte // last byte - ls byte // last byte status. 0: init-canDoNothing, 1: canRead, 2: canUnread - b [1]byte // tiny buffer for reading single bytes -} - -func (z *ioDecByteScanner) Read(p []byte) (n int, err error) { - var firstByte bool - if z.ls == 1 { - z.ls = 2 - 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 = 2 - } - if firstByte { - n++ - } - return -} - -func (z *ioDecByteScanner) ReadByte() (c byte, err error) { - n, err := z.Read(z.b[:]) - 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 *ioDecByteScanner) UnreadByte() (err error) { - x := z.ls - if x == 0 { - err = errors.New("cannot unread - nothing has been read") - } else if x == 1 { - err = errors.New("cannot unread - last byte has not been read") - } else if x == 2 { - z.ls = 1 - } - return -} - -// ioDecReader is a decReader that reads off an io.Reader -type ioDecReader struct { - br decReaderByteScanner - // temp byte array re-used internally for efficiency during read. - // shares buffer with Decoder, so we keep size of struct within 8 words. - x *[scratchByteArrayLen]byte - bs ioDecByteScanner - n int // num read - tr []byte // tracking bytes read - trb bool -} - -func (z *ioDecReader) numread() int { - return z.n -} - -func (z *ioDecReader) readx(n int) (bs []byte) { - if n <= 0 { - return - } - if n < len(z.x) { - bs = z.x[:n] - } else { - bs = make([]byte, n) - } - if _, err := io.ReadAtLeast(z.br, bs, n); err != nil { - panic(err) - } - z.n += len(bs) - if z.trb { - z.tr = append(z.tr, bs...) - } - return -} - -func (z *ioDecReader) readb(bs []byte) { - if len(bs) == 0 { - return - } - n, err := io.ReadAtLeast(z.br, bs, len(bs)) - z.n += n - if err != nil { - panic(err) - } - if z.trb { - z.tr = append(z.tr, bs...) - } -} - -func (z *ioDecReader) readn1() (b uint8) { - b, err := z.br.ReadByte() - if err != nil { - panic(err) - } - z.n++ - if z.trb { - z.tr = append(z.tr, b) - } - return b -} - -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) - } - } else if err == io.EOF { - eof = true - } else { - panic(err) - } - return -} - -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] - } - } -} - -func (z *ioDecReader) track() { - if z.tr != nil { - z.tr = z.tr[:0] - } - z.trb = true -} - -func (z *ioDecReader) stopTrack() (bs []byte) { - z.trb = false - return z.tr -} - -// ------------------------------------ - -var bytesDecReaderCannotUnreadErr = 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 int // cursor - a int // available - t int // track start -} - -func (z *bytesDecReader) reset(in []byte) { - z.b = in - z.a = len(in) - z.c = 0 - z.t = 0 -} - -func (z *bytesDecReader) numread() int { - return z.c -} - -func (z *bytesDecReader) unreadn1() { - if z.c == 0 || len(z.b) == 0 { - panic(bytesDecReaderCannotUnreadErr) - } - z.c-- - z.a++ - return -} - -func (z *bytesDecReader) readx(n int) (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 -} - -func (z *bytesDecReader) readn1() (v uint8) { - if z.a == 0 { - panic(io.EOF) - } - v = z.b[z.c] - z.c++ - z.a-- - return -} - -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) readb(bs []byte) { - copy(bs, z.readx(len(bs))) -} - -func (z *bytesDecReader) track() { - z.t = z.c -} - -func (z *bytesDecReader) stopTrack() (bs []byte) { - return z.b[z.t:z.c] -} - -// ------------------------------------ - -type decFnInfo struct { - d *Decoder - ti *typeInfo - xfFn Ext - xfTag uint64 - seq seqType -} - -// ---------------------------------------- - -type decFn struct { - i decFnInfo - f func(*decFnInfo, reflect.Value) -} - -func (f *decFnInfo) builtin(rv reflect.Value) { - f.d.d.DecodeBuiltin(f.ti.rtid, rv.Addr().Interface()) -} - -func (f *decFnInfo) rawExt(rv reflect.Value) { - f.d.d.DecodeExt(rv.Addr().Interface(), 0, nil) -} - -func (f *decFnInfo) ext(rv reflect.Value) { - f.d.d.DecodeExt(rv.Addr().Interface(), f.xfTag, f.xfFn) -} - -func (f *decFnInfo) getValueForUnmarshalInterface(rv reflect.Value, indir int8) (v interface{}) { - if indir == -1 { - v = rv.Addr().Interface() - } else if indir == 0 { - v = rv.Interface() - } else { - for j := int8(0); j < indir; j++ { - if rv.IsNil() { - rv.Set(reflect.New(rv.Type().Elem())) - } - rv = rv.Elem() - } - v = rv.Interface() - } - return -} - -func (f *decFnInfo) selferUnmarshal(rv reflect.Value) { - f.getValueForUnmarshalInterface(rv, f.ti.csIndir).(Selfer).CodecDecodeSelf(f.d) -} - -func (f *decFnInfo) binaryUnmarshal(rv reflect.Value) { - bm := f.getValueForUnmarshalInterface(rv, f.ti.bunmIndir).(encoding.BinaryUnmarshaler) - xbs := f.d.d.DecodeBytes(nil, false, true) - if fnerr := bm.UnmarshalBinary(xbs); fnerr != nil { - panic(fnerr) - } -} - -func (f *decFnInfo) textUnmarshal(rv reflect.Value) { - tm := f.getValueForUnmarshalInterface(rv, f.ti.tunmIndir).(encoding.TextUnmarshaler) - fnerr := tm.UnmarshalText(f.d.d.DecodeBytes(f.d.b[:], true, true)) - if fnerr != nil { - panic(fnerr) - } -} - -func (f *decFnInfo) jsonUnmarshal(rv reflect.Value) { - tm := f.getValueForUnmarshalInterface(rv, f.ti.junmIndir).(jsonUnmarshaler) - // bs := f.d.d.DecodeBytes(f.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(f.d.nextValueBytes()) - if fnerr != nil { - panic(fnerr) - } -} - -func (f *decFnInfo) kErr(rv reflect.Value) { - f.d.errorf("no decoding function defined for kind %v", rv.Kind()) -} - -func (f *decFnInfo) kString(rv reflect.Value) { - rv.SetString(f.d.d.DecodeString()) -} - -func (f *decFnInfo) kBool(rv reflect.Value) { - rv.SetBool(f.d.d.DecodeBool()) -} - -func (f *decFnInfo) kInt(rv reflect.Value) { - rv.SetInt(f.d.d.DecodeInt(intBitsize)) -} - -func (f *decFnInfo) kInt64(rv reflect.Value) { - rv.SetInt(f.d.d.DecodeInt(64)) -} - -func (f *decFnInfo) kInt32(rv reflect.Value) { - rv.SetInt(f.d.d.DecodeInt(32)) -} - -func (f *decFnInfo) kInt8(rv reflect.Value) { - rv.SetInt(f.d.d.DecodeInt(8)) -} - -func (f *decFnInfo) kInt16(rv reflect.Value) { - rv.SetInt(f.d.d.DecodeInt(16)) -} - -func (f *decFnInfo) kFloat32(rv reflect.Value) { - rv.SetFloat(f.d.d.DecodeFloat(true)) -} - -func (f *decFnInfo) kFloat64(rv reflect.Value) { - rv.SetFloat(f.d.d.DecodeFloat(false)) -} - -func (f *decFnInfo) kUint8(rv reflect.Value) { - rv.SetUint(f.d.d.DecodeUint(8)) -} - -func (f *decFnInfo) kUint64(rv reflect.Value) { - rv.SetUint(f.d.d.DecodeUint(64)) -} - -func (f *decFnInfo) kUint(rv reflect.Value) { - rv.SetUint(f.d.d.DecodeUint(uintBitsize)) -} - -func (f *decFnInfo) kUintptr(rv reflect.Value) { - rv.SetUint(f.d.d.DecodeUint(uintBitsize)) -} - -func (f *decFnInfo) kUint32(rv reflect.Value) { - rv.SetUint(f.d.d.DecodeUint(32)) -} - -func (f *decFnInfo) kUint16(rv reflect.Value) { - rv.SetUint(f.d.d.DecodeUint(16)) -} - -// 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()) -// } - -// var kIntfCtr uint64 - -func (f *decFnInfo) kInterfaceNaked() (rvn reflect.Value) { - // nil interface: - // use some hieristics to decode it appropriately - // based on the detected next value in the stream. - d := f.d - d.d.DecodeNaked() - n := &d.n - if n.v == valueTypeNil { - return - } - // We cannot decode non-nil stream value into nil interface with methods (e.g. io.Reader). - // if num := f.ti.rt.NumMethod(); num > 0 { - 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 useRvn bool - switch n.v { - case valueTypeMap: - // if d.h.MapType == nil || d.h.MapType == mapIntfIntfTyp { - // } else if d.h.MapType == mapStrIntfTyp { // for json performance - // } - if d.mtid == 0 || d.mtid == mapIntfIntfTypId { - l := len(n.ms) - n.ms = append(n.ms, nil) - var v2 interface{} = &n.ms[l] - d.decode(v2) - rvn = reflect.ValueOf(v2).Elem() - n.ms = n.ms[:l] - } else if d.mtid == mapStrIntfTypId { // for json performance - l := len(n.ns) - n.ns = append(n.ns, nil) - var v2 interface{} = &n.ns[l] - d.decode(v2) - rvn = reflect.ValueOf(v2).Elem() - n.ns = n.ns[:l] - } else { - rvn = reflect.New(d.h.MapType).Elem() - d.decodeValue(rvn, nil) - } - case valueTypeArray: - // if d.h.SliceType == nil || d.h.SliceType == intfSliceTyp { - if d.stid == 0 || d.stid == intfSliceTypId { - l := len(n.ss) - n.ss = append(n.ss, nil) - var v2 interface{} = &n.ss[l] - d.decode(v2) - rvn = reflect.ValueOf(v2).Elem() - n.ss = n.ss[:l] - } else { - rvn = reflect.New(d.h.SliceType).Elem() - d.decodeValue(rvn, nil) - } - case valueTypeExt: - var v interface{} - tag, bytes := n.u, n.l // calling decode below might taint the values - if bytes == nil { - l := len(n.is) - n.is = append(n.is, nil) - v2 := &n.is[l] - d.decode(v2) - v = *v2 - n.is = n.is[:l] - } - bfn := d.h.getExtForTag(tag) - if bfn == nil { - var re RawExt - re.Tag = tag - re.Data = detachZeroCopyBytes(d.bytes, nil, bytes) - rvn = reflect.ValueOf(re) - } else { - rvnA := reflect.New(bfn.rt) - rvn = rvnA.Elem() - if bytes != nil { - bfn.ext.ReadExt(rvnA.Interface(), bytes) - } else { - bfn.ext.UpdateExt(rvnA.Interface(), v) - } - } - case valueTypeNil: - // no-op - case valueTypeInt: - rvn = reflect.ValueOf(&n.i).Elem() - case valueTypeUint: - rvn = reflect.ValueOf(&n.u).Elem() - case valueTypeFloat: - rvn = reflect.ValueOf(&n.f).Elem() - case valueTypeBool: - rvn = reflect.ValueOf(&n.b).Elem() - case valueTypeString, valueTypeSymbol: - rvn = reflect.ValueOf(&n.s).Elem() - case valueTypeBytes: - rvn = reflect.ValueOf(&n.l).Elem() - case valueTypeTimestamp: - rvn = reflect.ValueOf(&n.t).Elem() - default: - panic(fmt.Errorf("kInterfaceNaked: unexpected valueType: %d", n.v)) - } - return -} - -func (f *decFnInfo) kInterface(rv reflect.Value) { - // debugf("\t===> kInterface") - - // 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). - - var rvn reflect.Value - if rv.IsNil() { - rvn = f.kInterfaceNaked() - if rvn.IsValid() { - rv.Set(rvn) - } - } else if f.d.h.InterfaceReset { - rvn = f.kInterfaceNaked() - if rvn.IsValid() { - rv.Set(rvn) - } else { - // reset to zero value based on current type in there. - rv.Set(reflect.Zero(rv.Elem().Type())) - } - } else { - rvn = rv.Elem() - // Note: interface{} is settable, but underlying type may not be. - // Consequently, we have to set the reflect.Value directly. - // if underlying type is settable (e.g. ptr or interface), - // we just decode into it. - // Else we create a settable value, decode into it, and set on the interface. - if rvn.CanSet() { - f.d.decodeValue(rvn, nil) - } else { - rvn2 := reflect.New(rvn.Type()).Elem() - rvn2.Set(rvn) - f.d.decodeValue(rvn2, nil) - rv.Set(rvn2) - } - } -} - -func (f *decFnInfo) kStruct(rv reflect.Value) { - fti := f.ti - d := f.d - dd := d.d - cr := d.cr - ctyp := dd.ContainerType() - if ctyp == valueTypeMap { - containerLen := dd.ReadMapStart() - if containerLen == 0 { - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return - } - tisfi := fti.sfi - hasLen := containerLen >= 0 - if hasLen { - for j := 0; j < containerLen; j++ { - // rvkencname := dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapKey) - } - rvkencname := stringView(dd.DecodeBytes(f.d.b[:], true, true)) - // rvksi := ti.getForEncName(rvkencname) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if k := fti.indexForEncName(rvkencname); k > -1 { - si := tisfi[k] - if dd.TryDecodeAsNil() { - si.setToZeroValue(rv) - } else { - d.decodeValue(si.field(rv, true), nil) - } - } else { - d.structFieldNotFound(-1, rvkencname) - } - } - } else { - for j := 0; !dd.CheckBreak(); j++ { - // rvkencname := dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapKey) - } - rvkencname := stringView(dd.DecodeBytes(f.d.b[:], true, true)) - // rvksi := ti.getForEncName(rvkencname) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if k := fti.indexForEncName(rvkencname); k > -1 { - si := tisfi[k] - if dd.TryDecodeAsNil() { - si.setToZeroValue(rv) - } else { - d.decodeValue(si.field(rv, true), nil) - } - } else { - d.structFieldNotFound(-1, rvkencname) - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - } else if ctyp == valueTypeArray { - containerLen := dd.ReadArrayStart() - if containerLen == 0 { - if cr != nil { - cr.sendContainerState(containerArrayEnd) - } - return - } - // Not much gain from doing it two ways for array. - // Arrays are not used as much for structs. - hasLen := containerLen >= 0 - for j, si := range fti.sfip { - if hasLen { - if j == containerLen { - break - } - } else if dd.CheckBreak() { - break - } - if cr != nil { - cr.sendContainerState(containerArrayElem) - } - if dd.TryDecodeAsNil() { - si.setToZeroValue(rv) - } else { - d.decodeValue(si.field(rv, true), nil) - } - } - if containerLen > len(fti.sfip) { - // read remaining values and throw away - for j := len(fti.sfip); j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerArrayElem) - } - d.structFieldNotFound(j, "") - } - } - if cr != nil { - cr.sendContainerState(containerArrayEnd) - } - } else { - f.d.error(onlyMapOrArrayCanDecodeIntoStructErr) - return - } -} - -func (f *decFnInfo) kSlice(rv reflect.Value) { - // A slice can be set from a map or array in stream. - // This way, the order can be kept (as order is lost with map). - ti := f.ti - d := f.d - dd := d.d - rtelem0 := ti.rt.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) { - f.d.errorf("bytes or string in the stream must be decoded into a slice or array of bytes, not %v", ti.rt) - } - if f.seq == seqTypeChan { - bs2 := dd.DecodeBytes(nil, false, true) - ch := rv.Interface().(chan<- byte) - for _, b := range bs2 { - ch <- b - } - } else { - rvbs := rv.Bytes() - bs2 := dd.DecodeBytes(rvbs, false, false) - if rvbs == nil && bs2 != nil || rvbs != nil && bs2 == nil || len(bs2) != len(rvbs) { - if rv.CanSet() { - rv.SetBytes(bs2) - } else { - copy(rvbs, bs2) - } - } - } - return - } - - // 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 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)) - } - } - slh.End() - return - } - - rtelem := rtelem0 - for rtelem.Kind() == reflect.Ptr { - rtelem = rtelem.Elem() - } - fn := d.getDecFn(rtelem, true, true) - - var rv0, rv9 reflect.Value - rv0 = rv - rvChanged := false - - // for j := 0; j < containerLenS; j++ { - var rvlen int - if containerLenS > 0 { // hasLen - if f.seq == seqTypeChan { - if rv.IsNil() { - rvlen, _ = decInferLen(containerLenS, f.d.h.MaxInitLen, int(rtelem0.Size())) - rv.Set(reflect.MakeChan(ti.rt, rvlen)) - } - // handle chan specially: - for j := 0; j < containerLenS; j++ { - rv9 = reflect.New(rtelem0).Elem() - slh.ElemContainerState(j) - d.decodeValue(rv9, fn) - rv.Send(rv9) - } - } else { // slice or array - var truncated bool // says len of sequence is not same as expected number of elements - numToRead := containerLenS // if truncated, reset numToRead - - rvcap := rv.Cap() - rvlen = rv.Len() - if containerLenS > rvcap { - if f.seq == seqTypeArray { - d.arrayCannotExpand(rvlen, containerLenS) - } else { - oldRvlenGtZero := rvlen > 0 - rvlen, truncated = decInferLen(containerLenS, f.d.h.MaxInitLen, int(rtelem0.Size())) - if truncated { - if rvlen <= rvcap { - rv.SetLen(rvlen) - } else { - rv = reflect.MakeSlice(ti.rt, rvlen, rvlen) - rvChanged = true - } - } else { - rv = reflect.MakeSlice(ti.rt, rvlen, rvlen) - rvChanged = true - } - if rvChanged && oldRvlenGtZero && !isImmutableKind(rtelem0.Kind()) { - reflect.Copy(rv, rv0) // only copy up to length NOT cap i.e. rv0.Slice(0, rvcap) - } - rvcap = rvlen - } - numToRead = rvlen - } else if containerLenS != rvlen { - if f.seq == seqTypeSlice { - rv.SetLen(containerLenS) - rvlen = containerLenS - } - } - j := 0 - // we read up to the numToRead - for ; j < numToRead; j++ { - slh.ElemContainerState(j) - d.decodeValue(rv.Index(j), fn) - } - - // if slice, expand and read up to containerLenS (or EOF) iff truncated - // if array, swallow all the rest. - - if f.seq == seqTypeArray { - for ; j < containerLenS; j++ { - slh.ElemContainerState(j) - d.swallow() - } - } else if truncated { // slice was truncated, as chan NOT in this block - for ; j < containerLenS; j++ { - rv = expandSliceValue(rv, 1) - rv9 = rv.Index(j) - if resetSliceElemToZeroValue { - rv9.Set(reflect.Zero(rtelem0)) - } - slh.ElemContainerState(j) - d.decodeValue(rv9, fn) - } - } - } - } else { - rvlen = rv.Len() - j := 0 - for ; !dd.CheckBreak(); j++ { - if f.seq == seqTypeChan { - slh.ElemContainerState(j) - rv9 = reflect.New(rtelem0).Elem() - d.decodeValue(rv9, fn) - 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)) // uses append logic, plus varargs - rv = expandSliceValue(rv, 1) - rv9 = rv.Index(j) - // rv.Index(rv.Len() - 1).Set(reflect.Zero(rtelem0)) - if resetSliceElemToZeroValue { - rv9.Set(reflect.Zero(rtelem0)) - } - rvlen++ - rvChanged = true - } - } else { // slice or array - rv9 = rv.Index(j) - } - slh.ElemContainerState(j) - if decodeIntoBlank { - d.swallow() - } else { // seqTypeSlice - d.decodeValue(rv9, fn) - } - } - } - if f.seq == seqTypeSlice { - if j < rvlen { - rv.SetLen(j) - } else if j == 0 && rv.IsNil() { - rv = reflect.MakeSlice(ti.rt, 0, 0) - rvChanged = true - } - } - } - slh.End() - - if rvChanged { - rv0.Set(rv) - } -} - -func (f *decFnInfo) kArray(rv reflect.Value) { - // f.d.decodeValue(rv.Slice(0, rv.Len())) - f.kSlice(rv.Slice(0, rv.Len())) -} - -func (f *decFnInfo) kMap(rv reflect.Value) { - d := f.d - dd := d.d - containerLen := dd.ReadMapStart() - cr := d.cr - ti := f.ti - if rv.IsNil() { - rv.Set(reflect.MakeMap(ti.rt)) - } - - if containerLen == 0 { - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return - } - - ktype, vtype := ti.rt.Key(), ti.rt.Elem() - ktypeId := reflect.ValueOf(ktype).Pointer() - vtypeKind := vtype.Kind() - var keyFn, valFn *decFn - var xtyp reflect.Type - for xtyp = ktype; xtyp.Kind() == reflect.Ptr; xtyp = xtyp.Elem() { - } - keyFn = d.getDecFn(xtyp, true, true) - for xtyp = vtype; xtyp.Kind() == reflect.Ptr; xtyp = xtyp.Elem() { - } - valFn = d.getDecFn(xtyp, true, true) - var mapGet, mapSet bool - if !f.d.h.MapValueReset { - // if pointer, mapGet = true - // if interface, mapGet = true if !DecodeNakedAlways (else false) - // if builtin, mapGet = false - // else mapGet = true - if vtypeKind == reflect.Ptr { - mapGet = true - } else if vtypeKind == reflect.Interface { - if !f.d.h.InterfaceReset { - mapGet = true - } - } else if !isImmutableKind(vtypeKind) { - mapGet = true - } - } - - var rvk, rvv, rvz reflect.Value - - // for j := 0; j < containerLen; j++ { - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - rvk = reflect.New(ktype).Elem() - if cr != nil { - cr.sendContainerState(containerMapKey) - } - d.decodeValue(rvk, keyFn) - - // special case if a byte array. - if ktypeId == intfTypId { - rvk = rvk.Elem() - if rvk.Type() == uint8SliceTyp { - rvk = reflect.ValueOf(d.string(rvk.Bytes())) - } - } - mapSet = true // set to false if u do a get, and its a pointer, and exists - if mapGet { - rvv = rv.MapIndex(rvk) - if rvv.IsValid() { - if vtypeKind == reflect.Ptr { - mapSet = false - } - } else { - if rvz.IsValid() { - rvz.Set(reflect.Zero(vtype)) - } else { - rvz = reflect.New(vtype).Elem() - } - rvv = rvz - } - } else { - if rvz.IsValid() { - rvz.Set(reflect.Zero(vtype)) - } else { - rvz = reflect.New(vtype).Elem() - } - rvv = rvz - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - d.decodeValue(rvv, valFn) - if mapSet { - rv.SetMapIndex(rvk, rvv) - } - } - } else { - for j := 0; !dd.CheckBreak(); j++ { - rvk = reflect.New(ktype).Elem() - if cr != nil { - cr.sendContainerState(containerMapKey) - } - d.decodeValue(rvk, keyFn) - - // special case if a byte array. - if ktypeId == intfTypId { - rvk = rvk.Elem() - if rvk.Type() == uint8SliceTyp { - rvk = reflect.ValueOf(d.string(rvk.Bytes())) - } - } - mapSet = true // set to false if u do a get, and its a pointer, and exists - if mapGet { - rvv = rv.MapIndex(rvk) - if rvv.IsValid() { - if vtypeKind == reflect.Ptr { - mapSet = false - } - } else { - if rvz.IsValid() { - rvz.Set(reflect.Zero(vtype)) - } else { - rvz = reflect.New(vtype).Elem() - } - rvv = rvz - } - } else { - if rvz.IsValid() { - rvz.Set(reflect.Zero(vtype)) - } else { - rvz = reflect.New(vtype).Elem() - } - rvv = rvz - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - d.decodeValue(rvv, valFn) - if mapSet { - rv.SetMapIndex(rvk, rvv) - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -type decRtidFn struct { - rtid uintptr - fn decFn -} - -// 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 accomodate 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. - u uint64 - i int64 - f float64 - l []byte - s string - t time.Time - b bool - v valueType - - // stacks for reducing allocation - is []interface{} - ms []map[interface{}]interface{} - ns []map[string]interface{} - ss [][]interface{} - // rs []RawExt - - // keep arrays at the bottom? Chance is that they are not used much. - ia [4]interface{} - ma [4]map[interface{}]interface{} - na [4]map[string]interface{} - sa [4][]interface{} - // ra [2]RawExt -} - -func (n *decNaked) reset() { - if n.ss != nil { - n.ss = n.ss[:0] - } - if n.is != nil { - n.is = n.is[:0] - } - if n.ms != nil { - n.ms = n.ms[:0] - } - if n.ns != nil { - n.ns = n.ns[:0] - } -} - -// A Decoder reads and decodes an object from an input stream in the codec format. -type Decoder struct { - // 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). - - d decDriver - // NOTE: Decoder shouldn't call it's read methods, - // as the handler MAY need to do some coordination. - r decReader - // sa [initCollectionCap]decRtidFn - h *BasicHandle - hh Handle - - be bool // is binary encoding - bytes bool // is bytes reader - js bool // is json handle - - rb bytesDecReader - ri ioDecReader - cr containerStateRecv - - s []decRtidFn - f map[uintptr]*decFn - - // _ uintptr // for alignment purposes, so next one starts from a cache line - - // cache the mapTypeId and sliceTypeId for faster comparisons - mtid uintptr - stid uintptr - - n decNaked - b [scratchByteArrayLen]byte - is map[string]string // used for interning strings -} - -// 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 reader -// (eg bufio.Reader, bytes.Buffer). -func NewDecoder(r io.Reader, h Handle) *Decoder { - 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 { - d := newDecoder(h) - d.ResetBytes(in) - return d -} - -func newDecoder(h Handle) *Decoder { - d := &Decoder{hh: h, h: h.getBasicHandle(), be: h.isBinary()} - n := &d.n - // n.rs = n.ra[:0] - n.ms = n.ma[:0] - n.is = n.ia[:0] - n.ns = n.na[:0] - n.ss = n.sa[:0] - _, d.js = h.(*JsonHandle) - if d.h.InternString { - d.is = make(map[string]string, 32) - } - d.d = h.newDecDriver(d) - d.cr, _ = d.d.(containerStateRecv) - // d.d = h.newDecDriver(decReaderT{true, &d.rb, &d.ri}) - return d -} - -func (d *Decoder) resetCommon() { - d.n.reset() - d.d.reset() - // reset all things which were cached from the Handle, - // but could be changed. - d.mtid, d.stid = 0, 0 - if d.h.MapType != nil { - d.mtid = reflect.ValueOf(d.h.MapType).Pointer() - } - if d.h.SliceType != nil { - d.stid = reflect.ValueOf(d.h.SliceType).Pointer() - } -} - -func (d *Decoder) Reset(r io.Reader) { - d.ri.x = &d.b - // d.s = d.sa[:0] - d.ri.bs.r = r - var ok bool - d.ri.br, ok = r.(decReaderByteScanner) - if !ok { - d.ri.br = &d.ri.bs - } - d.r = &d.ri - d.resetCommon() -} - -func (d *Decoder) ResetBytes(in []byte) { - // d.s = d.sa[:0] - d.rb.reset(in) - d.r = &d.rb - d.resetCommon() -} - -// func (d *Decoder) sendContainerState(c containerState) { -// if d.cr != nil { -// d.cr.sendContainerState(c) -// } -// } - -// Decode decodes the stream from reader and stores the result in the -// value pointed to by v. v cannot be a nil pointer. v can also be -// a reflect.Value of a pointer. -// -// Note that a pointer to a nil interface is not a nil pointer. -// If you do not know what type of stream it is, pass in a pointer to a nil interface. -// We will decode and store a value in that nil interface. -// -// Sample usages: -// // Decoding into a non-nil typed value -// var f float32 -// err = codec.NewDecoder(r, handle).Decode(&f) -// -// // Decoding into nil interface -// var v interface{} -// dec := codec.NewDecoder(r, handle) -// err = dec.Decode(&v) -// -// When decoding into a nil interface{}, we will decode into an appropriate value based -// on the contents of the stream: -// - Numbers are decoded as float64, int64 or uint64. -// - Other values are decoded appropriately depending on the type: -// bool, string, []byte, time.Time, etc -// - Extensions are decoded as RawExt (if no ext function registered for the tag) -// Configurations exist on the Handle to override defaults -// (e.g. for MapType, SliceType and how to decode raw bytes). -// -// When decoding into a non-nil interface{} value, the mode of encoding is based on the -// type of the value. When a value is seen: -// - If an extension is registered for it, call that extension function -// - If it implements BinaryUnmarshaler, call its UnmarshalBinary(data []byte) error -// - 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. -// - 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. -// - A slice can be decoded from a stream map, by decoding as if -// it contains a sequence of key-value pairs. -// - A struct can be decoded from a stream map, by updating matching fields. -// - 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, -// 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). -// -func (d *Decoder) Decode(v interface{}) (err error) { - defer panicToErr(&err) - d.decode(v) - return -} - -// this is not a smart swallow, as it allocates objects and does unnecessary work. -func (d *Decoder) swallowViaHammer() { - var blank interface{} - d.decodeValue(reflect.ValueOf(&blank).Elem(), nil) -} - -func (d *Decoder) swallow() { - // smarter decode that just swallows the content - dd := d.d - if dd.TryDecodeAsNil() { - return - } - cr := d.cr - switch dd.ContainerType() { - case valueTypeMap: - containerLen := dd.ReadMapStart() - clenGtEqualZero := containerLen >= 0 - for j := 0; ; j++ { - if clenGtEqualZero { - if j >= containerLen { - break - } - } else if dd.CheckBreak() { - break - } - if cr != nil { - cr.sendContainerState(containerMapKey) - } - d.swallow() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - d.swallow() - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - case valueTypeArray: - containerLenS := dd.ReadArrayStart() - clenGtEqualZero := containerLenS >= 0 - for j := 0; ; j++ { - if clenGtEqualZero { - if j >= containerLenS { - break - } - } else if dd.CheckBreak() { - break - } - if cr != nil { - cr.sendContainerState(containerArrayElem) - } - d.swallow() - } - if cr != nil { - cr.sendContainerState(containerArrayEnd) - } - case valueTypeBytes: - dd.DecodeBytes(d.b[:], false, true) - case valueTypeString: - dd.DecodeBytes(d.b[:], true, true) - // dd.DecodeStringAsBytes(d.b[:]) - default: - // these are all primitives, which we can get from decodeNaked - // if RawExt using Value, complete the processing. - dd.DecodeNaked() - if n := &d.n; n.v == valueTypeExt && n.l == nil { - l := len(n.is) - n.is = append(n.is, nil) - v2 := &n.is[l] - d.decode(v2) - n.is = n.is[:l] - } - } -} - -// 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{}) { - d.decode(v) -} - -func (d *Decoder) decode(iv interface{}) { - // if ics, ok := iv.(Selfer); ok { - // ics.CodecDecodeSelf(d) - // return - // } - - if d.d.TryDecodeAsNil() { - switch v := iv.(type) { - case nil: - case *string: - *v = "" - case *bool: - *v = false - case *int: - *v = 0 - case *int8: - *v = 0 - case *int16: - *v = 0 - case *int32: - *v = 0 - case *int64: - *v = 0 - case *uint: - *v = 0 - case *uint8: - *v = 0 - case *uint16: - *v = 0 - case *uint32: - *v = 0 - case *uint64: - *v = 0 - case *float32: - *v = 0 - case *float64: - *v = 0 - case *[]uint8: - *v = nil - case reflect.Value: - if v.Kind() != reflect.Ptr || v.IsNil() { - d.errNotValidPtrValue(v) - } - // d.chkPtrValue(v) - v = v.Elem() - if v.IsValid() { - v.Set(reflect.Zero(v.Type())) - } - default: - rv := reflect.ValueOf(iv) - if rv.Kind() != reflect.Ptr || rv.IsNil() { - d.errNotValidPtrValue(rv) - } - // d.chkPtrValue(rv) - rv = rv.Elem() - if rv.IsValid() { - rv.Set(reflect.Zero(rv.Type())) - } - } - return - } - - switch v := iv.(type) { - case nil: - d.error(cannotDecodeIntoNilErr) - return - - case Selfer: - v.CodecDecodeSelf(d) - - case reflect.Value: - if v.Kind() != reflect.Ptr || v.IsNil() { - d.errNotValidPtrValue(v) - } - // d.chkPtrValue(v) - d.decodeValueNotNil(v.Elem(), nil) - - case *string: - *v = d.d.DecodeString() - case *bool: - *v = d.d.DecodeBool() - case *int: - *v = int(d.d.DecodeInt(intBitsize)) - case *int8: - *v = int8(d.d.DecodeInt(8)) - case *int16: - *v = int16(d.d.DecodeInt(16)) - case *int32: - *v = int32(d.d.DecodeInt(32)) - case *int64: - *v = d.d.DecodeInt(64) - case *uint: - *v = uint(d.d.DecodeUint(uintBitsize)) - case *uint8: - *v = uint8(d.d.DecodeUint(8)) - case *uint16: - *v = uint16(d.d.DecodeUint(16)) - case *uint32: - *v = uint32(d.d.DecodeUint(32)) - case *uint64: - *v = d.d.DecodeUint(64) - case *float32: - *v = float32(d.d.DecodeFloat(true)) - case *float64: - *v = d.d.DecodeFloat(false) - case *[]uint8: - *v = d.d.DecodeBytes(*v, false, false) - - case *interface{}: - d.decodeValueNotNil(reflect.ValueOf(iv).Elem(), nil) - - default: - if !fastpathDecodeTypeSwitch(iv, d) { - d.decodeI(iv, true, false, false, false) - } - } -} - -func (d *Decoder) preDecodeValue(rv reflect.Value, tryNil bool) (rv2 reflect.Value, proceed bool) { - if tryNil && d.d.TryDecodeAsNil() { - // No need to check if a ptr, recursively, to determine - // whether to set value to nil. - // Just always set value to its zero type. - if rv.IsValid() { // rv.CanSet() // always settable, except it's invalid - rv.Set(reflect.Zero(rv.Type())) - } - 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())) - } - rv = rv.Elem() - } - return rv, true -} - -func (d *Decoder) decodeI(iv interface{}, checkPtr, tryNil, checkFastpath, checkCodecSelfer bool) { - rv := reflect.ValueOf(iv) - if checkPtr { - if rv.Kind() != reflect.Ptr || rv.IsNil() { - d.errNotValidPtrValue(rv) - } - // d.chkPtrValue(rv) - } - rv, proceed := d.preDecodeValue(rv, tryNil) - if proceed { - fn := d.getDecFn(rv.Type(), checkFastpath, checkCodecSelfer) - fn.f(&fn.i, rv) - } -} - -func (d *Decoder) decodeValue(rv reflect.Value, fn *decFn) { - if rv, proceed := d.preDecodeValue(rv, true); proceed { - if fn == nil { - fn = d.getDecFn(rv.Type(), true, true) - } - fn.f(&fn.i, rv) - } -} - -func (d *Decoder) decodeValueNotNil(rv reflect.Value, fn *decFn) { - if rv, proceed := d.preDecodeValue(rv, false); proceed { - if fn == nil { - fn = d.getDecFn(rv.Type(), true, true) - } - fn.f(&fn.i, rv) - } -} - -func (d *Decoder) getDecFn(rt reflect.Type, checkFastpath, checkCodecSelfer bool) (fn *decFn) { - rtid := reflect.ValueOf(rt).Pointer() - - // retrieve or register a focus'ed function for this type - // to eliminate need to do the retrieval multiple times - - // if d.f == nil && d.s == nil { debugf("---->Creating new dec f map for type: %v\n", rt) } - var ok bool - if useMapForCodecCache { - fn, ok = d.f[rtid] - } else { - for i := range d.s { - v := &(d.s[i]) - if v.rtid == rtid { - fn, ok = &(v.fn), true - break - } - } - } - if ok { - return - } - - if useMapForCodecCache { - if d.f == nil { - d.f = make(map[uintptr]*decFn, initCollectionCap) - } - fn = new(decFn) - d.f[rtid] = fn - } else { - if d.s == nil { - d.s = make([]decRtidFn, 0, initCollectionCap) - } - d.s = append(d.s, decRtidFn{rtid: rtid}) - fn = &(d.s[len(d.s)-1]).fn - } - - // debugf("\tCreating new dec fn for type: %v\n", rt) - ti := d.h.getTypeInfo(rtid, rt) - fi := &(fn.i) - fi.d = d - fi.ti = ti - - // 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 checkCodecSelfer && ti.cs { - fn.f = (*decFnInfo).selferUnmarshal - } else if rtid == rawExtTypId { - fn.f = (*decFnInfo).rawExt - } else if d.d.IsBuiltinType(rtid) { - fn.f = (*decFnInfo).builtin - } else if xfFn := d.h.getExt(rtid); xfFn != nil { - fi.xfTag, fi.xfFn = xfFn.tag, xfFn.ext - fn.f = (*decFnInfo).ext - } else if supportMarshalInterfaces && d.be && ti.bunm { - fn.f = (*decFnInfo).binaryUnmarshal - } else if supportMarshalInterfaces && !d.be && d.js && ti.junm { - //If JSON, we should check JSONUnmarshal before textUnmarshal - fn.f = (*decFnInfo).jsonUnmarshal - } else if supportMarshalInterfaces && !d.be && ti.tunm { - fn.f = (*decFnInfo).textUnmarshal - } else { - rk := rt.Kind() - if fastpathEnabled && checkFastpath && (rk == reflect.Map || rk == reflect.Slice) { - if rt.PkgPath() == "" { - if idx := fastpathAV.index(rtid); idx != -1 { - fn.f = fastpathAV[idx].decfn - } - } else { - // use mapping for underlying type if there - ok = false - var rtu reflect.Type - if rk == reflect.Map { - rtu = reflect.MapOf(rt.Key(), rt.Elem()) - } else { - rtu = reflect.SliceOf(rt.Elem()) - } - rtuid := reflect.ValueOf(rtu).Pointer() - if idx := fastpathAV.index(rtuid); idx != -1 { - xfnf := fastpathAV[idx].decfn - xrt := fastpathAV[idx].rt - fn.f = func(xf *decFnInfo, xrv reflect.Value) { - // xfnf(xf, xrv.Convert(xrt)) - xfnf(xf, xrv.Addr().Convert(reflect.PtrTo(xrt)).Elem()) - } - } - } - } - if fn.f == nil { - switch 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.Uintptr: - fn.f = (*decFnInfo).kUintptr - case reflect.Interface: - fn.f = (*decFnInfo).kInterface - case reflect.Struct: - fn.f = (*decFnInfo).kStruct - case reflect.Chan: - fi.seq = seqTypeChan - fn.f = (*decFnInfo).kSlice - case reflect.Slice: - fi.seq = seqTypeSlice - fn.f = (*decFnInfo).kSlice - case reflect.Array: - fi.seq = seqTypeArray - fn.f = (*decFnInfo).kArray - case reflect.Map: - fn.f = (*decFnInfo).kMap - default: - fn.f = (*decFnInfo).kErr - } - } - } - - return -} - -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() -} - -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 (d *Decoder) chkPtrValue(rv reflect.Value) { - // We can only decode into a non-nil pointer - if rv.Kind() == reflect.Ptr && !rv.IsNil() { - return - } - d.errNotValidPtrValue(rv) -} - -func (d *Decoder) errNotValidPtrValue(rv reflect.Value) { - if !rv.IsValid() { - d.error(cannotDecodeIntoNilErr) - return - } - if !rv.CanInterface() { - d.errorf("cannot decode into a value without an interface: %v", rv) - return - } - rvi := rv.Interface() - d.errorf("cannot decode into non-pointer or nil pointer. Got: %v, %T, %v", rv.Kind(), rvi, rvi) -} - -func (d *Decoder) error(err error) { - panic(err) -} - -func (d *Decoder) errorf(format string, params ...interface{}) { - params2 := make([]interface{}, len(params)+1) - params2[0] = d.r.numread() - copy(params2[1:], params) - err := fmt.Errorf("[pos %d]: "+format, params2...) - panic(err) -} - -func (d *Decoder) string(v []byte) (s string) { - if d.is != nil { - s, ok := d.is[string(v)] // no allocation here. - if !ok { - s = string(v) - d.is[s] = s - } - return s - } - return string(v) // don't return stringView, as we need a real string here. -} - -func (d *Decoder) intern(s string) { - if d.is != nil { - d.is[s] = s - } -} - -// nextValueBytes returns the next value in the stream as a set of bytes. -func (d *Decoder) nextValueBytes() []byte { - d.d.uncacheRead() - d.r.track() - d.swallow() - return d.r.stopTrack() -} - -// -------------------------------------------------- - -// 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() - if ctyp == valueTypeArray { - x.array = true - clen = dd.ReadArrayStart() - } else if ctyp == valueTypeMap { - clen = dd.ReadMapStart() * 2 - } else { - d.errorf("only encoded map or array can be decoded into a slice (%d)", ctyp) - } - // x.ct = ctyp - x.d = d - return -} - -func (x decSliceHelper) End() { - cr := x.d.cr - if cr == nil { - return - } - if x.array { - cr.sendContainerState(containerArrayEnd) - } else { - cr.sendContainerState(containerMapEnd) - } -} - -func (x decSliceHelper) ElemContainerState(index int) { - cr := x.d.cr - if cr == nil { - return - } - if x.array { - cr.sendContainerState(containerArrayElem) - } else { - if index%2 == 0 { - cr.sendContainerState(containerMapKey) - } else { - cr.sendContainerState(containerMapValue) - } - } -} - -func decByteSlice(r decReader, clen int, bs []byte) (bsOut []byte) { - if clen == 0 { - return zeroByteSlice - } - if len(bs) == clen { - bsOut = bs - } else if cap(bs) >= clen { - bsOut = bs[:clen] - } else { - bsOut = make([]byte, clen) - } - r.readb(bsOut) - return -} - -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, truncated bool) { - // handle when maxlen is not set i.e. <= 0 - if clen <= 0 { - return - } - 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 - truncated = true - } else { - rvlen = clen - } - return - // if clen <= 0 { - // rvlen = 0 - // } else if maxlen > 0 && clen > maxlen { - // rvlen = maxlen - // truncated = true - // } else { - // rvlen = clen - // } - // return -} - -// // implement overall decReader wrapping both, for possible use inline: -// type decReaderT struct { -// bytes bool -// rb *bytesDecReader -// ri *ioDecReader -// } -// -// // implement *Decoder as a decReader. -// // Using decReaderT (defined just above) caused performance degradation -// // possibly because of constant copying the value, -// // and some value->interface conversion causing allocation. -// func (d *Decoder) unreadn1() { -// if d.bytes { -// d.rb.unreadn1() -// } else { -// d.ri.unreadn1() -// } -// } -// ... for other methods of decReader. -// Testing showed that performance improvement was negligible. diff --git a/_vendor/vendor/github.com/ugorji/go/codec/encode.go b/_vendor/vendor/github.com/ugorji/go/codec/encode.go deleted file mode 100644 index 25f426c..0000000 --- a/_vendor/vendor/github.com/ugorji/go/codec/encode.go +++ /dev/null @@ -1,1422 +0,0 @@ -// 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 - -import ( - "encoding" - "fmt" - "io" - "reflect" - "sort" - "sync" -) - -const ( - defEncByteBufSize = 1 << 6 // 4:16, 6:64, 8:256, 10:1024 -) - -// 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 - - // AsSymbolNone means do not encode anything as a symbol. - AsSymbolNone = 1 << iota - - // AsSymbolMapStringKeys means encode keys in map[string]XXX as symbols. - AsSymbolMapStringKeysFlag - - // AsSymbolStructFieldName means encode struct field names as symbols. - AsSymbolStructFieldNameFlag -) - -// encWriter abstracts writing to a byte array or to an io.Writer. -type encWriter interface { - writeb([]byte) - writestr(string) - writen1(byte) - writen2(byte, byte) - atEndOfEncode() -} - -// 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) - EncodeRawExt(re *RawExt, e *Encoder) - EncodeExt(v interface{}, xtag uint64, ext Ext, e *Encoder) - EncodeArrayStart(length int) - EncodeMapStart(length int) - EncodeString(c charEncoding, v string) - EncodeSymbol(v string) - EncodeStringBytes(c charEncoding, v []byte) - //TODO - //encBignum(f *big.Int) - //encStringRunes(c charEncoding, v []rune) - - reset() -} - -type encDriverAsis interface { - EncodeAsis(v []byte) -} - -type encNoSeparator struct{} - -func (_ encNoSeparator) EncodeEnd() {} - -type ioEncWriterWriter interface { - WriteByte(c byte) error - WriteString(s string) (n int, err error) - Write(p []byte) (n int, err error) -} - -type ioEncStringWriter interface { - WriteString(s string) (n int, err error) -} - -type EncodeOptions struct { - // Encode a struct as an array, and not as a map - StructToArray bool - - // Canonical representation means that encoding a value will always result in the same - // sequence of bytes. - // - // This only affects maps, as the iteration order for maps is random. - // - // The implementation MAY use the natural sort order for the map keys if possible: - // - // - If there is a natural sort order (ie for number, bool, string or []byte keys), - // then the map keys are first sorted in natural order and then written - // with corresponding map values to the strema. - // - If there is no natural sort order, then the map keys will first be - // encoded into []byte, and then sorted, - // before writing the sorted keys and the corresponding map values to the stream. - // - Canonical bool - - // 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 - - // 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 -} - -// --------------------------------------------- - -type simpleIoEncWriterWriter struct { - w io.Writer - bw io.ByteWriter - sw ioEncStringWriter - bs [1]byte -} - -func (o *simpleIoEncWriterWriter) WriteByte(c byte) (err error) { - if o.bw != nil { - return o.bw.WriteByte(c) - } - // _, err = o.w.Write([]byte{c}) - o.bs[0] = c - _, err = o.w.Write(o.bs[:]) - return -} - -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)) - return o.w.Write(bytesView(s)) -} - -func (o *simpleIoEncWriterWriter) Write(p []byte) (n int, err error) { - return o.w.Write(p) -} - -// ---------------------------------------- - -// ioEncWriter implements encWriter and can write to an io.Writer implementation -type ioEncWriter struct { - w ioEncWriterWriter - s simpleIoEncWriterWriter - // x [8]byte // temp byte array re-used internally for efficiency -} - -func (z *ioEncWriter) writeb(bs []byte) { - if len(bs) == 0 { - return - } - n, err := z.w.Write(bs) - if err != nil { - panic(err) - } - if n != len(bs) { - panic(fmt.Errorf("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 { - panic(err) - } - if n != len(s) { - panic(fmt.Errorf("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 { - panic(err) - } -} - -func (z *ioEncWriter) writen2(b1 byte, b2 byte) { - z.writen1(b1) - z.writen1(b2) -} - -func (z *ioEncWriter) atEndOfEncode() {} - -// ---------------------------------------- - -// 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 -} - -func (z *bytesEncWriter) writeb(s []byte) { - if len(s) > 0 { - c := z.grow(len(s)) - copy(z.b[c:], s) - } -} - -func (z *bytesEncWriter) writestr(s string) { - if len(s) > 0 { - c := z.grow(len(s)) - copy(z.b[c:], s) - } -} - -func (z *bytesEncWriter) writen1(b1 byte) { - c := z.grow(1) - z.b[c] = b1 -} - -func (z *bytesEncWriter) writen2(b1 byte, b2 byte) { - c := z.grow(2) - z.b[c+1] = b2 - z.b[c] = b1 -} - -func (z *bytesEncWriter) atEndOfEncode() { - *(z.out) = z.b[:z.c] -} - -func (z *bytesEncWriter) grow(n int) (oldcursor int) { - oldcursor = z.c - z.c = oldcursor + n - if z.c > len(z.b) { - if z.c > cap(z.b) { - // appendslice logic (if cap < 1024, *2, else *1.25): more expensive. many copy calls. - // bytes.Buffer model (2*cap + n): much better - // bs := make([]byte, 2*cap(z.b)+n) - bs := make([]byte, growCap(cap(z.b), 1, n)) - copy(bs, z.b[:oldcursor]) - z.b = bs - } else { - z.b = z.b[:cap(z.b)] - } - } - return -} - -// --------------------------------------------- - -type encFnInfo struct { - e *Encoder - ti *typeInfo - xfFn Ext - xfTag uint64 - seq seqType -} - -func (f *encFnInfo) builtin(rv reflect.Value) { - f.e.e.EncodeBuiltin(f.ti.rtid, rv.Interface()) -} - -func (f *encFnInfo) rawExt(rv reflect.Value) { - // rev := rv.Interface().(RawExt) - // f.e.e.EncodeRawExt(&rev, f.e) - var re *RawExt - if rv.CanAddr() { - re = rv.Addr().Interface().(*RawExt) - } else { - rev := rv.Interface().(RawExt) - re = &rev - } - f.e.e.EncodeRawExt(re, f.e) -} - -func (f *encFnInfo) ext(rv reflect.Value) { - // if this is a struct|array and it was addressable, then pass the address directly (not the value) - if k := rv.Kind(); (k == reflect.Struct || k == reflect.Array) && rv.CanAddr() { - rv = rv.Addr() - } - f.e.e.EncodeExt(rv.Interface(), f.xfTag, f.xfFn, f.e) -} - -func (f *encFnInfo) getValueForMarshalInterface(rv reflect.Value, indir int8) (v interface{}, proceed bool) { - if indir == 0 { - v = rv.Interface() - } else if indir == -1 { - // If a non-pointer was passed to Encode(), then that value is not addressable. - // Take addr if addresable, else copy value to an addressable value. - if rv.CanAddr() { - v = rv.Addr().Interface() - } else { - rv2 := reflect.New(rv.Type()) - rv2.Elem().Set(rv) - v = rv2.Interface() - // fmt.Printf("rv.Type: %v, rv2.Type: %v, v: %v\n", rv.Type(), rv2.Type(), v) - } - } else { - for j := int8(0); j < indir; j++ { - if rv.IsNil() { - f.e.e.EncodeNil() - return - } - rv = rv.Elem() - } - v = rv.Interface() - } - return v, true -} - -func (f *encFnInfo) selferMarshal(rv reflect.Value) { - if v, proceed := f.getValueForMarshalInterface(rv, f.ti.csIndir); proceed { - v.(Selfer).CodecEncodeSelf(f.e) - } -} - -func (f *encFnInfo) binaryMarshal(rv reflect.Value) { - if v, proceed := f.getValueForMarshalInterface(rv, f.ti.bmIndir); proceed { - bs, fnerr := v.(encoding.BinaryMarshaler).MarshalBinary() - f.e.marshal(bs, fnerr, false, c_RAW) - } -} - -func (f *encFnInfo) textMarshal(rv reflect.Value) { - if v, proceed := f.getValueForMarshalInterface(rv, f.ti.tmIndir); proceed { - // debugf(">>>> encoding.TextMarshaler: %T", rv.Interface()) - bs, fnerr := v.(encoding.TextMarshaler).MarshalText() - f.e.marshal(bs, fnerr, false, c_UTF8) - } -} - -func (f *encFnInfo) jsonMarshal(rv reflect.Value) { - if v, proceed := f.getValueForMarshalInterface(rv, f.ti.jmIndir); proceed { - bs, fnerr := v.(jsonMarshaler).MarshalJSON() - f.e.marshal(bs, fnerr, true, c_UTF8) - } -} - -func (f *encFnInfo) kBool(rv reflect.Value) { - f.e.e.EncodeBool(rv.Bool()) -} - -func (f *encFnInfo) kString(rv reflect.Value) { - f.e.e.EncodeString(c_UTF8, rv.String()) -} - -func (f *encFnInfo) kFloat64(rv reflect.Value) { - f.e.e.EncodeFloat64(rv.Float()) -} - -func (f *encFnInfo) kFloat32(rv reflect.Value) { - f.e.e.EncodeFloat32(float32(rv.Float())) -} - -func (f *encFnInfo) kInt(rv reflect.Value) { - f.e.e.EncodeInt(rv.Int()) -} - -func (f *encFnInfo) kUint(rv reflect.Value) { - f.e.e.EncodeUint(rv.Uint()) -} - -func (f *encFnInfo) kInvalid(rv reflect.Value) { - f.e.e.EncodeNil() -} - -func (f *encFnInfo) kErr(rv reflect.Value) { - f.e.errorf("unsupported kind %s, for %#v", rv.Kind(), rv) -} - -func (f *encFnInfo) kSlice(rv reflect.Value) { - ti := f.ti - // 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". - e := f.e - if f.seq != seqTypeArray { - if rv.IsNil() { - e.e.EncodeNil() - return - } - // If in this method, then there was no extension function defined. - // So it's okay to treat as []byte. - if ti.rtid == uint8SliceTypId { - e.e.EncodeStringBytes(c_RAW, rv.Bytes()) - return - } - } - cr := e.cr - rtelem := ti.rt.Elem() - l := rv.Len() - if ti.rtid == uint8SliceTypId || rtelem.Kind() == reflect.Uint8 { - switch f.seq { - case seqTypeArray: - // if l == 0 { e.e.encodeStringBytes(c_RAW, nil) } else - if rv.CanAddr() { - e.e.EncodeStringBytes(c_RAW, 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) - // TODO: Test that reflect.Copy works instead of manual one-by-one - // for i := 0; i < l; i++ { - // bs[i] = byte(rv.Index(i).Uint()) - // } - e.e.EncodeStringBytes(c_RAW, bs) - } - case seqTypeSlice: - e.e.EncodeStringBytes(c_RAW, rv.Bytes()) - case seqTypeChan: - bs := e.b[:0] - // 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 rv.Interface().(<-chan byte) { - // bs = append(bs, b) - // } - ch := rv.Interface().(<-chan byte) - for i := 0; i < l; i++ { - bs = append(bs, <-ch) - } - e.e.EncodeStringBytes(c_RAW, bs) - } - return - } - - if ti.mbs { - if l%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", l) - return - } - e.e.EncodeMapStart(l / 2) - } else { - e.e.EncodeArrayStart(l) - } - - if l > 0 { - 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. - var fn *encFn - if rtelem.Kind() != reflect.Interface { - rtelemid := reflect.ValueOf(rtelem).Pointer() - fn = e.getEncFn(rtelemid, rtelem, true, true) - } - // TODO: Consider perf implication of encoding odd index values as symbols if type is string - for j := 0; j < l; j++ { - if cr != nil { - if ti.mbs { - if j%2 == 0 { - cr.sendContainerState(containerMapKey) - } else { - cr.sendContainerState(containerMapValue) - } - } else { - cr.sendContainerState(containerArrayElem) - } - } - if f.seq == seqTypeChan { - if rv2, ok2 := rv.Recv(); ok2 { - e.encodeValue(rv2, fn) - } else { - e.encode(nil) // WE HAVE TO DO SOMETHING, so nil if nothing received. - } - } else { - e.encodeValue(rv.Index(j), fn) - } - } - } - - if cr != nil { - if ti.mbs { - cr.sendContainerState(containerMapEnd) - } else { - cr.sendContainerState(containerArrayEnd) - } - } -} - -func (f *encFnInfo) kStruct(rv reflect.Value) { - fti := f.ti - e := f.e - cr := e.cr - tisfi := fti.sfip - toMap := !(fti.toArray || e.h.StructToArray) - newlen := len(fti.sfi) - - // Use sync.Pool to reduce allocating slices unnecessarily. - // The cost of sync.Pool is less than the cost of new allocation. - pool, poolv, fkvs := encStructPoolGet(newlen) - - // if toMap, use the sorted array. If toArray, use unsorted array (to match sequence in struct) - if toMap { - tisfi = fti.sfi - } - newlen = 0 - var kv stringRv - for _, si := range tisfi { - kv.r = si.field(rv, false) - if toMap { - if si.omitEmpty && isEmptyValue(kv.r) { - continue - } - kv.v = si.encName - } else { - // use the zero value. - // if a reference or struct, set to nil (so you do not output too much) - if si.omitEmpty && isEmptyValue(kv.r) { - 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++ - } - - // debugf(">>>> kStruct: newlen: %v", newlen) - // sep := !e.be - ee := e.e //don't dereference everytime - - if toMap { - ee.EncodeMapStart(newlen) - // asSymbols := e.h.AsSymbols&AsSymbolStructFieldNameFlag != 0 - asSymbols := e.h.AsSymbols == AsSymbolDefault || e.h.AsSymbols&AsSymbolStructFieldNameFlag != 0 - for j := 0; j < newlen; j++ { - kv = fkvs[j] - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(kv.v) - } else { - ee.EncodeString(c_UTF8, kv.v) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encodeValue(kv.r, nil) - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - } else { - ee.EncodeArrayStart(newlen) - for j := 0; j < newlen; j++ { - kv = fkvs[j] - if cr != nil { - cr.sendContainerState(containerArrayElem) - } - e.encodeValue(kv.r, nil) - } - if cr != nil { - cr.sendContainerState(containerArrayEnd) - } - } - - // 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. - if pool != nil { - pool.Put(poolv) - } -} - -// func (f *encFnInfo) kPtr(rv reflect.Value) { -// debugf(">>>>>>> ??? encode kPtr called - shouldn't get called") -// if rv.IsNil() { -// f.e.e.encodeNil() -// return -// } -// f.e.encodeValue(rv.Elem()) -// } - -// func (f *encFnInfo) kInterface(rv reflect.Value) { -// println("kInterface called") -// debug.PrintStack() -// if rv.IsNil() { -// f.e.e.EncodeNil() -// return -// } -// f.e.encodeValue(rv.Elem(), nil) -// } - -func (f *encFnInfo) kMap(rv reflect.Value) { - ee := f.e.e - if rv.IsNil() { - ee.EncodeNil() - return - } - - l := rv.Len() - ee.EncodeMapStart(l) - e := f.e - cr := e.cr - if l == 0 { - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return - } - 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 *encFn - ti := f.ti - rtkey := ti.rt.Key() - rtval := ti.rt.Elem() - rtkeyid := reflect.ValueOf(rtkey).Pointer() - // keyTypeIsString := f.ti.rt.Key().Kind() == reflect.String - var keyTypeIsString = rtkeyid == stringTypId - if keyTypeIsString { - asSymbols = e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - } else { - for rtkey.Kind() == reflect.Ptr { - rtkey = rtkey.Elem() - } - if rtkey.Kind() != reflect.Interface { - rtkeyid = reflect.ValueOf(rtkey).Pointer() - keyFn = e.getEncFn(rtkeyid, rtkey, true, true) - } - } - for rtval.Kind() == reflect.Ptr { - rtval = rtval.Elem() - } - if rtval.Kind() != reflect.Interface { - rtvalid := reflect.ValueOf(rtval).Pointer() - valFn = e.getEncFn(rtvalid, rtval, true, true) - } - mks := rv.MapKeys() - // for j, lmks := 0, len(mks); j < lmks; j++ { - - if e.h.Canonical { - e.kMapCanonical(rtkeyid, rtkey, rv, mks, valFn, asSymbols) - } else { - for j := range mks { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if keyTypeIsString { - if asSymbols { - ee.EncodeSymbol(mks[j].String()) - } else { - ee.EncodeString(c_UTF8, mks[j].String()) - } - } else { - e.encodeValue(mks[j], keyFn) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encodeValue(rv.MapIndex(mks[j]), valFn) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (e *Encoder) kMapCanonical(rtkeyid uintptr, rtkey reflect.Type, rv reflect.Value, mks []reflect.Value, valFn *encFn, asSymbols bool) { - ee := e.e - cr := e.cr - // we previously did out-of-band if an extension was registered. - // This is not necessary, as the natural kind is sufficient for ordering. - - if rtkeyid == uint8SliceTypId { - mksv := make([]bytesRv, len(mks)) - for i, k := range mks { - v := &mksv[i] - v.r = k - v.v = k.Bytes() - } - sort.Sort(bytesRvSlice(mksv)) - for i := range mksv { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeStringBytes(c_RAW, mksv[i].v) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encodeValue(rv.MapIndex(mksv[i].r), valFn) - } - } else { - switch rtkey.Kind() { - case reflect.Bool: - mksv := make([]boolRv, len(mks)) - for i, k := range mks { - v := &mksv[i] - v.r = k - v.v = k.Bool() - } - sort.Sort(boolRvSlice(mksv)) - for i := range mksv { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(mksv[i].v) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encodeValue(rv.MapIndex(mksv[i].r), valFn) - } - case reflect.String: - mksv := make([]stringRv, len(mks)) - for i, k := range mks { - v := &mksv[i] - v.r = k - v.v = k.String() - } - sort.Sort(stringRvSlice(mksv)) - for i := range mksv { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(mksv[i].v) - } else { - ee.EncodeString(c_UTF8, mksv[i].v) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encodeValue(rv.MapIndex(mksv[i].r), valFn) - } - case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint, reflect.Uintptr: - mksv := make([]uintRv, len(mks)) - for i, k := range mks { - v := &mksv[i] - v.r = k - v.v = k.Uint() - } - sort.Sort(uintRvSlice(mksv)) - for i := range mksv { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(mksv[i].v) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encodeValue(rv.MapIndex(mksv[i].r), valFn) - } - case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: - mksv := make([]intRv, len(mks)) - for i, k := range mks { - v := &mksv[i] - v.r = k - v.v = k.Int() - } - sort.Sort(intRvSlice(mksv)) - for i := range mksv { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(mksv[i].v) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encodeValue(rv.MapIndex(mksv[i].r), valFn) - } - case reflect.Float32: - mksv := make([]floatRv, len(mks)) - for i, k := range mks { - v := &mksv[i] - v.r = k - v.v = k.Float() - } - sort.Sort(floatRvSlice(mksv)) - for i := range mksv { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(float32(mksv[i].v)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encodeValue(rv.MapIndex(mksv[i].r), valFn) - } - case reflect.Float64: - mksv := make([]floatRv, len(mks)) - for i, k := range mks { - v := &mksv[i] - v.r = k - v.v = k.Float() - } - sort.Sort(floatRvSlice(mksv)) - for i := range mksv { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(mksv[i].v) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encodeValue(rv.MapIndex(mksv[i].r), valFn) - } - default: - // out-of-band - // first encode each key to a []byte first, then sort them, then record - var mksv []byte = make([]byte, 0, len(mks)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - mksbv := make([]bytesRv, len(mks)) - for i, k := range mks { - v := &mksbv[i] - l := len(mksv) - e2.MustEncode(k) - v.r = k - v.v = mksv[l:] - // fmt.Printf(">>>>> %s\n", mksv[l:]) - } - sort.Sort(bytesRvSlice(mksbv)) - for j := range mksbv { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.asis(mksbv[j].v) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encodeValue(rv.MapIndex(mksbv[j].r), valFn) - } - } - } -} - -// -------------------------------------------------- - -// 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) -} - -// -------------------------------------------------- - -type encRtidFn struct { - rtid uintptr - fn encFn -} - -// An Encoder writes an object to an output stream in the codec format. -type Encoder struct { - // 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 encWriter - s []encRtidFn - ci set - be bool // is binary encoding - js bool // is json handle - - wi ioEncWriter - wb bytesEncWriter - - h *BasicHandle - hh Handle - - cr containerStateRecv - as encDriverAsis - - f map[uintptr]*encFn - b [scratchByteArrayLen]byte -} - -// 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). -func NewEncoder(w io.Writer, h Handle) *Encoder { - e := newEncoder(h) - e.Reset(w) - return e -} - -// NewEncoderBytes returns an encoder for encoding directly and efficiently -// into a byte slice, using zero-copying to temporary slices. -// -// 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 { - e := newEncoder(h) - e.ResetBytes(out) - return e -} - -func newEncoder(h Handle) *Encoder { - e := &Encoder{hh: h, h: h.getBasicHandle(), be: h.isBinary()} - _, e.js = h.(*JsonHandle) - e.e = h.newEncDriver(e) - e.as, _ = e.e.(encDriverAsis) - e.cr, _ = e.e.(containerStateRecv) - return e -} - -// Reset the Encoder with a new output stream. -// -// This accomodates using the state of the Encoder, -// where it has "cached" information about sub-engines. -func (e *Encoder) Reset(w io.Writer) { - ww, ok := w.(ioEncWriterWriter) - if ok { - e.wi.w = ww - } else { - sww := &e.wi.s - sww.w = w - sww.bw, _ = w.(io.ByteWriter) - sww.sw, _ = w.(ioEncStringWriter) - e.wi.w = sww - //ww = bufio.NewWriterSize(w, defEncByteBufSize) - } - e.w = &e.wi - e.e.reset() -} - -func (e *Encoder) ResetBytes(out *[]byte) { - in := *out - if in == nil { - in = make([]byte, defEncByteBufSize) - } - e.wb.b, e.wb.out, e.wb.c = in, out, 0 - e.w = &e.wb - e.e.reset() -} - -// func (e *Encoder) sendContainerState(c containerState) { -// if e.cr != nil { -// e.cr.sendContainerState(c) -// } -// } - -// Encode writes an object into a stream. -// -// Encoding can be configured via the struct tag for the fields. -// The "codec" key in struct field's tag value is the key name, -// followed by an optional comma and options. -// Note that the "json" key is used in the absence of the "codec" key. -// -// 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. -// -// Struct values "usually" encode as maps. Each exported struct field is encoded unless: -// - 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. -// -// However, struct values may encode as arrays. This happens when: -// - StructToArray Encode option is set, OR -// - the tag on the _struct field sets the "toarray" option -// -// 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 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 -// } -// -// 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 encoding.(Binary|Text|JSON)Marshaler, call its 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() - 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{}) { - e.encode(v) - e.w.atEndOfEncode() -} - -// comment out these (Must)Write methods. They were only put there to support cbor. -// However, users already have access to the streams, and can write directly. -// -// // Write allows users write to the Encoder stream directly. -// func (e *Encoder) Write(bs []byte) (err error) { -// defer panicToErr(&err) -// e.w.writeb(bs) -// return -// } -// // MustWrite is like write, but panics if unable to Write. -// func (e *Encoder) MustWrite(bs []byte) { -// e.w.writeb(bs) -// } - -func (e *Encoder) encode(iv interface{}) { - // if ics, ok := iv.(Selfer); ok { - // ics.CodecEncodeSelf(e) - // return - // } - - switch v := iv.(type) { - case nil: - e.e.EncodeNil() - case Selfer: - v.CodecEncodeSelf(e) - - case reflect.Value: - e.encodeValue(v, nil) - - case string: - e.e.EncodeString(c_UTF8, v) - case bool: - e.e.EncodeBool(v) - case int: - e.e.EncodeInt(int64(v)) - case int8: - e.e.EncodeInt(int64(v)) - case int16: - e.e.EncodeInt(int64(v)) - case int32: - e.e.EncodeInt(int64(v)) - case int64: - e.e.EncodeInt(v) - case uint: - e.e.EncodeUint(uint64(v)) - case uint8: - e.e.EncodeUint(uint64(v)) - case uint16: - e.e.EncodeUint(uint64(v)) - case uint32: - e.e.EncodeUint(uint64(v)) - case uint64: - e.e.EncodeUint(v) - case float32: - e.e.EncodeFloat32(v) - case float64: - e.e.EncodeFloat64(v) - - case []uint8: - e.e.EncodeStringBytes(c_RAW, v) - - case *string: - e.e.EncodeString(c_UTF8, *v) - case *bool: - e.e.EncodeBool(*v) - case *int: - e.e.EncodeInt(int64(*v)) - case *int8: - e.e.EncodeInt(int64(*v)) - case *int16: - e.e.EncodeInt(int64(*v)) - case *int32: - e.e.EncodeInt(int64(*v)) - case *int64: - e.e.EncodeInt(*v) - case *uint: - e.e.EncodeUint(uint64(*v)) - case *uint8: - e.e.EncodeUint(uint64(*v)) - case *uint16: - e.e.EncodeUint(uint64(*v)) - case *uint32: - e.e.EncodeUint(uint64(*v)) - case *uint64: - e.e.EncodeUint(*v) - case *float32: - e.e.EncodeFloat32(*v) - case *float64: - e.e.EncodeFloat64(*v) - - case *[]uint8: - e.e.EncodeStringBytes(c_RAW, *v) - - default: - const checkCodecSelfer1 = true // in case T is passed, where *T is a Selfer, still checkCodecSelfer - if !fastpathEncodeTypeSwitch(iv, e) { - e.encodeI(iv, false, checkCodecSelfer1) - } - } -} - -func (e *Encoder) preEncodeValue(rv reflect.Value) (rv2 reflect.Value, sptr uintptr, proceed bool) { - // use a goto statement instead of a recursive function for ptr/interface. -TOP: - switch rv.Kind() { - case reflect.Ptr: - if rv.IsNil() { - e.e.EncodeNil() - return - } - rv = rv.Elem() - if e.h.CheckCircularRef && rv.Kind() == reflect.Struct { - // TODO: Movable pointers will be an issue here. Future problem. - sptr = rv.UnsafeAddr() - break TOP - } - 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 - } - - proceed = true - rv2 = rv - return -} - -func (e *Encoder) doEncodeValue(rv reflect.Value, fn *encFn, sptr uintptr, - checkFastpath, checkCodecSelfer bool) { - if sptr != 0 { - if (&e.ci).add(sptr) { - e.errorf("circular reference found: # %d", sptr) - } - } - if fn == nil { - rt := rv.Type() - rtid := reflect.ValueOf(rt).Pointer() - // fn = e.getEncFn(rtid, rt, true, true) - fn = e.getEncFn(rtid, rt, checkFastpath, checkCodecSelfer) - } - fn.f(&fn.i, rv) - if sptr != 0 { - (&e.ci).remove(sptr) - } -} - -func (e *Encoder) encodeI(iv interface{}, checkFastpath, checkCodecSelfer bool) { - if rv, sptr, proceed := e.preEncodeValue(reflect.ValueOf(iv)); proceed { - e.doEncodeValue(rv, nil, sptr, checkFastpath, checkCodecSelfer) - } -} - -func (e *Encoder) encodeValue(rv reflect.Value, fn *encFn) { - // if a valid fn is passed, it MUST BE for the dereferenced type of rv - if rv, sptr, proceed := e.preEncodeValue(rv); proceed { - e.doEncodeValue(rv, fn, sptr, true, true) - } -} - -func (e *Encoder) getEncFn(rtid uintptr, rt reflect.Type, checkFastpath, checkCodecSelfer bool) (fn *encFn) { - // rtid := reflect.ValueOf(rt).Pointer() - var ok bool - if useMapForCodecCache { - fn, ok = e.f[rtid] - } else { - for i := range e.s { - v := &(e.s[i]) - if v.rtid == rtid { - fn, ok = &(v.fn), true - break - } - } - } - if ok { - return - } - - if useMapForCodecCache { - if e.f == nil { - e.f = make(map[uintptr]*encFn, initCollectionCap) - } - fn = new(encFn) - e.f[rtid] = fn - } else { - if e.s == nil { - e.s = make([]encRtidFn, 0, initCollectionCap) - } - e.s = append(e.s, encRtidFn{rtid: rtid}) - fn = &(e.s[len(e.s)-1]).fn - } - - ti := e.h.getTypeInfo(rtid, rt) - fi := &(fn.i) - fi.e = e - fi.ti = ti - - if checkCodecSelfer && ti.cs { - fn.f = (*encFnInfo).selferMarshal - } else if rtid == rawExtTypId { - fn.f = (*encFnInfo).rawExt - } else if e.e.IsBuiltinType(rtid) { - fn.f = (*encFnInfo).builtin - } else if xfFn := e.h.getExt(rtid); xfFn != nil { - fi.xfTag, fi.xfFn = xfFn.tag, xfFn.ext - fn.f = (*encFnInfo).ext - } else if supportMarshalInterfaces && e.be && ti.bm { - fn.f = (*encFnInfo).binaryMarshal - } else if supportMarshalInterfaces && !e.be && e.js && ti.jm { - //If JSON, we should check JSONMarshal before textMarshal - fn.f = (*encFnInfo).jsonMarshal - } else if supportMarshalInterfaces && !e.be && ti.tm { - fn.f = (*encFnInfo).textMarshal - } else { - rk := rt.Kind() - if fastpathEnabled && checkFastpath && (rk == reflect.Map || rk == reflect.Slice) { - if rt.PkgPath() == "" { // un-named slice or map - if idx := fastpathAV.index(rtid); idx != -1 { - fn.f = fastpathAV[idx].encfn - } - } else { - ok = false - // use mapping for underlying type if there - var rtu reflect.Type - if rk == reflect.Map { - rtu = reflect.MapOf(rt.Key(), rt.Elem()) - } else { - rtu = reflect.SliceOf(rt.Elem()) - } - rtuid := reflect.ValueOf(rtu).Pointer() - if idx := fastpathAV.index(rtuid); idx != -1 { - xfnf := fastpathAV[idx].encfn - xrt := fastpathAV[idx].rt - fn.f = func(xf *encFnInfo, xrv reflect.Value) { - xfnf(xf, xrv.Convert(xrt)) - } - } - } - } - if fn.f == nil { - switch 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, reflect.Uintptr: - fn.f = (*encFnInfo).kUint - case reflect.Invalid: - fn.f = (*encFnInfo).kInvalid - case reflect.Chan: - fi.seq = seqTypeChan - fn.f = (*encFnInfo).kSlice - case reflect.Slice: - fi.seq = seqTypeSlice - fn.f = (*encFnInfo).kSlice - case reflect.Array: - fi.seq = seqTypeArray - fn.f = (*encFnInfo).kSlice - case reflect.Struct: - fn.f = (*encFnInfo).kStruct - // reflect.Ptr and reflect.Interface are handled already by preEncodeValue - // 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 - } - } - } - - return -} - -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.EncodeStringBytes(c, bs) - } -} - -func (e *Encoder) asis(v []byte) { - if e.as == nil { - e.w.writeb(v) - } else { - e.as.EncodeAsis(v) - } -} - -func (e *Encoder) errorf(format string, params ...interface{}) { - err := fmt.Errorf(format, params...) - panic(err) -} - -// ---------------------------------------- - -const encStructPoolLen = 5 - -// encStructPool is an array of sync.Pool. -// 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. -var encStructPool [encStructPoolLen]sync.Pool - -func init() { - encStructPool[0].New = func() interface{} { return new([8]stringRv) } - encStructPool[1].New = func() interface{} { return new([16]stringRv) } - encStructPool[2].New = func() interface{} { return new([32]stringRv) } - encStructPool[3].New = func() interface{} { return new([64]stringRv) } - encStructPool[4].New = func() interface{} { return new([128]stringRv) } -} - -func encStructPoolGet(newlen int) (p *sync.Pool, v interface{}, s []stringRv) { - // if encStructPoolLen != 5 { // constant chec, so removed at build time. - // panic(errors.New("encStructPoolLen must be equal to 4")) // defensive, in case it is changed - // } - // idxpool := newlen / 8 - if newlen <= 8 { - p = &encStructPool[0] - v = p.Get() - s = v.(*[8]stringRv)[:newlen] - } else if newlen <= 16 { - p = &encStructPool[1] - v = p.Get() - s = v.(*[16]stringRv)[:newlen] - } else if newlen <= 32 { - p = &encStructPool[2] - v = p.Get() - s = v.(*[32]stringRv)[:newlen] - } else if newlen <= 64 { - p = &encStructPool[3] - v = p.Get() - s = v.(*[64]stringRv)[:newlen] - } else if newlen <= 128 { - p = &encStructPool[4] - v = p.Get() - s = v.(*[128]stringRv)[:newlen] - } else { - s = make([]stringRv, newlen) - } - return -} - -// ---------------------------------------- - -// func encErr(format string, params ...interface{}) { -// doPanic(msgTagEnc, format, params...) -// } diff --git a/_vendor/vendor/github.com/ugorji/go/codec/fast-path.generated.go b/_vendor/vendor/github.com/ugorji/go/codec/fast-path.generated.go deleted file mode 100644 index 67b6423..0000000 --- a/_vendor/vendor/github.com/ugorji/go/codec/fast-path.generated.go +++ /dev/null @@ -1,39352 +0,0 @@ -// +build !notfastpath - -// 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. - -// ************************************************************ -// DO NOT EDIT. -// THIS FILE IS AUTO-GENERATED from fast-path.go.tmpl -// ************************************************************ - -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 -// - symetrical 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 fastpathCheckNilFalse = false // for reflect -const fastpathCheckNilTrue = true // for type switch - -type fastpathT struct{} - -var fastpathTV fastpathT - -type fastpathE struct { - rtid uintptr - rt reflect.Type - encfn func(*encFnInfo, reflect.Value) - decfn func(*decFnInfo, 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) - h, i, j := 0, 0, 271 // len(x) - for i < j { - h = i + (j-i)/2 - if x[h].rtid < rtid { - i = h + 1 - } else { - j = h - } - } - if i < 271 && x[i].rtid == rtid { - return i - } - return -1 -} - -type fastpathAslice []fastpathE - -func (x fastpathAslice) Len() int { return len(x) } -func (x fastpathAslice) Less(i, j int) bool { return x[i].rtid < x[j].rtid } -func (x fastpathAslice) Swap(i, j int) { x[i], x[j] = x[j], x[i] } - -var fastpathAV fastpathA - -// due to possible initialization loop error, make fastpath in an init() -func init() { - i := 0 - fn := func(v interface{}, fe func(*encFnInfo, reflect.Value), fd func(*decFnInfo, reflect.Value)) (f fastpathE) { - xrt := reflect.TypeOf(v) - xptr := reflect.ValueOf(xrt).Pointer() - fastpathAV[i] = fastpathE{xptr, xrt, fe, fd} - i++ - return - } - - fn([]interface{}(nil), (*encFnInfo).fastpathEncSliceIntfR, (*decFnInfo).fastpathDecSliceIntfR) - fn([]string(nil), (*encFnInfo).fastpathEncSliceStringR, (*decFnInfo).fastpathDecSliceStringR) - fn([]float32(nil), (*encFnInfo).fastpathEncSliceFloat32R, (*decFnInfo).fastpathDecSliceFloat32R) - fn([]float64(nil), (*encFnInfo).fastpathEncSliceFloat64R, (*decFnInfo).fastpathDecSliceFloat64R) - fn([]uint(nil), (*encFnInfo).fastpathEncSliceUintR, (*decFnInfo).fastpathDecSliceUintR) - fn([]uint16(nil), (*encFnInfo).fastpathEncSliceUint16R, (*decFnInfo).fastpathDecSliceUint16R) - fn([]uint32(nil), (*encFnInfo).fastpathEncSliceUint32R, (*decFnInfo).fastpathDecSliceUint32R) - fn([]uint64(nil), (*encFnInfo).fastpathEncSliceUint64R, (*decFnInfo).fastpathDecSliceUint64R) - fn([]uintptr(nil), (*encFnInfo).fastpathEncSliceUintptrR, (*decFnInfo).fastpathDecSliceUintptrR) - fn([]int(nil), (*encFnInfo).fastpathEncSliceIntR, (*decFnInfo).fastpathDecSliceIntR) - fn([]int8(nil), (*encFnInfo).fastpathEncSliceInt8R, (*decFnInfo).fastpathDecSliceInt8R) - fn([]int16(nil), (*encFnInfo).fastpathEncSliceInt16R, (*decFnInfo).fastpathDecSliceInt16R) - fn([]int32(nil), (*encFnInfo).fastpathEncSliceInt32R, (*decFnInfo).fastpathDecSliceInt32R) - fn([]int64(nil), (*encFnInfo).fastpathEncSliceInt64R, (*decFnInfo).fastpathDecSliceInt64R) - fn([]bool(nil), (*encFnInfo).fastpathEncSliceBoolR, (*decFnInfo).fastpathDecSliceBoolR) - - fn(map[interface{}]interface{}(nil), (*encFnInfo).fastpathEncMapIntfIntfR, (*decFnInfo).fastpathDecMapIntfIntfR) - fn(map[interface{}]string(nil), (*encFnInfo).fastpathEncMapIntfStringR, (*decFnInfo).fastpathDecMapIntfStringR) - fn(map[interface{}]uint(nil), (*encFnInfo).fastpathEncMapIntfUintR, (*decFnInfo).fastpathDecMapIntfUintR) - fn(map[interface{}]uint8(nil), (*encFnInfo).fastpathEncMapIntfUint8R, (*decFnInfo).fastpathDecMapIntfUint8R) - fn(map[interface{}]uint16(nil), (*encFnInfo).fastpathEncMapIntfUint16R, (*decFnInfo).fastpathDecMapIntfUint16R) - fn(map[interface{}]uint32(nil), (*encFnInfo).fastpathEncMapIntfUint32R, (*decFnInfo).fastpathDecMapIntfUint32R) - fn(map[interface{}]uint64(nil), (*encFnInfo).fastpathEncMapIntfUint64R, (*decFnInfo).fastpathDecMapIntfUint64R) - fn(map[interface{}]uintptr(nil), (*encFnInfo).fastpathEncMapIntfUintptrR, (*decFnInfo).fastpathDecMapIntfUintptrR) - fn(map[interface{}]int(nil), (*encFnInfo).fastpathEncMapIntfIntR, (*decFnInfo).fastpathDecMapIntfIntR) - fn(map[interface{}]int8(nil), (*encFnInfo).fastpathEncMapIntfInt8R, (*decFnInfo).fastpathDecMapIntfInt8R) - fn(map[interface{}]int16(nil), (*encFnInfo).fastpathEncMapIntfInt16R, (*decFnInfo).fastpathDecMapIntfInt16R) - fn(map[interface{}]int32(nil), (*encFnInfo).fastpathEncMapIntfInt32R, (*decFnInfo).fastpathDecMapIntfInt32R) - fn(map[interface{}]int64(nil), (*encFnInfo).fastpathEncMapIntfInt64R, (*decFnInfo).fastpathDecMapIntfInt64R) - fn(map[interface{}]float32(nil), (*encFnInfo).fastpathEncMapIntfFloat32R, (*decFnInfo).fastpathDecMapIntfFloat32R) - fn(map[interface{}]float64(nil), (*encFnInfo).fastpathEncMapIntfFloat64R, (*decFnInfo).fastpathDecMapIntfFloat64R) - fn(map[interface{}]bool(nil), (*encFnInfo).fastpathEncMapIntfBoolR, (*decFnInfo).fastpathDecMapIntfBoolR) - fn(map[string]interface{}(nil), (*encFnInfo).fastpathEncMapStringIntfR, (*decFnInfo).fastpathDecMapStringIntfR) - fn(map[string]string(nil), (*encFnInfo).fastpathEncMapStringStringR, (*decFnInfo).fastpathDecMapStringStringR) - fn(map[string]uint(nil), (*encFnInfo).fastpathEncMapStringUintR, (*decFnInfo).fastpathDecMapStringUintR) - fn(map[string]uint8(nil), (*encFnInfo).fastpathEncMapStringUint8R, (*decFnInfo).fastpathDecMapStringUint8R) - fn(map[string]uint16(nil), (*encFnInfo).fastpathEncMapStringUint16R, (*decFnInfo).fastpathDecMapStringUint16R) - fn(map[string]uint32(nil), (*encFnInfo).fastpathEncMapStringUint32R, (*decFnInfo).fastpathDecMapStringUint32R) - fn(map[string]uint64(nil), (*encFnInfo).fastpathEncMapStringUint64R, (*decFnInfo).fastpathDecMapStringUint64R) - fn(map[string]uintptr(nil), (*encFnInfo).fastpathEncMapStringUintptrR, (*decFnInfo).fastpathDecMapStringUintptrR) - fn(map[string]int(nil), (*encFnInfo).fastpathEncMapStringIntR, (*decFnInfo).fastpathDecMapStringIntR) - fn(map[string]int8(nil), (*encFnInfo).fastpathEncMapStringInt8R, (*decFnInfo).fastpathDecMapStringInt8R) - fn(map[string]int16(nil), (*encFnInfo).fastpathEncMapStringInt16R, (*decFnInfo).fastpathDecMapStringInt16R) - fn(map[string]int32(nil), (*encFnInfo).fastpathEncMapStringInt32R, (*decFnInfo).fastpathDecMapStringInt32R) - fn(map[string]int64(nil), (*encFnInfo).fastpathEncMapStringInt64R, (*decFnInfo).fastpathDecMapStringInt64R) - fn(map[string]float32(nil), (*encFnInfo).fastpathEncMapStringFloat32R, (*decFnInfo).fastpathDecMapStringFloat32R) - fn(map[string]float64(nil), (*encFnInfo).fastpathEncMapStringFloat64R, (*decFnInfo).fastpathDecMapStringFloat64R) - fn(map[string]bool(nil), (*encFnInfo).fastpathEncMapStringBoolR, (*decFnInfo).fastpathDecMapStringBoolR) - fn(map[float32]interface{}(nil), (*encFnInfo).fastpathEncMapFloat32IntfR, (*decFnInfo).fastpathDecMapFloat32IntfR) - fn(map[float32]string(nil), (*encFnInfo).fastpathEncMapFloat32StringR, (*decFnInfo).fastpathDecMapFloat32StringR) - fn(map[float32]uint(nil), (*encFnInfo).fastpathEncMapFloat32UintR, (*decFnInfo).fastpathDecMapFloat32UintR) - fn(map[float32]uint8(nil), (*encFnInfo).fastpathEncMapFloat32Uint8R, (*decFnInfo).fastpathDecMapFloat32Uint8R) - fn(map[float32]uint16(nil), (*encFnInfo).fastpathEncMapFloat32Uint16R, (*decFnInfo).fastpathDecMapFloat32Uint16R) - fn(map[float32]uint32(nil), (*encFnInfo).fastpathEncMapFloat32Uint32R, (*decFnInfo).fastpathDecMapFloat32Uint32R) - fn(map[float32]uint64(nil), (*encFnInfo).fastpathEncMapFloat32Uint64R, (*decFnInfo).fastpathDecMapFloat32Uint64R) - fn(map[float32]uintptr(nil), (*encFnInfo).fastpathEncMapFloat32UintptrR, (*decFnInfo).fastpathDecMapFloat32UintptrR) - fn(map[float32]int(nil), (*encFnInfo).fastpathEncMapFloat32IntR, (*decFnInfo).fastpathDecMapFloat32IntR) - fn(map[float32]int8(nil), (*encFnInfo).fastpathEncMapFloat32Int8R, (*decFnInfo).fastpathDecMapFloat32Int8R) - fn(map[float32]int16(nil), (*encFnInfo).fastpathEncMapFloat32Int16R, (*decFnInfo).fastpathDecMapFloat32Int16R) - fn(map[float32]int32(nil), (*encFnInfo).fastpathEncMapFloat32Int32R, (*decFnInfo).fastpathDecMapFloat32Int32R) - fn(map[float32]int64(nil), (*encFnInfo).fastpathEncMapFloat32Int64R, (*decFnInfo).fastpathDecMapFloat32Int64R) - fn(map[float32]float32(nil), (*encFnInfo).fastpathEncMapFloat32Float32R, (*decFnInfo).fastpathDecMapFloat32Float32R) - fn(map[float32]float64(nil), (*encFnInfo).fastpathEncMapFloat32Float64R, (*decFnInfo).fastpathDecMapFloat32Float64R) - fn(map[float32]bool(nil), (*encFnInfo).fastpathEncMapFloat32BoolR, (*decFnInfo).fastpathDecMapFloat32BoolR) - fn(map[float64]interface{}(nil), (*encFnInfo).fastpathEncMapFloat64IntfR, (*decFnInfo).fastpathDecMapFloat64IntfR) - fn(map[float64]string(nil), (*encFnInfo).fastpathEncMapFloat64StringR, (*decFnInfo).fastpathDecMapFloat64StringR) - fn(map[float64]uint(nil), (*encFnInfo).fastpathEncMapFloat64UintR, (*decFnInfo).fastpathDecMapFloat64UintR) - fn(map[float64]uint8(nil), (*encFnInfo).fastpathEncMapFloat64Uint8R, (*decFnInfo).fastpathDecMapFloat64Uint8R) - fn(map[float64]uint16(nil), (*encFnInfo).fastpathEncMapFloat64Uint16R, (*decFnInfo).fastpathDecMapFloat64Uint16R) - fn(map[float64]uint32(nil), (*encFnInfo).fastpathEncMapFloat64Uint32R, (*decFnInfo).fastpathDecMapFloat64Uint32R) - fn(map[float64]uint64(nil), (*encFnInfo).fastpathEncMapFloat64Uint64R, (*decFnInfo).fastpathDecMapFloat64Uint64R) - fn(map[float64]uintptr(nil), (*encFnInfo).fastpathEncMapFloat64UintptrR, (*decFnInfo).fastpathDecMapFloat64UintptrR) - fn(map[float64]int(nil), (*encFnInfo).fastpathEncMapFloat64IntR, (*decFnInfo).fastpathDecMapFloat64IntR) - fn(map[float64]int8(nil), (*encFnInfo).fastpathEncMapFloat64Int8R, (*decFnInfo).fastpathDecMapFloat64Int8R) - fn(map[float64]int16(nil), (*encFnInfo).fastpathEncMapFloat64Int16R, (*decFnInfo).fastpathDecMapFloat64Int16R) - fn(map[float64]int32(nil), (*encFnInfo).fastpathEncMapFloat64Int32R, (*decFnInfo).fastpathDecMapFloat64Int32R) - fn(map[float64]int64(nil), (*encFnInfo).fastpathEncMapFloat64Int64R, (*decFnInfo).fastpathDecMapFloat64Int64R) - fn(map[float64]float32(nil), (*encFnInfo).fastpathEncMapFloat64Float32R, (*decFnInfo).fastpathDecMapFloat64Float32R) - fn(map[float64]float64(nil), (*encFnInfo).fastpathEncMapFloat64Float64R, (*decFnInfo).fastpathDecMapFloat64Float64R) - fn(map[float64]bool(nil), (*encFnInfo).fastpathEncMapFloat64BoolR, (*decFnInfo).fastpathDecMapFloat64BoolR) - fn(map[uint]interface{}(nil), (*encFnInfo).fastpathEncMapUintIntfR, (*decFnInfo).fastpathDecMapUintIntfR) - fn(map[uint]string(nil), (*encFnInfo).fastpathEncMapUintStringR, (*decFnInfo).fastpathDecMapUintStringR) - fn(map[uint]uint(nil), (*encFnInfo).fastpathEncMapUintUintR, (*decFnInfo).fastpathDecMapUintUintR) - fn(map[uint]uint8(nil), (*encFnInfo).fastpathEncMapUintUint8R, (*decFnInfo).fastpathDecMapUintUint8R) - fn(map[uint]uint16(nil), (*encFnInfo).fastpathEncMapUintUint16R, (*decFnInfo).fastpathDecMapUintUint16R) - fn(map[uint]uint32(nil), (*encFnInfo).fastpathEncMapUintUint32R, (*decFnInfo).fastpathDecMapUintUint32R) - fn(map[uint]uint64(nil), (*encFnInfo).fastpathEncMapUintUint64R, (*decFnInfo).fastpathDecMapUintUint64R) - fn(map[uint]uintptr(nil), (*encFnInfo).fastpathEncMapUintUintptrR, (*decFnInfo).fastpathDecMapUintUintptrR) - fn(map[uint]int(nil), (*encFnInfo).fastpathEncMapUintIntR, (*decFnInfo).fastpathDecMapUintIntR) - fn(map[uint]int8(nil), (*encFnInfo).fastpathEncMapUintInt8R, (*decFnInfo).fastpathDecMapUintInt8R) - fn(map[uint]int16(nil), (*encFnInfo).fastpathEncMapUintInt16R, (*decFnInfo).fastpathDecMapUintInt16R) - fn(map[uint]int32(nil), (*encFnInfo).fastpathEncMapUintInt32R, (*decFnInfo).fastpathDecMapUintInt32R) - fn(map[uint]int64(nil), (*encFnInfo).fastpathEncMapUintInt64R, (*decFnInfo).fastpathDecMapUintInt64R) - fn(map[uint]float32(nil), (*encFnInfo).fastpathEncMapUintFloat32R, (*decFnInfo).fastpathDecMapUintFloat32R) - fn(map[uint]float64(nil), (*encFnInfo).fastpathEncMapUintFloat64R, (*decFnInfo).fastpathDecMapUintFloat64R) - fn(map[uint]bool(nil), (*encFnInfo).fastpathEncMapUintBoolR, (*decFnInfo).fastpathDecMapUintBoolR) - fn(map[uint8]interface{}(nil), (*encFnInfo).fastpathEncMapUint8IntfR, (*decFnInfo).fastpathDecMapUint8IntfR) - fn(map[uint8]string(nil), (*encFnInfo).fastpathEncMapUint8StringR, (*decFnInfo).fastpathDecMapUint8StringR) - fn(map[uint8]uint(nil), (*encFnInfo).fastpathEncMapUint8UintR, (*decFnInfo).fastpathDecMapUint8UintR) - fn(map[uint8]uint8(nil), (*encFnInfo).fastpathEncMapUint8Uint8R, (*decFnInfo).fastpathDecMapUint8Uint8R) - fn(map[uint8]uint16(nil), (*encFnInfo).fastpathEncMapUint8Uint16R, (*decFnInfo).fastpathDecMapUint8Uint16R) - fn(map[uint8]uint32(nil), (*encFnInfo).fastpathEncMapUint8Uint32R, (*decFnInfo).fastpathDecMapUint8Uint32R) - fn(map[uint8]uint64(nil), (*encFnInfo).fastpathEncMapUint8Uint64R, (*decFnInfo).fastpathDecMapUint8Uint64R) - fn(map[uint8]uintptr(nil), (*encFnInfo).fastpathEncMapUint8UintptrR, (*decFnInfo).fastpathDecMapUint8UintptrR) - fn(map[uint8]int(nil), (*encFnInfo).fastpathEncMapUint8IntR, (*decFnInfo).fastpathDecMapUint8IntR) - fn(map[uint8]int8(nil), (*encFnInfo).fastpathEncMapUint8Int8R, (*decFnInfo).fastpathDecMapUint8Int8R) - fn(map[uint8]int16(nil), (*encFnInfo).fastpathEncMapUint8Int16R, (*decFnInfo).fastpathDecMapUint8Int16R) - fn(map[uint8]int32(nil), (*encFnInfo).fastpathEncMapUint8Int32R, (*decFnInfo).fastpathDecMapUint8Int32R) - fn(map[uint8]int64(nil), (*encFnInfo).fastpathEncMapUint8Int64R, (*decFnInfo).fastpathDecMapUint8Int64R) - fn(map[uint8]float32(nil), (*encFnInfo).fastpathEncMapUint8Float32R, (*decFnInfo).fastpathDecMapUint8Float32R) - fn(map[uint8]float64(nil), (*encFnInfo).fastpathEncMapUint8Float64R, (*decFnInfo).fastpathDecMapUint8Float64R) - fn(map[uint8]bool(nil), (*encFnInfo).fastpathEncMapUint8BoolR, (*decFnInfo).fastpathDecMapUint8BoolR) - fn(map[uint16]interface{}(nil), (*encFnInfo).fastpathEncMapUint16IntfR, (*decFnInfo).fastpathDecMapUint16IntfR) - fn(map[uint16]string(nil), (*encFnInfo).fastpathEncMapUint16StringR, (*decFnInfo).fastpathDecMapUint16StringR) - fn(map[uint16]uint(nil), (*encFnInfo).fastpathEncMapUint16UintR, (*decFnInfo).fastpathDecMapUint16UintR) - fn(map[uint16]uint8(nil), (*encFnInfo).fastpathEncMapUint16Uint8R, (*decFnInfo).fastpathDecMapUint16Uint8R) - fn(map[uint16]uint16(nil), (*encFnInfo).fastpathEncMapUint16Uint16R, (*decFnInfo).fastpathDecMapUint16Uint16R) - fn(map[uint16]uint32(nil), (*encFnInfo).fastpathEncMapUint16Uint32R, (*decFnInfo).fastpathDecMapUint16Uint32R) - fn(map[uint16]uint64(nil), (*encFnInfo).fastpathEncMapUint16Uint64R, (*decFnInfo).fastpathDecMapUint16Uint64R) - fn(map[uint16]uintptr(nil), (*encFnInfo).fastpathEncMapUint16UintptrR, (*decFnInfo).fastpathDecMapUint16UintptrR) - fn(map[uint16]int(nil), (*encFnInfo).fastpathEncMapUint16IntR, (*decFnInfo).fastpathDecMapUint16IntR) - fn(map[uint16]int8(nil), (*encFnInfo).fastpathEncMapUint16Int8R, (*decFnInfo).fastpathDecMapUint16Int8R) - fn(map[uint16]int16(nil), (*encFnInfo).fastpathEncMapUint16Int16R, (*decFnInfo).fastpathDecMapUint16Int16R) - fn(map[uint16]int32(nil), (*encFnInfo).fastpathEncMapUint16Int32R, (*decFnInfo).fastpathDecMapUint16Int32R) - fn(map[uint16]int64(nil), (*encFnInfo).fastpathEncMapUint16Int64R, (*decFnInfo).fastpathDecMapUint16Int64R) - fn(map[uint16]float32(nil), (*encFnInfo).fastpathEncMapUint16Float32R, (*decFnInfo).fastpathDecMapUint16Float32R) - fn(map[uint16]float64(nil), (*encFnInfo).fastpathEncMapUint16Float64R, (*decFnInfo).fastpathDecMapUint16Float64R) - fn(map[uint16]bool(nil), (*encFnInfo).fastpathEncMapUint16BoolR, (*decFnInfo).fastpathDecMapUint16BoolR) - fn(map[uint32]interface{}(nil), (*encFnInfo).fastpathEncMapUint32IntfR, (*decFnInfo).fastpathDecMapUint32IntfR) - fn(map[uint32]string(nil), (*encFnInfo).fastpathEncMapUint32StringR, (*decFnInfo).fastpathDecMapUint32StringR) - fn(map[uint32]uint(nil), (*encFnInfo).fastpathEncMapUint32UintR, (*decFnInfo).fastpathDecMapUint32UintR) - fn(map[uint32]uint8(nil), (*encFnInfo).fastpathEncMapUint32Uint8R, (*decFnInfo).fastpathDecMapUint32Uint8R) - fn(map[uint32]uint16(nil), (*encFnInfo).fastpathEncMapUint32Uint16R, (*decFnInfo).fastpathDecMapUint32Uint16R) - fn(map[uint32]uint32(nil), (*encFnInfo).fastpathEncMapUint32Uint32R, (*decFnInfo).fastpathDecMapUint32Uint32R) - fn(map[uint32]uint64(nil), (*encFnInfo).fastpathEncMapUint32Uint64R, (*decFnInfo).fastpathDecMapUint32Uint64R) - fn(map[uint32]uintptr(nil), (*encFnInfo).fastpathEncMapUint32UintptrR, (*decFnInfo).fastpathDecMapUint32UintptrR) - fn(map[uint32]int(nil), (*encFnInfo).fastpathEncMapUint32IntR, (*decFnInfo).fastpathDecMapUint32IntR) - fn(map[uint32]int8(nil), (*encFnInfo).fastpathEncMapUint32Int8R, (*decFnInfo).fastpathDecMapUint32Int8R) - fn(map[uint32]int16(nil), (*encFnInfo).fastpathEncMapUint32Int16R, (*decFnInfo).fastpathDecMapUint32Int16R) - fn(map[uint32]int32(nil), (*encFnInfo).fastpathEncMapUint32Int32R, (*decFnInfo).fastpathDecMapUint32Int32R) - fn(map[uint32]int64(nil), (*encFnInfo).fastpathEncMapUint32Int64R, (*decFnInfo).fastpathDecMapUint32Int64R) - fn(map[uint32]float32(nil), (*encFnInfo).fastpathEncMapUint32Float32R, (*decFnInfo).fastpathDecMapUint32Float32R) - fn(map[uint32]float64(nil), (*encFnInfo).fastpathEncMapUint32Float64R, (*decFnInfo).fastpathDecMapUint32Float64R) - fn(map[uint32]bool(nil), (*encFnInfo).fastpathEncMapUint32BoolR, (*decFnInfo).fastpathDecMapUint32BoolR) - fn(map[uint64]interface{}(nil), (*encFnInfo).fastpathEncMapUint64IntfR, (*decFnInfo).fastpathDecMapUint64IntfR) - fn(map[uint64]string(nil), (*encFnInfo).fastpathEncMapUint64StringR, (*decFnInfo).fastpathDecMapUint64StringR) - fn(map[uint64]uint(nil), (*encFnInfo).fastpathEncMapUint64UintR, (*decFnInfo).fastpathDecMapUint64UintR) - fn(map[uint64]uint8(nil), (*encFnInfo).fastpathEncMapUint64Uint8R, (*decFnInfo).fastpathDecMapUint64Uint8R) - fn(map[uint64]uint16(nil), (*encFnInfo).fastpathEncMapUint64Uint16R, (*decFnInfo).fastpathDecMapUint64Uint16R) - fn(map[uint64]uint32(nil), (*encFnInfo).fastpathEncMapUint64Uint32R, (*decFnInfo).fastpathDecMapUint64Uint32R) - fn(map[uint64]uint64(nil), (*encFnInfo).fastpathEncMapUint64Uint64R, (*decFnInfo).fastpathDecMapUint64Uint64R) - fn(map[uint64]uintptr(nil), (*encFnInfo).fastpathEncMapUint64UintptrR, (*decFnInfo).fastpathDecMapUint64UintptrR) - fn(map[uint64]int(nil), (*encFnInfo).fastpathEncMapUint64IntR, (*decFnInfo).fastpathDecMapUint64IntR) - fn(map[uint64]int8(nil), (*encFnInfo).fastpathEncMapUint64Int8R, (*decFnInfo).fastpathDecMapUint64Int8R) - fn(map[uint64]int16(nil), (*encFnInfo).fastpathEncMapUint64Int16R, (*decFnInfo).fastpathDecMapUint64Int16R) - fn(map[uint64]int32(nil), (*encFnInfo).fastpathEncMapUint64Int32R, (*decFnInfo).fastpathDecMapUint64Int32R) - fn(map[uint64]int64(nil), (*encFnInfo).fastpathEncMapUint64Int64R, (*decFnInfo).fastpathDecMapUint64Int64R) - fn(map[uint64]float32(nil), (*encFnInfo).fastpathEncMapUint64Float32R, (*decFnInfo).fastpathDecMapUint64Float32R) - fn(map[uint64]float64(nil), (*encFnInfo).fastpathEncMapUint64Float64R, (*decFnInfo).fastpathDecMapUint64Float64R) - fn(map[uint64]bool(nil), (*encFnInfo).fastpathEncMapUint64BoolR, (*decFnInfo).fastpathDecMapUint64BoolR) - fn(map[uintptr]interface{}(nil), (*encFnInfo).fastpathEncMapUintptrIntfR, (*decFnInfo).fastpathDecMapUintptrIntfR) - fn(map[uintptr]string(nil), (*encFnInfo).fastpathEncMapUintptrStringR, (*decFnInfo).fastpathDecMapUintptrStringR) - fn(map[uintptr]uint(nil), (*encFnInfo).fastpathEncMapUintptrUintR, (*decFnInfo).fastpathDecMapUintptrUintR) - fn(map[uintptr]uint8(nil), (*encFnInfo).fastpathEncMapUintptrUint8R, (*decFnInfo).fastpathDecMapUintptrUint8R) - fn(map[uintptr]uint16(nil), (*encFnInfo).fastpathEncMapUintptrUint16R, (*decFnInfo).fastpathDecMapUintptrUint16R) - fn(map[uintptr]uint32(nil), (*encFnInfo).fastpathEncMapUintptrUint32R, (*decFnInfo).fastpathDecMapUintptrUint32R) - fn(map[uintptr]uint64(nil), (*encFnInfo).fastpathEncMapUintptrUint64R, (*decFnInfo).fastpathDecMapUintptrUint64R) - fn(map[uintptr]uintptr(nil), (*encFnInfo).fastpathEncMapUintptrUintptrR, (*decFnInfo).fastpathDecMapUintptrUintptrR) - fn(map[uintptr]int(nil), (*encFnInfo).fastpathEncMapUintptrIntR, (*decFnInfo).fastpathDecMapUintptrIntR) - fn(map[uintptr]int8(nil), (*encFnInfo).fastpathEncMapUintptrInt8R, (*decFnInfo).fastpathDecMapUintptrInt8R) - fn(map[uintptr]int16(nil), (*encFnInfo).fastpathEncMapUintptrInt16R, (*decFnInfo).fastpathDecMapUintptrInt16R) - fn(map[uintptr]int32(nil), (*encFnInfo).fastpathEncMapUintptrInt32R, (*decFnInfo).fastpathDecMapUintptrInt32R) - fn(map[uintptr]int64(nil), (*encFnInfo).fastpathEncMapUintptrInt64R, (*decFnInfo).fastpathDecMapUintptrInt64R) - fn(map[uintptr]float32(nil), (*encFnInfo).fastpathEncMapUintptrFloat32R, (*decFnInfo).fastpathDecMapUintptrFloat32R) - fn(map[uintptr]float64(nil), (*encFnInfo).fastpathEncMapUintptrFloat64R, (*decFnInfo).fastpathDecMapUintptrFloat64R) - fn(map[uintptr]bool(nil), (*encFnInfo).fastpathEncMapUintptrBoolR, (*decFnInfo).fastpathDecMapUintptrBoolR) - fn(map[int]interface{}(nil), (*encFnInfo).fastpathEncMapIntIntfR, (*decFnInfo).fastpathDecMapIntIntfR) - fn(map[int]string(nil), (*encFnInfo).fastpathEncMapIntStringR, (*decFnInfo).fastpathDecMapIntStringR) - fn(map[int]uint(nil), (*encFnInfo).fastpathEncMapIntUintR, (*decFnInfo).fastpathDecMapIntUintR) - fn(map[int]uint8(nil), (*encFnInfo).fastpathEncMapIntUint8R, (*decFnInfo).fastpathDecMapIntUint8R) - fn(map[int]uint16(nil), (*encFnInfo).fastpathEncMapIntUint16R, (*decFnInfo).fastpathDecMapIntUint16R) - fn(map[int]uint32(nil), (*encFnInfo).fastpathEncMapIntUint32R, (*decFnInfo).fastpathDecMapIntUint32R) - fn(map[int]uint64(nil), (*encFnInfo).fastpathEncMapIntUint64R, (*decFnInfo).fastpathDecMapIntUint64R) - fn(map[int]uintptr(nil), (*encFnInfo).fastpathEncMapIntUintptrR, (*decFnInfo).fastpathDecMapIntUintptrR) - fn(map[int]int(nil), (*encFnInfo).fastpathEncMapIntIntR, (*decFnInfo).fastpathDecMapIntIntR) - fn(map[int]int8(nil), (*encFnInfo).fastpathEncMapIntInt8R, (*decFnInfo).fastpathDecMapIntInt8R) - fn(map[int]int16(nil), (*encFnInfo).fastpathEncMapIntInt16R, (*decFnInfo).fastpathDecMapIntInt16R) - fn(map[int]int32(nil), (*encFnInfo).fastpathEncMapIntInt32R, (*decFnInfo).fastpathDecMapIntInt32R) - fn(map[int]int64(nil), (*encFnInfo).fastpathEncMapIntInt64R, (*decFnInfo).fastpathDecMapIntInt64R) - fn(map[int]float32(nil), (*encFnInfo).fastpathEncMapIntFloat32R, (*decFnInfo).fastpathDecMapIntFloat32R) - fn(map[int]float64(nil), (*encFnInfo).fastpathEncMapIntFloat64R, (*decFnInfo).fastpathDecMapIntFloat64R) - fn(map[int]bool(nil), (*encFnInfo).fastpathEncMapIntBoolR, (*decFnInfo).fastpathDecMapIntBoolR) - fn(map[int8]interface{}(nil), (*encFnInfo).fastpathEncMapInt8IntfR, (*decFnInfo).fastpathDecMapInt8IntfR) - fn(map[int8]string(nil), (*encFnInfo).fastpathEncMapInt8StringR, (*decFnInfo).fastpathDecMapInt8StringR) - fn(map[int8]uint(nil), (*encFnInfo).fastpathEncMapInt8UintR, (*decFnInfo).fastpathDecMapInt8UintR) - fn(map[int8]uint8(nil), (*encFnInfo).fastpathEncMapInt8Uint8R, (*decFnInfo).fastpathDecMapInt8Uint8R) - fn(map[int8]uint16(nil), (*encFnInfo).fastpathEncMapInt8Uint16R, (*decFnInfo).fastpathDecMapInt8Uint16R) - fn(map[int8]uint32(nil), (*encFnInfo).fastpathEncMapInt8Uint32R, (*decFnInfo).fastpathDecMapInt8Uint32R) - fn(map[int8]uint64(nil), (*encFnInfo).fastpathEncMapInt8Uint64R, (*decFnInfo).fastpathDecMapInt8Uint64R) - fn(map[int8]uintptr(nil), (*encFnInfo).fastpathEncMapInt8UintptrR, (*decFnInfo).fastpathDecMapInt8UintptrR) - fn(map[int8]int(nil), (*encFnInfo).fastpathEncMapInt8IntR, (*decFnInfo).fastpathDecMapInt8IntR) - fn(map[int8]int8(nil), (*encFnInfo).fastpathEncMapInt8Int8R, (*decFnInfo).fastpathDecMapInt8Int8R) - fn(map[int8]int16(nil), (*encFnInfo).fastpathEncMapInt8Int16R, (*decFnInfo).fastpathDecMapInt8Int16R) - fn(map[int8]int32(nil), (*encFnInfo).fastpathEncMapInt8Int32R, (*decFnInfo).fastpathDecMapInt8Int32R) - fn(map[int8]int64(nil), (*encFnInfo).fastpathEncMapInt8Int64R, (*decFnInfo).fastpathDecMapInt8Int64R) - fn(map[int8]float32(nil), (*encFnInfo).fastpathEncMapInt8Float32R, (*decFnInfo).fastpathDecMapInt8Float32R) - fn(map[int8]float64(nil), (*encFnInfo).fastpathEncMapInt8Float64R, (*decFnInfo).fastpathDecMapInt8Float64R) - fn(map[int8]bool(nil), (*encFnInfo).fastpathEncMapInt8BoolR, (*decFnInfo).fastpathDecMapInt8BoolR) - fn(map[int16]interface{}(nil), (*encFnInfo).fastpathEncMapInt16IntfR, (*decFnInfo).fastpathDecMapInt16IntfR) - fn(map[int16]string(nil), (*encFnInfo).fastpathEncMapInt16StringR, (*decFnInfo).fastpathDecMapInt16StringR) - fn(map[int16]uint(nil), (*encFnInfo).fastpathEncMapInt16UintR, (*decFnInfo).fastpathDecMapInt16UintR) - fn(map[int16]uint8(nil), (*encFnInfo).fastpathEncMapInt16Uint8R, (*decFnInfo).fastpathDecMapInt16Uint8R) - fn(map[int16]uint16(nil), (*encFnInfo).fastpathEncMapInt16Uint16R, (*decFnInfo).fastpathDecMapInt16Uint16R) - fn(map[int16]uint32(nil), (*encFnInfo).fastpathEncMapInt16Uint32R, (*decFnInfo).fastpathDecMapInt16Uint32R) - fn(map[int16]uint64(nil), (*encFnInfo).fastpathEncMapInt16Uint64R, (*decFnInfo).fastpathDecMapInt16Uint64R) - fn(map[int16]uintptr(nil), (*encFnInfo).fastpathEncMapInt16UintptrR, (*decFnInfo).fastpathDecMapInt16UintptrR) - fn(map[int16]int(nil), (*encFnInfo).fastpathEncMapInt16IntR, (*decFnInfo).fastpathDecMapInt16IntR) - fn(map[int16]int8(nil), (*encFnInfo).fastpathEncMapInt16Int8R, (*decFnInfo).fastpathDecMapInt16Int8R) - fn(map[int16]int16(nil), (*encFnInfo).fastpathEncMapInt16Int16R, (*decFnInfo).fastpathDecMapInt16Int16R) - fn(map[int16]int32(nil), (*encFnInfo).fastpathEncMapInt16Int32R, (*decFnInfo).fastpathDecMapInt16Int32R) - fn(map[int16]int64(nil), (*encFnInfo).fastpathEncMapInt16Int64R, (*decFnInfo).fastpathDecMapInt16Int64R) - fn(map[int16]float32(nil), (*encFnInfo).fastpathEncMapInt16Float32R, (*decFnInfo).fastpathDecMapInt16Float32R) - fn(map[int16]float64(nil), (*encFnInfo).fastpathEncMapInt16Float64R, (*decFnInfo).fastpathDecMapInt16Float64R) - fn(map[int16]bool(nil), (*encFnInfo).fastpathEncMapInt16BoolR, (*decFnInfo).fastpathDecMapInt16BoolR) - fn(map[int32]interface{}(nil), (*encFnInfo).fastpathEncMapInt32IntfR, (*decFnInfo).fastpathDecMapInt32IntfR) - fn(map[int32]string(nil), (*encFnInfo).fastpathEncMapInt32StringR, (*decFnInfo).fastpathDecMapInt32StringR) - fn(map[int32]uint(nil), (*encFnInfo).fastpathEncMapInt32UintR, (*decFnInfo).fastpathDecMapInt32UintR) - fn(map[int32]uint8(nil), (*encFnInfo).fastpathEncMapInt32Uint8R, (*decFnInfo).fastpathDecMapInt32Uint8R) - fn(map[int32]uint16(nil), (*encFnInfo).fastpathEncMapInt32Uint16R, (*decFnInfo).fastpathDecMapInt32Uint16R) - fn(map[int32]uint32(nil), (*encFnInfo).fastpathEncMapInt32Uint32R, (*decFnInfo).fastpathDecMapInt32Uint32R) - fn(map[int32]uint64(nil), (*encFnInfo).fastpathEncMapInt32Uint64R, (*decFnInfo).fastpathDecMapInt32Uint64R) - fn(map[int32]uintptr(nil), (*encFnInfo).fastpathEncMapInt32UintptrR, (*decFnInfo).fastpathDecMapInt32UintptrR) - fn(map[int32]int(nil), (*encFnInfo).fastpathEncMapInt32IntR, (*decFnInfo).fastpathDecMapInt32IntR) - fn(map[int32]int8(nil), (*encFnInfo).fastpathEncMapInt32Int8R, (*decFnInfo).fastpathDecMapInt32Int8R) - fn(map[int32]int16(nil), (*encFnInfo).fastpathEncMapInt32Int16R, (*decFnInfo).fastpathDecMapInt32Int16R) - fn(map[int32]int32(nil), (*encFnInfo).fastpathEncMapInt32Int32R, (*decFnInfo).fastpathDecMapInt32Int32R) - fn(map[int32]int64(nil), (*encFnInfo).fastpathEncMapInt32Int64R, (*decFnInfo).fastpathDecMapInt32Int64R) - fn(map[int32]float32(nil), (*encFnInfo).fastpathEncMapInt32Float32R, (*decFnInfo).fastpathDecMapInt32Float32R) - fn(map[int32]float64(nil), (*encFnInfo).fastpathEncMapInt32Float64R, (*decFnInfo).fastpathDecMapInt32Float64R) - fn(map[int32]bool(nil), (*encFnInfo).fastpathEncMapInt32BoolR, (*decFnInfo).fastpathDecMapInt32BoolR) - fn(map[int64]interface{}(nil), (*encFnInfo).fastpathEncMapInt64IntfR, (*decFnInfo).fastpathDecMapInt64IntfR) - fn(map[int64]string(nil), (*encFnInfo).fastpathEncMapInt64StringR, (*decFnInfo).fastpathDecMapInt64StringR) - fn(map[int64]uint(nil), (*encFnInfo).fastpathEncMapInt64UintR, (*decFnInfo).fastpathDecMapInt64UintR) - fn(map[int64]uint8(nil), (*encFnInfo).fastpathEncMapInt64Uint8R, (*decFnInfo).fastpathDecMapInt64Uint8R) - fn(map[int64]uint16(nil), (*encFnInfo).fastpathEncMapInt64Uint16R, (*decFnInfo).fastpathDecMapInt64Uint16R) - fn(map[int64]uint32(nil), (*encFnInfo).fastpathEncMapInt64Uint32R, (*decFnInfo).fastpathDecMapInt64Uint32R) - fn(map[int64]uint64(nil), (*encFnInfo).fastpathEncMapInt64Uint64R, (*decFnInfo).fastpathDecMapInt64Uint64R) - fn(map[int64]uintptr(nil), (*encFnInfo).fastpathEncMapInt64UintptrR, (*decFnInfo).fastpathDecMapInt64UintptrR) - fn(map[int64]int(nil), (*encFnInfo).fastpathEncMapInt64IntR, (*decFnInfo).fastpathDecMapInt64IntR) - fn(map[int64]int8(nil), (*encFnInfo).fastpathEncMapInt64Int8R, (*decFnInfo).fastpathDecMapInt64Int8R) - fn(map[int64]int16(nil), (*encFnInfo).fastpathEncMapInt64Int16R, (*decFnInfo).fastpathDecMapInt64Int16R) - fn(map[int64]int32(nil), (*encFnInfo).fastpathEncMapInt64Int32R, (*decFnInfo).fastpathDecMapInt64Int32R) - fn(map[int64]int64(nil), (*encFnInfo).fastpathEncMapInt64Int64R, (*decFnInfo).fastpathDecMapInt64Int64R) - fn(map[int64]float32(nil), (*encFnInfo).fastpathEncMapInt64Float32R, (*decFnInfo).fastpathDecMapInt64Float32R) - fn(map[int64]float64(nil), (*encFnInfo).fastpathEncMapInt64Float64R, (*decFnInfo).fastpathDecMapInt64Float64R) - fn(map[int64]bool(nil), (*encFnInfo).fastpathEncMapInt64BoolR, (*decFnInfo).fastpathDecMapInt64BoolR) - fn(map[bool]interface{}(nil), (*encFnInfo).fastpathEncMapBoolIntfR, (*decFnInfo).fastpathDecMapBoolIntfR) - fn(map[bool]string(nil), (*encFnInfo).fastpathEncMapBoolStringR, (*decFnInfo).fastpathDecMapBoolStringR) - fn(map[bool]uint(nil), (*encFnInfo).fastpathEncMapBoolUintR, (*decFnInfo).fastpathDecMapBoolUintR) - fn(map[bool]uint8(nil), (*encFnInfo).fastpathEncMapBoolUint8R, (*decFnInfo).fastpathDecMapBoolUint8R) - fn(map[bool]uint16(nil), (*encFnInfo).fastpathEncMapBoolUint16R, (*decFnInfo).fastpathDecMapBoolUint16R) - fn(map[bool]uint32(nil), (*encFnInfo).fastpathEncMapBoolUint32R, (*decFnInfo).fastpathDecMapBoolUint32R) - fn(map[bool]uint64(nil), (*encFnInfo).fastpathEncMapBoolUint64R, (*decFnInfo).fastpathDecMapBoolUint64R) - fn(map[bool]uintptr(nil), (*encFnInfo).fastpathEncMapBoolUintptrR, (*decFnInfo).fastpathDecMapBoolUintptrR) - fn(map[bool]int(nil), (*encFnInfo).fastpathEncMapBoolIntR, (*decFnInfo).fastpathDecMapBoolIntR) - fn(map[bool]int8(nil), (*encFnInfo).fastpathEncMapBoolInt8R, (*decFnInfo).fastpathDecMapBoolInt8R) - fn(map[bool]int16(nil), (*encFnInfo).fastpathEncMapBoolInt16R, (*decFnInfo).fastpathDecMapBoolInt16R) - fn(map[bool]int32(nil), (*encFnInfo).fastpathEncMapBoolInt32R, (*decFnInfo).fastpathDecMapBoolInt32R) - fn(map[bool]int64(nil), (*encFnInfo).fastpathEncMapBoolInt64R, (*decFnInfo).fastpathDecMapBoolInt64R) - fn(map[bool]float32(nil), (*encFnInfo).fastpathEncMapBoolFloat32R, (*decFnInfo).fastpathDecMapBoolFloat32R) - fn(map[bool]float64(nil), (*encFnInfo).fastpathEncMapBoolFloat64R, (*decFnInfo).fastpathDecMapBoolFloat64R) - fn(map[bool]bool(nil), (*encFnInfo).fastpathEncMapBoolBoolR, (*decFnInfo).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, fastpathCheckNilTrue, e) - case *[]interface{}: - fastpathTV.EncSliceIntfV(*v, fastpathCheckNilTrue, e) - - case map[interface{}]interface{}: - fastpathTV.EncMapIntfIntfV(v, fastpathCheckNilTrue, e) - case *map[interface{}]interface{}: - fastpathTV.EncMapIntfIntfV(*v, fastpathCheckNilTrue, e) - - case map[interface{}]string: - fastpathTV.EncMapIntfStringV(v, fastpathCheckNilTrue, e) - case *map[interface{}]string: - fastpathTV.EncMapIntfStringV(*v, fastpathCheckNilTrue, e) - - case map[interface{}]uint: - fastpathTV.EncMapIntfUintV(v, fastpathCheckNilTrue, e) - case *map[interface{}]uint: - fastpathTV.EncMapIntfUintV(*v, fastpathCheckNilTrue, e) - - case map[interface{}]uint8: - fastpathTV.EncMapIntfUint8V(v, fastpathCheckNilTrue, e) - case *map[interface{}]uint8: - fastpathTV.EncMapIntfUint8V(*v, fastpathCheckNilTrue, e) - - case map[interface{}]uint16: - fastpathTV.EncMapIntfUint16V(v, fastpathCheckNilTrue, e) - case *map[interface{}]uint16: - fastpathTV.EncMapIntfUint16V(*v, fastpathCheckNilTrue, e) - - case map[interface{}]uint32: - fastpathTV.EncMapIntfUint32V(v, fastpathCheckNilTrue, e) - case *map[interface{}]uint32: - fastpathTV.EncMapIntfUint32V(*v, fastpathCheckNilTrue, e) - - case map[interface{}]uint64: - fastpathTV.EncMapIntfUint64V(v, fastpathCheckNilTrue, e) - case *map[interface{}]uint64: - fastpathTV.EncMapIntfUint64V(*v, fastpathCheckNilTrue, e) - - case map[interface{}]uintptr: - fastpathTV.EncMapIntfUintptrV(v, fastpathCheckNilTrue, e) - case *map[interface{}]uintptr: - fastpathTV.EncMapIntfUintptrV(*v, fastpathCheckNilTrue, e) - - case map[interface{}]int: - fastpathTV.EncMapIntfIntV(v, fastpathCheckNilTrue, e) - case *map[interface{}]int: - fastpathTV.EncMapIntfIntV(*v, fastpathCheckNilTrue, e) - - case map[interface{}]int8: - fastpathTV.EncMapIntfInt8V(v, fastpathCheckNilTrue, e) - case *map[interface{}]int8: - fastpathTV.EncMapIntfInt8V(*v, fastpathCheckNilTrue, e) - - case map[interface{}]int16: - fastpathTV.EncMapIntfInt16V(v, fastpathCheckNilTrue, e) - case *map[interface{}]int16: - fastpathTV.EncMapIntfInt16V(*v, fastpathCheckNilTrue, e) - - case map[interface{}]int32: - fastpathTV.EncMapIntfInt32V(v, fastpathCheckNilTrue, e) - case *map[interface{}]int32: - fastpathTV.EncMapIntfInt32V(*v, fastpathCheckNilTrue, e) - - case map[interface{}]int64: - fastpathTV.EncMapIntfInt64V(v, fastpathCheckNilTrue, e) - case *map[interface{}]int64: - fastpathTV.EncMapIntfInt64V(*v, fastpathCheckNilTrue, e) - - case map[interface{}]float32: - fastpathTV.EncMapIntfFloat32V(v, fastpathCheckNilTrue, e) - case *map[interface{}]float32: - fastpathTV.EncMapIntfFloat32V(*v, fastpathCheckNilTrue, e) - - case map[interface{}]float64: - fastpathTV.EncMapIntfFloat64V(v, fastpathCheckNilTrue, e) - case *map[interface{}]float64: - fastpathTV.EncMapIntfFloat64V(*v, fastpathCheckNilTrue, e) - - case map[interface{}]bool: - fastpathTV.EncMapIntfBoolV(v, fastpathCheckNilTrue, e) - case *map[interface{}]bool: - fastpathTV.EncMapIntfBoolV(*v, fastpathCheckNilTrue, e) - - case []string: - fastpathTV.EncSliceStringV(v, fastpathCheckNilTrue, e) - case *[]string: - fastpathTV.EncSliceStringV(*v, fastpathCheckNilTrue, e) - - case map[string]interface{}: - fastpathTV.EncMapStringIntfV(v, fastpathCheckNilTrue, e) - case *map[string]interface{}: - fastpathTV.EncMapStringIntfV(*v, fastpathCheckNilTrue, e) - - case map[string]string: - fastpathTV.EncMapStringStringV(v, fastpathCheckNilTrue, e) - case *map[string]string: - fastpathTV.EncMapStringStringV(*v, fastpathCheckNilTrue, e) - - case map[string]uint: - fastpathTV.EncMapStringUintV(v, fastpathCheckNilTrue, e) - case *map[string]uint: - fastpathTV.EncMapStringUintV(*v, fastpathCheckNilTrue, e) - - case map[string]uint8: - fastpathTV.EncMapStringUint8V(v, fastpathCheckNilTrue, e) - case *map[string]uint8: - fastpathTV.EncMapStringUint8V(*v, fastpathCheckNilTrue, e) - - case map[string]uint16: - fastpathTV.EncMapStringUint16V(v, fastpathCheckNilTrue, e) - case *map[string]uint16: - fastpathTV.EncMapStringUint16V(*v, fastpathCheckNilTrue, e) - - case map[string]uint32: - fastpathTV.EncMapStringUint32V(v, fastpathCheckNilTrue, e) - case *map[string]uint32: - fastpathTV.EncMapStringUint32V(*v, fastpathCheckNilTrue, e) - - case map[string]uint64: - fastpathTV.EncMapStringUint64V(v, fastpathCheckNilTrue, e) - case *map[string]uint64: - fastpathTV.EncMapStringUint64V(*v, fastpathCheckNilTrue, e) - - case map[string]uintptr: - fastpathTV.EncMapStringUintptrV(v, fastpathCheckNilTrue, e) - case *map[string]uintptr: - fastpathTV.EncMapStringUintptrV(*v, fastpathCheckNilTrue, e) - - case map[string]int: - fastpathTV.EncMapStringIntV(v, fastpathCheckNilTrue, e) - case *map[string]int: - fastpathTV.EncMapStringIntV(*v, fastpathCheckNilTrue, e) - - case map[string]int8: - fastpathTV.EncMapStringInt8V(v, fastpathCheckNilTrue, e) - case *map[string]int8: - fastpathTV.EncMapStringInt8V(*v, fastpathCheckNilTrue, e) - - case map[string]int16: - fastpathTV.EncMapStringInt16V(v, fastpathCheckNilTrue, e) - case *map[string]int16: - fastpathTV.EncMapStringInt16V(*v, fastpathCheckNilTrue, e) - - case map[string]int32: - fastpathTV.EncMapStringInt32V(v, fastpathCheckNilTrue, e) - case *map[string]int32: - fastpathTV.EncMapStringInt32V(*v, fastpathCheckNilTrue, e) - - case map[string]int64: - fastpathTV.EncMapStringInt64V(v, fastpathCheckNilTrue, e) - case *map[string]int64: - fastpathTV.EncMapStringInt64V(*v, fastpathCheckNilTrue, e) - - case map[string]float32: - fastpathTV.EncMapStringFloat32V(v, fastpathCheckNilTrue, e) - case *map[string]float32: - fastpathTV.EncMapStringFloat32V(*v, fastpathCheckNilTrue, e) - - case map[string]float64: - fastpathTV.EncMapStringFloat64V(v, fastpathCheckNilTrue, e) - case *map[string]float64: - fastpathTV.EncMapStringFloat64V(*v, fastpathCheckNilTrue, e) - - case map[string]bool: - fastpathTV.EncMapStringBoolV(v, fastpathCheckNilTrue, e) - case *map[string]bool: - fastpathTV.EncMapStringBoolV(*v, fastpathCheckNilTrue, e) - - case []float32: - fastpathTV.EncSliceFloat32V(v, fastpathCheckNilTrue, e) - case *[]float32: - fastpathTV.EncSliceFloat32V(*v, fastpathCheckNilTrue, e) - - case map[float32]interface{}: - fastpathTV.EncMapFloat32IntfV(v, fastpathCheckNilTrue, e) - case *map[float32]interface{}: - fastpathTV.EncMapFloat32IntfV(*v, fastpathCheckNilTrue, e) - - case map[float32]string: - fastpathTV.EncMapFloat32StringV(v, fastpathCheckNilTrue, e) - case *map[float32]string: - fastpathTV.EncMapFloat32StringV(*v, fastpathCheckNilTrue, e) - - case map[float32]uint: - fastpathTV.EncMapFloat32UintV(v, fastpathCheckNilTrue, e) - case *map[float32]uint: - fastpathTV.EncMapFloat32UintV(*v, fastpathCheckNilTrue, e) - - case map[float32]uint8: - fastpathTV.EncMapFloat32Uint8V(v, fastpathCheckNilTrue, e) - case *map[float32]uint8: - fastpathTV.EncMapFloat32Uint8V(*v, fastpathCheckNilTrue, e) - - case map[float32]uint16: - fastpathTV.EncMapFloat32Uint16V(v, fastpathCheckNilTrue, e) - case *map[float32]uint16: - fastpathTV.EncMapFloat32Uint16V(*v, fastpathCheckNilTrue, e) - - case map[float32]uint32: - fastpathTV.EncMapFloat32Uint32V(v, fastpathCheckNilTrue, e) - case *map[float32]uint32: - fastpathTV.EncMapFloat32Uint32V(*v, fastpathCheckNilTrue, e) - - case map[float32]uint64: - fastpathTV.EncMapFloat32Uint64V(v, fastpathCheckNilTrue, e) - case *map[float32]uint64: - fastpathTV.EncMapFloat32Uint64V(*v, fastpathCheckNilTrue, e) - - case map[float32]uintptr: - fastpathTV.EncMapFloat32UintptrV(v, fastpathCheckNilTrue, e) - case *map[float32]uintptr: - fastpathTV.EncMapFloat32UintptrV(*v, fastpathCheckNilTrue, e) - - case map[float32]int: - fastpathTV.EncMapFloat32IntV(v, fastpathCheckNilTrue, e) - case *map[float32]int: - fastpathTV.EncMapFloat32IntV(*v, fastpathCheckNilTrue, e) - - case map[float32]int8: - fastpathTV.EncMapFloat32Int8V(v, fastpathCheckNilTrue, e) - case *map[float32]int8: - fastpathTV.EncMapFloat32Int8V(*v, fastpathCheckNilTrue, e) - - case map[float32]int16: - fastpathTV.EncMapFloat32Int16V(v, fastpathCheckNilTrue, e) - case *map[float32]int16: - fastpathTV.EncMapFloat32Int16V(*v, fastpathCheckNilTrue, e) - - case map[float32]int32: - fastpathTV.EncMapFloat32Int32V(v, fastpathCheckNilTrue, e) - case *map[float32]int32: - fastpathTV.EncMapFloat32Int32V(*v, fastpathCheckNilTrue, e) - - case map[float32]int64: - fastpathTV.EncMapFloat32Int64V(v, fastpathCheckNilTrue, e) - case *map[float32]int64: - fastpathTV.EncMapFloat32Int64V(*v, fastpathCheckNilTrue, e) - - case map[float32]float32: - fastpathTV.EncMapFloat32Float32V(v, fastpathCheckNilTrue, e) - case *map[float32]float32: - fastpathTV.EncMapFloat32Float32V(*v, fastpathCheckNilTrue, e) - - case map[float32]float64: - fastpathTV.EncMapFloat32Float64V(v, fastpathCheckNilTrue, e) - case *map[float32]float64: - fastpathTV.EncMapFloat32Float64V(*v, fastpathCheckNilTrue, e) - - case map[float32]bool: - fastpathTV.EncMapFloat32BoolV(v, fastpathCheckNilTrue, e) - case *map[float32]bool: - fastpathTV.EncMapFloat32BoolV(*v, fastpathCheckNilTrue, e) - - case []float64: - fastpathTV.EncSliceFloat64V(v, fastpathCheckNilTrue, e) - case *[]float64: - fastpathTV.EncSliceFloat64V(*v, fastpathCheckNilTrue, e) - - case map[float64]interface{}: - fastpathTV.EncMapFloat64IntfV(v, fastpathCheckNilTrue, e) - case *map[float64]interface{}: - fastpathTV.EncMapFloat64IntfV(*v, fastpathCheckNilTrue, e) - - case map[float64]string: - fastpathTV.EncMapFloat64StringV(v, fastpathCheckNilTrue, e) - case *map[float64]string: - fastpathTV.EncMapFloat64StringV(*v, fastpathCheckNilTrue, e) - - case map[float64]uint: - fastpathTV.EncMapFloat64UintV(v, fastpathCheckNilTrue, e) - case *map[float64]uint: - fastpathTV.EncMapFloat64UintV(*v, fastpathCheckNilTrue, e) - - case map[float64]uint8: - fastpathTV.EncMapFloat64Uint8V(v, fastpathCheckNilTrue, e) - case *map[float64]uint8: - fastpathTV.EncMapFloat64Uint8V(*v, fastpathCheckNilTrue, e) - - case map[float64]uint16: - fastpathTV.EncMapFloat64Uint16V(v, fastpathCheckNilTrue, e) - case *map[float64]uint16: - fastpathTV.EncMapFloat64Uint16V(*v, fastpathCheckNilTrue, e) - - case map[float64]uint32: - fastpathTV.EncMapFloat64Uint32V(v, fastpathCheckNilTrue, e) - case *map[float64]uint32: - fastpathTV.EncMapFloat64Uint32V(*v, fastpathCheckNilTrue, e) - - case map[float64]uint64: - fastpathTV.EncMapFloat64Uint64V(v, fastpathCheckNilTrue, e) - case *map[float64]uint64: - fastpathTV.EncMapFloat64Uint64V(*v, fastpathCheckNilTrue, e) - - case map[float64]uintptr: - fastpathTV.EncMapFloat64UintptrV(v, fastpathCheckNilTrue, e) - case *map[float64]uintptr: - fastpathTV.EncMapFloat64UintptrV(*v, fastpathCheckNilTrue, e) - - case map[float64]int: - fastpathTV.EncMapFloat64IntV(v, fastpathCheckNilTrue, e) - case *map[float64]int: - fastpathTV.EncMapFloat64IntV(*v, fastpathCheckNilTrue, e) - - case map[float64]int8: - fastpathTV.EncMapFloat64Int8V(v, fastpathCheckNilTrue, e) - case *map[float64]int8: - fastpathTV.EncMapFloat64Int8V(*v, fastpathCheckNilTrue, e) - - case map[float64]int16: - fastpathTV.EncMapFloat64Int16V(v, fastpathCheckNilTrue, e) - case *map[float64]int16: - fastpathTV.EncMapFloat64Int16V(*v, fastpathCheckNilTrue, e) - - case map[float64]int32: - fastpathTV.EncMapFloat64Int32V(v, fastpathCheckNilTrue, e) - case *map[float64]int32: - fastpathTV.EncMapFloat64Int32V(*v, fastpathCheckNilTrue, e) - - case map[float64]int64: - fastpathTV.EncMapFloat64Int64V(v, fastpathCheckNilTrue, e) - case *map[float64]int64: - fastpathTV.EncMapFloat64Int64V(*v, fastpathCheckNilTrue, e) - - case map[float64]float32: - fastpathTV.EncMapFloat64Float32V(v, fastpathCheckNilTrue, e) - case *map[float64]float32: - fastpathTV.EncMapFloat64Float32V(*v, fastpathCheckNilTrue, e) - - case map[float64]float64: - fastpathTV.EncMapFloat64Float64V(v, fastpathCheckNilTrue, e) - case *map[float64]float64: - fastpathTV.EncMapFloat64Float64V(*v, fastpathCheckNilTrue, e) - - case map[float64]bool: - fastpathTV.EncMapFloat64BoolV(v, fastpathCheckNilTrue, e) - case *map[float64]bool: - fastpathTV.EncMapFloat64BoolV(*v, fastpathCheckNilTrue, e) - - case []uint: - fastpathTV.EncSliceUintV(v, fastpathCheckNilTrue, e) - case *[]uint: - fastpathTV.EncSliceUintV(*v, fastpathCheckNilTrue, e) - - case map[uint]interface{}: - fastpathTV.EncMapUintIntfV(v, fastpathCheckNilTrue, e) - case *map[uint]interface{}: - fastpathTV.EncMapUintIntfV(*v, fastpathCheckNilTrue, e) - - case map[uint]string: - fastpathTV.EncMapUintStringV(v, fastpathCheckNilTrue, e) - case *map[uint]string: - fastpathTV.EncMapUintStringV(*v, fastpathCheckNilTrue, e) - - case map[uint]uint: - fastpathTV.EncMapUintUintV(v, fastpathCheckNilTrue, e) - case *map[uint]uint: - fastpathTV.EncMapUintUintV(*v, fastpathCheckNilTrue, e) - - case map[uint]uint8: - fastpathTV.EncMapUintUint8V(v, fastpathCheckNilTrue, e) - case *map[uint]uint8: - fastpathTV.EncMapUintUint8V(*v, fastpathCheckNilTrue, e) - - case map[uint]uint16: - fastpathTV.EncMapUintUint16V(v, fastpathCheckNilTrue, e) - case *map[uint]uint16: - fastpathTV.EncMapUintUint16V(*v, fastpathCheckNilTrue, e) - - case map[uint]uint32: - fastpathTV.EncMapUintUint32V(v, fastpathCheckNilTrue, e) - case *map[uint]uint32: - fastpathTV.EncMapUintUint32V(*v, fastpathCheckNilTrue, e) - - case map[uint]uint64: - fastpathTV.EncMapUintUint64V(v, fastpathCheckNilTrue, e) - case *map[uint]uint64: - fastpathTV.EncMapUintUint64V(*v, fastpathCheckNilTrue, e) - - case map[uint]uintptr: - fastpathTV.EncMapUintUintptrV(v, fastpathCheckNilTrue, e) - case *map[uint]uintptr: - fastpathTV.EncMapUintUintptrV(*v, fastpathCheckNilTrue, e) - - case map[uint]int: - fastpathTV.EncMapUintIntV(v, fastpathCheckNilTrue, e) - case *map[uint]int: - fastpathTV.EncMapUintIntV(*v, fastpathCheckNilTrue, e) - - case map[uint]int8: - fastpathTV.EncMapUintInt8V(v, fastpathCheckNilTrue, e) - case *map[uint]int8: - fastpathTV.EncMapUintInt8V(*v, fastpathCheckNilTrue, e) - - case map[uint]int16: - fastpathTV.EncMapUintInt16V(v, fastpathCheckNilTrue, e) - case *map[uint]int16: - fastpathTV.EncMapUintInt16V(*v, fastpathCheckNilTrue, e) - - case map[uint]int32: - fastpathTV.EncMapUintInt32V(v, fastpathCheckNilTrue, e) - case *map[uint]int32: - fastpathTV.EncMapUintInt32V(*v, fastpathCheckNilTrue, e) - - case map[uint]int64: - fastpathTV.EncMapUintInt64V(v, fastpathCheckNilTrue, e) - case *map[uint]int64: - fastpathTV.EncMapUintInt64V(*v, fastpathCheckNilTrue, e) - - case map[uint]float32: - fastpathTV.EncMapUintFloat32V(v, fastpathCheckNilTrue, e) - case *map[uint]float32: - fastpathTV.EncMapUintFloat32V(*v, fastpathCheckNilTrue, e) - - case map[uint]float64: - fastpathTV.EncMapUintFloat64V(v, fastpathCheckNilTrue, e) - case *map[uint]float64: - fastpathTV.EncMapUintFloat64V(*v, fastpathCheckNilTrue, e) - - case map[uint]bool: - fastpathTV.EncMapUintBoolV(v, fastpathCheckNilTrue, e) - case *map[uint]bool: - fastpathTV.EncMapUintBoolV(*v, fastpathCheckNilTrue, e) - - case map[uint8]interface{}: - fastpathTV.EncMapUint8IntfV(v, fastpathCheckNilTrue, e) - case *map[uint8]interface{}: - fastpathTV.EncMapUint8IntfV(*v, fastpathCheckNilTrue, e) - - case map[uint8]string: - fastpathTV.EncMapUint8StringV(v, fastpathCheckNilTrue, e) - case *map[uint8]string: - fastpathTV.EncMapUint8StringV(*v, fastpathCheckNilTrue, e) - - case map[uint8]uint: - fastpathTV.EncMapUint8UintV(v, fastpathCheckNilTrue, e) - case *map[uint8]uint: - fastpathTV.EncMapUint8UintV(*v, fastpathCheckNilTrue, e) - - case map[uint8]uint8: - fastpathTV.EncMapUint8Uint8V(v, fastpathCheckNilTrue, e) - case *map[uint8]uint8: - fastpathTV.EncMapUint8Uint8V(*v, fastpathCheckNilTrue, e) - - case map[uint8]uint16: - fastpathTV.EncMapUint8Uint16V(v, fastpathCheckNilTrue, e) - case *map[uint8]uint16: - fastpathTV.EncMapUint8Uint16V(*v, fastpathCheckNilTrue, e) - - case map[uint8]uint32: - fastpathTV.EncMapUint8Uint32V(v, fastpathCheckNilTrue, e) - case *map[uint8]uint32: - fastpathTV.EncMapUint8Uint32V(*v, fastpathCheckNilTrue, e) - - case map[uint8]uint64: - fastpathTV.EncMapUint8Uint64V(v, fastpathCheckNilTrue, e) - case *map[uint8]uint64: - fastpathTV.EncMapUint8Uint64V(*v, fastpathCheckNilTrue, e) - - case map[uint8]uintptr: - fastpathTV.EncMapUint8UintptrV(v, fastpathCheckNilTrue, e) - case *map[uint8]uintptr: - fastpathTV.EncMapUint8UintptrV(*v, fastpathCheckNilTrue, e) - - case map[uint8]int: - fastpathTV.EncMapUint8IntV(v, fastpathCheckNilTrue, e) - case *map[uint8]int: - fastpathTV.EncMapUint8IntV(*v, fastpathCheckNilTrue, e) - - case map[uint8]int8: - fastpathTV.EncMapUint8Int8V(v, fastpathCheckNilTrue, e) - case *map[uint8]int8: - fastpathTV.EncMapUint8Int8V(*v, fastpathCheckNilTrue, e) - - case map[uint8]int16: - fastpathTV.EncMapUint8Int16V(v, fastpathCheckNilTrue, e) - case *map[uint8]int16: - fastpathTV.EncMapUint8Int16V(*v, fastpathCheckNilTrue, e) - - case map[uint8]int32: - fastpathTV.EncMapUint8Int32V(v, fastpathCheckNilTrue, e) - case *map[uint8]int32: - fastpathTV.EncMapUint8Int32V(*v, fastpathCheckNilTrue, e) - - case map[uint8]int64: - fastpathTV.EncMapUint8Int64V(v, fastpathCheckNilTrue, e) - case *map[uint8]int64: - fastpathTV.EncMapUint8Int64V(*v, fastpathCheckNilTrue, e) - - case map[uint8]float32: - fastpathTV.EncMapUint8Float32V(v, fastpathCheckNilTrue, e) - case *map[uint8]float32: - fastpathTV.EncMapUint8Float32V(*v, fastpathCheckNilTrue, e) - - case map[uint8]float64: - fastpathTV.EncMapUint8Float64V(v, fastpathCheckNilTrue, e) - case *map[uint8]float64: - fastpathTV.EncMapUint8Float64V(*v, fastpathCheckNilTrue, e) - - case map[uint8]bool: - fastpathTV.EncMapUint8BoolV(v, fastpathCheckNilTrue, e) - case *map[uint8]bool: - fastpathTV.EncMapUint8BoolV(*v, fastpathCheckNilTrue, e) - - case []uint16: - fastpathTV.EncSliceUint16V(v, fastpathCheckNilTrue, e) - case *[]uint16: - fastpathTV.EncSliceUint16V(*v, fastpathCheckNilTrue, e) - - case map[uint16]interface{}: - fastpathTV.EncMapUint16IntfV(v, fastpathCheckNilTrue, e) - case *map[uint16]interface{}: - fastpathTV.EncMapUint16IntfV(*v, fastpathCheckNilTrue, e) - - case map[uint16]string: - fastpathTV.EncMapUint16StringV(v, fastpathCheckNilTrue, e) - case *map[uint16]string: - fastpathTV.EncMapUint16StringV(*v, fastpathCheckNilTrue, e) - - case map[uint16]uint: - fastpathTV.EncMapUint16UintV(v, fastpathCheckNilTrue, e) - case *map[uint16]uint: - fastpathTV.EncMapUint16UintV(*v, fastpathCheckNilTrue, e) - - case map[uint16]uint8: - fastpathTV.EncMapUint16Uint8V(v, fastpathCheckNilTrue, e) - case *map[uint16]uint8: - fastpathTV.EncMapUint16Uint8V(*v, fastpathCheckNilTrue, e) - - case map[uint16]uint16: - fastpathTV.EncMapUint16Uint16V(v, fastpathCheckNilTrue, e) - case *map[uint16]uint16: - fastpathTV.EncMapUint16Uint16V(*v, fastpathCheckNilTrue, e) - - case map[uint16]uint32: - fastpathTV.EncMapUint16Uint32V(v, fastpathCheckNilTrue, e) - case *map[uint16]uint32: - fastpathTV.EncMapUint16Uint32V(*v, fastpathCheckNilTrue, e) - - case map[uint16]uint64: - fastpathTV.EncMapUint16Uint64V(v, fastpathCheckNilTrue, e) - case *map[uint16]uint64: - fastpathTV.EncMapUint16Uint64V(*v, fastpathCheckNilTrue, e) - - case map[uint16]uintptr: - fastpathTV.EncMapUint16UintptrV(v, fastpathCheckNilTrue, e) - case *map[uint16]uintptr: - fastpathTV.EncMapUint16UintptrV(*v, fastpathCheckNilTrue, e) - - case map[uint16]int: - fastpathTV.EncMapUint16IntV(v, fastpathCheckNilTrue, e) - case *map[uint16]int: - fastpathTV.EncMapUint16IntV(*v, fastpathCheckNilTrue, e) - - case map[uint16]int8: - fastpathTV.EncMapUint16Int8V(v, fastpathCheckNilTrue, e) - case *map[uint16]int8: - fastpathTV.EncMapUint16Int8V(*v, fastpathCheckNilTrue, e) - - case map[uint16]int16: - fastpathTV.EncMapUint16Int16V(v, fastpathCheckNilTrue, e) - case *map[uint16]int16: - fastpathTV.EncMapUint16Int16V(*v, fastpathCheckNilTrue, e) - - case map[uint16]int32: - fastpathTV.EncMapUint16Int32V(v, fastpathCheckNilTrue, e) - case *map[uint16]int32: - fastpathTV.EncMapUint16Int32V(*v, fastpathCheckNilTrue, e) - - case map[uint16]int64: - fastpathTV.EncMapUint16Int64V(v, fastpathCheckNilTrue, e) - case *map[uint16]int64: - fastpathTV.EncMapUint16Int64V(*v, fastpathCheckNilTrue, e) - - case map[uint16]float32: - fastpathTV.EncMapUint16Float32V(v, fastpathCheckNilTrue, e) - case *map[uint16]float32: - fastpathTV.EncMapUint16Float32V(*v, fastpathCheckNilTrue, e) - - case map[uint16]float64: - fastpathTV.EncMapUint16Float64V(v, fastpathCheckNilTrue, e) - case *map[uint16]float64: - fastpathTV.EncMapUint16Float64V(*v, fastpathCheckNilTrue, e) - - case map[uint16]bool: - fastpathTV.EncMapUint16BoolV(v, fastpathCheckNilTrue, e) - case *map[uint16]bool: - fastpathTV.EncMapUint16BoolV(*v, fastpathCheckNilTrue, e) - - case []uint32: - fastpathTV.EncSliceUint32V(v, fastpathCheckNilTrue, e) - case *[]uint32: - fastpathTV.EncSliceUint32V(*v, fastpathCheckNilTrue, e) - - case map[uint32]interface{}: - fastpathTV.EncMapUint32IntfV(v, fastpathCheckNilTrue, e) - case *map[uint32]interface{}: - fastpathTV.EncMapUint32IntfV(*v, fastpathCheckNilTrue, e) - - case map[uint32]string: - fastpathTV.EncMapUint32StringV(v, fastpathCheckNilTrue, e) - case *map[uint32]string: - fastpathTV.EncMapUint32StringV(*v, fastpathCheckNilTrue, e) - - case map[uint32]uint: - fastpathTV.EncMapUint32UintV(v, fastpathCheckNilTrue, e) - case *map[uint32]uint: - fastpathTV.EncMapUint32UintV(*v, fastpathCheckNilTrue, e) - - case map[uint32]uint8: - fastpathTV.EncMapUint32Uint8V(v, fastpathCheckNilTrue, e) - case *map[uint32]uint8: - fastpathTV.EncMapUint32Uint8V(*v, fastpathCheckNilTrue, e) - - case map[uint32]uint16: - fastpathTV.EncMapUint32Uint16V(v, fastpathCheckNilTrue, e) - case *map[uint32]uint16: - fastpathTV.EncMapUint32Uint16V(*v, fastpathCheckNilTrue, e) - - case map[uint32]uint32: - fastpathTV.EncMapUint32Uint32V(v, fastpathCheckNilTrue, e) - case *map[uint32]uint32: - fastpathTV.EncMapUint32Uint32V(*v, fastpathCheckNilTrue, e) - - case map[uint32]uint64: - fastpathTV.EncMapUint32Uint64V(v, fastpathCheckNilTrue, e) - case *map[uint32]uint64: - fastpathTV.EncMapUint32Uint64V(*v, fastpathCheckNilTrue, e) - - case map[uint32]uintptr: - fastpathTV.EncMapUint32UintptrV(v, fastpathCheckNilTrue, e) - case *map[uint32]uintptr: - fastpathTV.EncMapUint32UintptrV(*v, fastpathCheckNilTrue, e) - - case map[uint32]int: - fastpathTV.EncMapUint32IntV(v, fastpathCheckNilTrue, e) - case *map[uint32]int: - fastpathTV.EncMapUint32IntV(*v, fastpathCheckNilTrue, e) - - case map[uint32]int8: - fastpathTV.EncMapUint32Int8V(v, fastpathCheckNilTrue, e) - case *map[uint32]int8: - fastpathTV.EncMapUint32Int8V(*v, fastpathCheckNilTrue, e) - - case map[uint32]int16: - fastpathTV.EncMapUint32Int16V(v, fastpathCheckNilTrue, e) - case *map[uint32]int16: - fastpathTV.EncMapUint32Int16V(*v, fastpathCheckNilTrue, e) - - case map[uint32]int32: - fastpathTV.EncMapUint32Int32V(v, fastpathCheckNilTrue, e) - case *map[uint32]int32: - fastpathTV.EncMapUint32Int32V(*v, fastpathCheckNilTrue, e) - - case map[uint32]int64: - fastpathTV.EncMapUint32Int64V(v, fastpathCheckNilTrue, e) - case *map[uint32]int64: - fastpathTV.EncMapUint32Int64V(*v, fastpathCheckNilTrue, e) - - case map[uint32]float32: - fastpathTV.EncMapUint32Float32V(v, fastpathCheckNilTrue, e) - case *map[uint32]float32: - fastpathTV.EncMapUint32Float32V(*v, fastpathCheckNilTrue, e) - - case map[uint32]float64: - fastpathTV.EncMapUint32Float64V(v, fastpathCheckNilTrue, e) - case *map[uint32]float64: - fastpathTV.EncMapUint32Float64V(*v, fastpathCheckNilTrue, e) - - case map[uint32]bool: - fastpathTV.EncMapUint32BoolV(v, fastpathCheckNilTrue, e) - case *map[uint32]bool: - fastpathTV.EncMapUint32BoolV(*v, fastpathCheckNilTrue, e) - - case []uint64: - fastpathTV.EncSliceUint64V(v, fastpathCheckNilTrue, e) - case *[]uint64: - fastpathTV.EncSliceUint64V(*v, fastpathCheckNilTrue, e) - - case map[uint64]interface{}: - fastpathTV.EncMapUint64IntfV(v, fastpathCheckNilTrue, e) - case *map[uint64]interface{}: - fastpathTV.EncMapUint64IntfV(*v, fastpathCheckNilTrue, e) - - case map[uint64]string: - fastpathTV.EncMapUint64StringV(v, fastpathCheckNilTrue, e) - case *map[uint64]string: - fastpathTV.EncMapUint64StringV(*v, fastpathCheckNilTrue, e) - - case map[uint64]uint: - fastpathTV.EncMapUint64UintV(v, fastpathCheckNilTrue, e) - case *map[uint64]uint: - fastpathTV.EncMapUint64UintV(*v, fastpathCheckNilTrue, e) - - case map[uint64]uint8: - fastpathTV.EncMapUint64Uint8V(v, fastpathCheckNilTrue, e) - case *map[uint64]uint8: - fastpathTV.EncMapUint64Uint8V(*v, fastpathCheckNilTrue, e) - - case map[uint64]uint16: - fastpathTV.EncMapUint64Uint16V(v, fastpathCheckNilTrue, e) - case *map[uint64]uint16: - fastpathTV.EncMapUint64Uint16V(*v, fastpathCheckNilTrue, e) - - case map[uint64]uint32: - fastpathTV.EncMapUint64Uint32V(v, fastpathCheckNilTrue, e) - case *map[uint64]uint32: - fastpathTV.EncMapUint64Uint32V(*v, fastpathCheckNilTrue, e) - - case map[uint64]uint64: - fastpathTV.EncMapUint64Uint64V(v, fastpathCheckNilTrue, e) - case *map[uint64]uint64: - fastpathTV.EncMapUint64Uint64V(*v, fastpathCheckNilTrue, e) - - case map[uint64]uintptr: - fastpathTV.EncMapUint64UintptrV(v, fastpathCheckNilTrue, e) - case *map[uint64]uintptr: - fastpathTV.EncMapUint64UintptrV(*v, fastpathCheckNilTrue, e) - - case map[uint64]int: - fastpathTV.EncMapUint64IntV(v, fastpathCheckNilTrue, e) - case *map[uint64]int: - fastpathTV.EncMapUint64IntV(*v, fastpathCheckNilTrue, e) - - case map[uint64]int8: - fastpathTV.EncMapUint64Int8V(v, fastpathCheckNilTrue, e) - case *map[uint64]int8: - fastpathTV.EncMapUint64Int8V(*v, fastpathCheckNilTrue, e) - - case map[uint64]int16: - fastpathTV.EncMapUint64Int16V(v, fastpathCheckNilTrue, e) - case *map[uint64]int16: - fastpathTV.EncMapUint64Int16V(*v, fastpathCheckNilTrue, e) - - case map[uint64]int32: - fastpathTV.EncMapUint64Int32V(v, fastpathCheckNilTrue, e) - case *map[uint64]int32: - fastpathTV.EncMapUint64Int32V(*v, fastpathCheckNilTrue, e) - - case map[uint64]int64: - fastpathTV.EncMapUint64Int64V(v, fastpathCheckNilTrue, e) - case *map[uint64]int64: - fastpathTV.EncMapUint64Int64V(*v, fastpathCheckNilTrue, e) - - case map[uint64]float32: - fastpathTV.EncMapUint64Float32V(v, fastpathCheckNilTrue, e) - case *map[uint64]float32: - fastpathTV.EncMapUint64Float32V(*v, fastpathCheckNilTrue, e) - - case map[uint64]float64: - fastpathTV.EncMapUint64Float64V(v, fastpathCheckNilTrue, e) - case *map[uint64]float64: - fastpathTV.EncMapUint64Float64V(*v, fastpathCheckNilTrue, e) - - case map[uint64]bool: - fastpathTV.EncMapUint64BoolV(v, fastpathCheckNilTrue, e) - case *map[uint64]bool: - fastpathTV.EncMapUint64BoolV(*v, fastpathCheckNilTrue, e) - - case []uintptr: - fastpathTV.EncSliceUintptrV(v, fastpathCheckNilTrue, e) - case *[]uintptr: - fastpathTV.EncSliceUintptrV(*v, fastpathCheckNilTrue, e) - - case map[uintptr]interface{}: - fastpathTV.EncMapUintptrIntfV(v, fastpathCheckNilTrue, e) - case *map[uintptr]interface{}: - fastpathTV.EncMapUintptrIntfV(*v, fastpathCheckNilTrue, e) - - case map[uintptr]string: - fastpathTV.EncMapUintptrStringV(v, fastpathCheckNilTrue, e) - case *map[uintptr]string: - fastpathTV.EncMapUintptrStringV(*v, fastpathCheckNilTrue, e) - - case map[uintptr]uint: - fastpathTV.EncMapUintptrUintV(v, fastpathCheckNilTrue, e) - case *map[uintptr]uint: - fastpathTV.EncMapUintptrUintV(*v, fastpathCheckNilTrue, e) - - case map[uintptr]uint8: - fastpathTV.EncMapUintptrUint8V(v, fastpathCheckNilTrue, e) - case *map[uintptr]uint8: - fastpathTV.EncMapUintptrUint8V(*v, fastpathCheckNilTrue, e) - - case map[uintptr]uint16: - fastpathTV.EncMapUintptrUint16V(v, fastpathCheckNilTrue, e) - case *map[uintptr]uint16: - fastpathTV.EncMapUintptrUint16V(*v, fastpathCheckNilTrue, e) - - case map[uintptr]uint32: - fastpathTV.EncMapUintptrUint32V(v, fastpathCheckNilTrue, e) - case *map[uintptr]uint32: - fastpathTV.EncMapUintptrUint32V(*v, fastpathCheckNilTrue, e) - - case map[uintptr]uint64: - fastpathTV.EncMapUintptrUint64V(v, fastpathCheckNilTrue, e) - case *map[uintptr]uint64: - fastpathTV.EncMapUintptrUint64V(*v, fastpathCheckNilTrue, e) - - case map[uintptr]uintptr: - fastpathTV.EncMapUintptrUintptrV(v, fastpathCheckNilTrue, e) - case *map[uintptr]uintptr: - fastpathTV.EncMapUintptrUintptrV(*v, fastpathCheckNilTrue, e) - - case map[uintptr]int: - fastpathTV.EncMapUintptrIntV(v, fastpathCheckNilTrue, e) - case *map[uintptr]int: - fastpathTV.EncMapUintptrIntV(*v, fastpathCheckNilTrue, e) - - case map[uintptr]int8: - fastpathTV.EncMapUintptrInt8V(v, fastpathCheckNilTrue, e) - case *map[uintptr]int8: - fastpathTV.EncMapUintptrInt8V(*v, fastpathCheckNilTrue, e) - - case map[uintptr]int16: - fastpathTV.EncMapUintptrInt16V(v, fastpathCheckNilTrue, e) - case *map[uintptr]int16: - fastpathTV.EncMapUintptrInt16V(*v, fastpathCheckNilTrue, e) - - case map[uintptr]int32: - fastpathTV.EncMapUintptrInt32V(v, fastpathCheckNilTrue, e) - case *map[uintptr]int32: - fastpathTV.EncMapUintptrInt32V(*v, fastpathCheckNilTrue, e) - - case map[uintptr]int64: - fastpathTV.EncMapUintptrInt64V(v, fastpathCheckNilTrue, e) - case *map[uintptr]int64: - fastpathTV.EncMapUintptrInt64V(*v, fastpathCheckNilTrue, e) - - case map[uintptr]float32: - fastpathTV.EncMapUintptrFloat32V(v, fastpathCheckNilTrue, e) - case *map[uintptr]float32: - fastpathTV.EncMapUintptrFloat32V(*v, fastpathCheckNilTrue, e) - - case map[uintptr]float64: - fastpathTV.EncMapUintptrFloat64V(v, fastpathCheckNilTrue, e) - case *map[uintptr]float64: - fastpathTV.EncMapUintptrFloat64V(*v, fastpathCheckNilTrue, e) - - case map[uintptr]bool: - fastpathTV.EncMapUintptrBoolV(v, fastpathCheckNilTrue, e) - case *map[uintptr]bool: - fastpathTV.EncMapUintptrBoolV(*v, fastpathCheckNilTrue, e) - - case []int: - fastpathTV.EncSliceIntV(v, fastpathCheckNilTrue, e) - case *[]int: - fastpathTV.EncSliceIntV(*v, fastpathCheckNilTrue, e) - - case map[int]interface{}: - fastpathTV.EncMapIntIntfV(v, fastpathCheckNilTrue, e) - case *map[int]interface{}: - fastpathTV.EncMapIntIntfV(*v, fastpathCheckNilTrue, e) - - case map[int]string: - fastpathTV.EncMapIntStringV(v, fastpathCheckNilTrue, e) - case *map[int]string: - fastpathTV.EncMapIntStringV(*v, fastpathCheckNilTrue, e) - - case map[int]uint: - fastpathTV.EncMapIntUintV(v, fastpathCheckNilTrue, e) - case *map[int]uint: - fastpathTV.EncMapIntUintV(*v, fastpathCheckNilTrue, e) - - case map[int]uint8: - fastpathTV.EncMapIntUint8V(v, fastpathCheckNilTrue, e) - case *map[int]uint8: - fastpathTV.EncMapIntUint8V(*v, fastpathCheckNilTrue, e) - - case map[int]uint16: - fastpathTV.EncMapIntUint16V(v, fastpathCheckNilTrue, e) - case *map[int]uint16: - fastpathTV.EncMapIntUint16V(*v, fastpathCheckNilTrue, e) - - case map[int]uint32: - fastpathTV.EncMapIntUint32V(v, fastpathCheckNilTrue, e) - case *map[int]uint32: - fastpathTV.EncMapIntUint32V(*v, fastpathCheckNilTrue, e) - - case map[int]uint64: - fastpathTV.EncMapIntUint64V(v, fastpathCheckNilTrue, e) - case *map[int]uint64: - fastpathTV.EncMapIntUint64V(*v, fastpathCheckNilTrue, e) - - case map[int]uintptr: - fastpathTV.EncMapIntUintptrV(v, fastpathCheckNilTrue, e) - case *map[int]uintptr: - fastpathTV.EncMapIntUintptrV(*v, fastpathCheckNilTrue, e) - - case map[int]int: - fastpathTV.EncMapIntIntV(v, fastpathCheckNilTrue, e) - case *map[int]int: - fastpathTV.EncMapIntIntV(*v, fastpathCheckNilTrue, e) - - case map[int]int8: - fastpathTV.EncMapIntInt8V(v, fastpathCheckNilTrue, e) - case *map[int]int8: - fastpathTV.EncMapIntInt8V(*v, fastpathCheckNilTrue, e) - - case map[int]int16: - fastpathTV.EncMapIntInt16V(v, fastpathCheckNilTrue, e) - case *map[int]int16: - fastpathTV.EncMapIntInt16V(*v, fastpathCheckNilTrue, e) - - case map[int]int32: - fastpathTV.EncMapIntInt32V(v, fastpathCheckNilTrue, e) - case *map[int]int32: - fastpathTV.EncMapIntInt32V(*v, fastpathCheckNilTrue, e) - - case map[int]int64: - fastpathTV.EncMapIntInt64V(v, fastpathCheckNilTrue, e) - case *map[int]int64: - fastpathTV.EncMapIntInt64V(*v, fastpathCheckNilTrue, e) - - case map[int]float32: - fastpathTV.EncMapIntFloat32V(v, fastpathCheckNilTrue, e) - case *map[int]float32: - fastpathTV.EncMapIntFloat32V(*v, fastpathCheckNilTrue, e) - - case map[int]float64: - fastpathTV.EncMapIntFloat64V(v, fastpathCheckNilTrue, e) - case *map[int]float64: - fastpathTV.EncMapIntFloat64V(*v, fastpathCheckNilTrue, e) - - case map[int]bool: - fastpathTV.EncMapIntBoolV(v, fastpathCheckNilTrue, e) - case *map[int]bool: - fastpathTV.EncMapIntBoolV(*v, fastpathCheckNilTrue, e) - - case []int8: - fastpathTV.EncSliceInt8V(v, fastpathCheckNilTrue, e) - case *[]int8: - fastpathTV.EncSliceInt8V(*v, fastpathCheckNilTrue, e) - - case map[int8]interface{}: - fastpathTV.EncMapInt8IntfV(v, fastpathCheckNilTrue, e) - case *map[int8]interface{}: - fastpathTV.EncMapInt8IntfV(*v, fastpathCheckNilTrue, e) - - case map[int8]string: - fastpathTV.EncMapInt8StringV(v, fastpathCheckNilTrue, e) - case *map[int8]string: - fastpathTV.EncMapInt8StringV(*v, fastpathCheckNilTrue, e) - - case map[int8]uint: - fastpathTV.EncMapInt8UintV(v, fastpathCheckNilTrue, e) - case *map[int8]uint: - fastpathTV.EncMapInt8UintV(*v, fastpathCheckNilTrue, e) - - case map[int8]uint8: - fastpathTV.EncMapInt8Uint8V(v, fastpathCheckNilTrue, e) - case *map[int8]uint8: - fastpathTV.EncMapInt8Uint8V(*v, fastpathCheckNilTrue, e) - - case map[int8]uint16: - fastpathTV.EncMapInt8Uint16V(v, fastpathCheckNilTrue, e) - case *map[int8]uint16: - fastpathTV.EncMapInt8Uint16V(*v, fastpathCheckNilTrue, e) - - case map[int8]uint32: - fastpathTV.EncMapInt8Uint32V(v, fastpathCheckNilTrue, e) - case *map[int8]uint32: - fastpathTV.EncMapInt8Uint32V(*v, fastpathCheckNilTrue, e) - - case map[int8]uint64: - fastpathTV.EncMapInt8Uint64V(v, fastpathCheckNilTrue, e) - case *map[int8]uint64: - fastpathTV.EncMapInt8Uint64V(*v, fastpathCheckNilTrue, e) - - case map[int8]uintptr: - fastpathTV.EncMapInt8UintptrV(v, fastpathCheckNilTrue, e) - case *map[int8]uintptr: - fastpathTV.EncMapInt8UintptrV(*v, fastpathCheckNilTrue, e) - - case map[int8]int: - fastpathTV.EncMapInt8IntV(v, fastpathCheckNilTrue, e) - case *map[int8]int: - fastpathTV.EncMapInt8IntV(*v, fastpathCheckNilTrue, e) - - case map[int8]int8: - fastpathTV.EncMapInt8Int8V(v, fastpathCheckNilTrue, e) - case *map[int8]int8: - fastpathTV.EncMapInt8Int8V(*v, fastpathCheckNilTrue, e) - - case map[int8]int16: - fastpathTV.EncMapInt8Int16V(v, fastpathCheckNilTrue, e) - case *map[int8]int16: - fastpathTV.EncMapInt8Int16V(*v, fastpathCheckNilTrue, e) - - case map[int8]int32: - fastpathTV.EncMapInt8Int32V(v, fastpathCheckNilTrue, e) - case *map[int8]int32: - fastpathTV.EncMapInt8Int32V(*v, fastpathCheckNilTrue, e) - - case map[int8]int64: - fastpathTV.EncMapInt8Int64V(v, fastpathCheckNilTrue, e) - case *map[int8]int64: - fastpathTV.EncMapInt8Int64V(*v, fastpathCheckNilTrue, e) - - case map[int8]float32: - fastpathTV.EncMapInt8Float32V(v, fastpathCheckNilTrue, e) - case *map[int8]float32: - fastpathTV.EncMapInt8Float32V(*v, fastpathCheckNilTrue, e) - - case map[int8]float64: - fastpathTV.EncMapInt8Float64V(v, fastpathCheckNilTrue, e) - case *map[int8]float64: - fastpathTV.EncMapInt8Float64V(*v, fastpathCheckNilTrue, e) - - case map[int8]bool: - fastpathTV.EncMapInt8BoolV(v, fastpathCheckNilTrue, e) - case *map[int8]bool: - fastpathTV.EncMapInt8BoolV(*v, fastpathCheckNilTrue, e) - - case []int16: - fastpathTV.EncSliceInt16V(v, fastpathCheckNilTrue, e) - case *[]int16: - fastpathTV.EncSliceInt16V(*v, fastpathCheckNilTrue, e) - - case map[int16]interface{}: - fastpathTV.EncMapInt16IntfV(v, fastpathCheckNilTrue, e) - case *map[int16]interface{}: - fastpathTV.EncMapInt16IntfV(*v, fastpathCheckNilTrue, e) - - case map[int16]string: - fastpathTV.EncMapInt16StringV(v, fastpathCheckNilTrue, e) - case *map[int16]string: - fastpathTV.EncMapInt16StringV(*v, fastpathCheckNilTrue, e) - - case map[int16]uint: - fastpathTV.EncMapInt16UintV(v, fastpathCheckNilTrue, e) - case *map[int16]uint: - fastpathTV.EncMapInt16UintV(*v, fastpathCheckNilTrue, e) - - case map[int16]uint8: - fastpathTV.EncMapInt16Uint8V(v, fastpathCheckNilTrue, e) - case *map[int16]uint8: - fastpathTV.EncMapInt16Uint8V(*v, fastpathCheckNilTrue, e) - - case map[int16]uint16: - fastpathTV.EncMapInt16Uint16V(v, fastpathCheckNilTrue, e) - case *map[int16]uint16: - fastpathTV.EncMapInt16Uint16V(*v, fastpathCheckNilTrue, e) - - case map[int16]uint32: - fastpathTV.EncMapInt16Uint32V(v, fastpathCheckNilTrue, e) - case *map[int16]uint32: - fastpathTV.EncMapInt16Uint32V(*v, fastpathCheckNilTrue, e) - - case map[int16]uint64: - fastpathTV.EncMapInt16Uint64V(v, fastpathCheckNilTrue, e) - case *map[int16]uint64: - fastpathTV.EncMapInt16Uint64V(*v, fastpathCheckNilTrue, e) - - case map[int16]uintptr: - fastpathTV.EncMapInt16UintptrV(v, fastpathCheckNilTrue, e) - case *map[int16]uintptr: - fastpathTV.EncMapInt16UintptrV(*v, fastpathCheckNilTrue, e) - - case map[int16]int: - fastpathTV.EncMapInt16IntV(v, fastpathCheckNilTrue, e) - case *map[int16]int: - fastpathTV.EncMapInt16IntV(*v, fastpathCheckNilTrue, e) - - case map[int16]int8: - fastpathTV.EncMapInt16Int8V(v, fastpathCheckNilTrue, e) - case *map[int16]int8: - fastpathTV.EncMapInt16Int8V(*v, fastpathCheckNilTrue, e) - - case map[int16]int16: - fastpathTV.EncMapInt16Int16V(v, fastpathCheckNilTrue, e) - case *map[int16]int16: - fastpathTV.EncMapInt16Int16V(*v, fastpathCheckNilTrue, e) - - case map[int16]int32: - fastpathTV.EncMapInt16Int32V(v, fastpathCheckNilTrue, e) - case *map[int16]int32: - fastpathTV.EncMapInt16Int32V(*v, fastpathCheckNilTrue, e) - - case map[int16]int64: - fastpathTV.EncMapInt16Int64V(v, fastpathCheckNilTrue, e) - case *map[int16]int64: - fastpathTV.EncMapInt16Int64V(*v, fastpathCheckNilTrue, e) - - case map[int16]float32: - fastpathTV.EncMapInt16Float32V(v, fastpathCheckNilTrue, e) - case *map[int16]float32: - fastpathTV.EncMapInt16Float32V(*v, fastpathCheckNilTrue, e) - - case map[int16]float64: - fastpathTV.EncMapInt16Float64V(v, fastpathCheckNilTrue, e) - case *map[int16]float64: - fastpathTV.EncMapInt16Float64V(*v, fastpathCheckNilTrue, e) - - case map[int16]bool: - fastpathTV.EncMapInt16BoolV(v, fastpathCheckNilTrue, e) - case *map[int16]bool: - fastpathTV.EncMapInt16BoolV(*v, fastpathCheckNilTrue, e) - - case []int32: - fastpathTV.EncSliceInt32V(v, fastpathCheckNilTrue, e) - case *[]int32: - fastpathTV.EncSliceInt32V(*v, fastpathCheckNilTrue, e) - - case map[int32]interface{}: - fastpathTV.EncMapInt32IntfV(v, fastpathCheckNilTrue, e) - case *map[int32]interface{}: - fastpathTV.EncMapInt32IntfV(*v, fastpathCheckNilTrue, e) - - case map[int32]string: - fastpathTV.EncMapInt32StringV(v, fastpathCheckNilTrue, e) - case *map[int32]string: - fastpathTV.EncMapInt32StringV(*v, fastpathCheckNilTrue, e) - - case map[int32]uint: - fastpathTV.EncMapInt32UintV(v, fastpathCheckNilTrue, e) - case *map[int32]uint: - fastpathTV.EncMapInt32UintV(*v, fastpathCheckNilTrue, e) - - case map[int32]uint8: - fastpathTV.EncMapInt32Uint8V(v, fastpathCheckNilTrue, e) - case *map[int32]uint8: - fastpathTV.EncMapInt32Uint8V(*v, fastpathCheckNilTrue, e) - - case map[int32]uint16: - fastpathTV.EncMapInt32Uint16V(v, fastpathCheckNilTrue, e) - case *map[int32]uint16: - fastpathTV.EncMapInt32Uint16V(*v, fastpathCheckNilTrue, e) - - case map[int32]uint32: - fastpathTV.EncMapInt32Uint32V(v, fastpathCheckNilTrue, e) - case *map[int32]uint32: - fastpathTV.EncMapInt32Uint32V(*v, fastpathCheckNilTrue, e) - - case map[int32]uint64: - fastpathTV.EncMapInt32Uint64V(v, fastpathCheckNilTrue, e) - case *map[int32]uint64: - fastpathTV.EncMapInt32Uint64V(*v, fastpathCheckNilTrue, e) - - case map[int32]uintptr: - fastpathTV.EncMapInt32UintptrV(v, fastpathCheckNilTrue, e) - case *map[int32]uintptr: - fastpathTV.EncMapInt32UintptrV(*v, fastpathCheckNilTrue, e) - - case map[int32]int: - fastpathTV.EncMapInt32IntV(v, fastpathCheckNilTrue, e) - case *map[int32]int: - fastpathTV.EncMapInt32IntV(*v, fastpathCheckNilTrue, e) - - case map[int32]int8: - fastpathTV.EncMapInt32Int8V(v, fastpathCheckNilTrue, e) - case *map[int32]int8: - fastpathTV.EncMapInt32Int8V(*v, fastpathCheckNilTrue, e) - - case map[int32]int16: - fastpathTV.EncMapInt32Int16V(v, fastpathCheckNilTrue, e) - case *map[int32]int16: - fastpathTV.EncMapInt32Int16V(*v, fastpathCheckNilTrue, e) - - case map[int32]int32: - fastpathTV.EncMapInt32Int32V(v, fastpathCheckNilTrue, e) - case *map[int32]int32: - fastpathTV.EncMapInt32Int32V(*v, fastpathCheckNilTrue, e) - - case map[int32]int64: - fastpathTV.EncMapInt32Int64V(v, fastpathCheckNilTrue, e) - case *map[int32]int64: - fastpathTV.EncMapInt32Int64V(*v, fastpathCheckNilTrue, e) - - case map[int32]float32: - fastpathTV.EncMapInt32Float32V(v, fastpathCheckNilTrue, e) - case *map[int32]float32: - fastpathTV.EncMapInt32Float32V(*v, fastpathCheckNilTrue, e) - - case map[int32]float64: - fastpathTV.EncMapInt32Float64V(v, fastpathCheckNilTrue, e) - case *map[int32]float64: - fastpathTV.EncMapInt32Float64V(*v, fastpathCheckNilTrue, e) - - case map[int32]bool: - fastpathTV.EncMapInt32BoolV(v, fastpathCheckNilTrue, e) - case *map[int32]bool: - fastpathTV.EncMapInt32BoolV(*v, fastpathCheckNilTrue, e) - - case []int64: - fastpathTV.EncSliceInt64V(v, fastpathCheckNilTrue, e) - case *[]int64: - fastpathTV.EncSliceInt64V(*v, fastpathCheckNilTrue, e) - - case map[int64]interface{}: - fastpathTV.EncMapInt64IntfV(v, fastpathCheckNilTrue, e) - case *map[int64]interface{}: - fastpathTV.EncMapInt64IntfV(*v, fastpathCheckNilTrue, e) - - case map[int64]string: - fastpathTV.EncMapInt64StringV(v, fastpathCheckNilTrue, e) - case *map[int64]string: - fastpathTV.EncMapInt64StringV(*v, fastpathCheckNilTrue, e) - - case map[int64]uint: - fastpathTV.EncMapInt64UintV(v, fastpathCheckNilTrue, e) - case *map[int64]uint: - fastpathTV.EncMapInt64UintV(*v, fastpathCheckNilTrue, e) - - case map[int64]uint8: - fastpathTV.EncMapInt64Uint8V(v, fastpathCheckNilTrue, e) - case *map[int64]uint8: - fastpathTV.EncMapInt64Uint8V(*v, fastpathCheckNilTrue, e) - - case map[int64]uint16: - fastpathTV.EncMapInt64Uint16V(v, fastpathCheckNilTrue, e) - case *map[int64]uint16: - fastpathTV.EncMapInt64Uint16V(*v, fastpathCheckNilTrue, e) - - case map[int64]uint32: - fastpathTV.EncMapInt64Uint32V(v, fastpathCheckNilTrue, e) - case *map[int64]uint32: - fastpathTV.EncMapInt64Uint32V(*v, fastpathCheckNilTrue, e) - - case map[int64]uint64: - fastpathTV.EncMapInt64Uint64V(v, fastpathCheckNilTrue, e) - case *map[int64]uint64: - fastpathTV.EncMapInt64Uint64V(*v, fastpathCheckNilTrue, e) - - case map[int64]uintptr: - fastpathTV.EncMapInt64UintptrV(v, fastpathCheckNilTrue, e) - case *map[int64]uintptr: - fastpathTV.EncMapInt64UintptrV(*v, fastpathCheckNilTrue, e) - - case map[int64]int: - fastpathTV.EncMapInt64IntV(v, fastpathCheckNilTrue, e) - case *map[int64]int: - fastpathTV.EncMapInt64IntV(*v, fastpathCheckNilTrue, e) - - case map[int64]int8: - fastpathTV.EncMapInt64Int8V(v, fastpathCheckNilTrue, e) - case *map[int64]int8: - fastpathTV.EncMapInt64Int8V(*v, fastpathCheckNilTrue, e) - - case map[int64]int16: - fastpathTV.EncMapInt64Int16V(v, fastpathCheckNilTrue, e) - case *map[int64]int16: - fastpathTV.EncMapInt64Int16V(*v, fastpathCheckNilTrue, e) - - case map[int64]int32: - fastpathTV.EncMapInt64Int32V(v, fastpathCheckNilTrue, e) - case *map[int64]int32: - fastpathTV.EncMapInt64Int32V(*v, fastpathCheckNilTrue, e) - - case map[int64]int64: - fastpathTV.EncMapInt64Int64V(v, fastpathCheckNilTrue, e) - case *map[int64]int64: - fastpathTV.EncMapInt64Int64V(*v, fastpathCheckNilTrue, e) - - case map[int64]float32: - fastpathTV.EncMapInt64Float32V(v, fastpathCheckNilTrue, e) - case *map[int64]float32: - fastpathTV.EncMapInt64Float32V(*v, fastpathCheckNilTrue, e) - - case map[int64]float64: - fastpathTV.EncMapInt64Float64V(v, fastpathCheckNilTrue, e) - case *map[int64]float64: - fastpathTV.EncMapInt64Float64V(*v, fastpathCheckNilTrue, e) - - case map[int64]bool: - fastpathTV.EncMapInt64BoolV(v, fastpathCheckNilTrue, e) - case *map[int64]bool: - fastpathTV.EncMapInt64BoolV(*v, fastpathCheckNilTrue, e) - - case []bool: - fastpathTV.EncSliceBoolV(v, fastpathCheckNilTrue, e) - case *[]bool: - fastpathTV.EncSliceBoolV(*v, fastpathCheckNilTrue, e) - - case map[bool]interface{}: - fastpathTV.EncMapBoolIntfV(v, fastpathCheckNilTrue, e) - case *map[bool]interface{}: - fastpathTV.EncMapBoolIntfV(*v, fastpathCheckNilTrue, e) - - case map[bool]string: - fastpathTV.EncMapBoolStringV(v, fastpathCheckNilTrue, e) - case *map[bool]string: - fastpathTV.EncMapBoolStringV(*v, fastpathCheckNilTrue, e) - - case map[bool]uint: - fastpathTV.EncMapBoolUintV(v, fastpathCheckNilTrue, e) - case *map[bool]uint: - fastpathTV.EncMapBoolUintV(*v, fastpathCheckNilTrue, e) - - case map[bool]uint8: - fastpathTV.EncMapBoolUint8V(v, fastpathCheckNilTrue, e) - case *map[bool]uint8: - fastpathTV.EncMapBoolUint8V(*v, fastpathCheckNilTrue, e) - - case map[bool]uint16: - fastpathTV.EncMapBoolUint16V(v, fastpathCheckNilTrue, e) - case *map[bool]uint16: - fastpathTV.EncMapBoolUint16V(*v, fastpathCheckNilTrue, e) - - case map[bool]uint32: - fastpathTV.EncMapBoolUint32V(v, fastpathCheckNilTrue, e) - case *map[bool]uint32: - fastpathTV.EncMapBoolUint32V(*v, fastpathCheckNilTrue, e) - - case map[bool]uint64: - fastpathTV.EncMapBoolUint64V(v, fastpathCheckNilTrue, e) - case *map[bool]uint64: - fastpathTV.EncMapBoolUint64V(*v, fastpathCheckNilTrue, e) - - case map[bool]uintptr: - fastpathTV.EncMapBoolUintptrV(v, fastpathCheckNilTrue, e) - case *map[bool]uintptr: - fastpathTV.EncMapBoolUintptrV(*v, fastpathCheckNilTrue, e) - - case map[bool]int: - fastpathTV.EncMapBoolIntV(v, fastpathCheckNilTrue, e) - case *map[bool]int: - fastpathTV.EncMapBoolIntV(*v, fastpathCheckNilTrue, e) - - case map[bool]int8: - fastpathTV.EncMapBoolInt8V(v, fastpathCheckNilTrue, e) - case *map[bool]int8: - fastpathTV.EncMapBoolInt8V(*v, fastpathCheckNilTrue, e) - - case map[bool]int16: - fastpathTV.EncMapBoolInt16V(v, fastpathCheckNilTrue, e) - case *map[bool]int16: - fastpathTV.EncMapBoolInt16V(*v, fastpathCheckNilTrue, e) - - case map[bool]int32: - fastpathTV.EncMapBoolInt32V(v, fastpathCheckNilTrue, e) - case *map[bool]int32: - fastpathTV.EncMapBoolInt32V(*v, fastpathCheckNilTrue, e) - - case map[bool]int64: - fastpathTV.EncMapBoolInt64V(v, fastpathCheckNilTrue, e) - case *map[bool]int64: - fastpathTV.EncMapBoolInt64V(*v, fastpathCheckNilTrue, e) - - case map[bool]float32: - fastpathTV.EncMapBoolFloat32V(v, fastpathCheckNilTrue, e) - case *map[bool]float32: - fastpathTV.EncMapBoolFloat32V(*v, fastpathCheckNilTrue, e) - - case map[bool]float64: - fastpathTV.EncMapBoolFloat64V(v, fastpathCheckNilTrue, e) - case *map[bool]float64: - fastpathTV.EncMapBoolFloat64V(*v, fastpathCheckNilTrue, e) - - case map[bool]bool: - fastpathTV.EncMapBoolBoolV(v, fastpathCheckNilTrue, e) - case *map[bool]bool: - fastpathTV.EncMapBoolBoolV(*v, fastpathCheckNilTrue, e) - - default: - _ = v // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release) - return false - } - return true -} - -func fastpathEncodeTypeSwitchSlice(iv interface{}, e *Encoder) bool { - switch v := iv.(type) { - - case []interface{}: - fastpathTV.EncSliceIntfV(v, fastpathCheckNilTrue, e) - case *[]interface{}: - fastpathTV.EncSliceIntfV(*v, fastpathCheckNilTrue, e) - - case []string: - fastpathTV.EncSliceStringV(v, fastpathCheckNilTrue, e) - case *[]string: - fastpathTV.EncSliceStringV(*v, fastpathCheckNilTrue, e) - - case []float32: - fastpathTV.EncSliceFloat32V(v, fastpathCheckNilTrue, e) - case *[]float32: - fastpathTV.EncSliceFloat32V(*v, fastpathCheckNilTrue, e) - - case []float64: - fastpathTV.EncSliceFloat64V(v, fastpathCheckNilTrue, e) - case *[]float64: - fastpathTV.EncSliceFloat64V(*v, fastpathCheckNilTrue, e) - - case []uint: - fastpathTV.EncSliceUintV(v, fastpathCheckNilTrue, e) - case *[]uint: - fastpathTV.EncSliceUintV(*v, fastpathCheckNilTrue, e) - - case []uint16: - fastpathTV.EncSliceUint16V(v, fastpathCheckNilTrue, e) - case *[]uint16: - fastpathTV.EncSliceUint16V(*v, fastpathCheckNilTrue, e) - - case []uint32: - fastpathTV.EncSliceUint32V(v, fastpathCheckNilTrue, e) - case *[]uint32: - fastpathTV.EncSliceUint32V(*v, fastpathCheckNilTrue, e) - - case []uint64: - fastpathTV.EncSliceUint64V(v, fastpathCheckNilTrue, e) - case *[]uint64: - fastpathTV.EncSliceUint64V(*v, fastpathCheckNilTrue, e) - - case []uintptr: - fastpathTV.EncSliceUintptrV(v, fastpathCheckNilTrue, e) - case *[]uintptr: - fastpathTV.EncSliceUintptrV(*v, fastpathCheckNilTrue, e) - - case []int: - fastpathTV.EncSliceIntV(v, fastpathCheckNilTrue, e) - case *[]int: - fastpathTV.EncSliceIntV(*v, fastpathCheckNilTrue, e) - - case []int8: - fastpathTV.EncSliceInt8V(v, fastpathCheckNilTrue, e) - case *[]int8: - fastpathTV.EncSliceInt8V(*v, fastpathCheckNilTrue, e) - - case []int16: - fastpathTV.EncSliceInt16V(v, fastpathCheckNilTrue, e) - case *[]int16: - fastpathTV.EncSliceInt16V(*v, fastpathCheckNilTrue, e) - - case []int32: - fastpathTV.EncSliceInt32V(v, fastpathCheckNilTrue, e) - case *[]int32: - fastpathTV.EncSliceInt32V(*v, fastpathCheckNilTrue, e) - - case []int64: - fastpathTV.EncSliceInt64V(v, fastpathCheckNilTrue, e) - case *[]int64: - fastpathTV.EncSliceInt64V(*v, fastpathCheckNilTrue, e) - - case []bool: - fastpathTV.EncSliceBoolV(v, fastpathCheckNilTrue, e) - case *[]bool: - fastpathTV.EncSliceBoolV(*v, fastpathCheckNilTrue, e) - - default: - _ = v // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release) - return false - } - return true -} - -func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool { - switch v := iv.(type) { - - case map[interface{}]interface{}: - fastpathTV.EncMapIntfIntfV(v, fastpathCheckNilTrue, e) - case *map[interface{}]interface{}: - fastpathTV.EncMapIntfIntfV(*v, fastpathCheckNilTrue, e) - - case map[interface{}]string: - fastpathTV.EncMapIntfStringV(v, fastpathCheckNilTrue, e) - case *map[interface{}]string: - fastpathTV.EncMapIntfStringV(*v, fastpathCheckNilTrue, e) - - case map[interface{}]uint: - fastpathTV.EncMapIntfUintV(v, fastpathCheckNilTrue, e) - case *map[interface{}]uint: - fastpathTV.EncMapIntfUintV(*v, fastpathCheckNilTrue, e) - - case map[interface{}]uint8: - fastpathTV.EncMapIntfUint8V(v, fastpathCheckNilTrue, e) - case *map[interface{}]uint8: - fastpathTV.EncMapIntfUint8V(*v, fastpathCheckNilTrue, e) - - case map[interface{}]uint16: - fastpathTV.EncMapIntfUint16V(v, fastpathCheckNilTrue, e) - case *map[interface{}]uint16: - fastpathTV.EncMapIntfUint16V(*v, fastpathCheckNilTrue, e) - - case map[interface{}]uint32: - fastpathTV.EncMapIntfUint32V(v, fastpathCheckNilTrue, e) - case *map[interface{}]uint32: - fastpathTV.EncMapIntfUint32V(*v, fastpathCheckNilTrue, e) - - case map[interface{}]uint64: - fastpathTV.EncMapIntfUint64V(v, fastpathCheckNilTrue, e) - case *map[interface{}]uint64: - fastpathTV.EncMapIntfUint64V(*v, fastpathCheckNilTrue, e) - - case map[interface{}]uintptr: - fastpathTV.EncMapIntfUintptrV(v, fastpathCheckNilTrue, e) - case *map[interface{}]uintptr: - fastpathTV.EncMapIntfUintptrV(*v, fastpathCheckNilTrue, e) - - case map[interface{}]int: - fastpathTV.EncMapIntfIntV(v, fastpathCheckNilTrue, e) - case *map[interface{}]int: - fastpathTV.EncMapIntfIntV(*v, fastpathCheckNilTrue, e) - - case map[interface{}]int8: - fastpathTV.EncMapIntfInt8V(v, fastpathCheckNilTrue, e) - case *map[interface{}]int8: - fastpathTV.EncMapIntfInt8V(*v, fastpathCheckNilTrue, e) - - case map[interface{}]int16: - fastpathTV.EncMapIntfInt16V(v, fastpathCheckNilTrue, e) - case *map[interface{}]int16: - fastpathTV.EncMapIntfInt16V(*v, fastpathCheckNilTrue, e) - - case map[interface{}]int32: - fastpathTV.EncMapIntfInt32V(v, fastpathCheckNilTrue, e) - case *map[interface{}]int32: - fastpathTV.EncMapIntfInt32V(*v, fastpathCheckNilTrue, e) - - case map[interface{}]int64: - fastpathTV.EncMapIntfInt64V(v, fastpathCheckNilTrue, e) - case *map[interface{}]int64: - fastpathTV.EncMapIntfInt64V(*v, fastpathCheckNilTrue, e) - - case map[interface{}]float32: - fastpathTV.EncMapIntfFloat32V(v, fastpathCheckNilTrue, e) - case *map[interface{}]float32: - fastpathTV.EncMapIntfFloat32V(*v, fastpathCheckNilTrue, e) - - case map[interface{}]float64: - fastpathTV.EncMapIntfFloat64V(v, fastpathCheckNilTrue, e) - case *map[interface{}]float64: - fastpathTV.EncMapIntfFloat64V(*v, fastpathCheckNilTrue, e) - - case map[interface{}]bool: - fastpathTV.EncMapIntfBoolV(v, fastpathCheckNilTrue, e) - case *map[interface{}]bool: - fastpathTV.EncMapIntfBoolV(*v, fastpathCheckNilTrue, e) - - case map[string]interface{}: - fastpathTV.EncMapStringIntfV(v, fastpathCheckNilTrue, e) - case *map[string]interface{}: - fastpathTV.EncMapStringIntfV(*v, fastpathCheckNilTrue, e) - - case map[string]string: - fastpathTV.EncMapStringStringV(v, fastpathCheckNilTrue, e) - case *map[string]string: - fastpathTV.EncMapStringStringV(*v, fastpathCheckNilTrue, e) - - case map[string]uint: - fastpathTV.EncMapStringUintV(v, fastpathCheckNilTrue, e) - case *map[string]uint: - fastpathTV.EncMapStringUintV(*v, fastpathCheckNilTrue, e) - - case map[string]uint8: - fastpathTV.EncMapStringUint8V(v, fastpathCheckNilTrue, e) - case *map[string]uint8: - fastpathTV.EncMapStringUint8V(*v, fastpathCheckNilTrue, e) - - case map[string]uint16: - fastpathTV.EncMapStringUint16V(v, fastpathCheckNilTrue, e) - case *map[string]uint16: - fastpathTV.EncMapStringUint16V(*v, fastpathCheckNilTrue, e) - - case map[string]uint32: - fastpathTV.EncMapStringUint32V(v, fastpathCheckNilTrue, e) - case *map[string]uint32: - fastpathTV.EncMapStringUint32V(*v, fastpathCheckNilTrue, e) - - case map[string]uint64: - fastpathTV.EncMapStringUint64V(v, fastpathCheckNilTrue, e) - case *map[string]uint64: - fastpathTV.EncMapStringUint64V(*v, fastpathCheckNilTrue, e) - - case map[string]uintptr: - fastpathTV.EncMapStringUintptrV(v, fastpathCheckNilTrue, e) - case *map[string]uintptr: - fastpathTV.EncMapStringUintptrV(*v, fastpathCheckNilTrue, e) - - case map[string]int: - fastpathTV.EncMapStringIntV(v, fastpathCheckNilTrue, e) - case *map[string]int: - fastpathTV.EncMapStringIntV(*v, fastpathCheckNilTrue, e) - - case map[string]int8: - fastpathTV.EncMapStringInt8V(v, fastpathCheckNilTrue, e) - case *map[string]int8: - fastpathTV.EncMapStringInt8V(*v, fastpathCheckNilTrue, e) - - case map[string]int16: - fastpathTV.EncMapStringInt16V(v, fastpathCheckNilTrue, e) - case *map[string]int16: - fastpathTV.EncMapStringInt16V(*v, fastpathCheckNilTrue, e) - - case map[string]int32: - fastpathTV.EncMapStringInt32V(v, fastpathCheckNilTrue, e) - case *map[string]int32: - fastpathTV.EncMapStringInt32V(*v, fastpathCheckNilTrue, e) - - case map[string]int64: - fastpathTV.EncMapStringInt64V(v, fastpathCheckNilTrue, e) - case *map[string]int64: - fastpathTV.EncMapStringInt64V(*v, fastpathCheckNilTrue, e) - - case map[string]float32: - fastpathTV.EncMapStringFloat32V(v, fastpathCheckNilTrue, e) - case *map[string]float32: - fastpathTV.EncMapStringFloat32V(*v, fastpathCheckNilTrue, e) - - case map[string]float64: - fastpathTV.EncMapStringFloat64V(v, fastpathCheckNilTrue, e) - case *map[string]float64: - fastpathTV.EncMapStringFloat64V(*v, fastpathCheckNilTrue, e) - - case map[string]bool: - fastpathTV.EncMapStringBoolV(v, fastpathCheckNilTrue, e) - case *map[string]bool: - fastpathTV.EncMapStringBoolV(*v, fastpathCheckNilTrue, e) - - case map[float32]interface{}: - fastpathTV.EncMapFloat32IntfV(v, fastpathCheckNilTrue, e) - case *map[float32]interface{}: - fastpathTV.EncMapFloat32IntfV(*v, fastpathCheckNilTrue, e) - - case map[float32]string: - fastpathTV.EncMapFloat32StringV(v, fastpathCheckNilTrue, e) - case *map[float32]string: - fastpathTV.EncMapFloat32StringV(*v, fastpathCheckNilTrue, e) - - case map[float32]uint: - fastpathTV.EncMapFloat32UintV(v, fastpathCheckNilTrue, e) - case *map[float32]uint: - fastpathTV.EncMapFloat32UintV(*v, fastpathCheckNilTrue, e) - - case map[float32]uint8: - fastpathTV.EncMapFloat32Uint8V(v, fastpathCheckNilTrue, e) - case *map[float32]uint8: - fastpathTV.EncMapFloat32Uint8V(*v, fastpathCheckNilTrue, e) - - case map[float32]uint16: - fastpathTV.EncMapFloat32Uint16V(v, fastpathCheckNilTrue, e) - case *map[float32]uint16: - fastpathTV.EncMapFloat32Uint16V(*v, fastpathCheckNilTrue, e) - - case map[float32]uint32: - fastpathTV.EncMapFloat32Uint32V(v, fastpathCheckNilTrue, e) - case *map[float32]uint32: - fastpathTV.EncMapFloat32Uint32V(*v, fastpathCheckNilTrue, e) - - case map[float32]uint64: - fastpathTV.EncMapFloat32Uint64V(v, fastpathCheckNilTrue, e) - case *map[float32]uint64: - fastpathTV.EncMapFloat32Uint64V(*v, fastpathCheckNilTrue, e) - - case map[float32]uintptr: - fastpathTV.EncMapFloat32UintptrV(v, fastpathCheckNilTrue, e) - case *map[float32]uintptr: - fastpathTV.EncMapFloat32UintptrV(*v, fastpathCheckNilTrue, e) - - case map[float32]int: - fastpathTV.EncMapFloat32IntV(v, fastpathCheckNilTrue, e) - case *map[float32]int: - fastpathTV.EncMapFloat32IntV(*v, fastpathCheckNilTrue, e) - - case map[float32]int8: - fastpathTV.EncMapFloat32Int8V(v, fastpathCheckNilTrue, e) - case *map[float32]int8: - fastpathTV.EncMapFloat32Int8V(*v, fastpathCheckNilTrue, e) - - case map[float32]int16: - fastpathTV.EncMapFloat32Int16V(v, fastpathCheckNilTrue, e) - case *map[float32]int16: - fastpathTV.EncMapFloat32Int16V(*v, fastpathCheckNilTrue, e) - - case map[float32]int32: - fastpathTV.EncMapFloat32Int32V(v, fastpathCheckNilTrue, e) - case *map[float32]int32: - fastpathTV.EncMapFloat32Int32V(*v, fastpathCheckNilTrue, e) - - case map[float32]int64: - fastpathTV.EncMapFloat32Int64V(v, fastpathCheckNilTrue, e) - case *map[float32]int64: - fastpathTV.EncMapFloat32Int64V(*v, fastpathCheckNilTrue, e) - - case map[float32]float32: - fastpathTV.EncMapFloat32Float32V(v, fastpathCheckNilTrue, e) - case *map[float32]float32: - fastpathTV.EncMapFloat32Float32V(*v, fastpathCheckNilTrue, e) - - case map[float32]float64: - fastpathTV.EncMapFloat32Float64V(v, fastpathCheckNilTrue, e) - case *map[float32]float64: - fastpathTV.EncMapFloat32Float64V(*v, fastpathCheckNilTrue, e) - - case map[float32]bool: - fastpathTV.EncMapFloat32BoolV(v, fastpathCheckNilTrue, e) - case *map[float32]bool: - fastpathTV.EncMapFloat32BoolV(*v, fastpathCheckNilTrue, e) - - case map[float64]interface{}: - fastpathTV.EncMapFloat64IntfV(v, fastpathCheckNilTrue, e) - case *map[float64]interface{}: - fastpathTV.EncMapFloat64IntfV(*v, fastpathCheckNilTrue, e) - - case map[float64]string: - fastpathTV.EncMapFloat64StringV(v, fastpathCheckNilTrue, e) - case *map[float64]string: - fastpathTV.EncMapFloat64StringV(*v, fastpathCheckNilTrue, e) - - case map[float64]uint: - fastpathTV.EncMapFloat64UintV(v, fastpathCheckNilTrue, e) - case *map[float64]uint: - fastpathTV.EncMapFloat64UintV(*v, fastpathCheckNilTrue, e) - - case map[float64]uint8: - fastpathTV.EncMapFloat64Uint8V(v, fastpathCheckNilTrue, e) - case *map[float64]uint8: - fastpathTV.EncMapFloat64Uint8V(*v, fastpathCheckNilTrue, e) - - case map[float64]uint16: - fastpathTV.EncMapFloat64Uint16V(v, fastpathCheckNilTrue, e) - case *map[float64]uint16: - fastpathTV.EncMapFloat64Uint16V(*v, fastpathCheckNilTrue, e) - - case map[float64]uint32: - fastpathTV.EncMapFloat64Uint32V(v, fastpathCheckNilTrue, e) - case *map[float64]uint32: - fastpathTV.EncMapFloat64Uint32V(*v, fastpathCheckNilTrue, e) - - case map[float64]uint64: - fastpathTV.EncMapFloat64Uint64V(v, fastpathCheckNilTrue, e) - case *map[float64]uint64: - fastpathTV.EncMapFloat64Uint64V(*v, fastpathCheckNilTrue, e) - - case map[float64]uintptr: - fastpathTV.EncMapFloat64UintptrV(v, fastpathCheckNilTrue, e) - case *map[float64]uintptr: - fastpathTV.EncMapFloat64UintptrV(*v, fastpathCheckNilTrue, e) - - case map[float64]int: - fastpathTV.EncMapFloat64IntV(v, fastpathCheckNilTrue, e) - case *map[float64]int: - fastpathTV.EncMapFloat64IntV(*v, fastpathCheckNilTrue, e) - - case map[float64]int8: - fastpathTV.EncMapFloat64Int8V(v, fastpathCheckNilTrue, e) - case *map[float64]int8: - fastpathTV.EncMapFloat64Int8V(*v, fastpathCheckNilTrue, e) - - case map[float64]int16: - fastpathTV.EncMapFloat64Int16V(v, fastpathCheckNilTrue, e) - case *map[float64]int16: - fastpathTV.EncMapFloat64Int16V(*v, fastpathCheckNilTrue, e) - - case map[float64]int32: - fastpathTV.EncMapFloat64Int32V(v, fastpathCheckNilTrue, e) - case *map[float64]int32: - fastpathTV.EncMapFloat64Int32V(*v, fastpathCheckNilTrue, e) - - case map[float64]int64: - fastpathTV.EncMapFloat64Int64V(v, fastpathCheckNilTrue, e) - case *map[float64]int64: - fastpathTV.EncMapFloat64Int64V(*v, fastpathCheckNilTrue, e) - - case map[float64]float32: - fastpathTV.EncMapFloat64Float32V(v, fastpathCheckNilTrue, e) - case *map[float64]float32: - fastpathTV.EncMapFloat64Float32V(*v, fastpathCheckNilTrue, e) - - case map[float64]float64: - fastpathTV.EncMapFloat64Float64V(v, fastpathCheckNilTrue, e) - case *map[float64]float64: - fastpathTV.EncMapFloat64Float64V(*v, fastpathCheckNilTrue, e) - - case map[float64]bool: - fastpathTV.EncMapFloat64BoolV(v, fastpathCheckNilTrue, e) - case *map[float64]bool: - fastpathTV.EncMapFloat64BoolV(*v, fastpathCheckNilTrue, e) - - case map[uint]interface{}: - fastpathTV.EncMapUintIntfV(v, fastpathCheckNilTrue, e) - case *map[uint]interface{}: - fastpathTV.EncMapUintIntfV(*v, fastpathCheckNilTrue, e) - - case map[uint]string: - fastpathTV.EncMapUintStringV(v, fastpathCheckNilTrue, e) - case *map[uint]string: - fastpathTV.EncMapUintStringV(*v, fastpathCheckNilTrue, e) - - case map[uint]uint: - fastpathTV.EncMapUintUintV(v, fastpathCheckNilTrue, e) - case *map[uint]uint: - fastpathTV.EncMapUintUintV(*v, fastpathCheckNilTrue, e) - - case map[uint]uint8: - fastpathTV.EncMapUintUint8V(v, fastpathCheckNilTrue, e) - case *map[uint]uint8: - fastpathTV.EncMapUintUint8V(*v, fastpathCheckNilTrue, e) - - case map[uint]uint16: - fastpathTV.EncMapUintUint16V(v, fastpathCheckNilTrue, e) - case *map[uint]uint16: - fastpathTV.EncMapUintUint16V(*v, fastpathCheckNilTrue, e) - - case map[uint]uint32: - fastpathTV.EncMapUintUint32V(v, fastpathCheckNilTrue, e) - case *map[uint]uint32: - fastpathTV.EncMapUintUint32V(*v, fastpathCheckNilTrue, e) - - case map[uint]uint64: - fastpathTV.EncMapUintUint64V(v, fastpathCheckNilTrue, e) - case *map[uint]uint64: - fastpathTV.EncMapUintUint64V(*v, fastpathCheckNilTrue, e) - - case map[uint]uintptr: - fastpathTV.EncMapUintUintptrV(v, fastpathCheckNilTrue, e) - case *map[uint]uintptr: - fastpathTV.EncMapUintUintptrV(*v, fastpathCheckNilTrue, e) - - case map[uint]int: - fastpathTV.EncMapUintIntV(v, fastpathCheckNilTrue, e) - case *map[uint]int: - fastpathTV.EncMapUintIntV(*v, fastpathCheckNilTrue, e) - - case map[uint]int8: - fastpathTV.EncMapUintInt8V(v, fastpathCheckNilTrue, e) - case *map[uint]int8: - fastpathTV.EncMapUintInt8V(*v, fastpathCheckNilTrue, e) - - case map[uint]int16: - fastpathTV.EncMapUintInt16V(v, fastpathCheckNilTrue, e) - case *map[uint]int16: - fastpathTV.EncMapUintInt16V(*v, fastpathCheckNilTrue, e) - - case map[uint]int32: - fastpathTV.EncMapUintInt32V(v, fastpathCheckNilTrue, e) - case *map[uint]int32: - fastpathTV.EncMapUintInt32V(*v, fastpathCheckNilTrue, e) - - case map[uint]int64: - fastpathTV.EncMapUintInt64V(v, fastpathCheckNilTrue, e) - case *map[uint]int64: - fastpathTV.EncMapUintInt64V(*v, fastpathCheckNilTrue, e) - - case map[uint]float32: - fastpathTV.EncMapUintFloat32V(v, fastpathCheckNilTrue, e) - case *map[uint]float32: - fastpathTV.EncMapUintFloat32V(*v, fastpathCheckNilTrue, e) - - case map[uint]float64: - fastpathTV.EncMapUintFloat64V(v, fastpathCheckNilTrue, e) - case *map[uint]float64: - fastpathTV.EncMapUintFloat64V(*v, fastpathCheckNilTrue, e) - - case map[uint]bool: - fastpathTV.EncMapUintBoolV(v, fastpathCheckNilTrue, e) - case *map[uint]bool: - fastpathTV.EncMapUintBoolV(*v, fastpathCheckNilTrue, e) - - case map[uint8]interface{}: - fastpathTV.EncMapUint8IntfV(v, fastpathCheckNilTrue, e) - case *map[uint8]interface{}: - fastpathTV.EncMapUint8IntfV(*v, fastpathCheckNilTrue, e) - - case map[uint8]string: - fastpathTV.EncMapUint8StringV(v, fastpathCheckNilTrue, e) - case *map[uint8]string: - fastpathTV.EncMapUint8StringV(*v, fastpathCheckNilTrue, e) - - case map[uint8]uint: - fastpathTV.EncMapUint8UintV(v, fastpathCheckNilTrue, e) - case *map[uint8]uint: - fastpathTV.EncMapUint8UintV(*v, fastpathCheckNilTrue, e) - - case map[uint8]uint8: - fastpathTV.EncMapUint8Uint8V(v, fastpathCheckNilTrue, e) - case *map[uint8]uint8: - fastpathTV.EncMapUint8Uint8V(*v, fastpathCheckNilTrue, e) - - case map[uint8]uint16: - fastpathTV.EncMapUint8Uint16V(v, fastpathCheckNilTrue, e) - case *map[uint8]uint16: - fastpathTV.EncMapUint8Uint16V(*v, fastpathCheckNilTrue, e) - - case map[uint8]uint32: - fastpathTV.EncMapUint8Uint32V(v, fastpathCheckNilTrue, e) - case *map[uint8]uint32: - fastpathTV.EncMapUint8Uint32V(*v, fastpathCheckNilTrue, e) - - case map[uint8]uint64: - fastpathTV.EncMapUint8Uint64V(v, fastpathCheckNilTrue, e) - case *map[uint8]uint64: - fastpathTV.EncMapUint8Uint64V(*v, fastpathCheckNilTrue, e) - - case map[uint8]uintptr: - fastpathTV.EncMapUint8UintptrV(v, fastpathCheckNilTrue, e) - case *map[uint8]uintptr: - fastpathTV.EncMapUint8UintptrV(*v, fastpathCheckNilTrue, e) - - case map[uint8]int: - fastpathTV.EncMapUint8IntV(v, fastpathCheckNilTrue, e) - case *map[uint8]int: - fastpathTV.EncMapUint8IntV(*v, fastpathCheckNilTrue, e) - - case map[uint8]int8: - fastpathTV.EncMapUint8Int8V(v, fastpathCheckNilTrue, e) - case *map[uint8]int8: - fastpathTV.EncMapUint8Int8V(*v, fastpathCheckNilTrue, e) - - case map[uint8]int16: - fastpathTV.EncMapUint8Int16V(v, fastpathCheckNilTrue, e) - case *map[uint8]int16: - fastpathTV.EncMapUint8Int16V(*v, fastpathCheckNilTrue, e) - - case map[uint8]int32: - fastpathTV.EncMapUint8Int32V(v, fastpathCheckNilTrue, e) - case *map[uint8]int32: - fastpathTV.EncMapUint8Int32V(*v, fastpathCheckNilTrue, e) - - case map[uint8]int64: - fastpathTV.EncMapUint8Int64V(v, fastpathCheckNilTrue, e) - case *map[uint8]int64: - fastpathTV.EncMapUint8Int64V(*v, fastpathCheckNilTrue, e) - - case map[uint8]float32: - fastpathTV.EncMapUint8Float32V(v, fastpathCheckNilTrue, e) - case *map[uint8]float32: - fastpathTV.EncMapUint8Float32V(*v, fastpathCheckNilTrue, e) - - case map[uint8]float64: - fastpathTV.EncMapUint8Float64V(v, fastpathCheckNilTrue, e) - case *map[uint8]float64: - fastpathTV.EncMapUint8Float64V(*v, fastpathCheckNilTrue, e) - - case map[uint8]bool: - fastpathTV.EncMapUint8BoolV(v, fastpathCheckNilTrue, e) - case *map[uint8]bool: - fastpathTV.EncMapUint8BoolV(*v, fastpathCheckNilTrue, e) - - case map[uint16]interface{}: - fastpathTV.EncMapUint16IntfV(v, fastpathCheckNilTrue, e) - case *map[uint16]interface{}: - fastpathTV.EncMapUint16IntfV(*v, fastpathCheckNilTrue, e) - - case map[uint16]string: - fastpathTV.EncMapUint16StringV(v, fastpathCheckNilTrue, e) - case *map[uint16]string: - fastpathTV.EncMapUint16StringV(*v, fastpathCheckNilTrue, e) - - case map[uint16]uint: - fastpathTV.EncMapUint16UintV(v, fastpathCheckNilTrue, e) - case *map[uint16]uint: - fastpathTV.EncMapUint16UintV(*v, fastpathCheckNilTrue, e) - - case map[uint16]uint8: - fastpathTV.EncMapUint16Uint8V(v, fastpathCheckNilTrue, e) - case *map[uint16]uint8: - fastpathTV.EncMapUint16Uint8V(*v, fastpathCheckNilTrue, e) - - case map[uint16]uint16: - fastpathTV.EncMapUint16Uint16V(v, fastpathCheckNilTrue, e) - case *map[uint16]uint16: - fastpathTV.EncMapUint16Uint16V(*v, fastpathCheckNilTrue, e) - - case map[uint16]uint32: - fastpathTV.EncMapUint16Uint32V(v, fastpathCheckNilTrue, e) - case *map[uint16]uint32: - fastpathTV.EncMapUint16Uint32V(*v, fastpathCheckNilTrue, e) - - case map[uint16]uint64: - fastpathTV.EncMapUint16Uint64V(v, fastpathCheckNilTrue, e) - case *map[uint16]uint64: - fastpathTV.EncMapUint16Uint64V(*v, fastpathCheckNilTrue, e) - - case map[uint16]uintptr: - fastpathTV.EncMapUint16UintptrV(v, fastpathCheckNilTrue, e) - case *map[uint16]uintptr: - fastpathTV.EncMapUint16UintptrV(*v, fastpathCheckNilTrue, e) - - case map[uint16]int: - fastpathTV.EncMapUint16IntV(v, fastpathCheckNilTrue, e) - case *map[uint16]int: - fastpathTV.EncMapUint16IntV(*v, fastpathCheckNilTrue, e) - - case map[uint16]int8: - fastpathTV.EncMapUint16Int8V(v, fastpathCheckNilTrue, e) - case *map[uint16]int8: - fastpathTV.EncMapUint16Int8V(*v, fastpathCheckNilTrue, e) - - case map[uint16]int16: - fastpathTV.EncMapUint16Int16V(v, fastpathCheckNilTrue, e) - case *map[uint16]int16: - fastpathTV.EncMapUint16Int16V(*v, fastpathCheckNilTrue, e) - - case map[uint16]int32: - fastpathTV.EncMapUint16Int32V(v, fastpathCheckNilTrue, e) - case *map[uint16]int32: - fastpathTV.EncMapUint16Int32V(*v, fastpathCheckNilTrue, e) - - case map[uint16]int64: - fastpathTV.EncMapUint16Int64V(v, fastpathCheckNilTrue, e) - case *map[uint16]int64: - fastpathTV.EncMapUint16Int64V(*v, fastpathCheckNilTrue, e) - - case map[uint16]float32: - fastpathTV.EncMapUint16Float32V(v, fastpathCheckNilTrue, e) - case *map[uint16]float32: - fastpathTV.EncMapUint16Float32V(*v, fastpathCheckNilTrue, e) - - case map[uint16]float64: - fastpathTV.EncMapUint16Float64V(v, fastpathCheckNilTrue, e) - case *map[uint16]float64: - fastpathTV.EncMapUint16Float64V(*v, fastpathCheckNilTrue, e) - - case map[uint16]bool: - fastpathTV.EncMapUint16BoolV(v, fastpathCheckNilTrue, e) - case *map[uint16]bool: - fastpathTV.EncMapUint16BoolV(*v, fastpathCheckNilTrue, e) - - case map[uint32]interface{}: - fastpathTV.EncMapUint32IntfV(v, fastpathCheckNilTrue, e) - case *map[uint32]interface{}: - fastpathTV.EncMapUint32IntfV(*v, fastpathCheckNilTrue, e) - - case map[uint32]string: - fastpathTV.EncMapUint32StringV(v, fastpathCheckNilTrue, e) - case *map[uint32]string: - fastpathTV.EncMapUint32StringV(*v, fastpathCheckNilTrue, e) - - case map[uint32]uint: - fastpathTV.EncMapUint32UintV(v, fastpathCheckNilTrue, e) - case *map[uint32]uint: - fastpathTV.EncMapUint32UintV(*v, fastpathCheckNilTrue, e) - - case map[uint32]uint8: - fastpathTV.EncMapUint32Uint8V(v, fastpathCheckNilTrue, e) - case *map[uint32]uint8: - fastpathTV.EncMapUint32Uint8V(*v, fastpathCheckNilTrue, e) - - case map[uint32]uint16: - fastpathTV.EncMapUint32Uint16V(v, fastpathCheckNilTrue, e) - case *map[uint32]uint16: - fastpathTV.EncMapUint32Uint16V(*v, fastpathCheckNilTrue, e) - - case map[uint32]uint32: - fastpathTV.EncMapUint32Uint32V(v, fastpathCheckNilTrue, e) - case *map[uint32]uint32: - fastpathTV.EncMapUint32Uint32V(*v, fastpathCheckNilTrue, e) - - case map[uint32]uint64: - fastpathTV.EncMapUint32Uint64V(v, fastpathCheckNilTrue, e) - case *map[uint32]uint64: - fastpathTV.EncMapUint32Uint64V(*v, fastpathCheckNilTrue, e) - - case map[uint32]uintptr: - fastpathTV.EncMapUint32UintptrV(v, fastpathCheckNilTrue, e) - case *map[uint32]uintptr: - fastpathTV.EncMapUint32UintptrV(*v, fastpathCheckNilTrue, e) - - case map[uint32]int: - fastpathTV.EncMapUint32IntV(v, fastpathCheckNilTrue, e) - case *map[uint32]int: - fastpathTV.EncMapUint32IntV(*v, fastpathCheckNilTrue, e) - - case map[uint32]int8: - fastpathTV.EncMapUint32Int8V(v, fastpathCheckNilTrue, e) - case *map[uint32]int8: - fastpathTV.EncMapUint32Int8V(*v, fastpathCheckNilTrue, e) - - case map[uint32]int16: - fastpathTV.EncMapUint32Int16V(v, fastpathCheckNilTrue, e) - case *map[uint32]int16: - fastpathTV.EncMapUint32Int16V(*v, fastpathCheckNilTrue, e) - - case map[uint32]int32: - fastpathTV.EncMapUint32Int32V(v, fastpathCheckNilTrue, e) - case *map[uint32]int32: - fastpathTV.EncMapUint32Int32V(*v, fastpathCheckNilTrue, e) - - case map[uint32]int64: - fastpathTV.EncMapUint32Int64V(v, fastpathCheckNilTrue, e) - case *map[uint32]int64: - fastpathTV.EncMapUint32Int64V(*v, fastpathCheckNilTrue, e) - - case map[uint32]float32: - fastpathTV.EncMapUint32Float32V(v, fastpathCheckNilTrue, e) - case *map[uint32]float32: - fastpathTV.EncMapUint32Float32V(*v, fastpathCheckNilTrue, e) - - case map[uint32]float64: - fastpathTV.EncMapUint32Float64V(v, fastpathCheckNilTrue, e) - case *map[uint32]float64: - fastpathTV.EncMapUint32Float64V(*v, fastpathCheckNilTrue, e) - - case map[uint32]bool: - fastpathTV.EncMapUint32BoolV(v, fastpathCheckNilTrue, e) - case *map[uint32]bool: - fastpathTV.EncMapUint32BoolV(*v, fastpathCheckNilTrue, e) - - case map[uint64]interface{}: - fastpathTV.EncMapUint64IntfV(v, fastpathCheckNilTrue, e) - case *map[uint64]interface{}: - fastpathTV.EncMapUint64IntfV(*v, fastpathCheckNilTrue, e) - - case map[uint64]string: - fastpathTV.EncMapUint64StringV(v, fastpathCheckNilTrue, e) - case *map[uint64]string: - fastpathTV.EncMapUint64StringV(*v, fastpathCheckNilTrue, e) - - case map[uint64]uint: - fastpathTV.EncMapUint64UintV(v, fastpathCheckNilTrue, e) - case *map[uint64]uint: - fastpathTV.EncMapUint64UintV(*v, fastpathCheckNilTrue, e) - - case map[uint64]uint8: - fastpathTV.EncMapUint64Uint8V(v, fastpathCheckNilTrue, e) - case *map[uint64]uint8: - fastpathTV.EncMapUint64Uint8V(*v, fastpathCheckNilTrue, e) - - case map[uint64]uint16: - fastpathTV.EncMapUint64Uint16V(v, fastpathCheckNilTrue, e) - case *map[uint64]uint16: - fastpathTV.EncMapUint64Uint16V(*v, fastpathCheckNilTrue, e) - - case map[uint64]uint32: - fastpathTV.EncMapUint64Uint32V(v, fastpathCheckNilTrue, e) - case *map[uint64]uint32: - fastpathTV.EncMapUint64Uint32V(*v, fastpathCheckNilTrue, e) - - case map[uint64]uint64: - fastpathTV.EncMapUint64Uint64V(v, fastpathCheckNilTrue, e) - case *map[uint64]uint64: - fastpathTV.EncMapUint64Uint64V(*v, fastpathCheckNilTrue, e) - - case map[uint64]uintptr: - fastpathTV.EncMapUint64UintptrV(v, fastpathCheckNilTrue, e) - case *map[uint64]uintptr: - fastpathTV.EncMapUint64UintptrV(*v, fastpathCheckNilTrue, e) - - case map[uint64]int: - fastpathTV.EncMapUint64IntV(v, fastpathCheckNilTrue, e) - case *map[uint64]int: - fastpathTV.EncMapUint64IntV(*v, fastpathCheckNilTrue, e) - - case map[uint64]int8: - fastpathTV.EncMapUint64Int8V(v, fastpathCheckNilTrue, e) - case *map[uint64]int8: - fastpathTV.EncMapUint64Int8V(*v, fastpathCheckNilTrue, e) - - case map[uint64]int16: - fastpathTV.EncMapUint64Int16V(v, fastpathCheckNilTrue, e) - case *map[uint64]int16: - fastpathTV.EncMapUint64Int16V(*v, fastpathCheckNilTrue, e) - - case map[uint64]int32: - fastpathTV.EncMapUint64Int32V(v, fastpathCheckNilTrue, e) - case *map[uint64]int32: - fastpathTV.EncMapUint64Int32V(*v, fastpathCheckNilTrue, e) - - case map[uint64]int64: - fastpathTV.EncMapUint64Int64V(v, fastpathCheckNilTrue, e) - case *map[uint64]int64: - fastpathTV.EncMapUint64Int64V(*v, fastpathCheckNilTrue, e) - - case map[uint64]float32: - fastpathTV.EncMapUint64Float32V(v, fastpathCheckNilTrue, e) - case *map[uint64]float32: - fastpathTV.EncMapUint64Float32V(*v, fastpathCheckNilTrue, e) - - case map[uint64]float64: - fastpathTV.EncMapUint64Float64V(v, fastpathCheckNilTrue, e) - case *map[uint64]float64: - fastpathTV.EncMapUint64Float64V(*v, fastpathCheckNilTrue, e) - - case map[uint64]bool: - fastpathTV.EncMapUint64BoolV(v, fastpathCheckNilTrue, e) - case *map[uint64]bool: - fastpathTV.EncMapUint64BoolV(*v, fastpathCheckNilTrue, e) - - case map[uintptr]interface{}: - fastpathTV.EncMapUintptrIntfV(v, fastpathCheckNilTrue, e) - case *map[uintptr]interface{}: - fastpathTV.EncMapUintptrIntfV(*v, fastpathCheckNilTrue, e) - - case map[uintptr]string: - fastpathTV.EncMapUintptrStringV(v, fastpathCheckNilTrue, e) - case *map[uintptr]string: - fastpathTV.EncMapUintptrStringV(*v, fastpathCheckNilTrue, e) - - case map[uintptr]uint: - fastpathTV.EncMapUintptrUintV(v, fastpathCheckNilTrue, e) - case *map[uintptr]uint: - fastpathTV.EncMapUintptrUintV(*v, fastpathCheckNilTrue, e) - - case map[uintptr]uint8: - fastpathTV.EncMapUintptrUint8V(v, fastpathCheckNilTrue, e) - case *map[uintptr]uint8: - fastpathTV.EncMapUintptrUint8V(*v, fastpathCheckNilTrue, e) - - case map[uintptr]uint16: - fastpathTV.EncMapUintptrUint16V(v, fastpathCheckNilTrue, e) - case *map[uintptr]uint16: - fastpathTV.EncMapUintptrUint16V(*v, fastpathCheckNilTrue, e) - - case map[uintptr]uint32: - fastpathTV.EncMapUintptrUint32V(v, fastpathCheckNilTrue, e) - case *map[uintptr]uint32: - fastpathTV.EncMapUintptrUint32V(*v, fastpathCheckNilTrue, e) - - case map[uintptr]uint64: - fastpathTV.EncMapUintptrUint64V(v, fastpathCheckNilTrue, e) - case *map[uintptr]uint64: - fastpathTV.EncMapUintptrUint64V(*v, fastpathCheckNilTrue, e) - - case map[uintptr]uintptr: - fastpathTV.EncMapUintptrUintptrV(v, fastpathCheckNilTrue, e) - case *map[uintptr]uintptr: - fastpathTV.EncMapUintptrUintptrV(*v, fastpathCheckNilTrue, e) - - case map[uintptr]int: - fastpathTV.EncMapUintptrIntV(v, fastpathCheckNilTrue, e) - case *map[uintptr]int: - fastpathTV.EncMapUintptrIntV(*v, fastpathCheckNilTrue, e) - - case map[uintptr]int8: - fastpathTV.EncMapUintptrInt8V(v, fastpathCheckNilTrue, e) - case *map[uintptr]int8: - fastpathTV.EncMapUintptrInt8V(*v, fastpathCheckNilTrue, e) - - case map[uintptr]int16: - fastpathTV.EncMapUintptrInt16V(v, fastpathCheckNilTrue, e) - case *map[uintptr]int16: - fastpathTV.EncMapUintptrInt16V(*v, fastpathCheckNilTrue, e) - - case map[uintptr]int32: - fastpathTV.EncMapUintptrInt32V(v, fastpathCheckNilTrue, e) - case *map[uintptr]int32: - fastpathTV.EncMapUintptrInt32V(*v, fastpathCheckNilTrue, e) - - case map[uintptr]int64: - fastpathTV.EncMapUintptrInt64V(v, fastpathCheckNilTrue, e) - case *map[uintptr]int64: - fastpathTV.EncMapUintptrInt64V(*v, fastpathCheckNilTrue, e) - - case map[uintptr]float32: - fastpathTV.EncMapUintptrFloat32V(v, fastpathCheckNilTrue, e) - case *map[uintptr]float32: - fastpathTV.EncMapUintptrFloat32V(*v, fastpathCheckNilTrue, e) - - case map[uintptr]float64: - fastpathTV.EncMapUintptrFloat64V(v, fastpathCheckNilTrue, e) - case *map[uintptr]float64: - fastpathTV.EncMapUintptrFloat64V(*v, fastpathCheckNilTrue, e) - - case map[uintptr]bool: - fastpathTV.EncMapUintptrBoolV(v, fastpathCheckNilTrue, e) - case *map[uintptr]bool: - fastpathTV.EncMapUintptrBoolV(*v, fastpathCheckNilTrue, e) - - case map[int]interface{}: - fastpathTV.EncMapIntIntfV(v, fastpathCheckNilTrue, e) - case *map[int]interface{}: - fastpathTV.EncMapIntIntfV(*v, fastpathCheckNilTrue, e) - - case map[int]string: - fastpathTV.EncMapIntStringV(v, fastpathCheckNilTrue, e) - case *map[int]string: - fastpathTV.EncMapIntStringV(*v, fastpathCheckNilTrue, e) - - case map[int]uint: - fastpathTV.EncMapIntUintV(v, fastpathCheckNilTrue, e) - case *map[int]uint: - fastpathTV.EncMapIntUintV(*v, fastpathCheckNilTrue, e) - - case map[int]uint8: - fastpathTV.EncMapIntUint8V(v, fastpathCheckNilTrue, e) - case *map[int]uint8: - fastpathTV.EncMapIntUint8V(*v, fastpathCheckNilTrue, e) - - case map[int]uint16: - fastpathTV.EncMapIntUint16V(v, fastpathCheckNilTrue, e) - case *map[int]uint16: - fastpathTV.EncMapIntUint16V(*v, fastpathCheckNilTrue, e) - - case map[int]uint32: - fastpathTV.EncMapIntUint32V(v, fastpathCheckNilTrue, e) - case *map[int]uint32: - fastpathTV.EncMapIntUint32V(*v, fastpathCheckNilTrue, e) - - case map[int]uint64: - fastpathTV.EncMapIntUint64V(v, fastpathCheckNilTrue, e) - case *map[int]uint64: - fastpathTV.EncMapIntUint64V(*v, fastpathCheckNilTrue, e) - - case map[int]uintptr: - fastpathTV.EncMapIntUintptrV(v, fastpathCheckNilTrue, e) - case *map[int]uintptr: - fastpathTV.EncMapIntUintptrV(*v, fastpathCheckNilTrue, e) - - case map[int]int: - fastpathTV.EncMapIntIntV(v, fastpathCheckNilTrue, e) - case *map[int]int: - fastpathTV.EncMapIntIntV(*v, fastpathCheckNilTrue, e) - - case map[int]int8: - fastpathTV.EncMapIntInt8V(v, fastpathCheckNilTrue, e) - case *map[int]int8: - fastpathTV.EncMapIntInt8V(*v, fastpathCheckNilTrue, e) - - case map[int]int16: - fastpathTV.EncMapIntInt16V(v, fastpathCheckNilTrue, e) - case *map[int]int16: - fastpathTV.EncMapIntInt16V(*v, fastpathCheckNilTrue, e) - - case map[int]int32: - fastpathTV.EncMapIntInt32V(v, fastpathCheckNilTrue, e) - case *map[int]int32: - fastpathTV.EncMapIntInt32V(*v, fastpathCheckNilTrue, e) - - case map[int]int64: - fastpathTV.EncMapIntInt64V(v, fastpathCheckNilTrue, e) - case *map[int]int64: - fastpathTV.EncMapIntInt64V(*v, fastpathCheckNilTrue, e) - - case map[int]float32: - fastpathTV.EncMapIntFloat32V(v, fastpathCheckNilTrue, e) - case *map[int]float32: - fastpathTV.EncMapIntFloat32V(*v, fastpathCheckNilTrue, e) - - case map[int]float64: - fastpathTV.EncMapIntFloat64V(v, fastpathCheckNilTrue, e) - case *map[int]float64: - fastpathTV.EncMapIntFloat64V(*v, fastpathCheckNilTrue, e) - - case map[int]bool: - fastpathTV.EncMapIntBoolV(v, fastpathCheckNilTrue, e) - case *map[int]bool: - fastpathTV.EncMapIntBoolV(*v, fastpathCheckNilTrue, e) - - case map[int8]interface{}: - fastpathTV.EncMapInt8IntfV(v, fastpathCheckNilTrue, e) - case *map[int8]interface{}: - fastpathTV.EncMapInt8IntfV(*v, fastpathCheckNilTrue, e) - - case map[int8]string: - fastpathTV.EncMapInt8StringV(v, fastpathCheckNilTrue, e) - case *map[int8]string: - fastpathTV.EncMapInt8StringV(*v, fastpathCheckNilTrue, e) - - case map[int8]uint: - fastpathTV.EncMapInt8UintV(v, fastpathCheckNilTrue, e) - case *map[int8]uint: - fastpathTV.EncMapInt8UintV(*v, fastpathCheckNilTrue, e) - - case map[int8]uint8: - fastpathTV.EncMapInt8Uint8V(v, fastpathCheckNilTrue, e) - case *map[int8]uint8: - fastpathTV.EncMapInt8Uint8V(*v, fastpathCheckNilTrue, e) - - case map[int8]uint16: - fastpathTV.EncMapInt8Uint16V(v, fastpathCheckNilTrue, e) - case *map[int8]uint16: - fastpathTV.EncMapInt8Uint16V(*v, fastpathCheckNilTrue, e) - - case map[int8]uint32: - fastpathTV.EncMapInt8Uint32V(v, fastpathCheckNilTrue, e) - case *map[int8]uint32: - fastpathTV.EncMapInt8Uint32V(*v, fastpathCheckNilTrue, e) - - case map[int8]uint64: - fastpathTV.EncMapInt8Uint64V(v, fastpathCheckNilTrue, e) - case *map[int8]uint64: - fastpathTV.EncMapInt8Uint64V(*v, fastpathCheckNilTrue, e) - - case map[int8]uintptr: - fastpathTV.EncMapInt8UintptrV(v, fastpathCheckNilTrue, e) - case *map[int8]uintptr: - fastpathTV.EncMapInt8UintptrV(*v, fastpathCheckNilTrue, e) - - case map[int8]int: - fastpathTV.EncMapInt8IntV(v, fastpathCheckNilTrue, e) - case *map[int8]int: - fastpathTV.EncMapInt8IntV(*v, fastpathCheckNilTrue, e) - - case map[int8]int8: - fastpathTV.EncMapInt8Int8V(v, fastpathCheckNilTrue, e) - case *map[int8]int8: - fastpathTV.EncMapInt8Int8V(*v, fastpathCheckNilTrue, e) - - case map[int8]int16: - fastpathTV.EncMapInt8Int16V(v, fastpathCheckNilTrue, e) - case *map[int8]int16: - fastpathTV.EncMapInt8Int16V(*v, fastpathCheckNilTrue, e) - - case map[int8]int32: - fastpathTV.EncMapInt8Int32V(v, fastpathCheckNilTrue, e) - case *map[int8]int32: - fastpathTV.EncMapInt8Int32V(*v, fastpathCheckNilTrue, e) - - case map[int8]int64: - fastpathTV.EncMapInt8Int64V(v, fastpathCheckNilTrue, e) - case *map[int8]int64: - fastpathTV.EncMapInt8Int64V(*v, fastpathCheckNilTrue, e) - - case map[int8]float32: - fastpathTV.EncMapInt8Float32V(v, fastpathCheckNilTrue, e) - case *map[int8]float32: - fastpathTV.EncMapInt8Float32V(*v, fastpathCheckNilTrue, e) - - case map[int8]float64: - fastpathTV.EncMapInt8Float64V(v, fastpathCheckNilTrue, e) - case *map[int8]float64: - fastpathTV.EncMapInt8Float64V(*v, fastpathCheckNilTrue, e) - - case map[int8]bool: - fastpathTV.EncMapInt8BoolV(v, fastpathCheckNilTrue, e) - case *map[int8]bool: - fastpathTV.EncMapInt8BoolV(*v, fastpathCheckNilTrue, e) - - case map[int16]interface{}: - fastpathTV.EncMapInt16IntfV(v, fastpathCheckNilTrue, e) - case *map[int16]interface{}: - fastpathTV.EncMapInt16IntfV(*v, fastpathCheckNilTrue, e) - - case map[int16]string: - fastpathTV.EncMapInt16StringV(v, fastpathCheckNilTrue, e) - case *map[int16]string: - fastpathTV.EncMapInt16StringV(*v, fastpathCheckNilTrue, e) - - case map[int16]uint: - fastpathTV.EncMapInt16UintV(v, fastpathCheckNilTrue, e) - case *map[int16]uint: - fastpathTV.EncMapInt16UintV(*v, fastpathCheckNilTrue, e) - - case map[int16]uint8: - fastpathTV.EncMapInt16Uint8V(v, fastpathCheckNilTrue, e) - case *map[int16]uint8: - fastpathTV.EncMapInt16Uint8V(*v, fastpathCheckNilTrue, e) - - case map[int16]uint16: - fastpathTV.EncMapInt16Uint16V(v, fastpathCheckNilTrue, e) - case *map[int16]uint16: - fastpathTV.EncMapInt16Uint16V(*v, fastpathCheckNilTrue, e) - - case map[int16]uint32: - fastpathTV.EncMapInt16Uint32V(v, fastpathCheckNilTrue, e) - case *map[int16]uint32: - fastpathTV.EncMapInt16Uint32V(*v, fastpathCheckNilTrue, e) - - case map[int16]uint64: - fastpathTV.EncMapInt16Uint64V(v, fastpathCheckNilTrue, e) - case *map[int16]uint64: - fastpathTV.EncMapInt16Uint64V(*v, fastpathCheckNilTrue, e) - - case map[int16]uintptr: - fastpathTV.EncMapInt16UintptrV(v, fastpathCheckNilTrue, e) - case *map[int16]uintptr: - fastpathTV.EncMapInt16UintptrV(*v, fastpathCheckNilTrue, e) - - case map[int16]int: - fastpathTV.EncMapInt16IntV(v, fastpathCheckNilTrue, e) - case *map[int16]int: - fastpathTV.EncMapInt16IntV(*v, fastpathCheckNilTrue, e) - - case map[int16]int8: - fastpathTV.EncMapInt16Int8V(v, fastpathCheckNilTrue, e) - case *map[int16]int8: - fastpathTV.EncMapInt16Int8V(*v, fastpathCheckNilTrue, e) - - case map[int16]int16: - fastpathTV.EncMapInt16Int16V(v, fastpathCheckNilTrue, e) - case *map[int16]int16: - fastpathTV.EncMapInt16Int16V(*v, fastpathCheckNilTrue, e) - - case map[int16]int32: - fastpathTV.EncMapInt16Int32V(v, fastpathCheckNilTrue, e) - case *map[int16]int32: - fastpathTV.EncMapInt16Int32V(*v, fastpathCheckNilTrue, e) - - case map[int16]int64: - fastpathTV.EncMapInt16Int64V(v, fastpathCheckNilTrue, e) - case *map[int16]int64: - fastpathTV.EncMapInt16Int64V(*v, fastpathCheckNilTrue, e) - - case map[int16]float32: - fastpathTV.EncMapInt16Float32V(v, fastpathCheckNilTrue, e) - case *map[int16]float32: - fastpathTV.EncMapInt16Float32V(*v, fastpathCheckNilTrue, e) - - case map[int16]float64: - fastpathTV.EncMapInt16Float64V(v, fastpathCheckNilTrue, e) - case *map[int16]float64: - fastpathTV.EncMapInt16Float64V(*v, fastpathCheckNilTrue, e) - - case map[int16]bool: - fastpathTV.EncMapInt16BoolV(v, fastpathCheckNilTrue, e) - case *map[int16]bool: - fastpathTV.EncMapInt16BoolV(*v, fastpathCheckNilTrue, e) - - case map[int32]interface{}: - fastpathTV.EncMapInt32IntfV(v, fastpathCheckNilTrue, e) - case *map[int32]interface{}: - fastpathTV.EncMapInt32IntfV(*v, fastpathCheckNilTrue, e) - - case map[int32]string: - fastpathTV.EncMapInt32StringV(v, fastpathCheckNilTrue, e) - case *map[int32]string: - fastpathTV.EncMapInt32StringV(*v, fastpathCheckNilTrue, e) - - case map[int32]uint: - fastpathTV.EncMapInt32UintV(v, fastpathCheckNilTrue, e) - case *map[int32]uint: - fastpathTV.EncMapInt32UintV(*v, fastpathCheckNilTrue, e) - - case map[int32]uint8: - fastpathTV.EncMapInt32Uint8V(v, fastpathCheckNilTrue, e) - case *map[int32]uint8: - fastpathTV.EncMapInt32Uint8V(*v, fastpathCheckNilTrue, e) - - case map[int32]uint16: - fastpathTV.EncMapInt32Uint16V(v, fastpathCheckNilTrue, e) - case *map[int32]uint16: - fastpathTV.EncMapInt32Uint16V(*v, fastpathCheckNilTrue, e) - - case map[int32]uint32: - fastpathTV.EncMapInt32Uint32V(v, fastpathCheckNilTrue, e) - case *map[int32]uint32: - fastpathTV.EncMapInt32Uint32V(*v, fastpathCheckNilTrue, e) - - case map[int32]uint64: - fastpathTV.EncMapInt32Uint64V(v, fastpathCheckNilTrue, e) - case *map[int32]uint64: - fastpathTV.EncMapInt32Uint64V(*v, fastpathCheckNilTrue, e) - - case map[int32]uintptr: - fastpathTV.EncMapInt32UintptrV(v, fastpathCheckNilTrue, e) - case *map[int32]uintptr: - fastpathTV.EncMapInt32UintptrV(*v, fastpathCheckNilTrue, e) - - case map[int32]int: - fastpathTV.EncMapInt32IntV(v, fastpathCheckNilTrue, e) - case *map[int32]int: - fastpathTV.EncMapInt32IntV(*v, fastpathCheckNilTrue, e) - - case map[int32]int8: - fastpathTV.EncMapInt32Int8V(v, fastpathCheckNilTrue, e) - case *map[int32]int8: - fastpathTV.EncMapInt32Int8V(*v, fastpathCheckNilTrue, e) - - case map[int32]int16: - fastpathTV.EncMapInt32Int16V(v, fastpathCheckNilTrue, e) - case *map[int32]int16: - fastpathTV.EncMapInt32Int16V(*v, fastpathCheckNilTrue, e) - - case map[int32]int32: - fastpathTV.EncMapInt32Int32V(v, fastpathCheckNilTrue, e) - case *map[int32]int32: - fastpathTV.EncMapInt32Int32V(*v, fastpathCheckNilTrue, e) - - case map[int32]int64: - fastpathTV.EncMapInt32Int64V(v, fastpathCheckNilTrue, e) - case *map[int32]int64: - fastpathTV.EncMapInt32Int64V(*v, fastpathCheckNilTrue, e) - - case map[int32]float32: - fastpathTV.EncMapInt32Float32V(v, fastpathCheckNilTrue, e) - case *map[int32]float32: - fastpathTV.EncMapInt32Float32V(*v, fastpathCheckNilTrue, e) - - case map[int32]float64: - fastpathTV.EncMapInt32Float64V(v, fastpathCheckNilTrue, e) - case *map[int32]float64: - fastpathTV.EncMapInt32Float64V(*v, fastpathCheckNilTrue, e) - - case map[int32]bool: - fastpathTV.EncMapInt32BoolV(v, fastpathCheckNilTrue, e) - case *map[int32]bool: - fastpathTV.EncMapInt32BoolV(*v, fastpathCheckNilTrue, e) - - case map[int64]interface{}: - fastpathTV.EncMapInt64IntfV(v, fastpathCheckNilTrue, e) - case *map[int64]interface{}: - fastpathTV.EncMapInt64IntfV(*v, fastpathCheckNilTrue, e) - - case map[int64]string: - fastpathTV.EncMapInt64StringV(v, fastpathCheckNilTrue, e) - case *map[int64]string: - fastpathTV.EncMapInt64StringV(*v, fastpathCheckNilTrue, e) - - case map[int64]uint: - fastpathTV.EncMapInt64UintV(v, fastpathCheckNilTrue, e) - case *map[int64]uint: - fastpathTV.EncMapInt64UintV(*v, fastpathCheckNilTrue, e) - - case map[int64]uint8: - fastpathTV.EncMapInt64Uint8V(v, fastpathCheckNilTrue, e) - case *map[int64]uint8: - fastpathTV.EncMapInt64Uint8V(*v, fastpathCheckNilTrue, e) - - case map[int64]uint16: - fastpathTV.EncMapInt64Uint16V(v, fastpathCheckNilTrue, e) - case *map[int64]uint16: - fastpathTV.EncMapInt64Uint16V(*v, fastpathCheckNilTrue, e) - - case map[int64]uint32: - fastpathTV.EncMapInt64Uint32V(v, fastpathCheckNilTrue, e) - case *map[int64]uint32: - fastpathTV.EncMapInt64Uint32V(*v, fastpathCheckNilTrue, e) - - case map[int64]uint64: - fastpathTV.EncMapInt64Uint64V(v, fastpathCheckNilTrue, e) - case *map[int64]uint64: - fastpathTV.EncMapInt64Uint64V(*v, fastpathCheckNilTrue, e) - - case map[int64]uintptr: - fastpathTV.EncMapInt64UintptrV(v, fastpathCheckNilTrue, e) - case *map[int64]uintptr: - fastpathTV.EncMapInt64UintptrV(*v, fastpathCheckNilTrue, e) - - case map[int64]int: - fastpathTV.EncMapInt64IntV(v, fastpathCheckNilTrue, e) - case *map[int64]int: - fastpathTV.EncMapInt64IntV(*v, fastpathCheckNilTrue, e) - - case map[int64]int8: - fastpathTV.EncMapInt64Int8V(v, fastpathCheckNilTrue, e) - case *map[int64]int8: - fastpathTV.EncMapInt64Int8V(*v, fastpathCheckNilTrue, e) - - case map[int64]int16: - fastpathTV.EncMapInt64Int16V(v, fastpathCheckNilTrue, e) - case *map[int64]int16: - fastpathTV.EncMapInt64Int16V(*v, fastpathCheckNilTrue, e) - - case map[int64]int32: - fastpathTV.EncMapInt64Int32V(v, fastpathCheckNilTrue, e) - case *map[int64]int32: - fastpathTV.EncMapInt64Int32V(*v, fastpathCheckNilTrue, e) - - case map[int64]int64: - fastpathTV.EncMapInt64Int64V(v, fastpathCheckNilTrue, e) - case *map[int64]int64: - fastpathTV.EncMapInt64Int64V(*v, fastpathCheckNilTrue, e) - - case map[int64]float32: - fastpathTV.EncMapInt64Float32V(v, fastpathCheckNilTrue, e) - case *map[int64]float32: - fastpathTV.EncMapInt64Float32V(*v, fastpathCheckNilTrue, e) - - case map[int64]float64: - fastpathTV.EncMapInt64Float64V(v, fastpathCheckNilTrue, e) - case *map[int64]float64: - fastpathTV.EncMapInt64Float64V(*v, fastpathCheckNilTrue, e) - - case map[int64]bool: - fastpathTV.EncMapInt64BoolV(v, fastpathCheckNilTrue, e) - case *map[int64]bool: - fastpathTV.EncMapInt64BoolV(*v, fastpathCheckNilTrue, e) - - case map[bool]interface{}: - fastpathTV.EncMapBoolIntfV(v, fastpathCheckNilTrue, e) - case *map[bool]interface{}: - fastpathTV.EncMapBoolIntfV(*v, fastpathCheckNilTrue, e) - - case map[bool]string: - fastpathTV.EncMapBoolStringV(v, fastpathCheckNilTrue, e) - case *map[bool]string: - fastpathTV.EncMapBoolStringV(*v, fastpathCheckNilTrue, e) - - case map[bool]uint: - fastpathTV.EncMapBoolUintV(v, fastpathCheckNilTrue, e) - case *map[bool]uint: - fastpathTV.EncMapBoolUintV(*v, fastpathCheckNilTrue, e) - - case map[bool]uint8: - fastpathTV.EncMapBoolUint8V(v, fastpathCheckNilTrue, e) - case *map[bool]uint8: - fastpathTV.EncMapBoolUint8V(*v, fastpathCheckNilTrue, e) - - case map[bool]uint16: - fastpathTV.EncMapBoolUint16V(v, fastpathCheckNilTrue, e) - case *map[bool]uint16: - fastpathTV.EncMapBoolUint16V(*v, fastpathCheckNilTrue, e) - - case map[bool]uint32: - fastpathTV.EncMapBoolUint32V(v, fastpathCheckNilTrue, e) - case *map[bool]uint32: - fastpathTV.EncMapBoolUint32V(*v, fastpathCheckNilTrue, e) - - case map[bool]uint64: - fastpathTV.EncMapBoolUint64V(v, fastpathCheckNilTrue, e) - case *map[bool]uint64: - fastpathTV.EncMapBoolUint64V(*v, fastpathCheckNilTrue, e) - - case map[bool]uintptr: - fastpathTV.EncMapBoolUintptrV(v, fastpathCheckNilTrue, e) - case *map[bool]uintptr: - fastpathTV.EncMapBoolUintptrV(*v, fastpathCheckNilTrue, e) - - case map[bool]int: - fastpathTV.EncMapBoolIntV(v, fastpathCheckNilTrue, e) - case *map[bool]int: - fastpathTV.EncMapBoolIntV(*v, fastpathCheckNilTrue, e) - - case map[bool]int8: - fastpathTV.EncMapBoolInt8V(v, fastpathCheckNilTrue, e) - case *map[bool]int8: - fastpathTV.EncMapBoolInt8V(*v, fastpathCheckNilTrue, e) - - case map[bool]int16: - fastpathTV.EncMapBoolInt16V(v, fastpathCheckNilTrue, e) - case *map[bool]int16: - fastpathTV.EncMapBoolInt16V(*v, fastpathCheckNilTrue, e) - - case map[bool]int32: - fastpathTV.EncMapBoolInt32V(v, fastpathCheckNilTrue, e) - case *map[bool]int32: - fastpathTV.EncMapBoolInt32V(*v, fastpathCheckNilTrue, e) - - case map[bool]int64: - fastpathTV.EncMapBoolInt64V(v, fastpathCheckNilTrue, e) - case *map[bool]int64: - fastpathTV.EncMapBoolInt64V(*v, fastpathCheckNilTrue, e) - - case map[bool]float32: - fastpathTV.EncMapBoolFloat32V(v, fastpathCheckNilTrue, e) - case *map[bool]float32: - fastpathTV.EncMapBoolFloat32V(*v, fastpathCheckNilTrue, e) - - case map[bool]float64: - fastpathTV.EncMapBoolFloat64V(v, fastpathCheckNilTrue, e) - case *map[bool]float64: - fastpathTV.EncMapBoolFloat64V(*v, fastpathCheckNilTrue, e) - - case map[bool]bool: - fastpathTV.EncMapBoolBoolV(v, fastpathCheckNilTrue, e) - case *map[bool]bool: - fastpathTV.EncMapBoolBoolV(*v, fastpathCheckNilTrue, e) - - default: - _ = v // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release) - return false - } - return true -} - -// -- -- fast path functions - -func (f *encFnInfo) fastpathEncSliceIntfR(rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceIntfV(rv.Interface().([]interface{}), fastpathCheckNilFalse, f.e) - } else { - fastpathTV.EncSliceIntfV(rv.Interface().([]interface{}), fastpathCheckNilFalse, f.e) - } -} -func (_ fastpathT) EncSliceIntfV(v []interface{}, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeArrayStart(len(v)) - for _, v2 := range v { - if cr != nil { - cr.sendContainerState(containerArrayElem) - } - e.encode(v2) - } - if cr != nil { - cr.sendContainerState(containerArrayEnd) - } -} - -func (_ fastpathT) EncAsMapSliceIntfV(v []interface{}, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.EncodeMapStart(len(v) / 2) - for j, v2 := range v { - if cr != nil { - if j%2 == 0 { - cr.sendContainerState(containerMapKey) - } else { - cr.sendContainerState(containerMapValue) - } - } - e.encode(v2) - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncSliceStringR(rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceStringV(rv.Interface().([]string), fastpathCheckNilFalse, f.e) - } else { - fastpathTV.EncSliceStringV(rv.Interface().([]string), fastpathCheckNilFalse, f.e) - } -} -func (_ fastpathT) EncSliceStringV(v []string, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeArrayStart(len(v)) - for _, v2 := range v { - if cr != nil { - cr.sendContainerState(containerArrayElem) - } - ee.EncodeString(c_UTF8, v2) - } - if cr != nil { - cr.sendContainerState(containerArrayEnd) - } -} - -func (_ fastpathT) EncAsMapSliceStringV(v []string, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.EncodeMapStart(len(v) / 2) - for j, v2 := range v { - if cr != nil { - if j%2 == 0 { - cr.sendContainerState(containerMapKey) - } else { - cr.sendContainerState(containerMapValue) - } - } - ee.EncodeString(c_UTF8, v2) - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncSliceFloat32R(rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceFloat32V(rv.Interface().([]float32), fastpathCheckNilFalse, f.e) - } else { - fastpathTV.EncSliceFloat32V(rv.Interface().([]float32), fastpathCheckNilFalse, f.e) - } -} -func (_ fastpathT) EncSliceFloat32V(v []float32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeArrayStart(len(v)) - for _, v2 := range v { - if cr != nil { - cr.sendContainerState(containerArrayElem) - } - ee.EncodeFloat32(v2) - } - if cr != nil { - cr.sendContainerState(containerArrayEnd) - } -} - -func (_ fastpathT) EncAsMapSliceFloat32V(v []float32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.EncodeMapStart(len(v) / 2) - for j, v2 := range v { - if cr != nil { - if j%2 == 0 { - cr.sendContainerState(containerMapKey) - } else { - cr.sendContainerState(containerMapValue) - } - } - ee.EncodeFloat32(v2) - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncSliceFloat64R(rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceFloat64V(rv.Interface().([]float64), fastpathCheckNilFalse, f.e) - } else { - fastpathTV.EncSliceFloat64V(rv.Interface().([]float64), fastpathCheckNilFalse, f.e) - } -} -func (_ fastpathT) EncSliceFloat64V(v []float64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeArrayStart(len(v)) - for _, v2 := range v { - if cr != nil { - cr.sendContainerState(containerArrayElem) - } - ee.EncodeFloat64(v2) - } - if cr != nil { - cr.sendContainerState(containerArrayEnd) - } -} - -func (_ fastpathT) EncAsMapSliceFloat64V(v []float64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.EncodeMapStart(len(v) / 2) - for j, v2 := range v { - if cr != nil { - if j%2 == 0 { - cr.sendContainerState(containerMapKey) - } else { - cr.sendContainerState(containerMapValue) - } - } - ee.EncodeFloat64(v2) - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncSliceUintR(rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceUintV(rv.Interface().([]uint), fastpathCheckNilFalse, f.e) - } else { - fastpathTV.EncSliceUintV(rv.Interface().([]uint), fastpathCheckNilFalse, f.e) - } -} -func (_ fastpathT) EncSliceUintV(v []uint, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeArrayStart(len(v)) - for _, v2 := range v { - if cr != nil { - cr.sendContainerState(containerArrayElem) - } - ee.EncodeUint(uint64(v2)) - } - if cr != nil { - cr.sendContainerState(containerArrayEnd) - } -} - -func (_ fastpathT) EncAsMapSliceUintV(v []uint, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.EncodeMapStart(len(v) / 2) - for j, v2 := range v { - if cr != nil { - if j%2 == 0 { - cr.sendContainerState(containerMapKey) - } else { - cr.sendContainerState(containerMapValue) - } - } - ee.EncodeUint(uint64(v2)) - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncSliceUint16R(rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceUint16V(rv.Interface().([]uint16), fastpathCheckNilFalse, f.e) - } else { - fastpathTV.EncSliceUint16V(rv.Interface().([]uint16), fastpathCheckNilFalse, f.e) - } -} -func (_ fastpathT) EncSliceUint16V(v []uint16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeArrayStart(len(v)) - for _, v2 := range v { - if cr != nil { - cr.sendContainerState(containerArrayElem) - } - ee.EncodeUint(uint64(v2)) - } - if cr != nil { - cr.sendContainerState(containerArrayEnd) - } -} - -func (_ fastpathT) EncAsMapSliceUint16V(v []uint16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.EncodeMapStart(len(v) / 2) - for j, v2 := range v { - if cr != nil { - if j%2 == 0 { - cr.sendContainerState(containerMapKey) - } else { - cr.sendContainerState(containerMapValue) - } - } - ee.EncodeUint(uint64(v2)) - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncSliceUint32R(rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceUint32V(rv.Interface().([]uint32), fastpathCheckNilFalse, f.e) - } else { - fastpathTV.EncSliceUint32V(rv.Interface().([]uint32), fastpathCheckNilFalse, f.e) - } -} -func (_ fastpathT) EncSliceUint32V(v []uint32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeArrayStart(len(v)) - for _, v2 := range v { - if cr != nil { - cr.sendContainerState(containerArrayElem) - } - ee.EncodeUint(uint64(v2)) - } - if cr != nil { - cr.sendContainerState(containerArrayEnd) - } -} - -func (_ fastpathT) EncAsMapSliceUint32V(v []uint32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.EncodeMapStart(len(v) / 2) - for j, v2 := range v { - if cr != nil { - if j%2 == 0 { - cr.sendContainerState(containerMapKey) - } else { - cr.sendContainerState(containerMapValue) - } - } - ee.EncodeUint(uint64(v2)) - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncSliceUint64R(rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceUint64V(rv.Interface().([]uint64), fastpathCheckNilFalse, f.e) - } else { - fastpathTV.EncSliceUint64V(rv.Interface().([]uint64), fastpathCheckNilFalse, f.e) - } -} -func (_ fastpathT) EncSliceUint64V(v []uint64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeArrayStart(len(v)) - for _, v2 := range v { - if cr != nil { - cr.sendContainerState(containerArrayElem) - } - ee.EncodeUint(uint64(v2)) - } - if cr != nil { - cr.sendContainerState(containerArrayEnd) - } -} - -func (_ fastpathT) EncAsMapSliceUint64V(v []uint64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.EncodeMapStart(len(v) / 2) - for j, v2 := range v { - if cr != nil { - if j%2 == 0 { - cr.sendContainerState(containerMapKey) - } else { - cr.sendContainerState(containerMapValue) - } - } - ee.EncodeUint(uint64(v2)) - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncSliceUintptrR(rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceUintptrV(rv.Interface().([]uintptr), fastpathCheckNilFalse, f.e) - } else { - fastpathTV.EncSliceUintptrV(rv.Interface().([]uintptr), fastpathCheckNilFalse, f.e) - } -} -func (_ fastpathT) EncSliceUintptrV(v []uintptr, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeArrayStart(len(v)) - for _, v2 := range v { - if cr != nil { - cr.sendContainerState(containerArrayElem) - } - e.encode(v2) - } - if cr != nil { - cr.sendContainerState(containerArrayEnd) - } -} - -func (_ fastpathT) EncAsMapSliceUintptrV(v []uintptr, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.EncodeMapStart(len(v) / 2) - for j, v2 := range v { - if cr != nil { - if j%2 == 0 { - cr.sendContainerState(containerMapKey) - } else { - cr.sendContainerState(containerMapValue) - } - } - e.encode(v2) - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncSliceIntR(rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceIntV(rv.Interface().([]int), fastpathCheckNilFalse, f.e) - } else { - fastpathTV.EncSliceIntV(rv.Interface().([]int), fastpathCheckNilFalse, f.e) - } -} -func (_ fastpathT) EncSliceIntV(v []int, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeArrayStart(len(v)) - for _, v2 := range v { - if cr != nil { - cr.sendContainerState(containerArrayElem) - } - ee.EncodeInt(int64(v2)) - } - if cr != nil { - cr.sendContainerState(containerArrayEnd) - } -} - -func (_ fastpathT) EncAsMapSliceIntV(v []int, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.EncodeMapStart(len(v) / 2) - for j, v2 := range v { - if cr != nil { - if j%2 == 0 { - cr.sendContainerState(containerMapKey) - } else { - cr.sendContainerState(containerMapValue) - } - } - ee.EncodeInt(int64(v2)) - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncSliceInt8R(rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceInt8V(rv.Interface().([]int8), fastpathCheckNilFalse, f.e) - } else { - fastpathTV.EncSliceInt8V(rv.Interface().([]int8), fastpathCheckNilFalse, f.e) - } -} -func (_ fastpathT) EncSliceInt8V(v []int8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeArrayStart(len(v)) - for _, v2 := range v { - if cr != nil { - cr.sendContainerState(containerArrayElem) - } - ee.EncodeInt(int64(v2)) - } - if cr != nil { - cr.sendContainerState(containerArrayEnd) - } -} - -func (_ fastpathT) EncAsMapSliceInt8V(v []int8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.EncodeMapStart(len(v) / 2) - for j, v2 := range v { - if cr != nil { - if j%2 == 0 { - cr.sendContainerState(containerMapKey) - } else { - cr.sendContainerState(containerMapValue) - } - } - ee.EncodeInt(int64(v2)) - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncSliceInt16R(rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceInt16V(rv.Interface().([]int16), fastpathCheckNilFalse, f.e) - } else { - fastpathTV.EncSliceInt16V(rv.Interface().([]int16), fastpathCheckNilFalse, f.e) - } -} -func (_ fastpathT) EncSliceInt16V(v []int16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeArrayStart(len(v)) - for _, v2 := range v { - if cr != nil { - cr.sendContainerState(containerArrayElem) - } - ee.EncodeInt(int64(v2)) - } - if cr != nil { - cr.sendContainerState(containerArrayEnd) - } -} - -func (_ fastpathT) EncAsMapSliceInt16V(v []int16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.EncodeMapStart(len(v) / 2) - for j, v2 := range v { - if cr != nil { - if j%2 == 0 { - cr.sendContainerState(containerMapKey) - } else { - cr.sendContainerState(containerMapValue) - } - } - ee.EncodeInt(int64(v2)) - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncSliceInt32R(rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceInt32V(rv.Interface().([]int32), fastpathCheckNilFalse, f.e) - } else { - fastpathTV.EncSliceInt32V(rv.Interface().([]int32), fastpathCheckNilFalse, f.e) - } -} -func (_ fastpathT) EncSliceInt32V(v []int32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeArrayStart(len(v)) - for _, v2 := range v { - if cr != nil { - cr.sendContainerState(containerArrayElem) - } - ee.EncodeInt(int64(v2)) - } - if cr != nil { - cr.sendContainerState(containerArrayEnd) - } -} - -func (_ fastpathT) EncAsMapSliceInt32V(v []int32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.EncodeMapStart(len(v) / 2) - for j, v2 := range v { - if cr != nil { - if j%2 == 0 { - cr.sendContainerState(containerMapKey) - } else { - cr.sendContainerState(containerMapValue) - } - } - ee.EncodeInt(int64(v2)) - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncSliceInt64R(rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceInt64V(rv.Interface().([]int64), fastpathCheckNilFalse, f.e) - } else { - fastpathTV.EncSliceInt64V(rv.Interface().([]int64), fastpathCheckNilFalse, f.e) - } -} -func (_ fastpathT) EncSliceInt64V(v []int64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeArrayStart(len(v)) - for _, v2 := range v { - if cr != nil { - cr.sendContainerState(containerArrayElem) - } - ee.EncodeInt(int64(v2)) - } - if cr != nil { - cr.sendContainerState(containerArrayEnd) - } -} - -func (_ fastpathT) EncAsMapSliceInt64V(v []int64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.EncodeMapStart(len(v) / 2) - for j, v2 := range v { - if cr != nil { - if j%2 == 0 { - cr.sendContainerState(containerMapKey) - } else { - cr.sendContainerState(containerMapValue) - } - } - ee.EncodeInt(int64(v2)) - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncSliceBoolR(rv reflect.Value) { - if f.ti.mbs { - fastpathTV.EncAsMapSliceBoolV(rv.Interface().([]bool), fastpathCheckNilFalse, f.e) - } else { - fastpathTV.EncSliceBoolV(rv.Interface().([]bool), fastpathCheckNilFalse, f.e) - } -} -func (_ fastpathT) EncSliceBoolV(v []bool, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeArrayStart(len(v)) - for _, v2 := range v { - if cr != nil { - cr.sendContainerState(containerArrayElem) - } - ee.EncodeBool(v2) - } - if cr != nil { - cr.sendContainerState(containerArrayEnd) - } -} - -func (_ fastpathT) EncAsMapSliceBoolV(v []bool, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - if len(v)%2 == 1 { - e.errorf("mapBySlice requires even slice length, but got %v", len(v)) - return - } - ee.EncodeMapStart(len(v) / 2) - for j, v2 := range v { - if cr != nil { - if j%2 == 0 { - cr.sendContainerState(containerMapKey) - } else { - cr.sendContainerState(containerMapValue) - } - } - ee.EncodeBool(v2) - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntfIntfR(rv reflect.Value) { - fastpathTV.EncMapIntfIntfV(rv.Interface().(map[interface{}]interface{}), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntfIntfV(v map[interface{}]interface{}, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.asis(v2[j].v) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntfStringR(rv reflect.Value) { - fastpathTV.EncMapIntfStringV(rv.Interface().(map[interface{}]string), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntfStringV(v map[interface{}]string, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.asis(v2[j].v) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntfUintR(rv reflect.Value) { - fastpathTV.EncMapIntfUintV(rv.Interface().(map[interface{}]uint), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntfUintV(v map[interface{}]uint, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.asis(v2[j].v) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntfUint8R(rv reflect.Value) { - fastpathTV.EncMapIntfUint8V(rv.Interface().(map[interface{}]uint8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntfUint8V(v map[interface{}]uint8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.asis(v2[j].v) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntfUint16R(rv reflect.Value) { - fastpathTV.EncMapIntfUint16V(rv.Interface().(map[interface{}]uint16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntfUint16V(v map[interface{}]uint16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.asis(v2[j].v) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntfUint32R(rv reflect.Value) { - fastpathTV.EncMapIntfUint32V(rv.Interface().(map[interface{}]uint32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntfUint32V(v map[interface{}]uint32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.asis(v2[j].v) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntfUint64R(rv reflect.Value) { - fastpathTV.EncMapIntfUint64V(rv.Interface().(map[interface{}]uint64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntfUint64V(v map[interface{}]uint64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.asis(v2[j].v) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntfUintptrR(rv reflect.Value) { - fastpathTV.EncMapIntfUintptrV(rv.Interface().(map[interface{}]uintptr), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntfUintptrV(v map[interface{}]uintptr, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.asis(v2[j].v) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntfIntR(rv reflect.Value) { - fastpathTV.EncMapIntfIntV(rv.Interface().(map[interface{}]int), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntfIntV(v map[interface{}]int, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.asis(v2[j].v) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntfInt8R(rv reflect.Value) { - fastpathTV.EncMapIntfInt8V(rv.Interface().(map[interface{}]int8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntfInt8V(v map[interface{}]int8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.asis(v2[j].v) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntfInt16R(rv reflect.Value) { - fastpathTV.EncMapIntfInt16V(rv.Interface().(map[interface{}]int16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntfInt16V(v map[interface{}]int16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.asis(v2[j].v) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntfInt32R(rv reflect.Value) { - fastpathTV.EncMapIntfInt32V(rv.Interface().(map[interface{}]int32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntfInt32V(v map[interface{}]int32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.asis(v2[j].v) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntfInt64R(rv reflect.Value) { - fastpathTV.EncMapIntfInt64V(rv.Interface().(map[interface{}]int64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntfInt64V(v map[interface{}]int64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.asis(v2[j].v) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntfFloat32R(rv reflect.Value) { - fastpathTV.EncMapIntfFloat32V(rv.Interface().(map[interface{}]float32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntfFloat32V(v map[interface{}]float32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.asis(v2[j].v) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntfFloat64R(rv reflect.Value) { - fastpathTV.EncMapIntfFloat64V(rv.Interface().(map[interface{}]float64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntfFloat64V(v map[interface{}]float64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.asis(v2[j].v) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntfBoolR(rv reflect.Value) { - fastpathTV.EncMapIntfBoolV(rv.Interface().(map[interface{}]bool), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntfBoolV(v map[interface{}]bool, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding - e2 := NewEncoderBytes(&mksv, e.hh) - v2 := make([]bytesI, len(v)) - var i, l int - var vp *bytesI - for k2, _ := range v { - l = len(mksv) - e2.MustEncode(k2) - vp = &v2[i] - vp.v = mksv[l:] - vp.i = k2 - i++ - } - sort.Sort(bytesISlice(v2)) - for j := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.asis(v2[j].v) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[v2[j].i]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapStringIntfR(rv reflect.Value) { - fastpathTV.EncMapStringIntfV(rv.Interface().(map[string]interface{}), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapStringIntfV(v map[string]interface{}, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[string(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapStringStringR(rv reflect.Value) { - fastpathTV.EncMapStringStringV(rv.Interface().(map[string]string), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapStringStringV(v map[string]string, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v[string(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapStringUintR(rv reflect.Value) { - fastpathTV.EncMapStringUintV(rv.Interface().(map[string]uint), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapStringUintV(v map[string]uint, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[string(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapStringUint8R(rv reflect.Value) { - fastpathTV.EncMapStringUint8V(rv.Interface().(map[string]uint8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapStringUint8V(v map[string]uint8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[string(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapStringUint16R(rv reflect.Value) { - fastpathTV.EncMapStringUint16V(rv.Interface().(map[string]uint16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapStringUint16V(v map[string]uint16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[string(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapStringUint32R(rv reflect.Value) { - fastpathTV.EncMapStringUint32V(rv.Interface().(map[string]uint32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapStringUint32V(v map[string]uint32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[string(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapStringUint64R(rv reflect.Value) { - fastpathTV.EncMapStringUint64V(rv.Interface().(map[string]uint64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapStringUint64V(v map[string]uint64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[string(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapStringUintptrR(rv reflect.Value) { - fastpathTV.EncMapStringUintptrV(rv.Interface().(map[string]uintptr), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapStringUintptrV(v map[string]uintptr, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[string(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapStringIntR(rv reflect.Value) { - fastpathTV.EncMapStringIntV(rv.Interface().(map[string]int), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapStringIntV(v map[string]int, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[string(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapStringInt8R(rv reflect.Value) { - fastpathTV.EncMapStringInt8V(rv.Interface().(map[string]int8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapStringInt8V(v map[string]int8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[string(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapStringInt16R(rv reflect.Value) { - fastpathTV.EncMapStringInt16V(rv.Interface().(map[string]int16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapStringInt16V(v map[string]int16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[string(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapStringInt32R(rv reflect.Value) { - fastpathTV.EncMapStringInt32V(rv.Interface().(map[string]int32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapStringInt32V(v map[string]int32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[string(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapStringInt64R(rv reflect.Value) { - fastpathTV.EncMapStringInt64V(rv.Interface().(map[string]int64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapStringInt64V(v map[string]int64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[string(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapStringFloat32R(rv reflect.Value) { - fastpathTV.EncMapStringFloat32V(rv.Interface().(map[string]float32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapStringFloat32V(v map[string]float32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v[string(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapStringFloat64R(rv reflect.Value) { - fastpathTV.EncMapStringFloat64V(rv.Interface().(map[string]float64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapStringFloat64V(v map[string]float64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v[string(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapStringBoolR(rv reflect.Value) { - fastpathTV.EncMapStringBoolV(rv.Interface().(map[string]bool), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapStringBoolV(v map[string]bool, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 - if e.h.Canonical { - v2 := make([]string, len(v)) - var i int - for k, _ := range v { - v2[i] = string(k) - i++ - } - sort.Sort(stringSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v[string(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - if asSymbols { - ee.EncodeSymbol(k2) - } else { - ee.EncodeString(c_UTF8, k2) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat32IntfR(rv reflect.Value) { - fastpathTV.EncMapFloat32IntfV(rv.Interface().(map[float32]interface{}), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat32IntfV(v map[float32]interface{}, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(float32(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[float32(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat32StringR(rv reflect.Value) { - fastpathTV.EncMapFloat32StringV(rv.Interface().(map[float32]string), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat32StringV(v map[float32]string, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(float32(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v[float32(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat32UintR(rv reflect.Value) { - fastpathTV.EncMapFloat32UintV(rv.Interface().(map[float32]uint), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat32UintV(v map[float32]uint, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(float32(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[float32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat32Uint8R(rv reflect.Value) { - fastpathTV.EncMapFloat32Uint8V(rv.Interface().(map[float32]uint8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat32Uint8V(v map[float32]uint8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(float32(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[float32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat32Uint16R(rv reflect.Value) { - fastpathTV.EncMapFloat32Uint16V(rv.Interface().(map[float32]uint16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat32Uint16V(v map[float32]uint16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(float32(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[float32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat32Uint32R(rv reflect.Value) { - fastpathTV.EncMapFloat32Uint32V(rv.Interface().(map[float32]uint32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat32Uint32V(v map[float32]uint32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(float32(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[float32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat32Uint64R(rv reflect.Value) { - fastpathTV.EncMapFloat32Uint64V(rv.Interface().(map[float32]uint64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat32Uint64V(v map[float32]uint64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(float32(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[float32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat32UintptrR(rv reflect.Value) { - fastpathTV.EncMapFloat32UintptrV(rv.Interface().(map[float32]uintptr), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat32UintptrV(v map[float32]uintptr, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(float32(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[float32(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat32IntR(rv reflect.Value) { - fastpathTV.EncMapFloat32IntV(rv.Interface().(map[float32]int), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat32IntV(v map[float32]int, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(float32(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[float32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat32Int8R(rv reflect.Value) { - fastpathTV.EncMapFloat32Int8V(rv.Interface().(map[float32]int8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat32Int8V(v map[float32]int8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(float32(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[float32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat32Int16R(rv reflect.Value) { - fastpathTV.EncMapFloat32Int16V(rv.Interface().(map[float32]int16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat32Int16V(v map[float32]int16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(float32(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[float32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat32Int32R(rv reflect.Value) { - fastpathTV.EncMapFloat32Int32V(rv.Interface().(map[float32]int32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat32Int32V(v map[float32]int32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(float32(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[float32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat32Int64R(rv reflect.Value) { - fastpathTV.EncMapFloat32Int64V(rv.Interface().(map[float32]int64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat32Int64V(v map[float32]int64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(float32(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[float32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat32Float32R(rv reflect.Value) { - fastpathTV.EncMapFloat32Float32V(rv.Interface().(map[float32]float32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat32Float32V(v map[float32]float32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(float32(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v[float32(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat32Float64R(rv reflect.Value) { - fastpathTV.EncMapFloat32Float64V(rv.Interface().(map[float32]float64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat32Float64V(v map[float32]float64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(float32(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v[float32(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat32BoolR(rv reflect.Value) { - fastpathTV.EncMapFloat32BoolV(rv.Interface().(map[float32]bool), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat32BoolV(v map[float32]bool, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(float32(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v[float32(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat32(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat64IntfR(rv reflect.Value) { - fastpathTV.EncMapFloat64IntfV(rv.Interface().(map[float64]interface{}), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat64IntfV(v map[float64]interface{}, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(float64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[float64(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat64StringR(rv reflect.Value) { - fastpathTV.EncMapFloat64StringV(rv.Interface().(map[float64]string), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat64StringV(v map[float64]string, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(float64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v[float64(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat64UintR(rv reflect.Value) { - fastpathTV.EncMapFloat64UintV(rv.Interface().(map[float64]uint), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat64UintV(v map[float64]uint, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(float64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[float64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat64Uint8R(rv reflect.Value) { - fastpathTV.EncMapFloat64Uint8V(rv.Interface().(map[float64]uint8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat64Uint8V(v map[float64]uint8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(float64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[float64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat64Uint16R(rv reflect.Value) { - fastpathTV.EncMapFloat64Uint16V(rv.Interface().(map[float64]uint16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat64Uint16V(v map[float64]uint16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(float64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[float64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat64Uint32R(rv reflect.Value) { - fastpathTV.EncMapFloat64Uint32V(rv.Interface().(map[float64]uint32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat64Uint32V(v map[float64]uint32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(float64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[float64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat64Uint64R(rv reflect.Value) { - fastpathTV.EncMapFloat64Uint64V(rv.Interface().(map[float64]uint64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat64Uint64V(v map[float64]uint64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(float64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[float64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat64UintptrR(rv reflect.Value) { - fastpathTV.EncMapFloat64UintptrV(rv.Interface().(map[float64]uintptr), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat64UintptrV(v map[float64]uintptr, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(float64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[float64(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat64IntR(rv reflect.Value) { - fastpathTV.EncMapFloat64IntV(rv.Interface().(map[float64]int), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat64IntV(v map[float64]int, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(float64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[float64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat64Int8R(rv reflect.Value) { - fastpathTV.EncMapFloat64Int8V(rv.Interface().(map[float64]int8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat64Int8V(v map[float64]int8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(float64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[float64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat64Int16R(rv reflect.Value) { - fastpathTV.EncMapFloat64Int16V(rv.Interface().(map[float64]int16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat64Int16V(v map[float64]int16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(float64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[float64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat64Int32R(rv reflect.Value) { - fastpathTV.EncMapFloat64Int32V(rv.Interface().(map[float64]int32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat64Int32V(v map[float64]int32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(float64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[float64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat64Int64R(rv reflect.Value) { - fastpathTV.EncMapFloat64Int64V(rv.Interface().(map[float64]int64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat64Int64V(v map[float64]int64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(float64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[float64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat64Float32R(rv reflect.Value) { - fastpathTV.EncMapFloat64Float32V(rv.Interface().(map[float64]float32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat64Float32V(v map[float64]float32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(float64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v[float64(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat64Float64R(rv reflect.Value) { - fastpathTV.EncMapFloat64Float64V(rv.Interface().(map[float64]float64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat64Float64V(v map[float64]float64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(float64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v[float64(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapFloat64BoolR(rv reflect.Value) { - fastpathTV.EncMapFloat64BoolV(rv.Interface().(map[float64]bool), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapFloat64BoolV(v map[float64]bool, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]float64, len(v)) - var i int - for k, _ := range v { - v2[i] = float64(k) - i++ - } - sort.Sort(floatSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(float64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v[float64(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeFloat64(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintIntfR(rv reflect.Value) { - fastpathTV.EncMapUintIntfV(rv.Interface().(map[uint]interface{}), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintIntfV(v map[uint]interface{}, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[uint(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintStringR(rv reflect.Value) { - fastpathTV.EncMapUintStringV(rv.Interface().(map[uint]string), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintStringV(v map[uint]string, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v[uint(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintUintR(rv reflect.Value) { - fastpathTV.EncMapUintUintV(rv.Interface().(map[uint]uint), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintUintV(v map[uint]uint, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uint(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintUint8R(rv reflect.Value) { - fastpathTV.EncMapUintUint8V(rv.Interface().(map[uint]uint8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintUint8V(v map[uint]uint8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uint(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintUint16R(rv reflect.Value) { - fastpathTV.EncMapUintUint16V(rv.Interface().(map[uint]uint16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintUint16V(v map[uint]uint16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uint(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintUint32R(rv reflect.Value) { - fastpathTV.EncMapUintUint32V(rv.Interface().(map[uint]uint32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintUint32V(v map[uint]uint32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uint(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintUint64R(rv reflect.Value) { - fastpathTV.EncMapUintUint64V(rv.Interface().(map[uint]uint64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintUint64V(v map[uint]uint64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uint(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintUintptrR(rv reflect.Value) { - fastpathTV.EncMapUintUintptrV(rv.Interface().(map[uint]uintptr), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintUintptrV(v map[uint]uintptr, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[uint(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintIntR(rv reflect.Value) { - fastpathTV.EncMapUintIntV(rv.Interface().(map[uint]int), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintIntV(v map[uint]int, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uint(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintInt8R(rv reflect.Value) { - fastpathTV.EncMapUintInt8V(rv.Interface().(map[uint]int8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintInt8V(v map[uint]int8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uint(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintInt16R(rv reflect.Value) { - fastpathTV.EncMapUintInt16V(rv.Interface().(map[uint]int16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintInt16V(v map[uint]int16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uint(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintInt32R(rv reflect.Value) { - fastpathTV.EncMapUintInt32V(rv.Interface().(map[uint]int32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintInt32V(v map[uint]int32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uint(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintInt64R(rv reflect.Value) { - fastpathTV.EncMapUintInt64V(rv.Interface().(map[uint]int64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintInt64V(v map[uint]int64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uint(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintFloat32R(rv reflect.Value) { - fastpathTV.EncMapUintFloat32V(rv.Interface().(map[uint]float32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintFloat32V(v map[uint]float32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v[uint(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintFloat64R(rv reflect.Value) { - fastpathTV.EncMapUintFloat64V(rv.Interface().(map[uint]float64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintFloat64V(v map[uint]float64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v[uint(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintBoolR(rv reflect.Value) { - fastpathTV.EncMapUintBoolV(rv.Interface().(map[uint]bool), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintBoolV(v map[uint]bool, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v[uint(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint8IntfR(rv reflect.Value) { - fastpathTV.EncMapUint8IntfV(rv.Interface().(map[uint8]interface{}), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint8IntfV(v map[uint8]interface{}, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[uint8(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint8StringR(rv reflect.Value) { - fastpathTV.EncMapUint8StringV(rv.Interface().(map[uint8]string), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint8StringV(v map[uint8]string, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v[uint8(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint8UintR(rv reflect.Value) { - fastpathTV.EncMapUint8UintV(rv.Interface().(map[uint8]uint), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint8UintV(v map[uint8]uint, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uint8(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint8Uint8R(rv reflect.Value) { - fastpathTV.EncMapUint8Uint8V(rv.Interface().(map[uint8]uint8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint8Uint8V(v map[uint8]uint8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uint8(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint8Uint16R(rv reflect.Value) { - fastpathTV.EncMapUint8Uint16V(rv.Interface().(map[uint8]uint16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint8Uint16V(v map[uint8]uint16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uint8(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint8Uint32R(rv reflect.Value) { - fastpathTV.EncMapUint8Uint32V(rv.Interface().(map[uint8]uint32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint8Uint32V(v map[uint8]uint32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uint8(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint8Uint64R(rv reflect.Value) { - fastpathTV.EncMapUint8Uint64V(rv.Interface().(map[uint8]uint64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint8Uint64V(v map[uint8]uint64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uint8(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint8UintptrR(rv reflect.Value) { - fastpathTV.EncMapUint8UintptrV(rv.Interface().(map[uint8]uintptr), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint8UintptrV(v map[uint8]uintptr, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[uint8(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint8IntR(rv reflect.Value) { - fastpathTV.EncMapUint8IntV(rv.Interface().(map[uint8]int), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint8IntV(v map[uint8]int, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uint8(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint8Int8R(rv reflect.Value) { - fastpathTV.EncMapUint8Int8V(rv.Interface().(map[uint8]int8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint8Int8V(v map[uint8]int8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uint8(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint8Int16R(rv reflect.Value) { - fastpathTV.EncMapUint8Int16V(rv.Interface().(map[uint8]int16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint8Int16V(v map[uint8]int16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uint8(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint8Int32R(rv reflect.Value) { - fastpathTV.EncMapUint8Int32V(rv.Interface().(map[uint8]int32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint8Int32V(v map[uint8]int32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uint8(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint8Int64R(rv reflect.Value) { - fastpathTV.EncMapUint8Int64V(rv.Interface().(map[uint8]int64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint8Int64V(v map[uint8]int64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uint8(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint8Float32R(rv reflect.Value) { - fastpathTV.EncMapUint8Float32V(rv.Interface().(map[uint8]float32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint8Float32V(v map[uint8]float32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v[uint8(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint8Float64R(rv reflect.Value) { - fastpathTV.EncMapUint8Float64V(rv.Interface().(map[uint8]float64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint8Float64V(v map[uint8]float64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v[uint8(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint8BoolR(rv reflect.Value) { - fastpathTV.EncMapUint8BoolV(rv.Interface().(map[uint8]bool), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint8BoolV(v map[uint8]bool, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v[uint8(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint16IntfR(rv reflect.Value) { - fastpathTV.EncMapUint16IntfV(rv.Interface().(map[uint16]interface{}), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint16IntfV(v map[uint16]interface{}, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[uint16(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint16StringR(rv reflect.Value) { - fastpathTV.EncMapUint16StringV(rv.Interface().(map[uint16]string), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint16StringV(v map[uint16]string, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v[uint16(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint16UintR(rv reflect.Value) { - fastpathTV.EncMapUint16UintV(rv.Interface().(map[uint16]uint), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint16UintV(v map[uint16]uint, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uint16(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint16Uint8R(rv reflect.Value) { - fastpathTV.EncMapUint16Uint8V(rv.Interface().(map[uint16]uint8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint16Uint8V(v map[uint16]uint8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uint16(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint16Uint16R(rv reflect.Value) { - fastpathTV.EncMapUint16Uint16V(rv.Interface().(map[uint16]uint16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint16Uint16V(v map[uint16]uint16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uint16(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint16Uint32R(rv reflect.Value) { - fastpathTV.EncMapUint16Uint32V(rv.Interface().(map[uint16]uint32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint16Uint32V(v map[uint16]uint32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uint16(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint16Uint64R(rv reflect.Value) { - fastpathTV.EncMapUint16Uint64V(rv.Interface().(map[uint16]uint64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint16Uint64V(v map[uint16]uint64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uint16(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint16UintptrR(rv reflect.Value) { - fastpathTV.EncMapUint16UintptrV(rv.Interface().(map[uint16]uintptr), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint16UintptrV(v map[uint16]uintptr, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[uint16(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint16IntR(rv reflect.Value) { - fastpathTV.EncMapUint16IntV(rv.Interface().(map[uint16]int), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint16IntV(v map[uint16]int, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uint16(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint16Int8R(rv reflect.Value) { - fastpathTV.EncMapUint16Int8V(rv.Interface().(map[uint16]int8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint16Int8V(v map[uint16]int8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uint16(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint16Int16R(rv reflect.Value) { - fastpathTV.EncMapUint16Int16V(rv.Interface().(map[uint16]int16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint16Int16V(v map[uint16]int16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uint16(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint16Int32R(rv reflect.Value) { - fastpathTV.EncMapUint16Int32V(rv.Interface().(map[uint16]int32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint16Int32V(v map[uint16]int32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uint16(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint16Int64R(rv reflect.Value) { - fastpathTV.EncMapUint16Int64V(rv.Interface().(map[uint16]int64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint16Int64V(v map[uint16]int64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uint16(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint16Float32R(rv reflect.Value) { - fastpathTV.EncMapUint16Float32V(rv.Interface().(map[uint16]float32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint16Float32V(v map[uint16]float32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v[uint16(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint16Float64R(rv reflect.Value) { - fastpathTV.EncMapUint16Float64V(rv.Interface().(map[uint16]float64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint16Float64V(v map[uint16]float64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v[uint16(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint16BoolR(rv reflect.Value) { - fastpathTV.EncMapUint16BoolV(rv.Interface().(map[uint16]bool), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint16BoolV(v map[uint16]bool, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v[uint16(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint32IntfR(rv reflect.Value) { - fastpathTV.EncMapUint32IntfV(rv.Interface().(map[uint32]interface{}), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint32IntfV(v map[uint32]interface{}, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[uint32(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint32StringR(rv reflect.Value) { - fastpathTV.EncMapUint32StringV(rv.Interface().(map[uint32]string), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint32StringV(v map[uint32]string, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v[uint32(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint32UintR(rv reflect.Value) { - fastpathTV.EncMapUint32UintV(rv.Interface().(map[uint32]uint), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint32UintV(v map[uint32]uint, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uint32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint32Uint8R(rv reflect.Value) { - fastpathTV.EncMapUint32Uint8V(rv.Interface().(map[uint32]uint8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint32Uint8V(v map[uint32]uint8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uint32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint32Uint16R(rv reflect.Value) { - fastpathTV.EncMapUint32Uint16V(rv.Interface().(map[uint32]uint16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint32Uint16V(v map[uint32]uint16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uint32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint32Uint32R(rv reflect.Value) { - fastpathTV.EncMapUint32Uint32V(rv.Interface().(map[uint32]uint32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint32Uint32V(v map[uint32]uint32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uint32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint32Uint64R(rv reflect.Value) { - fastpathTV.EncMapUint32Uint64V(rv.Interface().(map[uint32]uint64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint32Uint64V(v map[uint32]uint64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uint32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint32UintptrR(rv reflect.Value) { - fastpathTV.EncMapUint32UintptrV(rv.Interface().(map[uint32]uintptr), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint32UintptrV(v map[uint32]uintptr, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[uint32(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint32IntR(rv reflect.Value) { - fastpathTV.EncMapUint32IntV(rv.Interface().(map[uint32]int), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint32IntV(v map[uint32]int, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uint32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint32Int8R(rv reflect.Value) { - fastpathTV.EncMapUint32Int8V(rv.Interface().(map[uint32]int8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint32Int8V(v map[uint32]int8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uint32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint32Int16R(rv reflect.Value) { - fastpathTV.EncMapUint32Int16V(rv.Interface().(map[uint32]int16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint32Int16V(v map[uint32]int16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uint32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint32Int32R(rv reflect.Value) { - fastpathTV.EncMapUint32Int32V(rv.Interface().(map[uint32]int32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint32Int32V(v map[uint32]int32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uint32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint32Int64R(rv reflect.Value) { - fastpathTV.EncMapUint32Int64V(rv.Interface().(map[uint32]int64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint32Int64V(v map[uint32]int64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uint32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint32Float32R(rv reflect.Value) { - fastpathTV.EncMapUint32Float32V(rv.Interface().(map[uint32]float32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint32Float32V(v map[uint32]float32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v[uint32(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint32Float64R(rv reflect.Value) { - fastpathTV.EncMapUint32Float64V(rv.Interface().(map[uint32]float64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint32Float64V(v map[uint32]float64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v[uint32(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint32BoolR(rv reflect.Value) { - fastpathTV.EncMapUint32BoolV(rv.Interface().(map[uint32]bool), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint32BoolV(v map[uint32]bool, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v[uint32(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint64IntfR(rv reflect.Value) { - fastpathTV.EncMapUint64IntfV(rv.Interface().(map[uint64]interface{}), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint64IntfV(v map[uint64]interface{}, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[uint64(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint64StringR(rv reflect.Value) { - fastpathTV.EncMapUint64StringV(rv.Interface().(map[uint64]string), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint64StringV(v map[uint64]string, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v[uint64(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint64UintR(rv reflect.Value) { - fastpathTV.EncMapUint64UintV(rv.Interface().(map[uint64]uint), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint64UintV(v map[uint64]uint, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uint64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint64Uint8R(rv reflect.Value) { - fastpathTV.EncMapUint64Uint8V(rv.Interface().(map[uint64]uint8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint64Uint8V(v map[uint64]uint8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uint64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint64Uint16R(rv reflect.Value) { - fastpathTV.EncMapUint64Uint16V(rv.Interface().(map[uint64]uint16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint64Uint16V(v map[uint64]uint16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uint64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint64Uint32R(rv reflect.Value) { - fastpathTV.EncMapUint64Uint32V(rv.Interface().(map[uint64]uint32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint64Uint32V(v map[uint64]uint32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uint64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint64Uint64R(rv reflect.Value) { - fastpathTV.EncMapUint64Uint64V(rv.Interface().(map[uint64]uint64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint64Uint64V(v map[uint64]uint64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uint64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint64UintptrR(rv reflect.Value) { - fastpathTV.EncMapUint64UintptrV(rv.Interface().(map[uint64]uintptr), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint64UintptrV(v map[uint64]uintptr, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[uint64(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint64IntR(rv reflect.Value) { - fastpathTV.EncMapUint64IntV(rv.Interface().(map[uint64]int), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint64IntV(v map[uint64]int, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uint64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint64Int8R(rv reflect.Value) { - fastpathTV.EncMapUint64Int8V(rv.Interface().(map[uint64]int8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint64Int8V(v map[uint64]int8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uint64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint64Int16R(rv reflect.Value) { - fastpathTV.EncMapUint64Int16V(rv.Interface().(map[uint64]int16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint64Int16V(v map[uint64]int16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uint64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint64Int32R(rv reflect.Value) { - fastpathTV.EncMapUint64Int32V(rv.Interface().(map[uint64]int32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint64Int32V(v map[uint64]int32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uint64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint64Int64R(rv reflect.Value) { - fastpathTV.EncMapUint64Int64V(rv.Interface().(map[uint64]int64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint64Int64V(v map[uint64]int64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uint64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint64Float32R(rv reflect.Value) { - fastpathTV.EncMapUint64Float32V(rv.Interface().(map[uint64]float32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint64Float32V(v map[uint64]float32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v[uint64(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint64Float64R(rv reflect.Value) { - fastpathTV.EncMapUint64Float64V(rv.Interface().(map[uint64]float64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint64Float64V(v map[uint64]float64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v[uint64(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUint64BoolR(rv reflect.Value) { - fastpathTV.EncMapUint64BoolV(rv.Interface().(map[uint64]bool), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUint64BoolV(v map[uint64]bool, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(uint64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v[uint64(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeUint(uint64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintptrIntfR(rv reflect.Value) { - fastpathTV.EncMapUintptrIntfV(rv.Interface().(map[uintptr]interface{}), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintptrIntfV(v map[uintptr]interface{}, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(uintptr(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[uintptr(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintptrStringR(rv reflect.Value) { - fastpathTV.EncMapUintptrStringV(rv.Interface().(map[uintptr]string), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintptrStringV(v map[uintptr]string, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(uintptr(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v[uintptr(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintptrUintR(rv reflect.Value) { - fastpathTV.EncMapUintptrUintV(rv.Interface().(map[uintptr]uint), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintptrUintV(v map[uintptr]uint, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(uintptr(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uintptr(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintptrUint8R(rv reflect.Value) { - fastpathTV.EncMapUintptrUint8V(rv.Interface().(map[uintptr]uint8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintptrUint8V(v map[uintptr]uint8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(uintptr(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uintptr(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintptrUint16R(rv reflect.Value) { - fastpathTV.EncMapUintptrUint16V(rv.Interface().(map[uintptr]uint16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintptrUint16V(v map[uintptr]uint16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(uintptr(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uintptr(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintptrUint32R(rv reflect.Value) { - fastpathTV.EncMapUintptrUint32V(rv.Interface().(map[uintptr]uint32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintptrUint32V(v map[uintptr]uint32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(uintptr(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uintptr(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintptrUint64R(rv reflect.Value) { - fastpathTV.EncMapUintptrUint64V(rv.Interface().(map[uintptr]uint64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintptrUint64V(v map[uintptr]uint64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(uintptr(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[uintptr(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintptrUintptrR(rv reflect.Value) { - fastpathTV.EncMapUintptrUintptrV(rv.Interface().(map[uintptr]uintptr), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintptrUintptrV(v map[uintptr]uintptr, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(uintptr(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[uintptr(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintptrIntR(rv reflect.Value) { - fastpathTV.EncMapUintptrIntV(rv.Interface().(map[uintptr]int), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintptrIntV(v map[uintptr]int, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(uintptr(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uintptr(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintptrInt8R(rv reflect.Value) { - fastpathTV.EncMapUintptrInt8V(rv.Interface().(map[uintptr]int8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintptrInt8V(v map[uintptr]int8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(uintptr(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uintptr(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintptrInt16R(rv reflect.Value) { - fastpathTV.EncMapUintptrInt16V(rv.Interface().(map[uintptr]int16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintptrInt16V(v map[uintptr]int16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(uintptr(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uintptr(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintptrInt32R(rv reflect.Value) { - fastpathTV.EncMapUintptrInt32V(rv.Interface().(map[uintptr]int32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintptrInt32V(v map[uintptr]int32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(uintptr(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uintptr(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintptrInt64R(rv reflect.Value) { - fastpathTV.EncMapUintptrInt64V(rv.Interface().(map[uintptr]int64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintptrInt64V(v map[uintptr]int64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(uintptr(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[uintptr(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintptrFloat32R(rv reflect.Value) { - fastpathTV.EncMapUintptrFloat32V(rv.Interface().(map[uintptr]float32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintptrFloat32V(v map[uintptr]float32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(uintptr(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v[uintptr(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintptrFloat64R(rv reflect.Value) { - fastpathTV.EncMapUintptrFloat64V(rv.Interface().(map[uintptr]float64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintptrFloat64V(v map[uintptr]float64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(uintptr(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v[uintptr(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapUintptrBoolR(rv reflect.Value) { - fastpathTV.EncMapUintptrBoolV(rv.Interface().(map[uintptr]bool), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapUintptrBoolV(v map[uintptr]bool, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]uint64, len(v)) - var i int - for k, _ := range v { - v2[i] = uint64(k) - i++ - } - sort.Sort(uintSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(uintptr(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v[uintptr(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - e.encode(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntIntfR(rv reflect.Value) { - fastpathTV.EncMapIntIntfV(rv.Interface().(map[int]interface{}), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntIntfV(v map[int]interface{}, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[int(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntStringR(rv reflect.Value) { - fastpathTV.EncMapIntStringV(rv.Interface().(map[int]string), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntStringV(v map[int]string, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v[int(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntUintR(rv reflect.Value) { - fastpathTV.EncMapIntUintV(rv.Interface().(map[int]uint), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntUintV(v map[int]uint, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[int(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntUint8R(rv reflect.Value) { - fastpathTV.EncMapIntUint8V(rv.Interface().(map[int]uint8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntUint8V(v map[int]uint8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[int(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntUint16R(rv reflect.Value) { - fastpathTV.EncMapIntUint16V(rv.Interface().(map[int]uint16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntUint16V(v map[int]uint16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[int(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntUint32R(rv reflect.Value) { - fastpathTV.EncMapIntUint32V(rv.Interface().(map[int]uint32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntUint32V(v map[int]uint32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[int(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntUint64R(rv reflect.Value) { - fastpathTV.EncMapIntUint64V(rv.Interface().(map[int]uint64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntUint64V(v map[int]uint64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[int(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntUintptrR(rv reflect.Value) { - fastpathTV.EncMapIntUintptrV(rv.Interface().(map[int]uintptr), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntUintptrV(v map[int]uintptr, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[int(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntIntR(rv reflect.Value) { - fastpathTV.EncMapIntIntV(rv.Interface().(map[int]int), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntIntV(v map[int]int, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[int(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntInt8R(rv reflect.Value) { - fastpathTV.EncMapIntInt8V(rv.Interface().(map[int]int8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntInt8V(v map[int]int8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[int(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntInt16R(rv reflect.Value) { - fastpathTV.EncMapIntInt16V(rv.Interface().(map[int]int16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntInt16V(v map[int]int16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[int(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntInt32R(rv reflect.Value) { - fastpathTV.EncMapIntInt32V(rv.Interface().(map[int]int32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntInt32V(v map[int]int32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[int(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntInt64R(rv reflect.Value) { - fastpathTV.EncMapIntInt64V(rv.Interface().(map[int]int64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntInt64V(v map[int]int64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[int(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntFloat32R(rv reflect.Value) { - fastpathTV.EncMapIntFloat32V(rv.Interface().(map[int]float32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntFloat32V(v map[int]float32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v[int(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntFloat64R(rv reflect.Value) { - fastpathTV.EncMapIntFloat64V(rv.Interface().(map[int]float64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntFloat64V(v map[int]float64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v[int(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapIntBoolR(rv reflect.Value) { - fastpathTV.EncMapIntBoolV(rv.Interface().(map[int]bool), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapIntBoolV(v map[int]bool, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v[int(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt8IntfR(rv reflect.Value) { - fastpathTV.EncMapInt8IntfV(rv.Interface().(map[int8]interface{}), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt8IntfV(v map[int8]interface{}, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[int8(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt8StringR(rv reflect.Value) { - fastpathTV.EncMapInt8StringV(rv.Interface().(map[int8]string), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt8StringV(v map[int8]string, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v[int8(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt8UintR(rv reflect.Value) { - fastpathTV.EncMapInt8UintV(rv.Interface().(map[int8]uint), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt8UintV(v map[int8]uint, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[int8(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt8Uint8R(rv reflect.Value) { - fastpathTV.EncMapInt8Uint8V(rv.Interface().(map[int8]uint8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt8Uint8V(v map[int8]uint8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[int8(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt8Uint16R(rv reflect.Value) { - fastpathTV.EncMapInt8Uint16V(rv.Interface().(map[int8]uint16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt8Uint16V(v map[int8]uint16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[int8(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt8Uint32R(rv reflect.Value) { - fastpathTV.EncMapInt8Uint32V(rv.Interface().(map[int8]uint32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt8Uint32V(v map[int8]uint32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[int8(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt8Uint64R(rv reflect.Value) { - fastpathTV.EncMapInt8Uint64V(rv.Interface().(map[int8]uint64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt8Uint64V(v map[int8]uint64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[int8(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt8UintptrR(rv reflect.Value) { - fastpathTV.EncMapInt8UintptrV(rv.Interface().(map[int8]uintptr), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt8UintptrV(v map[int8]uintptr, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[int8(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt8IntR(rv reflect.Value) { - fastpathTV.EncMapInt8IntV(rv.Interface().(map[int8]int), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt8IntV(v map[int8]int, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[int8(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt8Int8R(rv reflect.Value) { - fastpathTV.EncMapInt8Int8V(rv.Interface().(map[int8]int8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt8Int8V(v map[int8]int8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[int8(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt8Int16R(rv reflect.Value) { - fastpathTV.EncMapInt8Int16V(rv.Interface().(map[int8]int16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt8Int16V(v map[int8]int16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[int8(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt8Int32R(rv reflect.Value) { - fastpathTV.EncMapInt8Int32V(rv.Interface().(map[int8]int32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt8Int32V(v map[int8]int32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[int8(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt8Int64R(rv reflect.Value) { - fastpathTV.EncMapInt8Int64V(rv.Interface().(map[int8]int64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt8Int64V(v map[int8]int64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[int8(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt8Float32R(rv reflect.Value) { - fastpathTV.EncMapInt8Float32V(rv.Interface().(map[int8]float32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt8Float32V(v map[int8]float32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v[int8(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt8Float64R(rv reflect.Value) { - fastpathTV.EncMapInt8Float64V(rv.Interface().(map[int8]float64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt8Float64V(v map[int8]float64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v[int8(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt8BoolR(rv reflect.Value) { - fastpathTV.EncMapInt8BoolV(rv.Interface().(map[int8]bool), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt8BoolV(v map[int8]bool, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int8(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v[int8(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt16IntfR(rv reflect.Value) { - fastpathTV.EncMapInt16IntfV(rv.Interface().(map[int16]interface{}), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt16IntfV(v map[int16]interface{}, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[int16(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt16StringR(rv reflect.Value) { - fastpathTV.EncMapInt16StringV(rv.Interface().(map[int16]string), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt16StringV(v map[int16]string, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v[int16(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt16UintR(rv reflect.Value) { - fastpathTV.EncMapInt16UintV(rv.Interface().(map[int16]uint), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt16UintV(v map[int16]uint, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[int16(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt16Uint8R(rv reflect.Value) { - fastpathTV.EncMapInt16Uint8V(rv.Interface().(map[int16]uint8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt16Uint8V(v map[int16]uint8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[int16(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt16Uint16R(rv reflect.Value) { - fastpathTV.EncMapInt16Uint16V(rv.Interface().(map[int16]uint16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt16Uint16V(v map[int16]uint16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[int16(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt16Uint32R(rv reflect.Value) { - fastpathTV.EncMapInt16Uint32V(rv.Interface().(map[int16]uint32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt16Uint32V(v map[int16]uint32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[int16(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt16Uint64R(rv reflect.Value) { - fastpathTV.EncMapInt16Uint64V(rv.Interface().(map[int16]uint64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt16Uint64V(v map[int16]uint64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[int16(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt16UintptrR(rv reflect.Value) { - fastpathTV.EncMapInt16UintptrV(rv.Interface().(map[int16]uintptr), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt16UintptrV(v map[int16]uintptr, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[int16(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt16IntR(rv reflect.Value) { - fastpathTV.EncMapInt16IntV(rv.Interface().(map[int16]int), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt16IntV(v map[int16]int, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[int16(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt16Int8R(rv reflect.Value) { - fastpathTV.EncMapInt16Int8V(rv.Interface().(map[int16]int8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt16Int8V(v map[int16]int8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[int16(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt16Int16R(rv reflect.Value) { - fastpathTV.EncMapInt16Int16V(rv.Interface().(map[int16]int16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt16Int16V(v map[int16]int16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[int16(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt16Int32R(rv reflect.Value) { - fastpathTV.EncMapInt16Int32V(rv.Interface().(map[int16]int32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt16Int32V(v map[int16]int32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[int16(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt16Int64R(rv reflect.Value) { - fastpathTV.EncMapInt16Int64V(rv.Interface().(map[int16]int64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt16Int64V(v map[int16]int64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[int16(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt16Float32R(rv reflect.Value) { - fastpathTV.EncMapInt16Float32V(rv.Interface().(map[int16]float32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt16Float32V(v map[int16]float32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v[int16(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt16Float64R(rv reflect.Value) { - fastpathTV.EncMapInt16Float64V(rv.Interface().(map[int16]float64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt16Float64V(v map[int16]float64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v[int16(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt16BoolR(rv reflect.Value) { - fastpathTV.EncMapInt16BoolV(rv.Interface().(map[int16]bool), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt16BoolV(v map[int16]bool, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int16(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v[int16(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt32IntfR(rv reflect.Value) { - fastpathTV.EncMapInt32IntfV(rv.Interface().(map[int32]interface{}), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt32IntfV(v map[int32]interface{}, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[int32(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt32StringR(rv reflect.Value) { - fastpathTV.EncMapInt32StringV(rv.Interface().(map[int32]string), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt32StringV(v map[int32]string, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v[int32(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt32UintR(rv reflect.Value) { - fastpathTV.EncMapInt32UintV(rv.Interface().(map[int32]uint), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt32UintV(v map[int32]uint, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[int32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt32Uint8R(rv reflect.Value) { - fastpathTV.EncMapInt32Uint8V(rv.Interface().(map[int32]uint8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt32Uint8V(v map[int32]uint8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[int32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt32Uint16R(rv reflect.Value) { - fastpathTV.EncMapInt32Uint16V(rv.Interface().(map[int32]uint16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt32Uint16V(v map[int32]uint16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[int32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt32Uint32R(rv reflect.Value) { - fastpathTV.EncMapInt32Uint32V(rv.Interface().(map[int32]uint32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt32Uint32V(v map[int32]uint32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[int32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt32Uint64R(rv reflect.Value) { - fastpathTV.EncMapInt32Uint64V(rv.Interface().(map[int32]uint64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt32Uint64V(v map[int32]uint64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[int32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt32UintptrR(rv reflect.Value) { - fastpathTV.EncMapInt32UintptrV(rv.Interface().(map[int32]uintptr), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt32UintptrV(v map[int32]uintptr, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[int32(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt32IntR(rv reflect.Value) { - fastpathTV.EncMapInt32IntV(rv.Interface().(map[int32]int), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt32IntV(v map[int32]int, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[int32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt32Int8R(rv reflect.Value) { - fastpathTV.EncMapInt32Int8V(rv.Interface().(map[int32]int8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt32Int8V(v map[int32]int8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[int32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt32Int16R(rv reflect.Value) { - fastpathTV.EncMapInt32Int16V(rv.Interface().(map[int32]int16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt32Int16V(v map[int32]int16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[int32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt32Int32R(rv reflect.Value) { - fastpathTV.EncMapInt32Int32V(rv.Interface().(map[int32]int32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt32Int32V(v map[int32]int32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[int32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt32Int64R(rv reflect.Value) { - fastpathTV.EncMapInt32Int64V(rv.Interface().(map[int32]int64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt32Int64V(v map[int32]int64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[int32(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt32Float32R(rv reflect.Value) { - fastpathTV.EncMapInt32Float32V(rv.Interface().(map[int32]float32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt32Float32V(v map[int32]float32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v[int32(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt32Float64R(rv reflect.Value) { - fastpathTV.EncMapInt32Float64V(rv.Interface().(map[int32]float64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt32Float64V(v map[int32]float64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v[int32(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt32BoolR(rv reflect.Value) { - fastpathTV.EncMapInt32BoolV(rv.Interface().(map[int32]bool), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt32BoolV(v map[int32]bool, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int32(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v[int32(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt64IntfR(rv reflect.Value) { - fastpathTV.EncMapInt64IntfV(rv.Interface().(map[int64]interface{}), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt64IntfV(v map[int64]interface{}, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[int64(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt64StringR(rv reflect.Value) { - fastpathTV.EncMapInt64StringV(rv.Interface().(map[int64]string), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt64StringV(v map[int64]string, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v[int64(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt64UintR(rv reflect.Value) { - fastpathTV.EncMapInt64UintV(rv.Interface().(map[int64]uint), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt64UintV(v map[int64]uint, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[int64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt64Uint8R(rv reflect.Value) { - fastpathTV.EncMapInt64Uint8V(rv.Interface().(map[int64]uint8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt64Uint8V(v map[int64]uint8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[int64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt64Uint16R(rv reflect.Value) { - fastpathTV.EncMapInt64Uint16V(rv.Interface().(map[int64]uint16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt64Uint16V(v map[int64]uint16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[int64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt64Uint32R(rv reflect.Value) { - fastpathTV.EncMapInt64Uint32V(rv.Interface().(map[int64]uint32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt64Uint32V(v map[int64]uint32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[int64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt64Uint64R(rv reflect.Value) { - fastpathTV.EncMapInt64Uint64V(rv.Interface().(map[int64]uint64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt64Uint64V(v map[int64]uint64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[int64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt64UintptrR(rv reflect.Value) { - fastpathTV.EncMapInt64UintptrV(rv.Interface().(map[int64]uintptr), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt64UintptrV(v map[int64]uintptr, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[int64(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt64IntR(rv reflect.Value) { - fastpathTV.EncMapInt64IntV(rv.Interface().(map[int64]int), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt64IntV(v map[int64]int, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[int64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt64Int8R(rv reflect.Value) { - fastpathTV.EncMapInt64Int8V(rv.Interface().(map[int64]int8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt64Int8V(v map[int64]int8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[int64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt64Int16R(rv reflect.Value) { - fastpathTV.EncMapInt64Int16V(rv.Interface().(map[int64]int16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt64Int16V(v map[int64]int16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[int64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt64Int32R(rv reflect.Value) { - fastpathTV.EncMapInt64Int32V(rv.Interface().(map[int64]int32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt64Int32V(v map[int64]int32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[int64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt64Int64R(rv reflect.Value) { - fastpathTV.EncMapInt64Int64V(rv.Interface().(map[int64]int64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt64Int64V(v map[int64]int64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[int64(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt64Float32R(rv reflect.Value) { - fastpathTV.EncMapInt64Float32V(rv.Interface().(map[int64]float32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt64Float32V(v map[int64]float32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v[int64(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt64Float64R(rv reflect.Value) { - fastpathTV.EncMapInt64Float64V(rv.Interface().(map[int64]float64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt64Float64V(v map[int64]float64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v[int64(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapInt64BoolR(rv reflect.Value) { - fastpathTV.EncMapInt64BoolV(rv.Interface().(map[int64]bool), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapInt64BoolV(v map[int64]bool, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]int64, len(v)) - var i int - for k, _ := range v { - v2[i] = int64(k) - i++ - } - sort.Sort(intSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(int64(k2))) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v[int64(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeInt(int64(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapBoolIntfR(rv reflect.Value) { - fastpathTV.EncMapBoolIntfV(rv.Interface().(map[bool]interface{}), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapBoolIntfV(v map[bool]interface{}, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(bool(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[bool(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapBoolStringR(rv reflect.Value) { - fastpathTV.EncMapBoolStringV(rv.Interface().(map[bool]string), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapBoolStringV(v map[bool]string, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(bool(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v[bool(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeString(c_UTF8, v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapBoolUintR(rv reflect.Value) { - fastpathTV.EncMapBoolUintV(rv.Interface().(map[bool]uint), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapBoolUintV(v map[bool]uint, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(bool(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[bool(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapBoolUint8R(rv reflect.Value) { - fastpathTV.EncMapBoolUint8V(rv.Interface().(map[bool]uint8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapBoolUint8V(v map[bool]uint8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(bool(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[bool(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapBoolUint16R(rv reflect.Value) { - fastpathTV.EncMapBoolUint16V(rv.Interface().(map[bool]uint16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapBoolUint16V(v map[bool]uint16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(bool(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[bool(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapBoolUint32R(rv reflect.Value) { - fastpathTV.EncMapBoolUint32V(rv.Interface().(map[bool]uint32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapBoolUint32V(v map[bool]uint32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(bool(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[bool(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapBoolUint64R(rv reflect.Value) { - fastpathTV.EncMapBoolUint64V(rv.Interface().(map[bool]uint64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapBoolUint64V(v map[bool]uint64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(bool(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v[bool(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeUint(uint64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapBoolUintptrR(rv reflect.Value) { - fastpathTV.EncMapBoolUintptrV(rv.Interface().(map[bool]uintptr), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapBoolUintptrV(v map[bool]uintptr, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(bool(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v[bool(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - e.encode(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapBoolIntR(rv reflect.Value) { - fastpathTV.EncMapBoolIntV(rv.Interface().(map[bool]int), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapBoolIntV(v map[bool]int, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(bool(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[bool(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapBoolInt8R(rv reflect.Value) { - fastpathTV.EncMapBoolInt8V(rv.Interface().(map[bool]int8), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapBoolInt8V(v map[bool]int8, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(bool(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[bool(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapBoolInt16R(rv reflect.Value) { - fastpathTV.EncMapBoolInt16V(rv.Interface().(map[bool]int16), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapBoolInt16V(v map[bool]int16, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(bool(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[bool(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapBoolInt32R(rv reflect.Value) { - fastpathTV.EncMapBoolInt32V(rv.Interface().(map[bool]int32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapBoolInt32V(v map[bool]int32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(bool(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[bool(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapBoolInt64R(rv reflect.Value) { - fastpathTV.EncMapBoolInt64V(rv.Interface().(map[bool]int64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapBoolInt64V(v map[bool]int64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(bool(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v[bool(k2)])) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeInt(int64(v2)) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapBoolFloat32R(rv reflect.Value) { - fastpathTV.EncMapBoolFloat32V(rv.Interface().(map[bool]float32), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapBoolFloat32V(v map[bool]float32, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(bool(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v[bool(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat32(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapBoolFloat64R(rv reflect.Value) { - fastpathTV.EncMapBoolFloat64V(rv.Interface().(map[bool]float64), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapBoolFloat64V(v map[bool]float64, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(bool(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v[bool(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeFloat64(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -func (f *encFnInfo) fastpathEncMapBoolBoolR(rv reflect.Value) { - fastpathTV.EncMapBoolBoolV(rv.Interface().(map[bool]bool), fastpathCheckNilFalse, f.e) -} -func (_ fastpathT) EncMapBoolBoolV(v map[bool]bool, checkNil bool, e *Encoder) { - ee := e.e - cr := e.cr - if checkNil && v == nil { - ee.EncodeNil() - return - } - ee.EncodeMapStart(len(v)) - if e.h.Canonical { - v2 := make([]bool, len(v)) - var i int - for k, _ := range v { - v2[i] = bool(k) - i++ - } - sort.Sort(boolSlice(v2)) - for _, k2 := range v2 { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(bool(k2)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v[bool(k2)]) - } - } else { - for k2, v2 := range v { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - ee.EncodeBool(k2) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - ee.EncodeBool(v2) - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } -} - -// -- decode - -// -- -- fast path type switch -func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { - switch v := iv.(type) { - - case []interface{}: - fastpathTV.DecSliceIntfV(v, fastpathCheckNilFalse, false, d) - case *[]interface{}: - v2, changed2 := fastpathTV.DecSliceIntfV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[interface{}]interface{}: - fastpathTV.DecMapIntfIntfV(v, fastpathCheckNilFalse, false, d) - case *map[interface{}]interface{}: - v2, changed2 := fastpathTV.DecMapIntfIntfV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[interface{}]string: - fastpathTV.DecMapIntfStringV(v, fastpathCheckNilFalse, false, d) - case *map[interface{}]string: - v2, changed2 := fastpathTV.DecMapIntfStringV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[interface{}]uint: - fastpathTV.DecMapIntfUintV(v, fastpathCheckNilFalse, false, d) - case *map[interface{}]uint: - v2, changed2 := fastpathTV.DecMapIntfUintV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[interface{}]uint8: - fastpathTV.DecMapIntfUint8V(v, fastpathCheckNilFalse, false, d) - case *map[interface{}]uint8: - v2, changed2 := fastpathTV.DecMapIntfUint8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[interface{}]uint16: - fastpathTV.DecMapIntfUint16V(v, fastpathCheckNilFalse, false, d) - case *map[interface{}]uint16: - v2, changed2 := fastpathTV.DecMapIntfUint16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[interface{}]uint32: - fastpathTV.DecMapIntfUint32V(v, fastpathCheckNilFalse, false, d) - case *map[interface{}]uint32: - v2, changed2 := fastpathTV.DecMapIntfUint32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[interface{}]uint64: - fastpathTV.DecMapIntfUint64V(v, fastpathCheckNilFalse, false, d) - case *map[interface{}]uint64: - v2, changed2 := fastpathTV.DecMapIntfUint64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[interface{}]uintptr: - fastpathTV.DecMapIntfUintptrV(v, fastpathCheckNilFalse, false, d) - case *map[interface{}]uintptr: - v2, changed2 := fastpathTV.DecMapIntfUintptrV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[interface{}]int: - fastpathTV.DecMapIntfIntV(v, fastpathCheckNilFalse, false, d) - case *map[interface{}]int: - v2, changed2 := fastpathTV.DecMapIntfIntV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[interface{}]int8: - fastpathTV.DecMapIntfInt8V(v, fastpathCheckNilFalse, false, d) - case *map[interface{}]int8: - v2, changed2 := fastpathTV.DecMapIntfInt8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[interface{}]int16: - fastpathTV.DecMapIntfInt16V(v, fastpathCheckNilFalse, false, d) - case *map[interface{}]int16: - v2, changed2 := fastpathTV.DecMapIntfInt16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[interface{}]int32: - fastpathTV.DecMapIntfInt32V(v, fastpathCheckNilFalse, false, d) - case *map[interface{}]int32: - v2, changed2 := fastpathTV.DecMapIntfInt32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[interface{}]int64: - fastpathTV.DecMapIntfInt64V(v, fastpathCheckNilFalse, false, d) - case *map[interface{}]int64: - v2, changed2 := fastpathTV.DecMapIntfInt64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[interface{}]float32: - fastpathTV.DecMapIntfFloat32V(v, fastpathCheckNilFalse, false, d) - case *map[interface{}]float32: - v2, changed2 := fastpathTV.DecMapIntfFloat32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[interface{}]float64: - fastpathTV.DecMapIntfFloat64V(v, fastpathCheckNilFalse, false, d) - case *map[interface{}]float64: - v2, changed2 := fastpathTV.DecMapIntfFloat64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[interface{}]bool: - fastpathTV.DecMapIntfBoolV(v, fastpathCheckNilFalse, false, d) - case *map[interface{}]bool: - v2, changed2 := fastpathTV.DecMapIntfBoolV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case []string: - fastpathTV.DecSliceStringV(v, fastpathCheckNilFalse, false, d) - case *[]string: - v2, changed2 := fastpathTV.DecSliceStringV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[string]interface{}: - fastpathTV.DecMapStringIntfV(v, fastpathCheckNilFalse, false, d) - case *map[string]interface{}: - v2, changed2 := fastpathTV.DecMapStringIntfV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[string]string: - fastpathTV.DecMapStringStringV(v, fastpathCheckNilFalse, false, d) - case *map[string]string: - v2, changed2 := fastpathTV.DecMapStringStringV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[string]uint: - fastpathTV.DecMapStringUintV(v, fastpathCheckNilFalse, false, d) - case *map[string]uint: - v2, changed2 := fastpathTV.DecMapStringUintV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[string]uint8: - fastpathTV.DecMapStringUint8V(v, fastpathCheckNilFalse, false, d) - case *map[string]uint8: - v2, changed2 := fastpathTV.DecMapStringUint8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[string]uint16: - fastpathTV.DecMapStringUint16V(v, fastpathCheckNilFalse, false, d) - case *map[string]uint16: - v2, changed2 := fastpathTV.DecMapStringUint16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[string]uint32: - fastpathTV.DecMapStringUint32V(v, fastpathCheckNilFalse, false, d) - case *map[string]uint32: - v2, changed2 := fastpathTV.DecMapStringUint32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[string]uint64: - fastpathTV.DecMapStringUint64V(v, fastpathCheckNilFalse, false, d) - case *map[string]uint64: - v2, changed2 := fastpathTV.DecMapStringUint64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[string]uintptr: - fastpathTV.DecMapStringUintptrV(v, fastpathCheckNilFalse, false, d) - case *map[string]uintptr: - v2, changed2 := fastpathTV.DecMapStringUintptrV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[string]int: - fastpathTV.DecMapStringIntV(v, fastpathCheckNilFalse, false, d) - case *map[string]int: - v2, changed2 := fastpathTV.DecMapStringIntV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[string]int8: - fastpathTV.DecMapStringInt8V(v, fastpathCheckNilFalse, false, d) - case *map[string]int8: - v2, changed2 := fastpathTV.DecMapStringInt8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[string]int16: - fastpathTV.DecMapStringInt16V(v, fastpathCheckNilFalse, false, d) - case *map[string]int16: - v2, changed2 := fastpathTV.DecMapStringInt16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[string]int32: - fastpathTV.DecMapStringInt32V(v, fastpathCheckNilFalse, false, d) - case *map[string]int32: - v2, changed2 := fastpathTV.DecMapStringInt32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[string]int64: - fastpathTV.DecMapStringInt64V(v, fastpathCheckNilFalse, false, d) - case *map[string]int64: - v2, changed2 := fastpathTV.DecMapStringInt64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[string]float32: - fastpathTV.DecMapStringFloat32V(v, fastpathCheckNilFalse, false, d) - case *map[string]float32: - v2, changed2 := fastpathTV.DecMapStringFloat32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[string]float64: - fastpathTV.DecMapStringFloat64V(v, fastpathCheckNilFalse, false, d) - case *map[string]float64: - v2, changed2 := fastpathTV.DecMapStringFloat64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[string]bool: - fastpathTV.DecMapStringBoolV(v, fastpathCheckNilFalse, false, d) - case *map[string]bool: - v2, changed2 := fastpathTV.DecMapStringBoolV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case []float32: - fastpathTV.DecSliceFloat32V(v, fastpathCheckNilFalse, false, d) - case *[]float32: - v2, changed2 := fastpathTV.DecSliceFloat32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float32]interface{}: - fastpathTV.DecMapFloat32IntfV(v, fastpathCheckNilFalse, false, d) - case *map[float32]interface{}: - v2, changed2 := fastpathTV.DecMapFloat32IntfV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float32]string: - fastpathTV.DecMapFloat32StringV(v, fastpathCheckNilFalse, false, d) - case *map[float32]string: - v2, changed2 := fastpathTV.DecMapFloat32StringV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float32]uint: - fastpathTV.DecMapFloat32UintV(v, fastpathCheckNilFalse, false, d) - case *map[float32]uint: - v2, changed2 := fastpathTV.DecMapFloat32UintV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float32]uint8: - fastpathTV.DecMapFloat32Uint8V(v, fastpathCheckNilFalse, false, d) - case *map[float32]uint8: - v2, changed2 := fastpathTV.DecMapFloat32Uint8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float32]uint16: - fastpathTV.DecMapFloat32Uint16V(v, fastpathCheckNilFalse, false, d) - case *map[float32]uint16: - v2, changed2 := fastpathTV.DecMapFloat32Uint16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float32]uint32: - fastpathTV.DecMapFloat32Uint32V(v, fastpathCheckNilFalse, false, d) - case *map[float32]uint32: - v2, changed2 := fastpathTV.DecMapFloat32Uint32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float32]uint64: - fastpathTV.DecMapFloat32Uint64V(v, fastpathCheckNilFalse, false, d) - case *map[float32]uint64: - v2, changed2 := fastpathTV.DecMapFloat32Uint64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float32]uintptr: - fastpathTV.DecMapFloat32UintptrV(v, fastpathCheckNilFalse, false, d) - case *map[float32]uintptr: - v2, changed2 := fastpathTV.DecMapFloat32UintptrV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float32]int: - fastpathTV.DecMapFloat32IntV(v, fastpathCheckNilFalse, false, d) - case *map[float32]int: - v2, changed2 := fastpathTV.DecMapFloat32IntV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float32]int8: - fastpathTV.DecMapFloat32Int8V(v, fastpathCheckNilFalse, false, d) - case *map[float32]int8: - v2, changed2 := fastpathTV.DecMapFloat32Int8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float32]int16: - fastpathTV.DecMapFloat32Int16V(v, fastpathCheckNilFalse, false, d) - case *map[float32]int16: - v2, changed2 := fastpathTV.DecMapFloat32Int16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float32]int32: - fastpathTV.DecMapFloat32Int32V(v, fastpathCheckNilFalse, false, d) - case *map[float32]int32: - v2, changed2 := fastpathTV.DecMapFloat32Int32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float32]int64: - fastpathTV.DecMapFloat32Int64V(v, fastpathCheckNilFalse, false, d) - case *map[float32]int64: - v2, changed2 := fastpathTV.DecMapFloat32Int64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float32]float32: - fastpathTV.DecMapFloat32Float32V(v, fastpathCheckNilFalse, false, d) - case *map[float32]float32: - v2, changed2 := fastpathTV.DecMapFloat32Float32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float32]float64: - fastpathTV.DecMapFloat32Float64V(v, fastpathCheckNilFalse, false, d) - case *map[float32]float64: - v2, changed2 := fastpathTV.DecMapFloat32Float64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float32]bool: - fastpathTV.DecMapFloat32BoolV(v, fastpathCheckNilFalse, false, d) - case *map[float32]bool: - v2, changed2 := fastpathTV.DecMapFloat32BoolV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case []float64: - fastpathTV.DecSliceFloat64V(v, fastpathCheckNilFalse, false, d) - case *[]float64: - v2, changed2 := fastpathTV.DecSliceFloat64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float64]interface{}: - fastpathTV.DecMapFloat64IntfV(v, fastpathCheckNilFalse, false, d) - case *map[float64]interface{}: - v2, changed2 := fastpathTV.DecMapFloat64IntfV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float64]string: - fastpathTV.DecMapFloat64StringV(v, fastpathCheckNilFalse, false, d) - case *map[float64]string: - v2, changed2 := fastpathTV.DecMapFloat64StringV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float64]uint: - fastpathTV.DecMapFloat64UintV(v, fastpathCheckNilFalse, false, d) - case *map[float64]uint: - v2, changed2 := fastpathTV.DecMapFloat64UintV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float64]uint8: - fastpathTV.DecMapFloat64Uint8V(v, fastpathCheckNilFalse, false, d) - case *map[float64]uint8: - v2, changed2 := fastpathTV.DecMapFloat64Uint8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float64]uint16: - fastpathTV.DecMapFloat64Uint16V(v, fastpathCheckNilFalse, false, d) - case *map[float64]uint16: - v2, changed2 := fastpathTV.DecMapFloat64Uint16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float64]uint32: - fastpathTV.DecMapFloat64Uint32V(v, fastpathCheckNilFalse, false, d) - case *map[float64]uint32: - v2, changed2 := fastpathTV.DecMapFloat64Uint32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float64]uint64: - fastpathTV.DecMapFloat64Uint64V(v, fastpathCheckNilFalse, false, d) - case *map[float64]uint64: - v2, changed2 := fastpathTV.DecMapFloat64Uint64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float64]uintptr: - fastpathTV.DecMapFloat64UintptrV(v, fastpathCheckNilFalse, false, d) - case *map[float64]uintptr: - v2, changed2 := fastpathTV.DecMapFloat64UintptrV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float64]int: - fastpathTV.DecMapFloat64IntV(v, fastpathCheckNilFalse, false, d) - case *map[float64]int: - v2, changed2 := fastpathTV.DecMapFloat64IntV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float64]int8: - fastpathTV.DecMapFloat64Int8V(v, fastpathCheckNilFalse, false, d) - case *map[float64]int8: - v2, changed2 := fastpathTV.DecMapFloat64Int8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float64]int16: - fastpathTV.DecMapFloat64Int16V(v, fastpathCheckNilFalse, false, d) - case *map[float64]int16: - v2, changed2 := fastpathTV.DecMapFloat64Int16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float64]int32: - fastpathTV.DecMapFloat64Int32V(v, fastpathCheckNilFalse, false, d) - case *map[float64]int32: - v2, changed2 := fastpathTV.DecMapFloat64Int32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float64]int64: - fastpathTV.DecMapFloat64Int64V(v, fastpathCheckNilFalse, false, d) - case *map[float64]int64: - v2, changed2 := fastpathTV.DecMapFloat64Int64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float64]float32: - fastpathTV.DecMapFloat64Float32V(v, fastpathCheckNilFalse, false, d) - case *map[float64]float32: - v2, changed2 := fastpathTV.DecMapFloat64Float32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float64]float64: - fastpathTV.DecMapFloat64Float64V(v, fastpathCheckNilFalse, false, d) - case *map[float64]float64: - v2, changed2 := fastpathTV.DecMapFloat64Float64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[float64]bool: - fastpathTV.DecMapFloat64BoolV(v, fastpathCheckNilFalse, false, d) - case *map[float64]bool: - v2, changed2 := fastpathTV.DecMapFloat64BoolV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case []uint: - fastpathTV.DecSliceUintV(v, fastpathCheckNilFalse, false, d) - case *[]uint: - v2, changed2 := fastpathTV.DecSliceUintV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint]interface{}: - fastpathTV.DecMapUintIntfV(v, fastpathCheckNilFalse, false, d) - case *map[uint]interface{}: - v2, changed2 := fastpathTV.DecMapUintIntfV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint]string: - fastpathTV.DecMapUintStringV(v, fastpathCheckNilFalse, false, d) - case *map[uint]string: - v2, changed2 := fastpathTV.DecMapUintStringV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint]uint: - fastpathTV.DecMapUintUintV(v, fastpathCheckNilFalse, false, d) - case *map[uint]uint: - v2, changed2 := fastpathTV.DecMapUintUintV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint]uint8: - fastpathTV.DecMapUintUint8V(v, fastpathCheckNilFalse, false, d) - case *map[uint]uint8: - v2, changed2 := fastpathTV.DecMapUintUint8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint]uint16: - fastpathTV.DecMapUintUint16V(v, fastpathCheckNilFalse, false, d) - case *map[uint]uint16: - v2, changed2 := fastpathTV.DecMapUintUint16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint]uint32: - fastpathTV.DecMapUintUint32V(v, fastpathCheckNilFalse, false, d) - case *map[uint]uint32: - v2, changed2 := fastpathTV.DecMapUintUint32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint]uint64: - fastpathTV.DecMapUintUint64V(v, fastpathCheckNilFalse, false, d) - case *map[uint]uint64: - v2, changed2 := fastpathTV.DecMapUintUint64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint]uintptr: - fastpathTV.DecMapUintUintptrV(v, fastpathCheckNilFalse, false, d) - case *map[uint]uintptr: - v2, changed2 := fastpathTV.DecMapUintUintptrV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint]int: - fastpathTV.DecMapUintIntV(v, fastpathCheckNilFalse, false, d) - case *map[uint]int: - v2, changed2 := fastpathTV.DecMapUintIntV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint]int8: - fastpathTV.DecMapUintInt8V(v, fastpathCheckNilFalse, false, d) - case *map[uint]int8: - v2, changed2 := fastpathTV.DecMapUintInt8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint]int16: - fastpathTV.DecMapUintInt16V(v, fastpathCheckNilFalse, false, d) - case *map[uint]int16: - v2, changed2 := fastpathTV.DecMapUintInt16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint]int32: - fastpathTV.DecMapUintInt32V(v, fastpathCheckNilFalse, false, d) - case *map[uint]int32: - v2, changed2 := fastpathTV.DecMapUintInt32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint]int64: - fastpathTV.DecMapUintInt64V(v, fastpathCheckNilFalse, false, d) - case *map[uint]int64: - v2, changed2 := fastpathTV.DecMapUintInt64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint]float32: - fastpathTV.DecMapUintFloat32V(v, fastpathCheckNilFalse, false, d) - case *map[uint]float32: - v2, changed2 := fastpathTV.DecMapUintFloat32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint]float64: - fastpathTV.DecMapUintFloat64V(v, fastpathCheckNilFalse, false, d) - case *map[uint]float64: - v2, changed2 := fastpathTV.DecMapUintFloat64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint]bool: - fastpathTV.DecMapUintBoolV(v, fastpathCheckNilFalse, false, d) - case *map[uint]bool: - v2, changed2 := fastpathTV.DecMapUintBoolV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint8]interface{}: - fastpathTV.DecMapUint8IntfV(v, fastpathCheckNilFalse, false, d) - case *map[uint8]interface{}: - v2, changed2 := fastpathTV.DecMapUint8IntfV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint8]string: - fastpathTV.DecMapUint8StringV(v, fastpathCheckNilFalse, false, d) - case *map[uint8]string: - v2, changed2 := fastpathTV.DecMapUint8StringV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint8]uint: - fastpathTV.DecMapUint8UintV(v, fastpathCheckNilFalse, false, d) - case *map[uint8]uint: - v2, changed2 := fastpathTV.DecMapUint8UintV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint8]uint8: - fastpathTV.DecMapUint8Uint8V(v, fastpathCheckNilFalse, false, d) - case *map[uint8]uint8: - v2, changed2 := fastpathTV.DecMapUint8Uint8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint8]uint16: - fastpathTV.DecMapUint8Uint16V(v, fastpathCheckNilFalse, false, d) - case *map[uint8]uint16: - v2, changed2 := fastpathTV.DecMapUint8Uint16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint8]uint32: - fastpathTV.DecMapUint8Uint32V(v, fastpathCheckNilFalse, false, d) - case *map[uint8]uint32: - v2, changed2 := fastpathTV.DecMapUint8Uint32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint8]uint64: - fastpathTV.DecMapUint8Uint64V(v, fastpathCheckNilFalse, false, d) - case *map[uint8]uint64: - v2, changed2 := fastpathTV.DecMapUint8Uint64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint8]uintptr: - fastpathTV.DecMapUint8UintptrV(v, fastpathCheckNilFalse, false, d) - case *map[uint8]uintptr: - v2, changed2 := fastpathTV.DecMapUint8UintptrV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint8]int: - fastpathTV.DecMapUint8IntV(v, fastpathCheckNilFalse, false, d) - case *map[uint8]int: - v2, changed2 := fastpathTV.DecMapUint8IntV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint8]int8: - fastpathTV.DecMapUint8Int8V(v, fastpathCheckNilFalse, false, d) - case *map[uint8]int8: - v2, changed2 := fastpathTV.DecMapUint8Int8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint8]int16: - fastpathTV.DecMapUint8Int16V(v, fastpathCheckNilFalse, false, d) - case *map[uint8]int16: - v2, changed2 := fastpathTV.DecMapUint8Int16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint8]int32: - fastpathTV.DecMapUint8Int32V(v, fastpathCheckNilFalse, false, d) - case *map[uint8]int32: - v2, changed2 := fastpathTV.DecMapUint8Int32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint8]int64: - fastpathTV.DecMapUint8Int64V(v, fastpathCheckNilFalse, false, d) - case *map[uint8]int64: - v2, changed2 := fastpathTV.DecMapUint8Int64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint8]float32: - fastpathTV.DecMapUint8Float32V(v, fastpathCheckNilFalse, false, d) - case *map[uint8]float32: - v2, changed2 := fastpathTV.DecMapUint8Float32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint8]float64: - fastpathTV.DecMapUint8Float64V(v, fastpathCheckNilFalse, false, d) - case *map[uint8]float64: - v2, changed2 := fastpathTV.DecMapUint8Float64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint8]bool: - fastpathTV.DecMapUint8BoolV(v, fastpathCheckNilFalse, false, d) - case *map[uint8]bool: - v2, changed2 := fastpathTV.DecMapUint8BoolV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case []uint16: - fastpathTV.DecSliceUint16V(v, fastpathCheckNilFalse, false, d) - case *[]uint16: - v2, changed2 := fastpathTV.DecSliceUint16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint16]interface{}: - fastpathTV.DecMapUint16IntfV(v, fastpathCheckNilFalse, false, d) - case *map[uint16]interface{}: - v2, changed2 := fastpathTV.DecMapUint16IntfV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint16]string: - fastpathTV.DecMapUint16StringV(v, fastpathCheckNilFalse, false, d) - case *map[uint16]string: - v2, changed2 := fastpathTV.DecMapUint16StringV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint16]uint: - fastpathTV.DecMapUint16UintV(v, fastpathCheckNilFalse, false, d) - case *map[uint16]uint: - v2, changed2 := fastpathTV.DecMapUint16UintV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint16]uint8: - fastpathTV.DecMapUint16Uint8V(v, fastpathCheckNilFalse, false, d) - case *map[uint16]uint8: - v2, changed2 := fastpathTV.DecMapUint16Uint8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint16]uint16: - fastpathTV.DecMapUint16Uint16V(v, fastpathCheckNilFalse, false, d) - case *map[uint16]uint16: - v2, changed2 := fastpathTV.DecMapUint16Uint16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint16]uint32: - fastpathTV.DecMapUint16Uint32V(v, fastpathCheckNilFalse, false, d) - case *map[uint16]uint32: - v2, changed2 := fastpathTV.DecMapUint16Uint32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint16]uint64: - fastpathTV.DecMapUint16Uint64V(v, fastpathCheckNilFalse, false, d) - case *map[uint16]uint64: - v2, changed2 := fastpathTV.DecMapUint16Uint64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint16]uintptr: - fastpathTV.DecMapUint16UintptrV(v, fastpathCheckNilFalse, false, d) - case *map[uint16]uintptr: - v2, changed2 := fastpathTV.DecMapUint16UintptrV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint16]int: - fastpathTV.DecMapUint16IntV(v, fastpathCheckNilFalse, false, d) - case *map[uint16]int: - v2, changed2 := fastpathTV.DecMapUint16IntV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint16]int8: - fastpathTV.DecMapUint16Int8V(v, fastpathCheckNilFalse, false, d) - case *map[uint16]int8: - v2, changed2 := fastpathTV.DecMapUint16Int8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint16]int16: - fastpathTV.DecMapUint16Int16V(v, fastpathCheckNilFalse, false, d) - case *map[uint16]int16: - v2, changed2 := fastpathTV.DecMapUint16Int16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint16]int32: - fastpathTV.DecMapUint16Int32V(v, fastpathCheckNilFalse, false, d) - case *map[uint16]int32: - v2, changed2 := fastpathTV.DecMapUint16Int32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint16]int64: - fastpathTV.DecMapUint16Int64V(v, fastpathCheckNilFalse, false, d) - case *map[uint16]int64: - v2, changed2 := fastpathTV.DecMapUint16Int64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint16]float32: - fastpathTV.DecMapUint16Float32V(v, fastpathCheckNilFalse, false, d) - case *map[uint16]float32: - v2, changed2 := fastpathTV.DecMapUint16Float32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint16]float64: - fastpathTV.DecMapUint16Float64V(v, fastpathCheckNilFalse, false, d) - case *map[uint16]float64: - v2, changed2 := fastpathTV.DecMapUint16Float64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint16]bool: - fastpathTV.DecMapUint16BoolV(v, fastpathCheckNilFalse, false, d) - case *map[uint16]bool: - v2, changed2 := fastpathTV.DecMapUint16BoolV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case []uint32: - fastpathTV.DecSliceUint32V(v, fastpathCheckNilFalse, false, d) - case *[]uint32: - v2, changed2 := fastpathTV.DecSliceUint32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint32]interface{}: - fastpathTV.DecMapUint32IntfV(v, fastpathCheckNilFalse, false, d) - case *map[uint32]interface{}: - v2, changed2 := fastpathTV.DecMapUint32IntfV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint32]string: - fastpathTV.DecMapUint32StringV(v, fastpathCheckNilFalse, false, d) - case *map[uint32]string: - v2, changed2 := fastpathTV.DecMapUint32StringV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint32]uint: - fastpathTV.DecMapUint32UintV(v, fastpathCheckNilFalse, false, d) - case *map[uint32]uint: - v2, changed2 := fastpathTV.DecMapUint32UintV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint32]uint8: - fastpathTV.DecMapUint32Uint8V(v, fastpathCheckNilFalse, false, d) - case *map[uint32]uint8: - v2, changed2 := fastpathTV.DecMapUint32Uint8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint32]uint16: - fastpathTV.DecMapUint32Uint16V(v, fastpathCheckNilFalse, false, d) - case *map[uint32]uint16: - v2, changed2 := fastpathTV.DecMapUint32Uint16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint32]uint32: - fastpathTV.DecMapUint32Uint32V(v, fastpathCheckNilFalse, false, d) - case *map[uint32]uint32: - v2, changed2 := fastpathTV.DecMapUint32Uint32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint32]uint64: - fastpathTV.DecMapUint32Uint64V(v, fastpathCheckNilFalse, false, d) - case *map[uint32]uint64: - v2, changed2 := fastpathTV.DecMapUint32Uint64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint32]uintptr: - fastpathTV.DecMapUint32UintptrV(v, fastpathCheckNilFalse, false, d) - case *map[uint32]uintptr: - v2, changed2 := fastpathTV.DecMapUint32UintptrV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint32]int: - fastpathTV.DecMapUint32IntV(v, fastpathCheckNilFalse, false, d) - case *map[uint32]int: - v2, changed2 := fastpathTV.DecMapUint32IntV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint32]int8: - fastpathTV.DecMapUint32Int8V(v, fastpathCheckNilFalse, false, d) - case *map[uint32]int8: - v2, changed2 := fastpathTV.DecMapUint32Int8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint32]int16: - fastpathTV.DecMapUint32Int16V(v, fastpathCheckNilFalse, false, d) - case *map[uint32]int16: - v2, changed2 := fastpathTV.DecMapUint32Int16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint32]int32: - fastpathTV.DecMapUint32Int32V(v, fastpathCheckNilFalse, false, d) - case *map[uint32]int32: - v2, changed2 := fastpathTV.DecMapUint32Int32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint32]int64: - fastpathTV.DecMapUint32Int64V(v, fastpathCheckNilFalse, false, d) - case *map[uint32]int64: - v2, changed2 := fastpathTV.DecMapUint32Int64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint32]float32: - fastpathTV.DecMapUint32Float32V(v, fastpathCheckNilFalse, false, d) - case *map[uint32]float32: - v2, changed2 := fastpathTV.DecMapUint32Float32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint32]float64: - fastpathTV.DecMapUint32Float64V(v, fastpathCheckNilFalse, false, d) - case *map[uint32]float64: - v2, changed2 := fastpathTV.DecMapUint32Float64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint32]bool: - fastpathTV.DecMapUint32BoolV(v, fastpathCheckNilFalse, false, d) - case *map[uint32]bool: - v2, changed2 := fastpathTV.DecMapUint32BoolV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case []uint64: - fastpathTV.DecSliceUint64V(v, fastpathCheckNilFalse, false, d) - case *[]uint64: - v2, changed2 := fastpathTV.DecSliceUint64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint64]interface{}: - fastpathTV.DecMapUint64IntfV(v, fastpathCheckNilFalse, false, d) - case *map[uint64]interface{}: - v2, changed2 := fastpathTV.DecMapUint64IntfV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint64]string: - fastpathTV.DecMapUint64StringV(v, fastpathCheckNilFalse, false, d) - case *map[uint64]string: - v2, changed2 := fastpathTV.DecMapUint64StringV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint64]uint: - fastpathTV.DecMapUint64UintV(v, fastpathCheckNilFalse, false, d) - case *map[uint64]uint: - v2, changed2 := fastpathTV.DecMapUint64UintV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint64]uint8: - fastpathTV.DecMapUint64Uint8V(v, fastpathCheckNilFalse, false, d) - case *map[uint64]uint8: - v2, changed2 := fastpathTV.DecMapUint64Uint8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint64]uint16: - fastpathTV.DecMapUint64Uint16V(v, fastpathCheckNilFalse, false, d) - case *map[uint64]uint16: - v2, changed2 := fastpathTV.DecMapUint64Uint16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint64]uint32: - fastpathTV.DecMapUint64Uint32V(v, fastpathCheckNilFalse, false, d) - case *map[uint64]uint32: - v2, changed2 := fastpathTV.DecMapUint64Uint32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint64]uint64: - fastpathTV.DecMapUint64Uint64V(v, fastpathCheckNilFalse, false, d) - case *map[uint64]uint64: - v2, changed2 := fastpathTV.DecMapUint64Uint64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint64]uintptr: - fastpathTV.DecMapUint64UintptrV(v, fastpathCheckNilFalse, false, d) - case *map[uint64]uintptr: - v2, changed2 := fastpathTV.DecMapUint64UintptrV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint64]int: - fastpathTV.DecMapUint64IntV(v, fastpathCheckNilFalse, false, d) - case *map[uint64]int: - v2, changed2 := fastpathTV.DecMapUint64IntV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint64]int8: - fastpathTV.DecMapUint64Int8V(v, fastpathCheckNilFalse, false, d) - case *map[uint64]int8: - v2, changed2 := fastpathTV.DecMapUint64Int8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint64]int16: - fastpathTV.DecMapUint64Int16V(v, fastpathCheckNilFalse, false, d) - case *map[uint64]int16: - v2, changed2 := fastpathTV.DecMapUint64Int16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint64]int32: - fastpathTV.DecMapUint64Int32V(v, fastpathCheckNilFalse, false, d) - case *map[uint64]int32: - v2, changed2 := fastpathTV.DecMapUint64Int32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint64]int64: - fastpathTV.DecMapUint64Int64V(v, fastpathCheckNilFalse, false, d) - case *map[uint64]int64: - v2, changed2 := fastpathTV.DecMapUint64Int64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint64]float32: - fastpathTV.DecMapUint64Float32V(v, fastpathCheckNilFalse, false, d) - case *map[uint64]float32: - v2, changed2 := fastpathTV.DecMapUint64Float32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint64]float64: - fastpathTV.DecMapUint64Float64V(v, fastpathCheckNilFalse, false, d) - case *map[uint64]float64: - v2, changed2 := fastpathTV.DecMapUint64Float64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uint64]bool: - fastpathTV.DecMapUint64BoolV(v, fastpathCheckNilFalse, false, d) - case *map[uint64]bool: - v2, changed2 := fastpathTV.DecMapUint64BoolV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case []uintptr: - fastpathTV.DecSliceUintptrV(v, fastpathCheckNilFalse, false, d) - case *[]uintptr: - v2, changed2 := fastpathTV.DecSliceUintptrV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uintptr]interface{}: - fastpathTV.DecMapUintptrIntfV(v, fastpathCheckNilFalse, false, d) - case *map[uintptr]interface{}: - v2, changed2 := fastpathTV.DecMapUintptrIntfV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uintptr]string: - fastpathTV.DecMapUintptrStringV(v, fastpathCheckNilFalse, false, d) - case *map[uintptr]string: - v2, changed2 := fastpathTV.DecMapUintptrStringV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uintptr]uint: - fastpathTV.DecMapUintptrUintV(v, fastpathCheckNilFalse, false, d) - case *map[uintptr]uint: - v2, changed2 := fastpathTV.DecMapUintptrUintV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uintptr]uint8: - fastpathTV.DecMapUintptrUint8V(v, fastpathCheckNilFalse, false, d) - case *map[uintptr]uint8: - v2, changed2 := fastpathTV.DecMapUintptrUint8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uintptr]uint16: - fastpathTV.DecMapUintptrUint16V(v, fastpathCheckNilFalse, false, d) - case *map[uintptr]uint16: - v2, changed2 := fastpathTV.DecMapUintptrUint16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uintptr]uint32: - fastpathTV.DecMapUintptrUint32V(v, fastpathCheckNilFalse, false, d) - case *map[uintptr]uint32: - v2, changed2 := fastpathTV.DecMapUintptrUint32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uintptr]uint64: - fastpathTV.DecMapUintptrUint64V(v, fastpathCheckNilFalse, false, d) - case *map[uintptr]uint64: - v2, changed2 := fastpathTV.DecMapUintptrUint64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uintptr]uintptr: - fastpathTV.DecMapUintptrUintptrV(v, fastpathCheckNilFalse, false, d) - case *map[uintptr]uintptr: - v2, changed2 := fastpathTV.DecMapUintptrUintptrV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uintptr]int: - fastpathTV.DecMapUintptrIntV(v, fastpathCheckNilFalse, false, d) - case *map[uintptr]int: - v2, changed2 := fastpathTV.DecMapUintptrIntV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uintptr]int8: - fastpathTV.DecMapUintptrInt8V(v, fastpathCheckNilFalse, false, d) - case *map[uintptr]int8: - v2, changed2 := fastpathTV.DecMapUintptrInt8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uintptr]int16: - fastpathTV.DecMapUintptrInt16V(v, fastpathCheckNilFalse, false, d) - case *map[uintptr]int16: - v2, changed2 := fastpathTV.DecMapUintptrInt16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uintptr]int32: - fastpathTV.DecMapUintptrInt32V(v, fastpathCheckNilFalse, false, d) - case *map[uintptr]int32: - v2, changed2 := fastpathTV.DecMapUintptrInt32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uintptr]int64: - fastpathTV.DecMapUintptrInt64V(v, fastpathCheckNilFalse, false, d) - case *map[uintptr]int64: - v2, changed2 := fastpathTV.DecMapUintptrInt64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uintptr]float32: - fastpathTV.DecMapUintptrFloat32V(v, fastpathCheckNilFalse, false, d) - case *map[uintptr]float32: - v2, changed2 := fastpathTV.DecMapUintptrFloat32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uintptr]float64: - fastpathTV.DecMapUintptrFloat64V(v, fastpathCheckNilFalse, false, d) - case *map[uintptr]float64: - v2, changed2 := fastpathTV.DecMapUintptrFloat64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[uintptr]bool: - fastpathTV.DecMapUintptrBoolV(v, fastpathCheckNilFalse, false, d) - case *map[uintptr]bool: - v2, changed2 := fastpathTV.DecMapUintptrBoolV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case []int: - fastpathTV.DecSliceIntV(v, fastpathCheckNilFalse, false, d) - case *[]int: - v2, changed2 := fastpathTV.DecSliceIntV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int]interface{}: - fastpathTV.DecMapIntIntfV(v, fastpathCheckNilFalse, false, d) - case *map[int]interface{}: - v2, changed2 := fastpathTV.DecMapIntIntfV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int]string: - fastpathTV.DecMapIntStringV(v, fastpathCheckNilFalse, false, d) - case *map[int]string: - v2, changed2 := fastpathTV.DecMapIntStringV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int]uint: - fastpathTV.DecMapIntUintV(v, fastpathCheckNilFalse, false, d) - case *map[int]uint: - v2, changed2 := fastpathTV.DecMapIntUintV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int]uint8: - fastpathTV.DecMapIntUint8V(v, fastpathCheckNilFalse, false, d) - case *map[int]uint8: - v2, changed2 := fastpathTV.DecMapIntUint8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int]uint16: - fastpathTV.DecMapIntUint16V(v, fastpathCheckNilFalse, false, d) - case *map[int]uint16: - v2, changed2 := fastpathTV.DecMapIntUint16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int]uint32: - fastpathTV.DecMapIntUint32V(v, fastpathCheckNilFalse, false, d) - case *map[int]uint32: - v2, changed2 := fastpathTV.DecMapIntUint32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int]uint64: - fastpathTV.DecMapIntUint64V(v, fastpathCheckNilFalse, false, d) - case *map[int]uint64: - v2, changed2 := fastpathTV.DecMapIntUint64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int]uintptr: - fastpathTV.DecMapIntUintptrV(v, fastpathCheckNilFalse, false, d) - case *map[int]uintptr: - v2, changed2 := fastpathTV.DecMapIntUintptrV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int]int: - fastpathTV.DecMapIntIntV(v, fastpathCheckNilFalse, false, d) - case *map[int]int: - v2, changed2 := fastpathTV.DecMapIntIntV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int]int8: - fastpathTV.DecMapIntInt8V(v, fastpathCheckNilFalse, false, d) - case *map[int]int8: - v2, changed2 := fastpathTV.DecMapIntInt8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int]int16: - fastpathTV.DecMapIntInt16V(v, fastpathCheckNilFalse, false, d) - case *map[int]int16: - v2, changed2 := fastpathTV.DecMapIntInt16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int]int32: - fastpathTV.DecMapIntInt32V(v, fastpathCheckNilFalse, false, d) - case *map[int]int32: - v2, changed2 := fastpathTV.DecMapIntInt32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int]int64: - fastpathTV.DecMapIntInt64V(v, fastpathCheckNilFalse, false, d) - case *map[int]int64: - v2, changed2 := fastpathTV.DecMapIntInt64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int]float32: - fastpathTV.DecMapIntFloat32V(v, fastpathCheckNilFalse, false, d) - case *map[int]float32: - v2, changed2 := fastpathTV.DecMapIntFloat32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int]float64: - fastpathTV.DecMapIntFloat64V(v, fastpathCheckNilFalse, false, d) - case *map[int]float64: - v2, changed2 := fastpathTV.DecMapIntFloat64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int]bool: - fastpathTV.DecMapIntBoolV(v, fastpathCheckNilFalse, false, d) - case *map[int]bool: - v2, changed2 := fastpathTV.DecMapIntBoolV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case []int8: - fastpathTV.DecSliceInt8V(v, fastpathCheckNilFalse, false, d) - case *[]int8: - v2, changed2 := fastpathTV.DecSliceInt8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int8]interface{}: - fastpathTV.DecMapInt8IntfV(v, fastpathCheckNilFalse, false, d) - case *map[int8]interface{}: - v2, changed2 := fastpathTV.DecMapInt8IntfV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int8]string: - fastpathTV.DecMapInt8StringV(v, fastpathCheckNilFalse, false, d) - case *map[int8]string: - v2, changed2 := fastpathTV.DecMapInt8StringV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int8]uint: - fastpathTV.DecMapInt8UintV(v, fastpathCheckNilFalse, false, d) - case *map[int8]uint: - v2, changed2 := fastpathTV.DecMapInt8UintV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int8]uint8: - fastpathTV.DecMapInt8Uint8V(v, fastpathCheckNilFalse, false, d) - case *map[int8]uint8: - v2, changed2 := fastpathTV.DecMapInt8Uint8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int8]uint16: - fastpathTV.DecMapInt8Uint16V(v, fastpathCheckNilFalse, false, d) - case *map[int8]uint16: - v2, changed2 := fastpathTV.DecMapInt8Uint16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int8]uint32: - fastpathTV.DecMapInt8Uint32V(v, fastpathCheckNilFalse, false, d) - case *map[int8]uint32: - v2, changed2 := fastpathTV.DecMapInt8Uint32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int8]uint64: - fastpathTV.DecMapInt8Uint64V(v, fastpathCheckNilFalse, false, d) - case *map[int8]uint64: - v2, changed2 := fastpathTV.DecMapInt8Uint64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int8]uintptr: - fastpathTV.DecMapInt8UintptrV(v, fastpathCheckNilFalse, false, d) - case *map[int8]uintptr: - v2, changed2 := fastpathTV.DecMapInt8UintptrV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int8]int: - fastpathTV.DecMapInt8IntV(v, fastpathCheckNilFalse, false, d) - case *map[int8]int: - v2, changed2 := fastpathTV.DecMapInt8IntV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int8]int8: - fastpathTV.DecMapInt8Int8V(v, fastpathCheckNilFalse, false, d) - case *map[int8]int8: - v2, changed2 := fastpathTV.DecMapInt8Int8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int8]int16: - fastpathTV.DecMapInt8Int16V(v, fastpathCheckNilFalse, false, d) - case *map[int8]int16: - v2, changed2 := fastpathTV.DecMapInt8Int16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int8]int32: - fastpathTV.DecMapInt8Int32V(v, fastpathCheckNilFalse, false, d) - case *map[int8]int32: - v2, changed2 := fastpathTV.DecMapInt8Int32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int8]int64: - fastpathTV.DecMapInt8Int64V(v, fastpathCheckNilFalse, false, d) - case *map[int8]int64: - v2, changed2 := fastpathTV.DecMapInt8Int64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int8]float32: - fastpathTV.DecMapInt8Float32V(v, fastpathCheckNilFalse, false, d) - case *map[int8]float32: - v2, changed2 := fastpathTV.DecMapInt8Float32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int8]float64: - fastpathTV.DecMapInt8Float64V(v, fastpathCheckNilFalse, false, d) - case *map[int8]float64: - v2, changed2 := fastpathTV.DecMapInt8Float64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int8]bool: - fastpathTV.DecMapInt8BoolV(v, fastpathCheckNilFalse, false, d) - case *map[int8]bool: - v2, changed2 := fastpathTV.DecMapInt8BoolV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case []int16: - fastpathTV.DecSliceInt16V(v, fastpathCheckNilFalse, false, d) - case *[]int16: - v2, changed2 := fastpathTV.DecSliceInt16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int16]interface{}: - fastpathTV.DecMapInt16IntfV(v, fastpathCheckNilFalse, false, d) - case *map[int16]interface{}: - v2, changed2 := fastpathTV.DecMapInt16IntfV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int16]string: - fastpathTV.DecMapInt16StringV(v, fastpathCheckNilFalse, false, d) - case *map[int16]string: - v2, changed2 := fastpathTV.DecMapInt16StringV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int16]uint: - fastpathTV.DecMapInt16UintV(v, fastpathCheckNilFalse, false, d) - case *map[int16]uint: - v2, changed2 := fastpathTV.DecMapInt16UintV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int16]uint8: - fastpathTV.DecMapInt16Uint8V(v, fastpathCheckNilFalse, false, d) - case *map[int16]uint8: - v2, changed2 := fastpathTV.DecMapInt16Uint8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int16]uint16: - fastpathTV.DecMapInt16Uint16V(v, fastpathCheckNilFalse, false, d) - case *map[int16]uint16: - v2, changed2 := fastpathTV.DecMapInt16Uint16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int16]uint32: - fastpathTV.DecMapInt16Uint32V(v, fastpathCheckNilFalse, false, d) - case *map[int16]uint32: - v2, changed2 := fastpathTV.DecMapInt16Uint32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int16]uint64: - fastpathTV.DecMapInt16Uint64V(v, fastpathCheckNilFalse, false, d) - case *map[int16]uint64: - v2, changed2 := fastpathTV.DecMapInt16Uint64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int16]uintptr: - fastpathTV.DecMapInt16UintptrV(v, fastpathCheckNilFalse, false, d) - case *map[int16]uintptr: - v2, changed2 := fastpathTV.DecMapInt16UintptrV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int16]int: - fastpathTV.DecMapInt16IntV(v, fastpathCheckNilFalse, false, d) - case *map[int16]int: - v2, changed2 := fastpathTV.DecMapInt16IntV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int16]int8: - fastpathTV.DecMapInt16Int8V(v, fastpathCheckNilFalse, false, d) - case *map[int16]int8: - v2, changed2 := fastpathTV.DecMapInt16Int8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int16]int16: - fastpathTV.DecMapInt16Int16V(v, fastpathCheckNilFalse, false, d) - case *map[int16]int16: - v2, changed2 := fastpathTV.DecMapInt16Int16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int16]int32: - fastpathTV.DecMapInt16Int32V(v, fastpathCheckNilFalse, false, d) - case *map[int16]int32: - v2, changed2 := fastpathTV.DecMapInt16Int32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int16]int64: - fastpathTV.DecMapInt16Int64V(v, fastpathCheckNilFalse, false, d) - case *map[int16]int64: - v2, changed2 := fastpathTV.DecMapInt16Int64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int16]float32: - fastpathTV.DecMapInt16Float32V(v, fastpathCheckNilFalse, false, d) - case *map[int16]float32: - v2, changed2 := fastpathTV.DecMapInt16Float32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int16]float64: - fastpathTV.DecMapInt16Float64V(v, fastpathCheckNilFalse, false, d) - case *map[int16]float64: - v2, changed2 := fastpathTV.DecMapInt16Float64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int16]bool: - fastpathTV.DecMapInt16BoolV(v, fastpathCheckNilFalse, false, d) - case *map[int16]bool: - v2, changed2 := fastpathTV.DecMapInt16BoolV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case []int32: - fastpathTV.DecSliceInt32V(v, fastpathCheckNilFalse, false, d) - case *[]int32: - v2, changed2 := fastpathTV.DecSliceInt32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int32]interface{}: - fastpathTV.DecMapInt32IntfV(v, fastpathCheckNilFalse, false, d) - case *map[int32]interface{}: - v2, changed2 := fastpathTV.DecMapInt32IntfV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int32]string: - fastpathTV.DecMapInt32StringV(v, fastpathCheckNilFalse, false, d) - case *map[int32]string: - v2, changed2 := fastpathTV.DecMapInt32StringV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int32]uint: - fastpathTV.DecMapInt32UintV(v, fastpathCheckNilFalse, false, d) - case *map[int32]uint: - v2, changed2 := fastpathTV.DecMapInt32UintV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int32]uint8: - fastpathTV.DecMapInt32Uint8V(v, fastpathCheckNilFalse, false, d) - case *map[int32]uint8: - v2, changed2 := fastpathTV.DecMapInt32Uint8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int32]uint16: - fastpathTV.DecMapInt32Uint16V(v, fastpathCheckNilFalse, false, d) - case *map[int32]uint16: - v2, changed2 := fastpathTV.DecMapInt32Uint16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int32]uint32: - fastpathTV.DecMapInt32Uint32V(v, fastpathCheckNilFalse, false, d) - case *map[int32]uint32: - v2, changed2 := fastpathTV.DecMapInt32Uint32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int32]uint64: - fastpathTV.DecMapInt32Uint64V(v, fastpathCheckNilFalse, false, d) - case *map[int32]uint64: - v2, changed2 := fastpathTV.DecMapInt32Uint64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int32]uintptr: - fastpathTV.DecMapInt32UintptrV(v, fastpathCheckNilFalse, false, d) - case *map[int32]uintptr: - v2, changed2 := fastpathTV.DecMapInt32UintptrV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int32]int: - fastpathTV.DecMapInt32IntV(v, fastpathCheckNilFalse, false, d) - case *map[int32]int: - v2, changed2 := fastpathTV.DecMapInt32IntV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int32]int8: - fastpathTV.DecMapInt32Int8V(v, fastpathCheckNilFalse, false, d) - case *map[int32]int8: - v2, changed2 := fastpathTV.DecMapInt32Int8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int32]int16: - fastpathTV.DecMapInt32Int16V(v, fastpathCheckNilFalse, false, d) - case *map[int32]int16: - v2, changed2 := fastpathTV.DecMapInt32Int16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int32]int32: - fastpathTV.DecMapInt32Int32V(v, fastpathCheckNilFalse, false, d) - case *map[int32]int32: - v2, changed2 := fastpathTV.DecMapInt32Int32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int32]int64: - fastpathTV.DecMapInt32Int64V(v, fastpathCheckNilFalse, false, d) - case *map[int32]int64: - v2, changed2 := fastpathTV.DecMapInt32Int64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int32]float32: - fastpathTV.DecMapInt32Float32V(v, fastpathCheckNilFalse, false, d) - case *map[int32]float32: - v2, changed2 := fastpathTV.DecMapInt32Float32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int32]float64: - fastpathTV.DecMapInt32Float64V(v, fastpathCheckNilFalse, false, d) - case *map[int32]float64: - v2, changed2 := fastpathTV.DecMapInt32Float64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int32]bool: - fastpathTV.DecMapInt32BoolV(v, fastpathCheckNilFalse, false, d) - case *map[int32]bool: - v2, changed2 := fastpathTV.DecMapInt32BoolV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case []int64: - fastpathTV.DecSliceInt64V(v, fastpathCheckNilFalse, false, d) - case *[]int64: - v2, changed2 := fastpathTV.DecSliceInt64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int64]interface{}: - fastpathTV.DecMapInt64IntfV(v, fastpathCheckNilFalse, false, d) - case *map[int64]interface{}: - v2, changed2 := fastpathTV.DecMapInt64IntfV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int64]string: - fastpathTV.DecMapInt64StringV(v, fastpathCheckNilFalse, false, d) - case *map[int64]string: - v2, changed2 := fastpathTV.DecMapInt64StringV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int64]uint: - fastpathTV.DecMapInt64UintV(v, fastpathCheckNilFalse, false, d) - case *map[int64]uint: - v2, changed2 := fastpathTV.DecMapInt64UintV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int64]uint8: - fastpathTV.DecMapInt64Uint8V(v, fastpathCheckNilFalse, false, d) - case *map[int64]uint8: - v2, changed2 := fastpathTV.DecMapInt64Uint8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int64]uint16: - fastpathTV.DecMapInt64Uint16V(v, fastpathCheckNilFalse, false, d) - case *map[int64]uint16: - v2, changed2 := fastpathTV.DecMapInt64Uint16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int64]uint32: - fastpathTV.DecMapInt64Uint32V(v, fastpathCheckNilFalse, false, d) - case *map[int64]uint32: - v2, changed2 := fastpathTV.DecMapInt64Uint32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int64]uint64: - fastpathTV.DecMapInt64Uint64V(v, fastpathCheckNilFalse, false, d) - case *map[int64]uint64: - v2, changed2 := fastpathTV.DecMapInt64Uint64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int64]uintptr: - fastpathTV.DecMapInt64UintptrV(v, fastpathCheckNilFalse, false, d) - case *map[int64]uintptr: - v2, changed2 := fastpathTV.DecMapInt64UintptrV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int64]int: - fastpathTV.DecMapInt64IntV(v, fastpathCheckNilFalse, false, d) - case *map[int64]int: - v2, changed2 := fastpathTV.DecMapInt64IntV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int64]int8: - fastpathTV.DecMapInt64Int8V(v, fastpathCheckNilFalse, false, d) - case *map[int64]int8: - v2, changed2 := fastpathTV.DecMapInt64Int8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int64]int16: - fastpathTV.DecMapInt64Int16V(v, fastpathCheckNilFalse, false, d) - case *map[int64]int16: - v2, changed2 := fastpathTV.DecMapInt64Int16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int64]int32: - fastpathTV.DecMapInt64Int32V(v, fastpathCheckNilFalse, false, d) - case *map[int64]int32: - v2, changed2 := fastpathTV.DecMapInt64Int32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int64]int64: - fastpathTV.DecMapInt64Int64V(v, fastpathCheckNilFalse, false, d) - case *map[int64]int64: - v2, changed2 := fastpathTV.DecMapInt64Int64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int64]float32: - fastpathTV.DecMapInt64Float32V(v, fastpathCheckNilFalse, false, d) - case *map[int64]float32: - v2, changed2 := fastpathTV.DecMapInt64Float32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int64]float64: - fastpathTV.DecMapInt64Float64V(v, fastpathCheckNilFalse, false, d) - case *map[int64]float64: - v2, changed2 := fastpathTV.DecMapInt64Float64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[int64]bool: - fastpathTV.DecMapInt64BoolV(v, fastpathCheckNilFalse, false, d) - case *map[int64]bool: - v2, changed2 := fastpathTV.DecMapInt64BoolV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case []bool: - fastpathTV.DecSliceBoolV(v, fastpathCheckNilFalse, false, d) - case *[]bool: - v2, changed2 := fastpathTV.DecSliceBoolV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[bool]interface{}: - fastpathTV.DecMapBoolIntfV(v, fastpathCheckNilFalse, false, d) - case *map[bool]interface{}: - v2, changed2 := fastpathTV.DecMapBoolIntfV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[bool]string: - fastpathTV.DecMapBoolStringV(v, fastpathCheckNilFalse, false, d) - case *map[bool]string: - v2, changed2 := fastpathTV.DecMapBoolStringV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[bool]uint: - fastpathTV.DecMapBoolUintV(v, fastpathCheckNilFalse, false, d) - case *map[bool]uint: - v2, changed2 := fastpathTV.DecMapBoolUintV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[bool]uint8: - fastpathTV.DecMapBoolUint8V(v, fastpathCheckNilFalse, false, d) - case *map[bool]uint8: - v2, changed2 := fastpathTV.DecMapBoolUint8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[bool]uint16: - fastpathTV.DecMapBoolUint16V(v, fastpathCheckNilFalse, false, d) - case *map[bool]uint16: - v2, changed2 := fastpathTV.DecMapBoolUint16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[bool]uint32: - fastpathTV.DecMapBoolUint32V(v, fastpathCheckNilFalse, false, d) - case *map[bool]uint32: - v2, changed2 := fastpathTV.DecMapBoolUint32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[bool]uint64: - fastpathTV.DecMapBoolUint64V(v, fastpathCheckNilFalse, false, d) - case *map[bool]uint64: - v2, changed2 := fastpathTV.DecMapBoolUint64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[bool]uintptr: - fastpathTV.DecMapBoolUintptrV(v, fastpathCheckNilFalse, false, d) - case *map[bool]uintptr: - v2, changed2 := fastpathTV.DecMapBoolUintptrV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[bool]int: - fastpathTV.DecMapBoolIntV(v, fastpathCheckNilFalse, false, d) - case *map[bool]int: - v2, changed2 := fastpathTV.DecMapBoolIntV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[bool]int8: - fastpathTV.DecMapBoolInt8V(v, fastpathCheckNilFalse, false, d) - case *map[bool]int8: - v2, changed2 := fastpathTV.DecMapBoolInt8V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[bool]int16: - fastpathTV.DecMapBoolInt16V(v, fastpathCheckNilFalse, false, d) - case *map[bool]int16: - v2, changed2 := fastpathTV.DecMapBoolInt16V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[bool]int32: - fastpathTV.DecMapBoolInt32V(v, fastpathCheckNilFalse, false, d) - case *map[bool]int32: - v2, changed2 := fastpathTV.DecMapBoolInt32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[bool]int64: - fastpathTV.DecMapBoolInt64V(v, fastpathCheckNilFalse, false, d) - case *map[bool]int64: - v2, changed2 := fastpathTV.DecMapBoolInt64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[bool]float32: - fastpathTV.DecMapBoolFloat32V(v, fastpathCheckNilFalse, false, d) - case *map[bool]float32: - v2, changed2 := fastpathTV.DecMapBoolFloat32V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[bool]float64: - fastpathTV.DecMapBoolFloat64V(v, fastpathCheckNilFalse, false, d) - case *map[bool]float64: - v2, changed2 := fastpathTV.DecMapBoolFloat64V(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - case map[bool]bool: - fastpathTV.DecMapBoolBoolV(v, fastpathCheckNilFalse, false, d) - case *map[bool]bool: - v2, changed2 := fastpathTV.DecMapBoolBoolV(*v, fastpathCheckNilFalse, true, d) - if changed2 { - *v = v2 - } - - default: - _ = v // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release) - return false - } - return true -} - -// -- -- fast path functions - -func (f *decFnInfo) fastpathDecSliceIntfR(rv reflect.Value) { - array := f.seq == seqTypeArray - if !array && rv.CanAddr() { - vp := rv.Addr().Interface().(*[]interface{}) - v, changed := fastpathTV.DecSliceIntfV(*vp, fastpathCheckNilFalse, !array, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().([]interface{}) - fastpathTV.DecSliceIntfV(v, fastpathCheckNilFalse, false, f.d) - } -} - -func (f fastpathT) DecSliceIntfX(vp *[]interface{}, checkNil bool, d *Decoder) { - v, changed := f.DecSliceIntfV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecSliceIntfV(v []interface{}, checkNil bool, canChange bool, d *Decoder) (_ []interface{}, changed bool) { - dd := d.d - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - 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 - } - - if containerLenS > 0 { - x2read := containerLenS - var xtrunc bool - if containerLenS > cap(v) { - if canChange { - var xlen int - xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 16) - if xtrunc { - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]interface{}, xlen) - } - } else { - v = make([]interface{}, xlen) - } - changed = true - } else { - d.arrayCannotExpand(len(v), containerLenS) - } - x2read = len(v) - } else if containerLenS != len(v) { - if canChange { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; j < x2read; j++ { - slh.ElemContainerState(j) - d.decode(&v[j]) - } - if xtrunc { - for ; j < containerLenS; j++ { - v = append(v, nil) - slh.ElemContainerState(j) - d.decode(&v[j]) - } - } else if !canChange { - for ; j < containerLenS; j++ { - slh.ElemContainerState(j) - d.swallow() - } - } - } else { - breakFound := dd.CheckBreak() - if breakFound { - if canChange { - if v == nil { - v = []interface{}{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - if cap(v) == 0 { - v = make([]interface{}, 1, 4) - changed = true - } - j := 0 - for ; !breakFound; j++ { - if j >= len(v) { - if canChange { - v = append(v, nil) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - } - } - slh.ElemContainerState(j) - if j < len(v) { - d.decode(&v[j]) - - } else { - d.swallow() - } - breakFound = dd.CheckBreak() - } - if canChange && j < len(v) { - v = v[:j] - changed = true - } - } - slh.End() - return v, changed -} - -func (f *decFnInfo) fastpathDecSliceStringR(rv reflect.Value) { - array := f.seq == seqTypeArray - if !array && rv.CanAddr() { - vp := rv.Addr().Interface().(*[]string) - v, changed := fastpathTV.DecSliceStringV(*vp, fastpathCheckNilFalse, !array, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().([]string) - fastpathTV.DecSliceStringV(v, fastpathCheckNilFalse, false, f.d) - } -} - -func (f fastpathT) DecSliceStringX(vp *[]string, checkNil bool, d *Decoder) { - v, changed := f.DecSliceStringV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecSliceStringV(v []string, checkNil bool, canChange bool, d *Decoder) (_ []string, changed bool) { - dd := d.d - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - 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 - } - - if containerLenS > 0 { - x2read := containerLenS - var xtrunc bool - if containerLenS > cap(v) { - if canChange { - var xlen int - xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 16) - if xtrunc { - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]string, xlen) - } - } else { - v = make([]string, xlen) - } - changed = true - } else { - d.arrayCannotExpand(len(v), containerLenS) - } - x2read = len(v) - } else if containerLenS != len(v) { - if canChange { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; j < x2read; j++ { - slh.ElemContainerState(j) - v[j] = dd.DecodeString() - } - if xtrunc { - for ; j < containerLenS; j++ { - v = append(v, "") - slh.ElemContainerState(j) - v[j] = dd.DecodeString() - } - } else if !canChange { - for ; j < containerLenS; j++ { - slh.ElemContainerState(j) - d.swallow() - } - } - } else { - breakFound := dd.CheckBreak() - if breakFound { - if canChange { - if v == nil { - v = []string{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - if cap(v) == 0 { - v = make([]string, 1, 4) - changed = true - } - j := 0 - for ; !breakFound; j++ { - if j >= len(v) { - if canChange { - v = append(v, "") - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - } - } - slh.ElemContainerState(j) - if j < len(v) { - v[j] = dd.DecodeString() - } else { - d.swallow() - } - breakFound = dd.CheckBreak() - } - if canChange && j < len(v) { - v = v[:j] - changed = true - } - } - slh.End() - return v, changed -} - -func (f *decFnInfo) fastpathDecSliceFloat32R(rv reflect.Value) { - array := f.seq == seqTypeArray - if !array && rv.CanAddr() { - vp := rv.Addr().Interface().(*[]float32) - v, changed := fastpathTV.DecSliceFloat32V(*vp, fastpathCheckNilFalse, !array, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().([]float32) - fastpathTV.DecSliceFloat32V(v, fastpathCheckNilFalse, false, f.d) - } -} - -func (f fastpathT) DecSliceFloat32X(vp *[]float32, checkNil bool, d *Decoder) { - v, changed := f.DecSliceFloat32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecSliceFloat32V(v []float32, checkNil bool, canChange bool, d *Decoder) (_ []float32, changed bool) { - dd := d.d - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - 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 - } - - if containerLenS > 0 { - x2read := containerLenS - var xtrunc bool - if containerLenS > cap(v) { - if canChange { - var xlen int - xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 4) - if xtrunc { - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]float32, xlen) - } - } else { - v = make([]float32, xlen) - } - changed = true - } else { - d.arrayCannotExpand(len(v), containerLenS) - } - x2read = len(v) - } else if containerLenS != len(v) { - if canChange { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; j < x2read; j++ { - slh.ElemContainerState(j) - v[j] = float32(dd.DecodeFloat(true)) - } - if xtrunc { - for ; j < containerLenS; j++ { - v = append(v, 0) - slh.ElemContainerState(j) - v[j] = float32(dd.DecodeFloat(true)) - } - } else if !canChange { - for ; j < containerLenS; j++ { - slh.ElemContainerState(j) - d.swallow() - } - } - } else { - breakFound := dd.CheckBreak() - if breakFound { - if canChange { - if v == nil { - v = []float32{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - if cap(v) == 0 { - v = make([]float32, 1, 4) - changed = true - } - j := 0 - for ; !breakFound; j++ { - if j >= len(v) { - if canChange { - v = append(v, 0) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - } - } - slh.ElemContainerState(j) - if j < len(v) { - v[j] = float32(dd.DecodeFloat(true)) - } else { - d.swallow() - } - breakFound = dd.CheckBreak() - } - if canChange && j < len(v) { - v = v[:j] - changed = true - } - } - slh.End() - return v, changed -} - -func (f *decFnInfo) fastpathDecSliceFloat64R(rv reflect.Value) { - array := f.seq == seqTypeArray - if !array && rv.CanAddr() { - vp := rv.Addr().Interface().(*[]float64) - v, changed := fastpathTV.DecSliceFloat64V(*vp, fastpathCheckNilFalse, !array, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().([]float64) - fastpathTV.DecSliceFloat64V(v, fastpathCheckNilFalse, false, f.d) - } -} - -func (f fastpathT) DecSliceFloat64X(vp *[]float64, checkNil bool, d *Decoder) { - v, changed := f.DecSliceFloat64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecSliceFloat64V(v []float64, checkNil bool, canChange bool, d *Decoder) (_ []float64, changed bool) { - dd := d.d - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - 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 - } - - if containerLenS > 0 { - x2read := containerLenS - var xtrunc bool - if containerLenS > cap(v) { - if canChange { - var xlen int - xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 8) - if xtrunc { - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]float64, xlen) - } - } else { - v = make([]float64, xlen) - } - changed = true - } else { - d.arrayCannotExpand(len(v), containerLenS) - } - x2read = len(v) - } else if containerLenS != len(v) { - if canChange { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; j < x2read; j++ { - slh.ElemContainerState(j) - v[j] = dd.DecodeFloat(false) - } - if xtrunc { - for ; j < containerLenS; j++ { - v = append(v, 0) - slh.ElemContainerState(j) - v[j] = dd.DecodeFloat(false) - } - } else if !canChange { - for ; j < containerLenS; j++ { - slh.ElemContainerState(j) - d.swallow() - } - } - } else { - breakFound := dd.CheckBreak() - if breakFound { - if canChange { - if v == nil { - v = []float64{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - if cap(v) == 0 { - v = make([]float64, 1, 4) - changed = true - } - j := 0 - for ; !breakFound; j++ { - if j >= len(v) { - if canChange { - v = append(v, 0) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - } - } - slh.ElemContainerState(j) - if j < len(v) { - v[j] = dd.DecodeFloat(false) - } else { - d.swallow() - } - breakFound = dd.CheckBreak() - } - if canChange && j < len(v) { - v = v[:j] - changed = true - } - } - slh.End() - return v, changed -} - -func (f *decFnInfo) fastpathDecSliceUintR(rv reflect.Value) { - array := f.seq == seqTypeArray - if !array && rv.CanAddr() { - vp := rv.Addr().Interface().(*[]uint) - v, changed := fastpathTV.DecSliceUintV(*vp, fastpathCheckNilFalse, !array, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().([]uint) - fastpathTV.DecSliceUintV(v, fastpathCheckNilFalse, false, f.d) - } -} - -func (f fastpathT) DecSliceUintX(vp *[]uint, checkNil bool, d *Decoder) { - v, changed := f.DecSliceUintV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecSliceUintV(v []uint, checkNil bool, canChange bool, d *Decoder) (_ []uint, changed bool) { - dd := d.d - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - 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 - } - - if containerLenS > 0 { - x2read := containerLenS - var xtrunc bool - if containerLenS > cap(v) { - if canChange { - var xlen int - xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 8) - if xtrunc { - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]uint, xlen) - } - } else { - v = make([]uint, xlen) - } - changed = true - } else { - d.arrayCannotExpand(len(v), containerLenS) - } - x2read = len(v) - } else if containerLenS != len(v) { - if canChange { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; j < x2read; j++ { - slh.ElemContainerState(j) - v[j] = uint(dd.DecodeUint(uintBitsize)) - } - if xtrunc { - for ; j < containerLenS; j++ { - v = append(v, 0) - slh.ElemContainerState(j) - v[j] = uint(dd.DecodeUint(uintBitsize)) - } - } else if !canChange { - for ; j < containerLenS; j++ { - slh.ElemContainerState(j) - d.swallow() - } - } - } else { - breakFound := dd.CheckBreak() - if breakFound { - if canChange { - if v == nil { - v = []uint{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - if cap(v) == 0 { - v = make([]uint, 1, 4) - changed = true - } - j := 0 - for ; !breakFound; j++ { - if j >= len(v) { - if canChange { - v = append(v, 0) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - } - } - slh.ElemContainerState(j) - if j < len(v) { - v[j] = uint(dd.DecodeUint(uintBitsize)) - } else { - d.swallow() - } - breakFound = dd.CheckBreak() - } - if canChange && j < len(v) { - v = v[:j] - changed = true - } - } - slh.End() - return v, changed -} - -func (f *decFnInfo) fastpathDecSliceUint16R(rv reflect.Value) { - array := f.seq == seqTypeArray - if !array && rv.CanAddr() { - vp := rv.Addr().Interface().(*[]uint16) - v, changed := fastpathTV.DecSliceUint16V(*vp, fastpathCheckNilFalse, !array, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().([]uint16) - fastpathTV.DecSliceUint16V(v, fastpathCheckNilFalse, false, f.d) - } -} - -func (f fastpathT) DecSliceUint16X(vp *[]uint16, checkNil bool, d *Decoder) { - v, changed := f.DecSliceUint16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecSliceUint16V(v []uint16, checkNil bool, canChange bool, d *Decoder) (_ []uint16, changed bool) { - dd := d.d - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - 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 - } - - if containerLenS > 0 { - x2read := containerLenS - var xtrunc bool - if containerLenS > cap(v) { - if canChange { - var xlen int - xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 2) - if xtrunc { - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]uint16, xlen) - } - } else { - v = make([]uint16, xlen) - } - changed = true - } else { - d.arrayCannotExpand(len(v), containerLenS) - } - x2read = len(v) - } else if containerLenS != len(v) { - if canChange { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; j < x2read; j++ { - slh.ElemContainerState(j) - v[j] = uint16(dd.DecodeUint(16)) - } - if xtrunc { - for ; j < containerLenS; j++ { - v = append(v, 0) - slh.ElemContainerState(j) - v[j] = uint16(dd.DecodeUint(16)) - } - } else if !canChange { - for ; j < containerLenS; j++ { - slh.ElemContainerState(j) - d.swallow() - } - } - } else { - breakFound := dd.CheckBreak() - if breakFound { - if canChange { - if v == nil { - v = []uint16{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - if cap(v) == 0 { - v = make([]uint16, 1, 4) - changed = true - } - j := 0 - for ; !breakFound; j++ { - if j >= len(v) { - if canChange { - v = append(v, 0) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - } - } - slh.ElemContainerState(j) - if j < len(v) { - v[j] = uint16(dd.DecodeUint(16)) - } else { - d.swallow() - } - breakFound = dd.CheckBreak() - } - if canChange && j < len(v) { - v = v[:j] - changed = true - } - } - slh.End() - return v, changed -} - -func (f *decFnInfo) fastpathDecSliceUint32R(rv reflect.Value) { - array := f.seq == seqTypeArray - if !array && rv.CanAddr() { - vp := rv.Addr().Interface().(*[]uint32) - v, changed := fastpathTV.DecSliceUint32V(*vp, fastpathCheckNilFalse, !array, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().([]uint32) - fastpathTV.DecSliceUint32V(v, fastpathCheckNilFalse, false, f.d) - } -} - -func (f fastpathT) DecSliceUint32X(vp *[]uint32, checkNil bool, d *Decoder) { - v, changed := f.DecSliceUint32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecSliceUint32V(v []uint32, checkNil bool, canChange bool, d *Decoder) (_ []uint32, changed bool) { - dd := d.d - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - 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 - } - - if containerLenS > 0 { - x2read := containerLenS - var xtrunc bool - if containerLenS > cap(v) { - if canChange { - var xlen int - xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 4) - if xtrunc { - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]uint32, xlen) - } - } else { - v = make([]uint32, xlen) - } - changed = true - } else { - d.arrayCannotExpand(len(v), containerLenS) - } - x2read = len(v) - } else if containerLenS != len(v) { - if canChange { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; j < x2read; j++ { - slh.ElemContainerState(j) - v[j] = uint32(dd.DecodeUint(32)) - } - if xtrunc { - for ; j < containerLenS; j++ { - v = append(v, 0) - slh.ElemContainerState(j) - v[j] = uint32(dd.DecodeUint(32)) - } - } else if !canChange { - for ; j < containerLenS; j++ { - slh.ElemContainerState(j) - d.swallow() - } - } - } else { - breakFound := dd.CheckBreak() - if breakFound { - if canChange { - if v == nil { - v = []uint32{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - if cap(v) == 0 { - v = make([]uint32, 1, 4) - changed = true - } - j := 0 - for ; !breakFound; j++ { - if j >= len(v) { - if canChange { - v = append(v, 0) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - } - } - slh.ElemContainerState(j) - if j < len(v) { - v[j] = uint32(dd.DecodeUint(32)) - } else { - d.swallow() - } - breakFound = dd.CheckBreak() - } - if canChange && j < len(v) { - v = v[:j] - changed = true - } - } - slh.End() - return v, changed -} - -func (f *decFnInfo) fastpathDecSliceUint64R(rv reflect.Value) { - array := f.seq == seqTypeArray - if !array && rv.CanAddr() { - vp := rv.Addr().Interface().(*[]uint64) - v, changed := fastpathTV.DecSliceUint64V(*vp, fastpathCheckNilFalse, !array, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().([]uint64) - fastpathTV.DecSliceUint64V(v, fastpathCheckNilFalse, false, f.d) - } -} - -func (f fastpathT) DecSliceUint64X(vp *[]uint64, checkNil bool, d *Decoder) { - v, changed := f.DecSliceUint64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecSliceUint64V(v []uint64, checkNil bool, canChange bool, d *Decoder) (_ []uint64, changed bool) { - dd := d.d - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - 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 - } - - if containerLenS > 0 { - x2read := containerLenS - var xtrunc bool - if containerLenS > cap(v) { - if canChange { - var xlen int - xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 8) - if xtrunc { - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]uint64, xlen) - } - } else { - v = make([]uint64, xlen) - } - changed = true - } else { - d.arrayCannotExpand(len(v), containerLenS) - } - x2read = len(v) - } else if containerLenS != len(v) { - if canChange { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; j < x2read; j++ { - slh.ElemContainerState(j) - v[j] = dd.DecodeUint(64) - } - if xtrunc { - for ; j < containerLenS; j++ { - v = append(v, 0) - slh.ElemContainerState(j) - v[j] = dd.DecodeUint(64) - } - } else if !canChange { - for ; j < containerLenS; j++ { - slh.ElemContainerState(j) - d.swallow() - } - } - } else { - breakFound := dd.CheckBreak() - if breakFound { - if canChange { - if v == nil { - v = []uint64{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - if cap(v) == 0 { - v = make([]uint64, 1, 4) - changed = true - } - j := 0 - for ; !breakFound; j++ { - if j >= len(v) { - if canChange { - v = append(v, 0) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - } - } - slh.ElemContainerState(j) - if j < len(v) { - v[j] = dd.DecodeUint(64) - } else { - d.swallow() - } - breakFound = dd.CheckBreak() - } - if canChange && j < len(v) { - v = v[:j] - changed = true - } - } - slh.End() - return v, changed -} - -func (f *decFnInfo) fastpathDecSliceUintptrR(rv reflect.Value) { - array := f.seq == seqTypeArray - if !array && rv.CanAddr() { - vp := rv.Addr().Interface().(*[]uintptr) - v, changed := fastpathTV.DecSliceUintptrV(*vp, fastpathCheckNilFalse, !array, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().([]uintptr) - fastpathTV.DecSliceUintptrV(v, fastpathCheckNilFalse, false, f.d) - } -} - -func (f fastpathT) DecSliceUintptrX(vp *[]uintptr, checkNil bool, d *Decoder) { - v, changed := f.DecSliceUintptrV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecSliceUintptrV(v []uintptr, checkNil bool, canChange bool, d *Decoder) (_ []uintptr, changed bool) { - dd := d.d - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - slh, containerLenS := d.decSliceHelperStart() - 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 - } - - if containerLenS > 0 { - x2read := containerLenS - var xtrunc bool - if containerLenS > cap(v) { - if canChange { - var xlen int - xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 8) - if xtrunc { - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]uintptr, xlen) - } - } else { - v = make([]uintptr, xlen) - } - changed = true - } else { - d.arrayCannotExpand(len(v), containerLenS) - } - x2read = len(v) - } else if containerLenS != len(v) { - if canChange { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; j < x2read; j++ { - slh.ElemContainerState(j) - v[j] = uintptr(dd.DecodeUint(uintBitsize)) - } - if xtrunc { - for ; j < containerLenS; j++ { - v = append(v, 0) - slh.ElemContainerState(j) - v[j] = uintptr(dd.DecodeUint(uintBitsize)) - } - } else if !canChange { - for ; j < containerLenS; j++ { - slh.ElemContainerState(j) - d.swallow() - } - } - } else { - breakFound := dd.CheckBreak() - if breakFound { - if canChange { - if v == nil { - v = []uintptr{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - if cap(v) == 0 { - v = make([]uintptr, 1, 4) - changed = true - } - j := 0 - for ; !breakFound; j++ { - if j >= len(v) { - if canChange { - v = append(v, 0) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - } - } - slh.ElemContainerState(j) - if j < len(v) { - v[j] = uintptr(dd.DecodeUint(uintBitsize)) - } else { - d.swallow() - } - breakFound = dd.CheckBreak() - } - if canChange && j < len(v) { - v = v[:j] - changed = true - } - } - slh.End() - return v, changed -} - -func (f *decFnInfo) fastpathDecSliceIntR(rv reflect.Value) { - array := f.seq == seqTypeArray - if !array && rv.CanAddr() { - vp := rv.Addr().Interface().(*[]int) - v, changed := fastpathTV.DecSliceIntV(*vp, fastpathCheckNilFalse, !array, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().([]int) - fastpathTV.DecSliceIntV(v, fastpathCheckNilFalse, false, f.d) - } -} - -func (f fastpathT) DecSliceIntX(vp *[]int, checkNil bool, d *Decoder) { - v, changed := f.DecSliceIntV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecSliceIntV(v []int, checkNil bool, canChange bool, d *Decoder) (_ []int, changed bool) { - dd := d.d - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - 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 - } - - if containerLenS > 0 { - x2read := containerLenS - var xtrunc bool - if containerLenS > cap(v) { - if canChange { - var xlen int - xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 8) - if xtrunc { - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]int, xlen) - } - } else { - v = make([]int, xlen) - } - changed = true - } else { - d.arrayCannotExpand(len(v), containerLenS) - } - x2read = len(v) - } else if containerLenS != len(v) { - if canChange { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; j < x2read; j++ { - slh.ElemContainerState(j) - v[j] = int(dd.DecodeInt(intBitsize)) - } - if xtrunc { - for ; j < containerLenS; j++ { - v = append(v, 0) - slh.ElemContainerState(j) - v[j] = int(dd.DecodeInt(intBitsize)) - } - } else if !canChange { - for ; j < containerLenS; j++ { - slh.ElemContainerState(j) - d.swallow() - } - } - } else { - breakFound := dd.CheckBreak() - if breakFound { - if canChange { - if v == nil { - v = []int{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - if cap(v) == 0 { - v = make([]int, 1, 4) - changed = true - } - j := 0 - for ; !breakFound; j++ { - if j >= len(v) { - if canChange { - v = append(v, 0) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - } - } - slh.ElemContainerState(j) - if j < len(v) { - v[j] = int(dd.DecodeInt(intBitsize)) - } else { - d.swallow() - } - breakFound = dd.CheckBreak() - } - if canChange && j < len(v) { - v = v[:j] - changed = true - } - } - slh.End() - return v, changed -} - -func (f *decFnInfo) fastpathDecSliceInt8R(rv reflect.Value) { - array := f.seq == seqTypeArray - if !array && rv.CanAddr() { - vp := rv.Addr().Interface().(*[]int8) - v, changed := fastpathTV.DecSliceInt8V(*vp, fastpathCheckNilFalse, !array, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().([]int8) - fastpathTV.DecSliceInt8V(v, fastpathCheckNilFalse, false, f.d) - } -} - -func (f fastpathT) DecSliceInt8X(vp *[]int8, checkNil bool, d *Decoder) { - v, changed := f.DecSliceInt8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecSliceInt8V(v []int8, checkNil bool, canChange bool, d *Decoder) (_ []int8, changed bool) { - dd := d.d - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - 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 - } - - if containerLenS > 0 { - x2read := containerLenS - var xtrunc bool - if containerLenS > cap(v) { - if canChange { - var xlen int - xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 1) - if xtrunc { - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]int8, xlen) - } - } else { - v = make([]int8, xlen) - } - changed = true - } else { - d.arrayCannotExpand(len(v), containerLenS) - } - x2read = len(v) - } else if containerLenS != len(v) { - if canChange { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; j < x2read; j++ { - slh.ElemContainerState(j) - v[j] = int8(dd.DecodeInt(8)) - } - if xtrunc { - for ; j < containerLenS; j++ { - v = append(v, 0) - slh.ElemContainerState(j) - v[j] = int8(dd.DecodeInt(8)) - } - } else if !canChange { - for ; j < containerLenS; j++ { - slh.ElemContainerState(j) - d.swallow() - } - } - } else { - breakFound := dd.CheckBreak() - if breakFound { - if canChange { - if v == nil { - v = []int8{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - if cap(v) == 0 { - v = make([]int8, 1, 4) - changed = true - } - j := 0 - for ; !breakFound; j++ { - if j >= len(v) { - if canChange { - v = append(v, 0) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - } - } - slh.ElemContainerState(j) - if j < len(v) { - v[j] = int8(dd.DecodeInt(8)) - } else { - d.swallow() - } - breakFound = dd.CheckBreak() - } - if canChange && j < len(v) { - v = v[:j] - changed = true - } - } - slh.End() - return v, changed -} - -func (f *decFnInfo) fastpathDecSliceInt16R(rv reflect.Value) { - array := f.seq == seqTypeArray - if !array && rv.CanAddr() { - vp := rv.Addr().Interface().(*[]int16) - v, changed := fastpathTV.DecSliceInt16V(*vp, fastpathCheckNilFalse, !array, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().([]int16) - fastpathTV.DecSliceInt16V(v, fastpathCheckNilFalse, false, f.d) - } -} - -func (f fastpathT) DecSliceInt16X(vp *[]int16, checkNil bool, d *Decoder) { - v, changed := f.DecSliceInt16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecSliceInt16V(v []int16, checkNil bool, canChange bool, d *Decoder) (_ []int16, changed bool) { - dd := d.d - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - 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 - } - - if containerLenS > 0 { - x2read := containerLenS - var xtrunc bool - if containerLenS > cap(v) { - if canChange { - var xlen int - xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 2) - if xtrunc { - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]int16, xlen) - } - } else { - v = make([]int16, xlen) - } - changed = true - } else { - d.arrayCannotExpand(len(v), containerLenS) - } - x2read = len(v) - } else if containerLenS != len(v) { - if canChange { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; j < x2read; j++ { - slh.ElemContainerState(j) - v[j] = int16(dd.DecodeInt(16)) - } - if xtrunc { - for ; j < containerLenS; j++ { - v = append(v, 0) - slh.ElemContainerState(j) - v[j] = int16(dd.DecodeInt(16)) - } - } else if !canChange { - for ; j < containerLenS; j++ { - slh.ElemContainerState(j) - d.swallow() - } - } - } else { - breakFound := dd.CheckBreak() - if breakFound { - if canChange { - if v == nil { - v = []int16{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - if cap(v) == 0 { - v = make([]int16, 1, 4) - changed = true - } - j := 0 - for ; !breakFound; j++ { - if j >= len(v) { - if canChange { - v = append(v, 0) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - } - } - slh.ElemContainerState(j) - if j < len(v) { - v[j] = int16(dd.DecodeInt(16)) - } else { - d.swallow() - } - breakFound = dd.CheckBreak() - } - if canChange && j < len(v) { - v = v[:j] - changed = true - } - } - slh.End() - return v, changed -} - -func (f *decFnInfo) fastpathDecSliceInt32R(rv reflect.Value) { - array := f.seq == seqTypeArray - if !array && rv.CanAddr() { - vp := rv.Addr().Interface().(*[]int32) - v, changed := fastpathTV.DecSliceInt32V(*vp, fastpathCheckNilFalse, !array, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().([]int32) - fastpathTV.DecSliceInt32V(v, fastpathCheckNilFalse, false, f.d) - } -} - -func (f fastpathT) DecSliceInt32X(vp *[]int32, checkNil bool, d *Decoder) { - v, changed := f.DecSliceInt32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecSliceInt32V(v []int32, checkNil bool, canChange bool, d *Decoder) (_ []int32, changed bool) { - dd := d.d - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - 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 - } - - if containerLenS > 0 { - x2read := containerLenS - var xtrunc bool - if containerLenS > cap(v) { - if canChange { - var xlen int - xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 4) - if xtrunc { - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]int32, xlen) - } - } else { - v = make([]int32, xlen) - } - changed = true - } else { - d.arrayCannotExpand(len(v), containerLenS) - } - x2read = len(v) - } else if containerLenS != len(v) { - if canChange { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; j < x2read; j++ { - slh.ElemContainerState(j) - v[j] = int32(dd.DecodeInt(32)) - } - if xtrunc { - for ; j < containerLenS; j++ { - v = append(v, 0) - slh.ElemContainerState(j) - v[j] = int32(dd.DecodeInt(32)) - } - } else if !canChange { - for ; j < containerLenS; j++ { - slh.ElemContainerState(j) - d.swallow() - } - } - } else { - breakFound := dd.CheckBreak() - if breakFound { - if canChange { - if v == nil { - v = []int32{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - if cap(v) == 0 { - v = make([]int32, 1, 4) - changed = true - } - j := 0 - for ; !breakFound; j++ { - if j >= len(v) { - if canChange { - v = append(v, 0) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - } - } - slh.ElemContainerState(j) - if j < len(v) { - v[j] = int32(dd.DecodeInt(32)) - } else { - d.swallow() - } - breakFound = dd.CheckBreak() - } - if canChange && j < len(v) { - v = v[:j] - changed = true - } - } - slh.End() - return v, changed -} - -func (f *decFnInfo) fastpathDecSliceInt64R(rv reflect.Value) { - array := f.seq == seqTypeArray - if !array && rv.CanAddr() { - vp := rv.Addr().Interface().(*[]int64) - v, changed := fastpathTV.DecSliceInt64V(*vp, fastpathCheckNilFalse, !array, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().([]int64) - fastpathTV.DecSliceInt64V(v, fastpathCheckNilFalse, false, f.d) - } -} - -func (f fastpathT) DecSliceInt64X(vp *[]int64, checkNil bool, d *Decoder) { - v, changed := f.DecSliceInt64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecSliceInt64V(v []int64, checkNil bool, canChange bool, d *Decoder) (_ []int64, changed bool) { - dd := d.d - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - 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 - } - - if containerLenS > 0 { - x2read := containerLenS - var xtrunc bool - if containerLenS > cap(v) { - if canChange { - var xlen int - xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 8) - if xtrunc { - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]int64, xlen) - } - } else { - v = make([]int64, xlen) - } - changed = true - } else { - d.arrayCannotExpand(len(v), containerLenS) - } - x2read = len(v) - } else if containerLenS != len(v) { - if canChange { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; j < x2read; j++ { - slh.ElemContainerState(j) - v[j] = dd.DecodeInt(64) - } - if xtrunc { - for ; j < containerLenS; j++ { - v = append(v, 0) - slh.ElemContainerState(j) - v[j] = dd.DecodeInt(64) - } - } else if !canChange { - for ; j < containerLenS; j++ { - slh.ElemContainerState(j) - d.swallow() - } - } - } else { - breakFound := dd.CheckBreak() - if breakFound { - if canChange { - if v == nil { - v = []int64{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - if cap(v) == 0 { - v = make([]int64, 1, 4) - changed = true - } - j := 0 - for ; !breakFound; j++ { - if j >= len(v) { - if canChange { - v = append(v, 0) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - } - } - slh.ElemContainerState(j) - if j < len(v) { - v[j] = dd.DecodeInt(64) - } else { - d.swallow() - } - breakFound = dd.CheckBreak() - } - if canChange && j < len(v) { - v = v[:j] - changed = true - } - } - slh.End() - return v, changed -} - -func (f *decFnInfo) fastpathDecSliceBoolR(rv reflect.Value) { - array := f.seq == seqTypeArray - if !array && rv.CanAddr() { - vp := rv.Addr().Interface().(*[]bool) - v, changed := fastpathTV.DecSliceBoolV(*vp, fastpathCheckNilFalse, !array, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().([]bool) - fastpathTV.DecSliceBoolV(v, fastpathCheckNilFalse, false, f.d) - } -} - -func (f fastpathT) DecSliceBoolX(vp *[]bool, checkNil bool, d *Decoder) { - v, changed := f.DecSliceBoolV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecSliceBoolV(v []bool, checkNil bool, canChange bool, d *Decoder) (_ []bool, changed bool) { - dd := d.d - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - 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 - } - - if containerLenS > 0 { - x2read := containerLenS - var xtrunc bool - if containerLenS > cap(v) { - if canChange { - var xlen int - xlen, xtrunc = decInferLen(containerLenS, d.h.MaxInitLen, 1) - if xtrunc { - if xlen <= cap(v) { - v = v[:xlen] - } else { - v = make([]bool, xlen) - } - } else { - v = make([]bool, xlen) - } - changed = true - } else { - d.arrayCannotExpand(len(v), containerLenS) - } - x2read = len(v) - } else if containerLenS != len(v) { - if canChange { - v = v[:containerLenS] - changed = true - } - } - j := 0 - for ; j < x2read; j++ { - slh.ElemContainerState(j) - v[j] = dd.DecodeBool() - } - if xtrunc { - for ; j < containerLenS; j++ { - v = append(v, false) - slh.ElemContainerState(j) - v[j] = dd.DecodeBool() - } - } else if !canChange { - for ; j < containerLenS; j++ { - slh.ElemContainerState(j) - d.swallow() - } - } - } else { - breakFound := dd.CheckBreak() - if breakFound { - if canChange { - if v == nil { - v = []bool{} - } else if len(v) != 0 { - v = v[:0] - } - changed = true - } - slh.End() - return v, changed - } - if cap(v) == 0 { - v = make([]bool, 1, 4) - changed = true - } - j := 0 - for ; !breakFound; j++ { - if j >= len(v) { - if canChange { - v = append(v, false) - changed = true - } else { - d.arrayCannotExpand(len(v), j+1) - } - } - slh.ElemContainerState(j) - if j < len(v) { - v[j] = dd.DecodeBool() - } else { - d.swallow() - } - breakFound = dd.CheckBreak() - } - if canChange && j < len(v) { - v = v[:j] - changed = true - } - } - slh.End() - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntfIntfR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[interface{}]interface{}) - v, changed := fastpathTV.DecMapIntfIntfV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[interface{}]interface{}) - fastpathTV.DecMapIntfIntfV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntfIntfX(vp *map[interface{}]interface{}, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntfIntfV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfIntfV(v map[interface{}]interface{}, checkNil bool, canChange bool, - d *Decoder) (_ map[interface{}]interface{}, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 32) - v = make(map[interface{}]interface{}, xlen) - changed = true - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk interface{} - var mv interface{} - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntfStringR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[interface{}]string) - v, changed := fastpathTV.DecMapIntfStringV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[interface{}]string) - fastpathTV.DecMapIntfStringV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntfStringX(vp *map[interface{}]string, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntfStringV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfStringV(v map[interface{}]string, checkNil bool, canChange bool, - d *Decoder) (_ map[interface{}]string, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 32) - v = make(map[interface{}]string, xlen) - changed = true - } - - var mk interface{} - var mv string - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntfUintR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[interface{}]uint) - v, changed := fastpathTV.DecMapIntfUintV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[interface{}]uint) - fastpathTV.DecMapIntfUintV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntfUintX(vp *map[interface{}]uint, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntfUintV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfUintV(v map[interface{}]uint, checkNil bool, canChange bool, - d *Decoder) (_ map[interface{}]uint, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[interface{}]uint, xlen) - changed = true - } - - var mk interface{} - var mv uint - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntfUint8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[interface{}]uint8) - v, changed := fastpathTV.DecMapIntfUint8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[interface{}]uint8) - fastpathTV.DecMapIntfUint8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntfUint8X(vp *map[interface{}]uint8, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntfUint8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfUint8V(v map[interface{}]uint8, checkNil bool, canChange bool, - d *Decoder) (_ map[interface{}]uint8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17) - v = make(map[interface{}]uint8, xlen) - changed = true - } - - var mk interface{} - var mv uint8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntfUint16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[interface{}]uint16) - v, changed := fastpathTV.DecMapIntfUint16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[interface{}]uint16) - fastpathTV.DecMapIntfUint16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntfUint16X(vp *map[interface{}]uint16, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntfUint16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfUint16V(v map[interface{}]uint16, checkNil bool, canChange bool, - d *Decoder) (_ map[interface{}]uint16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 18) - v = make(map[interface{}]uint16, xlen) - changed = true - } - - var mk interface{} - var mv uint16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntfUint32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[interface{}]uint32) - v, changed := fastpathTV.DecMapIntfUint32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[interface{}]uint32) - fastpathTV.DecMapIntfUint32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntfUint32X(vp *map[interface{}]uint32, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntfUint32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfUint32V(v map[interface{}]uint32, checkNil bool, canChange bool, - d *Decoder) (_ map[interface{}]uint32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20) - v = make(map[interface{}]uint32, xlen) - changed = true - } - - var mk interface{} - var mv uint32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntfUint64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[interface{}]uint64) - v, changed := fastpathTV.DecMapIntfUint64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[interface{}]uint64) - fastpathTV.DecMapIntfUint64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntfUint64X(vp *map[interface{}]uint64, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntfUint64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfUint64V(v map[interface{}]uint64, checkNil bool, canChange bool, - d *Decoder) (_ map[interface{}]uint64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[interface{}]uint64, xlen) - changed = true - } - - var mk interface{} - var mv uint64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntfUintptrR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[interface{}]uintptr) - v, changed := fastpathTV.DecMapIntfUintptrV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[interface{}]uintptr) - fastpathTV.DecMapIntfUintptrV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntfUintptrX(vp *map[interface{}]uintptr, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntfUintptrV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfUintptrV(v map[interface{}]uintptr, checkNil bool, canChange bool, - d *Decoder) (_ map[interface{}]uintptr, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[interface{}]uintptr, xlen) - changed = true - } - - var mk interface{} - var mv uintptr - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntfIntR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[interface{}]int) - v, changed := fastpathTV.DecMapIntfIntV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[interface{}]int) - fastpathTV.DecMapIntfIntV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntfIntX(vp *map[interface{}]int, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntfIntV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfIntV(v map[interface{}]int, checkNil bool, canChange bool, - d *Decoder) (_ map[interface{}]int, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[interface{}]int, xlen) - changed = true - } - - var mk interface{} - var mv int - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntfInt8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[interface{}]int8) - v, changed := fastpathTV.DecMapIntfInt8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[interface{}]int8) - fastpathTV.DecMapIntfInt8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntfInt8X(vp *map[interface{}]int8, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntfInt8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfInt8V(v map[interface{}]int8, checkNil bool, canChange bool, - d *Decoder) (_ map[interface{}]int8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17) - v = make(map[interface{}]int8, xlen) - changed = true - } - - var mk interface{} - var mv int8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntfInt16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[interface{}]int16) - v, changed := fastpathTV.DecMapIntfInt16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[interface{}]int16) - fastpathTV.DecMapIntfInt16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntfInt16X(vp *map[interface{}]int16, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntfInt16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfInt16V(v map[interface{}]int16, checkNil bool, canChange bool, - d *Decoder) (_ map[interface{}]int16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 18) - v = make(map[interface{}]int16, xlen) - changed = true - } - - var mk interface{} - var mv int16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntfInt32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[interface{}]int32) - v, changed := fastpathTV.DecMapIntfInt32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[interface{}]int32) - fastpathTV.DecMapIntfInt32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntfInt32X(vp *map[interface{}]int32, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntfInt32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfInt32V(v map[interface{}]int32, checkNil bool, canChange bool, - d *Decoder) (_ map[interface{}]int32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20) - v = make(map[interface{}]int32, xlen) - changed = true - } - - var mk interface{} - var mv int32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntfInt64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[interface{}]int64) - v, changed := fastpathTV.DecMapIntfInt64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[interface{}]int64) - fastpathTV.DecMapIntfInt64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntfInt64X(vp *map[interface{}]int64, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntfInt64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfInt64V(v map[interface{}]int64, checkNil bool, canChange bool, - d *Decoder) (_ map[interface{}]int64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[interface{}]int64, xlen) - changed = true - } - - var mk interface{} - var mv int64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntfFloat32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[interface{}]float32) - v, changed := fastpathTV.DecMapIntfFloat32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[interface{}]float32) - fastpathTV.DecMapIntfFloat32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntfFloat32X(vp *map[interface{}]float32, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntfFloat32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfFloat32V(v map[interface{}]float32, checkNil bool, canChange bool, - d *Decoder) (_ map[interface{}]float32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20) - v = make(map[interface{}]float32, xlen) - changed = true - } - - var mk interface{} - var mv float32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntfFloat64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[interface{}]float64) - v, changed := fastpathTV.DecMapIntfFloat64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[interface{}]float64) - fastpathTV.DecMapIntfFloat64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntfFloat64X(vp *map[interface{}]float64, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntfFloat64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfFloat64V(v map[interface{}]float64, checkNil bool, canChange bool, - d *Decoder) (_ map[interface{}]float64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[interface{}]float64, xlen) - changed = true - } - - var mk interface{} - var mv float64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntfBoolR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[interface{}]bool) - v, changed := fastpathTV.DecMapIntfBoolV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[interface{}]bool) - fastpathTV.DecMapIntfBoolV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntfBoolX(vp *map[interface{}]bool, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntfBoolV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntfBoolV(v map[interface{}]bool, checkNil bool, canChange bool, - d *Decoder) (_ map[interface{}]bool, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17) - v = make(map[interface{}]bool, xlen) - changed = true - } - - var mk interface{} - var mv bool - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = nil - d.decode(&mk) - if bv, bok := mk.([]byte); bok { - mk = d.string(bv) - } - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapStringIntfR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[string]interface{}) - v, changed := fastpathTV.DecMapStringIntfV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[string]interface{}) - fastpathTV.DecMapStringIntfV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapStringIntfX(vp *map[string]interface{}, checkNil bool, d *Decoder) { - v, changed := f.DecMapStringIntfV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringIntfV(v map[string]interface{}, checkNil bool, canChange bool, - d *Decoder) (_ map[string]interface{}, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 32) - v = make(map[string]interface{}, xlen) - changed = true - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk string - var mv interface{} - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapStringStringR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[string]string) - v, changed := fastpathTV.DecMapStringStringV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[string]string) - fastpathTV.DecMapStringStringV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapStringStringX(vp *map[string]string, checkNil bool, d *Decoder) { - v, changed := f.DecMapStringStringV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringStringV(v map[string]string, checkNil bool, canChange bool, - d *Decoder) (_ map[string]string, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 32) - v = make(map[string]string, xlen) - changed = true - } - - var mk string - var mv string - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapStringUintR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[string]uint) - v, changed := fastpathTV.DecMapStringUintV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[string]uint) - fastpathTV.DecMapStringUintV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapStringUintX(vp *map[string]uint, checkNil bool, d *Decoder) { - v, changed := f.DecMapStringUintV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringUintV(v map[string]uint, checkNil bool, canChange bool, - d *Decoder) (_ map[string]uint, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[string]uint, xlen) - changed = true - } - - var mk string - var mv uint - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapStringUint8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[string]uint8) - v, changed := fastpathTV.DecMapStringUint8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[string]uint8) - fastpathTV.DecMapStringUint8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapStringUint8X(vp *map[string]uint8, checkNil bool, d *Decoder) { - v, changed := f.DecMapStringUint8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringUint8V(v map[string]uint8, checkNil bool, canChange bool, - d *Decoder) (_ map[string]uint8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17) - v = make(map[string]uint8, xlen) - changed = true - } - - var mk string - var mv uint8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapStringUint16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[string]uint16) - v, changed := fastpathTV.DecMapStringUint16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[string]uint16) - fastpathTV.DecMapStringUint16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapStringUint16X(vp *map[string]uint16, checkNil bool, d *Decoder) { - v, changed := f.DecMapStringUint16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringUint16V(v map[string]uint16, checkNil bool, canChange bool, - d *Decoder) (_ map[string]uint16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 18) - v = make(map[string]uint16, xlen) - changed = true - } - - var mk string - var mv uint16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapStringUint32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[string]uint32) - v, changed := fastpathTV.DecMapStringUint32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[string]uint32) - fastpathTV.DecMapStringUint32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapStringUint32X(vp *map[string]uint32, checkNil bool, d *Decoder) { - v, changed := f.DecMapStringUint32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringUint32V(v map[string]uint32, checkNil bool, canChange bool, - d *Decoder) (_ map[string]uint32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20) - v = make(map[string]uint32, xlen) - changed = true - } - - var mk string - var mv uint32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapStringUint64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[string]uint64) - v, changed := fastpathTV.DecMapStringUint64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[string]uint64) - fastpathTV.DecMapStringUint64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapStringUint64X(vp *map[string]uint64, checkNil bool, d *Decoder) { - v, changed := f.DecMapStringUint64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringUint64V(v map[string]uint64, checkNil bool, canChange bool, - d *Decoder) (_ map[string]uint64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[string]uint64, xlen) - changed = true - } - - var mk string - var mv uint64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapStringUintptrR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[string]uintptr) - v, changed := fastpathTV.DecMapStringUintptrV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[string]uintptr) - fastpathTV.DecMapStringUintptrV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapStringUintptrX(vp *map[string]uintptr, checkNil bool, d *Decoder) { - v, changed := f.DecMapStringUintptrV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringUintptrV(v map[string]uintptr, checkNil bool, canChange bool, - d *Decoder) (_ map[string]uintptr, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[string]uintptr, xlen) - changed = true - } - - var mk string - var mv uintptr - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapStringIntR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[string]int) - v, changed := fastpathTV.DecMapStringIntV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[string]int) - fastpathTV.DecMapStringIntV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapStringIntX(vp *map[string]int, checkNil bool, d *Decoder) { - v, changed := f.DecMapStringIntV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringIntV(v map[string]int, checkNil bool, canChange bool, - d *Decoder) (_ map[string]int, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[string]int, xlen) - changed = true - } - - var mk string - var mv int - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapStringInt8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[string]int8) - v, changed := fastpathTV.DecMapStringInt8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[string]int8) - fastpathTV.DecMapStringInt8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapStringInt8X(vp *map[string]int8, checkNil bool, d *Decoder) { - v, changed := f.DecMapStringInt8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringInt8V(v map[string]int8, checkNil bool, canChange bool, - d *Decoder) (_ map[string]int8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17) - v = make(map[string]int8, xlen) - changed = true - } - - var mk string - var mv int8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapStringInt16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[string]int16) - v, changed := fastpathTV.DecMapStringInt16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[string]int16) - fastpathTV.DecMapStringInt16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapStringInt16X(vp *map[string]int16, checkNil bool, d *Decoder) { - v, changed := f.DecMapStringInt16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringInt16V(v map[string]int16, checkNil bool, canChange bool, - d *Decoder) (_ map[string]int16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 18) - v = make(map[string]int16, xlen) - changed = true - } - - var mk string - var mv int16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapStringInt32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[string]int32) - v, changed := fastpathTV.DecMapStringInt32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[string]int32) - fastpathTV.DecMapStringInt32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapStringInt32X(vp *map[string]int32, checkNil bool, d *Decoder) { - v, changed := f.DecMapStringInt32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringInt32V(v map[string]int32, checkNil bool, canChange bool, - d *Decoder) (_ map[string]int32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20) - v = make(map[string]int32, xlen) - changed = true - } - - var mk string - var mv int32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapStringInt64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[string]int64) - v, changed := fastpathTV.DecMapStringInt64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[string]int64) - fastpathTV.DecMapStringInt64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapStringInt64X(vp *map[string]int64, checkNil bool, d *Decoder) { - v, changed := f.DecMapStringInt64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringInt64V(v map[string]int64, checkNil bool, canChange bool, - d *Decoder) (_ map[string]int64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[string]int64, xlen) - changed = true - } - - var mk string - var mv int64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapStringFloat32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[string]float32) - v, changed := fastpathTV.DecMapStringFloat32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[string]float32) - fastpathTV.DecMapStringFloat32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapStringFloat32X(vp *map[string]float32, checkNil bool, d *Decoder) { - v, changed := f.DecMapStringFloat32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringFloat32V(v map[string]float32, checkNil bool, canChange bool, - d *Decoder) (_ map[string]float32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20) - v = make(map[string]float32, xlen) - changed = true - } - - var mk string - var mv float32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapStringFloat64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[string]float64) - v, changed := fastpathTV.DecMapStringFloat64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[string]float64) - fastpathTV.DecMapStringFloat64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapStringFloat64X(vp *map[string]float64, checkNil bool, d *Decoder) { - v, changed := f.DecMapStringFloat64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringFloat64V(v map[string]float64, checkNil bool, canChange bool, - d *Decoder) (_ map[string]float64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[string]float64, xlen) - changed = true - } - - var mk string - var mv float64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapStringBoolR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[string]bool) - v, changed := fastpathTV.DecMapStringBoolV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[string]bool) - fastpathTV.DecMapStringBoolV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapStringBoolX(vp *map[string]bool, checkNil bool, d *Decoder) { - v, changed := f.DecMapStringBoolV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapStringBoolV(v map[string]bool, checkNil bool, canChange bool, - d *Decoder) (_ map[string]bool, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17) - v = make(map[string]bool, xlen) - changed = true - } - - var mk string - var mv bool - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeString() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat32IntfR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float32]interface{}) - v, changed := fastpathTV.DecMapFloat32IntfV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float32]interface{}) - fastpathTV.DecMapFloat32IntfV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat32IntfX(vp *map[float32]interface{}, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat32IntfV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32IntfV(v map[float32]interface{}, checkNil bool, canChange bool, - d *Decoder) (_ map[float32]interface{}, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20) - v = make(map[float32]interface{}, xlen) - changed = true - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk float32 - var mv interface{} - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat32StringR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float32]string) - v, changed := fastpathTV.DecMapFloat32StringV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float32]string) - fastpathTV.DecMapFloat32StringV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat32StringX(vp *map[float32]string, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat32StringV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32StringV(v map[float32]string, checkNil bool, canChange bool, - d *Decoder) (_ map[float32]string, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20) - v = make(map[float32]string, xlen) - changed = true - } - - var mk float32 - var mv string - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat32UintR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float32]uint) - v, changed := fastpathTV.DecMapFloat32UintV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float32]uint) - fastpathTV.DecMapFloat32UintV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat32UintX(vp *map[float32]uint, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat32UintV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32UintV(v map[float32]uint, checkNil bool, canChange bool, - d *Decoder) (_ map[float32]uint, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[float32]uint, xlen) - changed = true - } - - var mk float32 - var mv uint - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat32Uint8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float32]uint8) - v, changed := fastpathTV.DecMapFloat32Uint8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float32]uint8) - fastpathTV.DecMapFloat32Uint8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat32Uint8X(vp *map[float32]uint8, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat32Uint8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32Uint8V(v map[float32]uint8, checkNil bool, canChange bool, - d *Decoder) (_ map[float32]uint8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[float32]uint8, xlen) - changed = true - } - - var mk float32 - var mv uint8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat32Uint16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float32]uint16) - v, changed := fastpathTV.DecMapFloat32Uint16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float32]uint16) - fastpathTV.DecMapFloat32Uint16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat32Uint16X(vp *map[float32]uint16, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat32Uint16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32Uint16V(v map[float32]uint16, checkNil bool, canChange bool, - d *Decoder) (_ map[float32]uint16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6) - v = make(map[float32]uint16, xlen) - changed = true - } - - var mk float32 - var mv uint16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat32Uint32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float32]uint32) - v, changed := fastpathTV.DecMapFloat32Uint32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float32]uint32) - fastpathTV.DecMapFloat32Uint32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat32Uint32X(vp *map[float32]uint32, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat32Uint32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32Uint32V(v map[float32]uint32, checkNil bool, canChange bool, - d *Decoder) (_ map[float32]uint32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8) - v = make(map[float32]uint32, xlen) - changed = true - } - - var mk float32 - var mv uint32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat32Uint64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float32]uint64) - v, changed := fastpathTV.DecMapFloat32Uint64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float32]uint64) - fastpathTV.DecMapFloat32Uint64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat32Uint64X(vp *map[float32]uint64, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat32Uint64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32Uint64V(v map[float32]uint64, checkNil bool, canChange bool, - d *Decoder) (_ map[float32]uint64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[float32]uint64, xlen) - changed = true - } - - var mk float32 - var mv uint64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat32UintptrR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float32]uintptr) - v, changed := fastpathTV.DecMapFloat32UintptrV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float32]uintptr) - fastpathTV.DecMapFloat32UintptrV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat32UintptrX(vp *map[float32]uintptr, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat32UintptrV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32UintptrV(v map[float32]uintptr, checkNil bool, canChange bool, - d *Decoder) (_ map[float32]uintptr, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[float32]uintptr, xlen) - changed = true - } - - var mk float32 - var mv uintptr - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat32IntR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float32]int) - v, changed := fastpathTV.DecMapFloat32IntV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float32]int) - fastpathTV.DecMapFloat32IntV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat32IntX(vp *map[float32]int, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat32IntV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32IntV(v map[float32]int, checkNil bool, canChange bool, - d *Decoder) (_ map[float32]int, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[float32]int, xlen) - changed = true - } - - var mk float32 - var mv int - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat32Int8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float32]int8) - v, changed := fastpathTV.DecMapFloat32Int8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float32]int8) - fastpathTV.DecMapFloat32Int8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat32Int8X(vp *map[float32]int8, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat32Int8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32Int8V(v map[float32]int8, checkNil bool, canChange bool, - d *Decoder) (_ map[float32]int8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[float32]int8, xlen) - changed = true - } - - var mk float32 - var mv int8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat32Int16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float32]int16) - v, changed := fastpathTV.DecMapFloat32Int16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float32]int16) - fastpathTV.DecMapFloat32Int16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat32Int16X(vp *map[float32]int16, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat32Int16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32Int16V(v map[float32]int16, checkNil bool, canChange bool, - d *Decoder) (_ map[float32]int16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6) - v = make(map[float32]int16, xlen) - changed = true - } - - var mk float32 - var mv int16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat32Int32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float32]int32) - v, changed := fastpathTV.DecMapFloat32Int32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float32]int32) - fastpathTV.DecMapFloat32Int32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat32Int32X(vp *map[float32]int32, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat32Int32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32Int32V(v map[float32]int32, checkNil bool, canChange bool, - d *Decoder) (_ map[float32]int32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8) - v = make(map[float32]int32, xlen) - changed = true - } - - var mk float32 - var mv int32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat32Int64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float32]int64) - v, changed := fastpathTV.DecMapFloat32Int64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float32]int64) - fastpathTV.DecMapFloat32Int64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat32Int64X(vp *map[float32]int64, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat32Int64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32Int64V(v map[float32]int64, checkNil bool, canChange bool, - d *Decoder) (_ map[float32]int64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[float32]int64, xlen) - changed = true - } - - var mk float32 - var mv int64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat32Float32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float32]float32) - v, changed := fastpathTV.DecMapFloat32Float32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float32]float32) - fastpathTV.DecMapFloat32Float32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat32Float32X(vp *map[float32]float32, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat32Float32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32Float32V(v map[float32]float32, checkNil bool, canChange bool, - d *Decoder) (_ map[float32]float32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8) - v = make(map[float32]float32, xlen) - changed = true - } - - var mk float32 - var mv float32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat32Float64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float32]float64) - v, changed := fastpathTV.DecMapFloat32Float64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float32]float64) - fastpathTV.DecMapFloat32Float64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat32Float64X(vp *map[float32]float64, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat32Float64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32Float64V(v map[float32]float64, checkNil bool, canChange bool, - d *Decoder) (_ map[float32]float64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[float32]float64, xlen) - changed = true - } - - var mk float32 - var mv float64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat32BoolR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float32]bool) - v, changed := fastpathTV.DecMapFloat32BoolV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float32]bool) - fastpathTV.DecMapFloat32BoolV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat32BoolX(vp *map[float32]bool, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat32BoolV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat32BoolV(v map[float32]bool, checkNil bool, canChange bool, - d *Decoder) (_ map[float32]bool, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[float32]bool, xlen) - changed = true - } - - var mk float32 - var mv bool - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = float32(dd.DecodeFloat(true)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat64IntfR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float64]interface{}) - v, changed := fastpathTV.DecMapFloat64IntfV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float64]interface{}) - fastpathTV.DecMapFloat64IntfV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat64IntfX(vp *map[float64]interface{}, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat64IntfV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64IntfV(v map[float64]interface{}, checkNil bool, canChange bool, - d *Decoder) (_ map[float64]interface{}, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[float64]interface{}, xlen) - changed = true - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk float64 - var mv interface{} - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat64StringR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float64]string) - v, changed := fastpathTV.DecMapFloat64StringV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float64]string) - fastpathTV.DecMapFloat64StringV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat64StringX(vp *map[float64]string, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat64StringV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64StringV(v map[float64]string, checkNil bool, canChange bool, - d *Decoder) (_ map[float64]string, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[float64]string, xlen) - changed = true - } - - var mk float64 - var mv string - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat64UintR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float64]uint) - v, changed := fastpathTV.DecMapFloat64UintV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float64]uint) - fastpathTV.DecMapFloat64UintV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat64UintX(vp *map[float64]uint, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat64UintV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64UintV(v map[float64]uint, checkNil bool, canChange bool, - d *Decoder) (_ map[float64]uint, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[float64]uint, xlen) - changed = true - } - - var mk float64 - var mv uint - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat64Uint8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float64]uint8) - v, changed := fastpathTV.DecMapFloat64Uint8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float64]uint8) - fastpathTV.DecMapFloat64Uint8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat64Uint8X(vp *map[float64]uint8, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat64Uint8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64Uint8V(v map[float64]uint8, checkNil bool, canChange bool, - d *Decoder) (_ map[float64]uint8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[float64]uint8, xlen) - changed = true - } - - var mk float64 - var mv uint8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat64Uint16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float64]uint16) - v, changed := fastpathTV.DecMapFloat64Uint16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float64]uint16) - fastpathTV.DecMapFloat64Uint16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat64Uint16X(vp *map[float64]uint16, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat64Uint16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64Uint16V(v map[float64]uint16, checkNil bool, canChange bool, - d *Decoder) (_ map[float64]uint16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[float64]uint16, xlen) - changed = true - } - - var mk float64 - var mv uint16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat64Uint32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float64]uint32) - v, changed := fastpathTV.DecMapFloat64Uint32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float64]uint32) - fastpathTV.DecMapFloat64Uint32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat64Uint32X(vp *map[float64]uint32, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat64Uint32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64Uint32V(v map[float64]uint32, checkNil bool, canChange bool, - d *Decoder) (_ map[float64]uint32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[float64]uint32, xlen) - changed = true - } - - var mk float64 - var mv uint32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat64Uint64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float64]uint64) - v, changed := fastpathTV.DecMapFloat64Uint64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float64]uint64) - fastpathTV.DecMapFloat64Uint64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat64Uint64X(vp *map[float64]uint64, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat64Uint64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64Uint64V(v map[float64]uint64, checkNil bool, canChange bool, - d *Decoder) (_ map[float64]uint64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[float64]uint64, xlen) - changed = true - } - - var mk float64 - var mv uint64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat64UintptrR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float64]uintptr) - v, changed := fastpathTV.DecMapFloat64UintptrV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float64]uintptr) - fastpathTV.DecMapFloat64UintptrV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat64UintptrX(vp *map[float64]uintptr, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat64UintptrV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64UintptrV(v map[float64]uintptr, checkNil bool, canChange bool, - d *Decoder) (_ map[float64]uintptr, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[float64]uintptr, xlen) - changed = true - } - - var mk float64 - var mv uintptr - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat64IntR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float64]int) - v, changed := fastpathTV.DecMapFloat64IntV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float64]int) - fastpathTV.DecMapFloat64IntV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat64IntX(vp *map[float64]int, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat64IntV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64IntV(v map[float64]int, checkNil bool, canChange bool, - d *Decoder) (_ map[float64]int, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[float64]int, xlen) - changed = true - } - - var mk float64 - var mv int - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat64Int8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float64]int8) - v, changed := fastpathTV.DecMapFloat64Int8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float64]int8) - fastpathTV.DecMapFloat64Int8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat64Int8X(vp *map[float64]int8, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat64Int8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64Int8V(v map[float64]int8, checkNil bool, canChange bool, - d *Decoder) (_ map[float64]int8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[float64]int8, xlen) - changed = true - } - - var mk float64 - var mv int8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat64Int16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float64]int16) - v, changed := fastpathTV.DecMapFloat64Int16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float64]int16) - fastpathTV.DecMapFloat64Int16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat64Int16X(vp *map[float64]int16, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat64Int16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64Int16V(v map[float64]int16, checkNil bool, canChange bool, - d *Decoder) (_ map[float64]int16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[float64]int16, xlen) - changed = true - } - - var mk float64 - var mv int16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat64Int32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float64]int32) - v, changed := fastpathTV.DecMapFloat64Int32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float64]int32) - fastpathTV.DecMapFloat64Int32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat64Int32X(vp *map[float64]int32, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat64Int32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64Int32V(v map[float64]int32, checkNil bool, canChange bool, - d *Decoder) (_ map[float64]int32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[float64]int32, xlen) - changed = true - } - - var mk float64 - var mv int32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat64Int64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float64]int64) - v, changed := fastpathTV.DecMapFloat64Int64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float64]int64) - fastpathTV.DecMapFloat64Int64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat64Int64X(vp *map[float64]int64, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat64Int64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64Int64V(v map[float64]int64, checkNil bool, canChange bool, - d *Decoder) (_ map[float64]int64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[float64]int64, xlen) - changed = true - } - - var mk float64 - var mv int64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat64Float32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float64]float32) - v, changed := fastpathTV.DecMapFloat64Float32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float64]float32) - fastpathTV.DecMapFloat64Float32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat64Float32X(vp *map[float64]float32, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat64Float32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64Float32V(v map[float64]float32, checkNil bool, canChange bool, - d *Decoder) (_ map[float64]float32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[float64]float32, xlen) - changed = true - } - - var mk float64 - var mv float32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat64Float64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float64]float64) - v, changed := fastpathTV.DecMapFloat64Float64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float64]float64) - fastpathTV.DecMapFloat64Float64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat64Float64X(vp *map[float64]float64, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat64Float64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64Float64V(v map[float64]float64, checkNil bool, canChange bool, - d *Decoder) (_ map[float64]float64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[float64]float64, xlen) - changed = true - } - - var mk float64 - var mv float64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapFloat64BoolR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[float64]bool) - v, changed := fastpathTV.DecMapFloat64BoolV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[float64]bool) - fastpathTV.DecMapFloat64BoolV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapFloat64BoolX(vp *map[float64]bool, checkNil bool, d *Decoder) { - v, changed := f.DecMapFloat64BoolV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapFloat64BoolV(v map[float64]bool, checkNil bool, canChange bool, - d *Decoder) (_ map[float64]bool, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[float64]bool, xlen) - changed = true - } - - var mk float64 - var mv bool - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeFloat(false) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintIntfR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint]interface{}) - v, changed := fastpathTV.DecMapUintIntfV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint]interface{}) - fastpathTV.DecMapUintIntfV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintIntfX(vp *map[uint]interface{}, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintIntfV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintIntfV(v map[uint]interface{}, checkNil bool, canChange bool, - d *Decoder) (_ map[uint]interface{}, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[uint]interface{}, xlen) - changed = true - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk uint - var mv interface{} - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintStringR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint]string) - v, changed := fastpathTV.DecMapUintStringV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint]string) - fastpathTV.DecMapUintStringV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintStringX(vp *map[uint]string, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintStringV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintStringV(v map[uint]string, checkNil bool, canChange bool, - d *Decoder) (_ map[uint]string, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[uint]string, xlen) - changed = true - } - - var mk uint - var mv string - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintUintR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint]uint) - v, changed := fastpathTV.DecMapUintUintV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint]uint) - fastpathTV.DecMapUintUintV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintUintX(vp *map[uint]uint, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintUintV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintUintV(v map[uint]uint, checkNil bool, canChange bool, - d *Decoder) (_ map[uint]uint, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uint]uint, xlen) - changed = true - } - - var mk uint - var mv uint - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintUint8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint]uint8) - v, changed := fastpathTV.DecMapUintUint8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint]uint8) - fastpathTV.DecMapUintUint8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintUint8X(vp *map[uint]uint8, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintUint8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintUint8V(v map[uint]uint8, checkNil bool, canChange bool, - d *Decoder) (_ map[uint]uint8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uint]uint8, xlen) - changed = true - } - - var mk uint - var mv uint8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintUint16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint]uint16) - v, changed := fastpathTV.DecMapUintUint16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint]uint16) - fastpathTV.DecMapUintUint16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintUint16X(vp *map[uint]uint16, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintUint16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintUint16V(v map[uint]uint16, checkNil bool, canChange bool, - d *Decoder) (_ map[uint]uint16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[uint]uint16, xlen) - changed = true - } - - var mk uint - var mv uint16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintUint32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint]uint32) - v, changed := fastpathTV.DecMapUintUint32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint]uint32) - fastpathTV.DecMapUintUint32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintUint32X(vp *map[uint]uint32, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintUint32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintUint32V(v map[uint]uint32, checkNil bool, canChange bool, - d *Decoder) (_ map[uint]uint32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uint]uint32, xlen) - changed = true - } - - var mk uint - var mv uint32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintUint64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint]uint64) - v, changed := fastpathTV.DecMapUintUint64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint]uint64) - fastpathTV.DecMapUintUint64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintUint64X(vp *map[uint]uint64, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintUint64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintUint64V(v map[uint]uint64, checkNil bool, canChange bool, - d *Decoder) (_ map[uint]uint64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uint]uint64, xlen) - changed = true - } - - var mk uint - var mv uint64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintUintptrR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint]uintptr) - v, changed := fastpathTV.DecMapUintUintptrV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint]uintptr) - fastpathTV.DecMapUintUintptrV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintUintptrX(vp *map[uint]uintptr, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintUintptrV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintUintptrV(v map[uint]uintptr, checkNil bool, canChange bool, - d *Decoder) (_ map[uint]uintptr, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uint]uintptr, xlen) - changed = true - } - - var mk uint - var mv uintptr - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintIntR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint]int) - v, changed := fastpathTV.DecMapUintIntV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint]int) - fastpathTV.DecMapUintIntV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintIntX(vp *map[uint]int, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintIntV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintIntV(v map[uint]int, checkNil bool, canChange bool, - d *Decoder) (_ map[uint]int, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uint]int, xlen) - changed = true - } - - var mk uint - var mv int - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintInt8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint]int8) - v, changed := fastpathTV.DecMapUintInt8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint]int8) - fastpathTV.DecMapUintInt8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintInt8X(vp *map[uint]int8, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintInt8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintInt8V(v map[uint]int8, checkNil bool, canChange bool, - d *Decoder) (_ map[uint]int8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uint]int8, xlen) - changed = true - } - - var mk uint - var mv int8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintInt16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint]int16) - v, changed := fastpathTV.DecMapUintInt16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint]int16) - fastpathTV.DecMapUintInt16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintInt16X(vp *map[uint]int16, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintInt16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintInt16V(v map[uint]int16, checkNil bool, canChange bool, - d *Decoder) (_ map[uint]int16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[uint]int16, xlen) - changed = true - } - - var mk uint - var mv int16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintInt32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint]int32) - v, changed := fastpathTV.DecMapUintInt32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint]int32) - fastpathTV.DecMapUintInt32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintInt32X(vp *map[uint]int32, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintInt32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintInt32V(v map[uint]int32, checkNil bool, canChange bool, - d *Decoder) (_ map[uint]int32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uint]int32, xlen) - changed = true - } - - var mk uint - var mv int32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintInt64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint]int64) - v, changed := fastpathTV.DecMapUintInt64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint]int64) - fastpathTV.DecMapUintInt64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintInt64X(vp *map[uint]int64, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintInt64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintInt64V(v map[uint]int64, checkNil bool, canChange bool, - d *Decoder) (_ map[uint]int64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uint]int64, xlen) - changed = true - } - - var mk uint - var mv int64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintFloat32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint]float32) - v, changed := fastpathTV.DecMapUintFloat32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint]float32) - fastpathTV.DecMapUintFloat32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintFloat32X(vp *map[uint]float32, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintFloat32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintFloat32V(v map[uint]float32, checkNil bool, canChange bool, - d *Decoder) (_ map[uint]float32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uint]float32, xlen) - changed = true - } - - var mk uint - var mv float32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintFloat64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint]float64) - v, changed := fastpathTV.DecMapUintFloat64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint]float64) - fastpathTV.DecMapUintFloat64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintFloat64X(vp *map[uint]float64, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintFloat64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintFloat64V(v map[uint]float64, checkNil bool, canChange bool, - d *Decoder) (_ map[uint]float64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uint]float64, xlen) - changed = true - } - - var mk uint - var mv float64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintBoolR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint]bool) - v, changed := fastpathTV.DecMapUintBoolV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint]bool) - fastpathTV.DecMapUintBoolV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintBoolX(vp *map[uint]bool, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintBoolV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintBoolV(v map[uint]bool, checkNil bool, canChange bool, - d *Decoder) (_ map[uint]bool, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uint]bool, xlen) - changed = true - } - - var mk uint - var mv bool - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint8IntfR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint8]interface{}) - v, changed := fastpathTV.DecMapUint8IntfV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint8]interface{}) - fastpathTV.DecMapUint8IntfV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint8IntfX(vp *map[uint8]interface{}, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint8IntfV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8IntfV(v map[uint8]interface{}, checkNil bool, canChange bool, - d *Decoder) (_ map[uint8]interface{}, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17) - v = make(map[uint8]interface{}, xlen) - changed = true - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk uint8 - var mv interface{} - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint8StringR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint8]string) - v, changed := fastpathTV.DecMapUint8StringV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint8]string) - fastpathTV.DecMapUint8StringV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint8StringX(vp *map[uint8]string, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint8StringV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8StringV(v map[uint8]string, checkNil bool, canChange bool, - d *Decoder) (_ map[uint8]string, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17) - v = make(map[uint8]string, xlen) - changed = true - } - - var mk uint8 - var mv string - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint8UintR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint8]uint) - v, changed := fastpathTV.DecMapUint8UintV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint8]uint) - fastpathTV.DecMapUint8UintV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint8UintX(vp *map[uint8]uint, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint8UintV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8UintV(v map[uint8]uint, checkNil bool, canChange bool, - d *Decoder) (_ map[uint8]uint, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uint8]uint, xlen) - changed = true - } - - var mk uint8 - var mv uint - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint8Uint8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint8]uint8) - v, changed := fastpathTV.DecMapUint8Uint8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint8]uint8) - fastpathTV.DecMapUint8Uint8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint8Uint8X(vp *map[uint8]uint8, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint8Uint8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8Uint8V(v map[uint8]uint8, checkNil bool, canChange bool, - d *Decoder) (_ map[uint8]uint8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2) - v = make(map[uint8]uint8, xlen) - changed = true - } - - var mk uint8 - var mv uint8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint8Uint16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint8]uint16) - v, changed := fastpathTV.DecMapUint8Uint16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint8]uint16) - fastpathTV.DecMapUint8Uint16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint8Uint16X(vp *map[uint8]uint16, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint8Uint16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8Uint16V(v map[uint8]uint16, checkNil bool, canChange bool, - d *Decoder) (_ map[uint8]uint16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3) - v = make(map[uint8]uint16, xlen) - changed = true - } - - var mk uint8 - var mv uint16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint8Uint32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint8]uint32) - v, changed := fastpathTV.DecMapUint8Uint32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint8]uint32) - fastpathTV.DecMapUint8Uint32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint8Uint32X(vp *map[uint8]uint32, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint8Uint32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8Uint32V(v map[uint8]uint32, checkNil bool, canChange bool, - d *Decoder) (_ map[uint8]uint32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[uint8]uint32, xlen) - changed = true - } - - var mk uint8 - var mv uint32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint8Uint64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint8]uint64) - v, changed := fastpathTV.DecMapUint8Uint64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint8]uint64) - fastpathTV.DecMapUint8Uint64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint8Uint64X(vp *map[uint8]uint64, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint8Uint64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8Uint64V(v map[uint8]uint64, checkNil bool, canChange bool, - d *Decoder) (_ map[uint8]uint64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uint8]uint64, xlen) - changed = true - } - - var mk uint8 - var mv uint64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint8UintptrR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint8]uintptr) - v, changed := fastpathTV.DecMapUint8UintptrV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint8]uintptr) - fastpathTV.DecMapUint8UintptrV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint8UintptrX(vp *map[uint8]uintptr, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint8UintptrV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8UintptrV(v map[uint8]uintptr, checkNil bool, canChange bool, - d *Decoder) (_ map[uint8]uintptr, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uint8]uintptr, xlen) - changed = true - } - - var mk uint8 - var mv uintptr - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint8IntR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint8]int) - v, changed := fastpathTV.DecMapUint8IntV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint8]int) - fastpathTV.DecMapUint8IntV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint8IntX(vp *map[uint8]int, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint8IntV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8IntV(v map[uint8]int, checkNil bool, canChange bool, - d *Decoder) (_ map[uint8]int, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uint8]int, xlen) - changed = true - } - - var mk uint8 - var mv int - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint8Int8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint8]int8) - v, changed := fastpathTV.DecMapUint8Int8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint8]int8) - fastpathTV.DecMapUint8Int8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint8Int8X(vp *map[uint8]int8, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint8Int8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8Int8V(v map[uint8]int8, checkNil bool, canChange bool, - d *Decoder) (_ map[uint8]int8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2) - v = make(map[uint8]int8, xlen) - changed = true - } - - var mk uint8 - var mv int8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint8Int16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint8]int16) - v, changed := fastpathTV.DecMapUint8Int16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint8]int16) - fastpathTV.DecMapUint8Int16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint8Int16X(vp *map[uint8]int16, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint8Int16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8Int16V(v map[uint8]int16, checkNil bool, canChange bool, - d *Decoder) (_ map[uint8]int16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3) - v = make(map[uint8]int16, xlen) - changed = true - } - - var mk uint8 - var mv int16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint8Int32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint8]int32) - v, changed := fastpathTV.DecMapUint8Int32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint8]int32) - fastpathTV.DecMapUint8Int32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint8Int32X(vp *map[uint8]int32, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint8Int32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8Int32V(v map[uint8]int32, checkNil bool, canChange bool, - d *Decoder) (_ map[uint8]int32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[uint8]int32, xlen) - changed = true - } - - var mk uint8 - var mv int32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint8Int64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint8]int64) - v, changed := fastpathTV.DecMapUint8Int64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint8]int64) - fastpathTV.DecMapUint8Int64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint8Int64X(vp *map[uint8]int64, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint8Int64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8Int64V(v map[uint8]int64, checkNil bool, canChange bool, - d *Decoder) (_ map[uint8]int64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uint8]int64, xlen) - changed = true - } - - var mk uint8 - var mv int64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint8Float32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint8]float32) - v, changed := fastpathTV.DecMapUint8Float32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint8]float32) - fastpathTV.DecMapUint8Float32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint8Float32X(vp *map[uint8]float32, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint8Float32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8Float32V(v map[uint8]float32, checkNil bool, canChange bool, - d *Decoder) (_ map[uint8]float32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[uint8]float32, xlen) - changed = true - } - - var mk uint8 - var mv float32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint8Float64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint8]float64) - v, changed := fastpathTV.DecMapUint8Float64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint8]float64) - fastpathTV.DecMapUint8Float64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint8Float64X(vp *map[uint8]float64, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint8Float64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8Float64V(v map[uint8]float64, checkNil bool, canChange bool, - d *Decoder) (_ map[uint8]float64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uint8]float64, xlen) - changed = true - } - - var mk uint8 - var mv float64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint8BoolR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint8]bool) - v, changed := fastpathTV.DecMapUint8BoolV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint8]bool) - fastpathTV.DecMapUint8BoolV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint8BoolX(vp *map[uint8]bool, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint8BoolV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint8BoolV(v map[uint8]bool, checkNil bool, canChange bool, - d *Decoder) (_ map[uint8]bool, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2) - v = make(map[uint8]bool, xlen) - changed = true - } - - var mk uint8 - var mv bool - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint8(dd.DecodeUint(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint16IntfR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint16]interface{}) - v, changed := fastpathTV.DecMapUint16IntfV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint16]interface{}) - fastpathTV.DecMapUint16IntfV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint16IntfX(vp *map[uint16]interface{}, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint16IntfV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16IntfV(v map[uint16]interface{}, checkNil bool, canChange bool, - d *Decoder) (_ map[uint16]interface{}, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 18) - v = make(map[uint16]interface{}, xlen) - changed = true - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk uint16 - var mv interface{} - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint16StringR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint16]string) - v, changed := fastpathTV.DecMapUint16StringV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint16]string) - fastpathTV.DecMapUint16StringV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint16StringX(vp *map[uint16]string, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint16StringV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16StringV(v map[uint16]string, checkNil bool, canChange bool, - d *Decoder) (_ map[uint16]string, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 18) - v = make(map[uint16]string, xlen) - changed = true - } - - var mk uint16 - var mv string - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint16UintR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint16]uint) - v, changed := fastpathTV.DecMapUint16UintV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint16]uint) - fastpathTV.DecMapUint16UintV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint16UintX(vp *map[uint16]uint, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint16UintV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16UintV(v map[uint16]uint, checkNil bool, canChange bool, - d *Decoder) (_ map[uint16]uint, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[uint16]uint, xlen) - changed = true - } - - var mk uint16 - var mv uint - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint16Uint8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint16]uint8) - v, changed := fastpathTV.DecMapUint16Uint8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint16]uint8) - fastpathTV.DecMapUint16Uint8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint16Uint8X(vp *map[uint16]uint8, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint16Uint8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16Uint8V(v map[uint16]uint8, checkNil bool, canChange bool, - d *Decoder) (_ map[uint16]uint8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3) - v = make(map[uint16]uint8, xlen) - changed = true - } - - var mk uint16 - var mv uint8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint16Uint16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint16]uint16) - v, changed := fastpathTV.DecMapUint16Uint16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint16]uint16) - fastpathTV.DecMapUint16Uint16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint16Uint16X(vp *map[uint16]uint16, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint16Uint16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16Uint16V(v map[uint16]uint16, checkNil bool, canChange bool, - d *Decoder) (_ map[uint16]uint16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 4) - v = make(map[uint16]uint16, xlen) - changed = true - } - - var mk uint16 - var mv uint16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint16Uint32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint16]uint32) - v, changed := fastpathTV.DecMapUint16Uint32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint16]uint32) - fastpathTV.DecMapUint16Uint32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint16Uint32X(vp *map[uint16]uint32, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint16Uint32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16Uint32V(v map[uint16]uint32, checkNil bool, canChange bool, - d *Decoder) (_ map[uint16]uint32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6) - v = make(map[uint16]uint32, xlen) - changed = true - } - - var mk uint16 - var mv uint32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint16Uint64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint16]uint64) - v, changed := fastpathTV.DecMapUint16Uint64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint16]uint64) - fastpathTV.DecMapUint16Uint64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint16Uint64X(vp *map[uint16]uint64, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint16Uint64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16Uint64V(v map[uint16]uint64, checkNil bool, canChange bool, - d *Decoder) (_ map[uint16]uint64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[uint16]uint64, xlen) - changed = true - } - - var mk uint16 - var mv uint64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint16UintptrR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint16]uintptr) - v, changed := fastpathTV.DecMapUint16UintptrV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint16]uintptr) - fastpathTV.DecMapUint16UintptrV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint16UintptrX(vp *map[uint16]uintptr, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint16UintptrV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16UintptrV(v map[uint16]uintptr, checkNil bool, canChange bool, - d *Decoder) (_ map[uint16]uintptr, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[uint16]uintptr, xlen) - changed = true - } - - var mk uint16 - var mv uintptr - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint16IntR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint16]int) - v, changed := fastpathTV.DecMapUint16IntV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint16]int) - fastpathTV.DecMapUint16IntV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint16IntX(vp *map[uint16]int, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint16IntV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16IntV(v map[uint16]int, checkNil bool, canChange bool, - d *Decoder) (_ map[uint16]int, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[uint16]int, xlen) - changed = true - } - - var mk uint16 - var mv int - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint16Int8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint16]int8) - v, changed := fastpathTV.DecMapUint16Int8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint16]int8) - fastpathTV.DecMapUint16Int8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint16Int8X(vp *map[uint16]int8, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint16Int8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16Int8V(v map[uint16]int8, checkNil bool, canChange bool, - d *Decoder) (_ map[uint16]int8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3) - v = make(map[uint16]int8, xlen) - changed = true - } - - var mk uint16 - var mv int8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint16Int16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint16]int16) - v, changed := fastpathTV.DecMapUint16Int16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint16]int16) - fastpathTV.DecMapUint16Int16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint16Int16X(vp *map[uint16]int16, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint16Int16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16Int16V(v map[uint16]int16, checkNil bool, canChange bool, - d *Decoder) (_ map[uint16]int16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 4) - v = make(map[uint16]int16, xlen) - changed = true - } - - var mk uint16 - var mv int16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint16Int32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint16]int32) - v, changed := fastpathTV.DecMapUint16Int32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint16]int32) - fastpathTV.DecMapUint16Int32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint16Int32X(vp *map[uint16]int32, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint16Int32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16Int32V(v map[uint16]int32, checkNil bool, canChange bool, - d *Decoder) (_ map[uint16]int32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6) - v = make(map[uint16]int32, xlen) - changed = true - } - - var mk uint16 - var mv int32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint16Int64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint16]int64) - v, changed := fastpathTV.DecMapUint16Int64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint16]int64) - fastpathTV.DecMapUint16Int64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint16Int64X(vp *map[uint16]int64, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint16Int64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16Int64V(v map[uint16]int64, checkNil bool, canChange bool, - d *Decoder) (_ map[uint16]int64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[uint16]int64, xlen) - changed = true - } - - var mk uint16 - var mv int64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint16Float32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint16]float32) - v, changed := fastpathTV.DecMapUint16Float32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint16]float32) - fastpathTV.DecMapUint16Float32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint16Float32X(vp *map[uint16]float32, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint16Float32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16Float32V(v map[uint16]float32, checkNil bool, canChange bool, - d *Decoder) (_ map[uint16]float32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6) - v = make(map[uint16]float32, xlen) - changed = true - } - - var mk uint16 - var mv float32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint16Float64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint16]float64) - v, changed := fastpathTV.DecMapUint16Float64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint16]float64) - fastpathTV.DecMapUint16Float64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint16Float64X(vp *map[uint16]float64, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint16Float64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16Float64V(v map[uint16]float64, checkNil bool, canChange bool, - d *Decoder) (_ map[uint16]float64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[uint16]float64, xlen) - changed = true - } - - var mk uint16 - var mv float64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint16BoolR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint16]bool) - v, changed := fastpathTV.DecMapUint16BoolV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint16]bool) - fastpathTV.DecMapUint16BoolV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint16BoolX(vp *map[uint16]bool, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint16BoolV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint16BoolV(v map[uint16]bool, checkNil bool, canChange bool, - d *Decoder) (_ map[uint16]bool, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3) - v = make(map[uint16]bool, xlen) - changed = true - } - - var mk uint16 - var mv bool - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint16(dd.DecodeUint(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint32IntfR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint32]interface{}) - v, changed := fastpathTV.DecMapUint32IntfV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint32]interface{}) - fastpathTV.DecMapUint32IntfV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint32IntfX(vp *map[uint32]interface{}, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint32IntfV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32IntfV(v map[uint32]interface{}, checkNil bool, canChange bool, - d *Decoder) (_ map[uint32]interface{}, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20) - v = make(map[uint32]interface{}, xlen) - changed = true - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk uint32 - var mv interface{} - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint32StringR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint32]string) - v, changed := fastpathTV.DecMapUint32StringV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint32]string) - fastpathTV.DecMapUint32StringV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint32StringX(vp *map[uint32]string, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint32StringV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32StringV(v map[uint32]string, checkNil bool, canChange bool, - d *Decoder) (_ map[uint32]string, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20) - v = make(map[uint32]string, xlen) - changed = true - } - - var mk uint32 - var mv string - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint32UintR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint32]uint) - v, changed := fastpathTV.DecMapUint32UintV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint32]uint) - fastpathTV.DecMapUint32UintV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint32UintX(vp *map[uint32]uint, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint32UintV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32UintV(v map[uint32]uint, checkNil bool, canChange bool, - d *Decoder) (_ map[uint32]uint, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uint32]uint, xlen) - changed = true - } - - var mk uint32 - var mv uint - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint32Uint8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint32]uint8) - v, changed := fastpathTV.DecMapUint32Uint8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint32]uint8) - fastpathTV.DecMapUint32Uint8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint32Uint8X(vp *map[uint32]uint8, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint32Uint8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32Uint8V(v map[uint32]uint8, checkNil bool, canChange bool, - d *Decoder) (_ map[uint32]uint8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[uint32]uint8, xlen) - changed = true - } - - var mk uint32 - var mv uint8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint32Uint16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint32]uint16) - v, changed := fastpathTV.DecMapUint32Uint16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint32]uint16) - fastpathTV.DecMapUint32Uint16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint32Uint16X(vp *map[uint32]uint16, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint32Uint16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32Uint16V(v map[uint32]uint16, checkNil bool, canChange bool, - d *Decoder) (_ map[uint32]uint16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6) - v = make(map[uint32]uint16, xlen) - changed = true - } - - var mk uint32 - var mv uint16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint32Uint32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint32]uint32) - v, changed := fastpathTV.DecMapUint32Uint32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint32]uint32) - fastpathTV.DecMapUint32Uint32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint32Uint32X(vp *map[uint32]uint32, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint32Uint32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32Uint32V(v map[uint32]uint32, checkNil bool, canChange bool, - d *Decoder) (_ map[uint32]uint32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8) - v = make(map[uint32]uint32, xlen) - changed = true - } - - var mk uint32 - var mv uint32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint32Uint64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint32]uint64) - v, changed := fastpathTV.DecMapUint32Uint64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint32]uint64) - fastpathTV.DecMapUint32Uint64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint32Uint64X(vp *map[uint32]uint64, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint32Uint64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32Uint64V(v map[uint32]uint64, checkNil bool, canChange bool, - d *Decoder) (_ map[uint32]uint64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uint32]uint64, xlen) - changed = true - } - - var mk uint32 - var mv uint64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint32UintptrR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint32]uintptr) - v, changed := fastpathTV.DecMapUint32UintptrV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint32]uintptr) - fastpathTV.DecMapUint32UintptrV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint32UintptrX(vp *map[uint32]uintptr, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint32UintptrV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32UintptrV(v map[uint32]uintptr, checkNil bool, canChange bool, - d *Decoder) (_ map[uint32]uintptr, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uint32]uintptr, xlen) - changed = true - } - - var mk uint32 - var mv uintptr - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint32IntR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint32]int) - v, changed := fastpathTV.DecMapUint32IntV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint32]int) - fastpathTV.DecMapUint32IntV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint32IntX(vp *map[uint32]int, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint32IntV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32IntV(v map[uint32]int, checkNil bool, canChange bool, - d *Decoder) (_ map[uint32]int, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uint32]int, xlen) - changed = true - } - - var mk uint32 - var mv int - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint32Int8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint32]int8) - v, changed := fastpathTV.DecMapUint32Int8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint32]int8) - fastpathTV.DecMapUint32Int8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint32Int8X(vp *map[uint32]int8, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint32Int8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32Int8V(v map[uint32]int8, checkNil bool, canChange bool, - d *Decoder) (_ map[uint32]int8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[uint32]int8, xlen) - changed = true - } - - var mk uint32 - var mv int8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint32Int16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint32]int16) - v, changed := fastpathTV.DecMapUint32Int16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint32]int16) - fastpathTV.DecMapUint32Int16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint32Int16X(vp *map[uint32]int16, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint32Int16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32Int16V(v map[uint32]int16, checkNil bool, canChange bool, - d *Decoder) (_ map[uint32]int16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6) - v = make(map[uint32]int16, xlen) - changed = true - } - - var mk uint32 - var mv int16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint32Int32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint32]int32) - v, changed := fastpathTV.DecMapUint32Int32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint32]int32) - fastpathTV.DecMapUint32Int32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint32Int32X(vp *map[uint32]int32, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint32Int32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32Int32V(v map[uint32]int32, checkNil bool, canChange bool, - d *Decoder) (_ map[uint32]int32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8) - v = make(map[uint32]int32, xlen) - changed = true - } - - var mk uint32 - var mv int32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint32Int64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint32]int64) - v, changed := fastpathTV.DecMapUint32Int64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint32]int64) - fastpathTV.DecMapUint32Int64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint32Int64X(vp *map[uint32]int64, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint32Int64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32Int64V(v map[uint32]int64, checkNil bool, canChange bool, - d *Decoder) (_ map[uint32]int64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uint32]int64, xlen) - changed = true - } - - var mk uint32 - var mv int64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint32Float32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint32]float32) - v, changed := fastpathTV.DecMapUint32Float32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint32]float32) - fastpathTV.DecMapUint32Float32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint32Float32X(vp *map[uint32]float32, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint32Float32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32Float32V(v map[uint32]float32, checkNil bool, canChange bool, - d *Decoder) (_ map[uint32]float32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8) - v = make(map[uint32]float32, xlen) - changed = true - } - - var mk uint32 - var mv float32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint32Float64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint32]float64) - v, changed := fastpathTV.DecMapUint32Float64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint32]float64) - fastpathTV.DecMapUint32Float64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint32Float64X(vp *map[uint32]float64, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint32Float64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32Float64V(v map[uint32]float64, checkNil bool, canChange bool, - d *Decoder) (_ map[uint32]float64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uint32]float64, xlen) - changed = true - } - - var mk uint32 - var mv float64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint32BoolR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint32]bool) - v, changed := fastpathTV.DecMapUint32BoolV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint32]bool) - fastpathTV.DecMapUint32BoolV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint32BoolX(vp *map[uint32]bool, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint32BoolV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint32BoolV(v map[uint32]bool, checkNil bool, canChange bool, - d *Decoder) (_ map[uint32]bool, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[uint32]bool, xlen) - changed = true - } - - var mk uint32 - var mv bool - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uint32(dd.DecodeUint(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint64IntfR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint64]interface{}) - v, changed := fastpathTV.DecMapUint64IntfV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint64]interface{}) - fastpathTV.DecMapUint64IntfV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint64IntfX(vp *map[uint64]interface{}, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint64IntfV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64IntfV(v map[uint64]interface{}, checkNil bool, canChange bool, - d *Decoder) (_ map[uint64]interface{}, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[uint64]interface{}, xlen) - changed = true - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk uint64 - var mv interface{} - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint64StringR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint64]string) - v, changed := fastpathTV.DecMapUint64StringV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint64]string) - fastpathTV.DecMapUint64StringV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint64StringX(vp *map[uint64]string, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint64StringV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64StringV(v map[uint64]string, checkNil bool, canChange bool, - d *Decoder) (_ map[uint64]string, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[uint64]string, xlen) - changed = true - } - - var mk uint64 - var mv string - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint64UintR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint64]uint) - v, changed := fastpathTV.DecMapUint64UintV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint64]uint) - fastpathTV.DecMapUint64UintV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint64UintX(vp *map[uint64]uint, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint64UintV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64UintV(v map[uint64]uint, checkNil bool, canChange bool, - d *Decoder) (_ map[uint64]uint, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uint64]uint, xlen) - changed = true - } - - var mk uint64 - var mv uint - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint64Uint8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint64]uint8) - v, changed := fastpathTV.DecMapUint64Uint8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint64]uint8) - fastpathTV.DecMapUint64Uint8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint64Uint8X(vp *map[uint64]uint8, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint64Uint8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64Uint8V(v map[uint64]uint8, checkNil bool, canChange bool, - d *Decoder) (_ map[uint64]uint8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uint64]uint8, xlen) - changed = true - } - - var mk uint64 - var mv uint8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint64Uint16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint64]uint16) - v, changed := fastpathTV.DecMapUint64Uint16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint64]uint16) - fastpathTV.DecMapUint64Uint16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint64Uint16X(vp *map[uint64]uint16, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint64Uint16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64Uint16V(v map[uint64]uint16, checkNil bool, canChange bool, - d *Decoder) (_ map[uint64]uint16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[uint64]uint16, xlen) - changed = true - } - - var mk uint64 - var mv uint16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint64Uint32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint64]uint32) - v, changed := fastpathTV.DecMapUint64Uint32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint64]uint32) - fastpathTV.DecMapUint64Uint32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint64Uint32X(vp *map[uint64]uint32, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint64Uint32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64Uint32V(v map[uint64]uint32, checkNil bool, canChange bool, - d *Decoder) (_ map[uint64]uint32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uint64]uint32, xlen) - changed = true - } - - var mk uint64 - var mv uint32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint64Uint64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint64]uint64) - v, changed := fastpathTV.DecMapUint64Uint64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint64]uint64) - fastpathTV.DecMapUint64Uint64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint64Uint64X(vp *map[uint64]uint64, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint64Uint64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64Uint64V(v map[uint64]uint64, checkNil bool, canChange bool, - d *Decoder) (_ map[uint64]uint64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uint64]uint64, xlen) - changed = true - } - - var mk uint64 - var mv uint64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint64UintptrR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint64]uintptr) - v, changed := fastpathTV.DecMapUint64UintptrV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint64]uintptr) - fastpathTV.DecMapUint64UintptrV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint64UintptrX(vp *map[uint64]uintptr, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint64UintptrV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64UintptrV(v map[uint64]uintptr, checkNil bool, canChange bool, - d *Decoder) (_ map[uint64]uintptr, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uint64]uintptr, xlen) - changed = true - } - - var mk uint64 - var mv uintptr - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint64IntR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint64]int) - v, changed := fastpathTV.DecMapUint64IntV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint64]int) - fastpathTV.DecMapUint64IntV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint64IntX(vp *map[uint64]int, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint64IntV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64IntV(v map[uint64]int, checkNil bool, canChange bool, - d *Decoder) (_ map[uint64]int, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uint64]int, xlen) - changed = true - } - - var mk uint64 - var mv int - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint64Int8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint64]int8) - v, changed := fastpathTV.DecMapUint64Int8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint64]int8) - fastpathTV.DecMapUint64Int8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint64Int8X(vp *map[uint64]int8, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint64Int8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64Int8V(v map[uint64]int8, checkNil bool, canChange bool, - d *Decoder) (_ map[uint64]int8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uint64]int8, xlen) - changed = true - } - - var mk uint64 - var mv int8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint64Int16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint64]int16) - v, changed := fastpathTV.DecMapUint64Int16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint64]int16) - fastpathTV.DecMapUint64Int16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint64Int16X(vp *map[uint64]int16, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint64Int16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64Int16V(v map[uint64]int16, checkNil bool, canChange bool, - d *Decoder) (_ map[uint64]int16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[uint64]int16, xlen) - changed = true - } - - var mk uint64 - var mv int16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint64Int32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint64]int32) - v, changed := fastpathTV.DecMapUint64Int32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint64]int32) - fastpathTV.DecMapUint64Int32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint64Int32X(vp *map[uint64]int32, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint64Int32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64Int32V(v map[uint64]int32, checkNil bool, canChange bool, - d *Decoder) (_ map[uint64]int32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uint64]int32, xlen) - changed = true - } - - var mk uint64 - var mv int32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint64Int64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint64]int64) - v, changed := fastpathTV.DecMapUint64Int64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint64]int64) - fastpathTV.DecMapUint64Int64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint64Int64X(vp *map[uint64]int64, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint64Int64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64Int64V(v map[uint64]int64, checkNil bool, canChange bool, - d *Decoder) (_ map[uint64]int64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uint64]int64, xlen) - changed = true - } - - var mk uint64 - var mv int64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint64Float32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint64]float32) - v, changed := fastpathTV.DecMapUint64Float32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint64]float32) - fastpathTV.DecMapUint64Float32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint64Float32X(vp *map[uint64]float32, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint64Float32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64Float32V(v map[uint64]float32, checkNil bool, canChange bool, - d *Decoder) (_ map[uint64]float32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uint64]float32, xlen) - changed = true - } - - var mk uint64 - var mv float32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint64Float64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint64]float64) - v, changed := fastpathTV.DecMapUint64Float64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint64]float64) - fastpathTV.DecMapUint64Float64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint64Float64X(vp *map[uint64]float64, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint64Float64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64Float64V(v map[uint64]float64, checkNil bool, canChange bool, - d *Decoder) (_ map[uint64]float64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uint64]float64, xlen) - changed = true - } - - var mk uint64 - var mv float64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUint64BoolR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uint64]bool) - v, changed := fastpathTV.DecMapUint64BoolV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uint64]bool) - fastpathTV.DecMapUint64BoolV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUint64BoolX(vp *map[uint64]bool, checkNil bool, d *Decoder) { - v, changed := f.DecMapUint64BoolV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUint64BoolV(v map[uint64]bool, checkNil bool, canChange bool, - d *Decoder) (_ map[uint64]bool, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uint64]bool, xlen) - changed = true - } - - var mk uint64 - var mv bool - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeUint(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintptrIntfR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uintptr]interface{}) - v, changed := fastpathTV.DecMapUintptrIntfV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uintptr]interface{}) - fastpathTV.DecMapUintptrIntfV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintptrIntfX(vp *map[uintptr]interface{}, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintptrIntfV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrIntfV(v map[uintptr]interface{}, checkNil bool, canChange bool, - d *Decoder) (_ map[uintptr]interface{}, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[uintptr]interface{}, xlen) - changed = true - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk uintptr - var mv interface{} - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintptrStringR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uintptr]string) - v, changed := fastpathTV.DecMapUintptrStringV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uintptr]string) - fastpathTV.DecMapUintptrStringV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintptrStringX(vp *map[uintptr]string, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintptrStringV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrStringV(v map[uintptr]string, checkNil bool, canChange bool, - d *Decoder) (_ map[uintptr]string, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[uintptr]string, xlen) - changed = true - } - - var mk uintptr - var mv string - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintptrUintR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uintptr]uint) - v, changed := fastpathTV.DecMapUintptrUintV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uintptr]uint) - fastpathTV.DecMapUintptrUintV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintptrUintX(vp *map[uintptr]uint, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintptrUintV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrUintV(v map[uintptr]uint, checkNil bool, canChange bool, - d *Decoder) (_ map[uintptr]uint, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uintptr]uint, xlen) - changed = true - } - - var mk uintptr - var mv uint - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintptrUint8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uintptr]uint8) - v, changed := fastpathTV.DecMapUintptrUint8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uintptr]uint8) - fastpathTV.DecMapUintptrUint8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintptrUint8X(vp *map[uintptr]uint8, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintptrUint8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrUint8V(v map[uintptr]uint8, checkNil bool, canChange bool, - d *Decoder) (_ map[uintptr]uint8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uintptr]uint8, xlen) - changed = true - } - - var mk uintptr - var mv uint8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintptrUint16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uintptr]uint16) - v, changed := fastpathTV.DecMapUintptrUint16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uintptr]uint16) - fastpathTV.DecMapUintptrUint16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintptrUint16X(vp *map[uintptr]uint16, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintptrUint16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrUint16V(v map[uintptr]uint16, checkNil bool, canChange bool, - d *Decoder) (_ map[uintptr]uint16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[uintptr]uint16, xlen) - changed = true - } - - var mk uintptr - var mv uint16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintptrUint32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uintptr]uint32) - v, changed := fastpathTV.DecMapUintptrUint32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uintptr]uint32) - fastpathTV.DecMapUintptrUint32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintptrUint32X(vp *map[uintptr]uint32, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintptrUint32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrUint32V(v map[uintptr]uint32, checkNil bool, canChange bool, - d *Decoder) (_ map[uintptr]uint32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uintptr]uint32, xlen) - changed = true - } - - var mk uintptr - var mv uint32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintptrUint64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uintptr]uint64) - v, changed := fastpathTV.DecMapUintptrUint64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uintptr]uint64) - fastpathTV.DecMapUintptrUint64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintptrUint64X(vp *map[uintptr]uint64, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintptrUint64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrUint64V(v map[uintptr]uint64, checkNil bool, canChange bool, - d *Decoder) (_ map[uintptr]uint64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uintptr]uint64, xlen) - changed = true - } - - var mk uintptr - var mv uint64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintptrUintptrR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uintptr]uintptr) - v, changed := fastpathTV.DecMapUintptrUintptrV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uintptr]uintptr) - fastpathTV.DecMapUintptrUintptrV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintptrUintptrX(vp *map[uintptr]uintptr, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintptrUintptrV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrUintptrV(v map[uintptr]uintptr, checkNil bool, canChange bool, - d *Decoder) (_ map[uintptr]uintptr, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uintptr]uintptr, xlen) - changed = true - } - - var mk uintptr - var mv uintptr - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintptrIntR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uintptr]int) - v, changed := fastpathTV.DecMapUintptrIntV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uintptr]int) - fastpathTV.DecMapUintptrIntV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintptrIntX(vp *map[uintptr]int, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintptrIntV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrIntV(v map[uintptr]int, checkNil bool, canChange bool, - d *Decoder) (_ map[uintptr]int, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uintptr]int, xlen) - changed = true - } - - var mk uintptr - var mv int - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintptrInt8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uintptr]int8) - v, changed := fastpathTV.DecMapUintptrInt8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uintptr]int8) - fastpathTV.DecMapUintptrInt8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintptrInt8X(vp *map[uintptr]int8, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintptrInt8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrInt8V(v map[uintptr]int8, checkNil bool, canChange bool, - d *Decoder) (_ map[uintptr]int8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uintptr]int8, xlen) - changed = true - } - - var mk uintptr - var mv int8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintptrInt16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uintptr]int16) - v, changed := fastpathTV.DecMapUintptrInt16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uintptr]int16) - fastpathTV.DecMapUintptrInt16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintptrInt16X(vp *map[uintptr]int16, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintptrInt16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrInt16V(v map[uintptr]int16, checkNil bool, canChange bool, - d *Decoder) (_ map[uintptr]int16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[uintptr]int16, xlen) - changed = true - } - - var mk uintptr - var mv int16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintptrInt32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uintptr]int32) - v, changed := fastpathTV.DecMapUintptrInt32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uintptr]int32) - fastpathTV.DecMapUintptrInt32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintptrInt32X(vp *map[uintptr]int32, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintptrInt32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrInt32V(v map[uintptr]int32, checkNil bool, canChange bool, - d *Decoder) (_ map[uintptr]int32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uintptr]int32, xlen) - changed = true - } - - var mk uintptr - var mv int32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintptrInt64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uintptr]int64) - v, changed := fastpathTV.DecMapUintptrInt64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uintptr]int64) - fastpathTV.DecMapUintptrInt64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintptrInt64X(vp *map[uintptr]int64, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintptrInt64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrInt64V(v map[uintptr]int64, checkNil bool, canChange bool, - d *Decoder) (_ map[uintptr]int64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uintptr]int64, xlen) - changed = true - } - - var mk uintptr - var mv int64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintptrFloat32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uintptr]float32) - v, changed := fastpathTV.DecMapUintptrFloat32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uintptr]float32) - fastpathTV.DecMapUintptrFloat32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintptrFloat32X(vp *map[uintptr]float32, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintptrFloat32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrFloat32V(v map[uintptr]float32, checkNil bool, canChange bool, - d *Decoder) (_ map[uintptr]float32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[uintptr]float32, xlen) - changed = true - } - - var mk uintptr - var mv float32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintptrFloat64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uintptr]float64) - v, changed := fastpathTV.DecMapUintptrFloat64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uintptr]float64) - fastpathTV.DecMapUintptrFloat64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintptrFloat64X(vp *map[uintptr]float64, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintptrFloat64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrFloat64V(v map[uintptr]float64, checkNil bool, canChange bool, - d *Decoder) (_ map[uintptr]float64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[uintptr]float64, xlen) - changed = true - } - - var mk uintptr - var mv float64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapUintptrBoolR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[uintptr]bool) - v, changed := fastpathTV.DecMapUintptrBoolV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[uintptr]bool) - fastpathTV.DecMapUintptrBoolV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapUintptrBoolX(vp *map[uintptr]bool, checkNil bool, d *Decoder) { - v, changed := f.DecMapUintptrBoolV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapUintptrBoolV(v map[uintptr]bool, checkNil bool, canChange bool, - d *Decoder) (_ map[uintptr]bool, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[uintptr]bool, xlen) - changed = true - } - - var mk uintptr - var mv bool - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = uintptr(dd.DecodeUint(uintBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntIntfR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int]interface{}) - v, changed := fastpathTV.DecMapIntIntfV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int]interface{}) - fastpathTV.DecMapIntIntfV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntIntfX(vp *map[int]interface{}, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntIntfV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntIntfV(v map[int]interface{}, checkNil bool, canChange bool, - d *Decoder) (_ map[int]interface{}, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[int]interface{}, xlen) - changed = true - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk int - var mv interface{} - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntStringR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int]string) - v, changed := fastpathTV.DecMapIntStringV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int]string) - fastpathTV.DecMapIntStringV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntStringX(vp *map[int]string, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntStringV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntStringV(v map[int]string, checkNil bool, canChange bool, - d *Decoder) (_ map[int]string, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[int]string, xlen) - changed = true - } - - var mk int - var mv string - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntUintR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int]uint) - v, changed := fastpathTV.DecMapIntUintV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int]uint) - fastpathTV.DecMapIntUintV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntUintX(vp *map[int]uint, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntUintV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntUintV(v map[int]uint, checkNil bool, canChange bool, - d *Decoder) (_ map[int]uint, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[int]uint, xlen) - changed = true - } - - var mk int - var mv uint - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntUint8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int]uint8) - v, changed := fastpathTV.DecMapIntUint8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int]uint8) - fastpathTV.DecMapIntUint8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntUint8X(vp *map[int]uint8, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntUint8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntUint8V(v map[int]uint8, checkNil bool, canChange bool, - d *Decoder) (_ map[int]uint8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[int]uint8, xlen) - changed = true - } - - var mk int - var mv uint8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntUint16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int]uint16) - v, changed := fastpathTV.DecMapIntUint16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int]uint16) - fastpathTV.DecMapIntUint16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntUint16X(vp *map[int]uint16, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntUint16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntUint16V(v map[int]uint16, checkNil bool, canChange bool, - d *Decoder) (_ map[int]uint16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[int]uint16, xlen) - changed = true - } - - var mk int - var mv uint16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntUint32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int]uint32) - v, changed := fastpathTV.DecMapIntUint32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int]uint32) - fastpathTV.DecMapIntUint32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntUint32X(vp *map[int]uint32, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntUint32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntUint32V(v map[int]uint32, checkNil bool, canChange bool, - d *Decoder) (_ map[int]uint32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[int]uint32, xlen) - changed = true - } - - var mk int - var mv uint32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntUint64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int]uint64) - v, changed := fastpathTV.DecMapIntUint64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int]uint64) - fastpathTV.DecMapIntUint64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntUint64X(vp *map[int]uint64, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntUint64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntUint64V(v map[int]uint64, checkNil bool, canChange bool, - d *Decoder) (_ map[int]uint64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[int]uint64, xlen) - changed = true - } - - var mk int - var mv uint64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntUintptrR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int]uintptr) - v, changed := fastpathTV.DecMapIntUintptrV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int]uintptr) - fastpathTV.DecMapIntUintptrV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntUintptrX(vp *map[int]uintptr, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntUintptrV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntUintptrV(v map[int]uintptr, checkNil bool, canChange bool, - d *Decoder) (_ map[int]uintptr, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[int]uintptr, xlen) - changed = true - } - - var mk int - var mv uintptr - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntIntR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int]int) - v, changed := fastpathTV.DecMapIntIntV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int]int) - fastpathTV.DecMapIntIntV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntIntX(vp *map[int]int, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntIntV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntIntV(v map[int]int, checkNil bool, canChange bool, - d *Decoder) (_ map[int]int, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[int]int, xlen) - changed = true - } - - var mk int - var mv int - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntInt8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int]int8) - v, changed := fastpathTV.DecMapIntInt8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int]int8) - fastpathTV.DecMapIntInt8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntInt8X(vp *map[int]int8, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntInt8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntInt8V(v map[int]int8, checkNil bool, canChange bool, - d *Decoder) (_ map[int]int8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[int]int8, xlen) - changed = true - } - - var mk int - var mv int8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntInt16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int]int16) - v, changed := fastpathTV.DecMapIntInt16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int]int16) - fastpathTV.DecMapIntInt16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntInt16X(vp *map[int]int16, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntInt16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntInt16V(v map[int]int16, checkNil bool, canChange bool, - d *Decoder) (_ map[int]int16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[int]int16, xlen) - changed = true - } - - var mk int - var mv int16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntInt32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int]int32) - v, changed := fastpathTV.DecMapIntInt32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int]int32) - fastpathTV.DecMapIntInt32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntInt32X(vp *map[int]int32, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntInt32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntInt32V(v map[int]int32, checkNil bool, canChange bool, - d *Decoder) (_ map[int]int32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[int]int32, xlen) - changed = true - } - - var mk int - var mv int32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntInt64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int]int64) - v, changed := fastpathTV.DecMapIntInt64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int]int64) - fastpathTV.DecMapIntInt64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntInt64X(vp *map[int]int64, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntInt64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntInt64V(v map[int]int64, checkNil bool, canChange bool, - d *Decoder) (_ map[int]int64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[int]int64, xlen) - changed = true - } - - var mk int - var mv int64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntFloat32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int]float32) - v, changed := fastpathTV.DecMapIntFloat32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int]float32) - fastpathTV.DecMapIntFloat32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntFloat32X(vp *map[int]float32, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntFloat32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntFloat32V(v map[int]float32, checkNil bool, canChange bool, - d *Decoder) (_ map[int]float32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[int]float32, xlen) - changed = true - } - - var mk int - var mv float32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntFloat64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int]float64) - v, changed := fastpathTV.DecMapIntFloat64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int]float64) - fastpathTV.DecMapIntFloat64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntFloat64X(vp *map[int]float64, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntFloat64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntFloat64V(v map[int]float64, checkNil bool, canChange bool, - d *Decoder) (_ map[int]float64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[int]float64, xlen) - changed = true - } - - var mk int - var mv float64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapIntBoolR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int]bool) - v, changed := fastpathTV.DecMapIntBoolV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int]bool) - fastpathTV.DecMapIntBoolV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapIntBoolX(vp *map[int]bool, checkNil bool, d *Decoder) { - v, changed := f.DecMapIntBoolV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapIntBoolV(v map[int]bool, checkNil bool, canChange bool, - d *Decoder) (_ map[int]bool, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[int]bool, xlen) - changed = true - } - - var mk int - var mv bool - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int(dd.DecodeInt(intBitsize)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt8IntfR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int8]interface{}) - v, changed := fastpathTV.DecMapInt8IntfV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int8]interface{}) - fastpathTV.DecMapInt8IntfV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt8IntfX(vp *map[int8]interface{}, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt8IntfV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8IntfV(v map[int8]interface{}, checkNil bool, canChange bool, - d *Decoder) (_ map[int8]interface{}, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17) - v = make(map[int8]interface{}, xlen) - changed = true - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk int8 - var mv interface{} - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt8StringR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int8]string) - v, changed := fastpathTV.DecMapInt8StringV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int8]string) - fastpathTV.DecMapInt8StringV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt8StringX(vp *map[int8]string, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt8StringV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8StringV(v map[int8]string, checkNil bool, canChange bool, - d *Decoder) (_ map[int8]string, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17) - v = make(map[int8]string, xlen) - changed = true - } - - var mk int8 - var mv string - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt8UintR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int8]uint) - v, changed := fastpathTV.DecMapInt8UintV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int8]uint) - fastpathTV.DecMapInt8UintV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt8UintX(vp *map[int8]uint, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt8UintV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8UintV(v map[int8]uint, checkNil bool, canChange bool, - d *Decoder) (_ map[int8]uint, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[int8]uint, xlen) - changed = true - } - - var mk int8 - var mv uint - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt8Uint8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int8]uint8) - v, changed := fastpathTV.DecMapInt8Uint8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int8]uint8) - fastpathTV.DecMapInt8Uint8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt8Uint8X(vp *map[int8]uint8, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt8Uint8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8Uint8V(v map[int8]uint8, checkNil bool, canChange bool, - d *Decoder) (_ map[int8]uint8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2) - v = make(map[int8]uint8, xlen) - changed = true - } - - var mk int8 - var mv uint8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt8Uint16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int8]uint16) - v, changed := fastpathTV.DecMapInt8Uint16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int8]uint16) - fastpathTV.DecMapInt8Uint16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt8Uint16X(vp *map[int8]uint16, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt8Uint16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8Uint16V(v map[int8]uint16, checkNil bool, canChange bool, - d *Decoder) (_ map[int8]uint16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3) - v = make(map[int8]uint16, xlen) - changed = true - } - - var mk int8 - var mv uint16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt8Uint32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int8]uint32) - v, changed := fastpathTV.DecMapInt8Uint32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int8]uint32) - fastpathTV.DecMapInt8Uint32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt8Uint32X(vp *map[int8]uint32, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt8Uint32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8Uint32V(v map[int8]uint32, checkNil bool, canChange bool, - d *Decoder) (_ map[int8]uint32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[int8]uint32, xlen) - changed = true - } - - var mk int8 - var mv uint32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt8Uint64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int8]uint64) - v, changed := fastpathTV.DecMapInt8Uint64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int8]uint64) - fastpathTV.DecMapInt8Uint64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt8Uint64X(vp *map[int8]uint64, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt8Uint64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8Uint64V(v map[int8]uint64, checkNil bool, canChange bool, - d *Decoder) (_ map[int8]uint64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[int8]uint64, xlen) - changed = true - } - - var mk int8 - var mv uint64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt8UintptrR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int8]uintptr) - v, changed := fastpathTV.DecMapInt8UintptrV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int8]uintptr) - fastpathTV.DecMapInt8UintptrV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt8UintptrX(vp *map[int8]uintptr, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt8UintptrV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8UintptrV(v map[int8]uintptr, checkNil bool, canChange bool, - d *Decoder) (_ map[int8]uintptr, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[int8]uintptr, xlen) - changed = true - } - - var mk int8 - var mv uintptr - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt8IntR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int8]int) - v, changed := fastpathTV.DecMapInt8IntV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int8]int) - fastpathTV.DecMapInt8IntV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt8IntX(vp *map[int8]int, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt8IntV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8IntV(v map[int8]int, checkNil bool, canChange bool, - d *Decoder) (_ map[int8]int, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[int8]int, xlen) - changed = true - } - - var mk int8 - var mv int - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt8Int8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int8]int8) - v, changed := fastpathTV.DecMapInt8Int8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int8]int8) - fastpathTV.DecMapInt8Int8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt8Int8X(vp *map[int8]int8, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt8Int8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8Int8V(v map[int8]int8, checkNil bool, canChange bool, - d *Decoder) (_ map[int8]int8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2) - v = make(map[int8]int8, xlen) - changed = true - } - - var mk int8 - var mv int8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt8Int16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int8]int16) - v, changed := fastpathTV.DecMapInt8Int16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int8]int16) - fastpathTV.DecMapInt8Int16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt8Int16X(vp *map[int8]int16, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt8Int16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8Int16V(v map[int8]int16, checkNil bool, canChange bool, - d *Decoder) (_ map[int8]int16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3) - v = make(map[int8]int16, xlen) - changed = true - } - - var mk int8 - var mv int16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt8Int32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int8]int32) - v, changed := fastpathTV.DecMapInt8Int32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int8]int32) - fastpathTV.DecMapInt8Int32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt8Int32X(vp *map[int8]int32, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt8Int32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8Int32V(v map[int8]int32, checkNil bool, canChange bool, - d *Decoder) (_ map[int8]int32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[int8]int32, xlen) - changed = true - } - - var mk int8 - var mv int32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt8Int64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int8]int64) - v, changed := fastpathTV.DecMapInt8Int64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int8]int64) - fastpathTV.DecMapInt8Int64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt8Int64X(vp *map[int8]int64, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt8Int64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8Int64V(v map[int8]int64, checkNil bool, canChange bool, - d *Decoder) (_ map[int8]int64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[int8]int64, xlen) - changed = true - } - - var mk int8 - var mv int64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt8Float32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int8]float32) - v, changed := fastpathTV.DecMapInt8Float32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int8]float32) - fastpathTV.DecMapInt8Float32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt8Float32X(vp *map[int8]float32, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt8Float32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8Float32V(v map[int8]float32, checkNil bool, canChange bool, - d *Decoder) (_ map[int8]float32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[int8]float32, xlen) - changed = true - } - - var mk int8 - var mv float32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt8Float64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int8]float64) - v, changed := fastpathTV.DecMapInt8Float64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int8]float64) - fastpathTV.DecMapInt8Float64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt8Float64X(vp *map[int8]float64, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt8Float64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8Float64V(v map[int8]float64, checkNil bool, canChange bool, - d *Decoder) (_ map[int8]float64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[int8]float64, xlen) - changed = true - } - - var mk int8 - var mv float64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt8BoolR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int8]bool) - v, changed := fastpathTV.DecMapInt8BoolV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int8]bool) - fastpathTV.DecMapInt8BoolV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt8BoolX(vp *map[int8]bool, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt8BoolV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt8BoolV(v map[int8]bool, checkNil bool, canChange bool, - d *Decoder) (_ map[int8]bool, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2) - v = make(map[int8]bool, xlen) - changed = true - } - - var mk int8 - var mv bool - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int8(dd.DecodeInt(8)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt16IntfR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int16]interface{}) - v, changed := fastpathTV.DecMapInt16IntfV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int16]interface{}) - fastpathTV.DecMapInt16IntfV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt16IntfX(vp *map[int16]interface{}, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt16IntfV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16IntfV(v map[int16]interface{}, checkNil bool, canChange bool, - d *Decoder) (_ map[int16]interface{}, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 18) - v = make(map[int16]interface{}, xlen) - changed = true - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk int16 - var mv interface{} - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt16StringR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int16]string) - v, changed := fastpathTV.DecMapInt16StringV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int16]string) - fastpathTV.DecMapInt16StringV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt16StringX(vp *map[int16]string, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt16StringV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16StringV(v map[int16]string, checkNil bool, canChange bool, - d *Decoder) (_ map[int16]string, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 18) - v = make(map[int16]string, xlen) - changed = true - } - - var mk int16 - var mv string - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt16UintR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int16]uint) - v, changed := fastpathTV.DecMapInt16UintV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int16]uint) - fastpathTV.DecMapInt16UintV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt16UintX(vp *map[int16]uint, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt16UintV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16UintV(v map[int16]uint, checkNil bool, canChange bool, - d *Decoder) (_ map[int16]uint, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[int16]uint, xlen) - changed = true - } - - var mk int16 - var mv uint - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt16Uint8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int16]uint8) - v, changed := fastpathTV.DecMapInt16Uint8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int16]uint8) - fastpathTV.DecMapInt16Uint8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt16Uint8X(vp *map[int16]uint8, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt16Uint8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16Uint8V(v map[int16]uint8, checkNil bool, canChange bool, - d *Decoder) (_ map[int16]uint8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3) - v = make(map[int16]uint8, xlen) - changed = true - } - - var mk int16 - var mv uint8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt16Uint16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int16]uint16) - v, changed := fastpathTV.DecMapInt16Uint16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int16]uint16) - fastpathTV.DecMapInt16Uint16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt16Uint16X(vp *map[int16]uint16, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt16Uint16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16Uint16V(v map[int16]uint16, checkNil bool, canChange bool, - d *Decoder) (_ map[int16]uint16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 4) - v = make(map[int16]uint16, xlen) - changed = true - } - - var mk int16 - var mv uint16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt16Uint32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int16]uint32) - v, changed := fastpathTV.DecMapInt16Uint32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int16]uint32) - fastpathTV.DecMapInt16Uint32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt16Uint32X(vp *map[int16]uint32, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt16Uint32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16Uint32V(v map[int16]uint32, checkNil bool, canChange bool, - d *Decoder) (_ map[int16]uint32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6) - v = make(map[int16]uint32, xlen) - changed = true - } - - var mk int16 - var mv uint32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt16Uint64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int16]uint64) - v, changed := fastpathTV.DecMapInt16Uint64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int16]uint64) - fastpathTV.DecMapInt16Uint64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt16Uint64X(vp *map[int16]uint64, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt16Uint64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16Uint64V(v map[int16]uint64, checkNil bool, canChange bool, - d *Decoder) (_ map[int16]uint64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[int16]uint64, xlen) - changed = true - } - - var mk int16 - var mv uint64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt16UintptrR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int16]uintptr) - v, changed := fastpathTV.DecMapInt16UintptrV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int16]uintptr) - fastpathTV.DecMapInt16UintptrV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt16UintptrX(vp *map[int16]uintptr, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt16UintptrV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16UintptrV(v map[int16]uintptr, checkNil bool, canChange bool, - d *Decoder) (_ map[int16]uintptr, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[int16]uintptr, xlen) - changed = true - } - - var mk int16 - var mv uintptr - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt16IntR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int16]int) - v, changed := fastpathTV.DecMapInt16IntV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int16]int) - fastpathTV.DecMapInt16IntV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt16IntX(vp *map[int16]int, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt16IntV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16IntV(v map[int16]int, checkNil bool, canChange bool, - d *Decoder) (_ map[int16]int, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[int16]int, xlen) - changed = true - } - - var mk int16 - var mv int - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt16Int8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int16]int8) - v, changed := fastpathTV.DecMapInt16Int8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int16]int8) - fastpathTV.DecMapInt16Int8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt16Int8X(vp *map[int16]int8, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt16Int8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16Int8V(v map[int16]int8, checkNil bool, canChange bool, - d *Decoder) (_ map[int16]int8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3) - v = make(map[int16]int8, xlen) - changed = true - } - - var mk int16 - var mv int8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt16Int16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int16]int16) - v, changed := fastpathTV.DecMapInt16Int16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int16]int16) - fastpathTV.DecMapInt16Int16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt16Int16X(vp *map[int16]int16, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt16Int16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16Int16V(v map[int16]int16, checkNil bool, canChange bool, - d *Decoder) (_ map[int16]int16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 4) - v = make(map[int16]int16, xlen) - changed = true - } - - var mk int16 - var mv int16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt16Int32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int16]int32) - v, changed := fastpathTV.DecMapInt16Int32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int16]int32) - fastpathTV.DecMapInt16Int32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt16Int32X(vp *map[int16]int32, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt16Int32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16Int32V(v map[int16]int32, checkNil bool, canChange bool, - d *Decoder) (_ map[int16]int32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6) - v = make(map[int16]int32, xlen) - changed = true - } - - var mk int16 - var mv int32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt16Int64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int16]int64) - v, changed := fastpathTV.DecMapInt16Int64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int16]int64) - fastpathTV.DecMapInt16Int64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt16Int64X(vp *map[int16]int64, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt16Int64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16Int64V(v map[int16]int64, checkNil bool, canChange bool, - d *Decoder) (_ map[int16]int64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[int16]int64, xlen) - changed = true - } - - var mk int16 - var mv int64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt16Float32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int16]float32) - v, changed := fastpathTV.DecMapInt16Float32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int16]float32) - fastpathTV.DecMapInt16Float32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt16Float32X(vp *map[int16]float32, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt16Float32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16Float32V(v map[int16]float32, checkNil bool, canChange bool, - d *Decoder) (_ map[int16]float32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6) - v = make(map[int16]float32, xlen) - changed = true - } - - var mk int16 - var mv float32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt16Float64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int16]float64) - v, changed := fastpathTV.DecMapInt16Float64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int16]float64) - fastpathTV.DecMapInt16Float64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt16Float64X(vp *map[int16]float64, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt16Float64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16Float64V(v map[int16]float64, checkNil bool, canChange bool, - d *Decoder) (_ map[int16]float64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[int16]float64, xlen) - changed = true - } - - var mk int16 - var mv float64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt16BoolR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int16]bool) - v, changed := fastpathTV.DecMapInt16BoolV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int16]bool) - fastpathTV.DecMapInt16BoolV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt16BoolX(vp *map[int16]bool, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt16BoolV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt16BoolV(v map[int16]bool, checkNil bool, canChange bool, - d *Decoder) (_ map[int16]bool, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3) - v = make(map[int16]bool, xlen) - changed = true - } - - var mk int16 - var mv bool - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int16(dd.DecodeInt(16)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt32IntfR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int32]interface{}) - v, changed := fastpathTV.DecMapInt32IntfV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int32]interface{}) - fastpathTV.DecMapInt32IntfV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt32IntfX(vp *map[int32]interface{}, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt32IntfV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32IntfV(v map[int32]interface{}, checkNil bool, canChange bool, - d *Decoder) (_ map[int32]interface{}, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20) - v = make(map[int32]interface{}, xlen) - changed = true - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk int32 - var mv interface{} - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt32StringR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int32]string) - v, changed := fastpathTV.DecMapInt32StringV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int32]string) - fastpathTV.DecMapInt32StringV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt32StringX(vp *map[int32]string, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt32StringV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32StringV(v map[int32]string, checkNil bool, canChange bool, - d *Decoder) (_ map[int32]string, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 20) - v = make(map[int32]string, xlen) - changed = true - } - - var mk int32 - var mv string - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt32UintR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int32]uint) - v, changed := fastpathTV.DecMapInt32UintV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int32]uint) - fastpathTV.DecMapInt32UintV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt32UintX(vp *map[int32]uint, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt32UintV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32UintV(v map[int32]uint, checkNil bool, canChange bool, - d *Decoder) (_ map[int32]uint, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[int32]uint, xlen) - changed = true - } - - var mk int32 - var mv uint - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt32Uint8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int32]uint8) - v, changed := fastpathTV.DecMapInt32Uint8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int32]uint8) - fastpathTV.DecMapInt32Uint8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt32Uint8X(vp *map[int32]uint8, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt32Uint8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32Uint8V(v map[int32]uint8, checkNil bool, canChange bool, - d *Decoder) (_ map[int32]uint8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[int32]uint8, xlen) - changed = true - } - - var mk int32 - var mv uint8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt32Uint16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int32]uint16) - v, changed := fastpathTV.DecMapInt32Uint16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int32]uint16) - fastpathTV.DecMapInt32Uint16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt32Uint16X(vp *map[int32]uint16, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt32Uint16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32Uint16V(v map[int32]uint16, checkNil bool, canChange bool, - d *Decoder) (_ map[int32]uint16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6) - v = make(map[int32]uint16, xlen) - changed = true - } - - var mk int32 - var mv uint16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt32Uint32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int32]uint32) - v, changed := fastpathTV.DecMapInt32Uint32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int32]uint32) - fastpathTV.DecMapInt32Uint32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt32Uint32X(vp *map[int32]uint32, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt32Uint32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32Uint32V(v map[int32]uint32, checkNil bool, canChange bool, - d *Decoder) (_ map[int32]uint32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8) - v = make(map[int32]uint32, xlen) - changed = true - } - - var mk int32 - var mv uint32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt32Uint64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int32]uint64) - v, changed := fastpathTV.DecMapInt32Uint64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int32]uint64) - fastpathTV.DecMapInt32Uint64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt32Uint64X(vp *map[int32]uint64, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt32Uint64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32Uint64V(v map[int32]uint64, checkNil bool, canChange bool, - d *Decoder) (_ map[int32]uint64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[int32]uint64, xlen) - changed = true - } - - var mk int32 - var mv uint64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt32UintptrR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int32]uintptr) - v, changed := fastpathTV.DecMapInt32UintptrV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int32]uintptr) - fastpathTV.DecMapInt32UintptrV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt32UintptrX(vp *map[int32]uintptr, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt32UintptrV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32UintptrV(v map[int32]uintptr, checkNil bool, canChange bool, - d *Decoder) (_ map[int32]uintptr, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[int32]uintptr, xlen) - changed = true - } - - var mk int32 - var mv uintptr - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt32IntR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int32]int) - v, changed := fastpathTV.DecMapInt32IntV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int32]int) - fastpathTV.DecMapInt32IntV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt32IntX(vp *map[int32]int, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt32IntV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32IntV(v map[int32]int, checkNil bool, canChange bool, - d *Decoder) (_ map[int32]int, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[int32]int, xlen) - changed = true - } - - var mk int32 - var mv int - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt32Int8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int32]int8) - v, changed := fastpathTV.DecMapInt32Int8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int32]int8) - fastpathTV.DecMapInt32Int8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt32Int8X(vp *map[int32]int8, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt32Int8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32Int8V(v map[int32]int8, checkNil bool, canChange bool, - d *Decoder) (_ map[int32]int8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[int32]int8, xlen) - changed = true - } - - var mk int32 - var mv int8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt32Int16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int32]int16) - v, changed := fastpathTV.DecMapInt32Int16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int32]int16) - fastpathTV.DecMapInt32Int16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt32Int16X(vp *map[int32]int16, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt32Int16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32Int16V(v map[int32]int16, checkNil bool, canChange bool, - d *Decoder) (_ map[int32]int16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 6) - v = make(map[int32]int16, xlen) - changed = true - } - - var mk int32 - var mv int16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt32Int32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int32]int32) - v, changed := fastpathTV.DecMapInt32Int32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int32]int32) - fastpathTV.DecMapInt32Int32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt32Int32X(vp *map[int32]int32, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt32Int32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32Int32V(v map[int32]int32, checkNil bool, canChange bool, - d *Decoder) (_ map[int32]int32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8) - v = make(map[int32]int32, xlen) - changed = true - } - - var mk int32 - var mv int32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt32Int64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int32]int64) - v, changed := fastpathTV.DecMapInt32Int64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int32]int64) - fastpathTV.DecMapInt32Int64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt32Int64X(vp *map[int32]int64, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt32Int64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32Int64V(v map[int32]int64, checkNil bool, canChange bool, - d *Decoder) (_ map[int32]int64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[int32]int64, xlen) - changed = true - } - - var mk int32 - var mv int64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt32Float32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int32]float32) - v, changed := fastpathTV.DecMapInt32Float32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int32]float32) - fastpathTV.DecMapInt32Float32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt32Float32X(vp *map[int32]float32, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt32Float32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32Float32V(v map[int32]float32, checkNil bool, canChange bool, - d *Decoder) (_ map[int32]float32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 8) - v = make(map[int32]float32, xlen) - changed = true - } - - var mk int32 - var mv float32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt32Float64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int32]float64) - v, changed := fastpathTV.DecMapInt32Float64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int32]float64) - fastpathTV.DecMapInt32Float64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt32Float64X(vp *map[int32]float64, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt32Float64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32Float64V(v map[int32]float64, checkNil bool, canChange bool, - d *Decoder) (_ map[int32]float64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[int32]float64, xlen) - changed = true - } - - var mk int32 - var mv float64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt32BoolR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int32]bool) - v, changed := fastpathTV.DecMapInt32BoolV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int32]bool) - fastpathTV.DecMapInt32BoolV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt32BoolX(vp *map[int32]bool, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt32BoolV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt32BoolV(v map[int32]bool, checkNil bool, canChange bool, - d *Decoder) (_ map[int32]bool, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[int32]bool, xlen) - changed = true - } - - var mk int32 - var mv bool - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = int32(dd.DecodeInt(32)) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt64IntfR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int64]interface{}) - v, changed := fastpathTV.DecMapInt64IntfV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int64]interface{}) - fastpathTV.DecMapInt64IntfV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt64IntfX(vp *map[int64]interface{}, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt64IntfV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64IntfV(v map[int64]interface{}, checkNil bool, canChange bool, - d *Decoder) (_ map[int64]interface{}, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[int64]interface{}, xlen) - changed = true - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk int64 - var mv interface{} - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt64StringR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int64]string) - v, changed := fastpathTV.DecMapInt64StringV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int64]string) - fastpathTV.DecMapInt64StringV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt64StringX(vp *map[int64]string, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt64StringV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64StringV(v map[int64]string, checkNil bool, canChange bool, - d *Decoder) (_ map[int64]string, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 24) - v = make(map[int64]string, xlen) - changed = true - } - - var mk int64 - var mv string - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt64UintR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int64]uint) - v, changed := fastpathTV.DecMapInt64UintV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int64]uint) - fastpathTV.DecMapInt64UintV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt64UintX(vp *map[int64]uint, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt64UintV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64UintV(v map[int64]uint, checkNil bool, canChange bool, - d *Decoder) (_ map[int64]uint, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[int64]uint, xlen) - changed = true - } - - var mk int64 - var mv uint - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt64Uint8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int64]uint8) - v, changed := fastpathTV.DecMapInt64Uint8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int64]uint8) - fastpathTV.DecMapInt64Uint8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt64Uint8X(vp *map[int64]uint8, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt64Uint8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64Uint8V(v map[int64]uint8, checkNil bool, canChange bool, - d *Decoder) (_ map[int64]uint8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[int64]uint8, xlen) - changed = true - } - - var mk int64 - var mv uint8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt64Uint16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int64]uint16) - v, changed := fastpathTV.DecMapInt64Uint16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int64]uint16) - fastpathTV.DecMapInt64Uint16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt64Uint16X(vp *map[int64]uint16, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt64Uint16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64Uint16V(v map[int64]uint16, checkNil bool, canChange bool, - d *Decoder) (_ map[int64]uint16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[int64]uint16, xlen) - changed = true - } - - var mk int64 - var mv uint16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt64Uint32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int64]uint32) - v, changed := fastpathTV.DecMapInt64Uint32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int64]uint32) - fastpathTV.DecMapInt64Uint32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt64Uint32X(vp *map[int64]uint32, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt64Uint32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64Uint32V(v map[int64]uint32, checkNil bool, canChange bool, - d *Decoder) (_ map[int64]uint32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[int64]uint32, xlen) - changed = true - } - - var mk int64 - var mv uint32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt64Uint64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int64]uint64) - v, changed := fastpathTV.DecMapInt64Uint64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int64]uint64) - fastpathTV.DecMapInt64Uint64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt64Uint64X(vp *map[int64]uint64, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt64Uint64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64Uint64V(v map[int64]uint64, checkNil bool, canChange bool, - d *Decoder) (_ map[int64]uint64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[int64]uint64, xlen) - changed = true - } - - var mk int64 - var mv uint64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt64UintptrR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int64]uintptr) - v, changed := fastpathTV.DecMapInt64UintptrV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int64]uintptr) - fastpathTV.DecMapInt64UintptrV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt64UintptrX(vp *map[int64]uintptr, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt64UintptrV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64UintptrV(v map[int64]uintptr, checkNil bool, canChange bool, - d *Decoder) (_ map[int64]uintptr, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[int64]uintptr, xlen) - changed = true - } - - var mk int64 - var mv uintptr - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt64IntR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int64]int) - v, changed := fastpathTV.DecMapInt64IntV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int64]int) - fastpathTV.DecMapInt64IntV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt64IntX(vp *map[int64]int, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt64IntV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64IntV(v map[int64]int, checkNil bool, canChange bool, - d *Decoder) (_ map[int64]int, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[int64]int, xlen) - changed = true - } - - var mk int64 - var mv int - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt64Int8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int64]int8) - v, changed := fastpathTV.DecMapInt64Int8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int64]int8) - fastpathTV.DecMapInt64Int8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt64Int8X(vp *map[int64]int8, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt64Int8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64Int8V(v map[int64]int8, checkNil bool, canChange bool, - d *Decoder) (_ map[int64]int8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[int64]int8, xlen) - changed = true - } - - var mk int64 - var mv int8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt64Int16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int64]int16) - v, changed := fastpathTV.DecMapInt64Int16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int64]int16) - fastpathTV.DecMapInt64Int16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt64Int16X(vp *map[int64]int16, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt64Int16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64Int16V(v map[int64]int16, checkNil bool, canChange bool, - d *Decoder) (_ map[int64]int16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 10) - v = make(map[int64]int16, xlen) - changed = true - } - - var mk int64 - var mv int16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt64Int32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int64]int32) - v, changed := fastpathTV.DecMapInt64Int32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int64]int32) - fastpathTV.DecMapInt64Int32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt64Int32X(vp *map[int64]int32, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt64Int32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64Int32V(v map[int64]int32, checkNil bool, canChange bool, - d *Decoder) (_ map[int64]int32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[int64]int32, xlen) - changed = true - } - - var mk int64 - var mv int32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt64Int64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int64]int64) - v, changed := fastpathTV.DecMapInt64Int64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int64]int64) - fastpathTV.DecMapInt64Int64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt64Int64X(vp *map[int64]int64, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt64Int64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64Int64V(v map[int64]int64, checkNil bool, canChange bool, - d *Decoder) (_ map[int64]int64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[int64]int64, xlen) - changed = true - } - - var mk int64 - var mv int64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt64Float32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int64]float32) - v, changed := fastpathTV.DecMapInt64Float32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int64]float32) - fastpathTV.DecMapInt64Float32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt64Float32X(vp *map[int64]float32, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt64Float32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64Float32V(v map[int64]float32, checkNil bool, canChange bool, - d *Decoder) (_ map[int64]float32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 12) - v = make(map[int64]float32, xlen) - changed = true - } - - var mk int64 - var mv float32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt64Float64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int64]float64) - v, changed := fastpathTV.DecMapInt64Float64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int64]float64) - fastpathTV.DecMapInt64Float64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt64Float64X(vp *map[int64]float64, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt64Float64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64Float64V(v map[int64]float64, checkNil bool, canChange bool, - d *Decoder) (_ map[int64]float64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 16) - v = make(map[int64]float64, xlen) - changed = true - } - - var mk int64 - var mv float64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapInt64BoolR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[int64]bool) - v, changed := fastpathTV.DecMapInt64BoolV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[int64]bool) - fastpathTV.DecMapInt64BoolV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapInt64BoolX(vp *map[int64]bool, checkNil bool, d *Decoder) { - v, changed := f.DecMapInt64BoolV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapInt64BoolV(v map[int64]bool, checkNil bool, canChange bool, - d *Decoder) (_ map[int64]bool, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[int64]bool, xlen) - changed = true - } - - var mk int64 - var mv bool - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeInt(64) - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapBoolIntfR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[bool]interface{}) - v, changed := fastpathTV.DecMapBoolIntfV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[bool]interface{}) - fastpathTV.DecMapBoolIntfV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapBoolIntfX(vp *map[bool]interface{}, checkNil bool, d *Decoder) { - v, changed := f.DecMapBoolIntfV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolIntfV(v map[bool]interface{}, checkNil bool, canChange bool, - d *Decoder) (_ map[bool]interface{}, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17) - v = make(map[bool]interface{}, xlen) - changed = true - } - mapGet := !d.h.MapValueReset && !d.h.InterfaceReset - var mk bool - var mv interface{} - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - if mapGet { - mv = v[mk] - } else { - mv = nil - } - d.decode(&mv) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapBoolStringR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[bool]string) - v, changed := fastpathTV.DecMapBoolStringV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[bool]string) - fastpathTV.DecMapBoolStringV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapBoolStringX(vp *map[bool]string, checkNil bool, d *Decoder) { - v, changed := f.DecMapBoolStringV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolStringV(v map[bool]string, checkNil bool, canChange bool, - d *Decoder) (_ map[bool]string, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 17) - v = make(map[bool]string, xlen) - changed = true - } - - var mk bool - var mv string - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeString() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapBoolUintR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[bool]uint) - v, changed := fastpathTV.DecMapBoolUintV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[bool]uint) - fastpathTV.DecMapBoolUintV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapBoolUintX(vp *map[bool]uint, checkNil bool, d *Decoder) { - v, changed := f.DecMapBoolUintV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolUintV(v map[bool]uint, checkNil bool, canChange bool, - d *Decoder) (_ map[bool]uint, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[bool]uint, xlen) - changed = true - } - - var mk bool - var mv uint - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapBoolUint8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[bool]uint8) - v, changed := fastpathTV.DecMapBoolUint8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[bool]uint8) - fastpathTV.DecMapBoolUint8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapBoolUint8X(vp *map[bool]uint8, checkNil bool, d *Decoder) { - v, changed := f.DecMapBoolUint8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolUint8V(v map[bool]uint8, checkNil bool, canChange bool, - d *Decoder) (_ map[bool]uint8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2) - v = make(map[bool]uint8, xlen) - changed = true - } - - var mk bool - var mv uint8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint8(dd.DecodeUint(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapBoolUint16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[bool]uint16) - v, changed := fastpathTV.DecMapBoolUint16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[bool]uint16) - fastpathTV.DecMapBoolUint16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapBoolUint16X(vp *map[bool]uint16, checkNil bool, d *Decoder) { - v, changed := f.DecMapBoolUint16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolUint16V(v map[bool]uint16, checkNil bool, canChange bool, - d *Decoder) (_ map[bool]uint16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3) - v = make(map[bool]uint16, xlen) - changed = true - } - - var mk bool - var mv uint16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint16(dd.DecodeUint(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapBoolUint32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[bool]uint32) - v, changed := fastpathTV.DecMapBoolUint32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[bool]uint32) - fastpathTV.DecMapBoolUint32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapBoolUint32X(vp *map[bool]uint32, checkNil bool, d *Decoder) { - v, changed := f.DecMapBoolUint32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolUint32V(v map[bool]uint32, checkNil bool, canChange bool, - d *Decoder) (_ map[bool]uint32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[bool]uint32, xlen) - changed = true - } - - var mk bool - var mv uint32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uint32(dd.DecodeUint(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapBoolUint64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[bool]uint64) - v, changed := fastpathTV.DecMapBoolUint64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[bool]uint64) - fastpathTV.DecMapBoolUint64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapBoolUint64X(vp *map[bool]uint64, checkNil bool, d *Decoder) { - v, changed := f.DecMapBoolUint64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolUint64V(v map[bool]uint64, checkNil bool, canChange bool, - d *Decoder) (_ map[bool]uint64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[bool]uint64, xlen) - changed = true - } - - var mk bool - var mv uint64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeUint(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapBoolUintptrR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[bool]uintptr) - v, changed := fastpathTV.DecMapBoolUintptrV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[bool]uintptr) - fastpathTV.DecMapBoolUintptrV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapBoolUintptrX(vp *map[bool]uintptr, checkNil bool, d *Decoder) { - v, changed := f.DecMapBoolUintptrV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolUintptrV(v map[bool]uintptr, checkNil bool, canChange bool, - d *Decoder) (_ map[bool]uintptr, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[bool]uintptr, xlen) - changed = true - } - - var mk bool - var mv uintptr - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = uintptr(dd.DecodeUint(uintBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapBoolIntR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[bool]int) - v, changed := fastpathTV.DecMapBoolIntV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[bool]int) - fastpathTV.DecMapBoolIntV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapBoolIntX(vp *map[bool]int, checkNil bool, d *Decoder) { - v, changed := f.DecMapBoolIntV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolIntV(v map[bool]int, checkNil bool, canChange bool, - d *Decoder) (_ map[bool]int, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[bool]int, xlen) - changed = true - } - - var mk bool - var mv int - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int(dd.DecodeInt(intBitsize)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapBoolInt8R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[bool]int8) - v, changed := fastpathTV.DecMapBoolInt8V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[bool]int8) - fastpathTV.DecMapBoolInt8V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapBoolInt8X(vp *map[bool]int8, checkNil bool, d *Decoder) { - v, changed := f.DecMapBoolInt8V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolInt8V(v map[bool]int8, checkNil bool, canChange bool, - d *Decoder) (_ map[bool]int8, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2) - v = make(map[bool]int8, xlen) - changed = true - } - - var mk bool - var mv int8 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int8(dd.DecodeInt(8)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapBoolInt16R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[bool]int16) - v, changed := fastpathTV.DecMapBoolInt16V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[bool]int16) - fastpathTV.DecMapBoolInt16V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapBoolInt16X(vp *map[bool]int16, checkNil bool, d *Decoder) { - v, changed := f.DecMapBoolInt16V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolInt16V(v map[bool]int16, checkNil bool, canChange bool, - d *Decoder) (_ map[bool]int16, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 3) - v = make(map[bool]int16, xlen) - changed = true - } - - var mk bool - var mv int16 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int16(dd.DecodeInt(16)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapBoolInt32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[bool]int32) - v, changed := fastpathTV.DecMapBoolInt32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[bool]int32) - fastpathTV.DecMapBoolInt32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapBoolInt32X(vp *map[bool]int32, checkNil bool, d *Decoder) { - v, changed := f.DecMapBoolInt32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolInt32V(v map[bool]int32, checkNil bool, canChange bool, - d *Decoder) (_ map[bool]int32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[bool]int32, xlen) - changed = true - } - - var mk bool - var mv int32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = int32(dd.DecodeInt(32)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapBoolInt64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[bool]int64) - v, changed := fastpathTV.DecMapBoolInt64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[bool]int64) - fastpathTV.DecMapBoolInt64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapBoolInt64X(vp *map[bool]int64, checkNil bool, d *Decoder) { - v, changed := f.DecMapBoolInt64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolInt64V(v map[bool]int64, checkNil bool, canChange bool, - d *Decoder) (_ map[bool]int64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[bool]int64, xlen) - changed = true - } - - var mk bool - var mv int64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeInt(64) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapBoolFloat32R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[bool]float32) - v, changed := fastpathTV.DecMapBoolFloat32V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[bool]float32) - fastpathTV.DecMapBoolFloat32V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapBoolFloat32X(vp *map[bool]float32, checkNil bool, d *Decoder) { - v, changed := f.DecMapBoolFloat32V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolFloat32V(v map[bool]float32, checkNil bool, canChange bool, - d *Decoder) (_ map[bool]float32, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 5) - v = make(map[bool]float32, xlen) - changed = true - } - - var mk bool - var mv float32 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = float32(dd.DecodeFloat(true)) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapBoolFloat64R(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[bool]float64) - v, changed := fastpathTV.DecMapBoolFloat64V(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[bool]float64) - fastpathTV.DecMapBoolFloat64V(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapBoolFloat64X(vp *map[bool]float64, checkNil bool, d *Decoder) { - v, changed := f.DecMapBoolFloat64V(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolFloat64V(v map[bool]float64, checkNil bool, canChange bool, - d *Decoder) (_ map[bool]float64, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 9) - v = make(map[bool]float64, xlen) - changed = true - } - - var mk bool - var mv float64 - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeFloat(false) - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} - -func (f *decFnInfo) fastpathDecMapBoolBoolR(rv reflect.Value) { - if rv.CanAddr() { - vp := rv.Addr().Interface().(*map[bool]bool) - v, changed := fastpathTV.DecMapBoolBoolV(*vp, fastpathCheckNilFalse, true, f.d) - if changed { - *vp = v - } - } else { - v := rv.Interface().(map[bool]bool) - fastpathTV.DecMapBoolBoolV(v, fastpathCheckNilFalse, false, f.d) - } -} -func (f fastpathT) DecMapBoolBoolX(vp *map[bool]bool, checkNil bool, d *Decoder) { - v, changed := f.DecMapBoolBoolV(*vp, checkNil, true, d) - if changed { - *vp = v - } -} -func (_ fastpathT) DecMapBoolBoolV(v map[bool]bool, checkNil bool, canChange bool, - d *Decoder) (_ map[bool]bool, changed bool) { - dd := d.d - cr := d.cr - - if checkNil && dd.TryDecodeAsNil() { - if v != nil { - changed = true - } - return nil, changed - } - - containerLen := dd.ReadMapStart() - if canChange && v == nil { - xlen, _ := decInferLen(containerLen, d.h.MaxInitLen, 2) - v = make(map[bool]bool, xlen) - changed = true - } - - var mk bool - var mv bool - if containerLen > 0 { - for j := 0; j < containerLen; j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } else if containerLen < 0 { - for j := 0; !dd.CheckBreak(); j++ { - if cr != nil { - cr.sendContainerState(containerMapKey) - } - mk = dd.DecodeBool() - if cr != nil { - cr.sendContainerState(containerMapValue) - } - mv = dd.DecodeBool() - if v != nil { - v[mk] = mv - } - } - } - if cr != nil { - cr.sendContainerState(containerMapEnd) - } - return v, changed -} diff --git a/_vendor/vendor/github.com/ugorji/go/codec/gen.generated.go b/_vendor/vendor/github.com/ugorji/go/codec/gen.generated.go deleted file mode 100644 index 2ace97b..0000000 --- a/_vendor/vendor/github.com/ugorji/go/codec/gen.generated.go +++ /dev/null @@ -1,175 +0,0 @@ -// 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 - -// 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"}} {{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 { -for {{var "j"}} := 0; {{var "j"}} < {{var "l"}}; {{var "j"}}++ { - 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}} - z.DecSendContainerState(codecSelfer_containerMapValue{{ .Sfx }}) - {{ $x := printf "%vmv%v" .TempVar .Rand }}{{ decLineVar $x }} - if {{if decElemKindPtr}} {{var "ms"}} && {{end}} {{var "v"}} != nil { - {{var "v"}}[{{var "mk"}}] = {{var "mv"}} - } -} -} else if {{var "l"}} < 0 { -for {{var "j"}} := 0; !r.CheckBreak(); {{var "j"}}++ { - 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}} - z.DecSendContainerState(codecSelfer_containerMapValue{{ .Sfx }}) - {{ $x := printf "%vmv%v" .TempVar .Rand }}{{ decLineVar $x }} - if {{if decElemKindPtr}} {{var "ms"}} && {{end}} {{var "v"}} != nil { - {{var "v"}}[{{var "mk"}}] = {{var "mv"}} - } -} -} // else len==0: TODO: Should we clear map entries? -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 - } {{end}} {{if isChan }}if {{var "v"}} == nil { - {{var "v"}} = make({{ .CTyp }}, 0) - {{var "c"}} = true - } {{end}} -} else if {{var "l"}} > 0 { - {{if isChan }}if {{var "v"}} == nil { - {{var "rl"}}, _ = z.DecInferLen({{var "l"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }}) - {{var "v"}} = make({{ .CTyp }}, {{var "rl"}}) - {{var "c"}} = true - } - for {{var "r"}} := 0; {{var "r"}} < {{var "l"}}; {{var "r"}}++ { - {{var "h"}}.ElemContainerState({{var "r"}}) - var {{var "t"}} {{ .Typ }} - {{ $x := printf "%st%s" .TempVar .Rand }}{{ decLineVar $x }} - {{var "v"}} <- {{var "t"}} - } - {{ else }} var {{var "rr"}}, {{var "rl"}} int {{/* // num2read, length of slice/array/chan */}} - var {{var "rt"}} bool {{/* truncated */}} - _, _ = {{var "rl"}}, {{var "rt"}} - {{var "rr"}} = {{var "l"}} // len({{var "v"}}) - if {{var "l"}} > cap({{var "v"}}) { - {{if isArray }}z.DecArrayCannotExpand(len({{var "v"}}), {{var "l"}}) - {{ else }}{{if not .Immutable }} - {{var "rg"}} := len({{var "v"}}) > 0 - {{var "v2"}} := {{var "v"}} {{end}} - {{var "rl"}}, {{var "rt"}} = z.DecInferLen({{var "l"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }}) - if {{var "rt"}} { - if {{var "rl"}} <= cap({{var "v"}}) { - {{var "v"}} = {{var "v"}}[:{{var "rl"}}] - } else { - {{var "v"}} = make([]{{ .Typ }}, {{var "rl"}}) - } - } else { - {{var "v"}} = make([]{{ .Typ }}, {{var "rl"}}) - } - {{var "c"}} = true - {{var "rr"}} = len({{var "v"}}) {{if not .Immutable }} - if {{var "rg"}} { copy({{var "v"}}, {{var "v2"}}) } {{end}} {{end}}{{/* end not Immutable, isArray */}} - } {{if isSlice }} else if {{var "l"}} != len({{var "v"}}) { - {{var "v"}} = {{var "v"}}[:{{var "l"}}] - {{var "c"}} = true - } {{end}} {{/* end isSlice:47 */}} - {{var "j"}} := 0 - for ; {{var "j"}} < {{var "rr"}} ; {{var "j"}}++ { - {{var "h"}}.ElemContainerState({{var "j"}}) - {{ $x := printf "%[1]vv%[2]v[%[1]vj%[2]v]" .TempVar .Rand }}{{ decLineVar $x }} - } - {{if isArray }}for ; {{var "j"}} < {{var "l"}} ; {{var "j"}}++ { - {{var "h"}}.ElemContainerState({{var "j"}}) - z.DecSwallow() - } - {{ else }}if {{var "rt"}} { - for ; {{var "j"}} < {{var "l"}} ; {{var "j"}}++ { - {{var "v"}} = append({{var "v"}}, {{ zero}}) - {{var "h"}}.ElemContainerState({{var "j"}}) - {{ $x := printf "%[1]vv%[2]v[%[1]vj%[2]v]" .TempVar .Rand }}{{ decLineVar $x }} - } - } {{end}} {{/* end isArray:56 */}} - {{end}} {{/* end isChan:16 */}} -} else { {{/* len < 0 */}} - {{var "j"}} := 0 - for ; !r.CheckBreak(); {{var "j"}}++ { - {{if isChan }} - {{var "h"}}.ElemContainerState({{var "j"}}) - var {{var "t"}} {{ .Typ }} - {{ $x := printf "%st%s" .TempVar .Rand }}{{ decLineVar $x }} - {{var "v"}} <- {{var "t"}} - {{ else }} - if {{var "j"}} >= len({{var "v"}}) { - {{if isArray }}z.DecArrayCannotExpand(len({{var "v"}}), {{var "j"}}+1) - {{ else }}{{var "v"}} = append({{var "v"}}, {{zero}})// var {{var "z"}} {{ .Typ }} - {{var "c"}} = true {{end}} - } - {{var "h"}}.ElemContainerState({{var "j"}}) - if {{var "j"}} < len({{var "v"}}) { - {{ $x := printf "%[1]vv%[2]v[%[1]vj%[2]v]" .TempVar .Rand }}{{ decLineVar $x }} - } else { - z.DecSwallow() - } - {{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"}} = []{{ .Typ }}{} - {{var "c"}} = true - }{{end}} -} -{{var "h"}}.End() -{{if not isArray }}if {{var "c"}} { - *{{ .Varname }} = {{var "v"}} -}{{end}} -` - diff --git a/_vendor/vendor/github.com/ugorji/go/codec/helper_not_unsafe.go b/_vendor/vendor/github.com/ugorji/go/codec/helper_not_unsafe.go deleted file mode 100644 index 7c2ffc0..0000000 --- a/_vendor/vendor/github.com/ugorji/go/codec/helper_not_unsafe.go +++ /dev/null @@ -1,20 +0,0 @@ -//+build !unsafe - -// 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 - -// 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. -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. -func bytesView(v string) []byte { - return []byte(v) -} diff --git a/_vendor/vendor/github.com/ugorji/go/codec/helper_unsafe.go b/_vendor/vendor/github.com/ugorji/go/codec/helper_unsafe.go deleted file mode 100644 index 2928e4f..0000000 --- a/_vendor/vendor/github.com/ugorji/go/codec/helper_unsafe.go +++ /dev/null @@ -1,49 +0,0 @@ -//+build unsafe - -// 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 - -import ( - "unsafe" -) - -// This file has unsafe variants of some helper methods. - -type unsafeString struct { - Data uintptr - Len int -} - -type unsafeSlice struct { - Data uintptr - Len int - Cap int -} - -// 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. -func stringView(v []byte) string { - if len(v) == 0 { - return "" - } - - bx := (*unsafeSlice)(unsafe.Pointer(&v)) - sx := unsafeString{bx.Data, bx.Len} - return *(*string)(unsafe.Pointer(&sx)) -} - -// 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. -func bytesView(v string) []byte { - if len(v) == 0 { - return zeroByteSlice - } - - sx := (*unsafeString)(unsafe.Pointer(&v)) - bx := unsafeSlice{sx.Data, sx.Len, sx.Len} - return *(*[]byte)(unsafe.Pointer(&bx)) -} diff --git a/_vendor/vendor/github.com/ugorji/go/codec/json.go b/_vendor/vendor/github.com/ugorji/go/codec/json.go deleted file mode 100644 index a04dfcb..0000000 --- a/_vendor/vendor/github.com/ugorji/go/codec/json.go +++ /dev/null @@ -1,1213 +0,0 @@ -// 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 - -// 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. -// - Also, strconv.ParseXXX for floats and integers -// - only works on strings resulting in unnecessary allocation and []byte-string conversion. -// - it does a lot of redundant checks, because json numbers are simpler that what it supports. -// - We parse numbers (floats and integers) directly here. -// We only delegate parsing floats if it is a hairy float which could cause a loss of precision. -// In that case, we delegate to strconv.ParseFloat. -// -// Note: -// - encode does not beautify. There is no whitespace when encoding. -// - rpc calls which take single integer arguments or write single numeric arguments will need care. - -// Top-level methods of json(End|Dec)Driver (which are implementations of (en|de)cDriver -// MUST not call one-another. - -import ( - "bytes" - "encoding/base64" - "fmt" - "reflect" - "strconv" - "unicode/utf16" - "unicode/utf8" -) - -//-------------------------------- - -var ( - jsonLiterals = [...]byte{'t', 'r', 'u', 'e', 'f', 'a', 'l', 's', 'e', 'n', 'u', 'l', 'l'} - - jsonFloat64Pow10 = [...]float64{ - 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, - 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, - 1e20, 1e21, 1e22, - } - - jsonUint64Pow10 = [...]uint64{ - 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, - 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, - } - - // jsonTabs and jsonSpaces are used as caches for indents - jsonTabs, jsonSpaces string -) - -const ( - // jsonUnreadAfterDecNum controls whether we unread after decoding a number. - // - // instead of unreading, just update d.tok (iff it's not a whitespace char) - // However, doing this means that we may HOLD onto some data which belongs to another stream. - // Thus, it is safest to unread the data when done. - // keep behind a constant flag for now. - jsonUnreadAfterDecNum = true - - // 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 - - // if jsonTruncateMantissa, truncate mantissa if trailing 0's. - // This is important because it could allow some floats to be decoded without - // deferring to strconv.ParseFloat. - jsonTruncateMantissa = true - - // if mantissa >= jsonNumUintCutoff before multiplying by 10, this is an overflow - jsonNumUintCutoff = (1<<64-1)/uint64(10) + 1 // cutoff64(base) - - // if mantissa >= jsonNumUintMaxVal, this is an overflow - jsonNumUintMaxVal = 1< 1<<53 || v < -(1<<53)) { - e.w.writen1('"') - e.w.writeb(strconv.AppendInt(e.b[:0], v, 10)) - e.w.writen1('"') - return - } - e.w.writeb(strconv.AppendInt(e.b[:0], v, 10)) -} - -func (e *jsonEncDriver) EncodeUint(v uint64) { - if x := e.h.IntegerAsString; x == 'A' || x == 'L' && v > 1<<53 { - e.w.writen1('"') - e.w.writeb(strconv.AppendUint(e.b[:0], v, 10)) - e.w.writen1('"') - return - } - e.w.writeb(strconv.AppendUint(e.b[:0], v, 10)) -} - -func (e *jsonEncDriver) EncodeExt(rv interface{}, xtag uint64, ext Ext, en *Encoder) { - if v := ext.ConvertExt(rv); v == nil { - e.w.writeb(jsonLiterals[9:13]) // null // 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.w.writeb(jsonLiterals[9:13]) // null // e.EncodeNil() - } else { - en.encode(re.Value) - } -} - -func (e *jsonEncDriver) EncodeArrayStart(length int) { - if e.d { - e.dl++ - } - e.w.writen1('[') - e.c = containerArrayStart -} - -func (e *jsonEncDriver) EncodeMapStart(length int) { - if e.d { - e.dl++ - } - e.w.writen1('{') - e.c = containerMapStart -} - -func (e *jsonEncDriver) EncodeString(c charEncoding, v string) { - // e.w.writestr(strconv.Quote(v)) - e.quoteStr(v) -} - -func (e *jsonEncDriver) EncodeSymbol(v string) { - // e.EncodeString(c_UTF8, v) - e.quoteStr(v) -} - -func (e *jsonEncDriver) EncodeStringBytes(c charEncoding, v []byte) { - // if encoding raw bytes and RawBytesExt is configured, use it to encode - if c == c_RAW && e.se.i != nil { - e.EncodeExt(v, 0, &e.se, e.e) - return - } - if c == c_RAW { - slen := base64.StdEncoding.EncodedLen(len(v)) - if cap(e.bs) >= slen { - e.bs = e.bs[:slen] - } else { - e.bs = make([]byte, slen) - } - base64.StdEncoding.Encode(e.bs, v) - e.w.writen1('"') - e.w.writeb(e.bs) - e.w.writen1('"') - } else { - // e.EncodeString(c, string(v)) - e.quoteStr(stringView(v)) - } -} - -func (e *jsonEncDriver) EncodeAsis(v []byte) { - e.w.writeb(v) -} - -func (e *jsonEncDriver) quoteStr(s string) { - // adapted from std pkg encoding/json - const hex = "0123456789abcdef" - w := e.w - w.writen1('"') - start := 0 - for i := 0; i < len(s); { - if b := s[i]; b < utf8.RuneSelf { - if 0x20 <= b && b != '\\' && b != '"' && b != '<' && b != '>' && 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: - // encode all bytes < 0x20 (except \r, \n). - // also encode < > & to prevent security holes when served to some browsers. - 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. - 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 jsonNum struct { - // bytes []byte // may have [+-.eE0-9] - mantissa uint64 // where mantissa ends, and maybe dot begins. - exponent int16 // exponent value. - manOverflow bool - neg bool // started with -. No initial sign in the bytes above. - dot bool // has dot - explicitExponent bool // explicit exponent -} - -func (x *jsonNum) reset() { - x.manOverflow = false - x.neg = false - x.dot = false - x.explicitExponent = false - x.mantissa = 0 - x.exponent = 0 -} - -// uintExp is called only if exponent > 0. -func (x *jsonNum) uintExp() (n uint64, overflow bool) { - n = x.mantissa - e := x.exponent - if e >= int16(len(jsonUint64Pow10)) { - overflow = true - return - } - n *= jsonUint64Pow10[e] - if n < x.mantissa || n > jsonNumUintMaxVal { - overflow = true - return - } - return - // for i := int16(0); i < e; i++ { - // if n >= jsonNumUintCutoff { - // overflow = true - // return - // } - // n *= 10 - // } - // return -} - -// these constants are only used withn floatVal. -// They are brought out, so that floatVal can be inlined. -const ( - jsonUint64MantissaBits = 52 - jsonMaxExponent = int16(len(jsonFloat64Pow10)) - 1 -) - -func (x *jsonNum) floatVal() (f float64, parseUsingStrConv bool) { - // We do not want to lose precision. - // Consequently, we will delegate to strconv.ParseFloat if any of the following happen: - // - There are more digits than in math.MaxUint64: 18446744073709551615 (20 digits) - // We expect up to 99.... (19 digits) - // - The mantissa cannot fit into a 52 bits of uint64 - // - The exponent is beyond our scope ie beyong 22. - parseUsingStrConv = x.manOverflow || - x.exponent > jsonMaxExponent || - (x.exponent < 0 && -(x.exponent) > jsonMaxExponent) || - x.mantissa>>jsonUint64MantissaBits != 0 - - if parseUsingStrConv { - return - } - - // all good. so handle parse here. - f = float64(x.mantissa) - // fmt.Printf(".Float: uint64 value: %v, float: %v\n", m, f) - if x.neg { - f = -f - } - if x.exponent > 0 { - f *= jsonFloat64Pow10[x.exponent] - } else if x.exponent < 0 { - f /= jsonFloat64Pow10[-x.exponent] - } - return -} - -type jsonDecDriver struct { - noBuiltInTypes - d *Decoder - h *JsonHandle - r decReader - - c containerState - // tok is used to store the token read right after skipWhiteSpace. - tok uint8 - - bstr [8]byte // scratch used for string \UXXX parsing - b [64]byte // scratch, used for parsing strings or numbers - b2 [64]byte // scratch, used only for decodeBytes (after base64) - bs []byte // scratch. Initialized from b. Used for parsing strings or numbers. - - se setExtWrapper - - n jsonNum -} - -func jsonIsWS(b byte) bool { - return b == ' ' || b == '\t' || b == '\r' || b == '\n' -} - -// // This will skip whitespace characters and return the next byte to read. -// // The next byte determines what the value will be one of. -// func (d *jsonDecDriver) skipWhitespace() { -// // fast-path: do not enter loop. Just check first (in case no whitespace). -// b := d.r.readn1() -// if jsonIsWS(b) { -// r := d.r -// for b = r.readn1(); jsonIsWS(b); b = r.readn1() { -// } -// } -// d.tok = b -// } - -func (d *jsonDecDriver) uncacheRead() { - if d.tok != 0 { - d.r.unreadn1() - d.tok = 0 - } -} - -func (d *jsonDecDriver) sendContainerState(c containerState) { - if d.tok == 0 { - var b byte - r := d.r - for b = r.readn1(); jsonIsWS(b); b = r.readn1() { - } - d.tok = b - } - var xc uint8 // char expected - if c == containerMapKey { - if d.c != containerMapStart { - xc = ',' - } - } else if c == containerMapValue { - xc = ':' - } else if c == containerMapEnd { - xc = '}' - } else if c == containerArrayElem { - if d.c != containerArrayStart { - xc = ',' - } - } else if c == containerArrayEnd { - xc = ']' - } - if xc != 0 { - if d.tok != xc { - d.d.errorf("json: expect char '%c' but got char '%c'", xc, d.tok) - } - d.tok = 0 - } - d.c = c -} - -func (d *jsonDecDriver) CheckBreak() bool { - if d.tok == 0 { - var b byte - r := d.r - for b = r.readn1(); jsonIsWS(b); b = r.readn1() { - } - d.tok = b - } - if d.tok == '}' || d.tok == ']' { - // d.tok = 0 // only checking, not consuming - return true - } - return false -} - -func (d *jsonDecDriver) readStrIdx(fromIdx, toIdx uint8) { - bs := d.r.readx(int(toIdx - fromIdx)) - d.tok = 0 - if jsonValidateSymbols { - if !bytes.Equal(bs, jsonLiterals[fromIdx:toIdx]) { - d.d.errorf("json: expecting %s: got %s", jsonLiterals[fromIdx:toIdx], bs) - return - } - } -} - -func (d *jsonDecDriver) TryDecodeAsNil() bool { - if d.tok == 0 { - var b byte - r := d.r - for b = r.readn1(); jsonIsWS(b); b = r.readn1() { - } - d.tok = b - } - if d.tok == 'n' { - d.readStrIdx(10, 13) // ull - return true - } - return false -} - -func (d *jsonDecDriver) DecodeBool() bool { - if d.tok == 0 { - var b byte - r := d.r - for b = r.readn1(); jsonIsWS(b); b = r.readn1() { - } - d.tok = b - } - if d.tok == 'f' { - d.readStrIdx(5, 9) // alse - return false - } - if d.tok == 't' { - d.readStrIdx(1, 4) // rue - return true - } - d.d.errorf("json: decode bool: got first char %c", d.tok) - return false // "unreachable" -} - -func (d *jsonDecDriver) ReadMapStart() int { - if d.tok == 0 { - var b byte - r := d.r - for b = r.readn1(); jsonIsWS(b); b = r.readn1() { - } - d.tok = b - } - if d.tok != '{' { - d.d.errorf("json: expect char '%c' but got char '%c'", '{', d.tok) - } - d.tok = 0 - d.c = containerMapStart - return -1 -} - -func (d *jsonDecDriver) ReadArrayStart() int { - if d.tok == 0 { - var b byte - r := d.r - for b = r.readn1(); jsonIsWS(b); b = r.readn1() { - } - d.tok = b - } - if d.tok != '[' { - d.d.errorf("json: expect char '%c' but got char '%c'", '[', d.tok) - } - d.tok = 0 - d.c = containerArrayStart - return -1 -} - -func (d *jsonDecDriver) ContainerType() (vt valueType) { - // check container type by checking the first char - if d.tok == 0 { - var b byte - r := d.r - for b = r.readn1(); jsonIsWS(b); b = r.readn1() { - } - d.tok = b - } - 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 - // d.d.errorf("isContainerType: unsupported parameter: %v", vt) - // return false // "unreachable" -} - -func (d *jsonDecDriver) decNum(storeBytes bool) { - // If it is has a . or an e|E, decode as a float; else decode as an int. - if d.tok == 0 { - var b byte - r := d.r - for b = r.readn1(); jsonIsWS(b); b = r.readn1() { - } - d.tok = b - } - b := d.tok - var str bool - if b == '"' { - str = true - b = d.r.readn1() - } - if !(b == '+' || b == '-' || b == '.' || (b >= '0' && b <= '9')) { - d.d.errorf("json: decNum: got first char '%c'", b) - return - } - d.tok = 0 - - const cutoff = (1<<64-1)/uint64(10) + 1 // cutoff64(base) - const jsonNumUintMaxVal = 1<= jsonNumUintCutoff { - n.manOverflow = true - break - } - v := uint64(b - '0') - n.mantissa *= 10 - if v != 0 { - n1 := n.mantissa + v - if n1 < n.mantissa || n1 > jsonNumUintMaxVal { - n.manOverflow = true // n+v overflows - break - } - n.mantissa = n1 - } - case 6: - state = 7 - fallthrough - case 7: - if !(b == '0' && e == 0) { - e = e*10 + int16(b-'0') - } - default: - break LOOP - } - case '"': - if str { - if storeBytes { - d.bs = append(d.bs, '"') - } - b, eof = r.readn1eof() - } - break LOOP - default: - break LOOP - } - if storeBytes { - d.bs = append(d.bs, b) - } - b, eof = r.readn1eof() - } - - if jsonTruncateMantissa && n.mantissa != 0 { - for n.mantissa%10 == 0 { - n.mantissa /= 10 - n.exponent++ - } - } - - if e != 0 { - if eNeg { - n.exponent -= e - } else { - n.exponent += e - } - } - - // d.n = n - - if !eof { - if jsonUnreadAfterDecNum { - r.unreadn1() - } else { - if !jsonIsWS(b) { - d.tok = b - } - } - } - // fmt.Printf("1: n: bytes: %s, neg: %v, dot: %v, exponent: %v, mantissaEndIndex: %v\n", - // n.bytes, n.neg, n.dot, n.exponent, n.mantissaEndIndex) - return -} - -func (d *jsonDecDriver) DecodeInt(bitsize uint8) (i int64) { - d.decNum(false) - n := &d.n - if n.manOverflow { - d.d.errorf("json: overflow integer after: %v", n.mantissa) - return - } - var u uint64 - if n.exponent == 0 { - u = n.mantissa - } else if n.exponent < 0 { - d.d.errorf("json: fractional integer") - return - } else if n.exponent > 0 { - var overflow bool - if u, overflow = n.uintExp(); overflow { - d.d.errorf("json: overflow integer") - return - } - } - i = int64(u) - if n.neg { - i = -i - } - if chkOvf.Int(i, bitsize) { - d.d.errorf("json: overflow %v bits: %s", bitsize, d.bs) - return - } - // fmt.Printf("DecodeInt: %v\n", i) - return -} - -// floatVal MUST only be called after a decNum, as d.bs now contains the bytes of the number -func (d *jsonDecDriver) floatVal() (f float64) { - f, useStrConv := d.n.floatVal() - if useStrConv { - var err error - if f, err = strconv.ParseFloat(stringView(d.bs), 64); err != nil { - panic(fmt.Errorf("parse float: %s, %v", d.bs, err)) - } - if d.n.neg { - f = -f - } - } - return -} - -func (d *jsonDecDriver) DecodeUint(bitsize uint8) (u uint64) { - d.decNum(false) - n := &d.n - if n.neg { - d.d.errorf("json: unsigned integer cannot be negative") - return - } - if n.manOverflow { - d.d.errorf("json: overflow integer after: %v", n.mantissa) - return - } - if n.exponent == 0 { - u = n.mantissa - } else if n.exponent < 0 { - d.d.errorf("json: fractional integer") - return - } else if n.exponent > 0 { - var overflow bool - if u, overflow = n.uintExp(); overflow { - d.d.errorf("json: overflow integer") - return - } - } - if chkOvf.Uint(u, bitsize) { - d.d.errorf("json: overflow %v bits: %s", bitsize, d.bs) - return - } - // fmt.Printf("DecodeUint: %v\n", u) - return -} - -func (d *jsonDecDriver) DecodeFloat(chkOverflow32 bool) (f float64) { - d.decNum(true) - f = d.floatVal() - if chkOverflow32 && chkOvf.Float32(f) { - d.d.errorf("json: overflow float32: %v, %s", f, d.bs) - return - } - 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, isstring, zerocopy bool) (bsOut []byte) { - // if decoding into raw bytes, and the RawBytesExt is configured, use it to decode. - if !isstring && d.se.i != nil { - bsOut = bs - d.DecodeExt(&bsOut, 0, &d.se) - return - } - d.appendStringAsBytes() - // if isstring, then just return the bytes, even if it is using the scratch buffer. - // the bytes will be converted to a string as needed. - if isstring { - return d.bs - } - 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("json: 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() - // if x := d.s.sc; x != nil && x.so && x.st == '}' { // map key - if d.c == containerMapKey { - return d.d.string(d.bs) - } - return string(d.bs) -} - -func (d *jsonDecDriver) appendStringAsBytes() { - if d.tok == 0 { - var b byte - r := d.r - for b = r.readn1(); jsonIsWS(b); b = r.readn1() { - } - d.tok = b - } - if d.tok != '"' { - d.d.errorf("json: expect char '%c' but got char '%c'", '"', d.tok) - } - d.tok = 0 - - v := d.bs[:0] - var c uint8 - r := d.r - for { - c = r.readn1() - if c == '"' { - break - } else if c == '\\' { - c = r.readn1() - 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': - rr := d.jsonU4(false) - // fmt.Printf("$$$$$$$$$: is surrogate: %v\n", utf16.IsSurrogate(rr)) - if utf16.IsSurrogate(rr) { - rr = utf16.DecodeRune(rr, d.jsonU4(true)) - } - w2 := utf8.EncodeRune(d.bstr[:], rr) - v = append(v, d.bstr[:w2]...) - default: - d.d.errorf("json: unsupported escaped value: %c", c) - } - } else { - v = append(v, c) - } - } - d.bs = v -} - -func (d *jsonDecDriver) jsonU4(checkSlashU bool) rune { - r := d.r - if checkSlashU && !(r.readn1() == '\\' && r.readn1() == 'u') { - d.d.errorf(`json: unquoteStr: invalid unicode sequence. Expecting \u`) - return 0 - } - // u, _ := strconv.ParseUint(string(d.bstr[:4]), 16, 64) - var u uint32 - for i := 0; i < 4; i++ { - v := r.readn1() - if '0' <= v && v <= '9' { - v = v - '0' - } else if 'a' <= v && v <= 'z' { - v = v - 'a' + 10 - } else if 'A' <= v && v <= 'Z' { - v = v - 'A' + 10 - } else { - d.d.errorf(`json: unquoteStr: invalid hex char in \u unicode sequence: %q`, v) - return 0 - } - u = u*16 + uint32(v) - } - return rune(u) -} - -func (d *jsonDecDriver) DecodeNaked() { - z := &d.d.n - // var decodeFurther bool - - if d.tok == 0 { - var b byte - r := d.r - for b = r.readn1(); jsonIsWS(b); b = r.readn1() { - } - d.tok = b - } - switch d.tok { - case 'n': - d.readStrIdx(10, 13) // ull - z.v = valueTypeNil - case 'f': - d.readStrIdx(5, 9) // alse - z.v = valueTypeBool - z.b = false - case 't': - d.readStrIdx(1, 4) // rue - z.v = valueTypeBool - z.b = true - case '{': - z.v = valueTypeMap - // d.tok = 0 // don't consume. kInterfaceNaked will call ReadMapStart - // decodeFurther = true - case '[': - z.v = valueTypeArray - // d.tok = 0 // don't consume. kInterfaceNaked will call ReadArrayStart - // decodeFurther = true - case '"': - z.v = valueTypeString - z.s = d.DecodeString() - default: // number - d.decNum(true) - n := &d.n - // if the string had a any of [.eE], then decode as float. - switch { - case n.explicitExponent, n.dot, n.exponent < 0, n.manOverflow: - z.v = valueTypeFloat - z.f = d.floatVal() - case n.exponent == 0: - u := n.mantissa - switch { - case n.neg: - z.v = valueTypeInt - z.i = -int64(u) - case d.h.SignedInteger: - z.v = valueTypeInt - z.i = int64(u) - default: - z.v = valueTypeUint - z.u = u - } - default: - u, overflow := n.uintExp() - switch { - case overflow: - z.v = valueTypeFloat - z.f = d.floatVal() - case n.neg: - z.v = valueTypeInt - z.i = -int64(u) - case d.h.SignedInteger: - z.v = valueTypeInt - z.i = int64(u) - default: - z.v = valueTypeUint - z.u = u - } - } - // fmt.Printf("DecodeNaked: Number: %T, %v\n", v, v) - } - // if decodeFurther { - // d.s.sc.retryRead() - // } - return -} - -//---------------------- - -// JsonHandle is a handle for JSON encoding format. -// -// Json is comprehensively supported: -// - decodes numbers into interface{} as int, uint or float64 -// - 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 and -// minimizing allocations. -// -// 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. -type JsonHandle struct { - textEncodingType - BasicHandle - // 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 - - // 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 uint8 -} - -func (h *JsonHandle) SetInterfaceExt(rt reflect.Type, tag uint64, ext InterfaceExt) (err error) { - return h.SetExt(rt, tag, &setExtWrapper{i: ext}) -} - -func (h *JsonHandle) newEncDriver(e *Encoder) encDriver { - hd := jsonEncDriver{e: e, h: h} - hd.bs = hd.b[:0] - - hd.reset() - - return &hd -} - -func (h *JsonHandle) newDecDriver(d *Decoder) decDriver { - // d := jsonDecDriver{r: r.(*bytesDecReader), h: h} - hd := jsonDecDriver{d: d, h: h} - hd.bs = hd.b[:0] - hd.reset() - return &hd -} - -func (e *jsonEncDriver) reset() { - e.w = e.e.w - e.se.i = e.h.RawBytesExt - if e.bs != nil { - e.bs = e.bs[:0] - } - e.d, e.dt, e.dl, e.ds = false, false, 0, "" - e.c = 0 - if e.h.Indent > 0 { - e.d = true - e.ds = jsonSpaces[:e.h.Indent] - } else if e.h.Indent < 0 { - e.d = true - e.dt = true - e.ds = jsonTabs[:-(e.h.Indent)] - } -} - -func (d *jsonDecDriver) reset() { - d.r = d.d.r - d.se.i = d.h.RawBytesExt - if d.bs != nil { - d.bs = d.bs[:0] - } - d.c, d.tok = 0, 0 - d.n.reset() -} - -var jsonEncodeTerminate = []byte{' '} - -func (h *JsonHandle) rpcEncodeTerminate() []byte { - return jsonEncodeTerminate -} - -var _ decDriver = (*jsonDecDriver)(nil) -var _ encDriver = (*jsonEncDriver)(nil) diff --git a/_vendor/vendor/github.com/ugorji/go/codec/prebuild.go b/_vendor/vendor/github.com/ugorji/go/codec/prebuild.go deleted file mode 100644 index 2353263..0000000 --- a/_vendor/vendor/github.com/ugorji/go/codec/prebuild.go +++ /dev/null @@ -1,3 +0,0 @@ -package codec - -//go:generate bash prebuild.sh diff --git a/_vendor/vendor/github.com/ugorji/go/codec/rpc.go b/_vendor/vendor/github.com/ugorji/go/codec/rpc.go deleted file mode 100644 index dad53d0..0000000 --- a/_vendor/vendor/github.com/ugorji/go/codec/rpc.go +++ /dev/null @@ -1,180 +0,0 @@ -// 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 - -import ( - "bufio" - "io" - "net/rpc" - "sync" -) - -// rpcEncodeTerminator allows a handler specify a []byte terminator to send after each Encode. -// -// Some codecs like json need to put a space after each encoded value, to serve as a -// delimiter for things like numbers (else json codec will continue reading till EOF). -type rpcEncodeTerminator interface { - rpcEncodeTerminate() []byte -} - -// 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 -} - -// ------------------------------------- - -// rpcCodec defines the struct members and common methods. -type rpcCodec struct { - rwc io.ReadWriteCloser - dec *Decoder - enc *Encoder - bw *bufio.Writer - br *bufio.Reader - mu sync.Mutex - h Handle - - cls bool - clsmu sync.RWMutex -} - -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), - h: h, - } -} - -func (c *rpcCodec) BufferedReader() *bufio.Reader { - return c.br -} - -func (c *rpcCodec) BufferedWriter() *bufio.Writer { - return c.bw -} - -func (c *rpcCodec) write(obj1, obj2 interface{}, writeObj2, doFlush bool) (err error) { - if c.isClosed() { - return io.EOF - } - if err = c.enc.Encode(obj1); err != nil { - return - } - t, tOk := c.h.(rpcEncodeTerminator) - if tOk { - c.bw.Write(t.rpcEncodeTerminate()) - } - if writeObj2 { - if err = c.enc.Encode(obj2); err != nil { - return - } - if tOk { - c.bw.Write(t.rpcEncodeTerminate()) - } - } - if doFlush { - return c.bw.Flush() - } - return -} - -func (c *rpcCodec) read(obj interface{}) (err error) { - if c.isClosed() { - return io.EOF - } - //If nil is passed in, we should still attempt to read content to nowhere. - if obj == nil { - var obj2 interface{} - return c.dec.Decode(&obj2) - } - return c.dec.Decode(obj) -} - -func (c *rpcCodec) isClosed() bool { - c.clsmu.RLock() - x := c.cls - c.clsmu.RUnlock() - return x -} - -func (c *rpcCodec) Close() error { - if c.isClosed() { - return io.EOF - } - c.clsmu.Lock() - c.cls = true - c.clsmu.Unlock() - return c.rwc.Close() -} - -func (c *rpcCodec) ReadResponseBody(body interface{}) error { - return c.read(body) -} - -// ------------------------------------- - -type goRpcCodec struct { - rpcCodec -} - -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) -} - -func (c *goRpcCodec) WriteResponse(r *rpc.Response, body interface{}) error { - c.mu.Lock() - defer c.mu.Unlock() - return c.write(r, body, true, true) -} - -func (c *goRpcCodec) ReadResponseHeader(r *rpc.Response) error { - return c.read(r) -} - -func (c *goRpcCodec) ReadRequestHeader(r *rpc.Request) error { - return c.read(r) -} - -func (c *goRpcCodec) ReadRequestBody(body interface{}) error { - return c.read(body) -} - -// ------------------------------------- - -// goRpc is the implementation of Rpc that uses the communication protocol -// as defined in net/rpc package. -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. -var GoRpc goRpc - -func (x goRpc) ServerCodec(conn io.ReadWriteCloser, h Handle) rpc.ServerCodec { - return &goRpcCodec{newRPCCodec(conn, h)} -} - -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/glide.lock b/glide.lock deleted file mode 100644 index b4c0703..0000000 --- a/glide.lock +++ /dev/null @@ -1,65 +0,0 @@ -hash: 83229e7ecea008add55b2547fb28a23d247a4740fc30b4659f58bf5d495e3584 -updated: 2017-08-16T11:06:05.978126639+02:00 -imports: -- name: github.com/cupcake/rdb - version: 43ba34106c765f2111c0dc7b74cdf8ee437411e0 - subpackages: - - crc64 - - nopdecoder -- name: github.com/edsrzf/mmap-go - version: 935e0e8a636ca4ba70b713f3e38a19e1b77739e8 -- name: github.com/glendc/gopher-json - version: dc4743023d0c166c1b844da8fc688e57ec65fe0b -- name: github.com/golang/snappy - version: 553a641470496b2327abcac10b36396bd98e45c9 -- name: github.com/pelletier/go-buffruneio - version: c37440a7cf42ac63b919c752ca73a85067e05992 -- name: github.com/pelletier/go-toml - version: fe7536c3dee2596cdd23ee9976a17c22bdaae286 -- name: github.com/peterh/liner - version: bf27d3ba8e1d9899d45a457ffac16c953eb2d647 -- name: github.com/siddontang/go - version: 354e14e6c093c661abb29fd28403b3c19cff5514 - subpackages: - - bson - - filelock - - hack - - ioutil2 - - log - - num - - snappy - - sync2 -- name: github.com/siddontang/goredis - version: 760763f78400635ed7b9b115511b8ed06035e908 -- name: github.com/siddontang/rdb - version: fc89ed2e418d27e3ea76e708e54276d2b44ae9cf -- name: github.com/syndtr/goleveldb - version: cfa635847112c5dc4782e128fa7e0d05fdbfb394 - subpackages: - - leveldb - - leveldb/cache - - leveldb/comparer - - leveldb/errors - - leveldb/filter - - leveldb/iterator - - leveldb/journal - - leveldb/memdb - - leveldb/opt - - leveldb/storage - - leveldb/table - - leveldb/util -- name: github.com/ugorji/go - version: b94837a2404ab90efe9289e77a70694c355739cb - subpackages: - - codec -- name: github.com/yuin/gopher-lua - version: b402f3114ec730d8bddb074a6c137309f561aa78 - subpackages: - - ast - - parse - - pm -- name: golang.org/x/net - version: 1c05540f6879653db88113bc4a2b70aec4bd491f - subpackages: - - context -testImports: [] diff --git a/glide.yaml b/glide.yaml deleted file mode 100644 index a013f05..0000000 --- a/glide.yaml +++ /dev/null @@ -1,39 +0,0 @@ -package: github.com/siddontang/ledisdb -import: -- package: github.com/pelletier/go-toml - version: fe7536c3dee2596cdd23ee9976a17c22bdaae286 -- package: github.com/edsrzf/mmap-go - version: 935e0e8a636ca4ba70b713f3e38a19e1b77739e8 -- package: github.com/peterh/liner - version: bf27d3ba8e1d9899d45a457ffac16c953eb2d647 -- package: github.com/siddontang/go - version: 354e14e6c093c661abb29fd28403b3c19cff5514 - subpackages: - - bson - - filelock - - hack - - ioutil2 - - log - - num - - snappy - - sync2 -- package: github.com/siddontang/goredis - version: 760763f78400635ed7b9b115511b8ed06035e908 -- package: github.com/siddontang/rdb - version: fc89ed2e418d27e3ea76e708e54276d2b44ae9cf -- package: github.com/syndtr/goleveldb - version: cfa635847112c5dc4782e128fa7e0d05fdbfb394 - subpackages: - - leveldb - - leveldb/cache - - leveldb/filter - - leveldb/iterator - - leveldb/opt - - leveldb/storage - - leveldb/util -- package: github.com/ugorji/go - version: b94837a2404ab90efe9289e77a70694c355739cb - subpackages: - - codec -- package: github.com/yuin/gopher-lua - version: b402f3114ec730d8bddb074a6c137309f561aa78 diff --git a/vendor/github.com/cupcake/rdb/.gitignore b/vendor/github.com/cupcake/rdb/.gitignore new file mode 100644 index 0000000..fcc1e66 --- /dev/null +++ b/vendor/github.com/cupcake/rdb/.gitignore @@ -0,0 +1,25 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe + +# Project-specific files +diff diff --git a/vendor/github.com/cupcake/rdb/.travis.yml b/vendor/github.com/cupcake/rdb/.travis.yml new file mode 100644 index 0000000..49c6fb8 --- /dev/null +++ b/vendor/github.com/cupcake/rdb/.travis.yml @@ -0,0 +1,6 @@ +language: go +go: + - 1.1 + - tip +before_install: + - go get gopkg.in/check.v1 diff --git a/_vendor/vendor/github.com/cupcake/rdb/LICENCE b/vendor/github.com/cupcake/rdb/LICENCE similarity index 100% rename from _vendor/vendor/github.com/cupcake/rdb/LICENCE rename to vendor/github.com/cupcake/rdb/LICENCE diff --git a/vendor/github.com/cupcake/rdb/README.md b/vendor/github.com/cupcake/rdb/README.md new file mode 100644 index 0000000..5c19212 --- /dev/null +++ b/vendor/github.com/cupcake/rdb/README.md @@ -0,0 +1,17 @@ +# rdb [![Build Status](https://travis-ci.org/cupcake/rdb.png?branch=master)](https://travis-ci.org/cupcake/rdb) + +rdb is a Go package that implements parsing and encoding of the +[Redis](http://redis.io) [RDB file +format](https://github.com/sripathikrishnan/redis-rdb-tools/blob/master/docs/RDB_File_Format.textile). + +This package was heavily inspired by +[redis-rdb-tools](https://github.com/sripathikrishnan/redis-rdb-tools) by +[Sripathi Krishnan](https://github.com/sripathikrishnan). + +[**Documentation**](http://godoc.org/github.com/cupcake/rdb) + +## Installation + +``` +go get github.com/cupcake/rdb +``` diff --git a/_vendor/vendor/github.com/cupcake/rdb/crc64/crc64.go b/vendor/github.com/cupcake/rdb/crc64/crc64.go similarity index 100% rename from _vendor/vendor/github.com/cupcake/rdb/crc64/crc64.go rename to vendor/github.com/cupcake/rdb/crc64/crc64.go diff --git a/_vendor/vendor/github.com/cupcake/rdb/decoder.go b/vendor/github.com/cupcake/rdb/decoder.go similarity index 100% rename from _vendor/vendor/github.com/cupcake/rdb/decoder.go rename to vendor/github.com/cupcake/rdb/decoder.go diff --git a/vendor/github.com/cupcake/rdb/decoder_test.go b/vendor/github.com/cupcake/rdb/decoder_test.go new file mode 100644 index 0000000..6dd0e23 --- /dev/null +++ b/vendor/github.com/cupcake/rdb/decoder_test.go @@ -0,0 +1,347 @@ +package rdb_test + +import ( + "fmt" + "os" + "strings" + "testing" + + "github.com/cupcake/rdb" + . "gopkg.in/check.v1" +) + +// Hook gocheck into the gotest runner. +func Test(t *testing.T) { TestingT(t) } + +type DecoderSuite struct{} + +var _ = Suite(&DecoderSuite{}) + +func (s *DecoderSuite) TestEmptyRDB(c *C) { + r := decodeRDB("empty_database") + c.Assert(r.started, Equals, 1) + c.Assert(r.ended, Equals, 1) + c.Assert(len(r.dbs), Equals, 0) +} + +func (s *DecoderSuite) TestMultipleDatabases(c *C) { + r := decodeRDB("multiple_databases") + c.Assert(len(r.dbs), Equals, 2) + _, ok := r.dbs[1] + c.Assert(ok, Equals, false) + c.Assert(r.dbs[0]["key_in_zeroth_database"], Equals, "zero") + c.Assert(r.dbs[2]["key_in_second_database"], Equals, "second") +} + +func (s *DecoderSuite) TestExpiry(c *C) { + r := decodeRDB("keys_with_expiry") + c.Assert(r.expiries[0]["expires_ms_precision"], Equals, int64(1671963072573)) +} + +func (s *DecoderSuite) TestMixedExpiry(c *C) { + r := decodeRDB("keys_with_mixed_expiry") + c.Assert(r.expiries[0]["key01"], Not(Equals), int64(0)) + c.Assert(r.expiries[0]["key04"], Not(Equals), int64(0)) + + c.Assert(r.expiries[0]["key02"], Equals, int64(0)) + c.Assert(r.expiries[0]["key03"], Equals, int64(0)) +} + +func (s *DecoderSuite) TestIntegerKeys(c *C) { + r := decodeRDB("integer_keys") + c.Assert(r.dbs[0]["125"], Equals, "Positive 8 bit integer") + c.Assert(r.dbs[0]["43947"], Equals, "Positive 16 bit integer") + c.Assert(r.dbs[0]["183358245"], Equals, "Positive 32 bit integer") + c.Assert(r.dbs[0]["-123"], Equals, "Negative 8 bit integer") + c.Assert(r.dbs[0]["-29477"], Equals, "Negative 16 bit integer") + c.Assert(r.dbs[0]["-183358245"], Equals, "Negative 32 bit integer") +} + +func (s *DecoderSuite) TestStringKeyWithCompression(c *C) { + r := decodeRDB("easily_compressible_string_key") + c.Assert(r.dbs[0][strings.Repeat("a", 200)], Equals, "Key that redis should compress easily") +} + +func (s *DecoderSuite) TestZipmapWithCompression(c *C) { + r := decodeRDB("zipmap_that_compresses_easily") + zm := r.dbs[0]["zipmap_compresses_easily"].(map[string]string) + c.Assert(zm["a"], Equals, "aa") + c.Assert(zm["aa"], Equals, "aaaa") + c.Assert(zm["aaaaa"], Equals, "aaaaaaaaaaaaaa") +} + +func (s *DecoderSuite) TestZipmap(c *C) { + r := decodeRDB("zipmap_that_doesnt_compress") + zm := r.dbs[0]["zimap_doesnt_compress"].(map[string]string) + c.Assert(zm["MKD1G6"], Equals, "2") + c.Assert(zm["YNNXK"], Equals, "F7TI") +} + +func (s *DecoderSuite) TestZipmapWitBigValues(c *C) { + r := decodeRDB("zipmap_with_big_values") + zm := r.dbs[0]["zipmap_with_big_values"].(map[string]string) + c.Assert(len(zm["253bytes"]), Equals, 253) + c.Assert(len(zm["254bytes"]), Equals, 254) + c.Assert(len(zm["255bytes"]), Equals, 255) + c.Assert(len(zm["300bytes"]), Equals, 300) + c.Assert(len(zm["20kbytes"]), Equals, 20000) +} + +func (s *DecoderSuite) TestHashZiplist(c *C) { + r := decodeRDB("hash_as_ziplist") + zm := r.dbs[0]["zipmap_compresses_easily"].(map[string]string) + c.Assert(zm["a"], Equals, "aa") + c.Assert(zm["aa"], Equals, "aaaa") + c.Assert(zm["aaaaa"], Equals, "aaaaaaaaaaaaaa") +} + +func (s *DecoderSuite) TestDictionary(c *C) { + r := decodeRDB("dictionary") + d := r.dbs[0]["force_dictionary"].(map[string]string) + c.Assert(len(d), Equals, 1000) + c.Assert(d["ZMU5WEJDG7KU89AOG5LJT6K7HMNB3DEI43M6EYTJ83VRJ6XNXQ"], Equals, "T63SOS8DQJF0Q0VJEZ0D1IQFCYTIPSBOUIAI9SB0OV57MQR1FI") + c.Assert(d["UHS5ESW4HLK8XOGTM39IK1SJEUGVV9WOPK6JYA5QBZSJU84491"], Equals, "6VULTCV52FXJ8MGVSFTZVAGK2JXZMGQ5F8OVJI0X6GEDDR27RZ") +} + +func (s *DecoderSuite) TestZiplistWithCompression(c *C) { + r := decodeRDB("ziplist_that_compresses_easily") + for i, length := range []int{6, 12, 18, 24, 30, 36} { + c.Assert(r.dbs[0]["ziplist_compresses_easily"].([]string)[i], Equals, strings.Repeat("a", length)) + } +} + +func (s *DecoderSuite) TestZiplist(c *C) { + r := decodeRDB("ziplist_that_doesnt_compress") + l := r.dbs[0]["ziplist_doesnt_compress"].([]string) + c.Assert(l[0], Equals, "aj2410") + c.Assert(l[1], Equals, "cc953a17a8e096e76a44169ad3f9ac87c5f8248a403274416179aa9fbd852344") +} + +func (s *DecoderSuite) TestZiplistWithInts(c *C) { + r := decodeRDB("ziplist_with_integers") + expected := []string{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "-2", "13", "25", "-61", "63", "16380", "-16000", "65535", "-65523", "4194304", "9223372036854775807"} + for i, x := range expected { + c.Assert(r.dbs[0]["ziplist_with_integers"].([]string)[i], Equals, x) + } +} + +func (s *DecoderSuite) TestIntSet16(c *C) { + r := decodeRDB("intset_16") + for i, x := range []string{"32764", "32765", "32766"} { + c.Assert(r.dbs[0]["intset_16"].([]string)[i], Equals, x) + } +} + +func (s *DecoderSuite) TestIntSet32(c *C) { + r := decodeRDB("intset_32") + for i, x := range []string{"2147418108", "2147418109", "2147418110"} { + c.Assert(r.dbs[0]["intset_32"].([]string)[i], Equals, x) + } +} + +func (s *DecoderSuite) TestIntSet64(c *C) { + r := decodeRDB("intset_64") + for i, x := range []string{"9223090557583032316", "9223090557583032317", "9223090557583032318"} { + c.Assert(r.dbs[0]["intset_64"].([]string)[i], Equals, x) + } +} + +func (s *DecoderSuite) TestSet(c *C) { + r := decodeRDB("regular_set") + for i, x := range []string{"beta", "delta", "alpha", "phi", "gamma", "kappa"} { + c.Assert(r.dbs[0]["regular_set"].([]string)[i], Equals, x) + } +} + +func (s *DecoderSuite) TestZSetZiplist(c *C) { + r := decodeRDB("sorted_set_as_ziplist") + z := r.dbs[0]["sorted_set_as_ziplist"].(map[string]float64) + c.Assert(z["8b6ba6718a786daefa69438148361901"], Equals, float64(1)) + c.Assert(z["cb7a24bb7528f934b841b34c3a73e0c7"], Equals, float64(2.37)) + c.Assert(z["523af537946b79c4f8369ed39ba78605"], Equals, float64(3.423)) +} + +func (s *DecoderSuite) TestRDBv5(c *C) { + r := decodeRDB("rdb_version_5_with_checksum") + c.Assert(r.dbs[0]["abcd"], Equals, "efgh") + c.Assert(r.dbs[0]["foo"], Equals, "bar") + c.Assert(r.dbs[0]["bar"], Equals, "baz") + c.Assert(r.dbs[0]["abcdef"], Equals, "abcdef") + c.Assert(r.dbs[0]["longerstring"], Equals, "thisisalongerstring.idontknowwhatitmeans") +} + +func (s *DecoderSuite) TestRDBv7(c *C) { + r := decodeRDB("rdb_v7_list_quicklist") + c.Assert(r.aux["redis-ver"], Equals, "3.2.0") + c.Assert(r.dbSize[0], Equals, uint32(1)) + c.Assert(r.expiresSize[0], Equals, uint32(0)) + z := r.dbs[0]["foo"].([]string) + c.Assert(z[0], Equals, "bar") + c.Assert(z[1], Equals, "baz") + c.Assert(z[2], Equals, "boo") +} + +func (s *DecoderSuite) TestDumpDecoder(c *C) { + r := &FakeRedis{} + err := rdb.DecodeDump([]byte("\u0000\xC0\n\u0006\u0000\xF8r?\xC5\xFB\xFB_("), 1, []byte("test"), 123, r) + if err != nil { + c.Error(err) + } + c.Assert(r.dbs[1]["test"], Equals, "10") +} + +func decodeRDB(name string) *FakeRedis { + r := &FakeRedis{} + f, err := os.Open("fixtures/" + name + ".rdb") + if err != nil { + panic(err) + } + err = rdb.Decode(f, r) + if err != nil { + panic(err) + } + return r +} + +type FakeRedis struct { + dbs map[int]map[string]interface{} + lengths map[int]map[string]int + expiries map[int]map[string]int64 + dbSize map[int]uint32 + expiresSize map[int]uint32 + + cdb int + started int + ended int + + aux map[string]string +} + +func (r *FakeRedis) setExpiry(key []byte, expiry int64) { + r.expiries[r.cdb][string(key)] = expiry +} + +func (r *FakeRedis) setLength(key []byte, length int64) { + r.lengths[r.cdb][string(key)] = int(length) +} + +func (r *FakeRedis) getLength(key []byte) int { + return int(r.lengths[r.cdb][string(key)]) +} + +func (r *FakeRedis) db() map[string]interface{} { + return r.dbs[r.cdb] +} + +func (r *FakeRedis) StartRDB() { + r.started++ + r.dbs = make(map[int]map[string]interface{}) + r.expiries = make(map[int]map[string]int64) + r.lengths = make(map[int]map[string]int) + r.aux = make(map[string]string) + r.dbSize = make(map[int]uint32) + r.expiresSize = make(map[int]uint32) +} + +func (r *FakeRedis) StartDatabase(n int) { + r.dbs[n] = make(map[string]interface{}) + r.expiries[n] = make(map[string]int64) + r.lengths[n] = make(map[string]int) + r.cdb = n +} + +func (r *FakeRedis) Set(key, value []byte, expiry int64) { + r.setExpiry(key, expiry) + r.db()[string(key)] = string(value) +} + +func (r *FakeRedis) StartHash(key []byte, length, expiry int64) { + r.setExpiry(key, expiry) + r.setLength(key, length) + r.db()[string(key)] = make(map[string]string) +} + +func (r *FakeRedis) Hset(key, field, value []byte) { + r.db()[string(key)].(map[string]string)[string(field)] = string(value) +} + +func (r *FakeRedis) EndHash(key []byte) { + actual := len(r.db()[string(key)].(map[string]string)) + if actual != r.getLength(key) { + panic(fmt.Sprintf("wrong length for key %s got %d, expected %d", key, actual, r.getLength(key))) + } +} + +func (r *FakeRedis) StartSet(key []byte, cardinality, expiry int64) { + r.setExpiry(key, expiry) + r.setLength(key, cardinality) + r.db()[string(key)] = make([]string, 0, cardinality) +} + +func (r *FakeRedis) Sadd(key, member []byte) { + r.db()[string(key)] = append(r.db()[string(key)].([]string), string(member)) +} + +func (r *FakeRedis) EndSet(key []byte) { + actual := len(r.db()[string(key)].([]string)) + if actual != r.getLength(key) { + panic(fmt.Sprintf("wrong length for key %s got %d, expected %d", key, actual, r.getLength(key))) + } +} + +func (r *FakeRedis) StartList(key []byte, length, expiry int64) { + r.setExpiry(key, expiry) + r.setLength(key, length) + cap := length + if length < 0 { + cap = 1 + } + r.db()[string(key)] = make([]string, 0, cap) +} + +func (r *FakeRedis) Rpush(key, value []byte) { + r.db()[string(key)] = append(r.db()[string(key)].([]string), string(value)) +} + +func (r *FakeRedis) EndList(key []byte) { + actual := len(r.db()[string(key)].([]string)) + if actual != r.getLength(key) && r.getLength(key) >= 0 { + panic(fmt.Sprintf("wrong length for key %s got %d, expected %d", key, actual, r.getLength(key))) + } +} + +func (r *FakeRedis) StartZSet(key []byte, cardinality, expiry int64) { + r.setExpiry(key, expiry) + r.setLength(key, cardinality) + r.db()[string(key)] = make(map[string]float64) +} + +func (r *FakeRedis) Zadd(key []byte, score float64, member []byte) { + r.db()[string(key)].(map[string]float64)[string(member)] = score +} + +func (r *FakeRedis) EndZSet(key []byte) { + actual := len(r.db()[string(key)].(map[string]float64)) + if actual != r.getLength(key) { + panic(fmt.Sprintf("wrong length for key %s got %d, expected %d", key, actual, r.getLength(key))) + } +} + +func (r *FakeRedis) EndDatabase(n int) { + if n != r.cdb { + panic(fmt.Sprintf("database end called with %d, expected %d", n, r.cdb)) + } +} + +func (r *FakeRedis) EndRDB() { + r.ended++ +} + +func (r *FakeRedis) Aux(key, value []byte) { + r.aux[string(key)] = string(value) +} + +func (r *FakeRedis) ResizeDatabase(dbSize, expiresSize uint32) { + r.dbSize[r.cdb] = dbSize + r.expiresSize[r.cdb] = expiresSize +} diff --git a/_vendor/vendor/github.com/cupcake/rdb/encoder.go b/vendor/github.com/cupcake/rdb/encoder.go similarity index 100% rename from _vendor/vendor/github.com/cupcake/rdb/encoder.go rename to vendor/github.com/cupcake/rdb/encoder.go diff --git a/vendor/github.com/cupcake/rdb/encoder_test.go b/vendor/github.com/cupcake/rdb/encoder_test.go new file mode 100644 index 0000000..93cd765 --- /dev/null +++ b/vendor/github.com/cupcake/rdb/encoder_test.go @@ -0,0 +1,43 @@ +package rdb_test + +import ( + "bytes" + "encoding/base64" + + "github.com/cupcake/rdb" + . "gopkg.in/check.v1" +) + +type EncoderSuite struct{} + +var _ = Suite(&EncoderSuite{}) + +var stringEncodingTests = []struct { + str string + res string +}{ + {"0", "AMAABgAOrc/4DQU/mw=="}, + {"127", "AMB/BgCbWIOxpwH5hw=="}, + {"-128", "AMCABgAPi1rt2llnSg=="}, + {"128", "AMGAAAYAfZfbNeWad/Y="}, + {"-129", "AMF//wYAgY3qqKHVuBM="}, + {"32767", "AMH/fwYA37dfWuKh6bg="}, + {"-32768", "AMEAgAYAI61ux6buJl0="}, + {"-32768", "AMEAgAYAI61ux6buJl0="}, + {"2147483647", "AML///9/BgC6mY0eFXuRMg=="}, + {"-2147483648", "AMIAAACABgBRou++xgC9FA=="}, + {"a", "AAFhBgApE4cbemNBJw=="}, +} + +func (e *EncoderSuite) TestStringEncoding(c *C) { + buf := &bytes.Buffer{} + for _, t := range stringEncodingTests { + e := rdb.NewEncoder(buf) + e.EncodeType(rdb.TypeString) + e.EncodeString([]byte(t.str)) + e.EncodeDumpFooter() + expected, _ := base64.StdEncoding.DecodeString(t.res) + c.Assert(buf.Bytes(), DeepEquals, expected, Commentf("%s - expected: %x, actual: %x", t.str, expected, buf.Bytes())) + buf.Reset() + } +} diff --git a/_vendor/vendor/github.com/cupcake/rdb/nopdecoder/nop_decoder.go b/vendor/github.com/cupcake/rdb/nopdecoder/nop_decoder.go similarity index 100% rename from _vendor/vendor/github.com/cupcake/rdb/nopdecoder/nop_decoder.go rename to vendor/github.com/cupcake/rdb/nopdecoder/nop_decoder.go diff --git a/_vendor/vendor/github.com/cupcake/rdb/slice_buffer.go b/vendor/github.com/cupcake/rdb/slice_buffer.go similarity index 100% rename from _vendor/vendor/github.com/cupcake/rdb/slice_buffer.go rename to vendor/github.com/cupcake/rdb/slice_buffer.go diff --git a/vendor/github.com/edsrzf/mmap-go/.gitignore b/vendor/github.com/edsrzf/mmap-go/.gitignore new file mode 100644 index 0000000..9aa02c1 --- /dev/null +++ b/vendor/github.com/edsrzf/mmap-go/.gitignore @@ -0,0 +1,8 @@ +*.out +*.5 +*.6 +*.8 +*.swp +_obj +_test +testdata diff --git a/_vendor/vendor/github.com/edsrzf/mmap-go/LICENSE b/vendor/github.com/edsrzf/mmap-go/LICENSE similarity index 100% rename from _vendor/vendor/github.com/edsrzf/mmap-go/LICENSE rename to vendor/github.com/edsrzf/mmap-go/LICENSE diff --git a/vendor/github.com/edsrzf/mmap-go/README.md b/vendor/github.com/edsrzf/mmap-go/README.md new file mode 100644 index 0000000..4cc2bfe --- /dev/null +++ b/vendor/github.com/edsrzf/mmap-go/README.md @@ -0,0 +1,12 @@ +mmap-go +======= + +mmap-go is a portable mmap package for the [Go programming language](http://golang.org). +It has been tested on Linux (386, amd64), OS X, and Windows (386). It should also +work on other Unix-like platforms, but hasn't been tested with them. I'm interested +to hear about the results. + +I haven't been able to add more features without adding significant complexity, +so mmap-go doesn't support mprotect, mincore, and maybe a few other things. +If you're running on a Unix-like platform and need some of these features, +I suggest Gustavo Niemeyer's [gommap](http://labix.org/gommap). diff --git a/_vendor/vendor/github.com/edsrzf/mmap-go/mmap.go b/vendor/github.com/edsrzf/mmap-go/mmap.go similarity index 96% rename from _vendor/vendor/github.com/edsrzf/mmap-go/mmap.go rename to vendor/github.com/edsrzf/mmap-go/mmap.go index 7bb4965..14fb225 100644 --- a/_vendor/vendor/github.com/edsrzf/mmap-go/mmap.go +++ b/vendor/github.com/edsrzf/mmap-go/mmap.go @@ -54,6 +54,10 @@ func Map(f *os.File, prot, flags int) (MMap, error) { // If length < 0, the entire file will be mapped. // If ANON is set in flags, f is ignored. func MapRegion(f *os.File, length int, prot, flags int, offset int64) (MMap, error) { + if offset%int64(os.Getpagesize()) != 0 { + return nil, errors.New("offset parameter must be a multiple of the system's page size") + } + var fd uintptr if flags&ANON == 0 { fd = uintptr(f.Fd()) diff --git a/vendor/github.com/edsrzf/mmap-go/mmap_test.go b/vendor/github.com/edsrzf/mmap-go/mmap_test.go new file mode 100644 index 0000000..63f0ef0 --- /dev/null +++ b/vendor/github.com/edsrzf/mmap-go/mmap_test.go @@ -0,0 +1,152 @@ +// Copyright 2011 Evan Shaw. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// These tests are adapted from gommap: http://labix.org/gommap +// Copyright (c) 2010, Gustavo Niemeyer + +package mmap + +import ( + "bytes" + "io/ioutil" + "os" + "path/filepath" + "testing" +) + +var testData = []byte("0123456789ABCDEF") +var testPath = filepath.Join(os.TempDir(), "testdata") + +func init() { + f := openFile(os.O_RDWR | os.O_CREATE | os.O_TRUNC) + f.Write(testData) + f.Close() +} + +func openFile(flags int) *os.File { + f, err := os.OpenFile(testPath, flags, 0644) + if err != nil { + panic(err.Error()) + } + return f +} + +func TestUnmap(t *testing.T) { + f := openFile(os.O_RDONLY) + defer f.Close() + mmap, err := Map(f, RDONLY, 0) + if err != nil { + t.Errorf("error mapping: %s", err) + } + if err := mmap.Unmap(); err != nil { + t.Errorf("error unmapping: %s", err) + } +} + +func TestReadWrite(t *testing.T) { + f := openFile(os.O_RDWR) + defer f.Close() + mmap, err := Map(f, RDWR, 0) + if err != nil { + t.Errorf("error mapping: %s", err) + } + defer mmap.Unmap() + if !bytes.Equal(testData, mmap) { + t.Errorf("mmap != testData: %q, %q", mmap, testData) + } + + mmap[9] = 'X' + mmap.Flush() + + fileData, err := ioutil.ReadAll(f) + if err != nil { + t.Errorf("error reading file: %s", err) + } + if !bytes.Equal(fileData, []byte("012345678XABCDEF")) { + t.Errorf("file wasn't modified") + } + + // leave things how we found them + mmap[9] = '9' + mmap.Flush() +} + +func TestProtFlagsAndErr(t *testing.T) { + f := openFile(os.O_RDONLY) + defer f.Close() + if _, err := Map(f, RDWR, 0); err == nil { + t.Errorf("expected error") + } +} + +func TestFlags(t *testing.T) { + f := openFile(os.O_RDWR) + defer f.Close() + mmap, err := Map(f, COPY, 0) + if err != nil { + t.Errorf("error mapping: %s", err) + } + defer mmap.Unmap() + + mmap[9] = 'X' + mmap.Flush() + + fileData, err := ioutil.ReadAll(f) + if err != nil { + t.Errorf("error reading file: %s", err) + } + if !bytes.Equal(fileData, testData) { + t.Errorf("file was modified") + } +} + +// Test that we can map files from non-0 offsets +// The page size on most Unixes is 4KB, but on Windows it's 64KB +func TestNonZeroOffset(t *testing.T) { + const pageSize = 65536 + + // Create a 2-page sized file + bigFilePath := filepath.Join(os.TempDir(), "nonzero") + fileobj, err := os.OpenFile(bigFilePath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0644) + if err != nil { + panic(err.Error()) + } + + bigData := make([]byte, 2*pageSize, 2*pageSize) + fileobj.Write(bigData) + fileobj.Close() + + // Map the first page by itself + fileobj, err = os.OpenFile(bigFilePath, os.O_RDONLY, 0) + if err != nil { + panic(err.Error()) + } + m, err := MapRegion(fileobj, pageSize, RDONLY, 0, 0) + if err != nil { + t.Errorf("error mapping file: %s", err) + } + m.Unmap() + fileobj.Close() + + // Map the second page by itself + fileobj, err = os.OpenFile(bigFilePath, os.O_RDONLY, 0) + if err != nil { + panic(err.Error()) + } + m, err = MapRegion(fileobj, pageSize, RDONLY, 0, pageSize) + if err != nil { + t.Errorf("error mapping file: %s", err) + } + err = m.Unmap() + if err != nil { + t.Error(err) + } + + m, err = MapRegion(fileobj, pageSize, RDONLY, 0, 1) + if err == nil { + t.Error("expect error because offset is not multiple of page size") + } + + fileobj.Close() +} diff --git a/_vendor/vendor/github.com/edsrzf/mmap-go/mmap_unix.go b/vendor/github.com/edsrzf/mmap-go/mmap_unix.go similarity index 100% rename from _vendor/vendor/github.com/edsrzf/mmap-go/mmap_unix.go rename to vendor/github.com/edsrzf/mmap-go/mmap_unix.go diff --git a/_vendor/vendor/github.com/edsrzf/mmap-go/mmap_windows.go b/vendor/github.com/edsrzf/mmap-go/mmap_windows.go similarity index 100% rename from _vendor/vendor/github.com/edsrzf/mmap-go/mmap_windows.go rename to vendor/github.com/edsrzf/mmap-go/mmap_windows.go diff --git a/_vendor/vendor/github.com/edsrzf/mmap-go/msync_netbsd.go b/vendor/github.com/edsrzf/mmap-go/msync_netbsd.go similarity index 100% rename from _vendor/vendor/github.com/edsrzf/mmap-go/msync_netbsd.go rename to vendor/github.com/edsrzf/mmap-go/msync_netbsd.go diff --git a/_vendor/vendor/github.com/edsrzf/mmap-go/msync_unix.go b/vendor/github.com/edsrzf/mmap-go/msync_unix.go similarity index 100% rename from _vendor/vendor/github.com/edsrzf/mmap-go/msync_unix.go rename to vendor/github.com/edsrzf/mmap-go/msync_unix.go diff --git a/_vendor/vendor/github.com/glendc/gopher-json/LICENSE b/vendor/github.com/glendc/gopher-json/LICENSE similarity index 100% rename from _vendor/vendor/github.com/glendc/gopher-json/LICENSE rename to vendor/github.com/glendc/gopher-json/LICENSE diff --git a/vendor/github.com/glendc/gopher-json/README.md b/vendor/github.com/glendc/gopher-json/README.md new file mode 100644 index 0000000..a0e7c34 --- /dev/null +++ b/vendor/github.com/glendc/gopher-json/README.md @@ -0,0 +1,7 @@ +# gopher-json [![GoDoc](https://godoc.org/layeh.com/gopher-json?status.svg)](https://godoc.org/layeh.com/gopher-json) + +Package json is a simple JSON encoder/decoder for [gopher-lua](https://github.com/yuin/gopher-lua). + +## License + +Public domain. diff --git a/_vendor/vendor/github.com/glendc/gopher-json/api.go b/vendor/github.com/glendc/gopher-json/api.go similarity index 100% rename from _vendor/vendor/github.com/glendc/gopher-json/api.go rename to vendor/github.com/glendc/gopher-json/api.go diff --git a/_vendor/vendor/github.com/glendc/gopher-json/cjson.go b/vendor/github.com/glendc/gopher-json/cjson.go similarity index 100% rename from _vendor/vendor/github.com/glendc/gopher-json/cjson.go rename to vendor/github.com/glendc/gopher-json/cjson.go diff --git a/_vendor/vendor/github.com/glendc/gopher-json/doc.go b/vendor/github.com/glendc/gopher-json/doc.go similarity index 100% rename from _vendor/vendor/github.com/glendc/gopher-json/doc.go rename to vendor/github.com/glendc/gopher-json/doc.go diff --git a/_vendor/vendor/github.com/glendc/gopher-json/json.go b/vendor/github.com/glendc/gopher-json/json.go similarity index 100% rename from _vendor/vendor/github.com/glendc/gopher-json/json.go rename to vendor/github.com/glendc/gopher-json/json.go diff --git a/vendor/github.com/glendc/gopher-json/json_test.go b/vendor/github.com/glendc/gopher-json/json_test.go new file mode 100644 index 0000000..8f5a167 --- /dev/null +++ b/vendor/github.com/glendc/gopher-json/json_test.go @@ -0,0 +1,75 @@ +package json + +import ( + "testing" + + "github.com/yuin/gopher-lua" +) + +func TestSimple(t *testing.T) { + const str = ` + local json = require("json") + assert(type(json) == "table") + assert(type(json.decode) == "function") + assert(type(json.encode) == "function") + + assert(json.encode(true) == "true") + assert(json.encode(1) == "1") + assert(json.encode(-10) == "-10") + assert(json.encode(nil) == "{}") + + local obj = {"a",1,"b",2,"c",3} + local jsonStr = json.encode(obj) + local jsonObj = json.decode(jsonStr) + for i = 1, #obj do + assert(obj[i] == jsonObj[i]) + end + + local obj = {name="Tim",number=12345} + local jsonStr = json.encode(obj) + local jsonObj = json.decode(jsonStr) + assert(obj.name == jsonObj.name) + assert(obj.number == jsonObj.number) + + local obj = {"a","b",what="c",[5]="asd"} + local jsonStr = json.encode(obj) + local jsonObj = json.decode(jsonStr) + assert(obj[1] == jsonObj["1"]) + assert(obj[2] == jsonObj["2"]) + assert(obj.what == jsonObj["what"]) + assert(obj[5] == jsonObj["5"]) + + assert(json.decode("null") == nil) + + assert(json.decode(json.encode({person={name = "tim",}})).person.name == "tim") + + local obj = { + abc = 123, + def = nil, + } + local obj2 = { + obj = obj, + } + obj.obj2 = obj2 + assert(json.encode(obj) == nil) + ` + s := lua.NewState() + Preload(s) + if err := s.DoString(str); err != nil { + t.Error(err) + } +} + +func TestCustomRequire(t *testing.T) { + const str = ` + local j = require("JSON") + assert(type(j) == "table") + assert(type(j.decode) == "function") + assert(type(j.encode) == "function") + ` + s := lua.NewState() + s.PreloadModule("JSON", Loader) + if err := s.DoString(str); err != nil { + t.Error(err) + } +} diff --git a/_vendor/vendor/github.com/glendc/gopher-json/util.go b/vendor/github.com/glendc/gopher-json/util.go similarity index 100% rename from _vendor/vendor/github.com/glendc/gopher-json/util.go rename to vendor/github.com/glendc/gopher-json/util.go diff --git a/vendor/github.com/golang/snappy/.gitignore b/vendor/github.com/golang/snappy/.gitignore new file mode 100644 index 0000000..042091d --- /dev/null +++ b/vendor/github.com/golang/snappy/.gitignore @@ -0,0 +1,16 @@ +cmd/snappytool/snappytool +testdata/bench + +# These explicitly listed benchmark data files are for an obsolete version of +# snappy_test.go. +testdata/alice29.txt +testdata/asyoulik.txt +testdata/fireworks.jpeg +testdata/geo.protodata +testdata/html +testdata/html_x_4 +testdata/kppkn.gtb +testdata/lcet10.txt +testdata/paper-100k.pdf +testdata/plrabn12.txt +testdata/urls.10K diff --git a/vendor/github.com/golang/snappy/AUTHORS b/vendor/github.com/golang/snappy/AUTHORS new file mode 100644 index 0000000..bcfa195 --- /dev/null +++ b/vendor/github.com/golang/snappy/AUTHORS @@ -0,0 +1,15 @@ +# This is the official list of Snappy-Go authors for copyright purposes. +# This file is distinct from the CONTRIBUTORS files. +# See the latter for an explanation. + +# Names should be added to this file as +# Name or Organization +# The email address is not required for organizations. + +# Please keep the list sorted. + +Damian Gryski +Google Inc. +Jan Mercl <0xjnml@gmail.com> +Rodolfo Carvalho +Sebastien Binet diff --git a/vendor/github.com/golang/snappy/CONTRIBUTORS b/vendor/github.com/golang/snappy/CONTRIBUTORS new file mode 100644 index 0000000..931ae31 --- /dev/null +++ b/vendor/github.com/golang/snappy/CONTRIBUTORS @@ -0,0 +1,37 @@ +# This is the official list of people who can contribute +# (and typically have contributed) code to the Snappy-Go repository. +# The AUTHORS file lists the copyright holders; this file +# lists people. For example, Google employees are listed here +# but not in AUTHORS, because Google holds the copyright. +# +# The submission process automatically checks to make sure +# that people submitting code are listed in this file (by email address). +# +# Names should be added to this file only after verifying that +# the individual or the individual's organization has agreed to +# the appropriate Contributor License Agreement, found here: +# +# http://code.google.com/legal/individual-cla-v1.0.html +# http://code.google.com/legal/corporate-cla-v1.0.html +# +# The agreement for individuals can be filled out on the web. +# +# When adding J Random Contributor's name to this file, +# either J's name or J's organization's name should be +# added to the AUTHORS file, depending on whether the +# individual or corporate CLA was used. + +# Names should be added to this file like so: +# Name + +# Please keep the list sorted. + +Damian Gryski +Jan Mercl <0xjnml@gmail.com> +Kai Backman +Marc-Antoine Ruel +Nigel Tao +Rob Pike +Rodolfo Carvalho +Russ Cox +Sebastien Binet diff --git a/_vendor/vendor/github.com/golang/snappy/LICENSE b/vendor/github.com/golang/snappy/LICENSE similarity index 100% rename from _vendor/vendor/github.com/golang/snappy/LICENSE rename to vendor/github.com/golang/snappy/LICENSE diff --git a/vendor/github.com/golang/snappy/README b/vendor/github.com/golang/snappy/README new file mode 100644 index 0000000..cea1287 --- /dev/null +++ b/vendor/github.com/golang/snappy/README @@ -0,0 +1,107 @@ +The Snappy compression format in the Go programming language. + +To download and install from source: +$ go get github.com/golang/snappy + +Unless otherwise noted, the Snappy-Go source files are distributed +under the BSD-style license found in the LICENSE file. + + + +Benchmarks. + +The golang/snappy benchmarks include compressing (Z) and decompressing (U) ten +or so files, the same set used by the C++ Snappy code (github.com/google/snappy +and note the "google", not "golang"). On an "Intel(R) Core(TM) i7-3770 CPU @ +3.40GHz", Go's GOARCH=amd64 numbers as of 2016-05-29: + +"go test -test.bench=." + +_UFlat0-8 2.19GB/s ± 0% html +_UFlat1-8 1.41GB/s ± 0% urls +_UFlat2-8 23.5GB/s ± 2% jpg +_UFlat3-8 1.91GB/s ± 0% jpg_200 +_UFlat4-8 14.0GB/s ± 1% pdf +_UFlat5-8 1.97GB/s ± 0% html4 +_UFlat6-8 814MB/s ± 0% txt1 +_UFlat7-8 785MB/s ± 0% txt2 +_UFlat8-8 857MB/s ± 0% txt3 +_UFlat9-8 719MB/s ± 1% txt4 +_UFlat10-8 2.84GB/s ± 0% pb +_UFlat11-8 1.05GB/s ± 0% gaviota + +_ZFlat0-8 1.04GB/s ± 0% html +_ZFlat1-8 534MB/s ± 0% urls +_ZFlat2-8 15.7GB/s ± 1% jpg +_ZFlat3-8 740MB/s ± 3% jpg_200 +_ZFlat4-8 9.20GB/s ± 1% pdf +_ZFlat5-8 991MB/s ± 0% html4 +_ZFlat6-8 379MB/s ± 0% txt1 +_ZFlat7-8 352MB/s ± 0% txt2 +_ZFlat8-8 396MB/s ± 1% txt3 +_ZFlat9-8 327MB/s ± 1% txt4 +_ZFlat10-8 1.33GB/s ± 1% pb +_ZFlat11-8 605MB/s ± 1% gaviota + + + +"go test -test.bench=. -tags=noasm" + +_UFlat0-8 621MB/s ± 2% html +_UFlat1-8 494MB/s ± 1% urls +_UFlat2-8 23.2GB/s ± 1% jpg +_UFlat3-8 1.12GB/s ± 1% jpg_200 +_UFlat4-8 4.35GB/s ± 1% pdf +_UFlat5-8 609MB/s ± 0% html4 +_UFlat6-8 296MB/s ± 0% txt1 +_UFlat7-8 288MB/s ± 0% txt2 +_UFlat8-8 309MB/s ± 1% txt3 +_UFlat9-8 280MB/s ± 1% txt4 +_UFlat10-8 753MB/s ± 0% pb +_UFlat11-8 400MB/s ± 0% gaviota + +_ZFlat0-8 409MB/s ± 1% html +_ZFlat1-8 250MB/s ± 1% urls +_ZFlat2-8 12.3GB/s ± 1% jpg +_ZFlat3-8 132MB/s ± 0% jpg_200 +_ZFlat4-8 2.92GB/s ± 0% pdf +_ZFlat5-8 405MB/s ± 1% html4 +_ZFlat6-8 179MB/s ± 1% txt1 +_ZFlat7-8 170MB/s ± 1% txt2 +_ZFlat8-8 189MB/s ± 1% txt3 +_ZFlat9-8 164MB/s ± 1% txt4 +_ZFlat10-8 479MB/s ± 1% pb +_ZFlat11-8 270MB/s ± 1% gaviota + + + +For comparison (Go's encoded output is byte-for-byte identical to C++'s), here +are the numbers from C++ Snappy's + +make CXXFLAGS="-O2 -DNDEBUG -g" clean snappy_unittest.log && cat snappy_unittest.log + +BM_UFlat/0 2.4GB/s html +BM_UFlat/1 1.4GB/s urls +BM_UFlat/2 21.8GB/s jpg +BM_UFlat/3 1.5GB/s jpg_200 +BM_UFlat/4 13.3GB/s pdf +BM_UFlat/5 2.1GB/s html4 +BM_UFlat/6 1.0GB/s txt1 +BM_UFlat/7 959.4MB/s txt2 +BM_UFlat/8 1.0GB/s txt3 +BM_UFlat/9 864.5MB/s txt4 +BM_UFlat/10 2.9GB/s pb +BM_UFlat/11 1.2GB/s gaviota + +BM_ZFlat/0 944.3MB/s html (22.31 %) +BM_ZFlat/1 501.6MB/s urls (47.78 %) +BM_ZFlat/2 14.3GB/s jpg (99.95 %) +BM_ZFlat/3 538.3MB/s jpg_200 (73.00 %) +BM_ZFlat/4 8.3GB/s pdf (83.30 %) +BM_ZFlat/5 903.5MB/s html4 (22.52 %) +BM_ZFlat/6 336.0MB/s txt1 (57.88 %) +BM_ZFlat/7 312.3MB/s txt2 (61.91 %) +BM_ZFlat/8 353.1MB/s txt3 (54.99 %) +BM_ZFlat/9 289.9MB/s txt4 (66.26 %) +BM_ZFlat/10 1.2GB/s pb (19.68 %) +BM_ZFlat/11 527.4MB/s gaviota (37.72 %) diff --git a/_vendor/vendor/github.com/golang/snappy/decode.go b/vendor/github.com/golang/snappy/decode.go similarity index 100% rename from _vendor/vendor/github.com/golang/snappy/decode.go rename to vendor/github.com/golang/snappy/decode.go diff --git a/_vendor/vendor/github.com/golang/snappy/decode_amd64.go b/vendor/github.com/golang/snappy/decode_amd64.go similarity index 100% rename from _vendor/vendor/github.com/golang/snappy/decode_amd64.go rename to vendor/github.com/golang/snappy/decode_amd64.go diff --git a/_vendor/vendor/github.com/golang/snappy/decode_amd64.s b/vendor/github.com/golang/snappy/decode_amd64.s similarity index 100% rename from _vendor/vendor/github.com/golang/snappy/decode_amd64.s rename to vendor/github.com/golang/snappy/decode_amd64.s diff --git a/_vendor/vendor/github.com/golang/snappy/decode_other.go b/vendor/github.com/golang/snappy/decode_other.go similarity index 100% rename from _vendor/vendor/github.com/golang/snappy/decode_other.go rename to vendor/github.com/golang/snappy/decode_other.go diff --git a/_vendor/vendor/github.com/golang/snappy/encode.go b/vendor/github.com/golang/snappy/encode.go similarity index 100% rename from _vendor/vendor/github.com/golang/snappy/encode.go rename to vendor/github.com/golang/snappy/encode.go diff --git a/_vendor/vendor/github.com/golang/snappy/encode_amd64.go b/vendor/github.com/golang/snappy/encode_amd64.go similarity index 100% rename from _vendor/vendor/github.com/golang/snappy/encode_amd64.go rename to vendor/github.com/golang/snappy/encode_amd64.go diff --git a/_vendor/vendor/github.com/golang/snappy/encode_amd64.s b/vendor/github.com/golang/snappy/encode_amd64.s similarity index 100% rename from _vendor/vendor/github.com/golang/snappy/encode_amd64.s rename to vendor/github.com/golang/snappy/encode_amd64.s diff --git a/_vendor/vendor/github.com/golang/snappy/encode_other.go b/vendor/github.com/golang/snappy/encode_other.go similarity index 100% rename from _vendor/vendor/github.com/golang/snappy/encode_other.go rename to vendor/github.com/golang/snappy/encode_other.go diff --git a/vendor/github.com/golang/snappy/golden_test.go b/vendor/github.com/golang/snappy/golden_test.go new file mode 100644 index 0000000..e4496f9 --- /dev/null +++ b/vendor/github.com/golang/snappy/golden_test.go @@ -0,0 +1,1965 @@ +// Copyright 2016 The Snappy-Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package snappy + +// extendMatchGoldenTestCases is the i and j arguments, and the returned value, +// for every extendMatch call issued when encoding the +// testdata/Mark.Twain-Tom.Sawyer.txt file. It is used to benchmark the +// extendMatch implementation. +// +// It was generated manually by adding some print statements to the (pure Go) +// extendMatch implementation: +// +// func extendMatch(src []byte, i, j int) int { +// i0, j0 := i, j +// for ; j < len(src) && src[i] == src[j]; i, j = i+1, j+1 { +// } +// println("{", i0, ",", j0, ",", j, "},") +// return j +// } +// +// and running "go test -test.run=EncodeGoldenInput -tags=noasm". +var extendMatchGoldenTestCases = []struct { + i, j, want int +}{ + {11, 61, 62}, + {80, 81, 82}, + {86, 87, 101}, + {85, 133, 149}, + {152, 153, 162}, + {133, 168, 193}, + {168, 207, 225}, + {81, 255, 275}, + {278, 279, 283}, + {306, 417, 417}, + {373, 428, 430}, + {389, 444, 447}, + {474, 510, 512}, + {465, 533, 533}, + {47, 547, 547}, + {307, 551, 554}, + {420, 582, 587}, + {309, 604, 604}, + {604, 625, 625}, + {538, 629, 629}, + {328, 640, 640}, + {573, 645, 645}, + {319, 657, 657}, + {30, 664, 664}, + {45, 679, 680}, + {621, 684, 684}, + {376, 700, 700}, + {33, 707, 708}, + {601, 733, 733}, + {334, 744, 745}, + {625, 758, 759}, + {382, 763, 763}, + {550, 769, 771}, + {533, 789, 789}, + {804, 813, 813}, + {342, 841, 842}, + {742, 847, 847}, + {74, 852, 852}, + {810, 864, 864}, + {758, 868, 869}, + {714, 883, 883}, + {582, 889, 891}, + {61, 934, 935}, + {894, 942, 942}, + {939, 949, 949}, + {785, 956, 957}, + {886, 978, 978}, + {792, 998, 998}, + {998, 1005, 1005}, + {572, 1032, 1032}, + {698, 1051, 1053}, + {599, 1067, 1069}, + {1056, 1079, 1079}, + {942, 1089, 1090}, + {831, 1094, 1096}, + {1088, 1100, 1103}, + {732, 1113, 1114}, + {1037, 1118, 1118}, + {872, 1128, 1130}, + {1079, 1140, 1142}, + {332, 1162, 1162}, + {207, 1168, 1186}, + {1189, 1190, 1225}, + {105, 1229, 1230}, + {79, 1256, 1257}, + {1190, 1261, 1283}, + {255, 1306, 1306}, + {1319, 1339, 1358}, + {364, 1370, 1370}, + {955, 1378, 1380}, + {122, 1403, 1403}, + {1325, 1407, 1419}, + {664, 1423, 1424}, + {941, 1461, 1463}, + {867, 1477, 1478}, + {757, 1488, 1489}, + {1140, 1499, 1499}, + {31, 1506, 1506}, + {1487, 1510, 1512}, + {1089, 1520, 1521}, + {1467, 1525, 1529}, + {1394, 1537, 1537}, + {1499, 1541, 1541}, + {367, 1558, 1558}, + {1475, 1564, 1564}, + {1525, 1568, 1571}, + {1541, 1582, 1583}, + {864, 1587, 1588}, + {704, 1597, 1597}, + {336, 1602, 1602}, + {1383, 1613, 1613}, + {1498, 1617, 1618}, + {1051, 1623, 1625}, + {401, 1643, 1645}, + {1072, 1654, 1655}, + {1067, 1667, 1669}, + {699, 1673, 1674}, + {1587, 1683, 1684}, + {920, 1696, 1696}, + {1505, 1710, 1710}, + {1550, 1723, 1723}, + {996, 1727, 1727}, + {833, 1733, 1734}, + {1638, 1739, 1740}, + {1654, 1744, 1744}, + {753, 1761, 1761}, + {1548, 1773, 1773}, + {1568, 1777, 1780}, + {1683, 1793, 1794}, + {948, 1801, 1801}, + {1666, 1805, 1808}, + {1502, 1814, 1814}, + {1696, 1822, 1822}, + {502, 1836, 1837}, + {917, 1843, 1843}, + {1733, 1854, 1855}, + {970, 1859, 1859}, + {310, 1863, 1863}, + {657, 1872, 1872}, + {1005, 1876, 1876}, + {1662, 1880, 1880}, + {904, 1892, 1892}, + {1427, 1910, 1910}, + {1772, 1929, 1930}, + {1822, 1937, 1940}, + {1858, 1949, 1950}, + {1602, 1956, 1956}, + {1150, 1962, 1962}, + {1504, 1966, 1967}, + {51, 1971, 1971}, + {1605, 1979, 1979}, + {1458, 1983, 1988}, + {1536, 2001, 2006}, + {1373, 2014, 2018}, + {1494, 2025, 2025}, + {1667, 2029, 2031}, + {1592, 2035, 2035}, + {330, 2045, 2045}, + {1376, 2053, 2053}, + {1991, 2058, 2059}, + {1635, 2065, 2065}, + {1992, 2073, 2074}, + {2014, 2080, 2081}, + {1546, 2085, 2087}, + {59, 2099, 2099}, + {1996, 2106, 2106}, + {1836, 2110, 2110}, + {2068, 2114, 2114}, + {1338, 2122, 2122}, + {1562, 2128, 2130}, + {1934, 2134, 2134}, + {2114, 2141, 2142}, + {977, 2149, 2150}, + {956, 2154, 2155}, + {1407, 2162, 2162}, + {1773, 2166, 2166}, + {883, 2171, 2171}, + {623, 2175, 2178}, + {1520, 2191, 2192}, + {1162, 2200, 2200}, + {912, 2204, 2204}, + {733, 2208, 2208}, + {1777, 2212, 2215}, + {1532, 2219, 2219}, + {718, 2223, 2225}, + {2069, 2229, 2229}, + {2207, 2245, 2246}, + {1139, 2264, 2264}, + {677, 2274, 2274}, + {2099, 2279, 2279}, + {1863, 2283, 2283}, + {1966, 2305, 2306}, + {2279, 2313, 2313}, + {1628, 2319, 2319}, + {755, 2329, 2329}, + {1461, 2334, 2334}, + {2117, 2340, 2340}, + {2313, 2349, 2349}, + {1859, 2353, 2353}, + {1048, 2362, 2362}, + {895, 2366, 2366}, + {2278, 2373, 2373}, + {1884, 2377, 2377}, + {1402, 2387, 2392}, + {700, 2398, 2398}, + {1971, 2402, 2402}, + {2009, 2419, 2419}, + {1441, 2426, 2428}, + {2208, 2432, 2432}, + {2038, 2436, 2436}, + {932, 2443, 2443}, + {1759, 2447, 2448}, + {744, 2452, 2452}, + {1875, 2458, 2458}, + {2405, 2468, 2468}, + {1596, 2472, 2473}, + {1953, 2480, 2482}, + {736, 2487, 2487}, + {1913, 2493, 2493}, + {774, 2497, 2497}, + {1484, 2506, 2508}, + {2432, 2512, 2512}, + {752, 2519, 2519}, + {2497, 2523, 2523}, + {2409, 2528, 2529}, + {2122, 2533, 2533}, + {2396, 2537, 2538}, + {2410, 2547, 2548}, + {1093, 2555, 2560}, + {551, 2564, 2565}, + {2268, 2569, 2569}, + {1362, 2580, 2580}, + {1916, 2584, 2585}, + {994, 2589, 2590}, + {1979, 2596, 2596}, + {1041, 2602, 2602}, + {2104, 2614, 2616}, + {2609, 2621, 2628}, + {2329, 2638, 2638}, + {2211, 2657, 2658}, + {2638, 2662, 2667}, + {2578, 2676, 2679}, + {2153, 2685, 2686}, + {2608, 2696, 2697}, + {598, 2712, 2712}, + {2620, 2719, 2720}, + {1888, 2724, 2728}, + {2709, 2732, 2732}, + {1365, 2739, 2739}, + {784, 2747, 2748}, + {424, 2753, 2753}, + {2204, 2759, 2759}, + {812, 2768, 2769}, + {2455, 2773, 2773}, + {1722, 2781, 2781}, + {1917, 2792, 2792}, + {2705, 2799, 2799}, + {2685, 2806, 2807}, + {2742, 2811, 2811}, + {1370, 2818, 2818}, + {2641, 2830, 2830}, + {2512, 2837, 2837}, + {2457, 2841, 2841}, + {2756, 2845, 2845}, + {2719, 2855, 2855}, + {1423, 2859, 2859}, + {2849, 2863, 2865}, + {1474, 2871, 2871}, + {1161, 2875, 2876}, + {2282, 2880, 2881}, + {2746, 2888, 2888}, + {1783, 2893, 2893}, + {2401, 2899, 2900}, + {2632, 2920, 2923}, + {2422, 2928, 2930}, + {2715, 2939, 2939}, + {2162, 2943, 2943}, + {2859, 2947, 2947}, + {1910, 2951, 2951}, + {1431, 2955, 2956}, + {1439, 2964, 2964}, + {2501, 2968, 2969}, + {2029, 2973, 2976}, + {689, 2983, 2984}, + {1658, 2988, 2988}, + {1031, 2996, 2996}, + {2149, 3001, 3002}, + {25, 3009, 3013}, + {2964, 3023, 3023}, + {953, 3027, 3028}, + {2359, 3036, 3036}, + {3023, 3049, 3049}, + {2880, 3055, 3056}, + {2973, 3076, 3077}, + {2874, 3090, 3090}, + {2871, 3094, 3094}, + {2532, 3100, 3100}, + {2938, 3107, 3108}, + {350, 3115, 3115}, + {2196, 3119, 3121}, + {1133, 3127, 3129}, + {1797, 3134, 3150}, + {3032, 3158, 3158}, + {3016, 3172, 3172}, + {2533, 3179, 3179}, + {3055, 3187, 3188}, + {1384, 3192, 3193}, + {2799, 3199, 3199}, + {2126, 3203, 3207}, + {2334, 3215, 3215}, + {2105, 3220, 3221}, + {3199, 3229, 3229}, + {2891, 3233, 3233}, + {855, 3240, 3240}, + {1852, 3253, 3256}, + {2140, 3263, 3263}, + {1682, 3268, 3270}, + {3243, 3274, 3274}, + {924, 3279, 3279}, + {2212, 3283, 3283}, + {2596, 3287, 3287}, + {2999, 3291, 3291}, + {2353, 3295, 3295}, + {2480, 3302, 3304}, + {1959, 3308, 3311}, + {3000, 3318, 3318}, + {845, 3330, 3330}, + {2283, 3334, 3334}, + {2519, 3342, 3342}, + {3325, 3346, 3348}, + {2397, 3353, 3354}, + {2763, 3358, 3358}, + {3198, 3363, 3364}, + {3211, 3368, 3372}, + {2950, 3376, 3377}, + {3245, 3388, 3391}, + {2264, 3398, 3398}, + {795, 3403, 3403}, + {3287, 3407, 3407}, + {3358, 3411, 3411}, + {3317, 3415, 3415}, + {3232, 3431, 3431}, + {2128, 3435, 3437}, + {3236, 3441, 3441}, + {3398, 3445, 3446}, + {2814, 3450, 3450}, + {3394, 3466, 3466}, + {2425, 3470, 3470}, + {3330, 3476, 3476}, + {1612, 3480, 3480}, + {1004, 3485, 3486}, + {2732, 3490, 3490}, + {1117, 3494, 3495}, + {629, 3501, 3501}, + {3087, 3514, 3514}, + {684, 3518, 3518}, + {3489, 3522, 3524}, + {1760, 3529, 3529}, + {617, 3537, 3537}, + {3431, 3541, 3541}, + {997, 3547, 3547}, + {882, 3552, 3553}, + {2419, 3558, 3558}, + {610, 3562, 3563}, + {1903, 3567, 3569}, + {3005, 3575, 3575}, + {3076, 3585, 3586}, + {3541, 3590, 3590}, + {3490, 3594, 3594}, + {1899, 3599, 3599}, + {3545, 3606, 3606}, + {3290, 3614, 3615}, + {2056, 3619, 3620}, + {3556, 3625, 3625}, + {3294, 3632, 3633}, + {637, 3643, 3644}, + {3609, 3648, 3650}, + {3175, 3658, 3658}, + {3498, 3665, 3665}, + {1597, 3669, 3669}, + {1983, 3673, 3673}, + {3215, 3682, 3682}, + {3544, 3689, 3689}, + {3694, 3698, 3698}, + {3228, 3715, 3716}, + {2594, 3720, 3722}, + {3573, 3726, 3726}, + {2479, 3732, 3735}, + {3191, 3741, 3742}, + {1113, 3746, 3747}, + {2844, 3751, 3751}, + {3445, 3756, 3757}, + {3755, 3766, 3766}, + {3421, 3775, 3780}, + {3593, 3784, 3786}, + {3263, 3796, 3796}, + {3469, 3806, 3806}, + {2602, 3815, 3815}, + {723, 3819, 3821}, + {1608, 3826, 3826}, + {3334, 3830, 3830}, + {2198, 3835, 3835}, + {2635, 3840, 3840}, + {3702, 3852, 3853}, + {3406, 3858, 3859}, + {3681, 3867, 3870}, + {3407, 3880, 3880}, + {340, 3889, 3889}, + {3772, 3893, 3893}, + {593, 3897, 3897}, + {2563, 3914, 3916}, + {2981, 3929, 3929}, + {1835, 3933, 3934}, + {3906, 3951, 3951}, + {1459, 3958, 3958}, + {3889, 3974, 3974}, + {2188, 3982, 3982}, + {3220, 3986, 3987}, + {3585, 3991, 3993}, + {3712, 3997, 4001}, + {2805, 4007, 4007}, + {1879, 4012, 4013}, + {3618, 4018, 4018}, + {1145, 4031, 4032}, + {3901, 4037, 4037}, + {2772, 4046, 4047}, + {2802, 4053, 4054}, + {3299, 4058, 4058}, + {3725, 4066, 4066}, + {2271, 4070, 4070}, + {385, 4075, 4076}, + {3624, 4089, 4090}, + {3745, 4096, 4098}, + {1563, 4102, 4102}, + {4045, 4106, 4111}, + {3696, 4115, 4119}, + {3376, 4125, 4126}, + {1880, 4130, 4130}, + {2048, 4140, 4141}, + {2724, 4149, 4149}, + {1767, 4156, 4156}, + {2601, 4164, 4164}, + {2757, 4168, 4168}, + {3974, 4172, 4172}, + {3914, 4178, 4178}, + {516, 4185, 4185}, + {1032, 4189, 4190}, + {3462, 4197, 4198}, + {3805, 4202, 4203}, + {3910, 4207, 4212}, + {3075, 4221, 4221}, + {3756, 4225, 4226}, + {1872, 4236, 4237}, + {3844, 4241, 4241}, + {3991, 4245, 4249}, + {2203, 4258, 4258}, + {3903, 4267, 4268}, + {705, 4272, 4272}, + {1896, 4276, 4276}, + {1955, 4285, 4288}, + {3746, 4302, 4303}, + {2672, 4311, 4311}, + {3969, 4317, 4317}, + {3883, 4322, 4322}, + {1920, 4339, 4340}, + {3527, 4344, 4346}, + {1160, 4358, 4358}, + {3648, 4364, 4366}, + {2711, 4387, 4387}, + {3619, 4391, 4392}, + {1944, 4396, 4396}, + {4369, 4400, 4400}, + {2736, 4404, 4407}, + {2546, 4411, 4412}, + {4390, 4422, 4422}, + {3610, 4426, 4427}, + {4058, 4431, 4431}, + {4374, 4435, 4435}, + {3463, 4445, 4446}, + {1813, 4452, 4452}, + {3669, 4456, 4456}, + {3830, 4460, 4460}, + {421, 4464, 4465}, + {1719, 4471, 4471}, + {3880, 4475, 4475}, + {1834, 4485, 4487}, + {3590, 4491, 4491}, + {442, 4496, 4497}, + {4435, 4501, 4501}, + {3814, 4509, 4509}, + {987, 4513, 4513}, + {4494, 4518, 4521}, + {3218, 4526, 4529}, + {4221, 4537, 4537}, + {2778, 4543, 4545}, + {4422, 4552, 4552}, + {4031, 4558, 4559}, + {4178, 4563, 4563}, + {3726, 4567, 4574}, + {4027, 4578, 4578}, + {4339, 4585, 4587}, + {3796, 4592, 4595}, + {543, 4600, 4613}, + {2855, 4620, 4621}, + {2795, 4627, 4627}, + {3440, 4631, 4632}, + {4279, 4636, 4639}, + {4245, 4643, 4645}, + {4516, 4649, 4650}, + {3133, 4654, 4654}, + {4042, 4658, 4659}, + {3422, 4663, 4663}, + {4046, 4667, 4668}, + {4267, 4672, 4672}, + {4004, 4676, 4677}, + {2490, 4682, 4682}, + {2451, 4697, 4697}, + {3027, 4705, 4705}, + {4028, 4717, 4717}, + {4460, 4721, 4721}, + {2471, 4725, 4727}, + {3090, 4735, 4735}, + {3192, 4739, 4740}, + {3835, 4760, 4760}, + {4540, 4764, 4764}, + {4007, 4772, 4774}, + {619, 4784, 4784}, + {3561, 4789, 4791}, + {3367, 4805, 4805}, + {4490, 4810, 4811}, + {2402, 4815, 4815}, + {3352, 4819, 4822}, + {2773, 4828, 4828}, + {4552, 4832, 4832}, + {2522, 4840, 4841}, + {316, 4847, 4852}, + {4715, 4858, 4858}, + {2959, 4862, 4862}, + {4858, 4868, 4869}, + {2134, 4873, 4873}, + {578, 4878, 4878}, + {4189, 4889, 4890}, + {2229, 4894, 4894}, + {4501, 4898, 4898}, + {2297, 4903, 4903}, + {2933, 4909, 4909}, + {3008, 4913, 4913}, + {3153, 4917, 4917}, + {4819, 4921, 4921}, + {4921, 4932, 4933}, + {4920, 4944, 4945}, + {4814, 4954, 4955}, + {576, 4966, 4966}, + {1854, 4970, 4971}, + {1374, 4975, 4976}, + {3307, 4980, 4980}, + {974, 4984, 4988}, + {4721, 4992, 4992}, + {4898, 4996, 4996}, + {4475, 5006, 5006}, + {3819, 5012, 5012}, + {1948, 5019, 5021}, + {4954, 5027, 5029}, + {3740, 5038, 5040}, + {4763, 5044, 5045}, + {1936, 5051, 5051}, + {4844, 5055, 5060}, + {4215, 5069, 5072}, + {1146, 5076, 5076}, + {3845, 5082, 5082}, + {4865, 5090, 5090}, + {4624, 5094, 5094}, + {4815, 5098, 5098}, + {5006, 5105, 5105}, + {4980, 5109, 5109}, + {4795, 5113, 5115}, + {5043, 5119, 5121}, + {4782, 5129, 5129}, + {3826, 5139, 5139}, + {3876, 5156, 5156}, + {3111, 5167, 5171}, + {1470, 5177, 5177}, + {4431, 5181, 5181}, + {546, 5189, 5189}, + {4225, 5193, 5193}, + {1672, 5199, 5201}, + {4207, 5205, 5209}, + {4220, 5216, 5217}, + {4658, 5224, 5225}, + {3295, 5235, 5235}, + {2436, 5239, 5239}, + {2349, 5246, 5246}, + {2175, 5250, 5250}, + {5180, 5257, 5258}, + {3161, 5263, 5263}, + {5105, 5272, 5272}, + {3552, 5282, 5282}, + {4944, 5299, 5300}, + {4130, 5312, 5313}, + {902, 5323, 5323}, + {913, 5327, 5327}, + {2987, 5333, 5334}, + {5150, 5344, 5344}, + {5249, 5348, 5348}, + {1965, 5358, 5359}, + {5330, 5364, 5364}, + {2012, 5373, 5377}, + {712, 5384, 5386}, + {5235, 5390, 5390}, + {5044, 5398, 5399}, + {564, 5406, 5406}, + {39, 5410, 5410}, + {4642, 5422, 5425}, + {4421, 5437, 5438}, + {2347, 5449, 5449}, + {5333, 5453, 5454}, + {4136, 5458, 5459}, + {3793, 5468, 5468}, + {2243, 5480, 5480}, + {4889, 5492, 5493}, + {4295, 5504, 5504}, + {2785, 5511, 5511}, + {2377, 5518, 5518}, + {3662, 5525, 5525}, + {5097, 5529, 5530}, + {4781, 5537, 5538}, + {4697, 5547, 5548}, + {436, 5552, 5553}, + {5542, 5558, 5558}, + {3692, 5562, 5562}, + {2696, 5568, 5569}, + {4620, 5578, 5578}, + {2898, 5590, 5590}, + {5557, 5596, 5618}, + {2797, 5623, 5625}, + {2792, 5629, 5629}, + {5243, 5633, 5633}, + {5348, 5637, 5637}, + {5547, 5643, 5643}, + {4296, 5654, 5655}, + {5568, 5662, 5662}, + {3001, 5670, 5671}, + {3794, 5679, 5679}, + {4006, 5685, 5686}, + {4969, 5690, 5692}, + {687, 5704, 5704}, + {4563, 5708, 5708}, + {1723, 5738, 5738}, + {649, 5742, 5742}, + {5163, 5748, 5755}, + {3907, 5759, 5759}, + {3074, 5764, 5764}, + {5326, 5771, 5771}, + {2951, 5776, 5776}, + {5181, 5780, 5780}, + {2614, 5785, 5788}, + {4709, 5794, 5794}, + {2784, 5799, 5799}, + {5518, 5803, 5803}, + {4155, 5812, 5815}, + {921, 5819, 5819}, + {5224, 5823, 5824}, + {2853, 5830, 5836}, + {5776, 5840, 5840}, + {2955, 5844, 5845}, + {5745, 5853, 5853}, + {3291, 5857, 5857}, + {2988, 5861, 5861}, + {2647, 5865, 5865}, + {5398, 5869, 5870}, + {1085, 5874, 5875}, + {4906, 5881, 5881}, + {802, 5886, 5886}, + {5119, 5890, 5893}, + {5802, 5899, 5900}, + {3415, 5904, 5904}, + {5629, 5908, 5908}, + {3714, 5912, 5914}, + {5558, 5921, 5921}, + {2710, 5927, 5928}, + {1094, 5932, 5934}, + {2653, 5940, 5941}, + {4735, 5954, 5954}, + {5861, 5958, 5958}, + {1040, 5971, 5971}, + {5514, 5977, 5977}, + {5048, 5981, 5982}, + {5953, 5992, 5993}, + {3751, 5997, 5997}, + {4991, 6001, 6002}, + {5885, 6006, 6007}, + {5529, 6011, 6012}, + {4974, 6019, 6020}, + {5857, 6024, 6024}, + {3483, 6032, 6032}, + {3594, 6036, 6036}, + {1997, 6040, 6040}, + {5997, 6044, 6047}, + {5197, 6051, 6051}, + {1764, 6055, 6055}, + {6050, 6059, 6059}, + {5239, 6063, 6063}, + {5049, 6067, 6067}, + {5957, 6073, 6074}, + {1022, 6078, 6078}, + {3414, 6083, 6084}, + {3809, 6090, 6090}, + {4562, 6095, 6096}, + {5878, 6104, 6104}, + {594, 6108, 6109}, + {3353, 6115, 6116}, + {4992, 6120, 6121}, + {2424, 6125, 6125}, + {4484, 6130, 6130}, + {3900, 6134, 6135}, + {5793, 6139, 6141}, + {3562, 6145, 6145}, + {1438, 6152, 6153}, + {6058, 6157, 6158}, + {4411, 6162, 6163}, + {4590, 6167, 6171}, + {4748, 6175, 6175}, + {5517, 6183, 6184}, + {6095, 6191, 6192}, + {1471, 6203, 6203}, + {2643, 6209, 6210}, + {450, 6220, 6220}, + {5266, 6226, 6226}, + {2576, 6233, 6233}, + {2607, 6239, 6240}, + {5164, 6244, 6251}, + {6054, 6255, 6255}, + {1789, 6260, 6261}, + {5250, 6265, 6265}, + {6062, 6273, 6278}, + {5990, 6282, 6282}, + {3283, 6286, 6286}, + {5436, 6290, 6290}, + {6059, 6294, 6294}, + {5668, 6298, 6300}, + {3072, 6324, 6329}, + {3132, 6338, 6339}, + {3246, 6343, 6344}, + {28, 6348, 6349}, + {1503, 6353, 6355}, + {6067, 6359, 6359}, + {3384, 6364, 6364}, + {545, 6375, 6376}, + {5803, 6380, 6380}, + {5522, 6384, 6385}, + {5908, 6389, 6389}, + {2796, 6393, 6396}, + {4831, 6403, 6404}, + {6388, 6412, 6412}, + {6005, 6417, 6420}, + {4450, 6430, 6430}, + {4050, 6435, 6435}, + {5372, 6441, 6441}, + {4378, 6447, 6447}, + {6199, 6452, 6452}, + {3026, 6456, 6456}, + {2642, 6460, 6462}, + {6392, 6470, 6470}, + {6459, 6474, 6474}, + {2829, 6487, 6488}, + {2942, 6499, 6504}, + {5069, 6508, 6511}, + {5341, 6515, 6516}, + {5853, 6521, 6525}, + {6104, 6531, 6531}, + {5759, 6535, 6538}, + {4672, 6542, 6543}, + {2443, 6550, 6550}, + {5109, 6554, 6554}, + {6494, 6558, 6560}, + {6006, 6570, 6572}, + {6424, 6576, 6580}, + {4693, 6591, 6592}, + {6439, 6596, 6597}, + {3179, 6601, 6601}, + {5299, 6606, 6607}, + {4148, 6612, 6613}, + {3774, 6617, 6617}, + {3537, 6623, 6624}, + {4975, 6628, 6629}, + {3848, 6636, 6636}, + {856, 6640, 6640}, + {5724, 6645, 6645}, + {6632, 6651, 6651}, + {4630, 6656, 6658}, + {1440, 6662, 6662}, + {4281, 6666, 6667}, + {4302, 6671, 6672}, + {2589, 6676, 6677}, + {5647, 6681, 6687}, + {6082, 6691, 6693}, + {6144, 6698, 6698}, + {6103, 6709, 6710}, + {3710, 6714, 6714}, + {4253, 6718, 6721}, + {2467, 6730, 6730}, + {4778, 6734, 6734}, + {6528, 6738, 6738}, + {4358, 6747, 6747}, + {5889, 6753, 6753}, + {5193, 6757, 6757}, + {5797, 6761, 6761}, + {3858, 6765, 6766}, + {5951, 6776, 6776}, + {6487, 6781, 6782}, + {3282, 6786, 6787}, + {4667, 6797, 6799}, + {1927, 6803, 6806}, + {6583, 6810, 6810}, + {4937, 6814, 6814}, + {6099, 6824, 6824}, + {4415, 6835, 6836}, + {6332, 6840, 6841}, + {5160, 6850, 6850}, + {4764, 6854, 6854}, + {6814, 6858, 6859}, + {3018, 6864, 6864}, + {6293, 6868, 6869}, + {6359, 6877, 6877}, + {3047, 6884, 6886}, + {5262, 6890, 6891}, + {5471, 6900, 6900}, + {3268, 6910, 6912}, + {1047, 6916, 6916}, + {5904, 6923, 6923}, + {5798, 6933, 6938}, + {4149, 6942, 6942}, + {1821, 6946, 6946}, + {3599, 6952, 6952}, + {6470, 6957, 6957}, + {5562, 6961, 6961}, + {6268, 6965, 6967}, + {6389, 6971, 6971}, + {6596, 6975, 6976}, + {6553, 6980, 6981}, + {6576, 6985, 6989}, + {1375, 6993, 6993}, + {652, 6998, 6998}, + {4876, 7002, 7003}, + {5768, 7011, 7013}, + {3973, 7017, 7017}, + {6802, 7025, 7025}, + {6955, 7034, 7036}, + {6974, 7040, 7040}, + {5944, 7044, 7044}, + {6992, 7048, 7054}, + {6872, 7059, 7059}, + {2943, 7063, 7063}, + {6923, 7067, 7067}, + {5094, 7071, 7071}, + {4873, 7075, 7075}, + {5819, 7079, 7079}, + {5945, 7085, 7085}, + {1540, 7090, 7091}, + {2090, 7095, 7095}, + {5024, 7104, 7105}, + {6900, 7109, 7109}, + {6024, 7113, 7114}, + {6000, 7118, 7120}, + {2187, 7124, 7125}, + {6760, 7129, 7130}, + {5898, 7134, 7136}, + {7032, 7144, 7144}, + {4271, 7148, 7148}, + {3706, 7152, 7152}, + {6970, 7156, 7157}, + {7088, 7161, 7163}, + {2718, 7168, 7169}, + {5674, 7175, 7175}, + {4631, 7182, 7182}, + {7070, 7188, 7189}, + {6220, 7196, 7196}, + {3458, 7201, 7202}, + {2041, 7211, 7212}, + {1454, 7216, 7216}, + {5199, 7225, 7227}, + {3529, 7234, 7234}, + {6890, 7238, 7238}, + {3815, 7242, 7243}, + {5490, 7250, 7253}, + {6554, 7257, 7263}, + {5890, 7267, 7269}, + {6877, 7273, 7273}, + {4877, 7277, 7277}, + {2502, 7285, 7285}, + {1483, 7289, 7295}, + {7210, 7304, 7308}, + {6845, 7313, 7316}, + {7219, 7320, 7320}, + {7001, 7325, 7329}, + {6853, 7333, 7334}, + {6120, 7338, 7338}, + {6606, 7342, 7343}, + {7020, 7348, 7350}, + {3509, 7354, 7354}, + {7133, 7359, 7363}, + {3434, 7371, 7374}, + {2787, 7384, 7384}, + {7044, 7388, 7388}, + {6960, 7394, 7395}, + {6676, 7399, 7400}, + {7161, 7404, 7404}, + {7285, 7417, 7418}, + {4558, 7425, 7426}, + {4828, 7430, 7430}, + {6063, 7436, 7436}, + {3597, 7442, 7442}, + {914, 7446, 7446}, + {7320, 7452, 7454}, + {7267, 7458, 7460}, + {5076, 7464, 7464}, + {7430, 7468, 7469}, + {6273, 7473, 7474}, + {7440, 7478, 7487}, + {7348, 7491, 7494}, + {1021, 7510, 7510}, + {7473, 7515, 7515}, + {2823, 7519, 7519}, + {6264, 7527, 7527}, + {7302, 7531, 7531}, + {7089, 7535, 7535}, + {7342, 7540, 7541}, + {3688, 7547, 7551}, + {3054, 7558, 7560}, + {4177, 7566, 7567}, + {6691, 7574, 7575}, + {7156, 7585, 7586}, + {7147, 7590, 7592}, + {7407, 7598, 7598}, + {7403, 7602, 7603}, + {6868, 7607, 7607}, + {6636, 7611, 7611}, + {4805, 7617, 7617}, + {5779, 7623, 7623}, + {7063, 7627, 7627}, + {5079, 7632, 7632}, + {7377, 7637, 7637}, + {7337, 7641, 7642}, + {6738, 7655, 7655}, + {7338, 7659, 7659}, + {6541, 7669, 7671}, + {595, 7675, 7675}, + {7658, 7679, 7680}, + {7647, 7685, 7686}, + {2477, 7690, 7690}, + {5823, 7694, 7694}, + {4156, 7699, 7699}, + {5931, 7703, 7706}, + {6854, 7712, 7712}, + {4931, 7718, 7718}, + {6979, 7722, 7722}, + {5085, 7727, 7727}, + {6965, 7732, 7732}, + {7201, 7736, 7737}, + {3639, 7741, 7743}, + {7534, 7749, 7749}, + {4292, 7753, 7753}, + {3427, 7759, 7763}, + {7273, 7767, 7767}, + {940, 7778, 7778}, + {4838, 7782, 7785}, + {4216, 7790, 7792}, + {922, 7800, 7801}, + {7256, 7810, 7811}, + {7789, 7815, 7819}, + {7225, 7823, 7825}, + {7531, 7829, 7829}, + {6997, 7833, 7833}, + {7757, 7837, 7838}, + {4129, 7842, 7842}, + {7333, 7848, 7849}, + {6776, 7855, 7855}, + {7527, 7859, 7859}, + {4370, 7863, 7863}, + {4512, 7868, 7868}, + {5679, 7880, 7880}, + {3162, 7884, 7885}, + {3933, 7892, 7894}, + {7804, 7899, 7902}, + {6363, 7906, 7907}, + {7848, 7911, 7912}, + {5584, 7917, 7921}, + {874, 7926, 7926}, + {3342, 7930, 7930}, + {4507, 7935, 7937}, + {3672, 7943, 7944}, + {7911, 7948, 7949}, + {6402, 7956, 7956}, + {7940, 7960, 7960}, + {7113, 7964, 7964}, + {1073, 7968, 7968}, + {7740, 7974, 7974}, + {7601, 7978, 7982}, + {6797, 7987, 7988}, + {3528, 7994, 7995}, + {5483, 7999, 7999}, + {5717, 8011, 8011}, + {5480, 8017, 8017}, + {7770, 8023, 8030}, + {2452, 8034, 8034}, + {5282, 8047, 8047}, + {7967, 8051, 8051}, + {1128, 8058, 8066}, + {6348, 8070, 8070}, + {8055, 8077, 8077}, + {7925, 8081, 8086}, + {6810, 8090, 8090}, + {5051, 8101, 8101}, + {4696, 8109, 8110}, + {5129, 8119, 8119}, + {4449, 8123, 8123}, + {7222, 8127, 8127}, + {4649, 8131, 8134}, + {7994, 8138, 8138}, + {5954, 8148, 8148}, + {475, 8152, 8153}, + {7906, 8157, 8157}, + {7458, 8164, 8166}, + {7632, 8171, 8173}, + {3874, 8177, 8183}, + {4391, 8187, 8187}, + {561, 8191, 8191}, + {2417, 8195, 8195}, + {2357, 8204, 8204}, + {2269, 8216, 8218}, + {3968, 8222, 8222}, + {2200, 8226, 8227}, + {3453, 8247, 8247}, + {2439, 8251, 8252}, + {7175, 8257, 8257}, + {976, 8262, 8264}, + {4953, 8273, 8273}, + {4219, 8278, 8278}, + {6, 8285, 8291}, + {5703, 8295, 8296}, + {5272, 8300, 8300}, + {8037, 8304, 8304}, + {8186, 8314, 8314}, + {8304, 8318, 8318}, + {8051, 8326, 8326}, + {8318, 8330, 8330}, + {2671, 8334, 8335}, + {2662, 8339, 8339}, + {8081, 8349, 8350}, + {3328, 8356, 8356}, + {2879, 8360, 8362}, + {8050, 8370, 8371}, + {8330, 8375, 8376}, + {8375, 8386, 8386}, + {4961, 8390, 8390}, + {1017, 8403, 8405}, + {3533, 8416, 8416}, + {4555, 8422, 8422}, + {6445, 8426, 8426}, + {8169, 8432, 8432}, + {990, 8436, 8436}, + {4102, 8440, 8440}, + {7398, 8444, 8446}, + {3480, 8450, 8450}, + {6324, 8462, 8462}, + {7948, 8466, 8467}, + {5950, 8471, 8471}, + {5189, 8476, 8476}, + {4026, 8490, 8490}, + {8374, 8494, 8495}, + {4682, 8501, 8501}, + {7387, 8506, 8506}, + {8164, 8510, 8515}, + {4079, 8524, 8524}, + {8360, 8529, 8531}, + {7446, 8540, 8543}, + {7971, 8547, 8548}, + {4311, 8552, 8552}, + {5204, 8556, 8557}, + {7968, 8562, 8562}, + {7847, 8571, 8573}, + {8547, 8577, 8577}, + {5320, 8581, 8581}, + {8556, 8585, 8586}, + {8504, 8590, 8590}, + {7669, 8602, 8604}, + {5874, 8608, 8609}, + {5828, 8613, 8613}, + {7998, 8617, 8617}, + {8519, 8625, 8625}, + {7250, 8637, 8637}, + {426, 8641, 8641}, + {8436, 8645, 8645}, + {5986, 8649, 8656}, + {8157, 8660, 8660}, + {7182, 8665, 8665}, + {8421, 8675, 8675}, + {8509, 8681, 8681}, + {5137, 8688, 8689}, + {8625, 8694, 8695}, + {5228, 8701, 8702}, + {6661, 8714, 8714}, + {1010, 8719, 8719}, + {6648, 8723, 8723}, + {3500, 8728, 8728}, + {2442, 8735, 8735}, + {8494, 8740, 8741}, + {8171, 8753, 8755}, + {7242, 8763, 8764}, + {4739, 8768, 8769}, + {7079, 8773, 8773}, + {8386, 8777, 8777}, + {8624, 8781, 8787}, + {661, 8791, 8794}, + {8631, 8801, 8801}, + {7753, 8805, 8805}, + {4783, 8809, 8810}, + {1673, 8814, 8815}, + {6623, 8819, 8819}, + {4404, 8823, 8823}, + {8089, 8827, 8828}, + {8773, 8832, 8832}, + {5394, 8836, 8836}, + {6231, 8841, 8843}, + {1015, 8852, 8853}, + {6873, 8857, 8857}, + {6289, 8865, 8865}, + {8577, 8869, 8869}, + {8114, 8873, 8875}, + {8534, 8883, 8883}, + {3007, 8887, 8888}, + {8827, 8892, 8893}, + {4788, 8897, 8900}, + {5698, 8906, 8907}, + {7690, 8911, 8911}, + {6643, 8919, 8919}, + {7206, 8923, 8924}, + {7866, 8929, 8931}, + {8880, 8942, 8942}, + {8630, 8951, 8952}, + {6027, 8958, 8958}, + {7749, 8966, 8967}, + {4932, 8972, 8973}, + {8892, 8980, 8981}, + {634, 9003, 9003}, + {8109, 9007, 9008}, + {8777, 9012, 9012}, + {3981, 9016, 9017}, + {5723, 9025, 9025}, + {7662, 9034, 9038}, + {8955, 9042, 9042}, + {8070, 9060, 9062}, + {8910, 9066, 9066}, + {5363, 9070, 9071}, + {7699, 9075, 9076}, + {8991, 9081, 9081}, + {6850, 9085, 9085}, + {5811, 9092, 9094}, + {9079, 9098, 9102}, + {6456, 9106, 9106}, + {2259, 9111, 9111}, + {4752, 9116, 9116}, + {9060, 9120, 9123}, + {8090, 9127, 9127}, + {5305, 9131, 9132}, + {8623, 9137, 9137}, + {7417, 9141, 9141}, + {6564, 9148, 9149}, + {9126, 9157, 9158}, + {4285, 9169, 9170}, + {8698, 9174, 9174}, + {8869, 9178, 9178}, + {2572, 9182, 9183}, + {6482, 9188, 9190}, + {9181, 9201, 9201}, + {2968, 9208, 9209}, + {2506, 9213, 9215}, + {9127, 9219, 9219}, + {7910, 9225, 9227}, + {5422, 9235, 9239}, + {8813, 9244, 9246}, + {9178, 9250, 9250}, + {8748, 9255, 9255}, + {7354, 9265, 9265}, + {7767, 9269, 9269}, + {7710, 9281, 9283}, + {8826, 9288, 9290}, + {861, 9295, 9295}, + {4482, 9301, 9301}, + {9264, 9305, 9306}, + {8805, 9310, 9310}, + {4995, 9314, 9314}, + {6730, 9318, 9318}, + {7457, 9328, 9328}, + {2547, 9335, 9336}, + {6298, 9340, 9343}, + {9305, 9353, 9354}, + {9269, 9358, 9358}, + {6338, 9370, 9370}, + {7289, 9376, 9379}, + {5780, 9383, 9383}, + {7607, 9387, 9387}, + {2065, 9392, 9392}, + {7238, 9396, 9396}, + {8856, 9400, 9400}, + {8069, 9412, 9413}, + {611, 9420, 9420}, + {7071, 9424, 9424}, + {3089, 9430, 9431}, + {7117, 9435, 9438}, + {1976, 9445, 9445}, + {6640, 9449, 9449}, + {5488, 9453, 9453}, + {8739, 9457, 9459}, + {5958, 9466, 9466}, + {7985, 9470, 9470}, + {8735, 9475, 9475}, + {5009, 9479, 9479}, + {8073, 9483, 9484}, + {2328, 9490, 9491}, + {9250, 9495, 9495}, + {4043, 9502, 9502}, + {7712, 9506, 9506}, + {9012, 9510, 9510}, + {9028, 9514, 9515}, + {2190, 9521, 9524}, + {9029, 9528, 9528}, + {9519, 9532, 9532}, + {9495, 9536, 9536}, + {8527, 9540, 9540}, + {2137, 9550, 9550}, + {8419, 9557, 9557}, + {9383, 9561, 9562}, + {8970, 9575, 9578}, + {8911, 9582, 9582}, + {7828, 9595, 9596}, + {6180, 9600, 9600}, + {8738, 9604, 9607}, + {7540, 9611, 9612}, + {9599, 9616, 9618}, + {9187, 9623, 9623}, + {9294, 9628, 9629}, + {4536, 9639, 9639}, + {3867, 9643, 9643}, + {6305, 9648, 9648}, + {1617, 9654, 9657}, + {5762, 9666, 9666}, + {8314, 9670, 9670}, + {9666, 9674, 9675}, + {9506, 9679, 9679}, + {9669, 9685, 9686}, + {9683, 9690, 9690}, + {8763, 9697, 9698}, + {7468, 9702, 9702}, + {460, 9707, 9707}, + {3115, 9712, 9712}, + {9424, 9716, 9717}, + {7359, 9721, 9724}, + {7547, 9728, 9729}, + {7151, 9733, 9738}, + {7627, 9742, 9742}, + {2822, 9747, 9747}, + {8247, 9751, 9753}, + {9550, 9758, 9758}, + {7585, 9762, 9763}, + {1002, 9767, 9767}, + {7168, 9772, 9773}, + {6941, 9777, 9780}, + {9728, 9784, 9786}, + {9770, 9792, 9796}, + {6411, 9801, 9802}, + {3689, 9806, 9808}, + {9575, 9814, 9816}, + {7025, 9820, 9821}, + {2776, 9826, 9826}, + {9806, 9830, 9830}, + {9820, 9834, 9835}, + {9800, 9839, 9847}, + {9834, 9851, 9852}, + {9829, 9856, 9862}, + {1400, 9866, 9866}, + {3197, 9870, 9871}, + {9851, 9875, 9876}, + {9742, 9883, 9884}, + {3362, 9888, 9889}, + {9883, 9893, 9893}, + {5711, 9899, 9910}, + {7806, 9915, 9915}, + {9120, 9919, 9919}, + {9715, 9925, 9934}, + {2580, 9938, 9938}, + {4907, 9942, 9944}, + {6239, 9953, 9954}, + {6961, 9963, 9963}, + {5295, 9967, 9968}, + {1915, 9972, 9973}, + {3426, 9983, 9985}, + {9875, 9994, 9995}, + {6942, 9999, 9999}, + {6621, 10005, 10005}, + {7589, 10010, 10012}, + {9286, 10020, 10020}, + {838, 10024, 10024}, + {9980, 10028, 10031}, + {9994, 10035, 10041}, + {2702, 10048, 10051}, + {2621, 10059, 10059}, + {10054, 10065, 10065}, + {8612, 10073, 10074}, + {7033, 10078, 10078}, + {916, 10082, 10082}, + {10035, 10086, 10087}, + {8613, 10097, 10097}, + {9919, 10107, 10108}, + {6133, 10114, 10115}, + {10059, 10119, 10119}, + {10065, 10126, 10127}, + {7732, 10131, 10131}, + {7155, 10135, 10136}, + {6728, 10140, 10140}, + {6162, 10144, 10145}, + {4724, 10150, 10150}, + {1665, 10154, 10154}, + {10126, 10163, 10163}, + {9783, 10168, 10168}, + {1715, 10172, 10173}, + {7152, 10177, 10182}, + {8760, 10187, 10187}, + {7829, 10191, 10191}, + {9679, 10196, 10196}, + {9369, 10201, 10201}, + {2928, 10206, 10208}, + {6951, 10214, 10217}, + {5633, 10221, 10221}, + {7199, 10225, 10225}, + {10118, 10230, 10231}, + {9999, 10235, 10236}, + {10045, 10240, 10249}, + {5565, 10256, 10256}, + {9866, 10261, 10261}, + {10163, 10268, 10268}, + {9869, 10272, 10272}, + {9789, 10276, 10283}, + {10235, 10287, 10288}, + {10214, 10298, 10299}, + {6971, 10303, 10303}, + {3346, 10307, 10307}, + {10185, 10311, 10312}, + {9993, 10318, 10320}, + {2779, 10332, 10334}, + {1726, 10338, 10338}, + {741, 10354, 10360}, + {10230, 10372, 10373}, + {10260, 10384, 10385}, + {10131, 10389, 10398}, + {6946, 10406, 10409}, + {10158, 10413, 10420}, + {10123, 10424, 10424}, + {6157, 10428, 10429}, + {4518, 10434, 10434}, + {9893, 10438, 10438}, + {9865, 10442, 10446}, + {7558, 10454, 10454}, + {10434, 10460, 10460}, + {10064, 10466, 10468}, + {2703, 10472, 10474}, + {9751, 10478, 10479}, + {6714, 10485, 10485}, + {8020, 10490, 10490}, + {10303, 10494, 10494}, + {3521, 10499, 10500}, + {9281, 10513, 10515}, + {6028, 10519, 10523}, + {9387, 10527, 10527}, + {7614, 10531, 10531}, + {3611, 10536, 10536}, + {9162, 10540, 10540}, + {10081, 10546, 10547}, + {10034, 10560, 10562}, + {6726, 10567, 10571}, + {8237, 10575, 10575}, + {10438, 10579, 10583}, + {10140, 10587, 10587}, + {5784, 10592, 10592}, + {9819, 10597, 10600}, + {10567, 10604, 10608}, + {9335, 10613, 10613}, + {8300, 10617, 10617}, + {10575, 10621, 10621}, + {9678, 10625, 10626}, + {9962, 10632, 10633}, + {10535, 10637, 10638}, + {8199, 10642, 10642}, + {10372, 10647, 10648}, + {10637, 10656, 10657}, + {10579, 10667, 10668}, + {10465, 10677, 10680}, + {6702, 10684, 10685}, + {10073, 10691, 10692}, + {4505, 10696, 10697}, + {9042, 10701, 10701}, + {6460, 10705, 10706}, + {10010, 10714, 10716}, + {10656, 10720, 10722}, + {7282, 10727, 10729}, + {2327, 10733, 10733}, + {2491, 10740, 10741}, + {10704, 10748, 10750}, + {6465, 10754, 10754}, + {10647, 10758, 10759}, + {10424, 10763, 10763}, + {10748, 10776, 10776}, + {10546, 10780, 10781}, + {10758, 10785, 10786}, + {10287, 10790, 10797}, + {10785, 10801, 10807}, + {10240, 10811, 10826}, + {9509, 10830, 10830}, + {2579, 10836, 10838}, + {9801, 10843, 10845}, + {7555, 10849, 10850}, + {10776, 10860, 10865}, + {8023, 10869, 10869}, + {10046, 10876, 10884}, + {10253, 10888, 10892}, + {9941, 10897, 10897}, + {7898, 10901, 10905}, + {6725, 10909, 10913}, + {10757, 10921, 10923}, + {10160, 10931, 10931}, + {10916, 10935, 10942}, + {10261, 10946, 10946}, + {10318, 10952, 10954}, + {5911, 10959, 10961}, + {10801, 10965, 10966}, + {10946, 10970, 10977}, + {10592, 10982, 10984}, + {9913, 10988, 10990}, + {8510, 10994, 10996}, + {9419, 11000, 11001}, + {6765, 11006, 11007}, + {10725, 11011, 11011}, + {5537, 11017, 11019}, + {9208, 11024, 11025}, + {5850, 11030, 11030}, + {9610, 11034, 11036}, + {8846, 11041, 11047}, + {9697, 11051, 11051}, + {1622, 11055, 11058}, + {2370, 11062, 11062}, + {8393, 11067, 11067}, + {9756, 11071, 11071}, + {10172, 11076, 11076}, + {27, 11081, 11081}, + {7357, 11087, 11092}, + {8151, 11104, 11106}, + {6115, 11110, 11110}, + {10667, 11114, 11115}, + {11099, 11121, 11123}, + {10705, 11127, 11127}, + {8938, 11131, 11131}, + {11114, 11135, 11136}, + {1390, 11140, 11141}, + {10964, 11146, 11148}, + {11140, 11152, 11155}, + {9813, 11159, 11166}, + {624, 11171, 11172}, + {3118, 11177, 11179}, + {11029, 11184, 11186}, + {10186, 11190, 11190}, + {10306, 11196, 11196}, + {8665, 11201, 11201}, + {7382, 11205, 11205}, + {1100, 11210, 11210}, + {2337, 11216, 11217}, + {1609, 11221, 11223}, + {5763, 11228, 11229}, + {5220, 11233, 11233}, + {11061, 11241, 11241}, + {10617, 11246, 11246}, + {11190, 11250, 11251}, + {10144, 11255, 11256}, + {11232, 11260, 11260}, + {857, 11264, 11265}, + {10994, 11269, 11271}, + {3879, 11280, 11281}, + {11184, 11287, 11289}, + {9611, 11293, 11295}, + {11250, 11299, 11299}, + {4495, 11304, 11304}, + {7574, 11308, 11309}, + {9814, 11315, 11317}, + {1713, 11321, 11324}, + {1905, 11328, 11328}, + {8745, 11335, 11340}, + {8883, 11351, 11351}, + {8119, 11358, 11358}, + {1842, 11363, 11364}, + {11237, 11368, 11368}, + {8814, 11373, 11374}, + {5684, 11378, 11378}, + {11011, 11382, 11382}, + {6520, 11389, 11389}, + {11183, 11393, 11396}, + {1790, 11404, 11404}, + {9536, 11408, 11408}, + {11298, 11418, 11419}, + {3929, 11425, 11425}, + {5588, 11429, 11429}, + {8476, 11436, 11436}, + {4096, 11440, 11442}, + {11084, 11446, 11454}, + {10603, 11458, 11463}, + {7332, 11472, 11474}, + {7611, 11483, 11486}, + {4836, 11490, 11491}, + {10024, 11495, 11495}, + {4917, 11501, 11506}, + {6486, 11510, 11512}, + {11269, 11516, 11518}, + {3603, 11522, 11525}, + {11126, 11535, 11535}, + {11418, 11539, 11541}, + {11408, 11545, 11545}, + {9021, 11549, 11552}, + {6745, 11557, 11557}, + {5118, 11561, 11564}, + {7590, 11568, 11569}, + {4426, 11573, 11578}, + {9790, 11582, 11583}, + {6447, 11587, 11587}, + {10229, 11591, 11594}, + {10457, 11598, 11598}, + {10168, 11604, 11604}, + {10543, 11608, 11608}, + {7404, 11612, 11612}, + {11127, 11616, 11616}, + {3337, 11620, 11620}, + {11501, 11624, 11628}, + {4543, 11633, 11635}, + {8449, 11642, 11642}, + {4943, 11646, 11648}, + {10526, 11652, 11654}, + {11620, 11659, 11659}, + {8927, 11664, 11669}, + {532, 11673, 11673}, + {10513, 11677, 11679}, + {10428, 11683, 11683}, + {10999, 11689, 11690}, + {9469, 11695, 11695}, + {3606, 11699, 11699}, + {9560, 11708, 11709}, + {1564, 11714, 11714}, + {10527, 11718, 11718}, + {3071, 11723, 11726}, + {11590, 11731, 11732}, + {6605, 11737, 11737}, + {11624, 11741, 11745}, + {7822, 11749, 11752}, + {5269, 11757, 11758}, + {1339, 11767, 11767}, + {1363, 11771, 11773}, + {3704, 11777, 11777}, + {10952, 11781, 11783}, + {6764, 11793, 11795}, + {8675, 11800, 11800}, + {9963, 11804, 11804}, + {11573, 11808, 11809}, + {9548, 11813, 11813}, + {11591, 11817, 11818}, + {11446, 11822, 11822}, + {9224, 11828, 11828}, + {3158, 11836, 11836}, + {10830, 11840, 11840}, + {7234, 11846, 11846}, + {11299, 11850, 11850}, + {11544, 11854, 11855}, + {11498, 11859, 11859}, + {10993, 11865, 11868}, + {9720, 11872, 11878}, + {10489, 11882, 11890}, + {11712, 11898, 11904}, + {11516, 11908, 11910}, + {11568, 11914, 11915}, + {10177, 11919, 11924}, + {11363, 11928, 11929}, + {10494, 11933, 11933}, + {9870, 11937, 11938}, + {9427, 11942, 11942}, + {11481, 11949, 11949}, + {6030, 11955, 11957}, + {11718, 11961, 11961}, + {10531, 11965, 11983}, + {5126, 11987, 11987}, + {7515, 11991, 11991}, + {10646, 11996, 11997}, + {2947, 12001, 12001}, + {9582, 12009, 12010}, + {6202, 12017, 12018}, + {11714, 12022, 12022}, + {9235, 12033, 12037}, + {9721, 12041, 12044}, + {11932, 12051, 12052}, + {12040, 12056, 12056}, + {12051, 12060, 12060}, + {11601, 12066, 12066}, + {8426, 12070, 12070}, + {4053, 12077, 12077}, + {4262, 12081, 12081}, + {9761, 12086, 12088}, + {11582, 12092, 12093}, + {10965, 12097, 12098}, + {11803, 12103, 12104}, + {11933, 12108, 12109}, + {10688, 12117, 12117}, + {12107, 12125, 12126}, + {6774, 12130, 12132}, + {6286, 12137, 12137}, + {9543, 12141, 12141}, + {12097, 12145, 12146}, + {10790, 12150, 12150}, + {10125, 12154, 12156}, + {12125, 12164, 12164}, + {12064, 12168, 12172}, + {10811, 12178, 12188}, + {12092, 12192, 12193}, + {10058, 12197, 12198}, + {11611, 12211, 12212}, + {3459, 12216, 12216}, + {10291, 12225, 12228}, + {12191, 12232, 12234}, + {12145, 12238, 12238}, + {12001, 12242, 12250}, + {3840, 12255, 12255}, + {12216, 12259, 12259}, + {674, 12272, 12272}, + {12141, 12276, 12276}, + {10766, 12280, 12280}, + {11545, 12284, 12284}, + {6496, 12290, 12290}, + {11381, 12294, 12295}, + {603, 12302, 12303}, + {12276, 12308, 12308}, + {11850, 12313, 12314}, + {565, 12319, 12319}, + {9351, 12324, 12324}, + {11822, 12328, 12328}, + {2691, 12333, 12334}, + {11840, 12338, 12338}, + {11070, 12343, 12343}, + {9510, 12347, 12347}, + {11024, 12352, 12353}, + {7173, 12359, 12359}, + {517, 12363, 12363}, + {6311, 12367, 12368}, + {11367, 12372, 12373}, + {12008, 12377, 12377}, + {11372, 12382, 12384}, + {11358, 12391, 12392}, + {11382, 12396, 12396}, + {6882, 12400, 12401}, + {11246, 12405, 12405}, + {8359, 12409, 12412}, + {10154, 12418, 12418}, + {12016, 12425, 12426}, + {8972, 12434, 12435}, + {10478, 12439, 12440}, + {12395, 12449, 12449}, + {11612, 12454, 12454}, + {12347, 12458, 12458}, + {10700, 12466, 12467}, + {3637, 12471, 12476}, + {1042, 12480, 12481}, + {6747, 12488, 12488}, + {12396, 12492, 12493}, + {9420, 12497, 12497}, + {11285, 12501, 12510}, + {4470, 12515, 12515}, + {9374, 12519, 12519}, + {11293, 12528, 12528}, + {2058, 12534, 12535}, + {6521, 12539, 12539}, + {12492, 12543, 12543}, + {3043, 12547, 12547}, + {2982, 12551, 12553}, + {11030, 12557, 12563}, + {7636, 12568, 12568}, + {9639, 12572, 12572}, + {12543, 12576, 12576}, + {5989, 12580, 12583}, + {11051, 12587, 12587}, + {1061, 12592, 12594}, + {12313, 12599, 12601}, + {11846, 12605, 12605}, + {12576, 12609, 12609}, + {11040, 12618, 12625}, + {12479, 12629, 12629}, + {6903, 12633, 12633}, + {12322, 12639, 12639}, + {12253, 12643, 12645}, + {5594, 12651, 12651}, + {12522, 12655, 12655}, + {11703, 12659, 12659}, + {1377, 12665, 12665}, + {8022, 12669, 12669}, + {12280, 12674, 12674}, + {9023, 12680, 12681}, + {12328, 12685, 12685}, + {3085, 12689, 12693}, + {4700, 12698, 12698}, + {10224, 12702, 12702}, + {8781, 12706, 12706}, + {1651, 12710, 12710}, + {12458, 12714, 12714}, + {12005, 12718, 12721}, + {11908, 12725, 12726}, + {8202, 12733, 12733}, + {11708, 12739, 12740}, + {12599, 12744, 12745}, + {12284, 12749, 12749}, + {5285, 12756, 12756}, + {12055, 12775, 12777}, + {6919, 12782, 12782}, + {12242, 12786, 12786}, + {12009, 12790, 12790}, + {9628, 12794, 12796}, + {11354, 12801, 12802}, + {10225, 12806, 12807}, + {579, 12813, 12813}, + {8935, 12817, 12822}, + {8753, 12827, 12829}, + {11006, 12835, 12835}, + {858, 12841, 12845}, + {476, 12849, 12849}, + {7667, 12854, 12854}, + {12760, 12860, 12871}, + {11677, 12875, 12877}, + {12714, 12881, 12881}, + {12731, 12885, 12890}, + {7108, 12894, 12896}, + {1165, 12900, 12900}, + {4021, 12906, 12906}, + {10829, 12910, 12911}, + {12331, 12915, 12915}, + {8887, 12919, 12921}, + {11639, 12925, 12925}, + {7964, 12929, 12929}, + {12528, 12937, 12937}, + {8148, 12941, 12941}, + {12770, 12948, 12950}, + {12609, 12954, 12954}, + {12685, 12958, 12958}, + {2803, 12962, 12962}, + {9561, 12966, 12966}, + {6671, 12972, 12973}, + {12056, 12977, 12977}, + {6380, 12981, 12981}, + {12048, 12985, 12985}, + {11961, 12989, 12993}, + {3368, 12997, 12999}, + {6634, 13004, 13004}, + {6775, 13009, 13010}, + {12136, 13014, 13019}, + {10341, 13023, 13023}, + {13002, 13027, 13027}, + {10587, 13031, 13031}, + {10307, 13035, 13035}, + {12736, 13039, 13039}, + {12744, 13043, 13044}, + {6175, 13048, 13048}, + {9702, 13053, 13054}, + {662, 13059, 13061}, + {12718, 13065, 13068}, + {12893, 13072, 13075}, + {8299, 13086, 13091}, + {12604, 13095, 13096}, + {12848, 13100, 13101}, + {12749, 13105, 13105}, + {12526, 13109, 13114}, + {9173, 13122, 13122}, + {12769, 13128, 13128}, + {13038, 13132, 13132}, + {12725, 13136, 13137}, + {12639, 13146, 13146}, + {9711, 13150, 13151}, + {12137, 13155, 13155}, + {13039, 13159, 13159}, + {4681, 13163, 13164}, + {12954, 13168, 13168}, + {13158, 13175, 13176}, + {13105, 13180, 13180}, + {10754, 13184, 13184}, + {13167, 13188, 13188}, + {12658, 13192, 13192}, + {4294, 13199, 13200}, + {11682, 13204, 13205}, + {11695, 13209, 13209}, + {11076, 13214, 13214}, + {12232, 13218, 13218}, + {9399, 13223, 13224}, + {12880, 13228, 13229}, + {13048, 13234, 13234}, + {9701, 13238, 13239}, + {13209, 13243, 13243}, + {3658, 13248, 13248}, + {3698, 13252, 13254}, + {12237, 13260, 13260}, + {8872, 13266, 13266}, + {12957, 13272, 13273}, + {1393, 13281, 13281}, + {2013, 13285, 13288}, + {4244, 13296, 13299}, + {9428, 13303, 13303}, + {12702, 13307, 13307}, + {13078, 13311, 13311}, + {6071, 13315, 13315}, + {3061, 13319, 13319}, + {2051, 13324, 13324}, + {11560, 13328, 13331}, + {6584, 13336, 13336}, + {8482, 13340, 13340}, + {5331, 13344, 13344}, + {4171, 13348, 13348}, + {8501, 13352, 13352}, + {9219, 13356, 13356}, + {9473, 13360, 13363}, + {12881, 13367, 13367}, + {13065, 13371, 13375}, + {2979, 13379, 13384}, + {1518, 13388, 13388}, + {11177, 13392, 13392}, + {9457, 13398, 13398}, + {12293, 13407, 13410}, + {3697, 13414, 13417}, + {10338, 13425, 13425}, + {13367, 13429, 13429}, + {11074, 13433, 13437}, + {4201, 13441, 13443}, + {1812, 13447, 13448}, + {13360, 13452, 13456}, + {13188, 13463, 13463}, + {9732, 13470, 13470}, + {11332, 13477, 13477}, + {9918, 13487, 13487}, + {6337, 13497, 13497}, + {13429, 13501, 13501}, + {11413, 13505, 13505}, + {4685, 13512, 13513}, + {13136, 13517, 13519}, + {7416, 13528, 13530}, + {12929, 13534, 13534}, + {11110, 13539, 13539}, + {11521, 13543, 13543}, + {12825, 13553, 13553}, + {13447, 13557, 13558}, + {12299, 13562, 13563}, + {9003, 13570, 13570}, + {12500, 13577, 13577}, + {13501, 13581, 13581}, + {9392, 13586, 13586}, + {12454, 13590, 13590}, + {6189, 13595, 13595}, + {13053, 13599, 13599}, + {11881, 13604, 13604}, + {13159, 13608, 13608}, + {4894, 13612, 13612}, + {13221, 13621, 13621}, + {8950, 13625, 13625}, + {13533, 13629, 13629}, + {9633, 13633, 13633}, + {7892, 13637, 13639}, + {13581, 13643, 13643}, + {13616, 13647, 13649}, + {12794, 13653, 13654}, + {8919, 13659, 13659}, + {9674, 13663, 13663}, + {13577, 13668, 13668}, + {12966, 13672, 13672}, + {12659, 13676, 13683}, + {6124, 13688, 13688}, + {9225, 13693, 13695}, + {11833, 13702, 13702}, + {12904, 13709, 13717}, + {13647, 13721, 13722}, + {11687, 13726, 13727}, + {12434, 13731, 13732}, + {12689, 13736, 13742}, + {13168, 13746, 13746}, + {6151, 13751, 13752}, + {11821, 13756, 13757}, + {6467, 13764, 13764}, + {5730, 13769, 13769}, + {5136, 13780, 13780}, + {724, 13784, 13785}, + {13517, 13789, 13791}, + {640, 13795, 13796}, + {7721, 13800, 13802}, + {11121, 13806, 13807}, + {5791, 13811, 13815}, + {12894, 13819, 13819}, + {11100, 13824, 13824}, + {7011, 13830, 13830}, + {7129, 13834, 13837}, + {13833, 13841, 13841}, + {11276, 13847, 13847}, + {13621, 13853, 13853}, + {13589, 13862, 13863}, + {12989, 13867, 13867}, + {12789, 13871, 13871}, + {1239, 13875, 13875}, + {4675, 13879, 13881}, + {4686, 13885, 13885}, + {707, 13889, 13889}, + {5449, 13897, 13898}, + {13867, 13902, 13903}, + {10613, 13908, 13908}, + {13789, 13912, 13914}, + {4451, 13918, 13919}, + {9200, 13924, 13924}, + {2011, 13930, 13930}, + {11433, 13934, 13936}, + {4695, 13942, 13943}, + {9435, 13948, 13951}, + {13688, 13955, 13957}, + {11694, 13961, 13962}, + {5712, 13966, 13966}, + {5991, 13970, 13972}, + {13477, 13976, 13976}, + {10213, 13987, 13987}, + {11839, 13991, 13993}, + {12272, 13997, 13997}, + {6206, 14001, 14001}, + {13179, 14006, 14007}, + {2939, 14011, 14011}, + {12972, 14016, 14017}, + {13918, 14021, 14022}, + {7436, 14026, 14027}, + {7678, 14032, 14034}, + {13586, 14040, 14040}, + {13347, 14044, 14044}, + {13109, 14048, 14051}, + {9244, 14055, 14057}, + {13315, 14061, 14061}, + {13276, 14067, 14067}, + {11435, 14073, 14074}, + {13853, 14078, 14078}, + {13452, 14082, 14082}, + {14044, 14087, 14087}, + {4440, 14091, 14095}, + {4479, 14100, 14103}, + {9395, 14107, 14109}, + {6834, 14119, 14119}, + {10458, 14123, 14124}, + {1429, 14129, 14129}, + {8443, 14135, 14135}, + {10365, 14140, 14140}, + {5267, 14145, 14145}, + {11834, 14151, 14153}, +} diff --git a/_vendor/vendor/github.com/golang/snappy/snappy.go b/vendor/github.com/golang/snappy/snappy.go similarity index 100% rename from _vendor/vendor/github.com/golang/snappy/snappy.go rename to vendor/github.com/golang/snappy/snappy.go diff --git a/vendor/github.com/golang/snappy/snappy_test.go b/vendor/github.com/golang/snappy/snappy_test.go new file mode 100644 index 0000000..2712710 --- /dev/null +++ b/vendor/github.com/golang/snappy/snappy_test.go @@ -0,0 +1,1353 @@ +// Copyright 2011 The Snappy-Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package snappy + +import ( + "bytes" + "encoding/binary" + "flag" + "fmt" + "io" + "io/ioutil" + "math/rand" + "net/http" + "os" + "os/exec" + "path/filepath" + "runtime" + "strings" + "testing" +) + +var ( + download = flag.Bool("download", false, "If true, download any missing files before running benchmarks") + testdataDir = flag.String("testdataDir", "testdata", "Directory containing the test data") + benchdataDir = flag.String("benchdataDir", "testdata/bench", "Directory containing the benchmark data") +) + +// goEncoderShouldMatchCppEncoder is whether to test that the algorithm used by +// Go's encoder matches byte-for-byte what the C++ snappy encoder produces, on +// this GOARCH. There is more than one valid encoding of any given input, and +// there is more than one good algorithm along the frontier of trading off +// throughput for output size. Nonetheless, we presume that the C++ encoder's +// algorithm is a good one and has been tested on a wide range of inputs, so +// matching that exactly should mean that the Go encoder's algorithm is also +// good, without needing to gather our own corpus of test data. +// +// The exact algorithm used by the C++ code is potentially endian dependent, as +// it puns a byte pointer to a uint32 pointer to load, hash and compare 4 bytes +// at a time. The Go implementation is endian agnostic, in that its output is +// the same (as little-endian C++ code), regardless of the CPU's endianness. +// +// Thus, when comparing Go's output to C++ output generated beforehand, such as +// the "testdata/pi.txt.rawsnappy" file generated by C++ code on a little- +// endian system, we can run that test regardless of the runtime.GOARCH value. +// +// When comparing Go's output to dynamically generated C++ output, i.e. the +// result of fork/exec'ing a C++ program, we can run that test only on +// little-endian systems, because the C++ output might be different on +// big-endian systems. The runtime package doesn't export endianness per se, +// but we can restrict this match-C++ test to common little-endian systems. +const goEncoderShouldMatchCppEncoder = runtime.GOARCH == "386" || runtime.GOARCH == "amd64" || runtime.GOARCH == "arm" + +func TestMaxEncodedLenOfMaxBlockSize(t *testing.T) { + got := maxEncodedLenOfMaxBlockSize + want := MaxEncodedLen(maxBlockSize) + if got != want { + t.Fatalf("got %d, want %d", got, want) + } +} + +func cmp(a, b []byte) error { + if bytes.Equal(a, b) { + return nil + } + if len(a) != len(b) { + return fmt.Errorf("got %d bytes, want %d", len(a), len(b)) + } + for i := range a { + if a[i] != b[i] { + return fmt.Errorf("byte #%d: got 0x%02x, want 0x%02x", i, a[i], b[i]) + } + } + return nil +} + +func roundtrip(b, ebuf, dbuf []byte) error { + d, err := Decode(dbuf, Encode(ebuf, b)) + if err != nil { + return fmt.Errorf("decoding error: %v", err) + } + if err := cmp(d, b); err != nil { + return fmt.Errorf("roundtrip mismatch: %v", err) + } + return nil +} + +func TestEmpty(t *testing.T) { + if err := roundtrip(nil, nil, nil); err != nil { + t.Fatal(err) + } +} + +func TestSmallCopy(t *testing.T) { + for _, ebuf := range [][]byte{nil, make([]byte, 20), make([]byte, 64)} { + for _, dbuf := range [][]byte{nil, make([]byte, 20), make([]byte, 64)} { + for i := 0; i < 32; i++ { + s := "aaaa" + strings.Repeat("b", i) + "aaaabbbb" + if err := roundtrip([]byte(s), ebuf, dbuf); err != nil { + t.Errorf("len(ebuf)=%d, len(dbuf)=%d, i=%d: %v", len(ebuf), len(dbuf), i, err) + } + } + } + } +} + +func TestSmallRand(t *testing.T) { + rng := rand.New(rand.NewSource(1)) + for n := 1; n < 20000; n += 23 { + b := make([]byte, n) + for i := range b { + b[i] = uint8(rng.Intn(256)) + } + if err := roundtrip(b, nil, nil); err != nil { + t.Fatal(err) + } + } +} + +func TestSmallRegular(t *testing.T) { + for n := 1; n < 20000; n += 23 { + b := make([]byte, n) + for i := range b { + b[i] = uint8(i%10 + 'a') + } + if err := roundtrip(b, nil, nil); err != nil { + t.Fatal(err) + } + } +} + +func TestInvalidVarint(t *testing.T) { + testCases := []struct { + desc string + input string + }{{ + "invalid varint, final byte has continuation bit set", + "\xff", + }, { + "invalid varint, value overflows uint64", + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00", + }, { + // https://github.com/google/snappy/blob/master/format_description.txt + // says that "the stream starts with the uncompressed length [as a + // varint] (up to a maximum of 2^32 - 1)". + "valid varint (as uint64), but value overflows uint32", + "\x80\x80\x80\x80\x10", + }} + + for _, tc := range testCases { + input := []byte(tc.input) + if _, err := DecodedLen(input); err != ErrCorrupt { + t.Errorf("%s: DecodedLen: got %v, want ErrCorrupt", tc.desc, err) + } + if _, err := Decode(nil, input); err != ErrCorrupt { + t.Errorf("%s: Decode: got %v, want ErrCorrupt", tc.desc, err) + } + } +} + +func TestDecode(t *testing.T) { + lit40Bytes := make([]byte, 40) + for i := range lit40Bytes { + lit40Bytes[i] = byte(i) + } + lit40 := string(lit40Bytes) + + testCases := []struct { + desc string + input string + want string + wantErr error + }{{ + `decodedLen=0; valid input`, + "\x00", + "", + nil, + }, { + `decodedLen=3; tagLiteral, 0-byte length; length=3; valid input`, + "\x03" + "\x08\xff\xff\xff", + "\xff\xff\xff", + nil, + }, { + `decodedLen=2; tagLiteral, 0-byte length; length=3; not enough dst bytes`, + "\x02" + "\x08\xff\xff\xff", + "", + ErrCorrupt, + }, { + `decodedLen=3; tagLiteral, 0-byte length; length=3; not enough src bytes`, + "\x03" + "\x08\xff\xff", + "", + ErrCorrupt, + }, { + `decodedLen=40; tagLiteral, 0-byte length; length=40; valid input`, + "\x28" + "\x9c" + lit40, + lit40, + nil, + }, { + `decodedLen=1; tagLiteral, 1-byte length; not enough length bytes`, + "\x01" + "\xf0", + "", + ErrCorrupt, + }, { + `decodedLen=3; tagLiteral, 1-byte length; length=3; valid input`, + "\x03" + "\xf0\x02\xff\xff\xff", + "\xff\xff\xff", + nil, + }, { + `decodedLen=1; tagLiteral, 2-byte length; not enough length bytes`, + "\x01" + "\xf4\x00", + "", + ErrCorrupt, + }, { + `decodedLen=3; tagLiteral, 2-byte length; length=3; valid input`, + "\x03" + "\xf4\x02\x00\xff\xff\xff", + "\xff\xff\xff", + nil, + }, { + `decodedLen=1; tagLiteral, 3-byte length; not enough length bytes`, + "\x01" + "\xf8\x00\x00", + "", + ErrCorrupt, + }, { + `decodedLen=3; tagLiteral, 3-byte length; length=3; valid input`, + "\x03" + "\xf8\x02\x00\x00\xff\xff\xff", + "\xff\xff\xff", + nil, + }, { + `decodedLen=1; tagLiteral, 4-byte length; not enough length bytes`, + "\x01" + "\xfc\x00\x00\x00", + "", + ErrCorrupt, + }, { + `decodedLen=1; tagLiteral, 4-byte length; length=3; not enough dst bytes`, + "\x01" + "\xfc\x02\x00\x00\x00\xff\xff\xff", + "", + ErrCorrupt, + }, { + `decodedLen=4; tagLiteral, 4-byte length; length=3; not enough src bytes`, + "\x04" + "\xfc\x02\x00\x00\x00\xff", + "", + ErrCorrupt, + }, { + `decodedLen=3; tagLiteral, 4-byte length; length=3; valid input`, + "\x03" + "\xfc\x02\x00\x00\x00\xff\xff\xff", + "\xff\xff\xff", + nil, + }, { + `decodedLen=4; tagCopy1, 1 extra length|offset byte; not enough extra bytes`, + "\x04" + "\x01", + "", + ErrCorrupt, + }, { + `decodedLen=4; tagCopy2, 2 extra length|offset bytes; not enough extra bytes`, + "\x04" + "\x02\x00", + "", + ErrCorrupt, + }, { + `decodedLen=4; tagCopy4, 4 extra length|offset bytes; not enough extra bytes`, + "\x04" + "\x03\x00\x00\x00", + "", + ErrCorrupt, + }, { + `decodedLen=4; tagLiteral (4 bytes "abcd"); valid input`, + "\x04" + "\x0cabcd", + "abcd", + nil, + }, { + `decodedLen=13; tagLiteral (4 bytes "abcd"); tagCopy1; length=9 offset=4; valid input`, + "\x0d" + "\x0cabcd" + "\x15\x04", + "abcdabcdabcda", + nil, + }, { + `decodedLen=8; tagLiteral (4 bytes "abcd"); tagCopy1; length=4 offset=4; valid input`, + "\x08" + "\x0cabcd" + "\x01\x04", + "abcdabcd", + nil, + }, { + `decodedLen=8; tagLiteral (4 bytes "abcd"); tagCopy1; length=4 offset=2; valid input`, + "\x08" + "\x0cabcd" + "\x01\x02", + "abcdcdcd", + nil, + }, { + `decodedLen=8; tagLiteral (4 bytes "abcd"); tagCopy1; length=4 offset=1; valid input`, + "\x08" + "\x0cabcd" + "\x01\x01", + "abcddddd", + nil, + }, { + `decodedLen=8; tagLiteral (4 bytes "abcd"); tagCopy1; length=4 offset=0; zero offset`, + "\x08" + "\x0cabcd" + "\x01\x00", + "", + ErrCorrupt, + }, { + `decodedLen=9; tagLiteral (4 bytes "abcd"); tagCopy1; length=4 offset=4; inconsistent dLen`, + "\x09" + "\x0cabcd" + "\x01\x04", + "", + ErrCorrupt, + }, { + `decodedLen=8; tagLiteral (4 bytes "abcd"); tagCopy1; length=4 offset=5; offset too large`, + "\x08" + "\x0cabcd" + "\x01\x05", + "", + ErrCorrupt, + }, { + `decodedLen=7; tagLiteral (4 bytes "abcd"); tagCopy1; length=4 offset=4; length too large`, + "\x07" + "\x0cabcd" + "\x01\x04", + "", + ErrCorrupt, + }, { + `decodedLen=6; tagLiteral (4 bytes "abcd"); tagCopy2; length=2 offset=3; valid input`, + "\x06" + "\x0cabcd" + "\x06\x03\x00", + "abcdbc", + nil, + }, { + `decodedLen=6; tagLiteral (4 bytes "abcd"); tagCopy4; length=2 offset=3; valid input`, + "\x06" + "\x0cabcd" + "\x07\x03\x00\x00\x00", + "abcdbc", + nil, + }} + + const ( + // notPresentXxx defines a range of byte values [0xa0, 0xc5) that are + // not present in either the input or the output. It is written to dBuf + // to check that Decode does not write bytes past the end of + // dBuf[:dLen]. + // + // The magic number 37 was chosen because it is prime. A more 'natural' + // number like 32 might lead to a false negative if, for example, a + // byte was incorrectly copied 4*8 bytes later. + notPresentBase = 0xa0 + notPresentLen = 37 + ) + + var dBuf [100]byte +loop: + for i, tc := range testCases { + input := []byte(tc.input) + for _, x := range input { + if notPresentBase <= x && x < notPresentBase+notPresentLen { + t.Errorf("#%d (%s): input shouldn't contain %#02x\ninput: % x", i, tc.desc, x, input) + continue loop + } + } + + dLen, n := binary.Uvarint(input) + if n <= 0 { + t.Errorf("#%d (%s): invalid varint-encoded dLen", i, tc.desc) + continue + } + if dLen > uint64(len(dBuf)) { + t.Errorf("#%d (%s): dLen %d is too large", i, tc.desc, dLen) + continue + } + + for j := range dBuf { + dBuf[j] = byte(notPresentBase + j%notPresentLen) + } + g, gotErr := Decode(dBuf[:], input) + if got := string(g); got != tc.want || gotErr != tc.wantErr { + t.Errorf("#%d (%s):\ngot %q, %v\nwant %q, %v", + i, tc.desc, got, gotErr, tc.want, tc.wantErr) + continue + } + for j, x := range dBuf { + if uint64(j) < dLen { + continue + } + if w := byte(notPresentBase + j%notPresentLen); x != w { + t.Errorf("#%d (%s): Decode overrun: dBuf[%d] was modified: got %#02x, want %#02x\ndBuf: % x", + i, tc.desc, j, x, w, dBuf) + continue loop + } + } + } +} + +func TestDecodeCopy4(t *testing.T) { + dots := strings.Repeat(".", 65536) + + input := strings.Join([]string{ + "\x89\x80\x04", // decodedLen = 65545. + "\x0cpqrs", // 4-byte literal "pqrs". + "\xf4\xff\xff" + dots, // 65536-byte literal dots. + "\x13\x04\x00\x01\x00", // tagCopy4; length=5 offset=65540. + }, "") + + gotBytes, err := Decode(nil, []byte(input)) + if err != nil { + t.Fatal(err) + } + got := string(gotBytes) + want := "pqrs" + dots + "pqrs." + if len(got) != len(want) { + t.Fatalf("got %d bytes, want %d", len(got), len(want)) + } + if got != want { + for i := 0; i < len(got); i++ { + if g, w := got[i], want[i]; g != w { + t.Fatalf("byte #%d: got %#02x, want %#02x", i, g, w) + } + } + } +} + +// TestDecodeLengthOffset tests decoding an encoding of the form literal + +// copy-length-offset + literal. For example: "abcdefghijkl" + "efghij" + "AB". +func TestDecodeLengthOffset(t *testing.T) { + const ( + prefix = "abcdefghijklmnopqr" + suffix = "ABCDEFGHIJKLMNOPQR" + + // notPresentXxx defines a range of byte values [0xa0, 0xc5) that are + // not present in either the input or the output. It is written to + // gotBuf to check that Decode does not write bytes past the end of + // gotBuf[:totalLen]. + // + // The magic number 37 was chosen because it is prime. A more 'natural' + // number like 32 might lead to a false negative if, for example, a + // byte was incorrectly copied 4*8 bytes later. + notPresentBase = 0xa0 + notPresentLen = 37 + ) + var gotBuf, wantBuf, inputBuf [128]byte + for length := 1; length <= 18; length++ { + for offset := 1; offset <= 18; offset++ { + loop: + for suffixLen := 0; suffixLen <= 18; suffixLen++ { + totalLen := len(prefix) + length + suffixLen + + inputLen := binary.PutUvarint(inputBuf[:], uint64(totalLen)) + inputBuf[inputLen] = tagLiteral + 4*byte(len(prefix)-1) + inputLen++ + inputLen += copy(inputBuf[inputLen:], prefix) + inputBuf[inputLen+0] = tagCopy2 + 4*byte(length-1) + inputBuf[inputLen+1] = byte(offset) + inputBuf[inputLen+2] = 0x00 + inputLen += 3 + if suffixLen > 0 { + inputBuf[inputLen] = tagLiteral + 4*byte(suffixLen-1) + inputLen++ + inputLen += copy(inputBuf[inputLen:], suffix[:suffixLen]) + } + input := inputBuf[:inputLen] + + for i := range gotBuf { + gotBuf[i] = byte(notPresentBase + i%notPresentLen) + } + got, err := Decode(gotBuf[:], input) + if err != nil { + t.Errorf("length=%d, offset=%d; suffixLen=%d: %v", length, offset, suffixLen, err) + continue + } + + wantLen := 0 + wantLen += copy(wantBuf[wantLen:], prefix) + for i := 0; i < length; i++ { + wantBuf[wantLen] = wantBuf[wantLen-offset] + wantLen++ + } + wantLen += copy(wantBuf[wantLen:], suffix[:suffixLen]) + want := wantBuf[:wantLen] + + for _, x := range input { + if notPresentBase <= x && x < notPresentBase+notPresentLen { + t.Errorf("length=%d, offset=%d; suffixLen=%d: input shouldn't contain %#02x\ninput: % x", + length, offset, suffixLen, x, input) + continue loop + } + } + for i, x := range gotBuf { + if i < totalLen { + continue + } + if w := byte(notPresentBase + i%notPresentLen); x != w { + t.Errorf("length=%d, offset=%d; suffixLen=%d; totalLen=%d: "+ + "Decode overrun: gotBuf[%d] was modified: got %#02x, want %#02x\ngotBuf: % x", + length, offset, suffixLen, totalLen, i, x, w, gotBuf) + continue loop + } + } + for _, x := range want { + if notPresentBase <= x && x < notPresentBase+notPresentLen { + t.Errorf("length=%d, offset=%d; suffixLen=%d: want shouldn't contain %#02x\nwant: % x", + length, offset, suffixLen, x, want) + continue loop + } + } + + if !bytes.Equal(got, want) { + t.Errorf("length=%d, offset=%d; suffixLen=%d:\ninput % x\ngot % x\nwant % x", + length, offset, suffixLen, input, got, want) + continue + } + } + } + } +} + +const ( + goldenText = "Mark.Twain-Tom.Sawyer.txt" + goldenCompressed = goldenText + ".rawsnappy" +) + +func TestDecodeGoldenInput(t *testing.T) { + tDir := filepath.FromSlash(*testdataDir) + src, err := ioutil.ReadFile(filepath.Join(tDir, goldenCompressed)) + if err != nil { + t.Fatalf("ReadFile: %v", err) + } + got, err := Decode(nil, src) + if err != nil { + t.Fatalf("Decode: %v", err) + } + want, err := ioutil.ReadFile(filepath.Join(tDir, goldenText)) + if err != nil { + t.Fatalf("ReadFile: %v", err) + } + if err := cmp(got, want); err != nil { + t.Fatal(err) + } +} + +func TestEncodeGoldenInput(t *testing.T) { + tDir := filepath.FromSlash(*testdataDir) + src, err := ioutil.ReadFile(filepath.Join(tDir, goldenText)) + if err != nil { + t.Fatalf("ReadFile: %v", err) + } + got := Encode(nil, src) + want, err := ioutil.ReadFile(filepath.Join(tDir, goldenCompressed)) + if err != nil { + t.Fatalf("ReadFile: %v", err) + } + if err := cmp(got, want); err != nil { + t.Fatal(err) + } +} + +func TestExtendMatchGoldenInput(t *testing.T) { + tDir := filepath.FromSlash(*testdataDir) + src, err := ioutil.ReadFile(filepath.Join(tDir, goldenText)) + if err != nil { + t.Fatalf("ReadFile: %v", err) + } + for i, tc := range extendMatchGoldenTestCases { + got := extendMatch(src, tc.i, tc.j) + if got != tc.want { + t.Errorf("test #%d: i, j = %5d, %5d: got %5d (= j + %6d), want %5d (= j + %6d)", + i, tc.i, tc.j, got, got-tc.j, tc.want, tc.want-tc.j) + } + } +} + +func TestExtendMatch(t *testing.T) { + // ref is a simple, reference implementation of extendMatch. + ref := func(src []byte, i, j int) int { + for ; j < len(src) && src[i] == src[j]; i, j = i+1, j+1 { + } + return j + } + + nums := []int{0, 1, 2, 7, 8, 9, 29, 30, 31, 32, 33, 34, 38, 39, 40} + for yIndex := 40; yIndex > 30; yIndex-- { + xxx := bytes.Repeat([]byte("x"), 40) + if yIndex < len(xxx) { + xxx[yIndex] = 'y' + } + for _, i := range nums { + for _, j := range nums { + if i >= j { + continue + } + got := extendMatch(xxx, i, j) + want := ref(xxx, i, j) + if got != want { + t.Errorf("yIndex=%d, i=%d, j=%d: got %d, want %d", yIndex, i, j, got, want) + } + } + } + } +} + +const snappytoolCmdName = "cmd/snappytool/snappytool" + +func skipTestSameEncodingAsCpp() (msg string) { + if !goEncoderShouldMatchCppEncoder { + return fmt.Sprintf("skipping testing that the encoding is byte-for-byte identical to C++: GOARCH=%s", runtime.GOARCH) + } + if _, err := os.Stat(snappytoolCmdName); err != nil { + return fmt.Sprintf("could not find snappytool: %v", err) + } + return "" +} + +func runTestSameEncodingAsCpp(src []byte) error { + got := Encode(nil, src) + + cmd := exec.Command(snappytoolCmdName, "-e") + cmd.Stdin = bytes.NewReader(src) + want, err := cmd.Output() + if err != nil { + return fmt.Errorf("could not run snappytool: %v", err) + } + return cmp(got, want) +} + +func TestSameEncodingAsCppShortCopies(t *testing.T) { + if msg := skipTestSameEncodingAsCpp(); msg != "" { + t.Skip(msg) + } + src := bytes.Repeat([]byte{'a'}, 20) + for i := 0; i <= len(src); i++ { + if err := runTestSameEncodingAsCpp(src[:i]); err != nil { + t.Errorf("i=%d: %v", i, err) + } + } +} + +func TestSameEncodingAsCppLongFiles(t *testing.T) { + if msg := skipTestSameEncodingAsCpp(); msg != "" { + t.Skip(msg) + } + bDir := filepath.FromSlash(*benchdataDir) + failed := false + for i, tf := range testFiles { + if err := downloadBenchmarkFiles(t, tf.filename); err != nil { + t.Fatalf("failed to download testdata: %s", err) + } + data := readFile(t, filepath.Join(bDir, tf.filename)) + if n := tf.sizeLimit; 0 < n && n < len(data) { + data = data[:n] + } + if err := runTestSameEncodingAsCpp(data); err != nil { + t.Errorf("i=%d: %v", i, err) + failed = true + } + } + if failed { + t.Errorf("was the snappytool program built against the C++ snappy library version " + + "d53de187 or later, commited on 2016-04-05? See " + + "https://github.com/google/snappy/commit/d53de18799418e113e44444252a39b12a0e4e0cc") + } +} + +// TestSlowForwardCopyOverrun tests the "expand the pattern" algorithm +// described in decode_amd64.s and its claim of a 10 byte overrun worst case. +func TestSlowForwardCopyOverrun(t *testing.T) { + const base = 100 + + for length := 1; length < 18; length++ { + for offset := 1; offset < 18; offset++ { + highWaterMark := base + d := base + l := length + o := offset + + // makeOffsetAtLeast8 + for o < 8 { + if end := d + 8; highWaterMark < end { + highWaterMark = end + } + l -= o + d += o + o += o + } + + // fixUpSlowForwardCopy + a := d + d += l + + // finishSlowForwardCopy + for l > 0 { + if end := a + 8; highWaterMark < end { + highWaterMark = end + } + a += 8 + l -= 8 + } + + dWant := base + length + overrun := highWaterMark - dWant + if d != dWant || overrun < 0 || 10 < overrun { + t.Errorf("length=%d, offset=%d: d and overrun: got (%d, %d), want (%d, something in [0, 10])", + length, offset, d, overrun, dWant) + } + } + } +} + +// TestEncodeNoiseThenRepeats encodes input for which the first half is very +// incompressible and the second half is very compressible. The encoded form's +// length should be closer to 50% of the original length than 100%. +func TestEncodeNoiseThenRepeats(t *testing.T) { + for _, origLen := range []int{256 * 1024, 2048 * 1024} { + src := make([]byte, origLen) + rng := rand.New(rand.NewSource(1)) + firstHalf, secondHalf := src[:origLen/2], src[origLen/2:] + for i := range firstHalf { + firstHalf[i] = uint8(rng.Intn(256)) + } + for i := range secondHalf { + secondHalf[i] = uint8(i >> 8) + } + dst := Encode(nil, src) + if got, want := len(dst), origLen*3/4; got >= want { + t.Errorf("origLen=%d: got %d encoded bytes, want less than %d", origLen, got, want) + } + } +} + +func TestFramingFormat(t *testing.T) { + // src is comprised of alternating 1e5-sized sequences of random + // (incompressible) bytes and repeated (compressible) bytes. 1e5 was chosen + // because it is larger than maxBlockSize (64k). + src := make([]byte, 1e6) + rng := rand.New(rand.NewSource(1)) + for i := 0; i < 10; i++ { + if i%2 == 0 { + for j := 0; j < 1e5; j++ { + src[1e5*i+j] = uint8(rng.Intn(256)) + } + } else { + for j := 0; j < 1e5; j++ { + src[1e5*i+j] = uint8(i) + } + } + } + + buf := new(bytes.Buffer) + if _, err := NewWriter(buf).Write(src); err != nil { + t.Fatalf("Write: encoding: %v", err) + } + dst, err := ioutil.ReadAll(NewReader(buf)) + if err != nil { + t.Fatalf("ReadAll: decoding: %v", err) + } + if err := cmp(dst, src); err != nil { + t.Fatal(err) + } +} + +func TestWriterGoldenOutput(t *testing.T) { + buf := new(bytes.Buffer) + w := NewBufferedWriter(buf) + defer w.Close() + w.Write([]byte("abcd")) // Not compressible. + w.Flush() + w.Write(bytes.Repeat([]byte{'A'}, 150)) // Compressible. + w.Flush() + // The next chunk is also compressible, but a naive, greedy encoding of the + // overall length 67 copy as a length 64 copy (the longest expressible as a + // tagCopy1 or tagCopy2) plus a length 3 remainder would be two 3-byte + // tagCopy2 tags (6 bytes), since the minimum length for a tagCopy1 is 4 + // bytes. Instead, we could do it shorter, in 5 bytes: a 3-byte tagCopy2 + // (of length 60) and a 2-byte tagCopy1 (of length 7). + w.Write(bytes.Repeat([]byte{'B'}, 68)) + w.Write([]byte("efC")) // Not compressible. + w.Write(bytes.Repeat([]byte{'C'}, 20)) // Compressible. + w.Write(bytes.Repeat([]byte{'B'}, 20)) // Compressible. + w.Write([]byte("g")) // Not compressible. + w.Flush() + + got := buf.String() + want := strings.Join([]string{ + magicChunk, + "\x01\x08\x00\x00", // Uncompressed chunk, 8 bytes long (including 4 byte checksum). + "\x68\x10\xe6\xb6", // Checksum. + "\x61\x62\x63\x64", // Uncompressed payload: "abcd". + "\x00\x11\x00\x00", // Compressed chunk, 17 bytes long (including 4 byte checksum). + "\x5f\xeb\xf2\x10", // Checksum. + "\x96\x01", // Compressed payload: Uncompressed length (varint encoded): 150. + "\x00\x41", // Compressed payload: tagLiteral, length=1, "A". + "\xfe\x01\x00", // Compressed payload: tagCopy2, length=64, offset=1. + "\xfe\x01\x00", // Compressed payload: tagCopy2, length=64, offset=1. + "\x52\x01\x00", // Compressed payload: tagCopy2, length=21, offset=1. + "\x00\x18\x00\x00", // Compressed chunk, 24 bytes long (including 4 byte checksum). + "\x30\x85\x69\xeb", // Checksum. + "\x70", // Compressed payload: Uncompressed length (varint encoded): 112. + "\x00\x42", // Compressed payload: tagLiteral, length=1, "B". + "\xee\x01\x00", // Compressed payload: tagCopy2, length=60, offset=1. + "\x0d\x01", // Compressed payload: tagCopy1, length=7, offset=1. + "\x08\x65\x66\x43", // Compressed payload: tagLiteral, length=3, "efC". + "\x4e\x01\x00", // Compressed payload: tagCopy2, length=20, offset=1. + "\x4e\x5a\x00", // Compressed payload: tagCopy2, length=20, offset=90. + "\x00\x67", // Compressed payload: tagLiteral, length=1, "g". + }, "") + if got != want { + t.Fatalf("\ngot: % x\nwant: % x", got, want) + } +} + +func TestEmitLiteral(t *testing.T) { + testCases := []struct { + length int + want string + }{ + {1, "\x00"}, + {2, "\x04"}, + {59, "\xe8"}, + {60, "\xec"}, + {61, "\xf0\x3c"}, + {62, "\xf0\x3d"}, + {254, "\xf0\xfd"}, + {255, "\xf0\xfe"}, + {256, "\xf0\xff"}, + {257, "\xf4\x00\x01"}, + {65534, "\xf4\xfd\xff"}, + {65535, "\xf4\xfe\xff"}, + {65536, "\xf4\xff\xff"}, + } + + dst := make([]byte, 70000) + nines := bytes.Repeat([]byte{0x99}, 65536) + for _, tc := range testCases { + lit := nines[:tc.length] + n := emitLiteral(dst, lit) + if !bytes.HasSuffix(dst[:n], lit) { + t.Errorf("length=%d: did not end with that many literal bytes", tc.length) + continue + } + got := string(dst[:n-tc.length]) + if got != tc.want { + t.Errorf("length=%d:\ngot % x\nwant % x", tc.length, got, tc.want) + continue + } + } +} + +func TestEmitCopy(t *testing.T) { + testCases := []struct { + offset int + length int + want string + }{ + {8, 04, "\x01\x08"}, + {8, 11, "\x1d\x08"}, + {8, 12, "\x2e\x08\x00"}, + {8, 13, "\x32\x08\x00"}, + {8, 59, "\xea\x08\x00"}, + {8, 60, "\xee\x08\x00"}, + {8, 61, "\xf2\x08\x00"}, + {8, 62, "\xf6\x08\x00"}, + {8, 63, "\xfa\x08\x00"}, + {8, 64, "\xfe\x08\x00"}, + {8, 65, "\xee\x08\x00\x05\x08"}, + {8, 66, "\xee\x08\x00\x09\x08"}, + {8, 67, "\xee\x08\x00\x0d\x08"}, + {8, 68, "\xfe\x08\x00\x01\x08"}, + {8, 69, "\xfe\x08\x00\x05\x08"}, + {8, 80, "\xfe\x08\x00\x3e\x08\x00"}, + + {256, 04, "\x21\x00"}, + {256, 11, "\x3d\x00"}, + {256, 12, "\x2e\x00\x01"}, + {256, 13, "\x32\x00\x01"}, + {256, 59, "\xea\x00\x01"}, + {256, 60, "\xee\x00\x01"}, + {256, 61, "\xf2\x00\x01"}, + {256, 62, "\xf6\x00\x01"}, + {256, 63, "\xfa\x00\x01"}, + {256, 64, "\xfe\x00\x01"}, + {256, 65, "\xee\x00\x01\x25\x00"}, + {256, 66, "\xee\x00\x01\x29\x00"}, + {256, 67, "\xee\x00\x01\x2d\x00"}, + {256, 68, "\xfe\x00\x01\x21\x00"}, + {256, 69, "\xfe\x00\x01\x25\x00"}, + {256, 80, "\xfe\x00\x01\x3e\x00\x01"}, + + {2048, 04, "\x0e\x00\x08"}, + {2048, 11, "\x2a\x00\x08"}, + {2048, 12, "\x2e\x00\x08"}, + {2048, 13, "\x32\x00\x08"}, + {2048, 59, "\xea\x00\x08"}, + {2048, 60, "\xee\x00\x08"}, + {2048, 61, "\xf2\x00\x08"}, + {2048, 62, "\xf6\x00\x08"}, + {2048, 63, "\xfa\x00\x08"}, + {2048, 64, "\xfe\x00\x08"}, + {2048, 65, "\xee\x00\x08\x12\x00\x08"}, + {2048, 66, "\xee\x00\x08\x16\x00\x08"}, + {2048, 67, "\xee\x00\x08\x1a\x00\x08"}, + {2048, 68, "\xfe\x00\x08\x0e\x00\x08"}, + {2048, 69, "\xfe\x00\x08\x12\x00\x08"}, + {2048, 80, "\xfe\x00\x08\x3e\x00\x08"}, + } + + dst := make([]byte, 1024) + for _, tc := range testCases { + n := emitCopy(dst, tc.offset, tc.length) + got := string(dst[:n]) + if got != tc.want { + t.Errorf("offset=%d, length=%d:\ngot % x\nwant % x", tc.offset, tc.length, got, tc.want) + } + } +} + +func TestNewBufferedWriter(t *testing.T) { + // Test all 32 possible sub-sequences of these 5 input slices. + // + // Their lengths sum to 400,000, which is over 6 times the Writer ibuf + // capacity: 6 * maxBlockSize is 393,216. + inputs := [][]byte{ + bytes.Repeat([]byte{'a'}, 40000), + bytes.Repeat([]byte{'b'}, 150000), + bytes.Repeat([]byte{'c'}, 60000), + bytes.Repeat([]byte{'d'}, 120000), + bytes.Repeat([]byte{'e'}, 30000), + } +loop: + for i := 0; i < 1< 0; { + i := copy(x, src) + x = x[i:] + } + return dst +} + +func benchWords(b *testing.B, n int, decode bool) { + // Note: the file is OS-language dependent so the resulting values are not + // directly comparable for non-US-English OS installations. + data := expand(readFile(b, "/usr/share/dict/words"), n) + if decode { + benchDecode(b, data) + } else { + benchEncode(b, data) + } +} + +func BenchmarkWordsDecode1e1(b *testing.B) { benchWords(b, 1e1, true) } +func BenchmarkWordsDecode1e2(b *testing.B) { benchWords(b, 1e2, true) } +func BenchmarkWordsDecode1e3(b *testing.B) { benchWords(b, 1e3, true) } +func BenchmarkWordsDecode1e4(b *testing.B) { benchWords(b, 1e4, true) } +func BenchmarkWordsDecode1e5(b *testing.B) { benchWords(b, 1e5, true) } +func BenchmarkWordsDecode1e6(b *testing.B) { benchWords(b, 1e6, true) } +func BenchmarkWordsEncode1e1(b *testing.B) { benchWords(b, 1e1, false) } +func BenchmarkWordsEncode1e2(b *testing.B) { benchWords(b, 1e2, false) } +func BenchmarkWordsEncode1e3(b *testing.B) { benchWords(b, 1e3, false) } +func BenchmarkWordsEncode1e4(b *testing.B) { benchWords(b, 1e4, false) } +func BenchmarkWordsEncode1e5(b *testing.B) { benchWords(b, 1e5, false) } +func BenchmarkWordsEncode1e6(b *testing.B) { benchWords(b, 1e6, false) } + +func BenchmarkRandomEncode(b *testing.B) { + rng := rand.New(rand.NewSource(1)) + data := make([]byte, 1<<20) + for i := range data { + data[i] = uint8(rng.Intn(256)) + } + benchEncode(b, data) +} + +// testFiles' values are copied directly from +// https://raw.githubusercontent.com/google/snappy/master/snappy_unittest.cc +// The label field is unused in snappy-go. +var testFiles = []struct { + label string + filename string + sizeLimit int +}{ + {"html", "html", 0}, + {"urls", "urls.10K", 0}, + {"jpg", "fireworks.jpeg", 0}, + {"jpg_200", "fireworks.jpeg", 200}, + {"pdf", "paper-100k.pdf", 0}, + {"html4", "html_x_4", 0}, + {"txt1", "alice29.txt", 0}, + {"txt2", "asyoulik.txt", 0}, + {"txt3", "lcet10.txt", 0}, + {"txt4", "plrabn12.txt", 0}, + {"pb", "geo.protodata", 0}, + {"gaviota", "kppkn.gtb", 0}, +} + +const ( + // The benchmark data files are at this canonical URL. + benchURL = "https://raw.githubusercontent.com/google/snappy/master/testdata/" +) + +func downloadBenchmarkFiles(b testing.TB, basename string) (errRet error) { + bDir := filepath.FromSlash(*benchdataDir) + filename := filepath.Join(bDir, basename) + if stat, err := os.Stat(filename); err == nil && stat.Size() != 0 { + return nil + } + + if !*download { + b.Skipf("test data not found; skipping %s without the -download flag", testOrBenchmark(b)) + } + // Download the official snappy C++ implementation reference test data + // files for benchmarking. + if err := os.MkdirAll(bDir, 0777); err != nil && !os.IsExist(err) { + return fmt.Errorf("failed to create %s: %s", bDir, err) + } + + f, err := os.Create(filename) + if err != nil { + return fmt.Errorf("failed to create %s: %s", filename, err) + } + defer f.Close() + defer func() { + if errRet != nil { + os.Remove(filename) + } + }() + url := benchURL + basename + resp, err := http.Get(url) + if err != nil { + return fmt.Errorf("failed to download %s: %s", url, err) + } + defer resp.Body.Close() + if s := resp.StatusCode; s != http.StatusOK { + return fmt.Errorf("downloading %s: HTTP status code %d (%s)", url, s, http.StatusText(s)) + } + _, err = io.Copy(f, resp.Body) + if err != nil { + return fmt.Errorf("failed to download %s to %s: %s", url, filename, err) + } + return nil +} + +func benchFile(b *testing.B, i int, decode bool) { + if err := downloadBenchmarkFiles(b, testFiles[i].filename); err != nil { + b.Fatalf("failed to download testdata: %s", err) + } + bDir := filepath.FromSlash(*benchdataDir) + data := readFile(b, filepath.Join(bDir, testFiles[i].filename)) + if n := testFiles[i].sizeLimit; 0 < n && n < len(data) { + data = data[:n] + } + if decode { + benchDecode(b, data) + } else { + benchEncode(b, data) + } +} + +// Naming convention is kept similar to what snappy's C++ implementation uses. +func Benchmark_UFlat0(b *testing.B) { benchFile(b, 0, true) } +func Benchmark_UFlat1(b *testing.B) { benchFile(b, 1, true) } +func Benchmark_UFlat2(b *testing.B) { benchFile(b, 2, true) } +func Benchmark_UFlat3(b *testing.B) { benchFile(b, 3, true) } +func Benchmark_UFlat4(b *testing.B) { benchFile(b, 4, true) } +func Benchmark_UFlat5(b *testing.B) { benchFile(b, 5, true) } +func Benchmark_UFlat6(b *testing.B) { benchFile(b, 6, true) } +func Benchmark_UFlat7(b *testing.B) { benchFile(b, 7, true) } +func Benchmark_UFlat8(b *testing.B) { benchFile(b, 8, true) } +func Benchmark_UFlat9(b *testing.B) { benchFile(b, 9, true) } +func Benchmark_UFlat10(b *testing.B) { benchFile(b, 10, true) } +func Benchmark_UFlat11(b *testing.B) { benchFile(b, 11, true) } +func Benchmark_ZFlat0(b *testing.B) { benchFile(b, 0, false) } +func Benchmark_ZFlat1(b *testing.B) { benchFile(b, 1, false) } +func Benchmark_ZFlat2(b *testing.B) { benchFile(b, 2, false) } +func Benchmark_ZFlat3(b *testing.B) { benchFile(b, 3, false) } +func Benchmark_ZFlat4(b *testing.B) { benchFile(b, 4, false) } +func Benchmark_ZFlat5(b *testing.B) { benchFile(b, 5, false) } +func Benchmark_ZFlat6(b *testing.B) { benchFile(b, 6, false) } +func Benchmark_ZFlat7(b *testing.B) { benchFile(b, 7, false) } +func Benchmark_ZFlat8(b *testing.B) { benchFile(b, 8, false) } +func Benchmark_ZFlat9(b *testing.B) { benchFile(b, 9, false) } +func Benchmark_ZFlat10(b *testing.B) { benchFile(b, 10, false) } +func Benchmark_ZFlat11(b *testing.B) { benchFile(b, 11, false) } + +func BenchmarkExtendMatch(b *testing.B) { + tDir := filepath.FromSlash(*testdataDir) + src, err := ioutil.ReadFile(filepath.Join(tDir, goldenText)) + if err != nil { + b.Fatalf("ReadFile: %v", err) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + for _, tc := range extendMatchGoldenTestCases { + extendMatch(src, tc.i, tc.j) + } + } +} diff --git a/vendor/github.com/pelletier/go-toml/.gitignore b/vendor/github.com/pelletier/go-toml/.gitignore new file mode 100644 index 0000000..f1b6190 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/.gitignore @@ -0,0 +1 @@ +test_program/test_program_bin diff --git a/vendor/github.com/pelletier/go-toml/.travis.yml b/vendor/github.com/pelletier/go-toml/.travis.yml new file mode 100644 index 0000000..4966911 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/.travis.yml @@ -0,0 +1,23 @@ +sudo: false +language: go +go: + - 1.7.6 + - 1.8.3 + - 1.9 + - tip +matrix: + allow_failures: + - go: tip + fast_finish: true +script: + - if [ -n "$(go fmt ./...)" ]; then exit 1; fi + - ./test.sh + - ./benchmark.sh $TRAVIS_BRANCH https://github.com/$TRAVIS_REPO_SLUG.git +before_install: + - go get github.com/axw/gocov/gocov + - go get github.com/mattn/goveralls + - if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi +branches: + only: [master] +after_success: + - $HOME/gopath/bin/goveralls -service=travis-ci -coverprofile=coverage.out -repotoken $COVERALLS_TOKEN diff --git a/_vendor/vendor/github.com/pelletier/go-toml/LICENSE b/vendor/github.com/pelletier/go-toml/LICENSE similarity index 100% rename from _vendor/vendor/github.com/pelletier/go-toml/LICENSE rename to vendor/github.com/pelletier/go-toml/LICENSE diff --git a/vendor/github.com/pelletier/go-toml/README.md b/vendor/github.com/pelletier/go-toml/README.md new file mode 100644 index 0000000..2681690 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/README.md @@ -0,0 +1,119 @@ +# go-toml + +Go library for the [TOML](https://github.com/mojombo/toml) format. + +This library supports TOML version +[v0.4.0](https://github.com/toml-lang/toml/blob/master/versions/en/toml-v0.4.0.md) + +[![GoDoc](https://godoc.org/github.com/pelletier/go-toml?status.svg)](http://godoc.org/github.com/pelletier/go-toml) +[![license](https://img.shields.io/github/license/pelletier/go-toml.svg)](https://github.com/pelletier/go-toml/blob/master/LICENSE) +[![Build Status](https://travis-ci.org/pelletier/go-toml.svg?branch=master)](https://travis-ci.org/pelletier/go-toml) +[![Coverage Status](https://coveralls.io/repos/github/pelletier/go-toml/badge.svg?branch=master)](https://coveralls.io/github/pelletier/go-toml?branch=master) +[![Go Report Card](https://goreportcard.com/badge/github.com/pelletier/go-toml)](https://goreportcard.com/report/github.com/pelletier/go-toml) + +## Features + +Go-toml provides the following features for using data parsed from TOML documents: + +* Load TOML documents from files and string data +* Easily navigate TOML structure using Tree +* Mashaling and unmarshaling to and from data structures +* Line & column position data for all parsed elements +* [Query support similar to JSON-Path](query/) +* Syntax errors contain line and column numbers + +## Import + +```go +import "github.com/pelletier/go-toml" +``` + +## Usage example + +Read a TOML document: + +```go +config, _ := toml.Load(` +[postgres] +user = "pelletier" +password = "mypassword"`) +// retrieve data directly +user := config.Get("postgres.user").(string) + +// or using an intermediate object +postgresConfig := config.Get("postgres").(*toml.Tree) +password := postgresConfig.Get("password").(string) +``` + +Or use Unmarshal: + +```go +type Postgres struct { + User string + Password string +} +type Config struct { + Postgres Postgres +} + +doc := []byte(` +[postgres] +user = "pelletier" +password = "mypassword"`) + +config := Config{} +toml.Unmarshal(doc, &config) +fmt.Println("user=", config.Postgres.User) +``` + +Or use a query: + +```go +// use a query to gather elements without walking the tree +q, _ := query.Compile("$..[user,password]") +results := q.Execute(config) +for ii, item := range results.Values() { + fmt.Println("Query result %d: %v", ii, item) +} +``` + +## Documentation + +The documentation and additional examples are available at +[godoc.org](http://godoc.org/github.com/pelletier/go-toml). + +## Tools + +Go-toml provides two handy command line tools: + +* `tomll`: Reads TOML files and lint them. + + ``` + go install github.com/pelletier/go-toml/cmd/tomll + tomll --help + ``` +* `tomljson`: Reads a TOML file and outputs its JSON representation. + + ``` + go install github.com/pelletier/go-toml/cmd/tomljson + tomljson --help + ``` + +## Contribute + +Feel free to report bugs and patches using GitHub's pull requests system on +[pelletier/go-toml](https://github.com/pelletier/go-toml). Any feedback would be +much appreciated! + +### Run tests + +You have to make sure two kind of tests run: + +1. The Go unit tests +2. The TOML examples base + +You can run both of them using `./test.sh`. + +## License + +The MIT License (MIT). Read [LICENSE](LICENSE). diff --git a/vendor/github.com/pelletier/go-toml/benchmark.json b/vendor/github.com/pelletier/go-toml/benchmark.json new file mode 100644 index 0000000..86f99c6 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/benchmark.json @@ -0,0 +1,164 @@ +{ + "array": { + "key1": [ + 1, + 2, + 3 + ], + "key2": [ + "red", + "yellow", + "green" + ], + "key3": [ + [ + 1, + 2 + ], + [ + 3, + 4, + 5 + ] + ], + "key4": [ + [ + 1, + 2 + ], + [ + "a", + "b", + "c" + ] + ], + "key5": [ + 1, + 2, + 3 + ], + "key6": [ + 1, + 2 + ] + }, + "boolean": { + "False": false, + "True": true + }, + "datetime": { + "key1": "1979-05-27T07:32:00Z", + "key2": "1979-05-27T00:32:00-07:00", + "key3": "1979-05-27T00:32:00.999999-07:00" + }, + "float": { + "both": { + "key": 6.626e-34 + }, + "exponent": { + "key1": 5e+22, + "key2": 1000000, + "key3": -0.02 + }, + "fractional": { + "key1": 1, + "key2": 3.1415, + "key3": -0.01 + }, + "underscores": { + "key1": 9224617.445991227, + "key2": 1e+100 + } + }, + "fruit": [{ + "name": "apple", + "physical": { + "color": "red", + "shape": "round" + }, + "variety": [{ + "name": "red delicious" + }, + { + "name": "granny smith" + } + ] + }, + { + "name": "banana", + "variety": [{ + "name": "plantain" + }] + } + ], + "integer": { + "key1": 99, + "key2": 42, + "key3": 0, + "key4": -17, + "underscores": { + "key1": 1000, + "key2": 5349221, + "key3": 12345 + } + }, + "products": [{ + "name": "Hammer", + "sku": 738594937 + }, + {}, + { + "color": "gray", + "name": "Nail", + "sku": 284758393 + } + ], + "string": { + "basic": { + "basic": "I'm a string. \"You can quote me\". Name\tJosé\nLocation\tSF." + }, + "literal": { + "multiline": { + "lines": "The first newline is\ntrimmed in raw strings.\n All other whitespace\n is preserved.\n", + "regex2": "I [dw]on't need \\d{2} apples" + }, + "quoted": "Tom \"Dubs\" Preston-Werner", + "regex": "\u003c\\i\\c*\\s*\u003e", + "winpath": "C:\\Users\\nodejs\\templates", + "winpath2": "\\\\ServerX\\admin$\\system32\\" + }, + "multiline": { + "continued": { + "key1": "The quick brown fox jumps over the lazy dog.", + "key2": "The quick brown fox jumps over the lazy dog.", + "key3": "The quick brown fox jumps over the lazy dog." + }, + "key1": "One\nTwo", + "key2": "One\nTwo", + "key3": "One\nTwo" + } + }, + "table": { + "inline": { + "name": { + "first": "Tom", + "last": "Preston-Werner" + }, + "point": { + "x": 1, + "y": 2 + } + }, + "key": "value", + "subtable": { + "key": "another value" + } + }, + "x": { + "y": { + "z": { + "w": {} + } + } + } +} diff --git a/vendor/github.com/pelletier/go-toml/benchmark.sh b/vendor/github.com/pelletier/go-toml/benchmark.sh new file mode 100755 index 0000000..8b8bb52 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/benchmark.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +set -e + +reference_ref=${1:-master} +reference_git=${2:-.} + +if ! `hash benchstat 2>/dev/null`; then + echo "Installing benchstat" + go get golang.org/x/perf/cmd/benchstat + go install golang.org/x/perf/cmd/benchstat +fi + +tempdir=`mktemp -d /tmp/go-toml-benchmark-XXXXXX` +ref_tempdir="${tempdir}/ref" +ref_benchmark="${ref_tempdir}/benchmark-`echo -n ${reference_ref}|tr -s '/' '-'`.txt" +local_benchmark="`pwd`/benchmark-local.txt" + +echo "=== ${reference_ref} (${ref_tempdir})" +git clone ${reference_git} ${ref_tempdir} >/dev/null 2>/dev/null +pushd ${ref_tempdir} >/dev/null +git checkout ${reference_ref} >/dev/null 2>/dev/null +go test -bench=. -benchmem | tee ${ref_benchmark} +popd >/dev/null + +echo "" +echo "=== local" +go test -bench=. -benchmem | tee ${local_benchmark} + +echo "" +echo "=== diff" +benchstat -delta-test=none ${ref_benchmark} ${local_benchmark} \ No newline at end of file diff --git a/vendor/github.com/pelletier/go-toml/benchmark.toml b/vendor/github.com/pelletier/go-toml/benchmark.toml new file mode 100644 index 0000000..dfd77e0 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/benchmark.toml @@ -0,0 +1,244 @@ +################################################################################ +## Comment + +# Speak your mind with the hash symbol. They go from the symbol to the end of +# the line. + + +################################################################################ +## Table + +# Tables (also known as hash tables or dictionaries) are collections of +# key/value pairs. They appear in square brackets on a line by themselves. + +[table] + +key = "value" # Yeah, you can do this. + +# Nested tables are denoted by table names with dots in them. Name your tables +# whatever crap you please, just don't use #, ., [ or ]. + +[table.subtable] + +key = "another value" + +# You don't need to specify all the super-tables if you don't want to. TOML +# knows how to do it for you. + +# [x] you +# [x.y] don't +# [x.y.z] need these +[x.y.z.w] # for this to work + + +################################################################################ +## Inline Table + +# Inline tables provide a more compact syntax for expressing tables. They are +# especially useful for grouped data that can otherwise quickly become verbose. +# Inline tables are enclosed in curly braces `{` and `}`. No newlines are +# allowed between the curly braces unless they are valid within a value. + +[table.inline] + +name = { first = "Tom", last = "Preston-Werner" } +point = { x = 1, y = 2 } + + +################################################################################ +## String + +# There are four ways to express strings: basic, multi-line basic, literal, and +# multi-line literal. All strings must contain only valid UTF-8 characters. + +[string.basic] + +basic = "I'm a string. \"You can quote me\". Name\tJos\u00E9\nLocation\tSF." + +[string.multiline] + +# The following strings are byte-for-byte equivalent: +key1 = "One\nTwo" +key2 = """One\nTwo""" +key3 = """ +One +Two""" + +[string.multiline.continued] + +# The following strings are byte-for-byte equivalent: +key1 = "The quick brown fox jumps over the lazy dog." + +key2 = """ +The quick brown \ + + + fox jumps over \ + the lazy dog.""" + +key3 = """\ + The quick brown \ + fox jumps over \ + the lazy dog.\ + """ + +[string.literal] + +# What you see is what you get. +winpath = 'C:\Users\nodejs\templates' +winpath2 = '\\ServerX\admin$\system32\' +quoted = 'Tom "Dubs" Preston-Werner' +regex = '<\i\c*\s*>' + + +[string.literal.multiline] + +regex2 = '''I [dw]on't need \d{2} apples''' +lines = ''' +The first newline is +trimmed in raw strings. + All other whitespace + is preserved. +''' + + +################################################################################ +## Integer + +# Integers are whole numbers. Positive numbers may be prefixed with a plus sign. +# Negative numbers are prefixed with a minus sign. + +[integer] + +key1 = +99 +key2 = 42 +key3 = 0 +key4 = -17 + +[integer.underscores] + +# For large numbers, you may use underscores to enhance readability. Each +# underscore must be surrounded by at least one digit. +key1 = 1_000 +key2 = 5_349_221 +key3 = 1_2_3_4_5 # valid but inadvisable + + +################################################################################ +## Float + +# A float consists of an integer part (which may be prefixed with a plus or +# minus sign) followed by a fractional part and/or an exponent part. + +[float.fractional] + +key1 = +1.0 +key2 = 3.1415 +key3 = -0.01 + +[float.exponent] + +key1 = 5e+22 +key2 = 1e6 +key3 = -2E-2 + +[float.both] + +key = 6.626e-34 + +[float.underscores] + +key1 = 9_224_617.445_991_228_313 +key2 = 1e1_00 + + +################################################################################ +## Boolean + +# Booleans are just the tokens you're used to. Always lowercase. + +[boolean] + +True = true +False = false + + +################################################################################ +## Datetime + +# Datetimes are RFC 3339 dates. + +[datetime] + +key1 = 1979-05-27T07:32:00Z +key2 = 1979-05-27T00:32:00-07:00 +key3 = 1979-05-27T00:32:00.999999-07:00 + + +################################################################################ +## Array + +# Arrays are square brackets with other primitives inside. Whitespace is +# ignored. Elements are separated by commas. Data types may not be mixed. + +[array] + +key1 = [ 1, 2, 3 ] +key2 = [ "red", "yellow", "green" ] +key3 = [ [ 1, 2 ], [3, 4, 5] ] +#key4 = [ [ 1, 2 ], ["a", "b", "c"] ] # this is ok + +# Arrays can also be multiline. So in addition to ignoring whitespace, arrays +# also ignore newlines between the brackets. Terminating commas are ok before +# the closing bracket. + +key5 = [ + 1, 2, 3 +] +key6 = [ + 1, + 2, # this is ok +] + + +################################################################################ +## Array of Tables + +# These can be expressed by using a table name in double brackets. Each table +# with the same double bracketed name will be an element in the array. The +# tables are inserted in the order encountered. + +[[products]] + +name = "Hammer" +sku = 738594937 + +[[products]] + +[[products]] + +name = "Nail" +sku = 284758393 +color = "gray" + + +# You can create nested arrays of tables as well. + +[[fruit]] + name = "apple" + + [fruit.physical] + color = "red" + shape = "round" + + [[fruit.variety]] + name = "red delicious" + + [[fruit.variety]] + name = "granny smith" + +[[fruit]] + name = "banana" + + [[fruit.variety]] + name = "plantain" diff --git a/vendor/github.com/pelletier/go-toml/benchmark.yml b/vendor/github.com/pelletier/go-toml/benchmark.yml new file mode 100644 index 0000000..0bd19f0 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/benchmark.yml @@ -0,0 +1,121 @@ +--- +array: + key1: + - 1 + - 2 + - 3 + key2: + - red + - yellow + - green + key3: + - - 1 + - 2 + - - 3 + - 4 + - 5 + key4: + - - 1 + - 2 + - - a + - b + - c + key5: + - 1 + - 2 + - 3 + key6: + - 1 + - 2 +boolean: + 'False': false + 'True': true +datetime: + key1: '1979-05-27T07:32:00Z' + key2: '1979-05-27T00:32:00-07:00' + key3: '1979-05-27T00:32:00.999999-07:00' +float: + both: + key: 6.626e-34 + exponent: + key1: 5.0e+22 + key2: 1000000 + key3: -0.02 + fractional: + key1: 1 + key2: 3.1415 + key3: -0.01 + underscores: + key1: 9224617.445991227 + key2: 1.0e+100 +fruit: +- name: apple + physical: + color: red + shape: round + variety: + - name: red delicious + - name: granny smith +- name: banana + variety: + - name: plantain +integer: + key1: 99 + key2: 42 + key3: 0 + key4: -17 + underscores: + key1: 1000 + key2: 5349221 + key3: 12345 +products: +- name: Hammer + sku: 738594937 +- {} +- color: gray + name: Nail + sku: 284758393 +string: + basic: + basic: "I'm a string. \"You can quote me\". Name\tJosé\nLocation\tSF." + literal: + multiline: + lines: | + The first newline is + trimmed in raw strings. + All other whitespace + is preserved. + regex2: I [dw]on't need \d{2} apples + quoted: Tom "Dubs" Preston-Werner + regex: "<\\i\\c*\\s*>" + winpath: C:\Users\nodejs\templates + winpath2: "\\\\ServerX\\admin$\\system32\\" + multiline: + continued: + key1: The quick brown fox jumps over the lazy dog. + key2: The quick brown fox jumps over the lazy dog. + key3: The quick brown fox jumps over the lazy dog. + key1: |- + One + Two + key2: |- + One + Two + key3: |- + One + Two +table: + inline: + name: + first: Tom + last: Preston-Werner + point: + x: 1 + y: 2 + key: value + subtable: + key: another value +x: + y: + z: + w: {} diff --git a/vendor/github.com/pelletier/go-toml/benchmark_test.go b/vendor/github.com/pelletier/go-toml/benchmark_test.go new file mode 100644 index 0000000..e1f209d --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/benchmark_test.go @@ -0,0 +1,192 @@ +package toml + +import ( + "bytes" + "encoding/json" + "io/ioutil" + "testing" + "time" + + burntsushi "github.com/BurntSushi/toml" + yaml "gopkg.in/yaml.v2" +) + +type benchmarkDoc struct { + Table struct { + Key string + Subtable struct { + Key string + } + Inline struct { + Name struct { + First string + Last string + } + Point struct { + X int64 + U int64 + } + } + } + String struct { + Basic struct { + Basic string + } + Multiline struct { + Key1 string + Key2 string + Key3 string + Continued struct { + Key1 string + Key2 string + Key3 string + } + } + Literal struct { + Winpath string + Winpath2 string + Quoted string + Regex string + Multiline struct { + Regex2 string + Lines string + } + } + } + Integer struct { + Key1 int64 + Key2 int64 + Key3 int64 + Key4 int64 + Underscores struct { + Key1 int64 + Key2 int64 + Key3 int64 + } + } + Float struct { + Fractional struct { + Key1 float64 + Key2 float64 + Key3 float64 + } + Exponent struct { + Key1 float64 + Key2 float64 + Key3 float64 + } + Both struct { + Key float64 + } + Underscores struct { + Key1 float64 + Key2 float64 + } + } + Boolean struct { + True bool + False bool + } + Datetime struct { + Key1 time.Time + Key2 time.Time + Key3 time.Time + } + Array struct { + Key1 []int64 + Key2 []string + Key3 [][]int64 + // TODO: Key4 not supported by go-toml's Unmarshal + Key5 []int64 + Key6 []int64 + } + Products []struct { + Name string + Sku int64 + Color string + } + Fruit []struct { + Name string + Physical struct { + Color string + Shape string + Variety []struct { + Name string + } + } + } +} + +func BenchmarkParseToml(b *testing.B) { + fileBytes, err := ioutil.ReadFile("benchmark.toml") + if err != nil { + b.Fatal(err) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := LoadReader(bytes.NewReader(fileBytes)) + if err != nil { + b.Fatal(err) + } + } +} + +func BenchmarkUnmarshalToml(b *testing.B) { + bytes, err := ioutil.ReadFile("benchmark.toml") + if err != nil { + b.Fatal(err) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + target := benchmarkDoc{} + err := Unmarshal(bytes, &target) + if err != nil { + b.Fatal(err) + } + } +} + +func BenchmarkUnmarshalBurntSushiToml(b *testing.B) { + bytes, err := ioutil.ReadFile("benchmark.toml") + if err != nil { + b.Fatal(err) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + target := benchmarkDoc{} + err := burntsushi.Unmarshal(bytes, &target) + if err != nil { + b.Fatal(err) + } + } +} + +func BenchmarkUnmarshalJson(b *testing.B) { + bytes, err := ioutil.ReadFile("benchmark.json") + if err != nil { + b.Fatal(err) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + target := benchmarkDoc{} + err := json.Unmarshal(bytes, &target) + if err != nil { + b.Fatal(err) + } + } +} + +func BenchmarkUnmarshalYaml(b *testing.B) { + bytes, err := ioutil.ReadFile("benchmark.yml") + if err != nil { + b.Fatal(err) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + target := benchmarkDoc{} + err := yaml.Unmarshal(bytes, &target) + if err != nil { + b.Fatal(err) + } + } +} diff --git a/_vendor/vendor/github.com/pelletier/go-toml/doc.go b/vendor/github.com/pelletier/go-toml/doc.go similarity index 100% rename from _vendor/vendor/github.com/pelletier/go-toml/doc.go rename to vendor/github.com/pelletier/go-toml/doc.go diff --git a/vendor/github.com/pelletier/go-toml/doc_test.go b/vendor/github.com/pelletier/go-toml/doc_test.go new file mode 100644 index 0000000..a48c04b --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/doc_test.go @@ -0,0 +1,100 @@ +// code examples for godoc + +package toml_test + +import ( + "fmt" + "log" + + toml "github.com/pelletier/go-toml" +) + +func Example_tree() { + config, err := toml.LoadFile("config.toml") + + if err != nil { + fmt.Println("Error ", err.Error()) + } else { + // retrieve data directly + user := config.Get("postgres.user").(string) + password := config.Get("postgres.password").(string) + + // or using an intermediate object + configTree := config.Get("postgres").(*toml.Tree) + user = configTree.Get("user").(string) + password = configTree.Get("password").(string) + fmt.Println("User is", user, " and password is", password) + + // show where elements are in the file + fmt.Printf("User position: %v\n", configTree.GetPosition("user")) + fmt.Printf("Password position: %v\n", configTree.GetPosition("password")) + } +} + +func Example_unmarshal() { + type Employer struct { + Name string + Phone string + } + type Person struct { + Name string + Age int64 + Employer Employer + } + + document := []byte(` + name = "John" + age = 30 + [employer] + name = "Company Inc." + phone = "+1 234 567 89012" + `) + + person := Person{} + toml.Unmarshal(document, &person) + fmt.Println(person.Name, "is", person.Age, "and works at", person.Employer.Name) + // Output: + // John is 30 and works at Company Inc. +} + +func ExampleMarshal() { + type Postgres struct { + User string `toml:"user"` + Password string `toml:"password"` + } + type Config struct { + Postgres Postgres `toml:"postgres"` + } + + config := Config{Postgres{User: "pelletier", Password: "mypassword"}} + b, err := toml.Marshal(config) + if err != nil { + log.Fatal(err) + } + fmt.Println(string(b)) + // Output: + // [postgres] + // password = "mypassword" + // user = "pelletier" +} + +func ExampleUnmarshal() { + type Postgres struct { + User string + Password string + } + type Config struct { + Postgres Postgres + } + + doc := []byte(` + [postgres] + user = "pelletier" + password = "mypassword"`) + + config := Config{} + toml.Unmarshal(doc, &config) + fmt.Println("user=", config.Postgres.User) + // Output: + // user= pelletier +} diff --git a/vendor/github.com/pelletier/go-toml/example-crlf.toml b/vendor/github.com/pelletier/go-toml/example-crlf.toml new file mode 100644 index 0000000..12950a1 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/example-crlf.toml @@ -0,0 +1,29 @@ +# This is a TOML document. Boom. + +title = "TOML Example" + +[owner] +name = "Tom Preston-Werner" +organization = "GitHub" +bio = "GitHub Cofounder & CEO\nLikes tater tots and beer." +dob = 1979-05-27T07:32:00Z # First class dates? Why not? + +[database] +server = "192.168.1.1" +ports = [ 8001, 8001, 8002 ] +connection_max = 5000 +enabled = true + +[servers] + + # You can indent as you please. Tabs or spaces. TOML don't care. + [servers.alpha] + ip = "10.0.0.1" + dc = "eqdc10" + + [servers.beta] + ip = "10.0.0.2" + dc = "eqdc10" + +[clients] +data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it diff --git a/vendor/github.com/pelletier/go-toml/example.toml b/vendor/github.com/pelletier/go-toml/example.toml new file mode 100644 index 0000000..3d902f2 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/example.toml @@ -0,0 +1,29 @@ +# This is a TOML document. Boom. + +title = "TOML Example" + +[owner] +name = "Tom Preston-Werner" +organization = "GitHub" +bio = "GitHub Cofounder & CEO\nLikes tater tots and beer." +dob = 1979-05-27T07:32:00Z # First class dates? Why not? + +[database] +server = "192.168.1.1" +ports = [ 8001, 8001, 8002 ] +connection_max = 5000 +enabled = true + +[servers] + + # You can indent as you please. Tabs or spaces. TOML don't care. + [servers.alpha] + ip = "10.0.0.1" + dc = "eqdc10" + + [servers.beta] + ip = "10.0.0.2" + dc = "eqdc10" + +[clients] +data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it diff --git a/_vendor/vendor/github.com/pelletier/go-toml/keysparsing.go b/vendor/github.com/pelletier/go-toml/keysparsing.go similarity index 100% rename from _vendor/vendor/github.com/pelletier/go-toml/keysparsing.go rename to vendor/github.com/pelletier/go-toml/keysparsing.go diff --git a/vendor/github.com/pelletier/go-toml/keysparsing_test.go b/vendor/github.com/pelletier/go-toml/keysparsing_test.go new file mode 100644 index 0000000..1a9eccc --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/keysparsing_test.go @@ -0,0 +1,56 @@ +package toml + +import ( + "fmt" + "testing" +) + +func testResult(t *testing.T, key string, expected []string) { + parsed, err := parseKey(key) + t.Logf("key=%s expected=%s parsed=%s", key, expected, parsed) + if err != nil { + t.Fatal("Unexpected error:", err) + } + if len(expected) != len(parsed) { + t.Fatal("Expected length", len(expected), "but", len(parsed), "parsed") + } + for index, expectedKey := range expected { + if expectedKey != parsed[index] { + t.Fatal("Expected", expectedKey, "at index", index, "but found", parsed[index]) + } + } +} + +func testError(t *testing.T, key string, expectedError string) { + _, err := parseKey(key) + if fmt.Sprintf("%s", err) != expectedError { + t.Fatalf("Expected error \"%s\", but got \"%s\".", expectedError, err) + } +} + +func TestBareKeyBasic(t *testing.T) { + testResult(t, "test", []string{"test"}) +} + +func TestBareKeyDotted(t *testing.T) { + testResult(t, "this.is.a.key", []string{"this", "is", "a", "key"}) +} + +func TestDottedKeyBasic(t *testing.T) { + testResult(t, "\"a.dotted.key\"", []string{"a.dotted.key"}) +} + +func TestBaseKeyPound(t *testing.T) { + testError(t, "hello#world", "invalid bare character: #") +} + +func TestQuotedKeys(t *testing.T) { + testResult(t, `hello."foo".bar`, []string{"hello", "foo", "bar"}) + testResult(t, `"hello!"`, []string{"hello!"}) +} + +func TestEmptyKey(t *testing.T) { + testError(t, "", "empty key") + testError(t, " ", "empty key") + testResult(t, `""`, []string{""}) +} diff --git a/_vendor/vendor/github.com/pelletier/go-toml/lexer.go b/vendor/github.com/pelletier/go-toml/lexer.go similarity index 90% rename from _vendor/vendor/github.com/pelletier/go-toml/lexer.go rename to vendor/github.com/pelletier/go-toml/lexer.go index db3ab4e..1b6647d 100644 --- a/_vendor/vendor/github.com/pelletier/go-toml/lexer.go +++ b/vendor/github.com/pelletier/go-toml/lexer.go @@ -9,12 +9,9 @@ import ( "bytes" "errors" "fmt" - "io" "regexp" "strconv" "strings" - - "github.com/pelletier/go-buffruneio" ) var dateRegexp *regexp.Regexp @@ -24,29 +21,29 @@ type tomlLexStateFn func() tomlLexStateFn // Define lexer type tomlLexer struct { - input *buffruneio.Reader // Textual source - buffer bytes.Buffer // Runes composing the current token - tokens chan token - depth int - line int - col int - endbufferLine int - endbufferCol int + inputIdx int + input []rune // Textual source + currentTokenStart int + currentTokenStop int + tokens []token + depth int + line int + col int + endbufferLine int + endbufferCol int } // Basic read operations on input func (l *tomlLexer) read() rune { - r, _, err := l.input.ReadRune() - if err != nil { - panic(err) - } + r := l.peek() if r == '\n' { l.endbufferLine++ l.endbufferCol = 1 } else { l.endbufferCol++ } + l.inputIdx++ return r } @@ -54,13 +51,13 @@ func (l *tomlLexer) next() rune { r := l.read() if r != eof { - l.buffer.WriteRune(r) + l.currentTokenStop++ } return r } func (l *tomlLexer) ignore() { - l.buffer.Reset() + l.currentTokenStart = l.currentTokenStop l.line = l.endbufferLine l.col = l.endbufferCol } @@ -77,49 +74,46 @@ func (l *tomlLexer) fastForward(n int) { } func (l *tomlLexer) emitWithValue(t tokenType, value string) { - l.tokens <- token{ + l.tokens = append(l.tokens, token{ Position: Position{l.line, l.col}, typ: t, val: value, - } + }) l.ignore() } func (l *tomlLexer) emit(t tokenType) { - l.emitWithValue(t, l.buffer.String()) + l.emitWithValue(t, string(l.input[l.currentTokenStart:l.currentTokenStop])) } func (l *tomlLexer) peek() rune { - r, _, err := l.input.ReadRune() - if err != nil { - panic(err) + if l.inputIdx >= len(l.input) { + return eof } - l.input.UnreadRune() - return r + return l.input[l.inputIdx] +} + +func (l *tomlLexer) peekString(size int) string { + maxIdx := len(l.input) + upperIdx := l.inputIdx + size // FIXME: potential overflow + if upperIdx > maxIdx { + upperIdx = maxIdx + } + return string(l.input[l.inputIdx:upperIdx]) } func (l *tomlLexer) follow(next string) bool { - for _, expectedRune := range next { - r, _, err := l.input.ReadRune() - defer l.input.UnreadRune() - if err != nil { - panic(err) - } - if expectedRune != r { - return false - } - } - return true + return next == l.peekString(len(next)) } // Error management func (l *tomlLexer) errorf(format string, args ...interface{}) tomlLexStateFn { - l.tokens <- token{ + l.tokens = append(l.tokens, token{ Position: Position{l.line, l.col}, typ: tokenError, val: fmt.Sprintf(format, args...), - } + }) return nil } @@ -220,7 +214,7 @@ func (l *tomlLexer) lexRvalue() tomlLexStateFn { break } - possibleDate := string(l.input.PeekRunes(35)) + possibleDate := l.peekString(35) dateMatch := dateRegexp.FindString(possibleDate) if dateMatch != "" { l.fastForward(len(dateMatch)) @@ -537,7 +531,7 @@ func (l *tomlLexer) lexInsideTableArrayKey() tomlLexStateFn { for r := l.peek(); r != eof; r = l.peek() { switch r { case ']': - if l.buffer.Len() > 0 { + if l.currentTokenStop > l.currentTokenStart { l.emit(tokenKeyGroupArray) } l.next() @@ -560,7 +554,7 @@ func (l *tomlLexer) lexInsideTableKey() tomlLexStateFn { for r := l.peek(); r != eof; r = l.peek() { switch r { case ']': - if l.buffer.Len() > 0 { + if l.currentTokenStop > l.currentTokenStart { l.emit(tokenKeyGroup) } l.next() @@ -635,7 +629,6 @@ func (l *tomlLexer) run() { for state := l.lexVoid; state != nil; { state = state() } - close(l.tokens) } func init() { @@ -643,16 +636,16 @@ func init() { } // Entry point -func lexToml(input io.Reader) chan token { - bufferedInput := buffruneio.NewReader(input) +func lexToml(inputBytes []byte) []token { + runes := bytes.Runes(inputBytes) l := &tomlLexer{ - input: bufferedInput, - tokens: make(chan token), + input: runes, + tokens: make([]token, 0, 256), line: 1, col: 1, endbufferLine: 1, endbufferCol: 1, } - go l.run() + l.run() return l.tokens } diff --git a/vendor/github.com/pelletier/go-toml/lexer_test.go b/vendor/github.com/pelletier/go-toml/lexer_test.go new file mode 100644 index 0000000..313b83c --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/lexer_test.go @@ -0,0 +1,750 @@ +package toml + +import ( + "reflect" + "testing" +) + +func testFlow(t *testing.T, input string, expectedFlow []token) { + tokens := lexToml([]byte(input)) + if !reflect.DeepEqual(tokens, expectedFlow) { + t.Fatal("Different flows. Expected\n", expectedFlow, "\nGot:\n", tokens) + } +} + +func TestValidKeyGroup(t *testing.T) { + testFlow(t, "[hello world]", []token{ + {Position{1, 1}, tokenLeftBracket, "["}, + {Position{1, 2}, tokenKeyGroup, "hello world"}, + {Position{1, 13}, tokenRightBracket, "]"}, + {Position{1, 14}, tokenEOF, ""}, + }) +} + +func TestNestedQuotedUnicodeKeyGroup(t *testing.T) { + testFlow(t, `[ j . "ʞ" . l ]`, []token{ + {Position{1, 1}, tokenLeftBracket, "["}, + {Position{1, 2}, tokenKeyGroup, ` j . "ʞ" . l `}, + {Position{1, 15}, tokenRightBracket, "]"}, + {Position{1, 16}, tokenEOF, ""}, + }) +} + +func TestUnclosedKeyGroup(t *testing.T) { + testFlow(t, "[hello world", []token{ + {Position{1, 1}, tokenLeftBracket, "["}, + {Position{1, 2}, tokenError, "unclosed table key"}, + }) +} + +func TestComment(t *testing.T) { + testFlow(t, "# blahblah", []token{ + {Position{1, 11}, tokenEOF, ""}, + }) +} + +func TestKeyGroupComment(t *testing.T) { + testFlow(t, "[hello world] # blahblah", []token{ + {Position{1, 1}, tokenLeftBracket, "["}, + {Position{1, 2}, tokenKeyGroup, "hello world"}, + {Position{1, 13}, tokenRightBracket, "]"}, + {Position{1, 25}, tokenEOF, ""}, + }) +} + +func TestMultipleKeyGroupsComment(t *testing.T) { + testFlow(t, "[hello world] # blahblah\n[test]", []token{ + {Position{1, 1}, tokenLeftBracket, "["}, + {Position{1, 2}, tokenKeyGroup, "hello world"}, + {Position{1, 13}, tokenRightBracket, "]"}, + {Position{2, 1}, tokenLeftBracket, "["}, + {Position{2, 2}, tokenKeyGroup, "test"}, + {Position{2, 6}, tokenRightBracket, "]"}, + {Position{2, 7}, tokenEOF, ""}, + }) +} + +func TestSimpleWindowsCRLF(t *testing.T) { + testFlow(t, "a=4\r\nb=2", []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 2}, tokenEqual, "="}, + {Position{1, 3}, tokenInteger, "4"}, + {Position{2, 1}, tokenKey, "b"}, + {Position{2, 2}, tokenEqual, "="}, + {Position{2, 3}, tokenInteger, "2"}, + {Position{2, 4}, tokenEOF, ""}, + }) +} + +func TestBasicKey(t *testing.T) { + testFlow(t, "hello", []token{ + {Position{1, 1}, tokenKey, "hello"}, + {Position{1, 6}, tokenEOF, ""}, + }) +} + +func TestBasicKeyWithUnderscore(t *testing.T) { + testFlow(t, "hello_hello", []token{ + {Position{1, 1}, tokenKey, "hello_hello"}, + {Position{1, 12}, tokenEOF, ""}, + }) +} + +func TestBasicKeyWithDash(t *testing.T) { + testFlow(t, "hello-world", []token{ + {Position{1, 1}, tokenKey, "hello-world"}, + {Position{1, 12}, tokenEOF, ""}, + }) +} + +func TestBasicKeyWithUppercaseMix(t *testing.T) { + testFlow(t, "helloHELLOHello", []token{ + {Position{1, 1}, tokenKey, "helloHELLOHello"}, + {Position{1, 16}, tokenEOF, ""}, + }) +} + +func TestBasicKeyWithInternationalCharacters(t *testing.T) { + testFlow(t, "héllÖ", []token{ + {Position{1, 1}, tokenKey, "héllÖ"}, + {Position{1, 6}, tokenEOF, ""}, + }) +} + +func TestBasicKeyAndEqual(t *testing.T) { + testFlow(t, "hello =", []token{ + {Position{1, 1}, tokenKey, "hello"}, + {Position{1, 7}, tokenEqual, "="}, + {Position{1, 8}, tokenEOF, ""}, + }) +} + +func TestKeyWithSharpAndEqual(t *testing.T) { + testFlow(t, "key#name = 5", []token{ + {Position{1, 1}, tokenError, "keys cannot contain # character"}, + }) +} + +func TestKeyWithSymbolsAndEqual(t *testing.T) { + testFlow(t, "~!@$^&*()_+-`1234567890[]\\|/?><.,;:' = 5", []token{ + {Position{1, 1}, tokenError, "keys cannot contain ~ character"}, + }) +} + +func TestKeyEqualStringEscape(t *testing.T) { + testFlow(t, `foo = "hello\""`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, "hello\""}, + {Position{1, 16}, tokenEOF, ""}, + }) +} + +func TestKeyEqualStringUnfinished(t *testing.T) { + testFlow(t, `foo = "bar`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenError, "unclosed string"}, + }) +} + +func TestKeyEqualString(t *testing.T) { + testFlow(t, `foo = "bar"`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, "bar"}, + {Position{1, 12}, tokenEOF, ""}, + }) +} + +func TestKeyEqualTrue(t *testing.T) { + testFlow(t, "foo = true", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenTrue, "true"}, + {Position{1, 11}, tokenEOF, ""}, + }) +} + +func TestKeyEqualFalse(t *testing.T) { + testFlow(t, "foo = false", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenFalse, "false"}, + {Position{1, 12}, tokenEOF, ""}, + }) +} + +func TestArrayNestedString(t *testing.T) { + testFlow(t, `a = [ ["hello", "world"] ]`, []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 3}, tokenEqual, "="}, + {Position{1, 5}, tokenLeftBracket, "["}, + {Position{1, 7}, tokenLeftBracket, "["}, + {Position{1, 9}, tokenString, "hello"}, + {Position{1, 15}, tokenComma, ","}, + {Position{1, 18}, tokenString, "world"}, + {Position{1, 24}, tokenRightBracket, "]"}, + {Position{1, 26}, tokenRightBracket, "]"}, + {Position{1, 27}, tokenEOF, ""}, + }) +} + +func TestArrayNestedInts(t *testing.T) { + testFlow(t, "a = [ [42, 21], [10] ]", []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 3}, tokenEqual, "="}, + {Position{1, 5}, tokenLeftBracket, "["}, + {Position{1, 7}, tokenLeftBracket, "["}, + {Position{1, 8}, tokenInteger, "42"}, + {Position{1, 10}, tokenComma, ","}, + {Position{1, 12}, tokenInteger, "21"}, + {Position{1, 14}, tokenRightBracket, "]"}, + {Position{1, 15}, tokenComma, ","}, + {Position{1, 17}, tokenLeftBracket, "["}, + {Position{1, 18}, tokenInteger, "10"}, + {Position{1, 20}, tokenRightBracket, "]"}, + {Position{1, 22}, tokenRightBracket, "]"}, + {Position{1, 23}, tokenEOF, ""}, + }) +} + +func TestArrayInts(t *testing.T) { + testFlow(t, "a = [ 42, 21, 10, ]", []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 3}, tokenEqual, "="}, + {Position{1, 5}, tokenLeftBracket, "["}, + {Position{1, 7}, tokenInteger, "42"}, + {Position{1, 9}, tokenComma, ","}, + {Position{1, 11}, tokenInteger, "21"}, + {Position{1, 13}, tokenComma, ","}, + {Position{1, 15}, tokenInteger, "10"}, + {Position{1, 17}, tokenComma, ","}, + {Position{1, 19}, tokenRightBracket, "]"}, + {Position{1, 20}, tokenEOF, ""}, + }) +} + +func TestMultilineArrayComments(t *testing.T) { + testFlow(t, "a = [1, # wow\n2, # such items\n3, # so array\n]", []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 3}, tokenEqual, "="}, + {Position{1, 5}, tokenLeftBracket, "["}, + {Position{1, 6}, tokenInteger, "1"}, + {Position{1, 7}, tokenComma, ","}, + {Position{2, 1}, tokenInteger, "2"}, + {Position{2, 2}, tokenComma, ","}, + {Position{3, 1}, tokenInteger, "3"}, + {Position{3, 2}, tokenComma, ","}, + {Position{4, 1}, tokenRightBracket, "]"}, + {Position{4, 2}, tokenEOF, ""}, + }) +} + +func TestNestedArraysComment(t *testing.T) { + toml := ` +someArray = [ +# does not work +["entry1"] +]` + testFlow(t, toml, []token{ + {Position{2, 1}, tokenKey, "someArray"}, + {Position{2, 11}, tokenEqual, "="}, + {Position{2, 13}, tokenLeftBracket, "["}, + {Position{4, 1}, tokenLeftBracket, "["}, + {Position{4, 3}, tokenString, "entry1"}, + {Position{4, 10}, tokenRightBracket, "]"}, + {Position{5, 1}, tokenRightBracket, "]"}, + {Position{5, 2}, tokenEOF, ""}, + }) +} + +func TestKeyEqualArrayBools(t *testing.T) { + testFlow(t, "foo = [true, false, true]", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenLeftBracket, "["}, + {Position{1, 8}, tokenTrue, "true"}, + {Position{1, 12}, tokenComma, ","}, + {Position{1, 14}, tokenFalse, "false"}, + {Position{1, 19}, tokenComma, ","}, + {Position{1, 21}, tokenTrue, "true"}, + {Position{1, 25}, tokenRightBracket, "]"}, + {Position{1, 26}, tokenEOF, ""}, + }) +} + +func TestKeyEqualArrayBoolsWithComments(t *testing.T) { + testFlow(t, "foo = [true, false, true] # YEAH", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenLeftBracket, "["}, + {Position{1, 8}, tokenTrue, "true"}, + {Position{1, 12}, tokenComma, ","}, + {Position{1, 14}, tokenFalse, "false"}, + {Position{1, 19}, tokenComma, ","}, + {Position{1, 21}, tokenTrue, "true"}, + {Position{1, 25}, tokenRightBracket, "]"}, + {Position{1, 33}, tokenEOF, ""}, + }) +} + +func TestDateRegexp(t *testing.T) { + if dateRegexp.FindString("1979-05-27T07:32:00Z") == "" { + t.Error("basic lexing") + } + if dateRegexp.FindString("1979-05-27T00:32:00-07:00") == "" { + t.Error("offset lexing") + } + if dateRegexp.FindString("1979-05-27T00:32:00.999999-07:00") == "" { + t.Error("nano precision lexing") + } +} + +func TestKeyEqualDate(t *testing.T) { + testFlow(t, "foo = 1979-05-27T07:32:00Z", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenDate, "1979-05-27T07:32:00Z"}, + {Position{1, 27}, tokenEOF, ""}, + }) + testFlow(t, "foo = 1979-05-27T00:32:00-07:00", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenDate, "1979-05-27T00:32:00-07:00"}, + {Position{1, 32}, tokenEOF, ""}, + }) + testFlow(t, "foo = 1979-05-27T00:32:00.999999-07:00", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenDate, "1979-05-27T00:32:00.999999-07:00"}, + {Position{1, 39}, tokenEOF, ""}, + }) +} + +func TestFloatEndingWithDot(t *testing.T) { + testFlow(t, "foo = 42.", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenError, "float cannot end with a dot"}, + }) +} + +func TestFloatWithTwoDots(t *testing.T) { + testFlow(t, "foo = 4.2.", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenError, "cannot have two dots in one float"}, + }) +} + +func TestFloatWithExponent1(t *testing.T) { + testFlow(t, "a = 5e+22", []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 3}, tokenEqual, "="}, + {Position{1, 5}, tokenFloat, "5e+22"}, + {Position{1, 10}, tokenEOF, ""}, + }) +} + +func TestFloatWithExponent2(t *testing.T) { + testFlow(t, "a = 5E+22", []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 3}, tokenEqual, "="}, + {Position{1, 5}, tokenFloat, "5E+22"}, + {Position{1, 10}, tokenEOF, ""}, + }) +} + +func TestFloatWithExponent3(t *testing.T) { + testFlow(t, "a = -5e+22", []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 3}, tokenEqual, "="}, + {Position{1, 5}, tokenFloat, "-5e+22"}, + {Position{1, 11}, tokenEOF, ""}, + }) +} + +func TestFloatWithExponent4(t *testing.T) { + testFlow(t, "a = -5e-22", []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 3}, tokenEqual, "="}, + {Position{1, 5}, tokenFloat, "-5e-22"}, + {Position{1, 11}, tokenEOF, ""}, + }) +} + +func TestFloatWithExponent5(t *testing.T) { + testFlow(t, "a = 6.626e-34", []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 3}, tokenEqual, "="}, + {Position{1, 5}, tokenFloat, "6.626e-34"}, + {Position{1, 14}, tokenEOF, ""}, + }) +} + +func TestInvalidEsquapeSequence(t *testing.T) { + testFlow(t, `foo = "\x"`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenError, "invalid escape sequence: \\x"}, + }) +} + +func TestNestedArrays(t *testing.T) { + testFlow(t, "foo = [[[]]]", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenLeftBracket, "["}, + {Position{1, 8}, tokenLeftBracket, "["}, + {Position{1, 9}, tokenLeftBracket, "["}, + {Position{1, 10}, tokenRightBracket, "]"}, + {Position{1, 11}, tokenRightBracket, "]"}, + {Position{1, 12}, tokenRightBracket, "]"}, + {Position{1, 13}, tokenEOF, ""}, + }) +} + +func TestKeyEqualNumber(t *testing.T) { + testFlow(t, "foo = 42", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenInteger, "42"}, + {Position{1, 9}, tokenEOF, ""}, + }) + + testFlow(t, "foo = +42", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenInteger, "+42"}, + {Position{1, 10}, tokenEOF, ""}, + }) + + testFlow(t, "foo = -42", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenInteger, "-42"}, + {Position{1, 10}, tokenEOF, ""}, + }) + + testFlow(t, "foo = 4.2", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenFloat, "4.2"}, + {Position{1, 10}, tokenEOF, ""}, + }) + + testFlow(t, "foo = +4.2", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenFloat, "+4.2"}, + {Position{1, 11}, tokenEOF, ""}, + }) + + testFlow(t, "foo = -4.2", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenFloat, "-4.2"}, + {Position{1, 11}, tokenEOF, ""}, + }) + + testFlow(t, "foo = 1_000", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenInteger, "1_000"}, + {Position{1, 12}, tokenEOF, ""}, + }) + + testFlow(t, "foo = 5_349_221", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenInteger, "5_349_221"}, + {Position{1, 16}, tokenEOF, ""}, + }) + + testFlow(t, "foo = 1_2_3_4_5", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenInteger, "1_2_3_4_5"}, + {Position{1, 16}, tokenEOF, ""}, + }) + + testFlow(t, "flt8 = 9_224_617.445_991_228_313", []token{ + {Position{1, 1}, tokenKey, "flt8"}, + {Position{1, 6}, tokenEqual, "="}, + {Position{1, 8}, tokenFloat, "9_224_617.445_991_228_313"}, + {Position{1, 33}, tokenEOF, ""}, + }) + + testFlow(t, "foo = +", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenError, "no digit in that number"}, + }) +} + +func TestMultiline(t *testing.T) { + testFlow(t, "foo = 42\nbar=21", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 7}, tokenInteger, "42"}, + {Position{2, 1}, tokenKey, "bar"}, + {Position{2, 4}, tokenEqual, "="}, + {Position{2, 5}, tokenInteger, "21"}, + {Position{2, 7}, tokenEOF, ""}, + }) +} + +func TestKeyEqualStringUnicodeEscape(t *testing.T) { + testFlow(t, `foo = "hello \u2665"`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, "hello ♥"}, + {Position{1, 21}, tokenEOF, ""}, + }) + testFlow(t, `foo = "hello \U000003B4"`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, "hello δ"}, + {Position{1, 25}, tokenEOF, ""}, + }) + testFlow(t, `foo = "\uabcd"`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, "\uabcd"}, + {Position{1, 15}, tokenEOF, ""}, + }) + testFlow(t, `foo = "\uABCD"`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, "\uABCD"}, + {Position{1, 15}, tokenEOF, ""}, + }) + testFlow(t, `foo = "\U000bcdef"`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, "\U000bcdef"}, + {Position{1, 19}, tokenEOF, ""}, + }) + testFlow(t, `foo = "\U000BCDEF"`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, "\U000BCDEF"}, + {Position{1, 19}, tokenEOF, ""}, + }) + testFlow(t, `foo = "\u2"`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenError, "unfinished unicode escape"}, + }) + testFlow(t, `foo = "\U2"`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenError, "unfinished unicode escape"}, + }) +} + +func TestKeyEqualStringNoEscape(t *testing.T) { + testFlow(t, "foo = \"hello \u0002\"", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenError, "unescaped control character U+0002"}, + }) + testFlow(t, "foo = \"hello \u001F\"", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenError, "unescaped control character U+001F"}, + }) +} + +func TestLiteralString(t *testing.T) { + testFlow(t, `foo = 'C:\Users\nodejs\templates'`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, `C:\Users\nodejs\templates`}, + {Position{1, 34}, tokenEOF, ""}, + }) + testFlow(t, `foo = '\\ServerX\admin$\system32\'`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, `\\ServerX\admin$\system32\`}, + {Position{1, 35}, tokenEOF, ""}, + }) + testFlow(t, `foo = 'Tom "Dubs" Preston-Werner'`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, `Tom "Dubs" Preston-Werner`}, + {Position{1, 34}, tokenEOF, ""}, + }) + testFlow(t, `foo = '<\i\c*\s*>'`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, `<\i\c*\s*>`}, + {Position{1, 19}, tokenEOF, ""}, + }) + testFlow(t, `foo = 'C:\Users\nodejs\unfinis`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenError, "unclosed string"}, + }) +} + +func TestMultilineLiteralString(t *testing.T) { + testFlow(t, `foo = '''hello 'literal' world'''`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 10}, tokenString, `hello 'literal' world`}, + {Position{1, 34}, tokenEOF, ""}, + }) + + testFlow(t, "foo = '''\nhello\n'literal'\nworld'''", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{2, 1}, tokenString, "hello\n'literal'\nworld"}, + {Position{4, 9}, tokenEOF, ""}, + }) + testFlow(t, "foo = '''\r\nhello\r\n'literal'\r\nworld'''", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{2, 1}, tokenString, "hello\r\n'literal'\r\nworld"}, + {Position{4, 9}, tokenEOF, ""}, + }) +} + +func TestMultilineString(t *testing.T) { + testFlow(t, `foo = """hello "literal" world"""`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 10}, tokenString, `hello "literal" world`}, + {Position{1, 34}, tokenEOF, ""}, + }) + + testFlow(t, "foo = \"\"\"\r\nhello\\\r\n\"literal\"\\\nworld\"\"\"", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{2, 1}, tokenString, "hello\"literal\"world"}, + {Position{4, 9}, tokenEOF, ""}, + }) + + testFlow(t, "foo = \"\"\"\\\n \\\n \\\n hello\\\nmultiline\\\nworld\"\"\"", []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 10}, tokenString, "hellomultilineworld"}, + {Position{6, 9}, tokenEOF, ""}, + }) + + testFlow(t, "key2 = \"\"\"\nThe quick brown \\\n\n\n fox jumps over \\\n the lazy dog.\"\"\"", []token{ + {Position{1, 1}, tokenKey, "key2"}, + {Position{1, 6}, tokenEqual, "="}, + {Position{2, 1}, tokenString, "The quick brown fox jumps over the lazy dog."}, + {Position{6, 21}, tokenEOF, ""}, + }) + + testFlow(t, "key2 = \"\"\"\\\n The quick brown \\\n fox jumps over \\\n the lazy dog.\\\n \"\"\"", []token{ + {Position{1, 1}, tokenKey, "key2"}, + {Position{1, 6}, tokenEqual, "="}, + {Position{1, 11}, tokenString, "The quick brown fox jumps over the lazy dog."}, + {Position{5, 11}, tokenEOF, ""}, + }) + + testFlow(t, `key2 = "Roses are red\nViolets are blue"`, []token{ + {Position{1, 1}, tokenKey, "key2"}, + {Position{1, 6}, tokenEqual, "="}, + {Position{1, 9}, tokenString, "Roses are red\nViolets are blue"}, + {Position{1, 41}, tokenEOF, ""}, + }) + + testFlow(t, "key2 = \"\"\"\nRoses are red\nViolets are blue\"\"\"", []token{ + {Position{1, 1}, tokenKey, "key2"}, + {Position{1, 6}, tokenEqual, "="}, + {Position{2, 1}, tokenString, "Roses are red\nViolets are blue"}, + {Position{3, 20}, tokenEOF, ""}, + }) +} + +func TestUnicodeString(t *testing.T) { + testFlow(t, `foo = "hello ♥ world"`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, "hello ♥ world"}, + {Position{1, 22}, tokenEOF, ""}, + }) +} +func TestEscapeInString(t *testing.T) { + testFlow(t, `foo = "\b\f\/"`, []token{ + {Position{1, 1}, tokenKey, "foo"}, + {Position{1, 5}, tokenEqual, "="}, + {Position{1, 8}, tokenString, "\b\f/"}, + {Position{1, 15}, tokenEOF, ""}, + }) +} + +func TestKeyGroupArray(t *testing.T) { + testFlow(t, "[[foo]]", []token{ + {Position{1, 1}, tokenDoubleLeftBracket, "[["}, + {Position{1, 3}, tokenKeyGroupArray, "foo"}, + {Position{1, 6}, tokenDoubleRightBracket, "]]"}, + {Position{1, 8}, tokenEOF, ""}, + }) +} + +func TestQuotedKey(t *testing.T) { + testFlow(t, "\"a b\" = 42", []token{ + {Position{1, 1}, tokenKey, "\"a b\""}, + {Position{1, 7}, tokenEqual, "="}, + {Position{1, 9}, tokenInteger, "42"}, + {Position{1, 11}, tokenEOF, ""}, + }) +} + +func TestKeyNewline(t *testing.T) { + testFlow(t, "a\n= 4", []token{ + {Position{1, 1}, tokenError, "keys cannot contain new lines"}, + }) +} + +func TestInvalidFloat(t *testing.T) { + testFlow(t, "a=7e1_", []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 2}, tokenEqual, "="}, + {Position{1, 3}, tokenFloat, "7e1_"}, + {Position{1, 7}, tokenEOF, ""}, + }) +} + +func TestLexUnknownRvalue(t *testing.T) { + testFlow(t, `a = !b`, []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 3}, tokenEqual, "="}, + {Position{1, 5}, tokenError, "no value can start with !"}, + }) + + testFlow(t, `a = \b`, []token{ + {Position{1, 1}, tokenKey, "a"}, + {Position{1, 3}, tokenEqual, "="}, + {Position{1, 5}, tokenError, `no value can start with \`}, + }) +} + +func BenchmarkLexer(b *testing.B) { + sample := `title = "Hugo: A Fast and Flexible Website Generator" +baseurl = "http://gohugo.io/" +MetaDataFormat = "yaml" +pluralizeListTitles = false + +[params] + description = "Documentation of Hugo, a fast and flexible static site generator built with love by spf13, bep and friends in Go" + author = "Steve Francia (spf13) and friends" + release = "0.22-DEV" + +[[menu.main]] + name = "Download Hugo" + pre = "" + url = "https://github.com/spf13/hugo/releases" + weight = -200 +` + b.ResetTimer() + for i := 0; i < b.N; i++ { + lexToml([]byte(sample)) + } +} diff --git a/_vendor/vendor/github.com/pelletier/go-toml/marshal.go b/vendor/github.com/pelletier/go-toml/marshal.go similarity index 98% rename from _vendor/vendor/github.com/pelletier/go-toml/marshal.go rename to vendor/github.com/pelletier/go-toml/marshal.go index 9bf6fb9..1a3176f 100644 --- a/_vendor/vendor/github.com/pelletier/go-toml/marshal.go +++ b/vendor/github.com/pelletier/go-toml/marshal.go @@ -268,15 +268,20 @@ func valueFromTree(mtype reflect.Type, tval *Tree) (reflect.Value, error) { mtypef := mtype.Field(i) opts := tomlOptions(mtypef) if opts.include { - key := opts.name - exists := tval.Has(key) - if exists { + baseKey := opts.name + keysToTry := []string{baseKey, strings.ToLower(baseKey), strings.ToTitle(baseKey)} + for _, key := range keysToTry { + exists := tval.Has(key) + if !exists { + continue + } val := tval.Get(key) mvalf, err := valueFromToml(mtypef.Type, val) if err != nil { return mval, formatError(err, tval.GetPosition(key)) } mval.Field(i).Set(mvalf) + break } } } diff --git a/vendor/github.com/pelletier/go-toml/marshal_test.go b/vendor/github.com/pelletier/go-toml/marshal_test.go new file mode 100644 index 0000000..dbfc7c1 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/marshal_test.go @@ -0,0 +1,600 @@ +package toml + +import ( + "bytes" + "encoding/json" + "fmt" + "io/ioutil" + "reflect" + "testing" + "time" +) + +type basicMarshalTestStruct struct { + String string `toml:"string"` + StringList []string `toml:"strlist"` + Sub basicMarshalTestSubStruct `toml:"subdoc"` + SubList []basicMarshalTestSubStruct `toml:"sublist"` +} + +type basicMarshalTestSubStruct struct { + String2 string +} + +var basicTestData = basicMarshalTestStruct{ + String: "Hello", + StringList: []string{"Howdy", "Hey There"}, + Sub: basicMarshalTestSubStruct{"One"}, + SubList: []basicMarshalTestSubStruct{{"Two"}, {"Three"}}, +} + +var basicTestToml = []byte(`string = "Hello" +strlist = ["Howdy","Hey There"] + +[subdoc] + String2 = "One" + +[[sublist]] + String2 = "Two" + +[[sublist]] + String2 = "Three" +`) + +func TestBasicMarshal(t *testing.T) { + result, err := Marshal(basicTestData) + if err != nil { + t.Fatal(err) + } + expected := basicTestToml + if !bytes.Equal(result, expected) { + t.Errorf("Bad marshal: expected\n-----\n%s\n-----\ngot\n-----\n%s\n-----\n", expected, result) + } +} + +func TestBasicUnmarshal(t *testing.T) { + result := basicMarshalTestStruct{} + err := Unmarshal(basicTestToml, &result) + expected := basicTestData + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(result, expected) { + t.Errorf("Bad unmarshal: expected %v, got %v", expected, result) + } +} + +type testDoc struct { + Title string `toml:"title"` + Basics testDocBasics `toml:"basic"` + BasicLists testDocBasicLists `toml:"basic_lists"` + BasicMap map[string]string `toml:"basic_map"` + Subdocs testDocSubs `toml:"subdoc"` + SubDocList []testSubDoc `toml:"subdoclist"` + SubDocPtrs []*testSubDoc `toml:"subdocptrs"` + err int `toml:"shouldntBeHere"` + unexported int `toml:"shouldntBeHere"` + Unexported2 int `toml:"-"` +} + +type testDocBasics struct { + Bool bool `toml:"bool"` + Date time.Time `toml:"date"` + Float float32 `toml:"float"` + Int int `toml:"int"` + Uint uint `toml:"uint"` + String *string `toml:"string"` + unexported int `toml:"shouldntBeHere"` +} + +type testDocBasicLists struct { + Bools []bool `toml:"bools"` + Dates []time.Time `toml:"dates"` + Floats []*float32 `toml:"floats"` + Ints []int `toml:"ints"` + Strings []string `toml:"strings"` + UInts []uint `toml:"uints"` +} + +type testDocSubs struct { + First testSubDoc `toml:"first"` + Second *testSubDoc `toml:"second"` +} + +type testSubDoc struct { + Name string `toml:"name"` + unexported int `toml:"shouldntBeHere"` +} + +var biteMe = "Bite me" +var float1 float32 = 12.3 +var float2 float32 = 45.6 +var float3 float32 = 78.9 +var subdoc = testSubDoc{"Second", 0} + +var docData = testDoc{ + Title: "TOML Marshal Testing", + unexported: 0, + Unexported2: 0, + Basics: testDocBasics{ + Bool: true, + Date: time.Date(1979, 5, 27, 7, 32, 0, 0, time.UTC), + Float: 123.4, + Int: 5000, + Uint: 5001, + String: &biteMe, + unexported: 0, + }, + BasicLists: testDocBasicLists{ + Bools: []bool{true, false, true}, + Dates: []time.Time{ + time.Date(1979, 5, 27, 7, 32, 0, 0, time.UTC), + time.Date(1980, 5, 27, 7, 32, 0, 0, time.UTC), + }, + Floats: []*float32{&float1, &float2, &float3}, + Ints: []int{8001, 8001, 8002}, + Strings: []string{"One", "Two", "Three"}, + UInts: []uint{5002, 5003}, + }, + BasicMap: map[string]string{ + "one": "one", + "two": "two", + }, + Subdocs: testDocSubs{ + First: testSubDoc{"First", 0}, + Second: &subdoc, + }, + SubDocList: []testSubDoc{ + testSubDoc{"List.First", 0}, + testSubDoc{"List.Second", 0}, + }, + SubDocPtrs: []*testSubDoc{&subdoc}, +} + +func TestDocMarshal(t *testing.T) { + result, err := Marshal(docData) + if err != nil { + t.Fatal(err) + } + expected, _ := ioutil.ReadFile("marshal_test.toml") + if !bytes.Equal(result, expected) { + t.Errorf("Bad marshal: expected\n-----\n%s\n-----\ngot\n-----\n%s\n-----\n", expected, result) + } +} + +func TestDocUnmarshal(t *testing.T) { + result := testDoc{} + tomlData, _ := ioutil.ReadFile("marshal_test.toml") + err := Unmarshal(tomlData, &result) + expected := docData + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(result, expected) { + resStr, _ := json.MarshalIndent(result, "", " ") + expStr, _ := json.MarshalIndent(expected, "", " ") + t.Errorf("Bad unmarshal: expected\n-----\n%s\n-----\ngot\n-----\n%s\n-----\n", expStr, resStr) + } +} + +func TestDocPartialUnmarshal(t *testing.T) { + result := testDocSubs{} + + tree, _ := LoadFile("marshal_test.toml") + subTree := tree.Get("subdoc").(*Tree) + err := subTree.Unmarshal(&result) + expected := docData.Subdocs + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(result, expected) { + resStr, _ := json.MarshalIndent(result, "", " ") + expStr, _ := json.MarshalIndent(expected, "", " ") + t.Errorf("Bad partial unmartial: expected\n-----\n%s\n-----\ngot\n-----\n%s\n-----\n", expStr, resStr) + } +} + +type tomlTypeCheckTest struct { + name string + item interface{} + typ int //0=primitive, 1=otherslice, 2=treeslice, 3=tree +} + +func TestTypeChecks(t *testing.T) { + tests := []tomlTypeCheckTest{ + {"integer", 2, 0}, + {"time", time.Date(2015, 1, 1, 0, 0, 0, 0, time.UTC), 0}, + {"stringlist", []string{"hello", "hi"}, 1}, + {"timelist", []time.Time{time.Date(2015, 1, 1, 0, 0, 0, 0, time.UTC)}, 1}, + {"objectlist", []tomlTypeCheckTest{}, 2}, + {"object", tomlTypeCheckTest{}, 3}, + } + + for _, test := range tests { + expected := []bool{false, false, false, false} + expected[test.typ] = true + result := []bool{ + isPrimitive(reflect.TypeOf(test.item)), + isOtherSlice(reflect.TypeOf(test.item)), + isTreeSlice(reflect.TypeOf(test.item)), + isTree(reflect.TypeOf(test.item)), + } + if !reflect.DeepEqual(expected, result) { + t.Errorf("Bad type check on %q: expected %v, got %v", test.name, expected, result) + } + } +} + +type unexportedMarshalTestStruct struct { + String string `toml:"string"` + StringList []string `toml:"strlist"` + Sub basicMarshalTestSubStruct `toml:"subdoc"` + SubList []basicMarshalTestSubStruct `toml:"sublist"` + unexported int `toml:"shouldntBeHere"` + Unexported2 int `toml:"-"` +} + +var unexportedTestData = unexportedMarshalTestStruct{ + String: "Hello", + StringList: []string{"Howdy", "Hey There"}, + Sub: basicMarshalTestSubStruct{"One"}, + SubList: []basicMarshalTestSubStruct{{"Two"}, {"Three"}}, + unexported: 0, + Unexported2: 0, +} + +var unexportedTestToml = []byte(`string = "Hello" +strlist = ["Howdy","Hey There"] +unexported = 1 +shouldntBeHere = 2 + +[subdoc] + String2 = "One" + +[[sublist]] + String2 = "Two" + +[[sublist]] + String2 = "Three" +`) + +func TestUnexportedUnmarshal(t *testing.T) { + result := unexportedMarshalTestStruct{} + err := Unmarshal(unexportedTestToml, &result) + expected := unexportedTestData + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(result, expected) { + t.Errorf("Bad unexported unmarshal: expected %v, got %v", expected, result) + } +} + +type errStruct struct { + Bool bool `toml:"bool"` + Date time.Time `toml:"date"` + Float float64 `toml:"float"` + Int int16 `toml:"int"` + String *string `toml:"string"` +} + +var errTomls = []string{ + "bool = truly\ndate = 1979-05-27T07:32:00Z\nfloat = 123.4\nint = 5000\nstring = \"Bite me\"", + "bool = true\ndate = 1979-05-27T07:3200Z\nfloat = 123.4\nint = 5000\nstring = \"Bite me\"", + "bool = true\ndate = 1979-05-27T07:32:00Z\nfloat = 123a4\nint = 5000\nstring = \"Bite me\"", + "bool = true\ndate = 1979-05-27T07:32:00Z\nfloat = 123.4\nint = j000\nstring = \"Bite me\"", + "bool = true\ndate = 1979-05-27T07:32:00Z\nfloat = 123.4\nint = 5000\nstring = Bite me", + "bool = true\ndate = 1979-05-27T07:32:00Z\nfloat = 123.4\nint = 5000\nstring = Bite me", + "bool = 1\ndate = 1979-05-27T07:32:00Z\nfloat = 123.4\nint = 5000\nstring = \"Bite me\"", + "bool = true\ndate = 1\nfloat = 123.4\nint = 5000\nstring = \"Bite me\"", + "bool = true\ndate = 1979-05-27T07:32:00Z\n\"sorry\"\nint = 5000\nstring = \"Bite me\"", + "bool = true\ndate = 1979-05-27T07:32:00Z\nfloat = 123.4\nint = \"sorry\"\nstring = \"Bite me\"", + "bool = true\ndate = 1979-05-27T07:32:00Z\nfloat = 123.4\nint = 5000\nstring = 1", +} + +type mapErr struct { + Vals map[string]float64 +} + +type intErr struct { + Int1 int + Int2 int8 + Int3 int16 + Int4 int32 + Int5 int64 + UInt1 uint + UInt2 uint8 + UInt3 uint16 + UInt4 uint32 + UInt5 uint64 + Flt1 float32 + Flt2 float64 +} + +var intErrTomls = []string{ + "Int1 = []\nInt2 = 2\nInt3 = 3\nInt4 = 4\nInt5 = 5\nUInt1 = 1\nUInt2 = 2\nUInt3 = 3\nUInt4 = 4\nUInt5 = 5\nFlt1 = 1.0\nFlt2 = 2.0", + "Int1 = 1\nInt2 = []\nInt3 = 3\nInt4 = 4\nInt5 = 5\nUInt1 = 1\nUInt2 = 2\nUInt3 = 3\nUInt4 = 4\nUInt5 = 5\nFlt1 = 1.0\nFlt2 = 2.0", + "Int1 = 1\nInt2 = 2\nInt3 = []\nInt4 = 4\nInt5 = 5\nUInt1 = 1\nUInt2 = 2\nUInt3 = 3\nUInt4 = 4\nUInt5 = 5\nFlt1 = 1.0\nFlt2 = 2.0", + "Int1 = 1\nInt2 = 2\nInt3 = 3\nInt4 = []\nInt5 = 5\nUInt1 = 1\nUInt2 = 2\nUInt3 = 3\nUInt4 = 4\nUInt5 = 5\nFlt1 = 1.0\nFlt2 = 2.0", + "Int1 = 1\nInt2 = 2\nInt3 = 3\nInt4 = 4\nInt5 = []\nUInt1 = 1\nUInt2 = 2\nUInt3 = 3\nUInt4 = 4\nUInt5 = 5\nFlt1 = 1.0\nFlt2 = 2.0", + "Int1 = 1\nInt2 = 2\nInt3 = 3\nInt4 = 4\nInt5 = 5\nUInt1 = []\nUInt2 = 2\nUInt3 = 3\nUInt4 = 4\nUInt5 = 5\nFlt1 = 1.0\nFlt2 = 2.0", + "Int1 = 1\nInt2 = 2\nInt3 = 3\nInt4 = 4\nInt5 = 5\nUInt1 = 1\nUInt2 = []\nUInt3 = 3\nUInt4 = 4\nUInt5 = 5\nFlt1 = 1.0\nFlt2 = 2.0", + "Int1 = 1\nInt2 = 2\nInt3 = 3\nInt4 = 4\nInt5 = 5\nUInt1 = 1\nUInt2 = 2\nUInt3 = []\nUInt4 = 4\nUInt5 = 5\nFlt1 = 1.0\nFlt2 = 2.0", + "Int1 = 1\nInt2 = 2\nInt3 = 3\nInt4 = 4\nInt5 = 5\nUInt1 = 1\nUInt2 = 2\nUInt3 = 3\nUInt4 = []\nUInt5 = 5\nFlt1 = 1.0\nFlt2 = 2.0", + "Int1 = 1\nInt2 = 2\nInt3 = 3\nInt4 = 4\nInt5 = 5\nUInt1 = 1\nUInt2 = 2\nUInt3 = 3\nUInt4 = 4\nUInt5 = []\nFlt1 = 1.0\nFlt2 = 2.0", + "Int1 = 1\nInt2 = 2\nInt3 = 3\nInt4 = 4\nInt5 = 5\nUInt1 = 1\nUInt2 = 2\nUInt3 = 3\nUInt4 = 4\nUInt5 = 5\nFlt1 = []\nFlt2 = 2.0", + "Int1 = 1\nInt2 = 2\nInt3 = 3\nInt4 = 4\nInt5 = 5\nUInt1 = 1\nUInt2 = 2\nUInt3 = 3\nUInt4 = 4\nUInt5 = 5\nFlt1 = 1.0\nFlt2 = []", +} + +func TestErrUnmarshal(t *testing.T) { + for ind, toml := range errTomls { + result := errStruct{} + err := Unmarshal([]byte(toml), &result) + if err == nil { + t.Errorf("Expected err from case %d\n", ind) + } + } + result2 := mapErr{} + err := Unmarshal([]byte("[Vals]\nfred=\"1.2\""), &result2) + if err == nil { + t.Errorf("Expected err from map") + } + for ind, toml := range intErrTomls { + result3 := intErr{} + err := Unmarshal([]byte(toml), &result3) + if err == nil { + t.Errorf("Expected int err from case %d\n", ind) + } + } +} + +type emptyMarshalTestStruct struct { + Title string `toml:"title"` + Bool bool `toml:"bool"` + Int int `toml:"int"` + String string `toml:"string"` + StringList []string `toml:"stringlist"` + Ptr *basicMarshalTestStruct `toml:"ptr"` + Map map[string]string `toml:"map"` +} + +var emptyTestData = emptyMarshalTestStruct{ + Title: "Placeholder", + Bool: false, + Int: 0, + String: "", + StringList: []string{}, + Ptr: nil, + Map: map[string]string{}, +} + +var emptyTestToml = []byte(`bool = false +int = 0 +string = "" +stringlist = [] +title = "Placeholder" + +[map] +`) + +type emptyMarshalTestStruct2 struct { + Title string `toml:"title"` + Bool bool `toml:"bool,omitempty"` + Int int `toml:"int, omitempty"` + String string `toml:"string,omitempty "` + StringList []string `toml:"stringlist,omitempty"` + Ptr *basicMarshalTestStruct `toml:"ptr,omitempty"` + Map map[string]string `toml:"map,omitempty"` +} + +var emptyTestData2 = emptyMarshalTestStruct2{ + Title: "Placeholder", + Bool: false, + Int: 0, + String: "", + StringList: []string{}, + Ptr: nil, + Map: map[string]string{}, +} + +var emptyTestToml2 = []byte(`title = "Placeholder" +`) + +func TestEmptyMarshal(t *testing.T) { + result, err := Marshal(emptyTestData) + if err != nil { + t.Fatal(err) + } + expected := emptyTestToml + if !bytes.Equal(result, expected) { + t.Errorf("Bad empty marshal: expected\n-----\n%s\n-----\ngot\n-----\n%s\n-----\n", expected, result) + } +} + +func TestEmptyMarshalOmit(t *testing.T) { + result, err := Marshal(emptyTestData2) + if err != nil { + t.Fatal(err) + } + expected := emptyTestToml2 + if !bytes.Equal(result, expected) { + t.Errorf("Bad empty omit marshal: expected\n-----\n%s\n-----\ngot\n-----\n%s\n-----\n", expected, result) + } +} + +func TestEmptyUnmarshal(t *testing.T) { + result := emptyMarshalTestStruct{} + err := Unmarshal(emptyTestToml, &result) + expected := emptyTestData + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(result, expected) { + t.Errorf("Bad empty unmarshal: expected %v, got %v", expected, result) + } +} + +func TestEmptyUnmarshalOmit(t *testing.T) { + result := emptyMarshalTestStruct2{} + err := Unmarshal(emptyTestToml, &result) + expected := emptyTestData2 + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(result, expected) { + t.Errorf("Bad empty omit unmarshal: expected %v, got %v", expected, result) + } +} + +type pointerMarshalTestStruct struct { + Str *string + List *[]string + ListPtr *[]*string + Map *map[string]string + MapPtr *map[string]*string + EmptyStr *string + EmptyList *[]string + EmptyMap *map[string]string + DblPtr *[]*[]*string +} + +var pointerStr = "Hello" +var pointerList = []string{"Hello back"} +var pointerListPtr = []*string{&pointerStr} +var pointerMap = map[string]string{"response": "Goodbye"} +var pointerMapPtr = map[string]*string{"alternate": &pointerStr} +var pointerTestData = pointerMarshalTestStruct{ + Str: &pointerStr, + List: &pointerList, + ListPtr: &pointerListPtr, + Map: &pointerMap, + MapPtr: &pointerMapPtr, + EmptyStr: nil, + EmptyList: nil, + EmptyMap: nil, +} + +var pointerTestToml = []byte(`List = ["Hello back"] +ListPtr = ["Hello"] +Str = "Hello" + +[Map] + response = "Goodbye" + +[MapPtr] + alternate = "Hello" +`) + +func TestPointerMarshal(t *testing.T) { + result, err := Marshal(pointerTestData) + if err != nil { + t.Fatal(err) + } + expected := pointerTestToml + if !bytes.Equal(result, expected) { + t.Errorf("Bad pointer marshal: expected\n-----\n%s\n-----\ngot\n-----\n%s\n-----\n", expected, result) + } +} + +func TestPointerUnmarshal(t *testing.T) { + result := pointerMarshalTestStruct{} + err := Unmarshal(pointerTestToml, &result) + expected := pointerTestData + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(result, expected) { + t.Errorf("Bad pointer unmarshal: expected %v, got %v", expected, result) + } +} + +type nestedMarshalTestStruct struct { + String [][]string + //Struct [][]basicMarshalTestSubStruct + StringPtr *[]*[]*string + // StructPtr *[]*[]*basicMarshalTestSubStruct +} + +var str1 = "Three" +var str2 = "Four" +var strPtr = []*string{&str1, &str2} +var strPtr2 = []*[]*string{&strPtr} + +var nestedTestData = nestedMarshalTestStruct{ + String: [][]string{[]string{"Five", "Six"}, []string{"One", "Two"}}, + StringPtr: &strPtr2, +} + +var nestedTestToml = []byte(`String = [["Five","Six"],["One","Two"]] +StringPtr = [["Three","Four"]] +`) + +func TestNestedMarshal(t *testing.T) { + result, err := Marshal(nestedTestData) + if err != nil { + t.Fatal(err) + } + expected := nestedTestToml + if !bytes.Equal(result, expected) { + t.Errorf("Bad nested marshal: expected\n-----\n%s\n-----\ngot\n-----\n%s\n-----\n", expected, result) + } +} + +func TestNestedUnmarshal(t *testing.T) { + result := nestedMarshalTestStruct{} + err := Unmarshal(nestedTestToml, &result) + expected := nestedTestData + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(result, expected) { + t.Errorf("Bad nested unmarshal: expected %v, got %v", expected, result) + } +} + +type customMarshalerParent struct { + Self customMarshaler `toml:"me"` + Friends []customMarshaler `toml:"friends"` +} + +type customMarshaler struct { + FirsName string + LastName string +} + +func (c customMarshaler) MarshalTOML() ([]byte, error) { + fullName := fmt.Sprintf("%s %s", c.FirsName, c.LastName) + return []byte(fullName), nil +} + +var customMarshalerData = customMarshaler{FirsName: "Sally", LastName: "Fields"} +var customMarshalerToml = []byte(`Sally Fields`) +var nestedCustomMarshalerData = customMarshalerParent{ + Self: customMarshaler{FirsName: "Maiku", LastName: "Suteda"}, + Friends: []customMarshaler{customMarshalerData}, +} +var nestedCustomMarshalerToml = []byte(`friends = ["Sally Fields"] +me = "Maiku Suteda" +`) + +func TestCustomMarshaler(t *testing.T) { + result, err := Marshal(customMarshalerData) + if err != nil { + t.Fatal(err) + } + expected := customMarshalerToml + if !bytes.Equal(result, expected) { + t.Errorf("Bad custom marshaler: expected\n-----\n%s\n-----\ngot\n-----\n%s\n-----\n", expected, result) + } +} + +func TestNestedCustomMarshaler(t *testing.T) { + result, err := Marshal(nestedCustomMarshalerData) + if err != nil { + t.Fatal(err) + } + expected := nestedCustomMarshalerToml + if !bytes.Equal(result, expected) { + t.Errorf("Bad nested custom marshaler: expected\n-----\n%s\n-----\ngot\n-----\n%s\n-----\n", expected, result) + } +} diff --git a/vendor/github.com/pelletier/go-toml/marshal_test.toml b/vendor/github.com/pelletier/go-toml/marshal_test.toml new file mode 100644 index 0000000..1c5f98e --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/marshal_test.toml @@ -0,0 +1,38 @@ +title = "TOML Marshal Testing" + +[basic] + bool = true + date = 1979-05-27T07:32:00Z + float = 123.4 + int = 5000 + string = "Bite me" + uint = 5001 + +[basic_lists] + bools = [true,false,true] + dates = [1979-05-27T07:32:00Z,1980-05-27T07:32:00Z] + floats = [12.3,45.6,78.9] + ints = [8001,8001,8002] + strings = ["One","Two","Three"] + uints = [5002,5003] + +[basic_map] + one = "one" + two = "two" + +[subdoc] + + [subdoc.first] + name = "First" + + [subdoc.second] + name = "Second" + +[[subdoclist]] + name = "List.First" + +[[subdoclist]] + name = "List.Second" + +[[subdocptrs]] + name = "Second" diff --git a/_vendor/vendor/github.com/pelletier/go-toml/parser.go b/vendor/github.com/pelletier/go-toml/parser.go similarity index 95% rename from _vendor/vendor/github.com/pelletier/go-toml/parser.go rename to vendor/github.com/pelletier/go-toml/parser.go index 64eb0e5..8ee49cb 100644 --- a/_vendor/vendor/github.com/pelletier/go-toml/parser.go +++ b/vendor/github.com/pelletier/go-toml/parser.go @@ -13,9 +13,9 @@ import ( ) type tomlParser struct { - flow chan token + flowIdx int + flow []token tree *Tree - tokensBuffer []token currentTable []string seenTableKeys []string } @@ -34,16 +34,10 @@ func (p *tomlParser) run() { } func (p *tomlParser) peek() *token { - if len(p.tokensBuffer) != 0 { - return &(p.tokensBuffer[0]) - } - - tok, ok := <-p.flow - if !ok { + if p.flowIdx >= len(p.flow) { return nil } - p.tokensBuffer = append(p.tokensBuffer, tok) - return &tok + return &p.flow[p.flowIdx] } func (p *tomlParser) assume(typ tokenType) { @@ -57,16 +51,12 @@ func (p *tomlParser) assume(typ tokenType) { } func (p *tomlParser) getToken() *token { - if len(p.tokensBuffer) != 0 { - tok := p.tokensBuffer[0] - p.tokensBuffer = p.tokensBuffer[1:] - return &tok - } - tok, ok := <-p.flow - if !ok { + tok := p.peek() + if tok == nil { return nil } - return &tok + p.flowIdx++ + return tok } func (p *tomlParser) parseStart() tomlParserStateFn { @@ -374,13 +364,13 @@ func (p *tomlParser) parseArray() interface{} { return array } -func parseToml(flow chan token) *Tree { +func parseToml(flow []token) *Tree { result := newTree() result.position = Position{1, 1} parser := &tomlParser{ + flowIdx: 0, flow: flow, tree: result, - tokensBuffer: make([]token, 0), currentTable: make([]string, 0), seenTableKeys: make([]string, 0), } diff --git a/vendor/github.com/pelletier/go-toml/parser_test.go b/vendor/github.com/pelletier/go-toml/parser_test.go new file mode 100644 index 0000000..508cb65 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/parser_test.go @@ -0,0 +1,785 @@ +package toml + +import ( + "fmt" + "reflect" + "testing" + "time" + + "github.com/davecgh/go-spew/spew" +) + +func assertSubTree(t *testing.T, path []string, tree *Tree, err error, ref map[string]interface{}) { + if err != nil { + t.Error("Non-nil error:", err.Error()) + return + } + for k, v := range ref { + nextPath := append(path, k) + t.Log("asserting path", nextPath) + // NOTE: directly access key instead of resolve by path + // NOTE: see TestSpecialKV + switch node := tree.GetPath([]string{k}).(type) { + case []*Tree: + t.Log("\tcomparing key", nextPath, "by array iteration") + for idx, item := range node { + assertSubTree(t, nextPath, item, err, v.([]map[string]interface{})[idx]) + } + case *Tree: + t.Log("\tcomparing key", nextPath, "by subtree assestion") + assertSubTree(t, nextPath, node, err, v.(map[string]interface{})) + default: + t.Log("\tcomparing key", nextPath, "by string representation because it's of type", reflect.TypeOf(node)) + if fmt.Sprintf("%v", node) != fmt.Sprintf("%v", v) { + t.Errorf("was expecting %v at %v but got %v", v, k, node) + } + } + } +} + +func assertTree(t *testing.T, tree *Tree, err error, ref map[string]interface{}) { + t.Log("Asserting tree:\n", spew.Sdump(tree)) + assertSubTree(t, []string{}, tree, err, ref) + t.Log("Finished tree assertion.") +} + +func TestCreateSubTree(t *testing.T) { + tree := newTree() + tree.createSubTree([]string{"a", "b", "c"}, Position{}) + tree.Set("a.b.c", 42) + if tree.Get("a.b.c") != 42 { + t.Fail() + } +} + +func TestSimpleKV(t *testing.T) { + tree, err := Load("a = 42") + assertTree(t, tree, err, map[string]interface{}{ + "a": int64(42), + }) + + tree, _ = Load("a = 42\nb = 21") + assertTree(t, tree, err, map[string]interface{}{ + "a": int64(42), + "b": int64(21), + }) +} + +func TestNumberInKey(t *testing.T) { + tree, err := Load("hello2 = 42") + assertTree(t, tree, err, map[string]interface{}{ + "hello2": int64(42), + }) +} + +func TestSimpleNumbers(t *testing.T) { + tree, err := Load("a = +42\nb = -21\nc = +4.2\nd = -2.1") + assertTree(t, tree, err, map[string]interface{}{ + "a": int64(42), + "b": int64(-21), + "c": float64(4.2), + "d": float64(-2.1), + }) +} + +func TestNumbersWithUnderscores(t *testing.T) { + tree, err := Load("a = 1_000") + assertTree(t, tree, err, map[string]interface{}{ + "a": int64(1000), + }) + + tree, err = Load("a = 5_349_221") + assertTree(t, tree, err, map[string]interface{}{ + "a": int64(5349221), + }) + + tree, err = Load("a = 1_2_3_4_5") + assertTree(t, tree, err, map[string]interface{}{ + "a": int64(12345), + }) + + tree, err = Load("flt8 = 9_224_617.445_991_228_313") + assertTree(t, tree, err, map[string]interface{}{ + "flt8": float64(9224617.445991228313), + }) + + tree, err = Load("flt9 = 1e1_00") + assertTree(t, tree, err, map[string]interface{}{ + "flt9": float64(1e100), + }) +} + +func TestFloatsWithExponents(t *testing.T) { + tree, err := Load("a = 5e+22\nb = 5E+22\nc = -5e+22\nd = -5e-22\ne = 6.626e-34") + assertTree(t, tree, err, map[string]interface{}{ + "a": float64(5e+22), + "b": float64(5E+22), + "c": float64(-5e+22), + "d": float64(-5e-22), + "e": float64(6.626e-34), + }) +} + +func TestSimpleDate(t *testing.T) { + tree, err := Load("a = 1979-05-27T07:32:00Z") + assertTree(t, tree, err, map[string]interface{}{ + "a": time.Date(1979, time.May, 27, 7, 32, 0, 0, time.UTC), + }) +} + +func TestDateOffset(t *testing.T) { + tree, err := Load("a = 1979-05-27T00:32:00-07:00") + assertTree(t, tree, err, map[string]interface{}{ + "a": time.Date(1979, time.May, 27, 0, 32, 0, 0, time.FixedZone("", -7*60*60)), + }) +} + +func TestDateNano(t *testing.T) { + tree, err := Load("a = 1979-05-27T00:32:00.999999999-07:00") + assertTree(t, tree, err, map[string]interface{}{ + "a": time.Date(1979, time.May, 27, 0, 32, 0, 999999999, time.FixedZone("", -7*60*60)), + }) +} + +func TestSimpleString(t *testing.T) { + tree, err := Load("a = \"hello world\"") + assertTree(t, tree, err, map[string]interface{}{ + "a": "hello world", + }) +} + +func TestSpaceKey(t *testing.T) { + tree, err := Load("\"a b\" = \"hello world\"") + assertTree(t, tree, err, map[string]interface{}{ + "a b": "hello world", + }) +} + +func TestStringEscapables(t *testing.T) { + tree, err := Load("a = \"a \\n b\"") + assertTree(t, tree, err, map[string]interface{}{ + "a": "a \n b", + }) + + tree, err = Load("a = \"a \\t b\"") + assertTree(t, tree, err, map[string]interface{}{ + "a": "a \t b", + }) + + tree, err = Load("a = \"a \\r b\"") + assertTree(t, tree, err, map[string]interface{}{ + "a": "a \r b", + }) + + tree, err = Load("a = \"a \\\\ b\"") + assertTree(t, tree, err, map[string]interface{}{ + "a": "a \\ b", + }) +} + +func TestEmptyQuotedString(t *testing.T) { + tree, err := Load(`[""] +"" = 1`) + assertTree(t, tree, err, map[string]interface{}{ + "": map[string]interface{}{ + "": int64(1), + }, + }) +} + +func TestBools(t *testing.T) { + tree, err := Load("a = true\nb = false") + assertTree(t, tree, err, map[string]interface{}{ + "a": true, + "b": false, + }) +} + +func TestNestedKeys(t *testing.T) { + tree, err := Load("[a.b.c]\nd = 42") + assertTree(t, tree, err, map[string]interface{}{ + "a": map[string]interface{}{ + "b": map[string]interface{}{ + "c": map[string]interface{}{ + "d": int64(42), + }, + }, + }, + }) +} + +func TestNestedQuotedUnicodeKeys(t *testing.T) { + tree, err := Load("[ j . \"ʞ\" . l ]\nd = 42") + assertTree(t, tree, err, map[string]interface{}{ + "j": map[string]interface{}{ + "ʞ": map[string]interface{}{ + "l": map[string]interface{}{ + "d": int64(42), + }, + }, + }, + }) + + tree, err = Load("[ g . h . i ]\nd = 42") + assertTree(t, tree, err, map[string]interface{}{ + "g": map[string]interface{}{ + "h": map[string]interface{}{ + "i": map[string]interface{}{ + "d": int64(42), + }, + }, + }, + }) + + tree, err = Load("[ d.e.f ]\nk = 42") + assertTree(t, tree, err, map[string]interface{}{ + "d": map[string]interface{}{ + "e": map[string]interface{}{ + "f": map[string]interface{}{ + "k": int64(42), + }, + }, + }, + }) +} + +func TestArrayOne(t *testing.T) { + tree, err := Load("a = [1]") + assertTree(t, tree, err, map[string]interface{}{ + "a": []int64{int64(1)}, + }) +} + +func TestArrayZero(t *testing.T) { + tree, err := Load("a = []") + assertTree(t, tree, err, map[string]interface{}{ + "a": []interface{}{}, + }) +} + +func TestArraySimple(t *testing.T) { + tree, err := Load("a = [42, 21, 10]") + assertTree(t, tree, err, map[string]interface{}{ + "a": []int64{int64(42), int64(21), int64(10)}, + }) + + tree, _ = Load("a = [42, 21, 10,]") + assertTree(t, tree, err, map[string]interface{}{ + "a": []int64{int64(42), int64(21), int64(10)}, + }) +} + +func TestArrayMultiline(t *testing.T) { + tree, err := Load("a = [42,\n21, 10,]") + assertTree(t, tree, err, map[string]interface{}{ + "a": []int64{int64(42), int64(21), int64(10)}, + }) +} + +func TestArrayNested(t *testing.T) { + tree, err := Load("a = [[42, 21], [10]]") + assertTree(t, tree, err, map[string]interface{}{ + "a": [][]int64{{int64(42), int64(21)}, {int64(10)}}, + }) +} + +func TestNestedArrayComment(t *testing.T) { + tree, err := Load(` +someArray = [ +# does not work +["entry1"] +]`) + assertTree(t, tree, err, map[string]interface{}{ + "someArray": [][]string{{"entry1"}}, + }) +} + +func TestNestedEmptyArrays(t *testing.T) { + tree, err := Load("a = [[[]]]") + assertTree(t, tree, err, map[string]interface{}{ + "a": [][][]interface{}{{{}}}, + }) +} + +func TestArrayMixedTypes(t *testing.T) { + _, err := Load("a = [42, 16.0]") + if err.Error() != "(1, 10): mixed types in array" { + t.Error("Bad error message:", err.Error()) + } + + _, err = Load("a = [42, \"hello\"]") + if err.Error() != "(1, 11): mixed types in array" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestArrayNestedStrings(t *testing.T) { + tree, err := Load("data = [ [\"gamma\", \"delta\"], [\"Foo\"] ]") + assertTree(t, tree, err, map[string]interface{}{ + "data": [][]string{{"gamma", "delta"}, {"Foo"}}, + }) +} + +func TestParseUnknownRvalue(t *testing.T) { + _, err := Load("a = !bssss") + if err == nil { + t.Error("Expecting a parse error") + } + + _, err = Load("a = /b") + if err == nil { + t.Error("Expecting a parse error") + } +} + +func TestMissingValue(t *testing.T) { + _, err := Load("a = ") + if err.Error() != "(1, 5): expecting a value" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestUnterminatedArray(t *testing.T) { + _, err := Load("a = [1,") + if err.Error() != "(1, 8): unterminated array" { + t.Error("Bad error message:", err.Error()) + } + + _, err = Load("a = [1") + if err.Error() != "(1, 7): unterminated array" { + t.Error("Bad error message:", err.Error()) + } + + _, err = Load("a = [1 2") + if err.Error() != "(1, 8): missing comma" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestNewlinesInArrays(t *testing.T) { + tree, err := Load("a = [1,\n2,\n3]") + assertTree(t, tree, err, map[string]interface{}{ + "a": []int64{int64(1), int64(2), int64(3)}, + }) +} + +func TestArrayWithExtraComma(t *testing.T) { + tree, err := Load("a = [1,\n2,\n3,\n]") + assertTree(t, tree, err, map[string]interface{}{ + "a": []int64{int64(1), int64(2), int64(3)}, + }) +} + +func TestArrayWithExtraCommaComment(t *testing.T) { + tree, err := Load("a = [1, # wow\n2, # such items\n3, # so array\n]") + assertTree(t, tree, err, map[string]interface{}{ + "a": []int64{int64(1), int64(2), int64(3)}, + }) +} + +func TestSimpleInlineGroup(t *testing.T) { + tree, err := Load("key = {a = 42}") + assertTree(t, tree, err, map[string]interface{}{ + "key": map[string]interface{}{ + "a": int64(42), + }, + }) +} + +func TestDoubleInlineGroup(t *testing.T) { + tree, err := Load("key = {a = 42, b = \"foo\"}") + assertTree(t, tree, err, map[string]interface{}{ + "key": map[string]interface{}{ + "a": int64(42), + "b": "foo", + }, + }) +} + +func TestExampleInlineGroup(t *testing.T) { + tree, err := Load(`name = { first = "Tom", last = "Preston-Werner" } +point = { x = 1, y = 2 }`) + assertTree(t, tree, err, map[string]interface{}{ + "name": map[string]interface{}{ + "first": "Tom", + "last": "Preston-Werner", + }, + "point": map[string]interface{}{ + "x": int64(1), + "y": int64(2), + }, + }) +} + +func TestExampleInlineGroupInArray(t *testing.T) { + tree, err := Load(`points = [{ x = 1, y = 2 }]`) + assertTree(t, tree, err, map[string]interface{}{ + "points": []map[string]interface{}{ + { + "x": int64(1), + "y": int64(2), + }, + }, + }) +} + +func TestInlineTableUnterminated(t *testing.T) { + _, err := Load("foo = {") + if err.Error() != "(1, 8): unterminated inline table" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestInlineTableCommaExpected(t *testing.T) { + _, err := Load("foo = {hello = 53 test = foo}") + if err.Error() != "(1, 19): comma expected between fields in inline table" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestInlineTableCommaStart(t *testing.T) { + _, err := Load("foo = {, hello = 53}") + if err.Error() != "(1, 8): inline table cannot start with a comma" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestInlineTableDoubleComma(t *testing.T) { + _, err := Load("foo = {hello = 53,, foo = 17}") + if err.Error() != "(1, 19): need field between two commas in inline table" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestDuplicateGroups(t *testing.T) { + _, err := Load("[foo]\na=2\n[foo]b=3") + if err.Error() != "(3, 2): duplicated tables" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestDuplicateKeys(t *testing.T) { + _, err := Load("foo = 2\nfoo = 3") + if err.Error() != "(2, 1): The following key was defined twice: foo" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestEmptyIntermediateTable(t *testing.T) { + _, err := Load("[foo..bar]") + if err.Error() != "(1, 2): invalid table array key: empty table key" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestImplicitDeclarationBefore(t *testing.T) { + tree, err := Load("[a.b.c]\nanswer = 42\n[a]\nbetter = 43") + assertTree(t, tree, err, map[string]interface{}{ + "a": map[string]interface{}{ + "b": map[string]interface{}{ + "c": map[string]interface{}{ + "answer": int64(42), + }, + }, + "better": int64(43), + }, + }) +} + +func TestFloatsWithoutLeadingZeros(t *testing.T) { + _, err := Load("a = .42") + if err.Error() != "(1, 5): cannot start float with a dot" { + t.Error("Bad error message:", err.Error()) + } + + _, err = Load("a = -.42") + if err.Error() != "(1, 5): cannot start float with a dot" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestMissingFile(t *testing.T) { + _, err := LoadFile("foo.toml") + if err.Error() != "open foo.toml: no such file or directory" && + err.Error() != "open foo.toml: The system cannot find the file specified." { + t.Error("Bad error message:", err.Error()) + } +} + +func TestParseFile(t *testing.T) { + tree, err := LoadFile("example.toml") + + assertTree(t, tree, err, map[string]interface{}{ + "title": "TOML Example", + "owner": map[string]interface{}{ + "name": "Tom Preston-Werner", + "organization": "GitHub", + "bio": "GitHub Cofounder & CEO\nLikes tater tots and beer.", + "dob": time.Date(1979, time.May, 27, 7, 32, 0, 0, time.UTC), + }, + "database": map[string]interface{}{ + "server": "192.168.1.1", + "ports": []int64{8001, 8001, 8002}, + "connection_max": 5000, + "enabled": true, + }, + "servers": map[string]interface{}{ + "alpha": map[string]interface{}{ + "ip": "10.0.0.1", + "dc": "eqdc10", + }, + "beta": map[string]interface{}{ + "ip": "10.0.0.2", + "dc": "eqdc10", + }, + }, + "clients": map[string]interface{}{ + "data": []interface{}{ + []string{"gamma", "delta"}, + []int64{1, 2}, + }, + }, + }) +} + +func TestParseFileCRLF(t *testing.T) { + tree, err := LoadFile("example-crlf.toml") + + assertTree(t, tree, err, map[string]interface{}{ + "title": "TOML Example", + "owner": map[string]interface{}{ + "name": "Tom Preston-Werner", + "organization": "GitHub", + "bio": "GitHub Cofounder & CEO\nLikes tater tots and beer.", + "dob": time.Date(1979, time.May, 27, 7, 32, 0, 0, time.UTC), + }, + "database": map[string]interface{}{ + "server": "192.168.1.1", + "ports": []int64{8001, 8001, 8002}, + "connection_max": 5000, + "enabled": true, + }, + "servers": map[string]interface{}{ + "alpha": map[string]interface{}{ + "ip": "10.0.0.1", + "dc": "eqdc10", + }, + "beta": map[string]interface{}{ + "ip": "10.0.0.2", + "dc": "eqdc10", + }, + }, + "clients": map[string]interface{}{ + "data": []interface{}{ + []string{"gamma", "delta"}, + []int64{1, 2}, + }, + }, + }) +} + +func TestParseKeyGroupArray(t *testing.T) { + tree, err := Load("[[foo.bar]] a = 42\n[[foo.bar]] a = 69") + assertTree(t, tree, err, map[string]interface{}{ + "foo": map[string]interface{}{ + "bar": []map[string]interface{}{ + {"a": int64(42)}, + {"a": int64(69)}, + }, + }, + }) +} + +func TestParseKeyGroupArrayUnfinished(t *testing.T) { + _, err := Load("[[foo.bar]\na = 42") + if err.Error() != "(1, 10): was expecting token [[, but got unclosed table array key instead" { + t.Error("Bad error message:", err.Error()) + } + + _, err = Load("[[foo.[bar]\na = 42") + if err.Error() != "(1, 3): unexpected token table array key cannot contain ']', was expecting a table array key" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestParseKeyGroupArrayQueryExample(t *testing.T) { + tree, err := Load(` + [[book]] + title = "The Stand" + author = "Stephen King" + [[book]] + title = "For Whom the Bell Tolls" + author = "Ernest Hemmingway" + [[book]] + title = "Neuromancer" + author = "William Gibson" + `) + + assertTree(t, tree, err, map[string]interface{}{ + "book": []map[string]interface{}{ + {"title": "The Stand", "author": "Stephen King"}, + {"title": "For Whom the Bell Tolls", "author": "Ernest Hemmingway"}, + {"title": "Neuromancer", "author": "William Gibson"}, + }, + }) +} + +func TestParseKeyGroupArraySpec(t *testing.T) { + tree, err := Load("[[fruit]]\n name=\"apple\"\n [fruit.physical]\n color=\"red\"\n shape=\"round\"\n [[fruit]]\n name=\"banana\"") + assertTree(t, tree, err, map[string]interface{}{ + "fruit": []map[string]interface{}{ + {"name": "apple", "physical": map[string]interface{}{"color": "red", "shape": "round"}}, + {"name": "banana"}, + }, + }) +} + +func TestTomlValueStringRepresentation(t *testing.T) { + for idx, item := range []struct { + Value interface{} + Expect string + }{ + {int64(12345), "12345"}, + {uint64(50), "50"}, + {float64(123.45), "123.45"}, + {bool(true), "true"}, + {"hello world", "\"hello world\""}, + {"\b\t\n\f\r\"\\", "\"\\b\\t\\n\\f\\r\\\"\\\\\""}, + {"\x05", "\"\\u0005\""}, + {time.Date(1979, time.May, 27, 7, 32, 0, 0, time.UTC), + "1979-05-27T07:32:00Z"}, + {[]interface{}{"gamma", "delta"}, + "[\"gamma\",\"delta\"]"}, + {nil, ""}, + } { + result, err := tomlValueStringRepresentation(item.Value) + if err != nil { + t.Errorf("Test %d - unexpected error: %s", idx, err) + } + if result != item.Expect { + t.Errorf("Test %d - got '%s', expected '%s'", idx, result, item.Expect) + } + } +} + +func TestToStringMapStringString(t *testing.T) { + tree, err := TreeFromMap(map[string]interface{}{"m": map[string]interface{}{"v": "abc"}}) + if err != nil { + t.Fatalf("unexpected error: %s", err) + } + want := "\n[m]\n v = \"abc\"\n" + got := tree.String() + + if got != want { + t.Errorf("want:\n%q\ngot:\n%q", want, got) + } +} + +func assertPosition(t *testing.T, text string, ref map[string]Position) { + tree, err := Load(text) + if err != nil { + t.Errorf("Error loading document text: `%v`", text) + t.Errorf("Error: %v", err) + } + for path, pos := range ref { + testPos := tree.GetPosition(path) + if testPos.Invalid() { + t.Errorf("Failed to query tree path or path has invalid position: %s", path) + } else if pos != testPos { + t.Errorf("Expected position %v, got %v instead", pos, testPos) + } + } +} + +func TestDocumentPositions(t *testing.T) { + assertPosition(t, + "[foo]\nbar=42\nbaz=69", + map[string]Position{ + "": {1, 1}, + "foo": {1, 1}, + "foo.bar": {2, 1}, + "foo.baz": {3, 1}, + }) +} + +func TestDocumentPositionsWithSpaces(t *testing.T) { + assertPosition(t, + " [foo]\n bar=42\n baz=69", + map[string]Position{ + "": {1, 1}, + "foo": {1, 3}, + "foo.bar": {2, 3}, + "foo.baz": {3, 3}, + }) +} + +func TestDocumentPositionsWithGroupArray(t *testing.T) { + assertPosition(t, + "[[foo]]\nbar=42\nbaz=69", + map[string]Position{ + "": {1, 1}, + "foo": {1, 1}, + "foo.bar": {2, 1}, + "foo.baz": {3, 1}, + }) +} + +func TestNestedTreePosition(t *testing.T) { + assertPosition(t, + "[foo.bar]\na=42\nb=69", + map[string]Position{ + "": {1, 1}, + "foo": {1, 1}, + "foo.bar": {1, 1}, + "foo.bar.a": {2, 1}, + "foo.bar.b": {3, 1}, + }) +} + +func TestInvalidGroupArray(t *testing.T) { + _, err := Load("[table#key]\nanswer = 42") + if err == nil { + t.Error("Should error") + } + + _, err = Load("[foo.[bar]\na = 42") + if err.Error() != "(1, 2): unexpected token table key cannot contain ']', was expecting a table key" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestDoubleEqual(t *testing.T) { + _, err := Load("foo= = 2") + if err.Error() != "(1, 6): cannot have multiple equals for the same key" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestGroupArrayReassign(t *testing.T) { + _, err := Load("[hello]\n[[hello]]") + if err.Error() != "(2, 3): key \"hello\" is already assigned and not of type table array" { + t.Error("Bad error message:", err.Error()) + } +} + +func TestInvalidFloatParsing(t *testing.T) { + _, err := Load("a=1e_2") + if err.Error() != "(1, 3): invalid use of _ in number" { + t.Error("Bad error message:", err.Error()) + } + + _, err = Load("a=1e2_") + if err.Error() != "(1, 3): invalid use of _ in number" { + t.Error("Bad error message:", err.Error()) + } + + _, err = Load("a=1__2") + if err.Error() != "(1, 3): invalid use of _ in number" { + t.Error("Bad error message:", err.Error()) + } + + _, err = Load("a=_1_2") + if err.Error() != "(1, 3): cannot start number with underscore" { + t.Error("Bad error message:", err.Error()) + } +} diff --git a/_vendor/vendor/github.com/pelletier/go-toml/position.go b/vendor/github.com/pelletier/go-toml/position.go similarity index 100% rename from _vendor/vendor/github.com/pelletier/go-toml/position.go rename to vendor/github.com/pelletier/go-toml/position.go diff --git a/vendor/github.com/pelletier/go-toml/position_test.go b/vendor/github.com/pelletier/go-toml/position_test.go new file mode 100644 index 0000000..63ad1af --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/position_test.go @@ -0,0 +1,29 @@ +// Testing support for go-toml + +package toml + +import ( + "testing" +) + +func TestPositionString(t *testing.T) { + p := Position{123, 456} + expected := "(123, 456)" + value := p.String() + + if value != expected { + t.Errorf("Expected %v, got %v instead", expected, value) + } +} + +func TestInvalid(t *testing.T) { + for i, v := range []Position{ + {0, 1234}, + {1234, 0}, + {0, 0}, + } { + if !v.Invalid() { + t.Errorf("Position at %v is valid: %v", i, v) + } + } +} diff --git a/vendor/github.com/pelletier/go-toml/test.sh b/vendor/github.com/pelletier/go-toml/test.sh new file mode 100755 index 0000000..91a8896 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/test.sh @@ -0,0 +1,90 @@ +#!/bin/bash +# fail out of the script if anything here fails +set -e + +# set the path to the present working directory +export GOPATH=`pwd` + +function git_clone() { + path=$1 + branch=$2 + version=$3 + if [ ! -d "src/$path" ]; then + mkdir -p src/$path + git clone https://$path.git src/$path + fi + pushd src/$path + git checkout "$branch" + git reset --hard "$version" + popd +} + +# Remove potential previous runs +rm -rf src test_program_bin toml-test + +# Run go vet +go vet ./... + +go get github.com/pelletier/go-buffruneio +go get github.com/davecgh/go-spew/spew +go get gopkg.in/yaml.v2 +go get github.com/BurntSushi/toml + +# get code for BurntSushi TOML validation +# pinning all to 'HEAD' for version 0.3.x work (TODO: pin to commit hash when tests stabilize) +git_clone github.com/BurntSushi/toml master HEAD +git_clone github.com/BurntSushi/toml-test master HEAD #was: 0.2.0 HEAD + +# build the BurntSushi test application +go build -o toml-test github.com/BurntSushi/toml-test + +# vendorize the current lib for testing +# NOTE: this basically mocks an install without having to go back out to github for code +mkdir -p src/github.com/pelletier/go-toml/cmd +mkdir -p src/github.com/pelletier/go-toml/query +cp *.go *.toml src/github.com/pelletier/go-toml +cp -R cmd/* src/github.com/pelletier/go-toml/cmd +cp -R query/* src/github.com/pelletier/go-toml/query +go build -o test_program_bin src/github.com/pelletier/go-toml/cmd/test_program.go + +# Run basic unit tests +go test github.com/pelletier/go-toml -covermode=count -coverprofile=coverage.out +go test github.com/pelletier/go-toml/cmd/tomljson +go test github.com/pelletier/go-toml/query + +# run the entire BurntSushi test suite +if [[ $# -eq 0 ]] ; then + echo "Running all BurntSushi tests" + ./toml-test ./test_program_bin | tee test_out +else + # run a specific test + test=$1 + test_path='src/github.com/BurntSushi/toml-test/tests' + valid_test="$test_path/valid/$test" + invalid_test="$test_path/invalid/$test" + + if [ -e "$valid_test.toml" ]; then + echo "Valid Test TOML for $test:" + echo "====" + cat "$valid_test.toml" + + echo "Valid Test JSON for $test:" + echo "====" + cat "$valid_test.json" + + echo "Go-TOML Output for $test:" + echo "====" + cat "$valid_test.toml" | ./test_program_bin + fi + + if [ -e "$invalid_test.toml" ]; then + echo "Invalid Test TOML for $test:" + echo "====" + cat "$invalid_test.toml" + + echo "Go-TOML Output for $test:" + echo "====" + echo "go-toml Output:" + cat "$invalid_test.toml" | ./test_program_bin + fi +fi diff --git a/_vendor/vendor/github.com/pelletier/go-toml/token.go b/vendor/github.com/pelletier/go-toml/token.go similarity index 100% rename from _vendor/vendor/github.com/pelletier/go-toml/token.go rename to vendor/github.com/pelletier/go-toml/token.go diff --git a/vendor/github.com/pelletier/go-toml/token_test.go b/vendor/github.com/pelletier/go-toml/token_test.go new file mode 100644 index 0000000..20b560d --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/token_test.go @@ -0,0 +1,67 @@ +package toml + +import "testing" + +func TestTokenStringer(t *testing.T) { + var tests = []struct { + tt tokenType + expect string + }{ + {tokenError, "Error"}, + {tokenEOF, "EOF"}, + {tokenComment, "Comment"}, + {tokenKey, "Key"}, + {tokenString, "String"}, + {tokenInteger, "Integer"}, + {tokenTrue, "True"}, + {tokenFalse, "False"}, + {tokenFloat, "Float"}, + {tokenEqual, "="}, + {tokenLeftBracket, "["}, + {tokenRightBracket, "]"}, + {tokenLeftCurlyBrace, "{"}, + {tokenRightCurlyBrace, "}"}, + {tokenLeftParen, "("}, + {tokenRightParen, ")"}, + {tokenDoubleLeftBracket, "]]"}, + {tokenDoubleRightBracket, "[["}, + {tokenDate, "Date"}, + {tokenKeyGroup, "KeyGroup"}, + {tokenKeyGroupArray, "KeyGroupArray"}, + {tokenComma, ","}, + {tokenColon, ":"}, + {tokenDollar, "$"}, + {tokenStar, "*"}, + {tokenQuestion, "?"}, + {tokenDot, "."}, + {tokenDotDot, ".."}, + {tokenEOL, "EOL"}, + {tokenEOL + 1, "Unknown"}, + } + + for i, test := range tests { + got := test.tt.String() + if got != test.expect { + t.Errorf("[%d] invalid string of token type; got %q, expected %q", i, got, test.expect) + } + } +} + +func TestTokenString(t *testing.T) { + var tests = []struct { + tok token + expect string + }{ + {token{Position{1, 1}, tokenEOF, ""}, "EOF"}, + {token{Position{1, 1}, tokenError, "Δt"}, "Δt"}, + {token{Position{1, 1}, tokenString, "bar"}, `"bar"`}, + {token{Position{1, 1}, tokenString, "123456789012345"}, `"123456789012345"`}, + } + + for i, test := range tests { + got := test.tok.String() + if got != test.expect { + t.Errorf("[%d] invalid of string token; got %q, expected %q", i, got, test.expect) + } + } +} diff --git a/_vendor/vendor/github.com/pelletier/go-toml/toml.go b/vendor/github.com/pelletier/go-toml/toml.go similarity index 95% rename from _vendor/vendor/github.com/pelletier/go-toml/toml.go rename to vendor/github.com/pelletier/go-toml/toml.go index 2d2f640..64f19ed 100644 --- a/_vendor/vendor/github.com/pelletier/go-toml/toml.go +++ b/vendor/github.com/pelletier/go-toml/toml.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "io" + "io/ioutil" "os" "runtime" "strings" @@ -251,8 +252,8 @@ func (t *Tree) createSubTree(keys []string, pos Position) error { return nil } -// LoadReader creates a Tree from any io.Reader. -func LoadReader(reader io.Reader) (tree *Tree, err error) { +// LoadBytes creates a Tree from a []byte. +func LoadBytes(b []byte) (tree *Tree, err error) { defer func() { if r := recover(); r != nil { if _, ok := r.(runtime.Error); ok { @@ -261,13 +262,23 @@ func LoadReader(reader io.Reader) (tree *Tree, err error) { err = errors.New(r.(string)) } }() - tree = parseToml(lexToml(reader)) + tree = parseToml(lexToml(b)) + return +} + +// LoadReader creates a Tree from any io.Reader. +func LoadReader(reader io.Reader) (tree *Tree, err error) { + inputBytes, err := ioutil.ReadAll(reader) + if err != nil { + return + } + tree, err = LoadBytes(inputBytes) return } // Load creates a Tree from a string. func Load(content string) (tree *Tree, err error) { - return LoadReader(strings.NewReader(content)) + return LoadBytes([]byte(content)) } // LoadFile creates a Tree from a file. diff --git a/vendor/github.com/pelletier/go-toml/toml_test.go b/vendor/github.com/pelletier/go-toml/toml_test.go new file mode 100644 index 0000000..ab9c242 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/toml_test.go @@ -0,0 +1,106 @@ +// Testing support for go-toml + +package toml + +import ( + "testing" +) + +func TestTomlHas(t *testing.T) { + tree, _ := Load(` + [test] + key = "value" + `) + + if !tree.Has("test.key") { + t.Errorf("Has - expected test.key to exists") + } + + if tree.Has("") { + t.Errorf("Should return false if the key is not provided") + } +} + +func TestTomlGet(t *testing.T) { + tree, _ := Load(` + [test] + key = "value" + `) + + if tree.Get("") != tree { + t.Errorf("Get should return the tree itself when given an empty path") + } + + if tree.Get("test.key") != "value" { + t.Errorf("Get should return the value") + } + if tree.Get(`\`) != nil { + t.Errorf("should return nil when the key is malformed") + } +} + +func TestTomlGetDefault(t *testing.T) { + tree, _ := Load(` + [test] + key = "value" + `) + + if tree.GetDefault("", "hello") != tree { + t.Error("GetDefault should return the tree itself when given an empty path") + } + + if tree.GetDefault("test.key", "hello") != "value" { + t.Error("Get should return the value") + } + + if tree.GetDefault("whatever", "hello") != "hello" { + t.Error("GetDefault should return the default value if the key does not exist") + } +} + +func TestTomlHasPath(t *testing.T) { + tree, _ := Load(` + [test] + key = "value" + `) + + if !tree.HasPath([]string{"test", "key"}) { + t.Errorf("HasPath - expected test.key to exists") + } +} + +func TestTomlGetPath(t *testing.T) { + node := newTree() + //TODO: set other node data + + for idx, item := range []struct { + Path []string + Expected *Tree + }{ + { // empty path test + []string{}, + node, + }, + } { + result := node.GetPath(item.Path) + if result != item.Expected { + t.Errorf("GetPath[%d] %v - expected %v, got %v instead.", idx, item.Path, item.Expected, result) + } + } + + tree, _ := Load("[foo.bar]\na=1\nb=2\n[baz.foo]\na=3\nb=4\n[gorf.foo]\na=5\nb=6") + if tree.GetPath([]string{"whatever"}) != nil { + t.Error("GetPath should return nil when the key does not exist") + } +} + +func TestTomlFromMap(t *testing.T) { + simpleMap := map[string]interface{}{"hello": 42} + tree, err := TreeFromMap(simpleMap) + if err != nil { + t.Fatal("unexpected error:", err) + } + if tree.Get("hello") != int64(42) { + t.Fatal("hello should be 42, not", tree.Get("hello")) + } +} diff --git a/_vendor/vendor/github.com/pelletier/go-toml/tomltree_create.go b/vendor/github.com/pelletier/go-toml/tomltree_create.go similarity index 100% rename from _vendor/vendor/github.com/pelletier/go-toml/tomltree_create.go rename to vendor/github.com/pelletier/go-toml/tomltree_create.go diff --git a/vendor/github.com/pelletier/go-toml/tomltree_create_test.go b/vendor/github.com/pelletier/go-toml/tomltree_create_test.go new file mode 100644 index 0000000..1ca108a --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/tomltree_create_test.go @@ -0,0 +1,126 @@ +package toml + +import ( + "strconv" + "testing" + "time" +) + +type customString string + +type stringer struct{} + +func (s stringer) String() string { + return "stringer" +} + +func validate(t *testing.T, path string, object interface{}) { + switch o := object.(type) { + case *Tree: + for key, tree := range o.values { + validate(t, path+"."+key, tree) + } + case []*Tree: + for index, tree := range o { + validate(t, path+"."+strconv.Itoa(index), tree) + } + case *tomlValue: + switch o.value.(type) { + case int64, uint64, bool, string, float64, time.Time, + []int64, []uint64, []bool, []string, []float64, []time.Time: + default: + t.Fatalf("tomlValue at key %s containing incorrect type %T", path, o.value) + } + default: + t.Fatalf("value at key %s is of incorrect type %T", path, object) + } + t.Logf("validation ok %s as %T", path, object) +} + +func validateTree(t *testing.T, tree *Tree) { + validate(t, "", tree) +} + +func TestTreeCreateToTree(t *testing.T) { + data := map[string]interface{}{ + "a_string": "bar", + "an_int": 42, + "time": time.Now(), + "int8": int8(2), + "int16": int16(2), + "int32": int32(2), + "uint8": uint8(2), + "uint16": uint16(2), + "uint32": uint32(2), + "float32": float32(2), + "a_bool": false, + "stringer": stringer{}, + "nested": map[string]interface{}{ + "foo": "bar", + }, + "array": []string{"a", "b", "c"}, + "array_uint": []uint{uint(1), uint(2)}, + "array_table": []map[string]interface{}{map[string]interface{}{"sub_map": 52}}, + "array_times": []time.Time{time.Now(), time.Now()}, + "map_times": map[string]time.Time{"now": time.Now()}, + "custom_string_map_key": map[customString]interface{}{customString("custom"): "custom"}, + } + tree, err := TreeFromMap(data) + if err != nil { + t.Fatal("unexpected error:", err) + } + validateTree(t, tree) +} + +func TestTreeCreateToTreeInvalidLeafType(t *testing.T) { + _, err := TreeFromMap(map[string]interface{}{"foo": t}) + expected := "cannot convert type *testing.T to Tree" + if err.Error() != expected { + t.Fatalf("expected error %s, got %s", expected, err.Error()) + } +} + +func TestTreeCreateToTreeInvalidMapKeyType(t *testing.T) { + _, err := TreeFromMap(map[string]interface{}{"foo": map[int]interface{}{2: 1}}) + expected := "map key needs to be a string, not int (int)" + if err.Error() != expected { + t.Fatalf("expected error %s, got %s", expected, err.Error()) + } +} + +func TestTreeCreateToTreeInvalidArrayMemberType(t *testing.T) { + _, err := TreeFromMap(map[string]interface{}{"foo": []*testing.T{t}}) + expected := "cannot convert type *testing.T to Tree" + if err.Error() != expected { + t.Fatalf("expected error %s, got %s", expected, err.Error()) + } +} + +func TestTreeCreateToTreeInvalidTableGroupType(t *testing.T) { + _, err := TreeFromMap(map[string]interface{}{"foo": []map[string]interface{}{map[string]interface{}{"hello": t}}}) + expected := "cannot convert type *testing.T to Tree" + if err.Error() != expected { + t.Fatalf("expected error %s, got %s", expected, err.Error()) + } +} + +func TestRoundTripArrayOfTables(t *testing.T) { + orig := "\n[[stuff]]\n name = \"foo\"\n things = [\"a\",\"b\"]\n" + tree, err := Load(orig) + if err != nil { + t.Fatalf("unexpected error: %s", err) + } + + m := tree.ToMap() + + tree, err = TreeFromMap(m) + if err != nil { + t.Fatalf("unexpected error: %s", err) + } + want := orig + got := tree.String() + + if got != want { + t.Errorf("want:\n%s\ngot:\n%s", want, got) + } +} diff --git a/_vendor/vendor/github.com/pelletier/go-toml/tomltree_write.go b/vendor/github.com/pelletier/go-toml/tomltree_write.go similarity index 92% rename from _vendor/vendor/github.com/pelletier/go-toml/tomltree_write.go rename to vendor/github.com/pelletier/go-toml/tomltree_write.go index cd03f9d..ca763ed 100644 --- a/_vendor/vendor/github.com/pelletier/go-toml/tomltree_write.go +++ b/vendor/github.com/pelletier/go-toml/tomltree_write.go @@ -118,8 +118,7 @@ func (t *Tree) writeTo(w io.Writer, indent, keyspace string, bytesCount int64) ( return bytesCount, err } - kvRepr := indent + k + " = " + repr + "\n" - writtenBytesCount, err := w.Write([]byte(kvRepr)) + writtenBytesCount, err := writeStrings(w, indent, k, " = ", repr, "\n") bytesCount += int64(writtenBytesCount) if err != nil { return bytesCount, err @@ -137,8 +136,7 @@ func (t *Tree) writeTo(w io.Writer, indent, keyspace string, bytesCount int64) ( switch node := v.(type) { // node has to be of those two types given how keys are sorted above case *Tree: - tableName := "\n" + indent + "[" + combinedKey + "]\n" - writtenBytesCount, err := w.Write([]byte(tableName)) + writtenBytesCount, err := writeStrings(w, "\n", indent, "[", combinedKey, "]\n") bytesCount += int64(writtenBytesCount) if err != nil { return bytesCount, err @@ -149,8 +147,7 @@ func (t *Tree) writeTo(w io.Writer, indent, keyspace string, bytesCount int64) ( } case []*Tree: for _, subTree := range node { - tableArrayName := "\n" + indent + "[[" + combinedKey + "]]\n" - writtenBytesCount, err := w.Write([]byte(tableArrayName)) + writtenBytesCount, err := writeStrings(w, "\n", indent, "[[", combinedKey, "]]\n") bytesCount += int64(writtenBytesCount) if err != nil { return bytesCount, err @@ -167,6 +164,18 @@ func (t *Tree) writeTo(w io.Writer, indent, keyspace string, bytesCount int64) ( return bytesCount, nil } +func writeStrings(w io.Writer, s ...string) (int, error) { + var n int + for i := range s { + b, err := io.WriteString(w, s[i]) + n += b + if err != nil { + return n, err + } + } + return n, nil +} + // WriteTo encode the Tree as Toml and writes it to the writer w. // Returns the number of bytes written in case of success, or an error if anything happened. func (t *Tree) WriteTo(w io.Writer) (int64, error) { diff --git a/vendor/github.com/pelletier/go-toml/tomltree_write_test.go b/vendor/github.com/pelletier/go-toml/tomltree_write_test.go new file mode 100644 index 0000000..c2a1ce3 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/tomltree_write_test.go @@ -0,0 +1,358 @@ +package toml + +import ( + "bytes" + "errors" + "fmt" + "reflect" + "strings" + "testing" + "time" +) + +type failingWriter struct { + failAt int + written int + buffer bytes.Buffer +} + +func (f *failingWriter) Write(p []byte) (n int, err error) { + count := len(p) + toWrite := f.failAt - (count + f.written) + if toWrite < 0 { + toWrite = 0 + } + if toWrite > count { + f.written += count + f.buffer.Write(p) + return count, nil + } + + f.buffer.Write(p[:toWrite]) + f.written = f.failAt + return toWrite, fmt.Errorf("failingWriter failed after writting %d bytes", f.written) +} + +func assertErrorString(t *testing.T, expected string, err error) { + expectedErr := errors.New(expected) + if err == nil || err.Error() != expectedErr.Error() { + t.Errorf("expecting error %s, but got %s instead", expected, err) + } +} + +func TestTreeWriteToEmptyTable(t *testing.T) { + doc := `[[empty-tables]] +[[empty-tables]]` + + toml, err := Load(doc) + if err != nil { + t.Fatal("Unexpected Load error:", err) + } + tomlString, err := toml.ToTomlString() + if err != nil { + t.Fatal("Unexpected ToTomlString error:", err) + } + + expected := ` +[[empty-tables]] + +[[empty-tables]] +` + + if tomlString != expected { + t.Fatalf("Expected:\n%s\nGot:\n%s", expected, tomlString) + } +} + +func TestTreeWriteToTomlString(t *testing.T) { + toml, err := Load(`name = { first = "Tom", last = "Preston-Werner" } +points = { x = 1, y = 2 }`) + + if err != nil { + t.Fatal("Unexpected error:", err) + } + + tomlString, _ := toml.ToTomlString() + reparsedTree, err := Load(tomlString) + + assertTree(t, reparsedTree, err, map[string]interface{}{ + "name": map[string]interface{}{ + "first": "Tom", + "last": "Preston-Werner", + }, + "points": map[string]interface{}{ + "x": int64(1), + "y": int64(2), + }, + }) +} + +func TestTreeWriteToTomlStringSimple(t *testing.T) { + tree, err := Load("[foo]\n\n[[foo.bar]]\na = 42\n\n[[foo.bar]]\na = 69\n") + if err != nil { + t.Errorf("Test failed to parse: %v", err) + return + } + result, err := tree.ToTomlString() + if err != nil { + t.Errorf("Unexpected error: %s", err) + } + expected := "\n[foo]\n\n [[foo.bar]]\n a = 42\n\n [[foo.bar]]\n a = 69\n" + if result != expected { + t.Errorf("Expected got '%s', expected '%s'", result, expected) + } +} + +func TestTreeWriteToTomlStringKeysOrders(t *testing.T) { + for i := 0; i < 100; i++ { + tree, _ := Load(` + foobar = true + bar = "baz" + foo = 1 + [qux] + foo = 1 + bar = "baz2"`) + + stringRepr, _ := tree.ToTomlString() + + t.Log("Intermediate string representation:") + t.Log(stringRepr) + + r := strings.NewReader(stringRepr) + toml, err := LoadReader(r) + + if err != nil { + t.Fatal("Unexpected error:", err) + } + + assertTree(t, toml, err, map[string]interface{}{ + "foobar": true, + "bar": "baz", + "foo": 1, + "qux": map[string]interface{}{ + "foo": 1, + "bar": "baz2", + }, + }) + } +} + +func testMaps(t *testing.T, actual, expected map[string]interface{}) { + if !reflect.DeepEqual(actual, expected) { + t.Fatal("trees aren't equal.\n", "Expected:\n", expected, "\nActual:\n", actual) + } +} + +func TestTreeWriteToMapSimple(t *testing.T) { + tree, _ := Load("a = 42\nb = 17") + + expected := map[string]interface{}{ + "a": int64(42), + "b": int64(17), + } + + testMaps(t, tree.ToMap(), expected) +} + +func TestTreeWriteToInvalidTreeSimpleValue(t *testing.T) { + tree := Tree{values: map[string]interface{}{"foo": int8(1)}} + _, err := tree.ToTomlString() + assertErrorString(t, "invalid value type at foo: int8", err) +} + +func TestTreeWriteToInvalidTreeTomlValue(t *testing.T) { + tree := Tree{values: map[string]interface{}{"foo": &tomlValue{int8(1), Position{}}}} + _, err := tree.ToTomlString() + assertErrorString(t, "unsupported value type int8: 1", err) +} + +func TestTreeWriteToInvalidTreeTomlValueArray(t *testing.T) { + tree := Tree{values: map[string]interface{}{"foo": &tomlValue{[]interface{}{int8(1)}, Position{}}}} + _, err := tree.ToTomlString() + assertErrorString(t, "unsupported value type int8: 1", err) +} + +func TestTreeWriteToFailingWriterInSimpleValue(t *testing.T) { + toml, _ := Load(`a = 2`) + writer := failingWriter{failAt: 0, written: 0} + _, err := toml.WriteTo(&writer) + assertErrorString(t, "failingWriter failed after writting 0 bytes", err) +} + +func TestTreeWriteToFailingWriterInTable(t *testing.T) { + toml, _ := Load(` +[b] +a = 2`) + writer := failingWriter{failAt: 2, written: 0} + _, err := toml.WriteTo(&writer) + assertErrorString(t, "failingWriter failed after writting 2 bytes", err) + + writer = failingWriter{failAt: 13, written: 0} + _, err = toml.WriteTo(&writer) + assertErrorString(t, "failingWriter failed after writting 13 bytes", err) +} + +func TestTreeWriteToFailingWriterInArray(t *testing.T) { + toml, _ := Load(` +[[b]] +a = 2`) + writer := failingWriter{failAt: 2, written: 0} + _, err := toml.WriteTo(&writer) + assertErrorString(t, "failingWriter failed after writting 2 bytes", err) + + writer = failingWriter{failAt: 15, written: 0} + _, err = toml.WriteTo(&writer) + assertErrorString(t, "failingWriter failed after writting 15 bytes", err) +} + +func TestTreeWriteToMapExampleFile(t *testing.T) { + tree, _ := LoadFile("example.toml") + expected := map[string]interface{}{ + "title": "TOML Example", + "owner": map[string]interface{}{ + "name": "Tom Preston-Werner", + "organization": "GitHub", + "bio": "GitHub Cofounder & CEO\nLikes tater tots and beer.", + "dob": time.Date(1979, time.May, 27, 7, 32, 0, 0, time.UTC), + }, + "database": map[string]interface{}{ + "server": "192.168.1.1", + "ports": []interface{}{int64(8001), int64(8001), int64(8002)}, + "connection_max": int64(5000), + "enabled": true, + }, + "servers": map[string]interface{}{ + "alpha": map[string]interface{}{ + "ip": "10.0.0.1", + "dc": "eqdc10", + }, + "beta": map[string]interface{}{ + "ip": "10.0.0.2", + "dc": "eqdc10", + }, + }, + "clients": map[string]interface{}{ + "data": []interface{}{ + []interface{}{"gamma", "delta"}, + []interface{}{int64(1), int64(2)}, + }, + }, + } + testMaps(t, tree.ToMap(), expected) +} + +func TestTreeWriteToMapWithTablesInMultipleChunks(t *testing.T) { + tree, _ := Load(` + [[menu.main]] + a = "menu 1" + b = "menu 2" + [[menu.main]] + c = "menu 3" + d = "menu 4"`) + expected := map[string]interface{}{ + "menu": map[string]interface{}{ + "main": []interface{}{ + map[string]interface{}{"a": "menu 1", "b": "menu 2"}, + map[string]interface{}{"c": "menu 3", "d": "menu 4"}, + }, + }, + } + treeMap := tree.ToMap() + + testMaps(t, treeMap, expected) +} + +func TestTreeWriteToMapWithArrayOfInlineTables(t *testing.T) { + tree, _ := Load(` + [params] + language_tabs = [ + { key = "shell", name = "Shell" }, + { key = "ruby", name = "Ruby" }, + { key = "python", name = "Python" } + ]`) + + expected := map[string]interface{}{ + "params": map[string]interface{}{ + "language_tabs": []interface{}{ + map[string]interface{}{ + "key": "shell", + "name": "Shell", + }, + map[string]interface{}{ + "key": "ruby", + "name": "Ruby", + }, + map[string]interface{}{ + "key": "python", + "name": "Python", + }, + }, + }, + } + + treeMap := tree.ToMap() + testMaps(t, treeMap, expected) +} + +func TestTreeWriteToFloat(t *testing.T) { + tree, err := Load(`a = 3.0`) + if err != nil { + t.Fatal(err) + } + str, err := tree.ToTomlString() + if err != nil { + t.Fatal(err) + } + expected := `a = 3.0` + if strings.TrimSpace(str) != strings.TrimSpace(expected) { + t.Fatalf("Expected:\n%s\nGot:\n%s", expected, str) + } +} + +func BenchmarkTreeToTomlString(b *testing.B) { + toml, err := Load(sampleHard) + if err != nil { + b.Fatal("Unexpected error:", err) + } + + for i := 0; i < b.N; i++ { + _, err := toml.ToTomlString() + if err != nil { + b.Fatal(err) + } + } +} + +var sampleHard = `# Test file for TOML +# Only this one tries to emulate a TOML file written by a user of the kind of parser writers probably hate +# This part you'll really hate + +[the] +test_string = "You'll hate me after this - #" # " Annoying, isn't it? + + [the.hard] + test_array = [ "] ", " # "] # ] There you go, parse this! + test_array2 = [ "Test #11 ]proved that", "Experiment #9 was a success" ] + # You didn't think it'd as easy as chucking out the last #, did you? + another_test_string = " Same thing, but with a string #" + harder_test_string = " And when \"'s are in the string, along with # \"" # "and comments are there too" + # Things will get harder + + [the.hard."bit#"] + "what?" = "You don't think some user won't do that?" + multi_line_array = [ + "]", + # ] Oh yes I did + ] + +# Each of the following keygroups/key value pairs should produce an error. Uncomment to them to test + +#[error] if you didn't catch this, your parser is broken +#string = "Anything other than tabs, spaces and newline after a keygroup or key value pair has ended should produce an error unless it is a comment" like this +#array = [ +# "This might most likely happen in multiline arrays", +# Like here, +# "or here, +# and here" +# ] End of array comment, forgot the # +#number = 3.14 pi <--again forgot the # ` diff --git a/_vendor/vendor/github.com/peterh/liner/COPYING b/vendor/github.com/peterh/liner/COPYING similarity index 100% rename from _vendor/vendor/github.com/peterh/liner/COPYING rename to vendor/github.com/peterh/liner/COPYING diff --git a/vendor/github.com/peterh/liner/README.md b/vendor/github.com/peterh/liner/README.md new file mode 100644 index 0000000..9148b24 --- /dev/null +++ b/vendor/github.com/peterh/liner/README.md @@ -0,0 +1,100 @@ +Liner +===== + +Liner is a command line editor with history. It was inspired by linenoise; +everything Unix-like is a VT100 (or is trying very hard to be). If your +terminal is not pretending to be a VT100, change it. Liner also support +Windows. + +Liner is released under the X11 license (which is similar to the new BSD +license). + +Line Editing +------------ + +The following line editing commands are supported on platforms and terminals +that Liner supports: + +Keystroke | Action +--------- | ------ +Ctrl-A, Home | Move cursor to beginning of line +Ctrl-E, End | Move cursor to end of line +Ctrl-B, Left | Move cursor one character left +Ctrl-F, Right| Move cursor one character right +Ctrl-Left, Alt-B | Move cursor to previous word +Ctrl-Right, Alt-F | Move cursor to next word +Ctrl-D, Del | (if line is *not* empty) Delete character under cursor +Ctrl-D | (if line *is* empty) End of File - usually quits application +Ctrl-C | Reset input (create new empty prompt) +Ctrl-L | Clear screen (line is unmodified) +Ctrl-T | Transpose previous character with current character +Ctrl-H, BackSpace | Delete character before cursor +Ctrl-W | Delete word leading up to cursor +Ctrl-K | Delete from cursor to end of line +Ctrl-U | Delete from start of line to cursor +Ctrl-P, Up | Previous match from history +Ctrl-N, Down | Next match from history +Ctrl-R | Reverse Search history (Ctrl-S forward, Ctrl-G cancel) +Ctrl-Y | Paste from Yank buffer (Alt-Y to paste next yank instead) +Tab | Next completion +Shift-Tab | (after Tab) Previous completion + +Getting started +----------------- + +```go +package main + +import ( + "log" + "os" + "path/filepath" + "strings" + + "github.com/peterh/liner" +) + +var ( + history_fn = filepath.Join(os.TempDir(), ".liner_example_history") + names = []string{"john", "james", "mary", "nancy"} +) + +func main() { + line := liner.NewLiner() + defer line.Close() + + line.SetCtrlCAborts(true) + + line.SetCompleter(func(line string) (c []string) { + for _, n := range names { + if strings.HasPrefix(n, strings.ToLower(line)) { + c = append(c, n) + } + } + return + }) + + if f, err := os.Open(history_fn); err == nil { + line.ReadHistory(f) + f.Close() + } + + if name, err := line.Prompt("What is your name? "); err == nil { + log.Print("Got: ", name) + line.AppendHistory(name) + } else if err == liner.ErrPromptAborted { + log.Print("Aborted") + } else { + log.Print("Error reading line: ", err) + } + + if f, err := os.Create(history_fn); err != nil { + log.Print("Error writing history file: ", err) + } else { + line.WriteHistory(f) + f.Close() + } +} +``` + +For documentation, see http://godoc.org/github.com/peterh/liner diff --git a/_vendor/vendor/github.com/peterh/liner/bsdinput.go b/vendor/github.com/peterh/liner/bsdinput.go similarity index 100% rename from _vendor/vendor/github.com/peterh/liner/bsdinput.go rename to vendor/github.com/peterh/liner/bsdinput.go diff --git a/_vendor/vendor/github.com/peterh/liner/common.go b/vendor/github.com/peterh/liner/common.go similarity index 96% rename from _vendor/vendor/github.com/peterh/liner/common.go rename to vendor/github.com/peterh/liner/common.go index e5b8fc2..e16ecbc 100644 --- a/_vendor/vendor/github.com/peterh/liner/common.go +++ b/vendor/github.com/peterh/liner/common.go @@ -64,6 +64,11 @@ var ErrNotTerminalOutput = errors.New("standard output is not a terminal") // be colour codes on some platforms). var ErrInvalidPrompt = errors.New("invalid prompt") +// ErrInternal is returned when liner experiences an error that it cannot +// handle. For example, if the number of colums becomes zero during an +// active call to Prompt +var ErrInternal = errors.New("liner: internal error") + // KillRingMax is the max number of elements to save on the killring. const KillRingMax = 60 @@ -156,7 +161,7 @@ func (s *State) getHistoryByPrefix(prefix string) (ph []string) { return } -// Returns the history lines matching the inteligent search +// Returns the history lines matching the intelligent search func (s *State) getHistoryByPattern(pattern string) (ph []string, pos []int) { if pattern == "" { return diff --git a/_vendor/vendor/github.com/peterh/liner/fallbackinput.go b/vendor/github.com/peterh/liner/fallbackinput.go similarity index 100% rename from _vendor/vendor/github.com/peterh/liner/fallbackinput.go rename to vendor/github.com/peterh/liner/fallbackinput.go diff --git a/_vendor/vendor/github.com/peterh/liner/input.go b/vendor/github.com/peterh/liner/input.go similarity index 98% rename from _vendor/vendor/github.com/peterh/liner/input.go rename to vendor/github.com/peterh/liner/input.go index 904fbf6..cdb8330 100644 --- a/_vendor/vendor/github.com/peterh/liner/input.go +++ b/vendor/github.com/peterh/liner/input.go @@ -113,7 +113,7 @@ func (s *State) nextPending(timeout <-chan time.Time) (rune, error) { select { case thing, ok := <-s.next: if !ok { - return 0, errors.New("liner: internal error") + return 0, ErrInternal } if thing.err != nil { return 0, thing.err @@ -137,7 +137,7 @@ func (s *State) readNext() (interface{}, error) { select { case thing, ok := <-s.next: if !ok { - return 0, errors.New("liner: internal error") + return 0, ErrInternal } if thing.err != nil { return nil, thing.err @@ -328,6 +328,9 @@ func (s *State) readNext() (interface{}, error) { case 'b': s.pending = s.pending[:0] // escape code complete return altB, nil + case 'd': + s.pending = s.pending[:0] // escape code complete + return altD, nil case 'f': s.pending = s.pending[:0] // escape code complete return altF, nil diff --git a/_vendor/vendor/github.com/peterh/liner/input_darwin.go b/vendor/github.com/peterh/liner/input_darwin.go similarity index 100% rename from _vendor/vendor/github.com/peterh/liner/input_darwin.go rename to vendor/github.com/peterh/liner/input_darwin.go diff --git a/_vendor/vendor/github.com/peterh/liner/input_linux.go b/vendor/github.com/peterh/liner/input_linux.go similarity index 100% rename from _vendor/vendor/github.com/peterh/liner/input_linux.go rename to vendor/github.com/peterh/liner/input_linux.go diff --git a/vendor/github.com/peterh/liner/input_test.go b/vendor/github.com/peterh/liner/input_test.go new file mode 100644 index 0000000..e515a48 --- /dev/null +++ b/vendor/github.com/peterh/liner/input_test.go @@ -0,0 +1,61 @@ +// +build !windows + +package liner + +import ( + "bufio" + "bytes" + "testing" +) + +func (s *State) expectRune(t *testing.T, r rune) { + item, err := s.readNext() + if err != nil { + t.Fatalf("Expected rune '%c', got error %s\n", r, err) + } + if v, ok := item.(rune); !ok { + t.Fatalf("Expected rune '%c', got non-rune %v\n", r, v) + } else { + if v != r { + t.Fatalf("Expected rune '%c', got rune '%c'\n", r, v) + } + } +} + +func (s *State) expectAction(t *testing.T, a action) { + item, err := s.readNext() + if err != nil { + t.Fatalf("Expected Action %d, got error %s\n", a, err) + } + if v, ok := item.(action); !ok { + t.Fatalf("Expected Action %d, got non-Action %v\n", a, v) + } else { + if v != a { + t.Fatalf("Expected Action %d, got Action %d\n", a, v) + } + } +} + +func TestTypes(t *testing.T) { + input := []byte{'A', 27, 'B', 27, 91, 68, 27, '[', '1', ';', '5', 'D', 'e'} + var s State + s.r = bufio.NewReader(bytes.NewBuffer(input)) + + next := make(chan nexter) + go func() { + for { + var n nexter + n.r, _, n.err = s.r.ReadRune() + next <- n + } + }() + s.next = next + + s.expectRune(t, 'A') + s.expectRune(t, 27) + s.expectRune(t, 'B') + s.expectAction(t, left) + s.expectAction(t, wordLeft) + + s.expectRune(t, 'e') +} diff --git a/_vendor/vendor/github.com/peterh/liner/input_windows.go b/vendor/github.com/peterh/liner/input_windows.go similarity index 97% rename from _vendor/vendor/github.com/peterh/liner/input_windows.go rename to vendor/github.com/peterh/liner/input_windows.go index a48eb0f..26bd31f 100644 --- a/_vendor/vendor/github.com/peterh/liner/input_windows.go +++ b/vendor/github.com/peterh/liner/input_windows.go @@ -134,6 +134,7 @@ const ( vk_f11 = 0x7a vk_f12 = 0x7b bKey = 0x42 + dKey = 0x44 fKey = 0x46 yKey = 0x59 ) @@ -202,6 +203,9 @@ func (s *State) readNext() (interface{}, error) { } else if ke.VirtualKeyCode == bKey && (ke.ControlKeyState&modKeys == leftAltPressed || ke.ControlKeyState&modKeys == rightAltPressed) { s.key = altB + } else if ke.VirtualKeyCode == dKey && (ke.ControlKeyState&modKeys == leftAltPressed || + ke.ControlKeyState&modKeys == rightAltPressed) { + s.key = altD } else if ke.VirtualKeyCode == fKey && (ke.ControlKeyState&modKeys == leftAltPressed || ke.ControlKeyState&modKeys == rightAltPressed) { s.key = altF diff --git a/_vendor/vendor/github.com/peterh/liner/line.go b/vendor/github.com/peterh/liner/line.go similarity index 90% rename from _vendor/vendor/github.com/peterh/liner/line.go rename to vendor/github.com/peterh/liner/line.go index cc147d6..ac71a1c 100644 --- a/_vendor/vendor/github.com/peterh/liner/line.go +++ b/vendor/github.com/peterh/liner/line.go @@ -3,10 +3,12 @@ package liner import ( + "bufio" "container/ring" "errors" "fmt" "io" + "os" "strings" "unicode" "unicode/utf8" @@ -38,6 +40,7 @@ const ( f11 f12 altB + altD altF altY shiftTab @@ -90,6 +93,10 @@ const ( ) func (s *State) refresh(prompt []rune, buf []rune, pos int) error { + if s.columns == 0 { + return ErrInternal + } + s.needRefresh = false if s.multiLineMode { return s.refreshMultiLine(prompt, buf, pos) @@ -351,8 +358,8 @@ func (s *State) tabComplete(p []rune, line []rune, pos int) ([]rune, int, interf } hl := utf8.RuneCountInString(head) if len(list) == 1 { - s.refresh(p, []rune(head+list[0]+tail), hl+utf8.RuneCountInString(list[0])) - return []rune(head + list[0] + tail), hl + utf8.RuneCountInString(list[0]), rune(esc), nil + err := s.refresh(p, []rune(head+list[0]+tail), hl+utf8.RuneCountInString(list[0])) + return []rune(head + list[0] + tail), hl + utf8.RuneCountInString(list[0]), rune(esc), err } direction := tabForward @@ -366,7 +373,10 @@ func (s *State) tabComplete(p []rune, line []rune, pos int) ([]rune, int, interf if err != nil { return line, pos, rune(esc), err } - s.refresh(p, []rune(head+pick+tail), hl+utf8.RuneCountInString(pick)) + err = s.refresh(p, []rune(head+pick+tail), hl+utf8.RuneCountInString(pick)) + if err != nil { + return line, pos, rune(esc), err + } next, err := s.readNext() if err != nil { @@ -392,7 +402,10 @@ func (s *State) tabComplete(p []rune, line []rune, pos int) ([]rune, int, interf // reverse intelligent search, implements a bash-like history search. func (s *State) reverseISearch(origLine []rune, origPos int) ([]rune, int, interface{}, error) { p := "(reverse-i-search)`': " - s.refresh([]rune(p), origLine, origPos) + err := s.refresh([]rune(p), origLine, origPos) + if err != nil { + return origLine, origPos, rune(esc), err + } line := []rune{} pos := 0 @@ -478,7 +491,10 @@ func (s *State) reverseISearch(origLine []rune, origPos int) ([]rune, int, inter case action: return []rune(foundLine), foundPos, next, err } - s.refresh(getLine()) + err = s.refresh(getLine()) + if err != nil { + return []rune(foundLine), foundPos, rune(esc), err + } } } @@ -535,7 +551,10 @@ func (s *State) yank(p []rune, text []rune, pos int) ([]rune, int, interface{}, line = append(line, lineEnd...) pos = len(lineStart) + len(value) - s.refresh(p, line, pos) + err := s.refresh(p, line, pos) + if err != nil { + return line, pos, 0, err + } next, err := s.readNext() if err != nil { @@ -577,6 +596,11 @@ func (s *State) PromptWithSuggestion(prompt string, text string, pos int) (strin if s.inputRedirected || !s.terminalSupported { return s.promptUnsupported(prompt) } + p := []rune(prompt) + const minWorkingSpace = 10 + if s.columns < countGlyphs(p)+minWorkingSpace { + return s.tooNarrow(prompt) + } if s.outputRedirected { return "", ErrNotTerminalOutput } @@ -585,7 +609,6 @@ func (s *State) PromptWithSuggestion(prompt string, text string, pos int) (strin defer s.historyMutex.RUnlock() fmt.Print(prompt) - p := []rune(prompt) var line = []rune(text) historyEnd := "" var historyPrefix []string @@ -600,7 +623,10 @@ func (s *State) PromptWithSuggestion(prompt string, text string, pos int) (strin pos = len(text) } if len(line) > 0 { - s.refresh(p, line, pos) + err := s.refresh(p, line, pos) + if err != nil { + return "", err + } } restart: @@ -624,7 +650,10 @@ mainLoop: switch v { case cr, lf: if s.needRefresh { - s.refresh(p, line, pos) + err := s.refresh(p, line, pos) + if err != nil { + return "", err + } } if s.multiLineMode { s.resetMultiLine(p, line, pos) @@ -941,6 +970,35 @@ mainLoop: pos = 0 case end: // End of line pos = len(line) + case altD: // Delete next word + if pos == len(line) { + fmt.Print(beep) + break + } + // Remove whitespace to the right + var buf []rune // Store the deleted chars in a buffer + for { + if pos == len(line) || !unicode.IsSpace(line[pos]) { + break + } + buf = append(buf, line[pos]) + line = append(line[:pos], line[pos+1:]...) + } + // Remove non-whitespace to the right + for { + if pos == len(line) || unicode.IsSpace(line[pos]) { + break + } + buf = append(buf, line[pos]) + line = append(line[:pos], line[pos+1:]...) + } + // Save the result on the killRing + if killAction > 0 { + s.addToKillRing(buf, 2) // Add in prepend mode + } else { + s.addToKillRing(buf, 0) // Add in normal mode + } + killAction = 2 // Mark that there was some killing case winch: // Window change if s.multiLineMode { if s.maxRows-s.cursorRows > 0 { @@ -958,7 +1016,10 @@ mainLoop: s.needRefresh = true } if s.needRefresh && !s.inputWaiting() { - s.refresh(p, line, pos) + err := s.refresh(p, line, pos) + if err != nil { + return "", err + } } if !historyAction { historyStale = true @@ -978,7 +1039,7 @@ func (s *State) PasswordPrompt(prompt string) (string, error) { return "", ErrInvalidPrompt } } - if !s.terminalSupported { + if !s.terminalSupported || s.columns == 0 { return "", errors.New("liner: function not supported in this terminal") } if s.inputRedirected { @@ -988,6 +1049,12 @@ func (s *State) PasswordPrompt(prompt string) (string, error) { return "", ErrNotTerminalOutput } + p := []rune(prompt) + const minWorkingSpace = 1 + if s.columns < countGlyphs(p)+minWorkingSpace { + return s.tooNarrow(prompt) + } + defer s.stopPrompt() restart: @@ -995,7 +1062,6 @@ restart: s.getColumns() fmt.Print(prompt) - p := []rune(prompt) var line []rune pos := 0 @@ -1014,7 +1080,10 @@ mainLoop: switch v { case cr, lf: if s.needRefresh { - s.refresh(p, line, pos) + err := s.refresh(p, line, pos) + if err != nil { + return "", err + } } if s.multiLineMode { s.resetMultiLine(p, line, pos) @@ -1032,7 +1101,10 @@ mainLoop: s.restartPrompt() case ctrlL: // clear screen s.eraseScreen() - s.refresh(p, []rune{}, 0) + err := s.refresh(p, []rune{}, 0) + if err != nil { + return "", err + } case ctrlH, bs: // Backspace if pos <= 0 { fmt.Print(beep) @@ -1068,3 +1140,20 @@ mainLoop: } return string(line), nil } + +func (s *State) tooNarrow(prompt string) (string, error) { + // Docker and OpenWRT and etc sometimes return 0 column width + // Reset mode temporarily. Restore baked mode in case the terminal + // is wide enough for the next Prompt attempt. + m, merr := TerminalMode() + s.origMode.ApplyMode() + if merr == nil { + defer m.ApplyMode() + } + if s.r == nil { + // Windows does not always set s.r + s.r = bufio.NewReader(os.Stdin) + defer func() { s.r = nil }() + } + return s.promptUnsupported(prompt) +} diff --git a/vendor/github.com/peterh/liner/line_test.go b/vendor/github.com/peterh/liner/line_test.go new file mode 100644 index 0000000..6324a75 --- /dev/null +++ b/vendor/github.com/peterh/liner/line_test.go @@ -0,0 +1,146 @@ +package liner + +import ( + "bytes" + "fmt" + "strings" + "testing" +) + +func TestAppend(t *testing.T) { + var s State + s.AppendHistory("foo") + s.AppendHistory("bar") + + var out bytes.Buffer + num, err := s.WriteHistory(&out) + if err != nil { + t.Fatal("Unexpected error writing history", err) + } + if num != 2 { + t.Fatalf("Expected 2 history entries, got %d", num) + } + + s.AppendHistory("baz") + num, err = s.WriteHistory(&out) + if err != nil { + t.Fatal("Unexpected error writing history", err) + } + if num != 3 { + t.Fatalf("Expected 3 history entries, got %d", num) + } + + s.AppendHistory("baz") + num, err = s.WriteHistory(&out) + if err != nil { + t.Fatal("Unexpected error writing history", err) + } + if num != 3 { + t.Fatalf("Expected 3 history entries after duplicate append, got %d", num) + } + + s.AppendHistory("baz") + +} + +func TestHistory(t *testing.T) { + input := `foo +bar +baz +quux +dingle` + + var s State + num, err := s.ReadHistory(strings.NewReader(input)) + if err != nil { + t.Fatal("Unexpected error reading history", err) + } + if num != 5 { + t.Fatal("Wrong number of history entries read") + } + + var out bytes.Buffer + num, err = s.WriteHistory(&out) + if err != nil { + t.Fatal("Unexpected error writing history", err) + } + if num != 5 { + t.Fatal("Wrong number of history entries written") + } + if strings.TrimSpace(out.String()) != input { + t.Fatal("Round-trip failure") + } + + // clear the history and re-write + s.ClearHistory() + num, err = s.WriteHistory(&out) + if err != nil { + t.Fatal("Unexpected error writing history", err) + } + if num != 0 { + t.Fatal("Wrong number of history entries written, expected none") + } + // Test reading with a trailing newline present + var s2 State + num, err = s2.ReadHistory(&out) + if err != nil { + t.Fatal("Unexpected error reading history the 2nd time", err) + } + if num != 5 { + t.Fatal("Wrong number of history entries read the 2nd time") + } + + num, err = s.ReadHistory(strings.NewReader(input + "\n\xff")) + if err == nil { + t.Fatal("Unexpected success reading corrupted history", err) + } + if num != 5 { + t.Fatal("Wrong number of history entries read the 3rd time") + } +} + +func TestColumns(t *testing.T) { + list := []string{"foo", "food", "This entry is quite a bit longer than the typical entry"} + + output := []struct { + width, columns, rows, maxWidth int + }{ + {80, 1, 3, len(list[2]) + 1}, + {120, 2, 2, len(list[2]) + 1}, + {800, 14, 1, 0}, + {8, 1, 3, 7}, + } + + for i, o := range output { + col, row, max := calculateColumns(o.width, list) + if col != o.columns { + t.Fatalf("Wrong number of columns, %d != %d, in TestColumns %d\n", col, o.columns, i) + } + if row != o.rows { + t.Fatalf("Wrong number of rows, %d != %d, in TestColumns %d\n", row, o.rows, i) + } + if max != o.maxWidth { + t.Fatalf("Wrong column width, %d != %d, in TestColumns %d\n", max, o.maxWidth, i) + } + } +} + +// This example demonstrates a way to retrieve the current +// history buffer without using a file. +func ExampleState_WriteHistory() { + var s State + s.AppendHistory("foo") + s.AppendHistory("bar") + + buf := new(bytes.Buffer) + _, err := s.WriteHistory(buf) + if err == nil { + history := strings.Split(strings.TrimSpace(buf.String()), "\n") + for i, line := range history { + fmt.Println("History entry", i, ":", line) + } + } + // Output: + // History entry 0 : foo + // History entry 1 : bar +} diff --git a/_vendor/vendor/github.com/peterh/liner/output.go b/vendor/github.com/peterh/liner/output.go similarity index 100% rename from _vendor/vendor/github.com/peterh/liner/output.go rename to vendor/github.com/peterh/liner/output.go diff --git a/_vendor/vendor/github.com/peterh/liner/output_windows.go b/vendor/github.com/peterh/liner/output_windows.go similarity index 100% rename from _vendor/vendor/github.com/peterh/liner/output_windows.go rename to vendor/github.com/peterh/liner/output_windows.go diff --git a/vendor/github.com/peterh/liner/prefix_test.go b/vendor/github.com/peterh/liner/prefix_test.go new file mode 100644 index 0000000..c826d6c --- /dev/null +++ b/vendor/github.com/peterh/liner/prefix_test.go @@ -0,0 +1,37 @@ +// +build windows linux darwin openbsd freebsd netbsd + +package liner + +import "testing" + +type testItem struct { + list []string + prefix string +} + +func TestPrefix(t *testing.T) { + list := []testItem{ + {[]string{"food", "foot"}, "foo"}, + {[]string{"foo", "foot"}, "foo"}, + {[]string{"food", "foo"}, "foo"}, + {[]string{"food", "foe", "foot"}, "fo"}, + {[]string{"food", "foot", "barbeque"}, ""}, + {[]string{"cafeteria", "café"}, "caf"}, + {[]string{"cafe", "café"}, "caf"}, + {[]string{"cafè", "café"}, "caf"}, + {[]string{"cafés", "café"}, "café"}, + {[]string{"áéíóú", "áéíóú"}, "áéíóú"}, + {[]string{"éclairs", "éclairs"}, "éclairs"}, + {[]string{"éclairs are the best", "éclairs are great", "éclairs"}, "éclairs"}, + {[]string{"éclair", "éclairs"}, "éclair"}, + {[]string{"éclairs", "éclair"}, "éclair"}, + {[]string{"éclair", "élan"}, "é"}, + } + + for _, test := range list { + lcp := longestCommonPrefix(test.list) + if lcp != test.prefix { + t.Errorf("%s != %s for %+v", lcp, test.prefix, test.list) + } + } +} diff --git a/vendor/github.com/peterh/liner/race_test.go b/vendor/github.com/peterh/liner/race_test.go new file mode 100644 index 0000000..e320849 --- /dev/null +++ b/vendor/github.com/peterh/liner/race_test.go @@ -0,0 +1,44 @@ +// +build race + +package liner + +import ( + "io/ioutil" + "os" + "sync" + "testing" +) + +func TestWriteHistory(t *testing.T) { + oldout := os.Stdout + defer func() { os.Stdout = oldout }() + oldin := os.Stdout + defer func() { os.Stdin = oldin }() + + newinr, newinw, err := os.Pipe() + if err != nil { + t.Fatal(err) + } + os.Stdin = newinr + newoutr, newoutw, err := os.Pipe() + if err != nil { + t.Fatal(err) + } + defer newoutr.Close() + os.Stdout = newoutw + + var wait sync.WaitGroup + wait.Add(1) + s := NewLiner() + go func() { + s.AppendHistory("foo") + s.AppendHistory("bar") + s.Prompt("") + wait.Done() + }() + + s.WriteHistory(ioutil.Discard) + + newinw.Close() + wait.Wait() +} diff --git a/_vendor/vendor/github.com/peterh/liner/unixmode.go b/vendor/github.com/peterh/liner/unixmode.go similarity index 100% rename from _vendor/vendor/github.com/peterh/liner/unixmode.go rename to vendor/github.com/peterh/liner/unixmode.go diff --git a/_vendor/vendor/github.com/peterh/liner/width.go b/vendor/github.com/peterh/liner/width.go similarity index 100% rename from _vendor/vendor/github.com/peterh/liner/width.go rename to vendor/github.com/peterh/liner/width.go diff --git a/vendor/github.com/peterh/liner/width_test.go b/vendor/github.com/peterh/liner/width_test.go new file mode 100644 index 0000000..add779c --- /dev/null +++ b/vendor/github.com/peterh/liner/width_test.go @@ -0,0 +1,102 @@ +package liner + +import ( + "strconv" + "testing" +) + +func accent(in []rune) []rune { + var out []rune + for _, r := range in { + out = append(out, r) + out = append(out, '\u0301') + } + return out +} + +type testCase struct { + s []rune + glyphs int +} + +var testCases = []testCase{ + {[]rune("query"), 5}, + {[]rune("私"), 2}, + {[]rune("hello世界"), 9}, +} + +func TestCountGlyphs(t *testing.T) { + for _, testCase := range testCases { + count := countGlyphs(testCase.s) + if count != testCase.glyphs { + t.Errorf("ASCII count incorrect. %d != %d", count, testCase.glyphs) + } + count = countGlyphs(accent(testCase.s)) + if count != testCase.glyphs { + t.Errorf("Accent count incorrect. %d != %d", count, testCase.glyphs) + } + } +} + +func compare(a, b []rune, name string, t *testing.T) { + if len(a) != len(b) { + t.Errorf(`"%s" != "%s" in %s"`, string(a), string(b), name) + return + } + for i := range a { + if a[i] != b[i] { + t.Errorf(`"%s" != "%s" in %s"`, string(a), string(b), name) + return + } + } +} + +func TestPrefixGlyphs(t *testing.T) { + for _, testCase := range testCases { + for i := 0; i <= len(testCase.s); i++ { + iter := strconv.Itoa(i) + out := getPrefixGlyphs(testCase.s, i) + compare(out, testCase.s[:i], "ascii prefix "+iter, t) + out = getPrefixGlyphs(accent(testCase.s), i) + compare(out, accent(testCase.s[:i]), "accent prefix "+iter, t) + } + out := getPrefixGlyphs(testCase.s, 999) + compare(out, testCase.s, "ascii prefix overflow", t) + out = getPrefixGlyphs(accent(testCase.s), 999) + compare(out, accent(testCase.s), "accent prefix overflow", t) + + out = getPrefixGlyphs(testCase.s, -3) + if len(out) != 0 { + t.Error("ascii prefix negative") + } + out = getPrefixGlyphs(accent(testCase.s), -3) + if len(out) != 0 { + t.Error("accent prefix negative") + } + } +} + +func TestSuffixGlyphs(t *testing.T) { + for _, testCase := range testCases { + for i := 0; i <= len(testCase.s); i++ { + iter := strconv.Itoa(i) + out := getSuffixGlyphs(testCase.s, i) + compare(out, testCase.s[len(testCase.s)-i:], "ascii suffix "+iter, t) + out = getSuffixGlyphs(accent(testCase.s), i) + compare(out, accent(testCase.s[len(testCase.s)-i:]), "accent suffix "+iter, t) + } + out := getSuffixGlyphs(testCase.s, 999) + compare(out, testCase.s, "ascii suffix overflow", t) + out = getSuffixGlyphs(accent(testCase.s), 999) + compare(out, accent(testCase.s), "accent suffix overflow", t) + + out = getSuffixGlyphs(testCase.s, -3) + if len(out) != 0 { + t.Error("ascii suffix negative") + } + out = getSuffixGlyphs(accent(testCase.s), -3) + if len(out) != 0 { + t.Error("accent suffix negative") + } + } +} diff --git a/_vendor/vendor/github.com/siddontang/go/LICENSE b/vendor/github.com/siddontang/go/LICENSE similarity index 100% rename from _vendor/vendor/github.com/siddontang/go/LICENSE rename to vendor/github.com/siddontang/go/LICENSE diff --git a/vendor/github.com/siddontang/go/README.md b/vendor/github.com/siddontang/go/README.md new file mode 100644 index 0000000..f5db8d9 --- /dev/null +++ b/vendor/github.com/siddontang/go/README.md @@ -0,0 +1,4 @@ +golib +===== + +my golang lib diff --git a/_vendor/vendor/github.com/siddontang/go/bson/LICENSE b/vendor/github.com/siddontang/go/bson/LICENSE similarity index 100% rename from _vendor/vendor/github.com/siddontang/go/bson/LICENSE rename to vendor/github.com/siddontang/go/bson/LICENSE diff --git a/_vendor/vendor/github.com/siddontang/go/bson/bson.go b/vendor/github.com/siddontang/go/bson/bson.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/go/bson/bson.go rename to vendor/github.com/siddontang/go/bson/bson.go diff --git a/vendor/github.com/siddontang/go/bson/bson_test.go b/vendor/github.com/siddontang/go/bson/bson_test.go new file mode 100644 index 0000000..3d97998 --- /dev/null +++ b/vendor/github.com/siddontang/go/bson/bson_test.go @@ -0,0 +1,1472 @@ +// BSON library for Go +// +// Copyright (c) 2010-2012 - Gustavo Niemeyer +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// 2. 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. +// +// 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 OWNER 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. +// gobson - BSON library for Go. + +package bson_test + +import ( + "encoding/binary" + "encoding/json" + "errors" + "net/url" + "reflect" + "testing" + "time" + + . "gopkg.in/check.v1" + "gopkg.in/mgo.v2/bson" +) + +func TestAll(t *testing.T) { + TestingT(t) +} + +type S struct{} + +var _ = Suite(&S{}) + +// Wrap up the document elements contained in data, prepending the int32 +// length of the data, and appending the '\x00' value closing the document. +func wrapInDoc(data string) string { + result := make([]byte, len(data)+5) + binary.LittleEndian.PutUint32(result, uint32(len(result))) + copy(result[4:], []byte(data)) + return string(result) +} + +func makeZeroDoc(value interface{}) (zero interface{}) { + v := reflect.ValueOf(value) + t := v.Type() + switch t.Kind() { + case reflect.Map: + mv := reflect.MakeMap(t) + zero = mv.Interface() + case reflect.Ptr: + pv := reflect.New(v.Type().Elem()) + zero = pv.Interface() + case reflect.Slice: + zero = reflect.New(t).Interface() + default: + panic("unsupported doc type") + } + return zero +} + +func testUnmarshal(c *C, data string, obj interface{}) { + zero := makeZeroDoc(obj) + err := bson.Unmarshal([]byte(data), zero) + c.Assert(err, IsNil) + c.Assert(zero, DeepEquals, obj) +} + +type testItemType struct { + obj interface{} + data string +} + +// -------------------------------------------------------------------------- +// Samples from bsonspec.org: + +var sampleItems = []testItemType{ + {bson.M{"hello": "world"}, + "\x16\x00\x00\x00\x02hello\x00\x06\x00\x00\x00world\x00\x00"}, + {bson.M{"BSON": []interface{}{"awesome", float64(5.05), 1986}}, + "1\x00\x00\x00\x04BSON\x00&\x00\x00\x00\x020\x00\x08\x00\x00\x00" + + "awesome\x00\x011\x00333333\x14@\x102\x00\xc2\x07\x00\x00\x00\x00"}, +} + +func (s *S) TestMarshalSampleItems(c *C) { + for i, item := range sampleItems { + data, err := bson.Marshal(item.obj) + c.Assert(err, IsNil) + c.Assert(string(data), Equals, item.data, Commentf("Failed on item %d", i)) + } +} + +func (s *S) TestUnmarshalSampleItems(c *C) { + for i, item := range sampleItems { + value := bson.M{} + err := bson.Unmarshal([]byte(item.data), value) + c.Assert(err, IsNil) + c.Assert(value, DeepEquals, item.obj, Commentf("Failed on item %d", i)) + } +} + +// -------------------------------------------------------------------------- +// Every type, ordered by the type flag. These are not wrapped with the +// length and last \x00 from the document. wrapInDoc() computes them. +// Note that all of them should be supported as two-way conversions. + +var allItems = []testItemType{ + {bson.M{}, + ""}, + {bson.M{"_": float64(5.05)}, + "\x01_\x00333333\x14@"}, + {bson.M{"_": "yo"}, + "\x02_\x00\x03\x00\x00\x00yo\x00"}, + {bson.M{"_": bson.M{"a": true}}, + "\x03_\x00\x09\x00\x00\x00\x08a\x00\x01\x00"}, + {bson.M{"_": []interface{}{true, false}}, + "\x04_\x00\r\x00\x00\x00\x080\x00\x01\x081\x00\x00\x00"}, + {bson.M{"_": []byte("yo")}, + "\x05_\x00\x02\x00\x00\x00\x00yo"}, + {bson.M{"_": bson.Binary{0x80, []byte("udef")}}, + "\x05_\x00\x04\x00\x00\x00\x80udef"}, + {bson.M{"_": bson.Undefined}, // Obsolete, but still seen in the wild. + "\x06_\x00"}, + {bson.M{"_": bson.ObjectId("0123456789ab")}, + "\x07_\x000123456789ab"}, + {bson.M{"_": false}, + "\x08_\x00\x00"}, + {bson.M{"_": true}, + "\x08_\x00\x01"}, + {bson.M{"_": time.Unix(0, 258e6)}, // Note the NS <=> MS conversion. + "\x09_\x00\x02\x01\x00\x00\x00\x00\x00\x00"}, + {bson.M{"_": nil}, + "\x0A_\x00"}, + {bson.M{"_": bson.RegEx{"ab", "cd"}}, + "\x0B_\x00ab\x00cd\x00"}, + {bson.M{"_": bson.JavaScript{"code", nil}}, + "\x0D_\x00\x05\x00\x00\x00code\x00"}, + {bson.M{"_": bson.Symbol("sym")}, + "\x0E_\x00\x04\x00\x00\x00sym\x00"}, + {bson.M{"_": bson.JavaScript{"code", bson.M{"": nil}}}, + "\x0F_\x00\x14\x00\x00\x00\x05\x00\x00\x00code\x00" + + "\x07\x00\x00\x00\x0A\x00\x00"}, + {bson.M{"_": 258}, + "\x10_\x00\x02\x01\x00\x00"}, + {bson.M{"_": bson.MongoTimestamp(258)}, + "\x11_\x00\x02\x01\x00\x00\x00\x00\x00\x00"}, + {bson.M{"_": int64(258)}, + "\x12_\x00\x02\x01\x00\x00\x00\x00\x00\x00"}, + {bson.M{"_": int64(258 << 32)}, + "\x12_\x00\x00\x00\x00\x00\x02\x01\x00\x00"}, + {bson.M{"_": bson.MaxKey}, + "\x7F_\x00"}, + {bson.M{"_": bson.MinKey}, + "\xFF_\x00"}, +} + +func (s *S) TestMarshalAllItems(c *C) { + for i, item := range allItems { + data, err := bson.Marshal(item.obj) + c.Assert(err, IsNil) + c.Assert(string(data), Equals, wrapInDoc(item.data), Commentf("Failed on item %d: %#v", i, item)) + } +} + +func (s *S) TestUnmarshalAllItems(c *C) { + for i, item := range allItems { + value := bson.M{} + err := bson.Unmarshal([]byte(wrapInDoc(item.data)), value) + c.Assert(err, IsNil) + c.Assert(value, DeepEquals, item.obj, Commentf("Failed on item %d: %#v", i, item)) + } +} + +func (s *S) TestUnmarshalRawAllItems(c *C) { + for i, item := range allItems { + if len(item.data) == 0 { + continue + } + value := item.obj.(bson.M)["_"] + if value == nil { + continue + } + pv := reflect.New(reflect.ValueOf(value).Type()) + raw := bson.Raw{item.data[0], []byte(item.data[3:])} + c.Logf("Unmarshal raw: %#v, %#v", raw, pv.Interface()) + err := raw.Unmarshal(pv.Interface()) + c.Assert(err, IsNil) + c.Assert(pv.Elem().Interface(), DeepEquals, value, Commentf("Failed on item %d: %#v", i, item)) + } +} + +func (s *S) TestUnmarshalRawIncompatible(c *C) { + raw := bson.Raw{0x08, []byte{0x01}} // true + err := raw.Unmarshal(&struct{}{}) + c.Assert(err, ErrorMatches, "BSON kind 0x08 isn't compatible with type struct \\{\\}") +} + +func (s *S) TestUnmarshalZeroesStruct(c *C) { + data, err := bson.Marshal(bson.M{"b": 2}) + c.Assert(err, IsNil) + type T struct{ A, B int } + v := T{A: 1} + err = bson.Unmarshal(data, &v) + c.Assert(err, IsNil) + c.Assert(v.A, Equals, 0) + c.Assert(v.B, Equals, 2) +} + +func (s *S) TestUnmarshalZeroesMap(c *C) { + data, err := bson.Marshal(bson.M{"b": 2}) + c.Assert(err, IsNil) + m := bson.M{"a": 1} + err = bson.Unmarshal(data, &m) + c.Assert(err, IsNil) + c.Assert(m, DeepEquals, bson.M{"b": 2}) +} + +func (s *S) TestUnmarshalNonNilInterface(c *C) { + data, err := bson.Marshal(bson.M{"b": 2}) + c.Assert(err, IsNil) + m := bson.M{"a": 1} + var i interface{} + i = m + err = bson.Unmarshal(data, &i) + c.Assert(err, IsNil) + c.Assert(i, DeepEquals, bson.M{"b": 2}) + c.Assert(m, DeepEquals, bson.M{"a": 1}) +} + +// -------------------------------------------------------------------------- +// Some one way marshaling operations which would unmarshal differently. + +var oneWayMarshalItems = []testItemType{ + // These are being passed as pointers, and will unmarshal as values. + {bson.M{"": &bson.Binary{0x02, []byte("old")}}, + "\x05\x00\x07\x00\x00\x00\x02\x03\x00\x00\x00old"}, + {bson.M{"": &bson.Binary{0x80, []byte("udef")}}, + "\x05\x00\x04\x00\x00\x00\x80udef"}, + {bson.M{"": &bson.RegEx{"ab", "cd"}}, + "\x0B\x00ab\x00cd\x00"}, + {bson.M{"": &bson.JavaScript{"code", nil}}, + "\x0D\x00\x05\x00\x00\x00code\x00"}, + {bson.M{"": &bson.JavaScript{"code", bson.M{"": nil}}}, + "\x0F\x00\x14\x00\x00\x00\x05\x00\x00\x00code\x00" + + "\x07\x00\x00\x00\x0A\x00\x00"}, + + // There's no float32 type in BSON. Will encode as a float64. + {bson.M{"": float32(5.05)}, + "\x01\x00\x00\x00\x00@33\x14@"}, + + // The array will be unmarshaled as a slice instead. + {bson.M{"": [2]bool{true, false}}, + "\x04\x00\r\x00\x00\x00\x080\x00\x01\x081\x00\x00\x00"}, + + // The typed slice will be unmarshaled as []interface{}. + {bson.M{"": []bool{true, false}}, + "\x04\x00\r\x00\x00\x00\x080\x00\x01\x081\x00\x00\x00"}, + + // Will unmarshal as a []byte. + {bson.M{"": bson.Binary{0x00, []byte("yo")}}, + "\x05\x00\x02\x00\x00\x00\x00yo"}, + {bson.M{"": bson.Binary{0x02, []byte("old")}}, + "\x05\x00\x07\x00\x00\x00\x02\x03\x00\x00\x00old"}, + + // No way to preserve the type information here. We might encode as a zero + // value, but this would mean that pointer values in structs wouldn't be + // able to correctly distinguish between unset and set to the zero value. + {bson.M{"": (*byte)(nil)}, + "\x0A\x00"}, + + // No int types smaller than int32 in BSON. Could encode this as a char, + // but it would still be ambiguous, take more, and be awkward in Go when + // loaded without typing information. + {bson.M{"": byte(8)}, + "\x10\x00\x08\x00\x00\x00"}, + + // There are no unsigned types in BSON. Will unmarshal as int32 or int64. + {bson.M{"": uint32(258)}, + "\x10\x00\x02\x01\x00\x00"}, + {bson.M{"": uint64(258)}, + "\x12\x00\x02\x01\x00\x00\x00\x00\x00\x00"}, + {bson.M{"": uint64(258 << 32)}, + "\x12\x00\x00\x00\x00\x00\x02\x01\x00\x00"}, + + // This will unmarshal as int. + {bson.M{"": int32(258)}, + "\x10\x00\x02\x01\x00\x00"}, + + // That's a special case. The unsigned value is too large for an int32, + // so an int64 is used instead. + {bson.M{"": uint32(1<<32 - 1)}, + "\x12\x00\xFF\xFF\xFF\xFF\x00\x00\x00\x00"}, + {bson.M{"": uint(1<<32 - 1)}, + "\x12\x00\xFF\xFF\xFF\xFF\x00\x00\x00\x00"}, +} + +func (s *S) TestOneWayMarshalItems(c *C) { + for i, item := range oneWayMarshalItems { + data, err := bson.Marshal(item.obj) + c.Assert(err, IsNil) + c.Assert(string(data), Equals, wrapInDoc(item.data), + Commentf("Failed on item %d", i)) + } +} + +// -------------------------------------------------------------------------- +// Two-way tests for user-defined structures using the samples +// from bsonspec.org. + +type specSample1 struct { + Hello string +} + +type specSample2 struct { + BSON []interface{} "BSON" +} + +var structSampleItems = []testItemType{ + {&specSample1{"world"}, + "\x16\x00\x00\x00\x02hello\x00\x06\x00\x00\x00world\x00\x00"}, + {&specSample2{[]interface{}{"awesome", float64(5.05), 1986}}, + "1\x00\x00\x00\x04BSON\x00&\x00\x00\x00\x020\x00\x08\x00\x00\x00" + + "awesome\x00\x011\x00333333\x14@\x102\x00\xc2\x07\x00\x00\x00\x00"}, +} + +func (s *S) TestMarshalStructSampleItems(c *C) { + for i, item := range structSampleItems { + data, err := bson.Marshal(item.obj) + c.Assert(err, IsNil) + c.Assert(string(data), Equals, item.data, + Commentf("Failed on item %d", i)) + } +} + +func (s *S) TestUnmarshalStructSampleItems(c *C) { + for _, item := range structSampleItems { + testUnmarshal(c, item.data, item.obj) + } +} + +func (s *S) Test64bitInt(c *C) { + var i int64 = (1 << 31) + if int(i) > 0 { + data, err := bson.Marshal(bson.M{"i": int(i)}) + c.Assert(err, IsNil) + c.Assert(string(data), Equals, wrapInDoc("\x12i\x00\x00\x00\x00\x80\x00\x00\x00\x00")) + + var result struct{ I int } + err = bson.Unmarshal(data, &result) + c.Assert(err, IsNil) + c.Assert(int64(result.I), Equals, i) + } +} + +// -------------------------------------------------------------------------- +// Generic two-way struct marshaling tests. + +var bytevar = byte(8) +var byteptr = &bytevar + +var structItems = []testItemType{ + {&struct{ Ptr *byte }{nil}, + "\x0Aptr\x00"}, + {&struct{ Ptr *byte }{&bytevar}, + "\x10ptr\x00\x08\x00\x00\x00"}, + {&struct{ Ptr **byte }{&byteptr}, + "\x10ptr\x00\x08\x00\x00\x00"}, + {&struct{ Byte byte }{8}, + "\x10byte\x00\x08\x00\x00\x00"}, + {&struct{ Byte byte }{0}, + "\x10byte\x00\x00\x00\x00\x00"}, + {&struct { + V byte "Tag" + }{8}, + "\x10Tag\x00\x08\x00\x00\x00"}, + {&struct { + V *struct { + Byte byte + } + }{&struct{ Byte byte }{8}}, + "\x03v\x00" + "\x0f\x00\x00\x00\x10byte\x00\b\x00\x00\x00\x00"}, + {&struct{ priv byte }{}, ""}, + + // The order of the dumped fields should be the same in the struct. + {&struct{ A, C, B, D, F, E *byte }{}, + "\x0Aa\x00\x0Ac\x00\x0Ab\x00\x0Ad\x00\x0Af\x00\x0Ae\x00"}, + + {&struct{ V bson.Raw }{bson.Raw{0x03, []byte("\x0f\x00\x00\x00\x10byte\x00\b\x00\x00\x00\x00")}}, + "\x03v\x00" + "\x0f\x00\x00\x00\x10byte\x00\b\x00\x00\x00\x00"}, + {&struct{ V bson.Raw }{bson.Raw{0x10, []byte("\x00\x00\x00\x00")}}, + "\x10v\x00" + "\x00\x00\x00\x00"}, + + // Byte arrays. + {&struct{ V [2]byte }{[2]byte{'y', 'o'}}, + "\x05v\x00\x02\x00\x00\x00\x00yo"}, +} + +func (s *S) TestMarshalStructItems(c *C) { + for i, item := range structItems { + data, err := bson.Marshal(item.obj) + c.Assert(err, IsNil) + c.Assert(string(data), Equals, wrapInDoc(item.data), + Commentf("Failed on item %d", i)) + } +} + +func (s *S) TestUnmarshalStructItems(c *C) { + for _, item := range structItems { + testUnmarshal(c, wrapInDoc(item.data), item.obj) + } +} + +func (s *S) TestUnmarshalRawStructItems(c *C) { + for i, item := range structItems { + raw := bson.Raw{0x03, []byte(wrapInDoc(item.data))} + zero := makeZeroDoc(item.obj) + err := raw.Unmarshal(zero) + c.Assert(err, IsNil) + c.Assert(zero, DeepEquals, item.obj, Commentf("Failed on item %d: %#v", i, item)) + } +} + +func (s *S) TestUnmarshalRawNil(c *C) { + // Regression test: shouldn't try to nil out the pointer itself, + // as it's not settable. + raw := bson.Raw{0x0A, []byte{}} + err := raw.Unmarshal(&struct{}{}) + c.Assert(err, IsNil) +} + +// -------------------------------------------------------------------------- +// One-way marshaling tests. + +type dOnIface struct { + D interface{} +} + +type ignoreField struct { + Before string + Ignore string `bson:"-"` + After string +} + +var marshalItems = []testItemType{ + // Ordered document dump. Will unmarshal as a dictionary by default. + {bson.D{{"a", nil}, {"c", nil}, {"b", nil}, {"d", nil}, {"f", nil}, {"e", true}}, + "\x0Aa\x00\x0Ac\x00\x0Ab\x00\x0Ad\x00\x0Af\x00\x08e\x00\x01"}, + {MyD{{"a", nil}, {"c", nil}, {"b", nil}, {"d", nil}, {"f", nil}, {"e", true}}, + "\x0Aa\x00\x0Ac\x00\x0Ab\x00\x0Ad\x00\x0Af\x00\x08e\x00\x01"}, + {&dOnIface{bson.D{{"a", nil}, {"c", nil}, {"b", nil}, {"d", true}}}, + "\x03d\x00" + wrapInDoc("\x0Aa\x00\x0Ac\x00\x0Ab\x00\x08d\x00\x01")}, + + {bson.RawD{{"a", bson.Raw{0x0A, nil}}, {"c", bson.Raw{0x0A, nil}}, {"b", bson.Raw{0x08, []byte{0x01}}}}, + "\x0Aa\x00" + "\x0Ac\x00" + "\x08b\x00\x01"}, + {MyRawD{{"a", bson.Raw{0x0A, nil}}, {"c", bson.Raw{0x0A, nil}}, {"b", bson.Raw{0x08, []byte{0x01}}}}, + "\x0Aa\x00" + "\x0Ac\x00" + "\x08b\x00\x01"}, + {&dOnIface{bson.RawD{{"a", bson.Raw{0x0A, nil}}, {"c", bson.Raw{0x0A, nil}}, {"b", bson.Raw{0x08, []byte{0x01}}}}}, + "\x03d\x00" + wrapInDoc("\x0Aa\x00"+"\x0Ac\x00"+"\x08b\x00\x01")}, + + {&ignoreField{"before", "ignore", "after"}, + "\x02before\x00\a\x00\x00\x00before\x00\x02after\x00\x06\x00\x00\x00after\x00"}, + + // Marshalling a Raw document does nothing. + {bson.Raw{0x03, []byte(wrapInDoc("anything"))}, + "anything"}, + {bson.Raw{Data: []byte(wrapInDoc("anything"))}, + "anything"}, +} + +func (s *S) TestMarshalOneWayItems(c *C) { + for _, item := range marshalItems { + data, err := bson.Marshal(item.obj) + c.Assert(err, IsNil) + c.Assert(string(data), Equals, wrapInDoc(item.data)) + } +} + +// -------------------------------------------------------------------------- +// One-way unmarshaling tests. + +var unmarshalItems = []testItemType{ + // Field is private. Should not attempt to unmarshal it. + {&struct{ priv byte }{}, + "\x10priv\x00\x08\x00\x00\x00"}, + + // Wrong casing. Field names are lowercased. + {&struct{ Byte byte }{}, + "\x10Byte\x00\x08\x00\x00\x00"}, + + // Ignore non-existing field. + {&struct{ Byte byte }{9}, + "\x10boot\x00\x08\x00\x00\x00" + "\x10byte\x00\x09\x00\x00\x00"}, + + // Do not unmarshal on ignored field. + {&ignoreField{"before", "", "after"}, + "\x02before\x00\a\x00\x00\x00before\x00" + + "\x02-\x00\a\x00\x00\x00ignore\x00" + + "\x02after\x00\x06\x00\x00\x00after\x00"}, + + // Ignore unsuitable types silently. + {map[string]string{"str": "s"}, + "\x02str\x00\x02\x00\x00\x00s\x00" + "\x10int\x00\x01\x00\x00\x00"}, + {map[string][]int{"array": []int{5, 9}}, + "\x04array\x00" + wrapInDoc("\x100\x00\x05\x00\x00\x00"+"\x021\x00\x02\x00\x00\x00s\x00"+"\x102\x00\x09\x00\x00\x00")}, + + // Wrong type. Shouldn't init pointer. + {&struct{ Str *byte }{}, + "\x02str\x00\x02\x00\x00\x00s\x00"}, + {&struct{ Str *struct{ Str string } }{}, + "\x02str\x00\x02\x00\x00\x00s\x00"}, + + // Ordered document. + {&struct{ bson.D }{bson.D{{"a", nil}, {"c", nil}, {"b", nil}, {"d", true}}}, + "\x03d\x00" + wrapInDoc("\x0Aa\x00\x0Ac\x00\x0Ab\x00\x08d\x00\x01")}, + + // Raw document. + {&bson.Raw{0x03, []byte(wrapInDoc("\x10byte\x00\x08\x00\x00\x00"))}, + "\x10byte\x00\x08\x00\x00\x00"}, + + // RawD document. + {&struct{ bson.RawD }{bson.RawD{{"a", bson.Raw{0x0A, []byte{}}}, {"c", bson.Raw{0x0A, []byte{}}}, {"b", bson.Raw{0x08, []byte{0x01}}}}}, + "\x03rawd\x00" + wrapInDoc("\x0Aa\x00\x0Ac\x00\x08b\x00\x01")}, + + // Decode old binary. + {bson.M{"_": []byte("old")}, + "\x05_\x00\x07\x00\x00\x00\x02\x03\x00\x00\x00old"}, + + // Decode old binary without length. According to the spec, this shouldn't happen. + {bson.M{"_": []byte("old")}, + "\x05_\x00\x03\x00\x00\x00\x02old"}, +} + +func (s *S) TestUnmarshalOneWayItems(c *C) { + for _, item := range unmarshalItems { + testUnmarshal(c, wrapInDoc(item.data), item.obj) + } +} + +func (s *S) TestUnmarshalNilInStruct(c *C) { + // Nil is the default value, so we need to ensure it's indeed being set. + b := byte(1) + v := &struct{ Ptr *byte }{&b} + err := bson.Unmarshal([]byte(wrapInDoc("\x0Aptr\x00")), v) + c.Assert(err, IsNil) + c.Assert(v, DeepEquals, &struct{ Ptr *byte }{nil}) +} + +// -------------------------------------------------------------------------- +// Marshalling error cases. + +type structWithDupKeys struct { + Name byte + Other byte "name" // Tag should precede. +} + +var marshalErrorItems = []testItemType{ + {bson.M{"": uint64(1 << 63)}, + "BSON has no uint64 type, and value is too large to fit correctly in an int64"}, + {bson.M{"": bson.ObjectId("tooshort")}, + "ObjectIDs must be exactly 12 bytes long \\(got 8\\)"}, + {int64(123), + "Can't marshal int64 as a BSON document"}, + {bson.M{"": 1i}, + "Can't marshal complex128 in a BSON document"}, + {&structWithDupKeys{}, + "Duplicated key 'name' in struct bson_test.structWithDupKeys"}, + {bson.Raw{0x0A, []byte{}}, + "Attempted to unmarshal Raw kind 10 as a document"}, + {&inlineCantPtr{&struct{ A, B int }{1, 2}}, + "Option ,inline needs a struct value or map field"}, + {&inlineDupName{1, struct{ A, B int }{2, 3}}, + "Duplicated key 'a' in struct bson_test.inlineDupName"}, + {&inlineDupMap{}, + "Multiple ,inline maps in struct bson_test.inlineDupMap"}, + {&inlineBadKeyMap{}, + "Option ,inline needs a map with string keys in struct bson_test.inlineBadKeyMap"}, + {&inlineMap{A: 1, M: map[string]interface{}{"a": 1}}, + `Can't have key "a" in inlined map; conflicts with struct field`}, +} + +func (s *S) TestMarshalErrorItems(c *C) { + for _, item := range marshalErrorItems { + data, err := bson.Marshal(item.obj) + c.Assert(err, ErrorMatches, item.data) + c.Assert(data, IsNil) + } +} + +// -------------------------------------------------------------------------- +// Unmarshalling error cases. + +type unmarshalErrorType struct { + obj interface{} + data string + error string +} + +var unmarshalErrorItems = []unmarshalErrorType{ + // Tag name conflicts with existing parameter. + {&structWithDupKeys{}, + "\x10name\x00\x08\x00\x00\x00", + "Duplicated key 'name' in struct bson_test.structWithDupKeys"}, + + // Non-string map key. + {map[int]interface{}{}, + "\x10name\x00\x08\x00\x00\x00", + "BSON map must have string keys. Got: map\\[int\\]interface \\{\\}"}, + + {nil, + "\xEEname\x00", + "Unknown element kind \\(0xEE\\)"}, + + {struct{ Name bool }{}, + "\x10name\x00\x08\x00\x00\x00", + "Unmarshal can't deal with struct values. Use a pointer."}, + + {123, + "\x10name\x00\x08\x00\x00\x00", + "Unmarshal needs a map or a pointer to a struct."}, +} + +func (s *S) TestUnmarshalErrorItems(c *C) { + for _, item := range unmarshalErrorItems { + data := []byte(wrapInDoc(item.data)) + var value interface{} + switch reflect.ValueOf(item.obj).Kind() { + case reflect.Map, reflect.Ptr: + value = makeZeroDoc(item.obj) + case reflect.Invalid: + value = bson.M{} + default: + value = item.obj + } + err := bson.Unmarshal(data, value) + c.Assert(err, ErrorMatches, item.error) + } +} + +type unmarshalRawErrorType struct { + obj interface{} + raw bson.Raw + error string +} + +var unmarshalRawErrorItems = []unmarshalRawErrorType{ + // Tag name conflicts with existing parameter. + {&structWithDupKeys{}, + bson.Raw{0x03, []byte("\x10byte\x00\x08\x00\x00\x00")}, + "Duplicated key 'name' in struct bson_test.structWithDupKeys"}, + + {&struct{}{}, + bson.Raw{0xEE, []byte{}}, + "Unknown element kind \\(0xEE\\)"}, + + {struct{ Name bool }{}, + bson.Raw{0x10, []byte("\x08\x00\x00\x00")}, + "Raw Unmarshal can't deal with struct values. Use a pointer."}, + + {123, + bson.Raw{0x10, []byte("\x08\x00\x00\x00")}, + "Raw Unmarshal needs a map or a valid pointer."}, +} + +func (s *S) TestUnmarshalRawErrorItems(c *C) { + for i, item := range unmarshalRawErrorItems { + err := item.raw.Unmarshal(item.obj) + c.Assert(err, ErrorMatches, item.error, Commentf("Failed on item %d: %#v\n", i, item)) + } +} + +var corruptedData = []string{ + "\x04\x00\x00\x00\x00", // Shorter than minimum + "\x06\x00\x00\x00\x00", // Not enough data + "\x05\x00\x00", // Broken length + "\x05\x00\x00\x00\xff", // Corrupted termination + "\x0A\x00\x00\x00\x0Aooop\x00", // Unfinished C string + + // Array end past end of string (s[2]=0x07 is correct) + wrapInDoc("\x04\x00\x09\x00\x00\x00\x0A\x00\x00"), + + // Array end within string, but past acceptable. + wrapInDoc("\x04\x00\x08\x00\x00\x00\x0A\x00\x00"), + + // Document end within string, but past acceptable. + wrapInDoc("\x03\x00\x08\x00\x00\x00\x0A\x00\x00"), + + // String with corrupted end. + wrapInDoc("\x02\x00\x03\x00\x00\x00yo\xFF"), +} + +func (s *S) TestUnmarshalMapDocumentTooShort(c *C) { + for _, data := range corruptedData { + err := bson.Unmarshal([]byte(data), bson.M{}) + c.Assert(err, ErrorMatches, "Document is corrupted") + + err = bson.Unmarshal([]byte(data), &struct{}{}) + c.Assert(err, ErrorMatches, "Document is corrupted") + } +} + +// -------------------------------------------------------------------------- +// Setter test cases. + +var setterResult = map[string]error{} + +type setterType struct { + received interface{} +} + +func (o *setterType) SetBSON(raw bson.Raw) error { + err := raw.Unmarshal(&o.received) + if err != nil { + panic("The panic:" + err.Error()) + } + if s, ok := o.received.(string); ok { + if result, ok := setterResult[s]; ok { + return result + } + } + return nil +} + +type ptrSetterDoc struct { + Field *setterType "_" +} + +type valSetterDoc struct { + Field setterType "_" +} + +func (s *S) TestUnmarshalAllItemsWithPtrSetter(c *C) { + for _, item := range allItems { + for i := 0; i != 2; i++ { + var field *setterType + if i == 0 { + obj := &ptrSetterDoc{} + err := bson.Unmarshal([]byte(wrapInDoc(item.data)), obj) + c.Assert(err, IsNil) + field = obj.Field + } else { + obj := &valSetterDoc{} + err := bson.Unmarshal([]byte(wrapInDoc(item.data)), obj) + c.Assert(err, IsNil) + field = &obj.Field + } + if item.data == "" { + // Nothing to unmarshal. Should be untouched. + if i == 0 { + c.Assert(field, IsNil) + } else { + c.Assert(field.received, IsNil) + } + } else { + expected := item.obj.(bson.M)["_"] + c.Assert(field, NotNil, Commentf("Pointer not initialized (%#v)", expected)) + c.Assert(field.received, DeepEquals, expected) + } + } + } +} + +func (s *S) TestUnmarshalWholeDocumentWithSetter(c *C) { + obj := &setterType{} + err := bson.Unmarshal([]byte(sampleItems[0].data), obj) + c.Assert(err, IsNil) + c.Assert(obj.received, DeepEquals, bson.M{"hello": "world"}) +} + +func (s *S) TestUnmarshalSetterOmits(c *C) { + setterResult["2"] = &bson.TypeError{} + setterResult["4"] = &bson.TypeError{} + defer func() { + delete(setterResult, "2") + delete(setterResult, "4") + }() + + m := map[string]*setterType{} + data := wrapInDoc("\x02abc\x00\x02\x00\x00\x001\x00" + + "\x02def\x00\x02\x00\x00\x002\x00" + + "\x02ghi\x00\x02\x00\x00\x003\x00" + + "\x02jkl\x00\x02\x00\x00\x004\x00") + err := bson.Unmarshal([]byte(data), m) + c.Assert(err, IsNil) + c.Assert(m["abc"], NotNil) + c.Assert(m["def"], IsNil) + c.Assert(m["ghi"], NotNil) + c.Assert(m["jkl"], IsNil) + + c.Assert(m["abc"].received, Equals, "1") + c.Assert(m["ghi"].received, Equals, "3") +} + +func (s *S) TestUnmarshalSetterErrors(c *C) { + boom := errors.New("BOOM") + setterResult["2"] = boom + defer delete(setterResult, "2") + + m := map[string]*setterType{} + data := wrapInDoc("\x02abc\x00\x02\x00\x00\x001\x00" + + "\x02def\x00\x02\x00\x00\x002\x00" + + "\x02ghi\x00\x02\x00\x00\x003\x00") + err := bson.Unmarshal([]byte(data), m) + c.Assert(err, Equals, boom) + c.Assert(m["abc"], NotNil) + c.Assert(m["def"], IsNil) + c.Assert(m["ghi"], IsNil) + + c.Assert(m["abc"].received, Equals, "1") +} + +func (s *S) TestDMap(c *C) { + d := bson.D{{"a", 1}, {"b", 2}} + c.Assert(d.Map(), DeepEquals, bson.M{"a": 1, "b": 2}) +} + +func (s *S) TestUnmarshalSetterSetZero(c *C) { + setterResult["foo"] = bson.SetZero + defer delete(setterResult, "field") + + data, err := bson.Marshal(bson.M{"field": "foo"}) + c.Assert(err, IsNil) + + m := map[string]*setterType{} + err = bson.Unmarshal([]byte(data), m) + c.Assert(err, IsNil) + + value, ok := m["field"] + c.Assert(ok, Equals, true) + c.Assert(value, IsNil) +} + +// -------------------------------------------------------------------------- +// Getter test cases. + +type typeWithGetter struct { + result interface{} + err error +} + +func (t *typeWithGetter) GetBSON() (interface{}, error) { + if t == nil { + return "", nil + } + return t.result, t.err +} + +type docWithGetterField struct { + Field *typeWithGetter "_" +} + +func (s *S) TestMarshalAllItemsWithGetter(c *C) { + for i, item := range allItems { + if item.data == "" { + continue + } + obj := &docWithGetterField{} + obj.Field = &typeWithGetter{result: item.obj.(bson.M)["_"]} + data, err := bson.Marshal(obj) + c.Assert(err, IsNil) + c.Assert(string(data), Equals, wrapInDoc(item.data), + Commentf("Failed on item #%d", i)) + } +} + +func (s *S) TestMarshalWholeDocumentWithGetter(c *C) { + obj := &typeWithGetter{result: sampleItems[0].obj} + data, err := bson.Marshal(obj) + c.Assert(err, IsNil) + c.Assert(string(data), Equals, sampleItems[0].data) +} + +func (s *S) TestGetterErrors(c *C) { + e := errors.New("oops") + + obj1 := &docWithGetterField{} + obj1.Field = &typeWithGetter{sampleItems[0].obj, e} + data, err := bson.Marshal(obj1) + c.Assert(err, ErrorMatches, "oops") + c.Assert(data, IsNil) + + obj2 := &typeWithGetter{sampleItems[0].obj, e} + data, err = bson.Marshal(obj2) + c.Assert(err, ErrorMatches, "oops") + c.Assert(data, IsNil) +} + +type intGetter int64 + +func (t intGetter) GetBSON() (interface{}, error) { + return int64(t), nil +} + +type typeWithIntGetter struct { + V intGetter ",minsize" +} + +func (s *S) TestMarshalShortWithGetter(c *C) { + obj := typeWithIntGetter{42} + data, err := bson.Marshal(obj) + c.Assert(err, IsNil) + m := bson.M{} + err = bson.Unmarshal(data, m) + c.Assert(err, IsNil) + c.Assert(m["v"], Equals, 42) +} + +func (s *S) TestMarshalWithGetterNil(c *C) { + obj := docWithGetterField{} + data, err := bson.Marshal(obj) + c.Assert(err, IsNil) + m := bson.M{} + err = bson.Unmarshal(data, m) + c.Assert(err, IsNil) + c.Assert(m, DeepEquals, bson.M{"_": ""}) +} + +// -------------------------------------------------------------------------- +// Cross-type conversion tests. + +type crossTypeItem struct { + obj1 interface{} + obj2 interface{} +} + +type condStr struct { + V string ",omitempty" +} +type condStrNS struct { + V string `a:"A" bson:",omitempty" b:"B"` +} +type condBool struct { + V bool ",omitempty" +} +type condInt struct { + V int ",omitempty" +} +type condUInt struct { + V uint ",omitempty" +} +type condFloat struct { + V float64 ",omitempty" +} +type condIface struct { + V interface{} ",omitempty" +} +type condPtr struct { + V *bool ",omitempty" +} +type condSlice struct { + V []string ",omitempty" +} +type condMap struct { + V map[string]int ",omitempty" +} +type namedCondStr struct { + V string "myv,omitempty" +} +type condTime struct { + V time.Time ",omitempty" +} +type condStruct struct { + V struct{ A []int } ",omitempty" +} + +type shortInt struct { + V int64 ",minsize" +} +type shortUint struct { + V uint64 ",minsize" +} +type shortIface struct { + V interface{} ",minsize" +} +type shortPtr struct { + V *int64 ",minsize" +} +type shortNonEmptyInt struct { + V int64 ",minsize,omitempty" +} + +type inlineInt struct { + V struct{ A, B int } ",inline" +} +type inlineCantPtr struct { + V *struct{ A, B int } ",inline" +} +type inlineDupName struct { + A int + V struct{ A, B int } ",inline" +} +type inlineMap struct { + A int + M map[string]interface{} ",inline" +} +type inlineMapInt struct { + A int + M map[string]int ",inline" +} +type inlineMapMyM struct { + A int + M MyM ",inline" +} +type inlineDupMap struct { + M1 map[string]interface{} ",inline" + M2 map[string]interface{} ",inline" +} +type inlineBadKeyMap struct { + M map[int]int ",inline" +} + +type ( + MyString string + MyBytes []byte + MyBool bool + MyD []bson.DocElem + MyRawD []bson.RawDocElem + MyM map[string]interface{} +) + +var ( + truevar = true + falsevar = false + + int64var = int64(42) + int64ptr = &int64var + intvar = int(42) + intptr = &intvar +) + +func parseURL(s string) *url.URL { + u, err := url.Parse(s) + if err != nil { + panic(err) + } + return u +} + +// That's a pretty fun test. It will dump the first item, generate a zero +// value equivalent to the second one, load the dumped data onto it, and then +// verify that the resulting value is deep-equal to the untouched second value. +// Then, it will do the same in the *opposite* direction! +var twoWayCrossItems = []crossTypeItem{ + // int<=>int + {&struct{ I int }{42}, &struct{ I int8 }{42}}, + {&struct{ I int }{42}, &struct{ I int32 }{42}}, + {&struct{ I int }{42}, &struct{ I int64 }{42}}, + {&struct{ I int8 }{42}, &struct{ I int32 }{42}}, + {&struct{ I int8 }{42}, &struct{ I int64 }{42}}, + {&struct{ I int32 }{42}, &struct{ I int64 }{42}}, + + // uint<=>uint + {&struct{ I uint }{42}, &struct{ I uint8 }{42}}, + {&struct{ I uint }{42}, &struct{ I uint32 }{42}}, + {&struct{ I uint }{42}, &struct{ I uint64 }{42}}, + {&struct{ I uint8 }{42}, &struct{ I uint32 }{42}}, + {&struct{ I uint8 }{42}, &struct{ I uint64 }{42}}, + {&struct{ I uint32 }{42}, &struct{ I uint64 }{42}}, + + // float32<=>float64 + {&struct{ I float32 }{42}, &struct{ I float64 }{42}}, + + // int<=>uint + {&struct{ I uint }{42}, &struct{ I int }{42}}, + {&struct{ I uint }{42}, &struct{ I int8 }{42}}, + {&struct{ I uint }{42}, &struct{ I int32 }{42}}, + {&struct{ I uint }{42}, &struct{ I int64 }{42}}, + {&struct{ I uint8 }{42}, &struct{ I int }{42}}, + {&struct{ I uint8 }{42}, &struct{ I int8 }{42}}, + {&struct{ I uint8 }{42}, &struct{ I int32 }{42}}, + {&struct{ I uint8 }{42}, &struct{ I int64 }{42}}, + {&struct{ I uint32 }{42}, &struct{ I int }{42}}, + {&struct{ I uint32 }{42}, &struct{ I int8 }{42}}, + {&struct{ I uint32 }{42}, &struct{ I int32 }{42}}, + {&struct{ I uint32 }{42}, &struct{ I int64 }{42}}, + {&struct{ I uint64 }{42}, &struct{ I int }{42}}, + {&struct{ I uint64 }{42}, &struct{ I int8 }{42}}, + {&struct{ I uint64 }{42}, &struct{ I int32 }{42}}, + {&struct{ I uint64 }{42}, &struct{ I int64 }{42}}, + + // int <=> float + {&struct{ I int }{42}, &struct{ I float64 }{42}}, + + // int <=> bool + {&struct{ I int }{1}, &struct{ I bool }{true}}, + {&struct{ I int }{0}, &struct{ I bool }{false}}, + + // uint <=> float64 + {&struct{ I uint }{42}, &struct{ I float64 }{42}}, + + // uint <=> bool + {&struct{ I uint }{1}, &struct{ I bool }{true}}, + {&struct{ I uint }{0}, &struct{ I bool }{false}}, + + // float64 <=> bool + {&struct{ I float64 }{1}, &struct{ I bool }{true}}, + {&struct{ I float64 }{0}, &struct{ I bool }{false}}, + + // string <=> string and string <=> []byte + {&struct{ S []byte }{[]byte("abc")}, &struct{ S string }{"abc"}}, + {&struct{ S []byte }{[]byte("def")}, &struct{ S bson.Symbol }{"def"}}, + {&struct{ S string }{"ghi"}, &struct{ S bson.Symbol }{"ghi"}}, + + // map <=> struct + {&struct { + A struct { + B, C int + } + }{struct{ B, C int }{1, 2}}, + map[string]map[string]int{"a": map[string]int{"b": 1, "c": 2}}}, + + {&struct{ A bson.Symbol }{"abc"}, map[string]string{"a": "abc"}}, + {&struct{ A bson.Symbol }{"abc"}, map[string][]byte{"a": []byte("abc")}}, + {&struct{ A []byte }{[]byte("abc")}, map[string]string{"a": "abc"}}, + {&struct{ A uint }{42}, map[string]int{"a": 42}}, + {&struct{ A uint }{42}, map[string]float64{"a": 42}}, + {&struct{ A uint }{1}, map[string]bool{"a": true}}, + {&struct{ A int }{42}, map[string]uint{"a": 42}}, + {&struct{ A int }{42}, map[string]float64{"a": 42}}, + {&struct{ A int }{1}, map[string]bool{"a": true}}, + {&struct{ A float64 }{42}, map[string]float32{"a": 42}}, + {&struct{ A float64 }{42}, map[string]int{"a": 42}}, + {&struct{ A float64 }{42}, map[string]uint{"a": 42}}, + {&struct{ A float64 }{1}, map[string]bool{"a": true}}, + {&struct{ A bool }{true}, map[string]int{"a": 1}}, + {&struct{ A bool }{true}, map[string]uint{"a": 1}}, + {&struct{ A bool }{true}, map[string]float64{"a": 1}}, + {&struct{ A **byte }{&byteptr}, map[string]byte{"a": 8}}, + + // url.URL <=> string + {&struct{ URL *url.URL }{parseURL("h://e.c/p")}, map[string]string{"url": "h://e.c/p"}}, + {&struct{ URL url.URL }{*parseURL("h://e.c/p")}, map[string]string{"url": "h://e.c/p"}}, + + // Slices + {&struct{ S []int }{[]int{1, 2, 3}}, map[string][]int{"s": []int{1, 2, 3}}}, + {&struct{ S *[]int }{&[]int{1, 2, 3}}, map[string][]int{"s": []int{1, 2, 3}}}, + + // Conditionals + {&condBool{true}, map[string]bool{"v": true}}, + {&condBool{}, map[string]bool{}}, + {&condInt{1}, map[string]int{"v": 1}}, + {&condInt{}, map[string]int{}}, + {&condUInt{1}, map[string]uint{"v": 1}}, + {&condUInt{}, map[string]uint{}}, + {&condFloat{}, map[string]int{}}, + {&condStr{"yo"}, map[string]string{"v": "yo"}}, + {&condStr{}, map[string]string{}}, + {&condStrNS{"yo"}, map[string]string{"v": "yo"}}, + {&condStrNS{}, map[string]string{}}, + {&condSlice{[]string{"yo"}}, map[string][]string{"v": []string{"yo"}}}, + {&condSlice{}, map[string][]string{}}, + {&condMap{map[string]int{"k": 1}}, bson.M{"v": bson.M{"k": 1}}}, + {&condMap{}, map[string][]string{}}, + {&condIface{"yo"}, map[string]string{"v": "yo"}}, + {&condIface{""}, map[string]string{"v": ""}}, + {&condIface{}, map[string]string{}}, + {&condPtr{&truevar}, map[string]bool{"v": true}}, + {&condPtr{&falsevar}, map[string]bool{"v": false}}, + {&condPtr{}, map[string]string{}}, + + {&condTime{time.Unix(123456789, 123e6)}, map[string]time.Time{"v": time.Unix(123456789, 123e6)}}, + {&condTime{}, map[string]string{}}, + + {&condStruct{struct{ A []int }{[]int{1}}}, bson.M{"v": bson.M{"a": []interface{}{1}}}}, + {&condStruct{struct{ A []int }{}}, bson.M{}}, + + {&namedCondStr{"yo"}, map[string]string{"myv": "yo"}}, + {&namedCondStr{}, map[string]string{}}, + + {&shortInt{1}, map[string]interface{}{"v": 1}}, + {&shortInt{1 << 30}, map[string]interface{}{"v": 1 << 30}}, + {&shortInt{1 << 31}, map[string]interface{}{"v": int64(1 << 31)}}, + {&shortUint{1 << 30}, map[string]interface{}{"v": 1 << 30}}, + {&shortUint{1 << 31}, map[string]interface{}{"v": int64(1 << 31)}}, + {&shortIface{int64(1) << 31}, map[string]interface{}{"v": int64(1 << 31)}}, + {&shortPtr{int64ptr}, map[string]interface{}{"v": intvar}}, + + {&shortNonEmptyInt{1}, map[string]interface{}{"v": 1}}, + {&shortNonEmptyInt{1 << 31}, map[string]interface{}{"v": int64(1 << 31)}}, + {&shortNonEmptyInt{}, map[string]interface{}{}}, + + {&inlineInt{struct{ A, B int }{1, 2}}, map[string]interface{}{"a": 1, "b": 2}}, + {&inlineMap{A: 1, M: map[string]interface{}{"b": 2}}, map[string]interface{}{"a": 1, "b": 2}}, + {&inlineMap{A: 1, M: nil}, map[string]interface{}{"a": 1}}, + {&inlineMapInt{A: 1, M: map[string]int{"b": 2}}, map[string]int{"a": 1, "b": 2}}, + {&inlineMapInt{A: 1, M: nil}, map[string]int{"a": 1}}, + {&inlineMapMyM{A: 1, M: MyM{"b": MyM{"c": 3}}}, map[string]interface{}{"a": 1, "b": map[string]interface{}{"c": 3}}}, + + // []byte <=> MyBytes + {&struct{ B MyBytes }{[]byte("abc")}, map[string]string{"b": "abc"}}, + {&struct{ B MyBytes }{[]byte{}}, map[string]string{"b": ""}}, + {&struct{ B MyBytes }{}, map[string]bool{}}, + {&struct{ B []byte }{[]byte("abc")}, map[string]MyBytes{"b": []byte("abc")}}, + + // bool <=> MyBool + {&struct{ B MyBool }{true}, map[string]bool{"b": true}}, + {&struct{ B MyBool }{}, map[string]bool{"b": false}}, + {&struct{ B MyBool }{}, map[string]string{}}, + {&struct{ B bool }{}, map[string]MyBool{"b": false}}, + + // arrays + {&struct{ V [2]int }{[...]int{1, 2}}, map[string][2]int{"v": [2]int{1, 2}}}, + + // zero time + {&struct{ V time.Time }{}, map[string]interface{}{"v": time.Time{}}}, + + // zero time + 1 second + 1 millisecond; overflows int64 as nanoseconds + {&struct{ V time.Time }{time.Unix(-62135596799, 1e6).Local()}, + map[string]interface{}{"v": time.Unix(-62135596799, 1e6).Local()}}, + + // bson.D <=> []DocElem + {&bson.D{{"a", bson.D{{"b", 1}, {"c", 2}}}}, &bson.D{{"a", bson.D{{"b", 1}, {"c", 2}}}}}, + {&bson.D{{"a", bson.D{{"b", 1}, {"c", 2}}}}, &MyD{{"a", MyD{{"b", 1}, {"c", 2}}}}}, + + // bson.RawD <=> []RawDocElem + {&bson.RawD{{"a", bson.Raw{0x08, []byte{0x01}}}}, &bson.RawD{{"a", bson.Raw{0x08, []byte{0x01}}}}}, + {&bson.RawD{{"a", bson.Raw{0x08, []byte{0x01}}}}, &MyRawD{{"a", bson.Raw{0x08, []byte{0x01}}}}}, + + // bson.M <=> map + {bson.M{"a": bson.M{"b": 1, "c": 2}}, MyM{"a": MyM{"b": 1, "c": 2}}}, + {bson.M{"a": bson.M{"b": 1, "c": 2}}, map[string]interface{}{"a": map[string]interface{}{"b": 1, "c": 2}}}, + + // bson.M <=> map[MyString] + {bson.M{"a": bson.M{"b": 1, "c": 2}}, map[MyString]interface{}{"a": map[MyString]interface{}{"b": 1, "c": 2}}}, + + // json.Number <=> int64, float64 + {&struct{ N json.Number }{"5"}, map[string]interface{}{"n": int64(5)}}, + {&struct{ N json.Number }{"5.05"}, map[string]interface{}{"n": 5.05}}, + {&struct{ N json.Number }{"9223372036854776000"}, map[string]interface{}{"n": float64(1 << 63)}}, +} + +// Same thing, but only one way (obj1 => obj2). +var oneWayCrossItems = []crossTypeItem{ + // map <=> struct + {map[string]interface{}{"a": 1, "b": "2", "c": 3}, map[string]int{"a": 1, "c": 3}}, + + // inline map elides badly typed values + {map[string]interface{}{"a": 1, "b": "2", "c": 3}, &inlineMapInt{A: 1, M: map[string]int{"c": 3}}}, + + // Can't decode int into struct. + {bson.M{"a": bson.M{"b": 2}}, &struct{ A bool }{}}, + + // Would get decoded into a int32 too in the opposite direction. + {&shortIface{int64(1) << 30}, map[string]interface{}{"v": 1 << 30}}, +} + +func testCrossPair(c *C, dump interface{}, load interface{}) { + c.Logf("Dump: %#v", dump) + c.Logf("Load: %#v", load) + zero := makeZeroDoc(load) + data, err := bson.Marshal(dump) + c.Assert(err, IsNil) + c.Logf("Dumped: %#v", string(data)) + err = bson.Unmarshal(data, zero) + c.Assert(err, IsNil) + c.Logf("Loaded: %#v", zero) + c.Assert(zero, DeepEquals, load) +} + +func (s *S) TestTwoWayCrossPairs(c *C) { + for _, item := range twoWayCrossItems { + testCrossPair(c, item.obj1, item.obj2) + testCrossPair(c, item.obj2, item.obj1) + } +} + +func (s *S) TestOneWayCrossPairs(c *C) { + for _, item := range oneWayCrossItems { + testCrossPair(c, item.obj1, item.obj2) + } +} + +// -------------------------------------------------------------------------- +// ObjectId hex representation test. + +func (s *S) TestObjectIdHex(c *C) { + id := bson.ObjectIdHex("4d88e15b60f486e428412dc9") + c.Assert(id.String(), Equals, `ObjectIdHex("4d88e15b60f486e428412dc9")`) + c.Assert(id.Hex(), Equals, "4d88e15b60f486e428412dc9") +} + +func (s *S) TestIsObjectIdHex(c *C) { + test := []struct { + id string + valid bool + }{ + {"4d88e15b60f486e428412dc9", true}, + {"4d88e15b60f486e428412dc", false}, + {"4d88e15b60f486e428412dc9e", false}, + {"4d88e15b60f486e428412dcx", false}, + } + for _, t := range test { + c.Assert(bson.IsObjectIdHex(t.id), Equals, t.valid) + } +} + +// -------------------------------------------------------------------------- +// ObjectId parts extraction tests. + +type objectIdParts struct { + id bson.ObjectId + timestamp int64 + machine []byte + pid uint16 + counter int32 +} + +var objectIds = []objectIdParts{ + objectIdParts{ + bson.ObjectIdHex("4d88e15b60f486e428412dc9"), + 1300816219, + []byte{0x60, 0xf4, 0x86}, + 0xe428, + 4271561, + }, + objectIdParts{ + bson.ObjectIdHex("000000000000000000000000"), + 0, + []byte{0x00, 0x00, 0x00}, + 0x0000, + 0, + }, + objectIdParts{ + bson.ObjectIdHex("00000000aabbccddee000001"), + 0, + []byte{0xaa, 0xbb, 0xcc}, + 0xddee, + 1, + }, +} + +func (s *S) TestObjectIdPartsExtraction(c *C) { + for i, v := range objectIds { + t := time.Unix(v.timestamp, 0) + c.Assert(v.id.Time(), Equals, t, Commentf("#%d Wrong timestamp value", i)) + c.Assert(v.id.Machine(), DeepEquals, v.machine, Commentf("#%d Wrong machine id value", i)) + c.Assert(v.id.Pid(), Equals, v.pid, Commentf("#%d Wrong pid value", i)) + c.Assert(v.id.Counter(), Equals, v.counter, Commentf("#%d Wrong counter value", i)) + } +} + +func (s *S) TestNow(c *C) { + before := time.Now() + time.Sleep(1e6) + now := bson.Now() + time.Sleep(1e6) + after := time.Now() + c.Assert(now.After(before) && now.Before(after), Equals, true, Commentf("now=%s, before=%s, after=%s", now, before, after)) +} + +// -------------------------------------------------------------------------- +// ObjectId generation tests. + +func (s *S) TestNewObjectId(c *C) { + // Generate 10 ids + ids := make([]bson.ObjectId, 10) + for i := 0; i < 10; i++ { + ids[i] = bson.NewObjectId() + } + for i := 1; i < 10; i++ { + prevId := ids[i-1] + id := ids[i] + // Test for uniqueness among all other 9 generated ids + for j, tid := range ids { + if j != i { + c.Assert(id, Not(Equals), tid, Commentf("Generated ObjectId is not unique")) + } + } + // Check that timestamp was incremented and is within 30 seconds of the previous one + secs := id.Time().Sub(prevId.Time()).Seconds() + c.Assert((secs >= 0 && secs <= 30), Equals, true, Commentf("Wrong timestamp in generated ObjectId")) + // Check that machine ids are the same + c.Assert(id.Machine(), DeepEquals, prevId.Machine()) + // Check that pids are the same + c.Assert(id.Pid(), Equals, prevId.Pid()) + // Test for proper increment + delta := int(id.Counter() - prevId.Counter()) + c.Assert(delta, Equals, 1, Commentf("Wrong increment in generated ObjectId")) + } +} + +func (s *S) TestNewObjectIdWithTime(c *C) { + t := time.Unix(12345678, 0) + id := bson.NewObjectIdWithTime(t) + c.Assert(id.Time(), Equals, t) + c.Assert(id.Machine(), DeepEquals, []byte{0x00, 0x00, 0x00}) + c.Assert(int(id.Pid()), Equals, 0) + c.Assert(int(id.Counter()), Equals, 0) +} + +// -------------------------------------------------------------------------- +// ObjectId JSON marshalling. + +type jsonType struct { + Id *bson.ObjectId +} + +func (s *S) TestObjectIdJSONMarshaling(c *C) { + id := bson.ObjectIdHex("4d88e15b60f486e428412dc9") + v := jsonType{Id: &id} + data, err := json.Marshal(&v) + c.Assert(err, IsNil) + c.Assert(string(data), Equals, `{"Id":"4d88e15b60f486e428412dc9"}`) +} + +func (s *S) TestObjectIdJSONUnmarshaling(c *C) { + data := []byte(`{"Id":"4d88e15b60f486e428412dc9"}`) + v := jsonType{} + err := json.Unmarshal(data, &v) + c.Assert(err, IsNil) + c.Assert(*v.Id, Equals, bson.ObjectIdHex("4d88e15b60f486e428412dc9")) +} + +func (s *S) TestObjectIdJSONUnmarshalingError(c *C) { + v := jsonType{} + err := json.Unmarshal([]byte(`{"Id":"4d88e15b60f486e428412dc9A"}`), &v) + c.Assert(err, ErrorMatches, `Invalid ObjectId in JSON: "4d88e15b60f486e428412dc9A"`) + err = json.Unmarshal([]byte(`{"Id":"4d88e15b60f486e428412dcZ"}`), &v) + c.Assert(err, ErrorMatches, `Invalid ObjectId in JSON: "4d88e15b60f486e428412dcZ" .*`) +} + +// -------------------------------------------------------------------------- +// Some simple benchmarks. + +type BenchT struct { + A, B, C, D, E, F string +} + +func BenchmarkUnmarhsalStruct(b *testing.B) { + v := BenchT{A: "A", D: "D", E: "E"} + data, err := bson.Marshal(&v) + if err != nil { + panic(err) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + err = bson.Unmarshal(data, &v) + } + if err != nil { + panic(err) + } +} + +func BenchmarkUnmarhsalMap(b *testing.B) { + m := bson.M{"a": "a", "d": "d", "e": "e"} + data, err := bson.Marshal(&m) + if err != nil { + panic(err) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + err = bson.Unmarshal(data, &m) + } + if err != nil { + panic(err) + } +} diff --git a/_vendor/vendor/github.com/siddontang/go/bson/decode.go b/vendor/github.com/siddontang/go/bson/decode.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/go/bson/decode.go rename to vendor/github.com/siddontang/go/bson/decode.go diff --git a/_vendor/vendor/github.com/siddontang/go/bson/encode.go b/vendor/github.com/siddontang/go/bson/encode.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/go/bson/encode.go rename to vendor/github.com/siddontang/go/bson/encode.go diff --git a/_vendor/vendor/github.com/siddontang/go/filelock/LICENSE b/vendor/github.com/siddontang/go/filelock/LICENSE similarity index 100% rename from _vendor/vendor/github.com/siddontang/go/filelock/LICENSE rename to vendor/github.com/siddontang/go/filelock/LICENSE diff --git a/_vendor/vendor/github.com/siddontang/go/filelock/file_lock_generic.go b/vendor/github.com/siddontang/go/filelock/file_lock_generic.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/go/filelock/file_lock_generic.go rename to vendor/github.com/siddontang/go/filelock/file_lock_generic.go diff --git a/_vendor/vendor/github.com/siddontang/go/filelock/file_lock_solaris.go b/vendor/github.com/siddontang/go/filelock/file_lock_solaris.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/go/filelock/file_lock_solaris.go rename to vendor/github.com/siddontang/go/filelock/file_lock_solaris.go diff --git a/vendor/github.com/siddontang/go/filelock/file_lock_test.go b/vendor/github.com/siddontang/go/filelock/file_lock_test.go new file mode 100644 index 0000000..3575fc2 --- /dev/null +++ b/vendor/github.com/siddontang/go/filelock/file_lock_test.go @@ -0,0 +1,77 @@ +// Copyright 2014 The LevelDB-Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +package filelock + +import ( + "bytes" + "flag" + "io/ioutil" + "os" + "os/exec" + "testing" +) + +var lockFilename = flag.String("lockfile", "", "File to lock. Non-empty value pimples child process.") + +func spawn(prog, filename string) ([]byte, error) { + return exec.Command(prog, "-lockfile", filename, "-test.v", + "-test.run=TestLock$").CombinedOutput() +} + +// TestLock locks a file, spawns a second process that attempts to grab the +// lock to verify it fails. +// Then it closes the lock, and spawns a third copy to verify it can be +// relocked. +func TestLock(t *testing.T) { + child := *lockFilename != "" + var filename string + if child { + filename = *lockFilename + } else { + f, err := ioutil.TempFile("", "") + if err != nil { + t.Fatal(err) + } + filename = f.Name() + defer os.Remove(filename) + } + + // Avoid truncating an existing, non-empty file. + fi, err := os.Stat(filename) + if err == nil && fi.Size() != 0 { + t.Fatal("The file %s is not empty", filename) + } + + t.Logf("Locking %s\n", filename) + lock, err := Lock(filename) + if err != nil { + t.Fatalf("Could not lock %s: %v", filename, err) + } + + if !child { + t.Logf("Spawning child, should fail to grab lock.") + out, err := spawn(os.Args[0], filename) + if err == nil { + t.Fatalf("Attempt to grab open lock should have failed.\n%s", out) + } + if !bytes.Contains(out, []byte("Could not lock")) { + t.Fatalf("Child failed with unexpected output: %s\n", out) + } + t.Logf("Child failed to grab lock as expected.") + } + + t.Logf("Unlocking %s", filename) + if err := lock.Close(); err != nil { + t.Fatalf("Could not unlock %s: %v", filename, err) + } + + if !child { + t.Logf("Spawning child, should successfully grab lock.") + if out, err := spawn(os.Args[0], filename); err != nil { + t.Fatalf("Attempt to re-open lock should have succeeded: %v\n%s", + err, out) + } + t.Logf("Child grabbed lock.") + } +} diff --git a/_vendor/vendor/github.com/siddontang/go/filelock/file_lock_unix.go b/vendor/github.com/siddontang/go/filelock/file_lock_unix.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/go/filelock/file_lock_unix.go rename to vendor/github.com/siddontang/go/filelock/file_lock_unix.go diff --git a/_vendor/vendor/github.com/siddontang/go/filelock/file_lock_windows.go b/vendor/github.com/siddontang/go/filelock/file_lock_windows.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/go/filelock/file_lock_windows.go rename to vendor/github.com/siddontang/go/filelock/file_lock_windows.go diff --git a/_vendor/vendor/github.com/siddontang/go/hack/hack.go b/vendor/github.com/siddontang/go/hack/hack.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/go/hack/hack.go rename to vendor/github.com/siddontang/go/hack/hack.go diff --git a/vendor/github.com/siddontang/go/hack/hack_test.go b/vendor/github.com/siddontang/go/hack/hack_test.go new file mode 100644 index 0000000..7b11b0b --- /dev/null +++ b/vendor/github.com/siddontang/go/hack/hack_test.go @@ -0,0 +1,36 @@ +package hack + +import ( + "bytes" + "testing" +) + +func TestString(t *testing.T) { + b := []byte("hello world") + a := String(b) + + if a != "hello world" { + t.Fatal(a) + } + + b[0] = 'a' + + if a != "aello world" { + t.Fatal(a) + } + + b = append(b, "abc"...) + if a != "aello world" { + t.Fatal(a) + } +} + +func TestByte(t *testing.T) { + a := "hello world" + + b := Slice(a) + + if !bytes.Equal(b, []byte("hello world")) { + t.Fatal(string(b)) + } +} diff --git a/_vendor/vendor/github.com/siddontang/go/ioutil2/ioutil.go b/vendor/github.com/siddontang/go/ioutil2/ioutil.go similarity index 93% rename from _vendor/vendor/github.com/siddontang/go/ioutil2/ioutil.go rename to vendor/github.com/siddontang/go/ioutil2/ioutil.go index c99c987..35c0ad3 100644 --- a/_vendor/vendor/github.com/siddontang/go/ioutil2/ioutil.go +++ b/vendor/github.com/siddontang/go/ioutil2/ioutil.go @@ -13,7 +13,7 @@ import ( // Write file to temp and atomically move when everything else succeeds. func WriteFileAtomic(filename string, data []byte, perm os.FileMode) error { - dir, name := path.Split(filename) + dir, name := path.Dir(filename), path.Base(filename) f, err := ioutil.TempFile(dir, name) if err != nil { return err diff --git a/_vendor/vendor/github.com/siddontang/go/ioutil2/sectionwriter.go b/vendor/github.com/siddontang/go/ioutil2/sectionwriter.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/go/ioutil2/sectionwriter.go rename to vendor/github.com/siddontang/go/ioutil2/sectionwriter.go diff --git a/vendor/github.com/siddontang/go/ioutil2/sectionwriter_test.go b/vendor/github.com/siddontang/go/ioutil2/sectionwriter_test.go new file mode 100644 index 0000000..35bf6d7 --- /dev/null +++ b/vendor/github.com/siddontang/go/ioutil2/sectionwriter_test.go @@ -0,0 +1,56 @@ +package ioutil2 + +import ( + "io/ioutil" + "os" + "testing" +) + +func TestSectionWriter(t *testing.T) { + f, err := ioutil.TempFile(".", "test_") + if err != nil { + t.Fatal(err) + } + + defer func() { + n := f.Name() + f.Close() + os.Remove(n) + }() + + f.Truncate(3) + + rw := NewSectionWriter(f, 0, 1) + + _, err = rw.Write([]byte{'1'}) + if err != nil { + t.Fatal(err) + } + + _, err = rw.Write([]byte{'1'}) + if err == nil { + t.Fatal("must err") + } + + rw = NewSectionWriter(f, 1, 2) + + _, err = rw.Write([]byte{'2', '3', '4'}) + if err == nil { + t.Fatal("must err") + } + + _, err = rw.Write([]byte{'2', '3'}) + if err != nil { + t.Fatal(err) + } + + buf := make([]byte, 3) + _, err = f.ReadAt(buf, 0) + if err != nil { + t.Fatal(err) + } + + if string(buf) != "123" { + t.Fatal(string(buf)) + } +} diff --git a/_vendor/vendor/github.com/siddontang/go/log/doc.go b/vendor/github.com/siddontang/go/log/doc.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/go/log/doc.go rename to vendor/github.com/siddontang/go/log/doc.go diff --git a/_vendor/vendor/github.com/siddontang/go/log/filehandler.go b/vendor/github.com/siddontang/go/log/filehandler.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/go/log/filehandler.go rename to vendor/github.com/siddontang/go/log/filehandler.go diff --git a/_vendor/vendor/github.com/siddontang/go/log/handler.go b/vendor/github.com/siddontang/go/log/handler.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/go/log/handler.go rename to vendor/github.com/siddontang/go/log/handler.go diff --git a/_vendor/vendor/github.com/siddontang/go/log/log.go b/vendor/github.com/siddontang/go/log/log.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/go/log/log.go rename to vendor/github.com/siddontang/go/log/log.go diff --git a/vendor/github.com/siddontang/go/log/log_test.go b/vendor/github.com/siddontang/go/log/log_test.go new file mode 100644 index 0000000..bc5ffa1 --- /dev/null +++ b/vendor/github.com/siddontang/go/log/log_test.go @@ -0,0 +1,68 @@ +package log + +import ( + "os" + "testing" +) + +func TestStdStreamLog(t *testing.T) { + h, _ := NewStreamHandler(os.Stdout) + s := NewDefault(h) + s.Info("hello world") + + s.Close() + + s.Info("can not log") + + Info("hello world") + + SetHandler(os.Stderr) + + Infof("%s %d", "Hello", 123) + + SetLevel(LevelError) + + Infof("%s %d", "Hello", 123) + + SetLevelByName("info") + + Infof("%s %d", "Hello", 123) + + Fatalf("%s %d", "Hello", 123) +} + +func TestRotatingFileLog(t *testing.T) { + path := "./test_log" + os.RemoveAll(path) + + os.Mkdir(path, 0777) + fileName := path + "/test" + + h, err := NewRotatingFileHandler(fileName, 10, 2) + if err != nil { + t.Fatal(err) + } + + buf := make([]byte, 10) + + h.Write(buf) + + h.Write(buf) + + if _, err := os.Stat(fileName + ".1"); err != nil { + t.Fatal(err) + } + + if _, err := os.Stat(fileName + ".2"); err == nil { + t.Fatal(err) + } + + h.Write(buf) + if _, err := os.Stat(fileName + ".2"); err != nil { + t.Fatal(err) + } + + h.Close() + + os.RemoveAll(path) +} diff --git a/_vendor/vendor/github.com/siddontang/go/log/sockethandler.go b/vendor/github.com/siddontang/go/log/sockethandler.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/go/log/sockethandler.go rename to vendor/github.com/siddontang/go/log/sockethandler.go diff --git a/_vendor/vendor/github.com/siddontang/go/num/bytes.go b/vendor/github.com/siddontang/go/num/bytes.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/go/num/bytes.go rename to vendor/github.com/siddontang/go/num/bytes.go diff --git a/_vendor/vendor/github.com/siddontang/go/num/cmp.go b/vendor/github.com/siddontang/go/num/cmp.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/go/num/cmp.go rename to vendor/github.com/siddontang/go/num/cmp.go diff --git a/vendor/github.com/siddontang/go/num/num_test.go b/vendor/github.com/siddontang/go/num/num_test.go new file mode 100644 index 0000000..9c64481 --- /dev/null +++ b/vendor/github.com/siddontang/go/num/num_test.go @@ -0,0 +1,209 @@ +package num + +import ( + "testing" +) + +func testMin(t *testing.T, v1 interface{}, v2 interface{}, v interface{}) { + var c interface{} + switch i1 := v1.(type) { + case int: + c = MinInt(i1, v2.(int)) + case int8: + c = MinInt8(i1, v2.(int8)) + case int16: + c = MinInt16(i1, v2.(int16)) + case int32: + c = MinInt32(i1, v2.(int32)) + case int64: + c = MinInt64(i1, v2.(int64)) + case uint: + c = MinUint(i1, v2.(uint)) + case uint8: + c = MinUint8(i1, v2.(uint8)) + case uint16: + c = MinUint16(i1, v2.(uint16)) + case uint32: + c = MinUint32(i1, v2.(uint32)) + case uint64: + c = MinUint64(i1, v2.(uint64)) + default: + t.Fatalf("invalid type %T", t) + } + + if c != v { + t.Fatalf("invalid %v(%T) != %v(%T)", c, c, v, v) + } +} + +func TestMin(t *testing.T) { + testMin(t, int(1), int(2), int(1)) + testMin(t, int(1), int(1), int(1)) + + testMin(t, int8(1), int8(2), int8(1)) + testMin(t, int8(1), int8(1), int8(1)) + + testMin(t, int16(1), int16(2), int16(1)) + testMin(t, int16(1), int16(1), int16(1)) + + testMin(t, int32(1), int32(2), int32(1)) + testMin(t, int32(1), int32(1), int32(1)) + + testMin(t, int64(1), int64(2), int64(1)) + testMin(t, int64(1), int64(1), int64(1)) + + testMin(t, uint(1), uint(2), uint(1)) + testMin(t, uint(1), uint(1), uint(1)) + + testMin(t, uint8(1), uint8(2), uint8(1)) + testMin(t, uint8(1), uint8(1), uint8(1)) + + testMin(t, uint16(1), uint16(2), uint16(1)) + testMin(t, uint16(1), uint16(1), uint16(1)) + + testMin(t, uint32(1), uint32(2), uint32(1)) + testMin(t, uint32(1), uint32(1), uint32(1)) + + testMin(t, uint64(1), uint64(2), uint64(1)) + testMin(t, uint64(1), uint64(1), uint64(1)) +} + +func testMax(t *testing.T, v1 interface{}, v2 interface{}, v interface{}) { + var c interface{} + switch i1 := v1.(type) { + case int: + c = MaxInt(i1, v2.(int)) + case int8: + c = MaxInt8(i1, v2.(int8)) + case int16: + c = MaxInt16(i1, v2.(int16)) + case int32: + c = MaxInt32(i1, v2.(int32)) + case int64: + c = MaxInt64(i1, v2.(int64)) + case uint: + c = MaxUint(i1, v2.(uint)) + case uint8: + c = MaxUint8(i1, v2.(uint8)) + case uint16: + c = MaxUint16(i1, v2.(uint16)) + case uint32: + c = MaxUint32(i1, v2.(uint32)) + case uint64: + c = MaxUint64(i1, v2.(uint64)) + default: + t.Fatalf("invalid type %T", t) + } + + if c != v { + t.Fatalf("invalid %v(%T) != %v(%T)", c, c, v, v) + } +} + +func TestMax(t *testing.T) { + testMax(t, int(1), int(2), int(2)) + testMax(t, int(1), int(1), int(1)) + + testMax(t, int8(1), int8(2), int8(2)) + testMax(t, int8(1), int8(1), int8(1)) + + testMax(t, int16(1), int16(2), int16(2)) + testMax(t, int16(1), int16(1), int16(1)) + + testMax(t, int32(1), int32(2), int32(2)) + testMax(t, int32(1), int32(1), int32(1)) + + testMax(t, int64(1), int64(2), int64(2)) + testMax(t, int64(1), int64(1), int64(1)) + + testMax(t, uint(1), uint(2), uint(2)) + testMax(t, uint(1), uint(1), uint(1)) + + testMax(t, uint8(1), uint8(2), uint8(2)) + testMax(t, uint8(1), uint8(1), uint8(1)) + + testMax(t, uint16(1), uint16(2), uint16(2)) + testMax(t, uint16(1), uint16(1), uint16(1)) + + testMax(t, uint32(1), uint32(2), uint32(2)) + testMax(t, uint32(1), uint32(1), uint32(1)) + + testMax(t, uint64(1), uint64(2), uint64(2)) + testMax(t, uint64(1), uint64(1), uint64(1)) +} + +func TestBytes(t *testing.T) { + if BytesToUint64(Uint64ToBytes(1)) != 1 { + t.Fatal("convert fail") + } + + if BytesToUint32(Uint32ToBytes(1)) != 1 { + t.Fatal("convert fail") + } + + if BytesToUint16(Uint16ToBytes(1)) != 1 { + t.Fatal("convert fail") + } + + if BytesToInt64(Int64ToBytes(-1)) != -1 { + t.Fatal("convert fail") + } + + if BytesToInt32(Int32ToBytes(-1)) != -1 { + t.Fatal("convert fail") + } + + if BytesToInt16(Int16ToBytes(-1)) != -1 { + t.Fatal("convert fail") + } +} + +func TestStr(t *testing.T) { + if v, err := ParseUint64(FormatUint64(1)); err != nil { + t.Fatal(err) + } else if v != 1 { + t.Fatal(v) + } + + if v, err := ParseUint32(FormatUint32(1)); err != nil { + t.Fatal(err) + } else if v != 1 { + t.Fatal(v) + } + + if v, err := ParseUint16(FormatUint16(1)); err != nil { + t.Fatal(err) + } else if v != 1 { + t.Fatal(v) + } + + if v, err := ParseUint8(FormatUint8(1)); err != nil { + t.Fatal(err) + } else if v != 1 { + t.Fatal(v) + } + + if v, err := ParseInt64(FormatInt64(-1)); err != nil { + t.Fatal(err) + } else if v != -1 { + t.Fatal(v) + } + + if v, err := ParseInt32(FormatInt32(-1)); err != nil { + t.Fatal(err) + } else if v != -1 { + t.Fatal(v) + } + + if v, err := ParseInt16(FormatInt16(-1)); err != nil { + t.Fatal(err) + } else if v != -1 { + t.Fatal(v) + } + + if v, err := ParseInt8(FormatInt8(-1)); err != nil { + t.Fatal(err) + } else if v != -1 { + t.Fatal(v) + } +} diff --git a/_vendor/vendor/github.com/siddontang/go/num/str.go b/vendor/github.com/siddontang/go/num/str.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/go/num/str.go rename to vendor/github.com/siddontang/go/num/str.go diff --git a/_vendor/vendor/github.com/siddontang/go/snappy/LICENSE b/vendor/github.com/siddontang/go/snappy/LICENSE similarity index 100% rename from _vendor/vendor/github.com/siddontang/go/snappy/LICENSE rename to vendor/github.com/siddontang/go/snappy/LICENSE diff --git a/_vendor/vendor/github.com/siddontang/go/snappy/decode.go b/vendor/github.com/siddontang/go/snappy/decode.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/go/snappy/decode.go rename to vendor/github.com/siddontang/go/snappy/decode.go diff --git a/_vendor/vendor/github.com/siddontang/go/snappy/encode.go b/vendor/github.com/siddontang/go/snappy/encode.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/go/snappy/encode.go rename to vendor/github.com/siddontang/go/snappy/encode.go diff --git a/_vendor/vendor/github.com/siddontang/go/snappy/snappy.go b/vendor/github.com/siddontang/go/snappy/snappy.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/go/snappy/snappy.go rename to vendor/github.com/siddontang/go/snappy/snappy.go diff --git a/vendor/github.com/siddontang/go/snappy/snappy_test.go b/vendor/github.com/siddontang/go/snappy/snappy_test.go new file mode 100644 index 0000000..7ba8392 --- /dev/null +++ b/vendor/github.com/siddontang/go/snappy/snappy_test.go @@ -0,0 +1,261 @@ +// Copyright 2011 The Snappy-Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package snappy + +import ( + "bytes" + "flag" + "fmt" + "io" + "io/ioutil" + "math/rand" + "net/http" + "os" + "path/filepath" + "strings" + "testing" +) + +var download = flag.Bool("download", false, "If true, download any missing files before running benchmarks") + +func roundtrip(b, ebuf, dbuf []byte) error { + e, err := Encode(ebuf, b) + if err != nil { + return fmt.Errorf("encoding error: %v", err) + } + d, err := Decode(dbuf, e) + if err != nil { + return fmt.Errorf("decoding error: %v", err) + } + if !bytes.Equal(b, d) { + return fmt.Errorf("roundtrip mismatch:\n\twant %v\n\tgot %v", b, d) + } + return nil +} + +func TestEmpty(t *testing.T) { + if err := roundtrip(nil, nil, nil); err != nil { + t.Fatal(err) + } +} + +func TestSmallCopy(t *testing.T) { + for _, ebuf := range [][]byte{nil, make([]byte, 20), make([]byte, 64)} { + for _, dbuf := range [][]byte{nil, make([]byte, 20), make([]byte, 64)} { + for i := 0; i < 32; i++ { + s := "aaaa" + strings.Repeat("b", i) + "aaaabbbb" + if err := roundtrip([]byte(s), ebuf, dbuf); err != nil { + t.Errorf("len(ebuf)=%d, len(dbuf)=%d, i=%d: %v", len(ebuf), len(dbuf), i, err) + } + } + } + } +} + +func TestSmallRand(t *testing.T) { + rand.Seed(27354294) + for n := 1; n < 20000; n += 23 { + b := make([]byte, n) + for i, _ := range b { + b[i] = uint8(rand.Uint32()) + } + if err := roundtrip(b, nil, nil); err != nil { + t.Fatal(err) + } + } +} + +func TestSmallRegular(t *testing.T) { + for n := 1; n < 20000; n += 23 { + b := make([]byte, n) + for i, _ := range b { + b[i] = uint8(i%10 + 'a') + } + if err := roundtrip(b, nil, nil); err != nil { + t.Fatal(err) + } + } +} + +func benchDecode(b *testing.B, src []byte) { + encoded, err := Encode(nil, src) + if err != nil { + b.Fatal(err) + } + // Bandwidth is in amount of uncompressed data. + b.SetBytes(int64(len(src))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + Decode(src, encoded) + } +} + +func benchEncode(b *testing.B, src []byte) { + // Bandwidth is in amount of uncompressed data. + b.SetBytes(int64(len(src))) + dst := make([]byte, MaxEncodedLen(len(src))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + Encode(dst, src) + } +} + +func readFile(b *testing.B, filename string) []byte { + src, err := ioutil.ReadFile(filename) + if err != nil { + b.Fatalf("failed reading %s: %s", filename, err) + } + if len(src) == 0 { + b.Fatalf("%s has zero length", filename) + } + return src +} + +// expand returns a slice of length n containing repeated copies of src. +func expand(src []byte, n int) []byte { + dst := make([]byte, n) + for x := dst; len(x) > 0; { + i := copy(x, src) + x = x[i:] + } + return dst +} + +func benchWords(b *testing.B, n int, decode bool) { + // Note: the file is OS-language dependent so the resulting values are not + // directly comparable for non-US-English OS installations. + data := expand(readFile(b, "/usr/share/dict/words"), n) + if decode { + benchDecode(b, data) + } else { + benchEncode(b, data) + } +} + +func BenchmarkWordsDecode1e3(b *testing.B) { benchWords(b, 1e3, true) } +func BenchmarkWordsDecode1e4(b *testing.B) { benchWords(b, 1e4, true) } +func BenchmarkWordsDecode1e5(b *testing.B) { benchWords(b, 1e5, true) } +func BenchmarkWordsDecode1e6(b *testing.B) { benchWords(b, 1e6, true) } +func BenchmarkWordsEncode1e3(b *testing.B) { benchWords(b, 1e3, false) } +func BenchmarkWordsEncode1e4(b *testing.B) { benchWords(b, 1e4, false) } +func BenchmarkWordsEncode1e5(b *testing.B) { benchWords(b, 1e5, false) } +func BenchmarkWordsEncode1e6(b *testing.B) { benchWords(b, 1e6, false) } + +// testFiles' values are copied directly from +// https://code.google.com/p/snappy/source/browse/trunk/snappy_unittest.cc. +// The label field is unused in snappy-go. +var testFiles = []struct { + label string + filename string +}{ + {"html", "html"}, + {"urls", "urls.10K"}, + {"jpg", "house.jpg"}, + {"pdf", "mapreduce-osdi-1.pdf"}, + {"html4", "html_x_4"}, + {"cp", "cp.html"}, + {"c", "fields.c"}, + {"lsp", "grammar.lsp"}, + {"xls", "kennedy.xls"}, + {"txt1", "alice29.txt"}, + {"txt2", "asyoulik.txt"}, + {"txt3", "lcet10.txt"}, + {"txt4", "plrabn12.txt"}, + {"bin", "ptt5"}, + {"sum", "sum"}, + {"man", "xargs.1"}, + {"pb", "geo.protodata"}, + {"gaviota", "kppkn.gtb"}, +} + +// The test data files are present at this canonical URL. +const baseURL = "https://snappy.googlecode.com/svn/trunk/testdata/" + +func downloadTestdata(basename string) (errRet error) { + filename := filepath.Join("testdata", basename) + f, err := os.Create(filename) + if err != nil { + return fmt.Errorf("failed to create %s: %s", filename, err) + } + defer f.Close() + defer func() { + if errRet != nil { + os.Remove(filename) + } + }() + resp, err := http.Get(baseURL + basename) + if err != nil { + return fmt.Errorf("failed to download %s: %s", baseURL+basename, err) + } + defer resp.Body.Close() + _, err = io.Copy(f, resp.Body) + if err != nil { + return fmt.Errorf("failed to write %s: %s", filename, err) + } + return nil +} + +func benchFile(b *testing.B, n int, decode bool) { + filename := filepath.Join("testdata", testFiles[n].filename) + if stat, err := os.Stat(filename); err != nil || stat.Size() == 0 { + if !*download { + b.Fatal("test data not found; skipping benchmark without the -download flag") + } + // Download the official snappy C++ implementation reference test data + // files for benchmarking. + if err := os.Mkdir("testdata", 0777); err != nil && !os.IsExist(err) { + b.Fatalf("failed to create testdata: %s", err) + } + for _, tf := range testFiles { + if err := downloadTestdata(tf.filename); err != nil { + b.Fatalf("failed to download testdata: %s", err) + } + } + } + data := readFile(b, filename) + if decode { + benchDecode(b, data) + } else { + benchEncode(b, data) + } +} + +// Naming convention is kept similar to what snappy's C++ implementation uses. +func Benchmark_UFlat0(b *testing.B) { benchFile(b, 0, true) } +func Benchmark_UFlat1(b *testing.B) { benchFile(b, 1, true) } +func Benchmark_UFlat2(b *testing.B) { benchFile(b, 2, true) } +func Benchmark_UFlat3(b *testing.B) { benchFile(b, 3, true) } +func Benchmark_UFlat4(b *testing.B) { benchFile(b, 4, true) } +func Benchmark_UFlat5(b *testing.B) { benchFile(b, 5, true) } +func Benchmark_UFlat6(b *testing.B) { benchFile(b, 6, true) } +func Benchmark_UFlat7(b *testing.B) { benchFile(b, 7, true) } +func Benchmark_UFlat8(b *testing.B) { benchFile(b, 8, true) } +func Benchmark_UFlat9(b *testing.B) { benchFile(b, 9, true) } +func Benchmark_UFlat10(b *testing.B) { benchFile(b, 10, true) } +func Benchmark_UFlat11(b *testing.B) { benchFile(b, 11, true) } +func Benchmark_UFlat12(b *testing.B) { benchFile(b, 12, true) } +func Benchmark_UFlat13(b *testing.B) { benchFile(b, 13, true) } +func Benchmark_UFlat14(b *testing.B) { benchFile(b, 14, true) } +func Benchmark_UFlat15(b *testing.B) { benchFile(b, 15, true) } +func Benchmark_UFlat16(b *testing.B) { benchFile(b, 16, true) } +func Benchmark_UFlat17(b *testing.B) { benchFile(b, 17, true) } +func Benchmark_ZFlat0(b *testing.B) { benchFile(b, 0, false) } +func Benchmark_ZFlat1(b *testing.B) { benchFile(b, 1, false) } +func Benchmark_ZFlat2(b *testing.B) { benchFile(b, 2, false) } +func Benchmark_ZFlat3(b *testing.B) { benchFile(b, 3, false) } +func Benchmark_ZFlat4(b *testing.B) { benchFile(b, 4, false) } +func Benchmark_ZFlat5(b *testing.B) { benchFile(b, 5, false) } +func Benchmark_ZFlat6(b *testing.B) { benchFile(b, 6, false) } +func Benchmark_ZFlat7(b *testing.B) { benchFile(b, 7, false) } +func Benchmark_ZFlat8(b *testing.B) { benchFile(b, 8, false) } +func Benchmark_ZFlat9(b *testing.B) { benchFile(b, 9, false) } +func Benchmark_ZFlat10(b *testing.B) { benchFile(b, 10, false) } +func Benchmark_ZFlat11(b *testing.B) { benchFile(b, 11, false) } +func Benchmark_ZFlat12(b *testing.B) { benchFile(b, 12, false) } +func Benchmark_ZFlat13(b *testing.B) { benchFile(b, 13, false) } +func Benchmark_ZFlat14(b *testing.B) { benchFile(b, 14, false) } +func Benchmark_ZFlat15(b *testing.B) { benchFile(b, 15, false) } +func Benchmark_ZFlat16(b *testing.B) { benchFile(b, 16, false) } +func Benchmark_ZFlat17(b *testing.B) { benchFile(b, 17, false) } diff --git a/_vendor/vendor/github.com/siddontang/go/sync2/atomic.go b/vendor/github.com/siddontang/go/sync2/atomic.go similarity index 99% rename from _vendor/vendor/github.com/siddontang/go/sync2/atomic.go rename to vendor/github.com/siddontang/go/sync2/atomic.go index 424a974..382fc20 100644 --- a/_vendor/vendor/github.com/siddontang/go/sync2/atomic.go +++ b/vendor/github.com/siddontang/go/sync2/atomic.go @@ -121,7 +121,7 @@ func (s *AtomicString) Get() string { return str } -func (s *AtomicString) CompareAndSwap(oldval, newval string) (swqpped bool) { +func (s *AtomicString) CompareAndSwap(oldval, newval string) (swapped bool) { s.mu.Lock() defer s.mu.Unlock() if s.str == oldval { diff --git a/vendor/github.com/siddontang/go/sync2/atomic_test.go b/vendor/github.com/siddontang/go/sync2/atomic_test.go new file mode 100644 index 0000000..040397f --- /dev/null +++ b/vendor/github.com/siddontang/go/sync2/atomic_test.go @@ -0,0 +1,51 @@ +// Copyright 2013, Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package sync2 + +import ( + "testing" +) + +func TestAtomicString(t *testing.T) { + var s AtomicString + if s.Get() != "" { + t.Errorf("want empty, got %s", s.Get()) + } + s.Set("a") + if s.Get() != "a" { + t.Errorf("want a, got %s", s.Get()) + } + if s.CompareAndSwap("b", "c") { + t.Errorf("want false, got true") + } + if s.Get() != "a" { + t.Errorf("want a, got %s", s.Get()) + } + if !s.CompareAndSwap("a", "c") { + t.Errorf("want true, got false") + } + if s.Get() != "c" { + t.Errorf("want c, got %s", s.Get()) + } +} + +func TestAtomicBool(t *testing.T) { + var b AtomicBool + if b.Get() != false { + t.Fatal("must false") + } + + b.Set(true) + + if b.Get() != true { + t.Fatal("must true") + } + + b.Set(false) + + if b.Get() != false { + t.Fatal("must false") + } +} diff --git a/_vendor/vendor/github.com/siddontang/go/sync2/semaphore.go b/vendor/github.com/siddontang/go/sync2/semaphore.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/go/sync2/semaphore.go rename to vendor/github.com/siddontang/go/sync2/semaphore.go diff --git a/vendor/github.com/siddontang/go/sync2/semaphore_test.go b/vendor/github.com/siddontang/go/sync2/semaphore_test.go new file mode 100644 index 0000000..8c48694 --- /dev/null +++ b/vendor/github.com/siddontang/go/sync2/semaphore_test.go @@ -0,0 +1,41 @@ +// Copyright 2012, Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package sync2 + +import ( + "testing" + "time" +) + +func TestSemaNoTimeout(t *testing.T) { + s := NewSemaphore(1) + s.Acquire() + released := false + go func() { + time.Sleep(10 * time.Millisecond) + released = true + s.Release() + }() + s.Acquire() + if !released { + t.Errorf("want true, got false") + } +} + +func TestSemaTimeout(t *testing.T) { + s := NewSemaphore(1) + s.Acquire() + go func() { + time.Sleep(10 * time.Millisecond) + s.Release() + }() + if ok := s.AcquireTimeout(5 * time.Millisecond); ok { + t.Errorf("want false, got true") + } + time.Sleep(10 * time.Millisecond) + if ok := s.AcquireTimeout(5 * time.Millisecond); !ok { + t.Errorf("want true, got false") + } +} diff --git a/vendor/github.com/siddontang/go/vitess_license b/vendor/github.com/siddontang/go/vitess_license new file mode 100644 index 0000000..989d02e --- /dev/null +++ b/vendor/github.com/siddontang/go/vitess_license @@ -0,0 +1,28 @@ +Copyright 2012, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * 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 Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +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 +OWNER 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. diff --git a/_vendor/vendor/github.com/siddontang/goredis/LICENSE b/vendor/github.com/siddontang/goredis/LICENSE similarity index 100% rename from _vendor/vendor/github.com/siddontang/goredis/LICENSE rename to vendor/github.com/siddontang/goredis/LICENSE diff --git a/_vendor/vendor/github.com/siddontang/goredis/client.go b/vendor/github.com/siddontang/goredis/client.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/goredis/client.go rename to vendor/github.com/siddontang/goredis/client.go diff --git a/_vendor/vendor/github.com/siddontang/goredis/conn.go b/vendor/github.com/siddontang/goredis/conn.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/goredis/conn.go rename to vendor/github.com/siddontang/goredis/conn.go diff --git a/_vendor/vendor/github.com/siddontang/goredis/doc.go b/vendor/github.com/siddontang/goredis/doc.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/goredis/doc.go rename to vendor/github.com/siddontang/goredis/doc.go diff --git a/vendor/github.com/siddontang/goredis/garyburd_license b/vendor/github.com/siddontang/goredis/garyburd_license new file mode 100644 index 0000000..8867881 --- /dev/null +++ b/vendor/github.com/siddontang/goredis/garyburd_license @@ -0,0 +1,13 @@ +// Copyright 2012 Gary Burd +// +// Licensed under the Apache License, Version 2.0 (the "License"): you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. \ No newline at end of file diff --git a/vendor/github.com/siddontang/goredis/goredis_test.go b/vendor/github.com/siddontang/goredis/goredis_test.go new file mode 100644 index 0000000..f96efcb --- /dev/null +++ b/vendor/github.com/siddontang/goredis/goredis_test.go @@ -0,0 +1,39 @@ +package goredis + +import ( + "github.com/alicebob/miniredis" + "testing" +) + +func Test(t *testing.T) { + s, err := miniredis.Run() + if err != nil { + t.Fatal(err) + } + defer s.Close() + + s.RequireAuth("123456") + + addr := s.Addr() + + c := NewClient(addr, "123456") + defer c.Close() + + conn, err := c.Get() + if err != nil { + t.Fatal(err) + } + defer conn.Close() + + if pong, err := String(conn.Do("PING")); err != nil { + t.Fatal(err) + } else if pong != "PONG" { + t.Fatal(pong) + } + + if pong, err := String(conn.Do("PING")); err != nil { + t.Fatal(err) + } else if pong != "PONG" { + t.Fatal(pong) + } +} diff --git a/_vendor/vendor/github.com/siddontang/goredis/reply.go b/vendor/github.com/siddontang/goredis/reply.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/goredis/reply.go rename to vendor/github.com/siddontang/goredis/reply.go diff --git a/_vendor/vendor/github.com/siddontang/goredis/resp.go b/vendor/github.com/siddontang/goredis/resp.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/goredis/resp.go rename to vendor/github.com/siddontang/goredis/resp.go diff --git a/vendor/github.com/siddontang/goredis/resp_test.go b/vendor/github.com/siddontang/goredis/resp_test.go new file mode 100644 index 0000000..c271797 --- /dev/null +++ b/vendor/github.com/siddontang/goredis/resp_test.go @@ -0,0 +1,81 @@ +package goredis + +import ( + "bufio" + "bytes" + "reflect" + "testing" +) + +func TestResp(t *testing.T) { + var buf bytes.Buffer + + reader := NewRespReader(bufio.NewReader(&buf)) + writer := NewRespWriter(bufio.NewWriter(&buf)) + + if err := writer.WriteCommand("SELECT", 1); err != nil { + t.Fatal(err) + } else { + if reqs, err := reader.ParseRequest(); err != nil { + t.Fatal(err) + } else if len(reqs) != 2 { + t.Fatal(len(reqs)) + } else if string(reqs[0]) != "SELECT" { + t.Fatal(string(reqs[0])) + } else if string(reqs[1]) != "1" { + t.Fatal(string(reqs[1])) + } + } + + if err := writer.FlushInteger(10); err != nil { + t.Fatal(err) + } else { + if n, err := Int64(reader.Parse()); err != nil { + t.Fatal(err) + } else if n != 10 { + t.Fatal(n) + } + } + + if err := writer.FlushString("abc"); err != nil { + t.Fatal(err) + } else { + if s, err := String(reader.Parse()); err != nil { + t.Fatal(err) + } else if s != "abc" { + t.Fatal(s) + } + } + + if err := writer.FlushBulk([]byte("abc")); err != nil { + t.Fatal(err) + } else { + if s, err := String(reader.Parse()); err != nil { + t.Fatal(err) + } else if s != "abc" { + t.Fatal(s) + } + } + + ay := []interface{}{[]byte("SET"), []byte("a"), []byte("1")} + if err := writer.FlushArray(ay); err != nil { + t.Fatal(err) + } else { + if oy, err := reader.Parse(); err != nil { + t.Fatal(err) + } else if !reflect.DeepEqual(oy, ay) { + t.Fatalf("%#v", oy) + } + } + + e := Error("hello world") + if err := writer.FlushError(e); err != nil { + t.Fatal(err) + } else { + if ee, err := reader.Parse(); err != nil { + t.Fatal("must error") + } else if !reflect.DeepEqual(e, ee) { + t.Fatal(ee) + } + } +} diff --git a/_vendor/vendor/github.com/siddontang/rdb/LICENSE b/vendor/github.com/siddontang/rdb/LICENSE similarity index 100% rename from _vendor/vendor/github.com/siddontang/rdb/LICENSE rename to vendor/github.com/siddontang/rdb/LICENSE diff --git a/vendor/github.com/siddontang/rdb/README.md b/vendor/github.com/siddontang/rdb/README.md new file mode 100644 index 0000000..aa1582e --- /dev/null +++ b/vendor/github.com/siddontang/rdb/README.md @@ -0,0 +1,3 @@ +# rdb + +Handling Redis RDB format. diff --git a/_vendor/vendor/github.com/siddontang/rdb/decode.go b/vendor/github.com/siddontang/rdb/decode.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/rdb/decode.go rename to vendor/github.com/siddontang/rdb/decode.go diff --git a/_vendor/vendor/github.com/siddontang/rdb/digest.go b/vendor/github.com/siddontang/rdb/digest.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/rdb/digest.go rename to vendor/github.com/siddontang/rdb/digest.go diff --git a/_vendor/vendor/github.com/siddontang/rdb/encode.go b/vendor/github.com/siddontang/rdb/encode.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/rdb/encode.go rename to vendor/github.com/siddontang/rdb/encode.go diff --git a/_vendor/vendor/github.com/siddontang/rdb/loader.go b/vendor/github.com/siddontang/rdb/loader.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/rdb/loader.go rename to vendor/github.com/siddontang/rdb/loader.go diff --git a/vendor/github.com/siddontang/rdb/loader_test.go b/vendor/github.com/siddontang/rdb/loader_test.go new file mode 100644 index 0000000..db8e2ee --- /dev/null +++ b/vendor/github.com/siddontang/rdb/loader_test.go @@ -0,0 +1,373 @@ +// Copyright 2014 Wandoujia Inc. All Rights Reserved. +// Licensed under the MIT (MIT-LICENSE.txt) license. + +package rdb + +import ( + "bytes" + "encoding/hex" + "fmt" + "math" + "strconv" + "strings" + "testing" +) + +func AssertNoError(t *testing.T, err error) { + if err == nil { + return + } + + t.Fatal(err) +} + +func Assert(t *testing.T, b bool) { + if b { + return + } + t.Fatal("assertion failed") +} + +func DecodeHexRdb(t *testing.T, s string, n int) map[string]*Entry { + p, err := hex.DecodeString(strings.NewReplacer("\t", "", "\r", "", "\n", "", " ", "").Replace(s)) + AssertNoError(t, err) + r := bytes.NewReader(p) + l := NewLoader(r) + AssertNoError(t, l.LoadHeader()) + entries := make(map[string]*Entry) + var i int = 0 + for { + e, err := l.LoadEntry() + AssertNoError(t, err) + if e == nil { + break + } + Assert(t, e.DB == 0) + entries[string(e.Key)] = e + i++ + } + AssertNoError(t, l.LoadChecksum()) + Assert(t, r.Len() == 0) + Assert(t, len(entries) == i && i == n) + return entries +} + +func getobj(t *testing.T, entries map[string]*Entry, key string) (*Entry, interface{}) { + e := entries[key] + Assert(t, e != nil) + val, err := DecodeDump(e.ValDump) + AssertNoError(t, err) + return e, val +} + +/* +#!/bin/bash +./redis-cli flushall +for i in 1 255 256 65535 65536 2147483647 2147483648 4294967295 4294967296 -2147483648; do + ./redis-cli set string_${i} ${i} +done +./redis-cli save && xxd -p -c 32 dump.rdb +*/ +func TestLoadIntString(t *testing.T) { + s := ` + 524544495330303036fe00000a737472696e675f323535c1ff00000873747269 + 6e675f31c0010011737472696e675f343239343936373239360a343239343936 + 373239360011737472696e675f343239343936373239350a3432393439363732 + 39350012737472696e675f2d32313437343833363438c200000080000c737472 + 696e675f3635353335c2ffff00000011737472696e675f323134373438333634 + 380a32313437343833363438000c737472696e675f3635353336c20000010000 + 0a737472696e675f323536c100010011737472696e675f323134373438333634 + 37c2ffffff7fffe49d9f131fb5c3b5 + ` + values := []int{1, 255, 256, 65535, 65536, 2147483647, 2147483648, 4294967295, 4294967296, -2147483648} + entries := DecodeHexRdb(t, s, len(values)) + for _, value := range values { + key := fmt.Sprintf("string_%d", value) + _, obj := getobj(t, entries, key) + val := obj.(String) + Assert(t, bytes.Equal([]byte(val), []byte(strconv.Itoa(value)))) + } +} + +/* +#!/bin/bash +./redis-cli flushall +./redis-cli set string_ttls string_ttls +./redis-cli expireat string_ttls 1500000000 +./redis-cli set string_ttlms string_ttlms +./redis-cli pexpireat string_ttlms 1500000000000 +./redis-cli save && xxd -p -c 32 dump.rdb +*/ +func TestLoadStringTTL(t *testing.T) { + s := ` + 524544495330303036fe00fc0098f73e5d010000000c737472696e675f74746c + 6d730c737472696e675f74746c6d73fc0098f73e5d010000000b737472696e67 + 5f74746c730b737472696e675f74746c73ffd15acd935a3fe949 + ` + expireat := uint64(1500000000000) + entries := DecodeHexRdb(t, s, 2) + keys := []string{"string_ttls", "string_ttlms"} + for _, key := range keys { + e, obj := getobj(t, entries, key) + val := obj.(String) + Assert(t, bytes.Equal([]byte(val), []byte(key))) + Assert(t, e.ExpireAt == expireat) + } +} + +/* +#!/bin/bash +s="01" +for ((i=0;i<15;i++)); do + s=$s$s +done +./redis-cli flushall +./redis-cli set string_long $s +./redis-cli save && xxd -p -c 32 dump.rdb +*/ +func TestLoadLongString(t *testing.T) { + s := ` + 524544495330303036fe00000b737472696e675f6c6f6e67c342f28000010000 + 02303130e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0 + ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01 + e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff + 01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0 + ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01 + e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff + 01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0 + ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01 + e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff + 01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0 + ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01 + e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff + 01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0 + ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01 + e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff + 01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0 + ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01 + e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff + 01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0 + ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01 + e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff + 01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0 + ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01e0ff01 + e0ff01e0ff01e0ff01e0ff01e03201013031ffdfdb02bd6d5da5e6 + ` + entries := DecodeHexRdb(t, s, 1) + _, obj := getobj(t, entries, "string_long") + val := []byte(obj.(String)) + for i := 0; i < (1 << 15); i++ { + var c uint8 = '0' + if i%2 != 0 { + c = '1' + } + Assert(t, val[i] == c) + } +} + +/* +#!/bin/bash +./redis-cli flushall +for ((i=0;i<256;i++)); do + ./redis-cli rpush list_lzf 0 + ./redis-cli rpush list_lzf 1 +done +./redis-cli save && xxd -p -c 32 dump.rdb +*/ +func TestLoadListZipmap(t *testing.T) { + s := ` + 524544495330303036fe000a086c6973745f6c7a66c31f440b040b0400000820 + 0306000200f102f202e0ff03e1ff07e1ff07e1d90701f2ffff6a1c2d51c02301 + 16 + ` + entries := DecodeHexRdb(t, s, 1) + _, obj := getobj(t, entries, "list_lzf") + val := obj.(List) + Assert(t, len(val) == 512) + for i := 0; i < 256; i++ { + var s string = "0" + if i%2 != 0 { + s = "1" + } + Assert(t, string(val[i]) == s) + } +} + +/* +#!/bin/bash +./redis-cli flushall +for ((i=0;i<32;i++)); do + ./redis-cli rpush list ${i} +done +./redis-cli save && xxd -p -c 32 dump.rdb +*/ +func TestLoadList(t *testing.T) { + s := ` + 524544495330303036fe0001046c69737420c000c001c002c003c004c005c006 + c007c008c009c00ac00bc00cc00dc00ec00fc010c011c012c013c014c015c016 + c017c018c019c01ac01bc01cc01dc01ec01fff756ea1fa90adefe3 + ` + entries := DecodeHexRdb(t, s, 1) + _, obj := getobj(t, entries, "list") + val := obj.(List) + Assert(t, len(val) == 32) + for i := 0; i < 32; i++ { + Assert(t, string(val[i]) == strconv.Itoa(i)) + } +} + +/* +#!/bin/bash +./redis-cli flushall +for ((i=0;i<16;i++)); do + ./redis-cli sadd set1 ${i} +done +for ((i=0;i<32;i++)); do + ./redis-cli sadd set2 ${i} +done +./redis-cli save && xxd -p -c 32 dump.rdb +*/ +func TestLoadSetAndSetIntset(t *testing.T) { + s := ` + 524544495330303036fe0002047365743220c016c00dc01bc012c01ac004c014 + c002c017c01dc01cc013c019c01ec008c006c000c001c007c00fc009c01fc00e + c003c00ac015c010c00bc018c011c00cc0050b04736574312802000000100000 + 0000000100020003000400050006000700080009000a000b000c000d000e000f + 00ff3a0a9697324d19c3 + ` + entries := DecodeHexRdb(t, s, 2) + + _, obj1 := getobj(t, entries, "set1") + val1 := obj1.(Set) + set1 := make(map[string]bool) + for _, mem := range val1 { + set1[string(mem)] = true + } + Assert(t, len(set1) == 16) + Assert(t, len(set1) == len(val1)) + for i := 0; i < 16; i++ { + _, ok := set1[strconv.Itoa(i)] + Assert(t, ok) + } + + _, obj2 := getobj(t, entries, "set2") + val2 := obj2.(Set) + set2 := make(map[string]bool) + for _, mem := range val2 { + set2[string(mem)] = true + } + Assert(t, len(set2) == 32) + Assert(t, len(set2) == len(val2)) + for i := 0; i < 32; i++ { + _, ok := set2[strconv.Itoa(i)] + Assert(t, ok) + } +} + +/* +#!/bin/bash +./redis-cli flushall +for ((i=0;i<16;i++)); do + ./redis-cli hset hash1 ${i} +done +for ((i=-16;i<16;i++)); do + ./redis-cli hset hash2 ${i} +done +./redis-cli save && xxd -p -c 32 dump.rdb +*/ +func TestLoadHashAndHashZiplist(t *testing.T) { + s := ` + 524544495330303036fe000405686173683220c00dc00dc0fcc0fcc0ffc0ffc0 + 04c004c002c002c0fbc0fbc0f0c0f0c0f9c0f9c008c008c0fac0fac006c006c0 + 00c000c001c001c0fec0fec007c007c0f6c0f6c00fc00fc009c009c0f7c0f7c0 + fdc0fdc0f1c0f1c0f2c0f2c0f3c0f3c00ec00ec003c003c00ac00ac00bc00bc0 + f8c0f8c00cc00cc0f5c0f5c0f4c0f4c005c0050d056861736831405151000000 + 4d000000200000f102f102f202f202f302f302f402f402f502f502f602f602f7 + 02f702f802f802f902f902fa02fa02fb02fb02fc02fc02fd02fd02fe0d03fe0d + 03fe0e03fe0e03fe0f03fe0fffffa423d3036c15e534 + ` + entries := DecodeHexRdb(t, s, 2) + + _, obj1 := getobj(t, entries, "hash1") + val1 := obj1.(Hash) + hash1 := make(map[string]string) + for _, ent := range val1 { + hash1[string(ent.Field)] = string(ent.Value) + } + Assert(t, len(hash1) == 16) + Assert(t, len(hash1) == len(val1)) + for i := 0; i < 16; i++ { + s := strconv.Itoa(i) + Assert(t, hash1[s] == s) + } + + _, obj2 := getobj(t, entries, "hash2") + val2 := obj2.(Hash) + hash2 := make(map[string]string) + for _, ent := range val2 { + hash2[string(ent.Field)] = string(ent.Value) + } + Assert(t, len(hash2) == 32) + Assert(t, len(hash2) == len(val2)) + for i := -16; i < 16; i++ { + s := strconv.Itoa(i) + Assert(t, hash2[s] == s) + } +} + +/* +#!/bin/bash +./redis-cli flushall +for ((i=0;i<16;i++)); do + ./redis-cli zadd zset1 ${i} ${i} +done +for ((i=0;i<32;i++)); do + ./redis-cli zadd zset2 -${i} ${i} +done +./redis-cli save && xxd -p -c 32 dump.rdb +*/ +func TestLoadZSetAndZSetZiplist(t *testing.T) { + s := ` + 524544495330303036fe0003057a7365743220c016032d3232c00d032d3133c0 + 1b032d3237c012032d3138c01a032d3236c004022d34c014032d3230c002022d + 32c017032d3233c01d032d3239c01c032d3238c013032d3139c019032d3235c0 + 1e032d3330c008022d38c006022d36c000022d30c001022d31c007022d37c009 + 022d39c00f032d3135c01f032d3331c00e032d3134c003022d33c00a032d3130 + c015032d3231c010032d3136c00b032d3131c018032d3234c011032d3137c00c + 032d3132c005022d350c057a736574314051510000004d000000200000f102f1 + 02f202f202f302f302f402f402f502f502f602f602f702f702f802f802f902f9 + 02fa02fa02fb02fb02fc02fc02fd02fd02fe0d03fe0d03fe0e03fe0e03fe0f03 + fe0fffff2addedbf4f5a8f93 + ` + entries := DecodeHexRdb(t, s, 2) + + _, obj1 := getobj(t, entries, "zset1") + val1 := obj1.(ZSet) + zset1 := make(map[string]float64) + for _, ent := range val1 { + zset1[string(ent.Member)] = ent.Score + } + Assert(t, len(zset1) == 16) + Assert(t, len(zset1) == len(val1)) + for i := 0; i < 16; i++ { + s := strconv.Itoa(i) + score, ok := zset1[s] + Assert(t, ok) + Assert(t, math.Abs(score-float64(i)) < 1e-10) + } + + _, obj2 := getobj(t, entries, "zset2") + val2 := obj2.(ZSet) + zset2 := make(map[string]float64) + for _, ent := range val2 { + zset2[string(ent.Member)] = ent.Score + } + Assert(t, len(zset2) == 32) + Assert(t, len(zset2) == len(val2)) + for i := 0; i < 32; i++ { + s := strconv.Itoa(i) + score, ok := zset2[s] + Assert(t, ok) + Assert(t, math.Abs(score+float64(i)) < 1e-10) + } +} diff --git a/vendor/github.com/siddontang/rdb/rdb_test.go b/vendor/github.com/siddontang/rdb/rdb_test.go new file mode 100644 index 0000000..88095d2 --- /dev/null +++ b/vendor/github.com/siddontang/rdb/rdb_test.go @@ -0,0 +1,23 @@ +package rdb + +import ( + "reflect" + "testing" +) + +func TestCodec(t *testing.T) { + testCodec(String("abc"), t) +} + +func testCodec(obj interface{}, t *testing.T) { + b, err := Dump(obj) + if err != nil { + t.Fatal(err) + } + + if o, err := DecodeDump(b); err != nil { + t.Fatal(err) + } else if !reflect.DeepEqual(obj, o) { + t.Fatal("must equal") + } +} diff --git a/_vendor/vendor/github.com/siddontang/rdb/reader.go b/vendor/github.com/siddontang/rdb/reader.go similarity index 100% rename from _vendor/vendor/github.com/siddontang/rdb/reader.go rename to vendor/github.com/siddontang/rdb/reader.go diff --git a/vendor/github.com/siddontang/rdb/wandoujia-license b/vendor/github.com/siddontang/rdb/wandoujia-license new file mode 100644 index 0000000..23320dc --- /dev/null +++ b/vendor/github.com/siddontang/rdb/wandoujia-license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Wandoujia Inc. + +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: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +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/syndtr/goleveldb/.travis.yml b/vendor/github.com/syndtr/goleveldb/.travis.yml new file mode 100644 index 0000000..5f26f3f --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/.travis.yml @@ -0,0 +1,11 @@ +language: go + +go: + - 1.4 + - 1.5 + - 1.6 + - tip + +script: + - go test -timeout 1h ./... + - go test -timeout 30m -race -run "TestDB_(Concurrent|GoleveldbIssue74)" ./leveldb diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/LICENSE b/vendor/github.com/syndtr/goleveldb/LICENSE similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/LICENSE rename to vendor/github.com/syndtr/goleveldb/LICENSE diff --git a/vendor/github.com/syndtr/goleveldb/README.md b/vendor/github.com/syndtr/goleveldb/README.md new file mode 100644 index 0000000..259286f --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/README.md @@ -0,0 +1,105 @@ +This is an implementation of the [LevelDB key/value database](http:code.google.com/p/leveldb) in the [Go programming language](http:golang.org). + +[![Build Status](https://travis-ci.org/syndtr/goleveldb.png?branch=master)](https://travis-ci.org/syndtr/goleveldb) + +Installation +----------- + + go get github.com/syndtr/goleveldb/leveldb + +Requirements +----------- + +* Need at least `go1.4` or newer. + +Usage +----------- + +Create or open a database: +```go +db, err := leveldb.OpenFile("path/to/db", nil) +... +defer db.Close() +... +``` +Read or modify the database content: +```go +// Remember that the contents of the returned slice should not be modified. +data, err := db.Get([]byte("key"), nil) +... +err = db.Put([]byte("key"), []byte("value"), nil) +... +err = db.Delete([]byte("key"), nil) +... +``` + +Iterate over database content: +```go +iter := db.NewIterator(nil, nil) +for iter.Next() { + // Remember that the contents of the returned slice should not be modified, and + // only valid until the next call to Next. + key := iter.Key() + value := iter.Value() + ... +} +iter.Release() +err = iter.Error() +... +``` +Seek-then-Iterate: +```go +iter := db.NewIterator(nil, nil) +for ok := iter.Seek(key); ok; ok = iter.Next() { + // Use key/value. + ... +} +iter.Release() +err = iter.Error() +... +``` +Iterate over subset of database content: +```go +iter := db.NewIterator(&util.Range{Start: []byte("foo"), Limit: []byte("xoo")}, nil) +for iter.Next() { + // Use key/value. + ... +} +iter.Release() +err = iter.Error() +... +``` +Iterate over subset of database content with a particular prefix: +```go +iter := db.NewIterator(util.BytesPrefix([]byte("foo-")), nil) +for iter.Next() { + // Use key/value. + ... +} +iter.Release() +err = iter.Error() +... +``` +Batch writes: +```go +batch := new(leveldb.Batch) +batch.Put([]byte("foo"), []byte("value")) +batch.Put([]byte("bar"), []byte("another value")) +batch.Delete([]byte("baz")) +err = db.Write(batch, nil) +... +``` +Use bloom filter: +```go +o := &opt.Options{ + Filter: filter.NewBloomFilter(10), +} +db, err := leveldb.OpenFile("path/to/db", o) +... +defer db.Close() +... +``` +Documentation +----------- + +You can read package documentation [here](http:godoc.org/github.com/syndtr/goleveldb). diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/batch.go b/vendor/github.com/syndtr/goleveldb/leveldb/batch.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/batch.go rename to vendor/github.com/syndtr/goleveldb/leveldb/batch.go diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/batch_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/batch_test.go new file mode 100644 index 0000000..ce0925e --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/batch_test.go @@ -0,0 +1,123 @@ +// Copyright (c) 2012, Suryandaru Triandana +// All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package leveldb + +import ( + "bytes" + "testing" + + "github.com/syndtr/goleveldb/leveldb/comparer" + "github.com/syndtr/goleveldb/leveldb/memdb" +) + +type tbRec struct { + kt keyType + key, value []byte +} + +type testBatch struct { + rec []*tbRec +} + +func (p *testBatch) Put(key, value []byte) { + p.rec = append(p.rec, &tbRec{keyTypeVal, key, value}) +} + +func (p *testBatch) Delete(key []byte) { + p.rec = append(p.rec, &tbRec{keyTypeDel, key, nil}) +} + +func compareBatch(t *testing.T, b1, b2 *Batch) { + if b1.seq != b2.seq { + t.Errorf("invalid seq number want %d, got %d", b1.seq, b2.seq) + } + if b1.Len() != b2.Len() { + t.Fatalf("invalid record length want %d, got %d", b1.Len(), b2.Len()) + } + p1, p2 := new(testBatch), new(testBatch) + err := b1.Replay(p1) + if err != nil { + t.Fatal("error when replaying batch 1: ", err) + } + err = b2.Replay(p2) + if err != nil { + t.Fatal("error when replaying batch 2: ", err) + } + for i := range p1.rec { + r1, r2 := p1.rec[i], p2.rec[i] + if r1.kt != r2.kt { + t.Errorf("invalid type on record '%d' want %d, got %d", i, r1.kt, r2.kt) + } + if !bytes.Equal(r1.key, r2.key) { + t.Errorf("invalid key on record '%d' want %s, got %s", i, string(r1.key), string(r2.key)) + } + if r1.kt == keyTypeVal { + if !bytes.Equal(r1.value, r2.value) { + t.Errorf("invalid value on record '%d' want %s, got %s", i, string(r1.value), string(r2.value)) + } + } + } +} + +func TestBatch_EncodeDecode(t *testing.T) { + b1 := new(Batch) + b1.seq = 10009 + b1.Put([]byte("key1"), []byte("value1")) + b1.Put([]byte("key2"), []byte("value2")) + b1.Delete([]byte("key1")) + b1.Put([]byte("k"), []byte("")) + b1.Put([]byte("zzzzzzzzzzz"), []byte("zzzzzzzzzzzzzzzzzzzzzzzz")) + b1.Delete([]byte("key10000")) + b1.Delete([]byte("k")) + buf := b1.encode() + b2 := new(Batch) + err := b2.decode(0, buf) + if err != nil { + t.Error("error when decoding batch: ", err) + } + compareBatch(t, b1, b2) +} + +func TestBatch_Append(t *testing.T) { + b1 := new(Batch) + b1.seq = 10009 + b1.Put([]byte("key1"), []byte("value1")) + b1.Put([]byte("key2"), []byte("value2")) + b1.Delete([]byte("key1")) + b1.Put([]byte("foo"), []byte("foovalue")) + b1.Put([]byte("bar"), []byte("barvalue")) + b2a := new(Batch) + b2a.seq = 10009 + b2a.Put([]byte("key1"), []byte("value1")) + b2a.Put([]byte("key2"), []byte("value2")) + b2a.Delete([]byte("key1")) + b2b := new(Batch) + b2b.Put([]byte("foo"), []byte("foovalue")) + b2b.Put([]byte("bar"), []byte("barvalue")) + b2a.append(b2b) + compareBatch(t, b1, b2a) + if b1.size() != b2a.size() { + t.Fatalf("invalid batch size want %d, got %d", b1.size(), b2a.size()) + } +} + +func TestBatch_Size(t *testing.T) { + b := new(Batch) + for i := 0; i < 2; i++ { + b.Put([]byte("key1"), []byte("value1")) + b.Put([]byte("key2"), []byte("value2")) + b.Delete([]byte("key1")) + b.Put([]byte("foo"), []byte("foovalue")) + b.Put([]byte("bar"), []byte("barvalue")) + mem := memdb.New(&iComparer{comparer.DefaultComparer}, 0) + b.memReplay(mem) + if b.size() != mem.Size() { + t.Errorf("invalid batch size calculation, want=%d got=%d", mem.Size(), b.size()) + } + b.Reset() + } +} diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/bench_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/bench_test.go new file mode 100644 index 0000000..12a8496 --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/bench_test.go @@ -0,0 +1,509 @@ +// Copyright (c) 2012, Suryandaru Triandana +// All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package leveldb + +import ( + "bytes" + "fmt" + "math/rand" + "os" + "path/filepath" + "runtime" + "sync/atomic" + "testing" + + "github.com/syndtr/goleveldb/leveldb/iterator" + "github.com/syndtr/goleveldb/leveldb/opt" + "github.com/syndtr/goleveldb/leveldb/storage" +) + +func randomString(r *rand.Rand, n int) []byte { + b := new(bytes.Buffer) + for i := 0; i < n; i++ { + b.WriteByte(' ' + byte(r.Intn(95))) + } + return b.Bytes() +} + +func compressibleStr(r *rand.Rand, frac float32, n int) []byte { + nn := int(float32(n) * frac) + rb := randomString(r, nn) + b := make([]byte, 0, n+nn) + for len(b) < n { + b = append(b, rb...) + } + return b[:n] +} + +type valueGen struct { + src []byte + pos int +} + +func newValueGen(frac float32) *valueGen { + v := new(valueGen) + r := rand.New(rand.NewSource(301)) + v.src = make([]byte, 0, 1048576+100) + for len(v.src) < 1048576 { + v.src = append(v.src, compressibleStr(r, frac, 100)...) + } + return v +} + +func (v *valueGen) get(n int) []byte { + if v.pos+n > len(v.src) { + v.pos = 0 + } + v.pos += n + return v.src[v.pos-n : v.pos] +} + +var benchDB = filepath.Join(os.TempDir(), fmt.Sprintf("goleveldbbench-%d", os.Getuid())) + +type dbBench struct { + b *testing.B + stor storage.Storage + db *DB + + o *opt.Options + ro *opt.ReadOptions + wo *opt.WriteOptions + + keys, values [][]byte +} + +func openDBBench(b *testing.B, noCompress bool) *dbBench { + _, err := os.Stat(benchDB) + if err == nil { + err = os.RemoveAll(benchDB) + if err != nil { + b.Fatal("cannot remove old db: ", err) + } + } + + p := &dbBench{ + b: b, + o: &opt.Options{}, + ro: &opt.ReadOptions{}, + wo: &opt.WriteOptions{}, + } + p.stor, err = storage.OpenFile(benchDB, false) + if err != nil { + b.Fatal("cannot open stor: ", err) + } + if noCompress { + p.o.Compression = opt.NoCompression + } + + p.db, err = Open(p.stor, p.o) + if err != nil { + b.Fatal("cannot open db: ", err) + } + + runtime.GOMAXPROCS(runtime.NumCPU()) + return p +} + +func (p *dbBench) reopen() { + p.db.Close() + var err error + p.db, err = Open(p.stor, p.o) + if err != nil { + p.b.Fatal("Reopen: got error: ", err) + } +} + +func (p *dbBench) populate(n int) { + p.keys, p.values = make([][]byte, n), make([][]byte, n) + v := newValueGen(0.5) + for i := range p.keys { + p.keys[i], p.values[i] = []byte(fmt.Sprintf("%016d", i)), v.get(100) + } +} + +func (p *dbBench) randomize() { + m := len(p.keys) + times := m * 2 + r1, r2 := rand.New(rand.NewSource(0xdeadbeef)), rand.New(rand.NewSource(0xbeefface)) + for n := 0; n < times; n++ { + i, j := r1.Int()%m, r2.Int()%m + if i == j { + continue + } + p.keys[i], p.keys[j] = p.keys[j], p.keys[i] + p.values[i], p.values[j] = p.values[j], p.values[i] + } +} + +func (p *dbBench) writes(perBatch int) { + b := p.b + db := p.db + + n := len(p.keys) + m := n / perBatch + if n%perBatch > 0 { + m++ + } + batches := make([]Batch, m) + j := 0 + for i := range batches { + first := true + for ; j < n && ((j+1)%perBatch != 0 || first); j++ { + first = false + batches[i].Put(p.keys[j], p.values[j]) + } + } + runtime.GC() + + b.ResetTimer() + b.StartTimer() + for i := range batches { + err := db.Write(&(batches[i]), p.wo) + if err != nil { + b.Fatal("write failed: ", err) + } + } + b.StopTimer() + b.SetBytes(116) +} + +func (p *dbBench) gc() { + p.keys, p.values = nil, nil + runtime.GC() +} + +func (p *dbBench) puts() { + b := p.b + db := p.db + + b.ResetTimer() + b.StartTimer() + for i := range p.keys { + err := db.Put(p.keys[i], p.values[i], p.wo) + if err != nil { + b.Fatal("put failed: ", err) + } + } + b.StopTimer() + b.SetBytes(116) +} + +func (p *dbBench) fill() { + b := p.b + db := p.db + + perBatch := 10000 + batch := new(Batch) + for i, n := 0, len(p.keys); i < n; { + first := true + for ; i < n && ((i+1)%perBatch != 0 || first); i++ { + first = false + batch.Put(p.keys[i], p.values[i]) + } + err := db.Write(batch, p.wo) + if err != nil { + b.Fatal("write failed: ", err) + } + batch.Reset() + } +} + +func (p *dbBench) gets() { + b := p.b + db := p.db + + b.ResetTimer() + for i := range p.keys { + _, err := db.Get(p.keys[i], p.ro) + if err != nil { + b.Error("got error: ", err) + } + } + b.StopTimer() +} + +func (p *dbBench) seeks() { + b := p.b + + iter := p.newIter() + defer iter.Release() + b.ResetTimer() + for i := range p.keys { + if !iter.Seek(p.keys[i]) { + b.Error("value not found for: ", string(p.keys[i])) + } + } + b.StopTimer() +} + +func (p *dbBench) newIter() iterator.Iterator { + iter := p.db.NewIterator(nil, p.ro) + err := iter.Error() + if err != nil { + p.b.Fatal("cannot create iterator: ", err) + } + return iter +} + +func (p *dbBench) close() { + if bp, err := p.db.GetProperty("leveldb.blockpool"); err == nil { + p.b.Log("Block pool stats: ", bp) + } + p.db.Close() + p.stor.Close() + os.RemoveAll(benchDB) + p.db = nil + p.keys = nil + p.values = nil + runtime.GC() + runtime.GOMAXPROCS(1) +} + +func BenchmarkDBWrite(b *testing.B) { + p := openDBBench(b, false) + p.populate(b.N) + p.writes(1) + p.close() +} + +func BenchmarkDBWriteBatch(b *testing.B) { + p := openDBBench(b, false) + p.populate(b.N) + p.writes(1000) + p.close() +} + +func BenchmarkDBWriteUncompressed(b *testing.B) { + p := openDBBench(b, true) + p.populate(b.N) + p.writes(1) + p.close() +} + +func BenchmarkDBWriteBatchUncompressed(b *testing.B) { + p := openDBBench(b, true) + p.populate(b.N) + p.writes(1000) + p.close() +} + +func BenchmarkDBWriteRandom(b *testing.B) { + p := openDBBench(b, false) + p.populate(b.N) + p.randomize() + p.writes(1) + p.close() +} + +func BenchmarkDBWriteRandomSync(b *testing.B) { + p := openDBBench(b, false) + p.wo.Sync = true + p.populate(b.N) + p.writes(1) + p.close() +} + +func BenchmarkDBOverwrite(b *testing.B) { + p := openDBBench(b, false) + p.populate(b.N) + p.writes(1) + p.writes(1) + p.close() +} + +func BenchmarkDBOverwriteRandom(b *testing.B) { + p := openDBBench(b, false) + p.populate(b.N) + p.writes(1) + p.randomize() + p.writes(1) + p.close() +} + +func BenchmarkDBPut(b *testing.B) { + p := openDBBench(b, false) + p.populate(b.N) + p.puts() + p.close() +} + +func BenchmarkDBRead(b *testing.B) { + p := openDBBench(b, false) + p.populate(b.N) + p.fill() + p.gc() + + iter := p.newIter() + b.ResetTimer() + for iter.Next() { + } + iter.Release() + b.StopTimer() + b.SetBytes(116) + p.close() +} + +func BenchmarkDBReadGC(b *testing.B) { + p := openDBBench(b, false) + p.populate(b.N) + p.fill() + + iter := p.newIter() + b.ResetTimer() + for iter.Next() { + } + iter.Release() + b.StopTimer() + b.SetBytes(116) + p.close() +} + +func BenchmarkDBReadUncompressed(b *testing.B) { + p := openDBBench(b, true) + p.populate(b.N) + p.fill() + p.gc() + + iter := p.newIter() + b.ResetTimer() + for iter.Next() { + } + iter.Release() + b.StopTimer() + b.SetBytes(116) + p.close() +} + +func BenchmarkDBReadTable(b *testing.B) { + p := openDBBench(b, false) + p.populate(b.N) + p.fill() + p.reopen() + p.gc() + + iter := p.newIter() + b.ResetTimer() + for iter.Next() { + } + iter.Release() + b.StopTimer() + b.SetBytes(116) + p.close() +} + +func BenchmarkDBReadReverse(b *testing.B) { + p := openDBBench(b, false) + p.populate(b.N) + p.fill() + p.gc() + + iter := p.newIter() + b.ResetTimer() + iter.Last() + for iter.Prev() { + } + iter.Release() + b.StopTimer() + b.SetBytes(116) + p.close() +} + +func BenchmarkDBReadReverseTable(b *testing.B) { + p := openDBBench(b, false) + p.populate(b.N) + p.fill() + p.reopen() + p.gc() + + iter := p.newIter() + b.ResetTimer() + iter.Last() + for iter.Prev() { + } + iter.Release() + b.StopTimer() + b.SetBytes(116) + p.close() +} + +func BenchmarkDBSeek(b *testing.B) { + p := openDBBench(b, false) + p.populate(b.N) + p.fill() + p.seeks() + p.close() +} + +func BenchmarkDBSeekRandom(b *testing.B) { + p := openDBBench(b, false) + p.populate(b.N) + p.fill() + p.randomize() + p.seeks() + p.close() +} + +func BenchmarkDBGet(b *testing.B) { + p := openDBBench(b, false) + p.populate(b.N) + p.fill() + p.gets() + p.close() +} + +func BenchmarkDBGetRandom(b *testing.B) { + p := openDBBench(b, false) + p.populate(b.N) + p.fill() + p.randomize() + p.gets() + p.close() +} + +func BenchmarkDBReadConcurrent(b *testing.B) { + p := openDBBench(b, false) + p.populate(b.N) + p.fill() + p.gc() + defer p.close() + + b.ResetTimer() + b.SetBytes(116) + + b.RunParallel(func(pb *testing.PB) { + iter := p.newIter() + defer iter.Release() + for pb.Next() && iter.Next() { + } + }) +} + +func BenchmarkDBReadConcurrent2(b *testing.B) { + p := openDBBench(b, false) + p.populate(b.N) + p.fill() + p.gc() + defer p.close() + + b.ResetTimer() + b.SetBytes(116) + + var dir uint32 + b.RunParallel(func(pb *testing.PB) { + iter := p.newIter() + defer iter.Release() + if atomic.AddUint32(&dir, 1)%2 == 0 { + for pb.Next() && iter.Next() { + } + } else { + if pb.Next() && iter.Last() { + for pb.Next() && iter.Prev() { + } + } + } + }) +} diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/cache/bench_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/cache/bench_test.go new file mode 100644 index 0000000..89aef69 --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/cache/bench_test.go @@ -0,0 +1,29 @@ +// Copyright (c) 2012, Suryandaru Triandana +// All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package cache + +import ( + "math/rand" + "testing" + "time" +) + +func BenchmarkLRUCache(b *testing.B) { + c := NewCache(NewLRU(10000)) + + b.SetParallelism(10) + b.RunParallel(func(pb *testing.PB) { + r := rand.New(rand.NewSource(time.Now().UnixNano())) + + for pb.Next() { + key := uint64(r.Intn(1000000)) + c.Get(0, key, func() (int, Value) { + return 1, key + }).Release() + } + }) +} diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/cache/cache.go b/vendor/github.com/syndtr/goleveldb/leveldb/cache/cache.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/cache/cache.go rename to vendor/github.com/syndtr/goleveldb/leveldb/cache/cache.go diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/cache/cache_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/cache/cache_test.go new file mode 100644 index 0000000..b7b1638 --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/cache/cache_test.go @@ -0,0 +1,553 @@ +// Copyright (c) 2012, Suryandaru Triandana +// All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package cache + +import ( + "math/rand" + "runtime" + "sync" + "sync/atomic" + "testing" + "time" + "unsafe" +) + +type int32o int32 + +func (o *int32o) acquire() { + if atomic.AddInt32((*int32)(o), 1) != 1 { + panic("BUG: invalid ref") + } +} + +func (o *int32o) Release() { + if atomic.AddInt32((*int32)(o), -1) != 0 { + panic("BUG: invalid ref") + } +} + +type releaserFunc struct { + fn func() + value Value +} + +func (r releaserFunc) Release() { + if r.fn != nil { + r.fn() + } +} + +func set(c *Cache, ns, key uint64, value Value, charge int, relf func()) *Handle { + return c.Get(ns, key, func() (int, Value) { + if relf != nil { + return charge, releaserFunc{relf, value} + } + return charge, value + }) +} + +func TestCacheMap(t *testing.T) { + runtime.GOMAXPROCS(runtime.NumCPU()) + + nsx := []struct { + nobjects, nhandles, concurrent, repeat int + }{ + {10000, 400, 50, 3}, + {100000, 1000, 100, 10}, + } + + var ( + objects [][]int32o + handles [][]unsafe.Pointer + ) + + for _, x := range nsx { + objects = append(objects, make([]int32o, x.nobjects)) + handles = append(handles, make([]unsafe.Pointer, x.nhandles)) + } + + c := NewCache(nil) + + wg := new(sync.WaitGroup) + var done int32 + + for ns, x := range nsx { + for i := 0; i < x.concurrent; i++ { + wg.Add(1) + go func(ns, i, repeat int, objects []int32o, handles []unsafe.Pointer) { + defer wg.Done() + r := rand.New(rand.NewSource(time.Now().UnixNano())) + + for j := len(objects) * repeat; j >= 0; j-- { + key := uint64(r.Intn(len(objects))) + h := c.Get(uint64(ns), key, func() (int, Value) { + o := &objects[key] + o.acquire() + return 1, o + }) + if v := h.Value().(*int32o); v != &objects[key] { + t.Fatalf("#%d invalid value: want=%p got=%p", ns, &objects[key], v) + } + if objects[key] != 1 { + t.Fatalf("#%d invalid object %d: %d", ns, key, objects[key]) + } + if !atomic.CompareAndSwapPointer(&handles[r.Intn(len(handles))], nil, unsafe.Pointer(h)) { + h.Release() + } + } + }(ns, i, x.repeat, objects[ns], handles[ns]) + } + + go func(handles []unsafe.Pointer) { + r := rand.New(rand.NewSource(time.Now().UnixNano())) + + for atomic.LoadInt32(&done) == 0 { + i := r.Intn(len(handles)) + h := (*Handle)(atomic.LoadPointer(&handles[i])) + if h != nil && atomic.CompareAndSwapPointer(&handles[i], unsafe.Pointer(h), nil) { + h.Release() + } + time.Sleep(time.Millisecond) + } + }(handles[ns]) + } + + go func() { + handles := make([]*Handle, 100000) + for atomic.LoadInt32(&done) == 0 { + for i := range handles { + handles[i] = c.Get(999999999, uint64(i), func() (int, Value) { + return 1, 1 + }) + } + for _, h := range handles { + h.Release() + } + } + }() + + wg.Wait() + + atomic.StoreInt32(&done, 1) + + for _, handles0 := range handles { + for i := range handles0 { + h := (*Handle)(atomic.LoadPointer(&handles0[i])) + if h != nil && atomic.CompareAndSwapPointer(&handles0[i], unsafe.Pointer(h), nil) { + h.Release() + } + } + } + + for ns, objects0 := range objects { + for i, o := range objects0 { + if o != 0 { + t.Fatalf("invalid object #%d.%d: ref=%d", ns, i, o) + } + } + } +} + +func TestCacheMap_NodesAndSize(t *testing.T) { + c := NewCache(nil) + if c.Nodes() != 0 { + t.Errorf("invalid nodes counter: want=%d got=%d", 0, c.Nodes()) + } + if c.Size() != 0 { + t.Errorf("invalid size counter: want=%d got=%d", 0, c.Size()) + } + set(c, 0, 1, 1, 1, nil) + set(c, 0, 2, 2, 2, nil) + set(c, 1, 1, 3, 3, nil) + set(c, 2, 1, 4, 1, nil) + if c.Nodes() != 4 { + t.Errorf("invalid nodes counter: want=%d got=%d", 4, c.Nodes()) + } + if c.Size() != 7 { + t.Errorf("invalid size counter: want=%d got=%d", 4, c.Size()) + } +} + +func TestLRUCache_Capacity(t *testing.T) { + c := NewCache(NewLRU(10)) + if c.Capacity() != 10 { + t.Errorf("invalid capacity: want=%d got=%d", 10, c.Capacity()) + } + set(c, 0, 1, 1, 1, nil).Release() + set(c, 0, 2, 2, 2, nil).Release() + set(c, 1, 1, 3, 3, nil).Release() + set(c, 2, 1, 4, 1, nil).Release() + set(c, 2, 2, 5, 1, nil).Release() + set(c, 2, 3, 6, 1, nil).Release() + set(c, 2, 4, 7, 1, nil).Release() + set(c, 2, 5, 8, 1, nil).Release() + if c.Nodes() != 7 { + t.Errorf("invalid nodes counter: want=%d got=%d", 7, c.Nodes()) + } + if c.Size() != 10 { + t.Errorf("invalid size counter: want=%d got=%d", 10, c.Size()) + } + c.SetCapacity(9) + if c.Capacity() != 9 { + t.Errorf("invalid capacity: want=%d got=%d", 9, c.Capacity()) + } + if c.Nodes() != 6 { + t.Errorf("invalid nodes counter: want=%d got=%d", 6, c.Nodes()) + } + if c.Size() != 8 { + t.Errorf("invalid size counter: want=%d got=%d", 8, c.Size()) + } +} + +func TestCacheMap_NilValue(t *testing.T) { + c := NewCache(NewLRU(10)) + h := c.Get(0, 0, func() (size int, value Value) { + return 1, nil + }) + if h != nil { + t.Error("cache handle is non-nil") + } + if c.Nodes() != 0 { + t.Errorf("invalid nodes counter: want=%d got=%d", 0, c.Nodes()) + } + if c.Size() != 0 { + t.Errorf("invalid size counter: want=%d got=%d", 0, c.Size()) + } +} + +func TestLRUCache_GetLatency(t *testing.T) { + runtime.GOMAXPROCS(runtime.NumCPU()) + + const ( + concurrentSet = 30 + concurrentGet = 3 + duration = 3 * time.Second + delay = 3 * time.Millisecond + maxkey = 100000 + ) + + var ( + set, getHit, getAll int32 + getMaxLatency, getDuration int64 + ) + + c := NewCache(NewLRU(5000)) + wg := &sync.WaitGroup{} + until := time.Now().Add(duration) + for i := 0; i < concurrentSet; i++ { + wg.Add(1) + go func(i int) { + defer wg.Done() + r := rand.New(rand.NewSource(time.Now().UnixNano())) + for time.Now().Before(until) { + c.Get(0, uint64(r.Intn(maxkey)), func() (int, Value) { + time.Sleep(delay) + atomic.AddInt32(&set, 1) + return 1, 1 + }).Release() + } + }(i) + } + for i := 0; i < concurrentGet; i++ { + wg.Add(1) + go func(i int) { + defer wg.Done() + r := rand.New(rand.NewSource(time.Now().UnixNano())) + for { + mark := time.Now() + if mark.Before(until) { + h := c.Get(0, uint64(r.Intn(maxkey)), nil) + latency := int64(time.Now().Sub(mark)) + m := atomic.LoadInt64(&getMaxLatency) + if latency > m { + atomic.CompareAndSwapInt64(&getMaxLatency, m, latency) + } + atomic.AddInt64(&getDuration, latency) + if h != nil { + atomic.AddInt32(&getHit, 1) + h.Release() + } + atomic.AddInt32(&getAll, 1) + } else { + break + } + } + }(i) + } + + wg.Wait() + getAvglatency := time.Duration(getDuration) / time.Duration(getAll) + t.Logf("set=%d getHit=%d getAll=%d getMaxLatency=%v getAvgLatency=%v", + set, getHit, getAll, time.Duration(getMaxLatency), getAvglatency) + + if getAvglatency > delay/3 { + t.Errorf("get avg latency > %v: got=%v", delay/3, getAvglatency) + } +} + +func TestLRUCache_HitMiss(t *testing.T) { + cases := []struct { + key uint64 + value string + }{ + {1, "vvvvvvvvv"}, + {100, "v1"}, + {0, "v2"}, + {12346, "v3"}, + {777, "v4"}, + {999, "v5"}, + {7654, "v6"}, + {2, "v7"}, + {3, "v8"}, + {9, "v9"}, + } + + setfin := 0 + c := NewCache(NewLRU(1000)) + for i, x := range cases { + set(c, 0, x.key, x.value, len(x.value), func() { + setfin++ + }).Release() + for j, y := range cases { + h := c.Get(0, y.key, nil) + if j <= i { + // should hit + if h == nil { + t.Errorf("case '%d' iteration '%d' is miss", i, j) + } else { + if x := h.Value().(releaserFunc).value.(string); x != y.value { + t.Errorf("case '%d' iteration '%d' has invalid value got '%s', want '%s'", i, j, x, y.value) + } + } + } else { + // should miss + if h != nil { + t.Errorf("case '%d' iteration '%d' is hit , value '%s'", i, j, h.Value().(releaserFunc).value.(string)) + } + } + if h != nil { + h.Release() + } + } + } + + for i, x := range cases { + finalizerOk := false + c.Delete(0, x.key, func() { + finalizerOk = true + }) + + if !finalizerOk { + t.Errorf("case %d delete finalizer not executed", i) + } + + for j, y := range cases { + h := c.Get(0, y.key, nil) + if j > i { + // should hit + if h == nil { + t.Errorf("case '%d' iteration '%d' is miss", i, j) + } else { + if x := h.Value().(releaserFunc).value.(string); x != y.value { + t.Errorf("case '%d' iteration '%d' has invalid value got '%s', want '%s'", i, j, x, y.value) + } + } + } else { + // should miss + if h != nil { + t.Errorf("case '%d' iteration '%d' is hit, value '%s'", i, j, h.Value().(releaserFunc).value.(string)) + } + } + if h != nil { + h.Release() + } + } + } + + if setfin != len(cases) { + t.Errorf("some set finalizer may not be executed, want=%d got=%d", len(cases), setfin) + } +} + +func TestLRUCache_Eviction(t *testing.T) { + c := NewCache(NewLRU(12)) + o1 := set(c, 0, 1, 1, 1, nil) + set(c, 0, 2, 2, 1, nil).Release() + set(c, 0, 3, 3, 1, nil).Release() + set(c, 0, 4, 4, 1, nil).Release() + set(c, 0, 5, 5, 1, nil).Release() + if h := c.Get(0, 2, nil); h != nil { // 1,3,4,5,2 + h.Release() + } + set(c, 0, 9, 9, 10, nil).Release() // 5,2,9 + + for _, key := range []uint64{9, 2, 5, 1} { + h := c.Get(0, key, nil) + if h == nil { + t.Errorf("miss for key '%d'", key) + } else { + if x := h.Value().(int); x != int(key) { + t.Errorf("invalid value for key '%d' want '%d', got '%d'", key, key, x) + } + h.Release() + } + } + o1.Release() + for _, key := range []uint64{1, 2, 5} { + h := c.Get(0, key, nil) + if h == nil { + t.Errorf("miss for key '%d'", key) + } else { + if x := h.Value().(int); x != int(key) { + t.Errorf("invalid value for key '%d' want '%d', got '%d'", key, key, x) + } + h.Release() + } + } + for _, key := range []uint64{3, 4, 9} { + h := c.Get(0, key, nil) + if h != nil { + t.Errorf("hit for key '%d'", key) + if x := h.Value().(int); x != int(key) { + t.Errorf("invalid value for key '%d' want '%d', got '%d'", key, key, x) + } + h.Release() + } + } +} + +func TestLRUCache_Evict(t *testing.T) { + c := NewCache(NewLRU(6)) + set(c, 0, 1, 1, 1, nil).Release() + set(c, 0, 2, 2, 1, nil).Release() + set(c, 1, 1, 4, 1, nil).Release() + set(c, 1, 2, 5, 1, nil).Release() + set(c, 2, 1, 6, 1, nil).Release() + set(c, 2, 2, 7, 1, nil).Release() + + for ns := 0; ns < 3; ns++ { + for key := 1; key < 3; key++ { + if h := c.Get(uint64(ns), uint64(key), nil); h != nil { + h.Release() + } else { + t.Errorf("Cache.Get on #%d.%d return nil", ns, key) + } + } + } + + if ok := c.Evict(0, 1); !ok { + t.Error("first Cache.Evict on #0.1 return false") + } + if ok := c.Evict(0, 1); ok { + t.Error("second Cache.Evict on #0.1 return true") + } + if h := c.Get(0, 1, nil); h != nil { + t.Errorf("Cache.Get on #0.1 return non-nil: %v", h.Value()) + } + + c.EvictNS(1) + if h := c.Get(1, 1, nil); h != nil { + t.Errorf("Cache.Get on #1.1 return non-nil: %v", h.Value()) + } + if h := c.Get(1, 2, nil); h != nil { + t.Errorf("Cache.Get on #1.2 return non-nil: %v", h.Value()) + } + + c.EvictAll() + for ns := 0; ns < 3; ns++ { + for key := 1; key < 3; key++ { + if h := c.Get(uint64(ns), uint64(key), nil); h != nil { + t.Errorf("Cache.Get on #%d.%d return non-nil: %v", ns, key, h.Value()) + } + } + } +} + +func TestLRUCache_Delete(t *testing.T) { + delFuncCalled := 0 + delFunc := func() { + delFuncCalled++ + } + + c := NewCache(NewLRU(2)) + set(c, 0, 1, 1, 1, nil).Release() + set(c, 0, 2, 2, 1, nil).Release() + + if ok := c.Delete(0, 1, delFunc); !ok { + t.Error("Cache.Delete on #1 return false") + } + if h := c.Get(0, 1, nil); h != nil { + t.Errorf("Cache.Get on #1 return non-nil: %v", h.Value()) + } + if ok := c.Delete(0, 1, delFunc); ok { + t.Error("Cache.Delete on #1 return true") + } + + h2 := c.Get(0, 2, nil) + if h2 == nil { + t.Error("Cache.Get on #2 return nil") + } + if ok := c.Delete(0, 2, delFunc); !ok { + t.Error("(1) Cache.Delete on #2 return false") + } + if ok := c.Delete(0, 2, delFunc); !ok { + t.Error("(2) Cache.Delete on #2 return false") + } + + set(c, 0, 3, 3, 1, nil).Release() + set(c, 0, 4, 4, 1, nil).Release() + c.Get(0, 2, nil).Release() + + for key := 2; key <= 4; key++ { + if h := c.Get(0, uint64(key), nil); h != nil { + h.Release() + } else { + t.Errorf("Cache.Get on #%d return nil", key) + } + } + + h2.Release() + if h := c.Get(0, 2, nil); h != nil { + t.Errorf("Cache.Get on #2 return non-nil: %v", h.Value()) + } + + if delFuncCalled != 4 { + t.Errorf("delFunc isn't called 4 times: got=%d", delFuncCalled) + } +} + +func TestLRUCache_Close(t *testing.T) { + relFuncCalled := 0 + relFunc := func() { + relFuncCalled++ + } + delFuncCalled := 0 + delFunc := func() { + delFuncCalled++ + } + + c := NewCache(NewLRU(2)) + set(c, 0, 1, 1, 1, relFunc).Release() + set(c, 0, 2, 2, 1, relFunc).Release() + + h3 := set(c, 0, 3, 3, 1, relFunc) + if h3 == nil { + t.Error("Cache.Get on #3 return nil") + } + if ok := c.Delete(0, 3, delFunc); !ok { + t.Error("Cache.Delete on #3 return false") + } + + c.Close() + + if relFuncCalled != 3 { + t.Errorf("relFunc isn't called 3 times: got=%d", relFuncCalled) + } + if delFuncCalled != 1 { + t.Errorf("delFunc isn't called 1 times: got=%d", delFuncCalled) + } +} diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/cache/lru.go b/vendor/github.com/syndtr/goleveldb/leveldb/cache/lru.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/cache/lru.go rename to vendor/github.com/syndtr/goleveldb/leveldb/cache/lru.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/comparer.go b/vendor/github.com/syndtr/goleveldb/leveldb/comparer.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/comparer.go rename to vendor/github.com/syndtr/goleveldb/leveldb/comparer.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/comparer/bytes_comparer.go b/vendor/github.com/syndtr/goleveldb/leveldb/comparer/bytes_comparer.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/comparer/bytes_comparer.go rename to vendor/github.com/syndtr/goleveldb/leveldb/comparer/bytes_comparer.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/comparer/comparer.go b/vendor/github.com/syndtr/goleveldb/leveldb/comparer/comparer.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/comparer/comparer.go rename to vendor/github.com/syndtr/goleveldb/leveldb/comparer/comparer.go diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/corrupt_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/corrupt_test.go new file mode 100644 index 0000000..fef2026 --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/corrupt_test.go @@ -0,0 +1,496 @@ +// Copyright (c) 2013, Suryandaru Triandana +// All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package leveldb + +import ( + "bytes" + "fmt" + "io" + "math/rand" + "testing" + + "github.com/syndtr/goleveldb/leveldb/filter" + "github.com/syndtr/goleveldb/leveldb/opt" + "github.com/syndtr/goleveldb/leveldb/storage" +) + +const ctValSize = 1000 + +type dbCorruptHarness struct { + dbHarness +} + +func newDbCorruptHarnessWopt(t *testing.T, o *opt.Options) *dbCorruptHarness { + h := new(dbCorruptHarness) + h.init(t, o) + return h +} + +func newDbCorruptHarness(t *testing.T) *dbCorruptHarness { + return newDbCorruptHarnessWopt(t, &opt.Options{ + BlockCacheCapacity: 100, + Strict: opt.StrictJournalChecksum, + }) +} + +func (h *dbCorruptHarness) recover() { + p := &h.dbHarness + t := p.t + + var err error + p.db, err = Recover(h.stor, h.o) + if err != nil { + t.Fatal("Repair: got error: ", err) + } +} + +func (h *dbCorruptHarness) build(n int) { + p := &h.dbHarness + t := p.t + db := p.db + + batch := new(Batch) + for i := 0; i < n; i++ { + batch.Reset() + batch.Put(tkey(i), tval(i, ctValSize)) + err := db.Write(batch, p.wo) + if err != nil { + t.Fatal("write error: ", err) + } + } +} + +func (h *dbCorruptHarness) buildShuffled(n int, rnd *rand.Rand) { + p := &h.dbHarness + t := p.t + db := p.db + + batch := new(Batch) + for i := range rnd.Perm(n) { + batch.Reset() + batch.Put(tkey(i), tval(i, ctValSize)) + err := db.Write(batch, p.wo) + if err != nil { + t.Fatal("write error: ", err) + } + } +} + +func (h *dbCorruptHarness) deleteRand(n, max int, rnd *rand.Rand) { + p := &h.dbHarness + t := p.t + db := p.db + + batch := new(Batch) + for i := 0; i < n; i++ { + batch.Reset() + batch.Delete(tkey(rnd.Intn(max))) + err := db.Write(batch, p.wo) + if err != nil { + t.Fatal("write error: ", err) + } + } +} + +func (h *dbCorruptHarness) corrupt(ft storage.FileType, fi, offset, n int) { + p := &h.dbHarness + t := p.t + + fds, _ := p.stor.List(ft) + sortFds(fds) + if fi < 0 { + fi = len(fds) - 1 + } + if fi >= len(fds) { + t.Fatalf("no such file with type %q with index %d", ft, fi) + } + + fd := fds[fi] + r, err := h.stor.Open(fd) + if err != nil { + t.Fatal("cannot open file: ", err) + } + x, err := r.Seek(0, 2) + if err != nil { + t.Fatal("cannot query file size: ", err) + } + m := int(x) + if _, err := r.Seek(0, 0); err != nil { + t.Fatal(err) + } + + if offset < 0 { + if -offset > m { + offset = 0 + } else { + offset = m + offset + } + } + if offset > m { + offset = m + } + if offset+n > m { + n = m - offset + } + + buf := make([]byte, m) + _, err = io.ReadFull(r, buf) + if err != nil { + t.Fatal("cannot read file: ", err) + } + r.Close() + + for i := 0; i < n; i++ { + buf[offset+i] ^= 0x80 + } + + err = h.stor.Remove(fd) + if err != nil { + t.Fatal("cannot remove old file: ", err) + } + w, err := h.stor.Create(fd) + if err != nil { + t.Fatal("cannot create new file: ", err) + } + _, err = w.Write(buf) + if err != nil { + t.Fatal("cannot write new file: ", err) + } + w.Close() +} + +func (h *dbCorruptHarness) removeAll(ft storage.FileType) { + fds, err := h.stor.List(ft) + if err != nil { + h.t.Fatal("get files: ", err) + } + for _, fd := range fds { + if err := h.stor.Remove(fd); err != nil { + h.t.Error("remove file: ", err) + } + } +} + +func (h *dbCorruptHarness) forceRemoveAll(ft storage.FileType) { + fds, err := h.stor.List(ft) + if err != nil { + h.t.Fatal("get files: ", err) + } + for _, fd := range fds { + if err := h.stor.ForceRemove(fd); err != nil { + h.t.Error("remove file: ", err) + } + } +} + +func (h *dbCorruptHarness) removeOne(ft storage.FileType) { + fds, err := h.stor.List(ft) + if err != nil { + h.t.Fatal("get files: ", err) + } + fd := fds[rand.Intn(len(fds))] + h.t.Logf("removing file @%d", fd.Num) + if err := h.stor.Remove(fd); err != nil { + h.t.Error("remove file: ", err) + } +} + +func (h *dbCorruptHarness) check(min, max int) { + p := &h.dbHarness + t := p.t + db := p.db + + var n, badk, badv, missed, good int + iter := db.NewIterator(nil, p.ro) + for iter.Next() { + k := 0 + fmt.Sscanf(string(iter.Key()), "%d", &k) + if k < n { + badk++ + continue + } + missed += k - n + n = k + 1 + if !bytes.Equal(iter.Value(), tval(k, ctValSize)) { + badv++ + } else { + good++ + } + } + err := iter.Error() + iter.Release() + t.Logf("want=%d..%d got=%d badkeys=%d badvalues=%d missed=%d, err=%v", + min, max, good, badk, badv, missed, err) + if good < min || good > max { + t.Errorf("good entries number not in range") + } +} + +func TestCorruptDB_Journal(t *testing.T) { + h := newDbCorruptHarness(t) + defer h.close() + + h.build(100) + h.check(100, 100) + h.closeDB() + h.corrupt(storage.TypeJournal, -1, 19, 1) + h.corrupt(storage.TypeJournal, -1, 32*1024+1000, 1) + + h.openDB() + h.check(36, 36) +} + +func TestCorruptDB_Table(t *testing.T) { + h := newDbCorruptHarness(t) + defer h.close() + + h.build(100) + h.compactMem() + h.compactRangeAt(0, "", "") + h.compactRangeAt(1, "", "") + h.closeDB() + h.corrupt(storage.TypeTable, -1, 100, 1) + + h.openDB() + h.check(99, 99) +} + +func TestCorruptDB_TableIndex(t *testing.T) { + h := newDbCorruptHarness(t) + defer h.close() + + h.build(10000) + h.compactMem() + h.closeDB() + h.corrupt(storage.TypeTable, -1, -2000, 500) + + h.openDB() + h.check(5000, 9999) +} + +func TestCorruptDB_MissingManifest(t *testing.T) { + rnd := rand.New(rand.NewSource(0x0badda7a)) + h := newDbCorruptHarnessWopt(t, &opt.Options{ + BlockCacheCapacity: 100, + Strict: opt.StrictJournalChecksum, + WriteBuffer: 1000 * 60, + }) + defer h.close() + + h.build(1000) + h.compactMem() + h.buildShuffled(1000, rnd) + h.compactMem() + h.deleteRand(500, 1000, rnd) + h.compactMem() + h.buildShuffled(1000, rnd) + h.compactMem() + h.deleteRand(500, 1000, rnd) + h.compactMem() + h.buildShuffled(1000, rnd) + h.compactMem() + h.closeDB() + + h.forceRemoveAll(storage.TypeManifest) + h.openAssert(false) + + h.recover() + h.check(1000, 1000) + h.build(1000) + h.compactMem() + h.compactRange("", "") + h.closeDB() + + h.recover() + h.check(1000, 1000) +} + +func TestCorruptDB_SequenceNumberRecovery(t *testing.T) { + h := newDbCorruptHarness(t) + defer h.close() + + h.put("foo", "v1") + h.put("foo", "v2") + h.put("foo", "v3") + h.put("foo", "v4") + h.put("foo", "v5") + h.closeDB() + + h.recover() + h.getVal("foo", "v5") + h.put("foo", "v6") + h.getVal("foo", "v6") + + h.reopenDB() + h.getVal("foo", "v6") +} + +func TestCorruptDB_SequenceNumberRecoveryTable(t *testing.T) { + h := newDbCorruptHarness(t) + defer h.close() + + h.put("foo", "v1") + h.put("foo", "v2") + h.put("foo", "v3") + h.compactMem() + h.put("foo", "v4") + h.put("foo", "v5") + h.compactMem() + h.closeDB() + + h.recover() + h.getVal("foo", "v5") + h.put("foo", "v6") + h.getVal("foo", "v6") + + h.reopenDB() + h.getVal("foo", "v6") +} + +func TestCorruptDB_CorruptedManifest(t *testing.T) { + h := newDbCorruptHarness(t) + defer h.close() + + h.put("foo", "hello") + h.compactMem() + h.compactRange("", "") + h.closeDB() + h.corrupt(storage.TypeManifest, -1, 0, 1000) + h.openAssert(false) + + h.recover() + h.getVal("foo", "hello") +} + +func TestCorruptDB_CompactionInputError(t *testing.T) { + h := newDbCorruptHarness(t) + defer h.close() + + h.build(10) + h.compactMem() + h.closeDB() + h.corrupt(storage.TypeTable, -1, 100, 1) + + h.openDB() + h.check(9, 9) + + h.build(10000) + h.check(10000, 10000) +} + +func TestCorruptDB_UnrelatedKeys(t *testing.T) { + h := newDbCorruptHarness(t) + defer h.close() + + h.build(10) + h.compactMem() + h.closeDB() + h.corrupt(storage.TypeTable, -1, 100, 1) + + h.openDB() + h.put(string(tkey(1000)), string(tval(1000, ctValSize))) + h.getVal(string(tkey(1000)), string(tval(1000, ctValSize))) + h.compactMem() + h.getVal(string(tkey(1000)), string(tval(1000, ctValSize))) +} + +func TestCorruptDB_Level0NewerFileHasOlderSeqnum(t *testing.T) { + h := newDbCorruptHarness(t) + defer h.close() + + h.put("a", "v1") + h.put("b", "v1") + h.compactMem() + h.put("a", "v2") + h.put("b", "v2") + h.compactMem() + h.put("a", "v3") + h.put("b", "v3") + h.compactMem() + h.put("c", "v0") + h.put("d", "v0") + h.compactMem() + h.compactRangeAt(1, "", "") + h.closeDB() + + h.recover() + h.getVal("a", "v3") + h.getVal("b", "v3") + h.getVal("c", "v0") + h.getVal("d", "v0") +} + +func TestCorruptDB_RecoverInvalidSeq_Issue53(t *testing.T) { + h := newDbCorruptHarness(t) + defer h.close() + + h.put("a", "v1") + h.put("b", "v1") + h.compactMem() + h.put("a", "v2") + h.put("b", "v2") + h.compactMem() + h.put("a", "v3") + h.put("b", "v3") + h.compactMem() + h.put("c", "v0") + h.put("d", "v0") + h.compactMem() + h.compactRangeAt(0, "", "") + h.closeDB() + + h.recover() + h.getVal("a", "v3") + h.getVal("b", "v3") + h.getVal("c", "v0") + h.getVal("d", "v0") +} + +func TestCorruptDB_MissingTableFiles(t *testing.T) { + h := newDbCorruptHarness(t) + defer h.close() + + h.put("a", "v1") + h.put("b", "v1") + h.compactMem() + h.put("c", "v2") + h.put("d", "v2") + h.compactMem() + h.put("e", "v3") + h.put("f", "v3") + h.closeDB() + + h.removeOne(storage.TypeTable) + h.openAssert(false) +} + +func TestCorruptDB_RecoverTable(t *testing.T) { + h := newDbCorruptHarnessWopt(t, &opt.Options{ + WriteBuffer: 112 * opt.KiB, + CompactionTableSize: 90 * opt.KiB, + Filter: filter.NewBloomFilter(10), + }) + defer h.close() + + h.build(1000) + h.compactMem() + h.compactRangeAt(0, "", "") + h.compactRangeAt(1, "", "") + seq := h.db.seq + h.closeDB() + h.corrupt(storage.TypeTable, 0, 1000, 1) + h.corrupt(storage.TypeTable, 3, 10000, 1) + // Corrupted filter shouldn't affect recovery. + h.corrupt(storage.TypeTable, 3, 113888, 10) + h.corrupt(storage.TypeTable, -1, 20000, 1) + + h.recover() + if h.db.seq != seq { + t.Errorf("invalid seq, want=%d got=%d", seq, h.db.seq) + } + h.check(985, 985) +} diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/db.go b/vendor/github.com/syndtr/goleveldb/leveldb/db.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/db.go rename to vendor/github.com/syndtr/goleveldb/leveldb/db.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/db_compaction.go b/vendor/github.com/syndtr/goleveldb/leveldb/db_compaction.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/db_compaction.go rename to vendor/github.com/syndtr/goleveldb/leveldb/db_compaction.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/db_iter.go b/vendor/github.com/syndtr/goleveldb/leveldb/db_iter.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/db_iter.go rename to vendor/github.com/syndtr/goleveldb/leveldb/db_iter.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/db_snapshot.go b/vendor/github.com/syndtr/goleveldb/leveldb/db_snapshot.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/db_snapshot.go rename to vendor/github.com/syndtr/goleveldb/leveldb/db_snapshot.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/db_state.go b/vendor/github.com/syndtr/goleveldb/leveldb/db_state.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/db_state.go rename to vendor/github.com/syndtr/goleveldb/leveldb/db_state.go diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/db_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/db_test.go new file mode 100644 index 0000000..37d08eb --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/db_test.go @@ -0,0 +1,2829 @@ +// Copyright (c) 2012, Suryandaru Triandana +// All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package leveldb + +import ( + "bytes" + "container/list" + crand "crypto/rand" + "encoding/binary" + "fmt" + "math/rand" + "os" + "path/filepath" + "runtime" + "strings" + "sync" + "sync/atomic" + "testing" + "time" + "unsafe" + + "github.com/onsi/gomega" + + "github.com/syndtr/goleveldb/leveldb/comparer" + "github.com/syndtr/goleveldb/leveldb/errors" + "github.com/syndtr/goleveldb/leveldb/filter" + "github.com/syndtr/goleveldb/leveldb/iterator" + "github.com/syndtr/goleveldb/leveldb/opt" + "github.com/syndtr/goleveldb/leveldb/storage" + "github.com/syndtr/goleveldb/leveldb/testutil" + "github.com/syndtr/goleveldb/leveldb/util" +) + +func tkey(i int) []byte { + return []byte(fmt.Sprintf("%016d", i)) +} + +func tval(seed, n int) []byte { + r := rand.New(rand.NewSource(int64(seed))) + return randomString(r, n) +} + +func testingLogger(t *testing.T) func(log string) { + return func(log string) { + t.Log(log) + } +} + +func testingPreserveOnFailed(t *testing.T) func() (preserve bool, err error) { + return func() (preserve bool, err error) { + preserve = t.Failed() + return + } +} + +type dbHarness struct { + t *testing.T + + stor *testutil.Storage + db *DB + o *opt.Options + ro *opt.ReadOptions + wo *opt.WriteOptions +} + +func newDbHarnessWopt(t *testing.T, o *opt.Options) *dbHarness { + h := new(dbHarness) + h.init(t, o) + return h +} + +func newDbHarness(t *testing.T) *dbHarness { + return newDbHarnessWopt(t, &opt.Options{DisableLargeBatchTransaction: true}) +} + +func (h *dbHarness) init(t *testing.T, o *opt.Options) { + gomega.RegisterTestingT(t) + h.t = t + h.stor = testutil.NewStorage() + h.stor.OnLog(testingLogger(t)) + h.stor.OnClose(testingPreserveOnFailed(t)) + h.o = o + h.ro = nil + h.wo = nil + + if err := h.openDB0(); err != nil { + // So that it will come after fatal message. + defer h.stor.Close() + h.t.Fatal("Open (init): got error: ", err) + } +} + +func (h *dbHarness) openDB0() (err error) { + h.t.Log("opening DB") + h.db, err = Open(h.stor, h.o) + return +} + +func (h *dbHarness) openDB() { + if err := h.openDB0(); err != nil { + h.t.Fatal("Open: got error: ", err) + } +} + +func (h *dbHarness) closeDB0() error { + h.t.Log("closing DB") + return h.db.Close() +} + +func (h *dbHarness) closeDB() { + if h.db != nil { + if err := h.closeDB0(); err != nil { + h.t.Error("Close: got error: ", err) + } + h.db = nil + } + h.stor.CloseCheck() + runtime.GC() +} + +func (h *dbHarness) reopenDB() { + if h.db != nil { + h.closeDB() + } + h.openDB() +} + +func (h *dbHarness) close() { + if h.db != nil { + h.closeDB0() + h.db = nil + } + h.stor.Close() + h.stor = nil + runtime.GC() +} + +func (h *dbHarness) openAssert(want bool) { + db, err := Open(h.stor, h.o) + if err != nil { + if want { + h.t.Error("Open: assert: got error: ", err) + } else { + h.t.Log("Open: assert: got error (expected): ", err) + } + } else { + if !want { + h.t.Error("Open: assert: expect error") + } + db.Close() + } +} + +func (h *dbHarness) write(batch *Batch) { + if err := h.db.Write(batch, h.wo); err != nil { + h.t.Error("Write: got error: ", err) + } +} + +func (h *dbHarness) put(key, value string) { + if err := h.db.Put([]byte(key), []byte(value), h.wo); err != nil { + h.t.Error("Put: got error: ", err) + } +} + +func (h *dbHarness) putMulti(n int, low, hi string) { + for i := 0; i < n; i++ { + h.put(low, "begin") + h.put(hi, "end") + h.compactMem() + } +} + +func (h *dbHarness) maxNextLevelOverlappingBytes(want int64) { + t := h.t + db := h.db + + var ( + maxOverlaps int64 + maxLevel int + ) + v := db.s.version() + if len(v.levels) > 2 { + for i, tt := range v.levels[1 : len(v.levels)-1] { + level := i + 1 + next := v.levels[level+1] + for _, t := range tt { + r := next.getOverlaps(nil, db.s.icmp, t.imin.ukey(), t.imax.ukey(), false) + sum := r.size() + if sum > maxOverlaps { + maxOverlaps = sum + maxLevel = level + } + } + } + } + v.release() + + if maxOverlaps > want { + t.Errorf("next level most overlapping bytes is more than %d, got=%d level=%d", want, maxOverlaps, maxLevel) + } else { + t.Logf("next level most overlapping bytes is %d, level=%d want=%d", maxOverlaps, maxLevel, want) + } +} + +func (h *dbHarness) delete(key string) { + t := h.t + db := h.db + + err := db.Delete([]byte(key), h.wo) + if err != nil { + t.Error("Delete: got error: ", err) + } +} + +func (h *dbHarness) assertNumKeys(want int) { + iter := h.db.NewIterator(nil, h.ro) + defer iter.Release() + got := 0 + for iter.Next() { + got++ + } + if err := iter.Error(); err != nil { + h.t.Error("assertNumKeys: ", err) + } + if want != got { + h.t.Errorf("assertNumKeys: want=%d got=%d", want, got) + } +} + +func (h *dbHarness) getr(db Reader, key string, expectFound bool) (found bool, v []byte) { + t := h.t + v, err := db.Get([]byte(key), h.ro) + switch err { + case ErrNotFound: + if expectFound { + t.Errorf("Get: key '%s' not found, want found", key) + } + case nil: + found = true + if !expectFound { + t.Errorf("Get: key '%s' found, want not found", key) + } + default: + t.Error("Get: got error: ", err) + } + return +} + +func (h *dbHarness) get(key string, expectFound bool) (found bool, v []byte) { + return h.getr(h.db, key, expectFound) +} + +func (h *dbHarness) getValr(db Reader, key, value string) { + t := h.t + found, r := h.getr(db, key, true) + if !found { + return + } + rval := string(r) + if rval != value { + t.Errorf("Get: invalid value, got '%s', want '%s'", rval, value) + } +} + +func (h *dbHarness) getVal(key, value string) { + h.getValr(h.db, key, value) +} + +func (h *dbHarness) allEntriesFor(key, want string) { + t := h.t + db := h.db + s := db.s + + ikey := makeInternalKey(nil, []byte(key), keyMaxSeq, keyTypeVal) + iter := db.newRawIterator(nil, nil, nil, nil) + if !iter.Seek(ikey) && iter.Error() != nil { + t.Error("AllEntries: error during seek, err: ", iter.Error()) + return + } + res := "[ " + first := true + for iter.Valid() { + if ukey, _, kt, kerr := parseInternalKey(iter.Key()); kerr == nil { + if s.icmp.uCompare(ikey.ukey(), ukey) != 0 { + break + } + if !first { + res += ", " + } + first = false + switch kt { + case keyTypeVal: + res += string(iter.Value()) + case keyTypeDel: + res += "DEL" + } + } else { + if !first { + res += ", " + } + first = false + res += "CORRUPTED" + } + iter.Next() + } + if !first { + res += " " + } + res += "]" + if res != want { + t.Errorf("AllEntries: assert failed for key %q, got=%q want=%q", key, res, want) + } +} + +// Return a string that contains all key,value pairs in order, +// formatted like "(k1->v1)(k2->v2)". +func (h *dbHarness) getKeyVal(want string) { + t := h.t + db := h.db + + s, err := db.GetSnapshot() + if err != nil { + t.Fatal("GetSnapshot: got error: ", err) + } + res := "" + iter := s.NewIterator(nil, nil) + for iter.Next() { + res += fmt.Sprintf("(%s->%s)", string(iter.Key()), string(iter.Value())) + } + iter.Release() + + if res != want { + t.Errorf("GetKeyVal: invalid key/value pair, got=%q want=%q", res, want) + } + s.Release() +} + +func (h *dbHarness) waitCompaction() { + t := h.t + db := h.db + if err := db.compTriggerWait(db.tcompCmdC); err != nil { + t.Error("compaction error: ", err) + } +} + +func (h *dbHarness) waitMemCompaction() { + t := h.t + db := h.db + + if err := db.compTriggerWait(db.mcompCmdC); err != nil { + t.Error("compaction error: ", err) + } +} + +func (h *dbHarness) compactMem() { + t := h.t + db := h.db + + t.Log("starting memdb compaction") + + db.writeLockC <- struct{}{} + defer func() { + <-db.writeLockC + }() + + if _, err := db.rotateMem(0, true); err != nil { + t.Error("compaction error: ", err) + } + + if h.totalTables() == 0 { + t.Error("zero tables after mem compaction") + } + + t.Log("memdb compaction done") +} + +func (h *dbHarness) compactRangeAtErr(level int, min, max string, wanterr bool) { + t := h.t + db := h.db + + var _min, _max []byte + if min != "" { + _min = []byte(min) + } + if max != "" { + _max = []byte(max) + } + + t.Logf("starting table range compaction: level=%d, min=%q, max=%q", level, min, max) + + if err := db.compTriggerRange(db.tcompCmdC, level, _min, _max); err != nil { + if wanterr { + t.Log("CompactRangeAt: got error (expected): ", err) + } else { + t.Error("CompactRangeAt: got error: ", err) + } + } else if wanterr { + t.Error("CompactRangeAt: expect error") + } + + t.Log("table range compaction done") +} + +func (h *dbHarness) compactRangeAt(level int, min, max string) { + h.compactRangeAtErr(level, min, max, false) +} + +func (h *dbHarness) compactRange(min, max string) { + t := h.t + db := h.db + + t.Logf("starting DB range compaction: min=%q, max=%q", min, max) + + var r util.Range + if min != "" { + r.Start = []byte(min) + } + if max != "" { + r.Limit = []byte(max) + } + if err := db.CompactRange(r); err != nil { + t.Error("CompactRange: got error: ", err) + } + + t.Log("DB range compaction done") +} + +func (h *dbHarness) sizeOf(start, limit string) int64 { + sz, err := h.db.SizeOf([]util.Range{ + {[]byte(start), []byte(limit)}, + }) + if err != nil { + h.t.Error("SizeOf: got error: ", err) + } + return sz.Sum() +} + +func (h *dbHarness) sizeAssert(start, limit string, low, hi int64) { + sz := h.sizeOf(start, limit) + if sz < low || sz > hi { + h.t.Errorf("sizeOf %q to %q not in range, want %d - %d, got %d", + shorten(start), shorten(limit), low, hi, sz) + } +} + +func (h *dbHarness) getSnapshot() (s *Snapshot) { + s, err := h.db.GetSnapshot() + if err != nil { + h.t.Fatal("GetSnapshot: got error: ", err) + } + return +} + +func (h *dbHarness) getTablesPerLevel() string { + res := "" + nz := 0 + v := h.db.s.version() + for level, tables := range v.levels { + if level > 0 { + res += "," + } + res += fmt.Sprint(len(tables)) + if len(tables) > 0 { + nz = len(res) + } + } + v.release() + return res[:nz] +} + +func (h *dbHarness) tablesPerLevel(want string) { + res := h.getTablesPerLevel() + if res != want { + h.t.Errorf("invalid tables len, want=%s, got=%s", want, res) + } +} + +func (h *dbHarness) totalTables() (n int) { + v := h.db.s.version() + for _, tables := range v.levels { + n += len(tables) + } + v.release() + return +} + +type keyValue interface { + Key() []byte + Value() []byte +} + +func testKeyVal(t *testing.T, kv keyValue, want string) { + res := string(kv.Key()) + "->" + string(kv.Value()) + if res != want { + t.Errorf("invalid key/value, want=%q, got=%q", want, res) + } +} + +func numKey(num int) string { + return fmt.Sprintf("key%06d", num) +} + +var testingBloomFilter = filter.NewBloomFilter(10) + +func truno(t *testing.T, o *opt.Options, f func(h *dbHarness)) { + for i := 0; i < 4; i++ { + func() { + switch i { + case 0: + case 1: + if o == nil { + o = &opt.Options{ + DisableLargeBatchTransaction: true, + Filter: testingBloomFilter, + } + } else { + old := o + o = &opt.Options{} + *o = *old + o.Filter = testingBloomFilter + } + case 2: + if o == nil { + o = &opt.Options{ + DisableLargeBatchTransaction: true, + Compression: opt.NoCompression, + } + } else { + old := o + o = &opt.Options{} + *o = *old + o.Compression = opt.NoCompression + } + } + h := newDbHarnessWopt(t, o) + defer h.close() + switch i { + case 3: + h.reopenDB() + } + f(h) + }() + } +} + +func trun(t *testing.T, f func(h *dbHarness)) { + truno(t, nil, f) +} + +func testAligned(t *testing.T, name string, offset uintptr) { + if offset%8 != 0 { + t.Errorf("field %s offset is not 64-bit aligned", name) + } +} + +func Test_FieldsAligned(t *testing.T) { + p1 := new(DB) + testAligned(t, "DB.seq", unsafe.Offsetof(p1.seq)) + p2 := new(session) + testAligned(t, "session.stNextFileNum", unsafe.Offsetof(p2.stNextFileNum)) + testAligned(t, "session.stJournalNum", unsafe.Offsetof(p2.stJournalNum)) + testAligned(t, "session.stPrevJournalNum", unsafe.Offsetof(p2.stPrevJournalNum)) + testAligned(t, "session.stSeqNum", unsafe.Offsetof(p2.stSeqNum)) +} + +func TestDB_Locking(t *testing.T) { + h := newDbHarness(t) + defer h.stor.Close() + h.openAssert(false) + h.closeDB() + h.openAssert(true) +} + +func TestDB_Empty(t *testing.T) { + trun(t, func(h *dbHarness) { + h.get("foo", false) + + h.reopenDB() + h.get("foo", false) + }) +} + +func TestDB_ReadWrite(t *testing.T) { + trun(t, func(h *dbHarness) { + h.put("foo", "v1") + h.getVal("foo", "v1") + h.put("bar", "v2") + h.put("foo", "v3") + h.getVal("foo", "v3") + h.getVal("bar", "v2") + + h.reopenDB() + h.getVal("foo", "v3") + h.getVal("bar", "v2") + }) +} + +func TestDB_PutDeleteGet(t *testing.T) { + trun(t, func(h *dbHarness) { + h.put("foo", "v1") + h.getVal("foo", "v1") + h.put("foo", "v2") + h.getVal("foo", "v2") + h.delete("foo") + h.get("foo", false) + + h.reopenDB() + h.get("foo", false) + }) +} + +func TestDB_EmptyBatch(t *testing.T) { + h := newDbHarness(t) + defer h.close() + + h.get("foo", false) + err := h.db.Write(new(Batch), h.wo) + if err != nil { + t.Error("writing empty batch yield error: ", err) + } + h.get("foo", false) +} + +func TestDB_GetFromFrozen(t *testing.T) { + h := newDbHarnessWopt(t, &opt.Options{ + DisableLargeBatchTransaction: true, + WriteBuffer: 100100, + }) + defer h.close() + + h.put("foo", "v1") + h.getVal("foo", "v1") + + h.stor.Stall(testutil.ModeSync, storage.TypeTable) // Block sync calls + h.put("k1", strings.Repeat("x", 100000)) // Fill memtable + h.put("k2", strings.Repeat("y", 100000)) // Trigger compaction + for i := 0; h.db.getFrozenMem() == nil && i < 100; i++ { + time.Sleep(10 * time.Microsecond) + } + if h.db.getFrozenMem() == nil { + h.stor.Release(testutil.ModeSync, storage.TypeTable) + t.Fatal("No frozen mem") + } + h.getVal("foo", "v1") + h.stor.Release(testutil.ModeSync, storage.TypeTable) // Release sync calls + + h.reopenDB() + h.getVal("foo", "v1") + h.get("k1", true) + h.get("k2", true) +} + +func TestDB_GetFromTable(t *testing.T) { + trun(t, func(h *dbHarness) { + h.put("foo", "v1") + h.compactMem() + h.getVal("foo", "v1") + }) +} + +func TestDB_GetSnapshot(t *testing.T) { + trun(t, func(h *dbHarness) { + bar := strings.Repeat("b", 200) + h.put("foo", "v1") + h.put(bar, "v1") + + snap, err := h.db.GetSnapshot() + if err != nil { + t.Fatal("GetSnapshot: got error: ", err) + } + + h.put("foo", "v2") + h.put(bar, "v2") + + h.getVal("foo", "v2") + h.getVal(bar, "v2") + h.getValr(snap, "foo", "v1") + h.getValr(snap, bar, "v1") + + h.compactMem() + + h.getVal("foo", "v2") + h.getVal(bar, "v2") + h.getValr(snap, "foo", "v1") + h.getValr(snap, bar, "v1") + + snap.Release() + + h.reopenDB() + h.getVal("foo", "v2") + h.getVal(bar, "v2") + }) +} + +func TestDB_GetLevel0Ordering(t *testing.T) { + trun(t, func(h *dbHarness) { + h.db.memdbMaxLevel = 2 + + for i := 0; i < 4; i++ { + h.put("bar", fmt.Sprintf("b%d", i)) + h.put("foo", fmt.Sprintf("v%d", i)) + h.compactMem() + } + h.getVal("foo", "v3") + h.getVal("bar", "b3") + + v := h.db.s.version() + t0len := v.tLen(0) + v.release() + if t0len < 2 { + t.Errorf("level-0 tables is less than 2, got %d", t0len) + } + + h.reopenDB() + h.getVal("foo", "v3") + h.getVal("bar", "b3") + }) +} + +func TestDB_GetOrderedByLevels(t *testing.T) { + trun(t, func(h *dbHarness) { + h.put("foo", "v1") + h.compactMem() + h.compactRange("a", "z") + h.getVal("foo", "v1") + h.put("foo", "v2") + h.compactMem() + h.getVal("foo", "v2") + }) +} + +func TestDB_GetPicksCorrectFile(t *testing.T) { + trun(t, func(h *dbHarness) { + // Arrange to have multiple files in a non-level-0 level. + h.put("a", "va") + h.compactMem() + h.compactRange("a", "b") + h.put("x", "vx") + h.compactMem() + h.compactRange("x", "y") + h.put("f", "vf") + h.compactMem() + h.compactRange("f", "g") + + h.getVal("a", "va") + h.getVal("f", "vf") + h.getVal("x", "vx") + + h.compactRange("", "") + h.getVal("a", "va") + h.getVal("f", "vf") + h.getVal("x", "vx") + }) +} + +func TestDB_GetEncountersEmptyLevel(t *testing.T) { + trun(t, func(h *dbHarness) { + h.db.memdbMaxLevel = 2 + + // Arrange for the following to happen: + // * sstable A in level 0 + // * nothing in level 1 + // * sstable B in level 2 + // Then do enough Get() calls to arrange for an automatic compaction + // of sstable A. A bug would cause the compaction to be marked as + // occuring at level 1 (instead of the correct level 0). + + // Step 1: First place sstables in levels 0 and 2 + for i := 0; ; i++ { + if i >= 100 { + t.Fatal("could not fill levels-0 and level-2") + } + v := h.db.s.version() + if v.tLen(0) > 0 && v.tLen(2) > 0 { + v.release() + break + } + v.release() + h.put("a", "begin") + h.put("z", "end") + h.compactMem() + + h.getVal("a", "begin") + h.getVal("z", "end") + } + + // Step 2: clear level 1 if necessary. + h.compactRangeAt(1, "", "") + h.tablesPerLevel("1,0,1") + + h.getVal("a", "begin") + h.getVal("z", "end") + + // Step 3: read a bunch of times + for i := 0; i < 200; i++ { + h.get("missing", false) + } + + // Step 4: Wait for compaction to finish + h.waitCompaction() + + v := h.db.s.version() + if v.tLen(0) > 0 { + t.Errorf("level-0 tables more than 0, got %d", v.tLen(0)) + } + v.release() + + h.getVal("a", "begin") + h.getVal("z", "end") + }) +} + +func TestDB_IterMultiWithDelete(t *testing.T) { + trun(t, func(h *dbHarness) { + h.put("a", "va") + h.put("b", "vb") + h.put("c", "vc") + h.delete("b") + h.get("b", false) + + iter := h.db.NewIterator(nil, nil) + iter.Seek([]byte("c")) + testKeyVal(t, iter, "c->vc") + iter.Prev() + testKeyVal(t, iter, "a->va") + iter.Release() + + h.compactMem() + + iter = h.db.NewIterator(nil, nil) + iter.Seek([]byte("c")) + testKeyVal(t, iter, "c->vc") + iter.Prev() + testKeyVal(t, iter, "a->va") + iter.Release() + }) +} + +func TestDB_IteratorPinsRef(t *testing.T) { + h := newDbHarness(t) + defer h.close() + + h.put("foo", "hello") + + // Get iterator that will yield the current contents of the DB. + iter := h.db.NewIterator(nil, nil) + + // Write to force compactions + h.put("foo", "newvalue1") + for i := 0; i < 100; i++ { + h.put(numKey(i), strings.Repeat(fmt.Sprintf("v%09d", i), 100000/10)) + } + h.put("foo", "newvalue2") + + iter.First() + testKeyVal(t, iter, "foo->hello") + if iter.Next() { + t.Errorf("expect eof") + } + iter.Release() +} + +func TestDB_Recover(t *testing.T) { + trun(t, func(h *dbHarness) { + h.put("foo", "v1") + h.put("baz", "v5") + + h.reopenDB() + h.getVal("foo", "v1") + + h.getVal("foo", "v1") + h.getVal("baz", "v5") + h.put("bar", "v2") + h.put("foo", "v3") + + h.reopenDB() + h.getVal("foo", "v3") + h.put("foo", "v4") + h.getVal("foo", "v4") + h.getVal("bar", "v2") + h.getVal("baz", "v5") + }) +} + +func TestDB_RecoverWithEmptyJournal(t *testing.T) { + trun(t, func(h *dbHarness) { + h.put("foo", "v1") + h.put("foo", "v2") + + h.reopenDB() + h.reopenDB() + h.put("foo", "v3") + + h.reopenDB() + h.getVal("foo", "v3") + }) +} + +func TestDB_RecoverDuringMemtableCompaction(t *testing.T) { + truno(t, &opt.Options{DisableLargeBatchTransaction: true, WriteBuffer: 1000000}, func(h *dbHarness) { + + h.stor.Stall(testutil.ModeSync, storage.TypeTable) + h.put("big1", strings.Repeat("x", 10000000)) + h.put("big2", strings.Repeat("y", 1000)) + h.put("bar", "v2") + h.stor.Release(testutil.ModeSync, storage.TypeTable) + + h.reopenDB() + h.getVal("bar", "v2") + h.getVal("big1", strings.Repeat("x", 10000000)) + h.getVal("big2", strings.Repeat("y", 1000)) + }) +} + +func TestDB_MinorCompactionsHappen(t *testing.T) { + h := newDbHarnessWopt(t, &opt.Options{DisableLargeBatchTransaction: true, WriteBuffer: 10000}) + defer h.close() + + n := 500 + + key := func(i int) string { + return fmt.Sprintf("key%06d", i) + } + + for i := 0; i < n; i++ { + h.put(key(i), key(i)+strings.Repeat("v", 1000)) + } + + for i := 0; i < n; i++ { + h.getVal(key(i), key(i)+strings.Repeat("v", 1000)) + } + + h.reopenDB() + for i := 0; i < n; i++ { + h.getVal(key(i), key(i)+strings.Repeat("v", 1000)) + } +} + +func TestDB_RecoverWithLargeJournal(t *testing.T) { + h := newDbHarness(t) + defer h.close() + + h.put("big1", strings.Repeat("1", 200000)) + h.put("big2", strings.Repeat("2", 200000)) + h.put("small3", strings.Repeat("3", 10)) + h.put("small4", strings.Repeat("4", 10)) + h.tablesPerLevel("") + + // Make sure that if we re-open with a small write buffer size that + // we flush table files in the middle of a large journal file. + h.o.WriteBuffer = 100000 + h.reopenDB() + h.getVal("big1", strings.Repeat("1", 200000)) + h.getVal("big2", strings.Repeat("2", 200000)) + h.getVal("small3", strings.Repeat("3", 10)) + h.getVal("small4", strings.Repeat("4", 10)) + v := h.db.s.version() + if v.tLen(0) <= 1 { + t.Errorf("tables-0 less than one") + } + v.release() +} + +func TestDB_CompactionsGenerateMultipleFiles(t *testing.T) { + h := newDbHarnessWopt(t, &opt.Options{ + DisableLargeBatchTransaction: true, + WriteBuffer: 10000000, + Compression: opt.NoCompression, + }) + defer h.close() + + v := h.db.s.version() + if v.tLen(0) > 0 { + t.Errorf("level-0 tables more than 0, got %d", v.tLen(0)) + } + v.release() + + n := 80 + + // Write 8MB (80 values, each 100K) + for i := 0; i < n; i++ { + h.put(numKey(i), strings.Repeat(fmt.Sprintf("v%09d", i), 100000/10)) + } + + // Reopening moves updates to level-0 + h.reopenDB() + h.compactRangeAt(0, "", "") + + v = h.db.s.version() + if v.tLen(0) > 0 { + t.Errorf("level-0 tables more than 0, got %d", v.tLen(0)) + } + if v.tLen(1) <= 1 { + t.Errorf("level-1 tables less than 1, got %d", v.tLen(1)) + } + v.release() + + for i := 0; i < n; i++ { + h.getVal(numKey(i), strings.Repeat(fmt.Sprintf("v%09d", i), 100000/10)) + } +} + +func TestDB_RepeatedWritesToSameKey(t *testing.T) { + h := newDbHarnessWopt(t, &opt.Options{DisableLargeBatchTransaction: true, WriteBuffer: 100000}) + defer h.close() + + maxTables := h.o.GetWriteL0PauseTrigger() + 7 + + value := strings.Repeat("v", 2*h.o.GetWriteBuffer()) + for i := 0; i < 5*maxTables; i++ { + h.put("key", value) + n := h.totalTables() + if n > maxTables { + t.Errorf("total tables exceed %d, got=%d, iter=%d", maxTables, n, i) + } + } +} + +func TestDB_RepeatedWritesToSameKeyAfterReopen(t *testing.T) { + h := newDbHarnessWopt(t, &opt.Options{ + DisableLargeBatchTransaction: true, + WriteBuffer: 100000, + }) + defer h.close() + + h.reopenDB() + + maxTables := h.o.GetWriteL0PauseTrigger() + 7 + + value := strings.Repeat("v", 2*h.o.GetWriteBuffer()) + for i := 0; i < 5*maxTables; i++ { + h.put("key", value) + n := h.totalTables() + if n > maxTables { + t.Errorf("total tables exceed %d, got=%d, iter=%d", maxTables, n, i) + } + } +} + +func TestDB_SparseMerge(t *testing.T) { + h := newDbHarnessWopt(t, &opt.Options{DisableLargeBatchTransaction: true, Compression: opt.NoCompression}) + defer h.close() + + h.putMulti(7, "A", "Z") + + // Suppose there is: + // small amount of data with prefix A + // large amount of data with prefix B + // small amount of data with prefix C + // and that recent updates have made small changes to all three prefixes. + // Check that we do not do a compaction that merges all of B in one shot. + h.put("A", "va") + value := strings.Repeat("x", 1000) + for i := 0; i < 100000; i++ { + h.put(fmt.Sprintf("B%010d", i), value) + } + h.put("C", "vc") + h.compactMem() + h.compactRangeAt(0, "", "") + h.waitCompaction() + + // Make sparse update + h.put("A", "va2") + h.put("B100", "bvalue2") + h.put("C", "vc2") + h.compactMem() + + h.waitCompaction() + h.maxNextLevelOverlappingBytes(20 * 1048576) + h.compactRangeAt(0, "", "") + h.waitCompaction() + h.maxNextLevelOverlappingBytes(20 * 1048576) + h.compactRangeAt(1, "", "") + h.waitCompaction() + h.maxNextLevelOverlappingBytes(20 * 1048576) +} + +func TestDB_SizeOf(t *testing.T) { + h := newDbHarnessWopt(t, &opt.Options{ + DisableLargeBatchTransaction: true, + Compression: opt.NoCompression, + WriteBuffer: 10000000, + }) + defer h.close() + + h.sizeAssert("", "xyz", 0, 0) + h.reopenDB() + h.sizeAssert("", "xyz", 0, 0) + + // Write 8MB (80 values, each 100K) + n := 80 + s1 := 100000 + s2 := 105000 + + for i := 0; i < n; i++ { + h.put(numKey(i), strings.Repeat(fmt.Sprintf("v%09d", i), s1/10)) + } + + // 0 because SizeOf() does not account for memtable space + h.sizeAssert("", numKey(50), 0, 0) + + for r := 0; r < 3; r++ { + h.reopenDB() + + for cs := 0; cs < n; cs += 10 { + for i := 0; i < n; i += 10 { + h.sizeAssert("", numKey(i), int64(s1*i), int64(s2*i)) + h.sizeAssert("", numKey(i)+".suffix", int64(s1*(i+1)), int64(s2*(i+1))) + h.sizeAssert(numKey(i), numKey(i+10), int64(s1*10), int64(s2*10)) + } + + h.sizeAssert("", numKey(50), int64(s1*50), int64(s2*50)) + h.sizeAssert("", numKey(50)+".suffix", int64(s1*50), int64(s2*50)) + + h.compactRangeAt(0, numKey(cs), numKey(cs+9)) + } + + v := h.db.s.version() + if v.tLen(0) != 0 { + t.Errorf("level-0 tables was not zero, got %d", v.tLen(0)) + } + if v.tLen(1) == 0 { + t.Error("level-1 tables was zero") + } + v.release() + } +} + +func TestDB_SizeOf_MixOfSmallAndLarge(t *testing.T) { + h := newDbHarnessWopt(t, &opt.Options{ + DisableLargeBatchTransaction: true, + Compression: opt.NoCompression, + }) + defer h.close() + + sizes := []int64{ + 10000, + 10000, + 100000, + 10000, + 100000, + 10000, + 300000, + 10000, + } + + for i, n := range sizes { + h.put(numKey(i), strings.Repeat(fmt.Sprintf("v%09d", i), int(n)/10)) + } + + for r := 0; r < 3; r++ { + h.reopenDB() + + var x int64 + for i, n := range sizes { + y := x + if i > 0 { + y += 1000 + } + h.sizeAssert("", numKey(i), x, y) + x += n + } + + h.sizeAssert(numKey(3), numKey(5), 110000, 111000) + + h.compactRangeAt(0, "", "") + } +} + +func TestDB_Snapshot(t *testing.T) { + trun(t, func(h *dbHarness) { + h.put("foo", "v1") + s1 := h.getSnapshot() + h.put("foo", "v2") + s2 := h.getSnapshot() + h.put("foo", "v3") + s3 := h.getSnapshot() + h.put("foo", "v4") + + h.getValr(s1, "foo", "v1") + h.getValr(s2, "foo", "v2") + h.getValr(s3, "foo", "v3") + h.getVal("foo", "v4") + + s3.Release() + h.getValr(s1, "foo", "v1") + h.getValr(s2, "foo", "v2") + h.getVal("foo", "v4") + + s1.Release() + h.getValr(s2, "foo", "v2") + h.getVal("foo", "v4") + + s2.Release() + h.getVal("foo", "v4") + }) +} + +func TestDB_SnapshotList(t *testing.T) { + db := &DB{snapsList: list.New()} + e0a := db.acquireSnapshot() + e0b := db.acquireSnapshot() + db.seq = 1 + e1 := db.acquireSnapshot() + db.seq = 2 + e2 := db.acquireSnapshot() + + if db.minSeq() != 0 { + t.Fatalf("invalid sequence number, got=%d", db.minSeq()) + } + db.releaseSnapshot(e0a) + if db.minSeq() != 0 { + t.Fatalf("invalid sequence number, got=%d", db.minSeq()) + } + db.releaseSnapshot(e2) + if db.minSeq() != 0 { + t.Fatalf("invalid sequence number, got=%d", db.minSeq()) + } + db.releaseSnapshot(e0b) + if db.minSeq() != 1 { + t.Fatalf("invalid sequence number, got=%d", db.minSeq()) + } + e2 = db.acquireSnapshot() + if db.minSeq() != 1 { + t.Fatalf("invalid sequence number, got=%d", db.minSeq()) + } + db.releaseSnapshot(e1) + if db.minSeq() != 2 { + t.Fatalf("invalid sequence number, got=%d", db.minSeq()) + } + db.releaseSnapshot(e2) + if db.minSeq() != 2 { + t.Fatalf("invalid sequence number, got=%d", db.minSeq()) + } +} + +func TestDB_HiddenValuesAreRemoved(t *testing.T) { + trun(t, func(h *dbHarness) { + s := h.db.s + + m := 2 + h.db.memdbMaxLevel = m + + h.put("foo", "v1") + h.compactMem() + v := s.version() + num := v.tLen(m) + v.release() + if num != 1 { + t.Errorf("invalid level-%d len, want=1 got=%d", m, num) + } + + // Place a table at level last-1 to prevent merging with preceding mutation + h.put("a", "begin") + h.put("z", "end") + h.compactMem() + v = s.version() + if v.tLen(m) != 1 { + t.Errorf("invalid level-%d len, want=1 got=%d", m, v.tLen(m)) + } + if v.tLen(m-1) != 1 { + t.Errorf("invalid level-%d len, want=1 got=%d", m-1, v.tLen(m-1)) + } + v.release() + + h.delete("foo") + h.put("foo", "v2") + h.allEntriesFor("foo", "[ v2, DEL, v1 ]") + h.compactMem() + h.allEntriesFor("foo", "[ v2, DEL, v1 ]") + h.compactRangeAt(m-2, "", "z") + // DEL eliminated, but v1 remains because we aren't compacting that level + // (DEL can be eliminated because v2 hides v1). + h.allEntriesFor("foo", "[ v2, v1 ]") + h.compactRangeAt(m-1, "", "") + // Merging last-1 w/ last, so we are the base level for "foo", so + // DEL is removed. (as is v1). + h.allEntriesFor("foo", "[ v2 ]") + }) +} + +func TestDB_DeletionMarkers2(t *testing.T) { + h := newDbHarness(t) + defer h.close() + s := h.db.s + + m := 2 + h.db.memdbMaxLevel = m + + h.put("foo", "v1") + h.compactMem() + v := s.version() + num := v.tLen(m) + v.release() + if num != 1 { + t.Errorf("invalid level-%d len, want=1 got=%d", m, num) + } + + // Place a table at level last-1 to prevent merging with preceding mutation + h.put("a", "begin") + h.put("z", "end") + h.compactMem() + v = s.version() + if v.tLen(m) != 1 { + t.Errorf("invalid level-%d len, want=1 got=%d", m, v.tLen(m)) + } + if v.tLen(m-1) != 1 { + t.Errorf("invalid level-%d len, want=1 got=%d", m-1, v.tLen(m-1)) + } + v.release() + + h.delete("foo") + h.allEntriesFor("foo", "[ DEL, v1 ]") + h.compactMem() // Moves to level last-2 + h.allEntriesFor("foo", "[ DEL, v1 ]") + h.compactRangeAt(m-2, "", "") + // DEL kept: "last" file overlaps + h.allEntriesFor("foo", "[ DEL, v1 ]") + h.compactRangeAt(m-1, "", "") + // Merging last-1 w/ last, so we are the base level for "foo", so + // DEL is removed. (as is v1). + h.allEntriesFor("foo", "[ ]") +} + +func TestDB_CompactionTableOpenError(t *testing.T) { + h := newDbHarnessWopt(t, &opt.Options{ + DisableLargeBatchTransaction: true, + OpenFilesCacheCapacity: -1, + }) + defer h.close() + + h.db.memdbMaxLevel = 2 + + im := 10 + jm := 10 + for r := 0; r < 2; r++ { + for i := 0; i < im; i++ { + for j := 0; j < jm; j++ { + h.put(fmt.Sprintf("k%d,%d", i, j), fmt.Sprintf("v%d,%d", i, j)) + } + h.compactMem() + } + } + + if n := h.totalTables(); n != im*2 { + t.Errorf("total tables is %d, want %d", n, im*2) + } + + h.stor.EmulateError(testutil.ModeOpen, storage.TypeTable, errors.New("open error during table compaction")) + go h.db.CompactRange(util.Range{}) + if err := h.db.compTriggerWait(h.db.tcompCmdC); err != nil { + t.Log("compaction error: ", err) + } + h.closeDB0() + h.openDB() + h.stor.EmulateError(testutil.ModeOpen, storage.TypeTable, nil) + + for i := 0; i < im; i++ { + for j := 0; j < jm; j++ { + h.getVal(fmt.Sprintf("k%d,%d", i, j), fmt.Sprintf("v%d,%d", i, j)) + } + } +} + +func TestDB_OverlapInLevel0(t *testing.T) { + trun(t, func(h *dbHarness) { + h.db.memdbMaxLevel = 2 + + // Fill levels 1 and 2 to disable the pushing of new memtables to levels > 0. + h.put("100", "v100") + h.put("999", "v999") + h.compactMem() + h.delete("100") + h.delete("999") + h.compactMem() + h.tablesPerLevel("0,1,1") + + // Make files spanning the following ranges in level-0: + // files[0] 200 .. 900 + // files[1] 300 .. 500 + // Note that files are sorted by min key. + h.put("300", "v300") + h.put("500", "v500") + h.compactMem() + h.put("200", "v200") + h.put("600", "v600") + h.put("900", "v900") + h.compactMem() + h.tablesPerLevel("2,1,1") + + // Compact away the placeholder files we created initially + h.compactRangeAt(1, "", "") + h.compactRangeAt(2, "", "") + h.tablesPerLevel("2") + + // Do a memtable compaction. Before bug-fix, the compaction would + // not detect the overlap with level-0 files and would incorrectly place + // the deletion in a deeper level. + h.delete("600") + h.compactMem() + h.tablesPerLevel("3") + h.get("600", false) + }) +} + +func TestDB_L0_CompactionBug_Issue44_a(t *testing.T) { + h := newDbHarness(t) + defer h.close() + + h.reopenDB() + h.put("b", "v") + h.reopenDB() + h.delete("b") + h.delete("a") + h.reopenDB() + h.delete("a") + h.reopenDB() + h.put("a", "v") + h.reopenDB() + h.reopenDB() + h.getKeyVal("(a->v)") + h.waitCompaction() + h.getKeyVal("(a->v)") +} + +func TestDB_L0_CompactionBug_Issue44_b(t *testing.T) { + h := newDbHarness(t) + defer h.close() + + h.reopenDB() + h.put("", "") + h.reopenDB() + h.delete("e") + h.put("", "") + h.reopenDB() + h.put("c", "cv") + h.reopenDB() + h.put("", "") + h.reopenDB() + h.put("", "") + h.waitCompaction() + h.reopenDB() + h.put("d", "dv") + h.reopenDB() + h.put("", "") + h.reopenDB() + h.delete("d") + h.delete("b") + h.reopenDB() + h.getKeyVal("(->)(c->cv)") + h.waitCompaction() + h.getKeyVal("(->)(c->cv)") +} + +func TestDB_SingleEntryMemCompaction(t *testing.T) { + trun(t, func(h *dbHarness) { + for i := 0; i < 10; i++ { + h.put("big", strings.Repeat("v", opt.DefaultWriteBuffer)) + h.compactMem() + h.put("key", strings.Repeat("v", opt.DefaultBlockSize)) + h.compactMem() + h.put("k", "v") + h.compactMem() + h.put("", "") + h.compactMem() + h.put("verybig", strings.Repeat("v", opt.DefaultWriteBuffer*2)) + h.compactMem() + } + }) +} + +func TestDB_ManifestWriteError(t *testing.T) { + for i := 0; i < 2; i++ { + func() { + h := newDbHarness(t) + defer h.close() + + h.put("foo", "bar") + h.getVal("foo", "bar") + + // Mem compaction (will succeed) + h.compactMem() + h.getVal("foo", "bar") + v := h.db.s.version() + if n := v.tLen(0); n != 1 { + t.Errorf("invalid total tables, want=1 got=%d", n) + } + v.release() + + if i == 0 { + h.stor.EmulateError(testutil.ModeWrite, storage.TypeManifest, errors.New("manifest write error")) + } else { + h.stor.EmulateError(testutil.ModeSync, storage.TypeManifest, errors.New("manifest sync error")) + } + + // Merging compaction (will fail) + h.compactRangeAtErr(0, "", "", true) + + h.db.Close() + h.stor.EmulateError(testutil.ModeWrite, storage.TypeManifest, nil) + h.stor.EmulateError(testutil.ModeSync, storage.TypeManifest, nil) + + // Should not lose data + h.openDB() + h.getVal("foo", "bar") + }() + } +} + +func assertErr(t *testing.T, err error, wanterr bool) { + if err != nil { + if wanterr { + t.Log("AssertErr: got error (expected): ", err) + } else { + t.Error("AssertErr: got error: ", err) + } + } else if wanterr { + t.Error("AssertErr: expect error") + } +} + +func TestDB_ClosedIsClosed(t *testing.T) { + h := newDbHarness(t) + db := h.db + + var iter, iter2 iterator.Iterator + var snap *Snapshot + func() { + defer h.close() + + h.put("k", "v") + h.getVal("k", "v") + + iter = db.NewIterator(nil, h.ro) + iter.Seek([]byte("k")) + testKeyVal(t, iter, "k->v") + + var err error + snap, err = db.GetSnapshot() + if err != nil { + t.Fatal("GetSnapshot: got error: ", err) + } + + h.getValr(snap, "k", "v") + + iter2 = snap.NewIterator(nil, h.ro) + iter2.Seek([]byte("k")) + testKeyVal(t, iter2, "k->v") + + h.put("foo", "v2") + h.delete("foo") + + // closing DB + iter.Release() + iter2.Release() + }() + + assertErr(t, db.Put([]byte("x"), []byte("y"), h.wo), true) + _, err := db.Get([]byte("k"), h.ro) + assertErr(t, err, true) + + if iter.Valid() { + t.Errorf("iter.Valid should false") + } + assertErr(t, iter.Error(), false) + testKeyVal(t, iter, "->") + if iter.Seek([]byte("k")) { + t.Errorf("iter.Seek should false") + } + assertErr(t, iter.Error(), true) + + assertErr(t, iter2.Error(), false) + + _, err = snap.Get([]byte("k"), h.ro) + assertErr(t, err, true) + + _, err = db.GetSnapshot() + assertErr(t, err, true) + + iter3 := db.NewIterator(nil, h.ro) + assertErr(t, iter3.Error(), true) + + iter3 = snap.NewIterator(nil, h.ro) + assertErr(t, iter3.Error(), true) + + assertErr(t, db.Delete([]byte("k"), h.wo), true) + + _, err = db.GetProperty("leveldb.stats") + assertErr(t, err, true) + + _, err = db.SizeOf([]util.Range{{[]byte("a"), []byte("z")}}) + assertErr(t, err, true) + + assertErr(t, db.CompactRange(util.Range{}), true) + + assertErr(t, db.Close(), true) +} + +type numberComparer struct{} + +func (numberComparer) num(x []byte) (n int) { + fmt.Sscan(string(x[1:len(x)-1]), &n) + return +} + +func (numberComparer) Name() string { + return "test.NumberComparer" +} + +func (p numberComparer) Compare(a, b []byte) int { + return p.num(a) - p.num(b) +} + +func (numberComparer) Separator(dst, a, b []byte) []byte { return nil } +func (numberComparer) Successor(dst, b []byte) []byte { return nil } + +func TestDB_CustomComparer(t *testing.T) { + h := newDbHarnessWopt(t, &opt.Options{ + DisableLargeBatchTransaction: true, + Comparer: numberComparer{}, + WriteBuffer: 1000, + }) + defer h.close() + + h.put("[10]", "ten") + h.put("[0x14]", "twenty") + for i := 0; i < 2; i++ { + h.getVal("[10]", "ten") + h.getVal("[0xa]", "ten") + h.getVal("[20]", "twenty") + h.getVal("[0x14]", "twenty") + h.get("[15]", false) + h.get("[0xf]", false) + h.compactMem() + h.compactRange("[0]", "[9999]") + } + + for n := 0; n < 2; n++ { + for i := 0; i < 100; i++ { + v := fmt.Sprintf("[%d]", i*10) + h.put(v, v) + } + h.compactMem() + h.compactRange("[0]", "[1000000]") + } +} + +func TestDB_ManualCompaction(t *testing.T) { + h := newDbHarness(t) + defer h.close() + + h.db.memdbMaxLevel = 2 + + h.putMulti(3, "p", "q") + h.tablesPerLevel("1,1,1") + + // Compaction range falls before files + h.compactRange("", "c") + h.tablesPerLevel("1,1,1") + + // Compaction range falls after files + h.compactRange("r", "z") + h.tablesPerLevel("1,1,1") + + // Compaction range overlaps files + h.compactRange("p1", "p9") + h.tablesPerLevel("0,0,1") + + // Populate a different range + h.putMulti(3, "c", "e") + h.tablesPerLevel("1,1,2") + + // Compact just the new range + h.compactRange("b", "f") + h.tablesPerLevel("0,0,2") + + // Compact all + h.putMulti(1, "a", "z") + h.tablesPerLevel("0,1,2") + h.compactRange("", "") + h.tablesPerLevel("0,0,1") +} + +func TestDB_BloomFilter(t *testing.T) { + h := newDbHarnessWopt(t, &opt.Options{ + DisableLargeBatchTransaction: true, + DisableBlockCache: true, + Filter: filter.NewBloomFilter(10), + }) + defer h.close() + + key := func(i int) string { + return fmt.Sprintf("key%06d", i) + } + + const n = 10000 + + // Populate multiple layers + for i := 0; i < n; i++ { + h.put(key(i), key(i)) + } + h.compactMem() + h.compactRange("a", "z") + for i := 0; i < n; i += 100 { + h.put(key(i), key(i)) + } + h.compactMem() + + // Prevent auto compactions triggered by seeks + h.stor.Stall(testutil.ModeSync, storage.TypeTable) + + // Lookup present keys. Should rarely read from small sstable. + h.stor.ResetCounter(testutil.ModeRead, storage.TypeTable) + for i := 0; i < n; i++ { + h.getVal(key(i), key(i)) + } + cnt, _ := h.stor.Counter(testutil.ModeRead, storage.TypeTable) + t.Logf("lookup of %d present keys yield %d sstable I/O reads", n, cnt) + if min, max := n, n+2*n/100; cnt < min || cnt > max { + t.Errorf("num of sstable I/O reads of present keys not in range of %d - %d, got %d", min, max, cnt) + } + + // Lookup missing keys. Should rarely read from either sstable. + h.stor.ResetCounter(testutil.ModeRead, storage.TypeTable) + for i := 0; i < n; i++ { + h.get(key(i)+".missing", false) + } + cnt, _ = h.stor.Counter(testutil.ModeRead, storage.TypeTable) + t.Logf("lookup of %d missing keys yield %d sstable I/O reads", n, cnt) + if max := 3 * n / 100; cnt > max { + t.Errorf("num of sstable I/O reads of missing keys was more than %d, got %d", max, cnt) + } + + h.stor.Release(testutil.ModeSync, storage.TypeTable) +} + +func TestDB_Concurrent(t *testing.T) { + const n, secs, maxkey = 4, 6, 1000 + h := newDbHarness(t) + defer h.close() + + runtime.GOMAXPROCS(runtime.NumCPU()) + + var ( + closeWg sync.WaitGroup + stop uint32 + cnt [n]uint32 + ) + + for i := 0; i < n; i++ { + closeWg.Add(1) + go func(i int) { + var put, get, found uint + defer func() { + t.Logf("goroutine %d stopped after %d ops, put=%d get=%d found=%d missing=%d", + i, cnt[i], put, get, found, get-found) + closeWg.Done() + }() + + rnd := rand.New(rand.NewSource(int64(1000 + i))) + for atomic.LoadUint32(&stop) == 0 { + x := cnt[i] + + k := rnd.Intn(maxkey) + kstr := fmt.Sprintf("%016d", k) + + if (rnd.Int() % 2) > 0 { + put++ + h.put(kstr, fmt.Sprintf("%d.%d.%-1000d", k, i, x)) + } else { + get++ + v, err := h.db.Get([]byte(kstr), h.ro) + if err == nil { + found++ + rk, ri, rx := 0, -1, uint32(0) + fmt.Sscanf(string(v), "%d.%d.%d", &rk, &ri, &rx) + if rk != k { + t.Errorf("invalid key want=%d got=%d", k, rk) + } + if ri < 0 || ri >= n { + t.Error("invalid goroutine number: ", ri) + } else { + tx := atomic.LoadUint32(&(cnt[ri])) + if rx > tx { + t.Errorf("invalid seq number, %d > %d ", rx, tx) + } + } + } else if err != ErrNotFound { + t.Error("Get: got error: ", err) + return + } + } + atomic.AddUint32(&cnt[i], 1) + } + }(i) + } + + time.Sleep(secs * time.Second) + atomic.StoreUint32(&stop, 1) + closeWg.Wait() +} + +func TestDB_ConcurrentIterator(t *testing.T) { + const n, n2 = 4, 1000 + h := newDbHarnessWopt(t, &opt.Options{DisableLargeBatchTransaction: true, WriteBuffer: 30}) + defer h.close() + + runtime.GOMAXPROCS(runtime.NumCPU()) + + var ( + closeWg sync.WaitGroup + stop uint32 + ) + + for i := 0; i < n; i++ { + closeWg.Add(1) + go func(i int) { + for k := 0; atomic.LoadUint32(&stop) == 0; k++ { + h.put(fmt.Sprintf("k%d", k), fmt.Sprintf("%d.%d.", k, i)+strings.Repeat("x", 10)) + } + closeWg.Done() + }(i) + } + + for i := 0; i < n; i++ { + closeWg.Add(1) + go func(i int) { + for k := 1000000; k < 0 || atomic.LoadUint32(&stop) == 0; k-- { + h.put(fmt.Sprintf("k%d", k), fmt.Sprintf("%d.%d.", k, i)+strings.Repeat("x", 10)) + } + closeWg.Done() + }(i) + } + + cmp := comparer.DefaultComparer + for i := 0; i < n2; i++ { + closeWg.Add(1) + go func(i int) { + it := h.db.NewIterator(nil, nil) + var pk []byte + for it.Next() { + kk := it.Key() + if cmp.Compare(kk, pk) <= 0 { + t.Errorf("iter %d: %q is successor of %q", i, pk, kk) + } + pk = append(pk[:0], kk...) + var k, vk, vi int + if n, err := fmt.Sscanf(string(it.Key()), "k%d", &k); err != nil { + t.Errorf("iter %d: Scanf error on key %q: %v", i, it.Key(), err) + } else if n < 1 { + t.Errorf("iter %d: Cannot parse key %q", i, it.Key()) + } + if n, err := fmt.Sscanf(string(it.Value()), "%d.%d", &vk, &vi); err != nil { + t.Errorf("iter %d: Scanf error on value %q: %v", i, it.Value(), err) + } else if n < 2 { + t.Errorf("iter %d: Cannot parse value %q", i, it.Value()) + } + + if vk != k { + t.Errorf("iter %d: invalid value i=%d, want=%d got=%d", i, vi, k, vk) + } + } + if err := it.Error(); err != nil { + t.Errorf("iter %d: Got error: %v", i, err) + } + it.Release() + closeWg.Done() + }(i) + } + + atomic.StoreUint32(&stop, 1) + closeWg.Wait() +} + +func TestDB_ConcurrentWrite(t *testing.T) { + const n, niter = 10, 10000 + h := newDbHarness(t) + defer h.close() + + runtime.GOMAXPROCS(runtime.NumCPU()) + + var wg sync.WaitGroup + for i := 0; i < n; i++ { + wg.Add(1) + go func(i int) { + defer wg.Done() + for k := 0; k < niter; k++ { + kstr := fmt.Sprintf("%d.%d", i, k) + vstr := fmt.Sprintf("v%d", k) + h.put(kstr, vstr) + // Key should immediately available after put returns. + h.getVal(kstr, vstr) + } + }(i) + } + wg.Wait() +} + +func TestDB_CreateReopenDbOnFile(t *testing.T) { + dbpath := filepath.Join(os.TempDir(), fmt.Sprintf("goleveldbtestCreateReopenDbOnFile-%d", os.Getuid())) + if err := os.RemoveAll(dbpath); err != nil { + t.Fatal("cannot remove old db: ", err) + } + defer os.RemoveAll(dbpath) + + for i := 0; i < 3; i++ { + stor, err := storage.OpenFile(dbpath, false) + if err != nil { + t.Fatalf("(%d) cannot open storage: %s", i, err) + } + db, err := Open(stor, nil) + if err != nil { + t.Fatalf("(%d) cannot open db: %s", i, err) + } + if err := db.Put([]byte("foo"), []byte("bar"), nil); err != nil { + t.Fatalf("(%d) cannot write to db: %s", i, err) + } + if err := db.Close(); err != nil { + t.Fatalf("(%d) cannot close db: %s", i, err) + } + if err := stor.Close(); err != nil { + t.Fatalf("(%d) cannot close storage: %s", i, err) + } + } +} + +func TestDB_CreateReopenDbOnFile2(t *testing.T) { + dbpath := filepath.Join(os.TempDir(), fmt.Sprintf("goleveldbtestCreateReopenDbOnFile2-%d", os.Getuid())) + if err := os.RemoveAll(dbpath); err != nil { + t.Fatal("cannot remove old db: ", err) + } + defer os.RemoveAll(dbpath) + + for i := 0; i < 3; i++ { + db, err := OpenFile(dbpath, nil) + if err != nil { + t.Fatalf("(%d) cannot open db: %s", i, err) + } + if err := db.Put([]byte("foo"), []byte("bar"), nil); err != nil { + t.Fatalf("(%d) cannot write to db: %s", i, err) + } + if err := db.Close(); err != nil { + t.Fatalf("(%d) cannot close db: %s", i, err) + } + } +} + +func TestDB_DeletionMarkersOnMemdb(t *testing.T) { + h := newDbHarness(t) + defer h.close() + + h.put("foo", "v1") + h.compactMem() + h.delete("foo") + h.get("foo", false) + h.getKeyVal("") +} + +func TestDB_LeveldbIssue178(t *testing.T) { + nKeys := (opt.DefaultCompactionTableSize / 30) * 5 + key1 := func(i int) string { + return fmt.Sprintf("my_key_%d", i) + } + key2 := func(i int) string { + return fmt.Sprintf("my_key_%d_xxx", i) + } + + // Disable compression since it affects the creation of layers and the + // code below is trying to test against a very specific scenario. + h := newDbHarnessWopt(t, &opt.Options{ + DisableLargeBatchTransaction: true, + Compression: opt.NoCompression, + }) + defer h.close() + + // Create first key range. + batch := new(Batch) + for i := 0; i < nKeys; i++ { + batch.Put([]byte(key1(i)), []byte("value for range 1 key")) + } + h.write(batch) + + // Create second key range. + batch.Reset() + for i := 0; i < nKeys; i++ { + batch.Put([]byte(key2(i)), []byte("value for range 2 key")) + } + h.write(batch) + + // Delete second key range. + batch.Reset() + for i := 0; i < nKeys; i++ { + batch.Delete([]byte(key2(i))) + } + h.write(batch) + h.waitMemCompaction() + + // Run manual compaction. + h.compactRange(key1(0), key1(nKeys-1)) + + // Checking the keys. + h.assertNumKeys(nKeys) +} + +func TestDB_LeveldbIssue200(t *testing.T) { + h := newDbHarness(t) + defer h.close() + + h.put("1", "b") + h.put("2", "c") + h.put("3", "d") + h.put("4", "e") + h.put("5", "f") + + iter := h.db.NewIterator(nil, h.ro) + + // Add an element that should not be reflected in the iterator. + h.put("25", "cd") + + iter.Seek([]byte("5")) + assertBytes(t, []byte("5"), iter.Key()) + iter.Prev() + assertBytes(t, []byte("4"), iter.Key()) + iter.Prev() + assertBytes(t, []byte("3"), iter.Key()) + iter.Next() + assertBytes(t, []byte("4"), iter.Key()) + iter.Next() + assertBytes(t, []byte("5"), iter.Key()) +} + +func TestDB_GoleveldbIssue74(t *testing.T) { + h := newDbHarnessWopt(t, &opt.Options{ + DisableLargeBatchTransaction: true, + WriteBuffer: 1 * opt.MiB, + }) + defer h.close() + + const n, dur = 10000, 5 * time.Second + + runtime.GOMAXPROCS(runtime.NumCPU()) + + until := time.Now().Add(dur) + wg := new(sync.WaitGroup) + wg.Add(2) + var done uint32 + go func() { + var i int + defer func() { + t.Logf("WRITER DONE #%d", i) + atomic.StoreUint32(&done, 1) + wg.Done() + }() + + b := new(Batch) + for ; time.Now().Before(until) && atomic.LoadUint32(&done) == 0; i++ { + iv := fmt.Sprintf("VAL%010d", i) + for k := 0; k < n; k++ { + key := fmt.Sprintf("KEY%06d", k) + b.Put([]byte(key), []byte(key+iv)) + b.Put([]byte(fmt.Sprintf("PTR%06d", k)), []byte(key)) + } + h.write(b) + + b.Reset() + snap := h.getSnapshot() + iter := snap.NewIterator(util.BytesPrefix([]byte("PTR")), nil) + var k int + for ; iter.Next(); k++ { + ptrKey := iter.Key() + key := iter.Value() + + if _, err := snap.Get(ptrKey, nil); err != nil { + t.Fatalf("WRITER #%d snapshot.Get %q: %v", i, ptrKey, err) + } + if value, err := snap.Get(key, nil); err != nil { + t.Fatalf("WRITER #%d snapshot.Get %q: %v", i, key, err) + } else if string(value) != string(key)+iv { + t.Fatalf("WRITER #%d snapshot.Get %q got invalid value, want %q got %q", i, key, string(key)+iv, value) + } + + b.Delete(key) + b.Delete(ptrKey) + } + h.write(b) + iter.Release() + snap.Release() + if k != n { + t.Fatalf("#%d %d != %d", i, k, n) + } + } + }() + go func() { + var i int + defer func() { + t.Logf("READER DONE #%d", i) + atomic.StoreUint32(&done, 1) + wg.Done() + }() + for ; time.Now().Before(until) && atomic.LoadUint32(&done) == 0; i++ { + snap := h.getSnapshot() + iter := snap.NewIterator(util.BytesPrefix([]byte("PTR")), nil) + var prevValue string + var k int + for ; iter.Next(); k++ { + ptrKey := iter.Key() + key := iter.Value() + + if _, err := snap.Get(ptrKey, nil); err != nil { + t.Fatalf("READER #%d snapshot.Get %q: %v", i, ptrKey, err) + } + + if value, err := snap.Get(key, nil); err != nil { + t.Fatalf("READER #%d snapshot.Get %q: %v", i, key, err) + } else if prevValue != "" && string(value) != string(key)+prevValue { + t.Fatalf("READER #%d snapshot.Get %q got invalid value, want %q got %q", i, key, string(key)+prevValue, value) + } else { + prevValue = string(value[len(key):]) + } + } + iter.Release() + snap.Release() + if k > 0 && k != n { + t.Fatalf("#%d %d != %d", i, k, n) + } + } + }() + wg.Wait() +} + +func TestDB_GetProperties(t *testing.T) { + h := newDbHarness(t) + defer h.close() + + _, err := h.db.GetProperty("leveldb.num-files-at-level") + if err == nil { + t.Error("GetProperty() failed to detect missing level") + } + + _, err = h.db.GetProperty("leveldb.num-files-at-level0") + if err != nil { + t.Error("got unexpected error", err) + } + + _, err = h.db.GetProperty("leveldb.num-files-at-level0x") + if err == nil { + t.Error("GetProperty() failed to detect invalid level") + } +} + +func TestDB_GoleveldbIssue72and83(t *testing.T) { + h := newDbHarnessWopt(t, &opt.Options{ + DisableLargeBatchTransaction: true, + WriteBuffer: 1 * opt.MiB, + OpenFilesCacheCapacity: 3, + }) + defer h.close() + + const n, wn, dur = 10000, 100, 30 * time.Second + + runtime.GOMAXPROCS(runtime.NumCPU()) + + randomData := func(prefix byte, i int) []byte { + data := make([]byte, 1+4+32+64+32) + _, err := crand.Reader.Read(data[1 : len(data)-8]) + if err != nil { + panic(err) + } + data[0] = prefix + binary.LittleEndian.PutUint32(data[len(data)-8:], uint32(i)) + binary.LittleEndian.PutUint32(data[len(data)-4:], util.NewCRC(data[:len(data)-4]).Value()) + return data + } + + keys := make([][]byte, n) + for i := range keys { + keys[i] = randomData(1, 0) + } + + until := time.Now().Add(dur) + wg := new(sync.WaitGroup) + wg.Add(3) + var done uint32 + go func() { + i := 0 + defer func() { + t.Logf("WRITER DONE #%d", i) + wg.Done() + }() + + b := new(Batch) + for ; i < wn && atomic.LoadUint32(&done) == 0; i++ { + b.Reset() + for _, k1 := range keys { + k2 := randomData(2, i) + b.Put(k2, randomData(42, i)) + b.Put(k1, k2) + } + if err := h.db.Write(b, h.wo); err != nil { + atomic.StoreUint32(&done, 1) + t.Fatalf("WRITER #%d db.Write: %v", i, err) + } + } + }() + go func() { + var i int + defer func() { + t.Logf("READER0 DONE #%d", i) + atomic.StoreUint32(&done, 1) + wg.Done() + }() + for ; time.Now().Before(until) && atomic.LoadUint32(&done) == 0; i++ { + snap := h.getSnapshot() + seq := snap.elem.seq + if seq == 0 { + snap.Release() + continue + } + iter := snap.NewIterator(util.BytesPrefix([]byte{1}), nil) + writei := int(seq/(n*2) - 1) + var k int + for ; iter.Next(); k++ { + k1 := iter.Key() + k2 := iter.Value() + k1checksum0 := binary.LittleEndian.Uint32(k1[len(k1)-4:]) + k1checksum1 := util.NewCRC(k1[:len(k1)-4]).Value() + if k1checksum0 != k1checksum1 { + t.Fatalf("READER0 #%d.%d W#%d invalid K1 checksum: %#x != %#x", i, k, k1checksum0, k1checksum0) + } + k2checksum0 := binary.LittleEndian.Uint32(k2[len(k2)-4:]) + k2checksum1 := util.NewCRC(k2[:len(k2)-4]).Value() + if k2checksum0 != k2checksum1 { + t.Fatalf("READER0 #%d.%d W#%d invalid K2 checksum: %#x != %#x", i, k, k2checksum0, k2checksum1) + } + kwritei := int(binary.LittleEndian.Uint32(k2[len(k2)-8:])) + if writei != kwritei { + t.Fatalf("READER0 #%d.%d W#%d invalid write iteration num: %d", i, k, writei, kwritei) + } + if _, err := snap.Get(k2, nil); err != nil { + t.Fatalf("READER0 #%d.%d W#%d snap.Get: %v\nk1: %x\n -> k2: %x", i, k, writei, err, k1, k2) + } + } + if err := iter.Error(); err != nil { + t.Fatalf("READER0 #%d.%d W#%d snap.Iterator: %v", i, k, writei, err) + } + iter.Release() + snap.Release() + if k > 0 && k != n { + t.Fatalf("READER0 #%d W#%d short read, got=%d want=%d", i, writei, k, n) + } + } + }() + go func() { + var i int + defer func() { + t.Logf("READER1 DONE #%d", i) + atomic.StoreUint32(&done, 1) + wg.Done() + }() + for ; time.Now().Before(until) && atomic.LoadUint32(&done) == 0; i++ { + iter := h.db.NewIterator(nil, nil) + seq := iter.(*dbIter).seq + if seq == 0 { + iter.Release() + continue + } + writei := int(seq/(n*2) - 1) + var k int + for ok := iter.Last(); ok; ok = iter.Prev() { + k++ + } + if err := iter.Error(); err != nil { + t.Fatalf("READER1 #%d.%d W#%d db.Iterator: %v", i, k, writei, err) + } + iter.Release() + if m := (writei+1)*n + n; k != m { + t.Fatalf("READER1 #%d W#%d short read, got=%d want=%d", i, writei, k, m) + } + } + }() + + wg.Wait() +} + +func TestDB_TransientError(t *testing.T) { + h := newDbHarnessWopt(t, &opt.Options{ + DisableLargeBatchTransaction: true, + WriteBuffer: 128 * opt.KiB, + OpenFilesCacheCapacity: 3, + DisableCompactionBackoff: true, + }) + defer h.close() + + const ( + nSnap = 20 + nKey = 10000 + ) + + var ( + snaps [nSnap]*Snapshot + b = &Batch{} + ) + for i := range snaps { + vtail := fmt.Sprintf("VAL%030d", i) + b.Reset() + for k := 0; k < nKey; k++ { + key := fmt.Sprintf("KEY%8d", k) + b.Put([]byte(key), []byte(key+vtail)) + } + h.stor.EmulateError(testutil.ModeOpen|testutil.ModeRead, storage.TypeTable, errors.New("table transient read error")) + if err := h.db.Write(b, nil); err != nil { + t.Logf("WRITE #%d error: %v", i, err) + h.stor.EmulateError(testutil.ModeOpen|testutil.ModeRead, storage.TypeTable, nil) + for { + if err := h.db.Write(b, nil); err == nil { + break + } else if errors.IsCorrupted(err) { + t.Fatalf("WRITE #%d corrupted: %v", i, err) + } + } + } + + snaps[i] = h.db.newSnapshot() + b.Reset() + for k := 0; k < nKey; k++ { + key := fmt.Sprintf("KEY%8d", k) + b.Delete([]byte(key)) + } + h.stor.EmulateError(testutil.ModeOpen|testutil.ModeRead, storage.TypeTable, errors.New("table transient read error")) + if err := h.db.Write(b, nil); err != nil { + t.Logf("WRITE #%d error: %v", i, err) + h.stor.EmulateError(testutil.ModeOpen|testutil.ModeRead, storage.TypeTable, nil) + for { + if err := h.db.Write(b, nil); err == nil { + break + } else if errors.IsCorrupted(err) { + t.Fatalf("WRITE #%d corrupted: %v", i, err) + } + } + } + } + h.stor.EmulateError(testutil.ModeOpen|testutil.ModeRead, storage.TypeTable, nil) + + runtime.GOMAXPROCS(runtime.NumCPU()) + + rnd := rand.New(rand.NewSource(0xecafdaed)) + wg := &sync.WaitGroup{} + for i, snap := range snaps { + wg.Add(2) + + go func(i int, snap *Snapshot, sk []int) { + defer wg.Done() + + vtail := fmt.Sprintf("VAL%030d", i) + for _, k := range sk { + key := fmt.Sprintf("KEY%8d", k) + xvalue, err := snap.Get([]byte(key), nil) + if err != nil { + t.Fatalf("READER_GET #%d SEQ=%d K%d error: %v", i, snap.elem.seq, k, err) + } + value := key + vtail + if !bytes.Equal([]byte(value), xvalue) { + t.Fatalf("READER_GET #%d SEQ=%d K%d invalid value: want %q, got %q", i, snap.elem.seq, k, value, xvalue) + } + } + }(i, snap, rnd.Perm(nKey)) + + go func(i int, snap *Snapshot) { + defer wg.Done() + + vtail := fmt.Sprintf("VAL%030d", i) + iter := snap.NewIterator(nil, nil) + defer iter.Release() + for k := 0; k < nKey; k++ { + if !iter.Next() { + if err := iter.Error(); err != nil { + t.Fatalf("READER_ITER #%d K%d error: %v", i, k, err) + } else { + t.Fatalf("READER_ITER #%d K%d eoi", i, k) + } + } + key := fmt.Sprintf("KEY%8d", k) + xkey := iter.Key() + if !bytes.Equal([]byte(key), xkey) { + t.Fatalf("READER_ITER #%d K%d invalid key: want %q, got %q", i, k, key, xkey) + } + value := key + vtail + xvalue := iter.Value() + if !bytes.Equal([]byte(value), xvalue) { + t.Fatalf("READER_ITER #%d K%d invalid value: want %q, got %q", i, k, value, xvalue) + } + } + }(i, snap) + } + + wg.Wait() +} + +func TestDB_UkeyShouldntHopAcrossTable(t *testing.T) { + h := newDbHarnessWopt(t, &opt.Options{ + DisableLargeBatchTransaction: true, + WriteBuffer: 112 * opt.KiB, + CompactionTableSize: 90 * opt.KiB, + CompactionExpandLimitFactor: 1, + }) + defer h.close() + + const ( + nSnap = 190 + nKey = 140 + ) + + var ( + snaps [nSnap]*Snapshot + b = &Batch{} + ) + for i := range snaps { + vtail := fmt.Sprintf("VAL%030d", i) + b.Reset() + for k := 0; k < nKey; k++ { + key := fmt.Sprintf("KEY%08d", k) + b.Put([]byte(key), []byte(key+vtail)) + } + if err := h.db.Write(b, nil); err != nil { + t.Fatalf("WRITE #%d error: %v", i, err) + } + + snaps[i] = h.db.newSnapshot() + b.Reset() + for k := 0; k < nKey; k++ { + key := fmt.Sprintf("KEY%08d", k) + b.Delete([]byte(key)) + } + if err := h.db.Write(b, nil); err != nil { + t.Fatalf("WRITE #%d error: %v", i, err) + } + } + + h.compactMem() + + h.waitCompaction() + for level, tables := range h.db.s.stVersion.levels { + for _, table := range tables { + t.Logf("L%d@%d %q:%q", level, table.fd.Num, table.imin, table.imax) + } + } + + h.compactRangeAt(0, "", "") + h.waitCompaction() + for level, tables := range h.db.s.stVersion.levels { + for _, table := range tables { + t.Logf("L%d@%d %q:%q", level, table.fd.Num, table.imin, table.imax) + } + } + h.compactRangeAt(1, "", "") + h.waitCompaction() + for level, tables := range h.db.s.stVersion.levels { + for _, table := range tables { + t.Logf("L%d@%d %q:%q", level, table.fd.Num, table.imin, table.imax) + } + } + runtime.GOMAXPROCS(runtime.NumCPU()) + + wg := &sync.WaitGroup{} + for i, snap := range snaps { + wg.Add(1) + + go func(i int, snap *Snapshot) { + defer wg.Done() + + vtail := fmt.Sprintf("VAL%030d", i) + for k := 0; k < nKey; k++ { + key := fmt.Sprintf("KEY%08d", k) + xvalue, err := snap.Get([]byte(key), nil) + if err != nil { + t.Fatalf("READER_GET #%d SEQ=%d K%d error: %v", i, snap.elem.seq, k, err) + } + value := key + vtail + if !bytes.Equal([]byte(value), xvalue) { + t.Fatalf("READER_GET #%d SEQ=%d K%d invalid value: want %q, got %q", i, snap.elem.seq, k, value, xvalue) + } + } + }(i, snap) + } + + wg.Wait() +} + +func TestDB_TableCompactionBuilder(t *testing.T) { + gomega.RegisterTestingT(t) + stor := testutil.NewStorage() + stor.OnLog(testingLogger(t)) + stor.OnClose(testingPreserveOnFailed(t)) + defer stor.Close() + + const nSeq = 99 + + o := &opt.Options{ + DisableLargeBatchTransaction: true, + WriteBuffer: 112 * opt.KiB, + CompactionTableSize: 43 * opt.KiB, + CompactionExpandLimitFactor: 1, + CompactionGPOverlapsFactor: 1, + DisableBlockCache: true, + } + s, err := newSession(stor, o) + if err != nil { + t.Fatal(err) + } + if err := s.create(); err != nil { + t.Fatal(err) + } + defer s.close() + var ( + seq uint64 + targetSize = 5 * o.CompactionTableSize + value = bytes.Repeat([]byte{'0'}, 100) + ) + for i := 0; i < 2; i++ { + tw, err := s.tops.create() + if err != nil { + t.Fatal(err) + } + for k := 0; tw.tw.BytesLen() < targetSize; k++ { + key := []byte(fmt.Sprintf("%09d", k)) + seq += nSeq - 1 + for x := uint64(0); x < nSeq; x++ { + if err := tw.append(makeInternalKey(nil, key, seq-x, keyTypeVal), value); err != nil { + t.Fatal(err) + } + } + } + tf, err := tw.finish() + if err != nil { + t.Fatal(err) + } + rec := &sessionRecord{} + rec.addTableFile(i, tf) + if err := s.commit(rec); err != nil { + t.Fatal(err) + } + } + + // Build grandparent. + v := s.version() + c := newCompaction(s, v, 1, append(tFiles{}, v.levels[1]...)) + rec := &sessionRecord{} + b := &tableCompactionBuilder{ + s: s, + c: c, + rec: rec, + stat1: new(cStatStaging), + minSeq: 0, + strict: true, + tableSize: o.CompactionTableSize/3 + 961, + } + if err := b.run(new(compactionTransactCounter)); err != nil { + t.Fatal(err) + } + for _, t := range c.levels[0] { + rec.delTable(c.sourceLevel, t.fd.Num) + } + if err := s.commit(rec); err != nil { + t.Fatal(err) + } + c.release() + + // Build level-1. + v = s.version() + c = newCompaction(s, v, 0, append(tFiles{}, v.levels[0]...)) + rec = &sessionRecord{} + b = &tableCompactionBuilder{ + s: s, + c: c, + rec: rec, + stat1: new(cStatStaging), + minSeq: 0, + strict: true, + tableSize: o.CompactionTableSize, + } + if err := b.run(new(compactionTransactCounter)); err != nil { + t.Fatal(err) + } + for _, t := range c.levels[0] { + rec.delTable(c.sourceLevel, t.fd.Num) + } + // Move grandparent to level-3 + for _, t := range v.levels[2] { + rec.delTable(2, t.fd.Num) + rec.addTableFile(3, t) + } + if err := s.commit(rec); err != nil { + t.Fatal(err) + } + c.release() + + v = s.version() + for level, want := range []bool{false, true, false, true} { + got := len(v.levels[level]) > 0 + if want != got { + t.Fatalf("invalid level-%d tables len: want %v, got %v", level, want, got) + } + } + for i, f := range v.levels[1][:len(v.levels[1])-1] { + nf := v.levels[1][i+1] + if bytes.Equal(f.imax.ukey(), nf.imin.ukey()) { + t.Fatalf("KEY %q hop across table %d .. %d", f.imax.ukey(), f.fd.Num, nf.fd.Num) + } + } + v.release() + + // Compaction with transient error. + v = s.version() + c = newCompaction(s, v, 1, append(tFiles{}, v.levels[1]...)) + rec = &sessionRecord{} + b = &tableCompactionBuilder{ + s: s, + c: c, + rec: rec, + stat1: new(cStatStaging), + minSeq: 0, + strict: true, + tableSize: o.CompactionTableSize, + } + stor.EmulateErrorOnce(testutil.ModeSync, storage.TypeTable, errors.New("table sync error (once)")) + stor.EmulateRandomError(testutil.ModeRead|testutil.ModeWrite, storage.TypeTable, 0.01, errors.New("table random IO error")) + for { + if err := b.run(new(compactionTransactCounter)); err != nil { + t.Logf("(expected) b.run: %v", err) + } else { + break + } + } + if err := s.commit(rec); err != nil { + t.Fatal(err) + } + c.release() + + stor.EmulateErrorOnce(testutil.ModeSync, storage.TypeTable, nil) + stor.EmulateRandomError(testutil.ModeRead|testutil.ModeWrite, storage.TypeTable, 0, nil) + + v = s.version() + if len(v.levels[1]) != len(v.levels[2]) { + t.Fatalf("invalid tables length, want %d, got %d", len(v.levels[1]), len(v.levels[2])) + } + for i, f0 := range v.levels[1] { + f1 := v.levels[2][i] + iter0 := s.tops.newIterator(f0, nil, nil) + iter1 := s.tops.newIterator(f1, nil, nil) + for j := 0; true; j++ { + next0 := iter0.Next() + next1 := iter1.Next() + if next0 != next1 { + t.Fatalf("#%d.%d invalid eoi: want %v, got %v", i, j, next0, next1) + } + key0 := iter0.Key() + key1 := iter1.Key() + if !bytes.Equal(key0, key1) { + t.Fatalf("#%d.%d invalid key: want %q, got %q", i, j, key0, key1) + } + if next0 == false { + break + } + } + iter0.Release() + iter1.Release() + } + v.release() +} + +func testDB_IterTriggeredCompaction(t *testing.T, limitDiv int) { + const ( + vSize = 200 * opt.KiB + tSize = 100 * opt.MiB + mIter = 100 + n = tSize / vSize + ) + + h := newDbHarnessWopt(t, &opt.Options{ + DisableLargeBatchTransaction: true, + Compression: opt.NoCompression, + DisableBlockCache: true, + }) + defer h.close() + + h.db.memdbMaxLevel = 2 + + key := func(x int) string { + return fmt.Sprintf("v%06d", x) + } + + // Fill. + value := strings.Repeat("x", vSize) + for i := 0; i < n; i++ { + h.put(key(i), value) + } + h.compactMem() + + // Delete all. + for i := 0; i < n; i++ { + h.delete(key(i)) + } + h.compactMem() + + var ( + limit = n / limitDiv + + startKey = key(0) + limitKey = key(limit) + maxKey = key(n) + slice = &util.Range{Limit: []byte(limitKey)} + + initialSize0 = h.sizeOf(startKey, limitKey) + initialSize1 = h.sizeOf(limitKey, maxKey) + ) + + t.Logf("inital size %s [rest %s]", shortenb(int(initialSize0)), shortenb(int(initialSize1))) + + for r := 0; true; r++ { + if r >= mIter { + t.Fatal("taking too long to compact") + } + + // Iterates. + iter := h.db.NewIterator(slice, h.ro) + for iter.Next() { + } + if err := iter.Error(); err != nil { + t.Fatalf("Iter err: %v", err) + } + iter.Release() + + // Wait compaction. + h.waitCompaction() + + // Check size. + size0 := h.sizeOf(startKey, limitKey) + size1 := h.sizeOf(limitKey, maxKey) + t.Logf("#%03d size %s [rest %s]", r, shortenb(int(size0)), shortenb(int(size1))) + if size0 < initialSize0/10 { + break + } + } + + if initialSize1 > 0 { + h.sizeAssert(limitKey, maxKey, initialSize1/4-opt.MiB, initialSize1+opt.MiB) + } +} + +func TestDB_IterTriggeredCompaction(t *testing.T) { + testDB_IterTriggeredCompaction(t, 1) +} + +func TestDB_IterTriggeredCompactionHalf(t *testing.T) { + testDB_IterTriggeredCompaction(t, 2) +} + +func TestDB_ReadOnly(t *testing.T) { + h := newDbHarness(t) + defer h.close() + + h.put("foo", "v1") + h.put("bar", "v2") + h.compactMem() + + h.put("xfoo", "v1") + h.put("xbar", "v2") + + t.Log("Trigger read-only") + if err := h.db.SetReadOnly(); err != nil { + h.close() + t.Fatalf("SetReadOnly error: %v", err) + } + + mode := testutil.ModeCreate | testutil.ModeRemove | testutil.ModeRename | testutil.ModeWrite | testutil.ModeSync + h.stor.EmulateError(mode, storage.TypeAll, errors.New("read-only DB shouldn't writes")) + + ro := func(key, value, wantValue string) { + if err := h.db.Put([]byte(key), []byte(value), h.wo); err != ErrReadOnly { + t.Fatalf("unexpected error: %v", err) + } + h.getVal(key, wantValue) + } + + ro("foo", "vx", "v1") + + h.o.ReadOnly = true + h.reopenDB() + + ro("foo", "vx", "v1") + ro("bar", "vx", "v2") + h.assertNumKeys(4) +} + +func TestDB_BulkInsertDelete(t *testing.T) { + h := newDbHarnessWopt(t, &opt.Options{ + DisableLargeBatchTransaction: true, + Compression: opt.NoCompression, + CompactionTableSize: 128 * opt.KiB, + CompactionTotalSize: 1 * opt.MiB, + WriteBuffer: 256 * opt.KiB, + }) + defer h.close() + + const R = 100 + const N = 2500 + key := make([]byte, 4) + value := make([]byte, 256) + for i := 0; i < R; i++ { + offset := N * i + for j := 0; j < N; j++ { + binary.BigEndian.PutUint32(key, uint32(offset+j)) + h.db.Put(key, value, nil) + } + for j := 0; j < N; j++ { + binary.BigEndian.PutUint32(key, uint32(offset+j)) + h.db.Delete(key, nil) + } + } + + if tot := h.totalTables(); tot > 10 { + t.Fatalf("too many uncompacted tables: %d (%s)", tot, h.getTablesPerLevel()) + } +} diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/db_transaction.go b/vendor/github.com/syndtr/goleveldb/leveldb/db_transaction.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/db_transaction.go rename to vendor/github.com/syndtr/goleveldb/leveldb/db_transaction.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/db_util.go b/vendor/github.com/syndtr/goleveldb/leveldb/db_util.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/db_util.go rename to vendor/github.com/syndtr/goleveldb/leveldb/db_util.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/db_write.go b/vendor/github.com/syndtr/goleveldb/leveldb/db_write.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/db_write.go rename to vendor/github.com/syndtr/goleveldb/leveldb/db_write.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/doc.go b/vendor/github.com/syndtr/goleveldb/leveldb/doc.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/doc.go rename to vendor/github.com/syndtr/goleveldb/leveldb/doc.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/errors.go b/vendor/github.com/syndtr/goleveldb/leveldb/errors.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/errors.go rename to vendor/github.com/syndtr/goleveldb/leveldb/errors.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/errors/errors.go b/vendor/github.com/syndtr/goleveldb/leveldb/errors/errors.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/errors/errors.go rename to vendor/github.com/syndtr/goleveldb/leveldb/errors/errors.go diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/external_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/external_test.go new file mode 100644 index 0000000..4bc3a91 --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/external_test.go @@ -0,0 +1,117 @@ +// Copyright (c) 2014, Suryandaru Triandana +// All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package leveldb + +import ( + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + + "github.com/syndtr/goleveldb/leveldb/opt" + "github.com/syndtr/goleveldb/leveldb/testutil" +) + +var _ = testutil.Defer(func() { + Describe("Leveldb external", func() { + o := &opt.Options{ + DisableBlockCache: true, + BlockRestartInterval: 5, + BlockSize: 80, + Compression: opt.NoCompression, + OpenFilesCacheCapacity: -1, + Strict: opt.StrictAll, + WriteBuffer: 1000, + CompactionTableSize: 2000, + } + + Describe("write test", func() { + It("should do write correctly", func(done Done) { + db := newTestingDB(o, nil, nil) + t := testutil.DBTesting{ + DB: db, + Deleted: testutil.KeyValue_Generate(nil, 500, 1, 50, 5, 5).Clone(), + } + testutil.DoDBTesting(&t) + db.TestClose() + done <- true + }, 20.0) + }) + + Describe("read test", func() { + testutil.AllKeyValueTesting(nil, nil, func(kv testutil.KeyValue) testutil.DB { + // Building the DB. + db := newTestingDB(o, nil, nil) + kv.IterateShuffled(nil, func(i int, key, value []byte) { + err := db.TestPut(key, value) + Expect(err).NotTo(HaveOccurred()) + }) + + return db + }, func(db testutil.DB) { + db.(*testingDB).TestClose() + }) + }) + + Describe("transaction test", func() { + It("should do transaction correctly", func(done Done) { + db := newTestingDB(o, nil, nil) + + By("creating first transaction") + var err error + tr := &testingTransaction{} + tr.Transaction, err = db.OpenTransaction() + Expect(err).NotTo(HaveOccurred()) + t0 := &testutil.DBTesting{ + DB: tr, + Deleted: testutil.KeyValue_Generate(nil, 200, 1, 50, 5, 5).Clone(), + } + testutil.DoDBTesting(t0) + testutil.TestGet(tr, t0.Present) + testutil.TestHas(tr, t0.Present) + + By("committing first transaction") + err = tr.Commit() + Expect(err).NotTo(HaveOccurred()) + testutil.TestIter(db, nil, t0.Present) + testutil.TestGet(db, t0.Present) + testutil.TestHas(db, t0.Present) + + By("manipulating DB without transaction") + t0.DB = db + testutil.DoDBTesting(t0) + + By("creating second transaction") + tr.Transaction, err = db.OpenTransaction() + Expect(err).NotTo(HaveOccurred()) + t1 := &testutil.DBTesting{ + DB: tr, + Deleted: t0.Deleted.Clone(), + Present: t0.Present.Clone(), + } + testutil.DoDBTesting(t1) + testutil.TestIter(db, nil, t0.Present) + + By("discarding second transaction") + tr.Discard() + testutil.TestIter(db, nil, t0.Present) + + By("creating third transaction") + tr.Transaction, err = db.OpenTransaction() + Expect(err).NotTo(HaveOccurred()) + t0.DB = tr + testutil.DoDBTesting(t0) + + By("committing third transaction") + err = tr.Commit() + Expect(err).NotTo(HaveOccurred()) + testutil.TestIter(db, nil, t0.Present) + + db.TestClose() + done <- true + }, 30.0) + }) + }) +}) diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/filter.go b/vendor/github.com/syndtr/goleveldb/leveldb/filter.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/filter.go rename to vendor/github.com/syndtr/goleveldb/leveldb/filter.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/filter/bloom.go b/vendor/github.com/syndtr/goleveldb/leveldb/filter/bloom.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/filter/bloom.go rename to vendor/github.com/syndtr/goleveldb/leveldb/filter/bloom.go diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/filter/bloom_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/filter/bloom_test.go new file mode 100644 index 0000000..1fb56f0 --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/filter/bloom_test.go @@ -0,0 +1,142 @@ +// Copyright (c) 2012, Suryandaru Triandana +// All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package filter + +import ( + "encoding/binary" + "github.com/syndtr/goleveldb/leveldb/util" + "testing" +) + +type harness struct { + t *testing.T + + bloom Filter + generator FilterGenerator + filter []byte +} + +func newHarness(t *testing.T) *harness { + bloom := NewBloomFilter(10) + return &harness{ + t: t, + bloom: bloom, + generator: bloom.NewGenerator(), + } +} + +func (h *harness) add(key []byte) { + h.generator.Add(key) +} + +func (h *harness) addNum(key uint32) { + var b [4]byte + binary.LittleEndian.PutUint32(b[:], key) + h.add(b[:]) +} + +func (h *harness) build() { + b := &util.Buffer{} + h.generator.Generate(b) + h.filter = b.Bytes() +} + +func (h *harness) reset() { + h.filter = nil +} + +func (h *harness) filterLen() int { + return len(h.filter) +} + +func (h *harness) assert(key []byte, want, silent bool) bool { + got := h.bloom.Contains(h.filter, key) + if !silent && got != want { + h.t.Errorf("assert on '%v' failed got '%v', want '%v'", key, got, want) + } + return got +} + +func (h *harness) assertNum(key uint32, want, silent bool) bool { + var b [4]byte + binary.LittleEndian.PutUint32(b[:], key) + return h.assert(b[:], want, silent) +} + +func TestBloomFilter_Empty(t *testing.T) { + h := newHarness(t) + h.build() + h.assert([]byte("hello"), false, false) + h.assert([]byte("world"), false, false) +} + +func TestBloomFilter_Small(t *testing.T) { + h := newHarness(t) + h.add([]byte("hello")) + h.add([]byte("world")) + h.build() + h.assert([]byte("hello"), true, false) + h.assert([]byte("world"), true, false) + h.assert([]byte("x"), false, false) + h.assert([]byte("foo"), false, false) +} + +func nextN(n int) int { + switch { + case n < 10: + n += 1 + case n < 100: + n += 10 + case n < 1000: + n += 100 + default: + n += 1000 + } + return n +} + +func TestBloomFilter_VaryingLengths(t *testing.T) { + h := newHarness(t) + var mediocre, good int + for n := 1; n < 10000; n = nextN(n) { + h.reset() + for i := 0; i < n; i++ { + h.addNum(uint32(i)) + } + h.build() + + got := h.filterLen() + want := (n * 10 / 8) + 40 + if got > want { + t.Errorf("filter len test failed, '%d' > '%d'", got, want) + } + + for i := 0; i < n; i++ { + h.assertNum(uint32(i), true, false) + } + + var rate float32 + for i := 0; i < 10000; i++ { + if h.assertNum(uint32(i+1000000000), true, true) { + rate++ + } + } + rate /= 10000 + if rate > 0.02 { + t.Errorf("false positive rate is more than 2%%, got %v, at len %d", rate, n) + } + if rate > 0.0125 { + mediocre++ + } else { + good++ + } + } + t.Logf("false positive rate: %d good, %d mediocre", good, mediocre) + if mediocre > good/5 { + t.Error("mediocre false positive rate is more than expected") + } +} diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/filter/filter.go b/vendor/github.com/syndtr/goleveldb/leveldb/filter/filter.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/filter/filter.go rename to vendor/github.com/syndtr/goleveldb/leveldb/filter/filter.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/iterator/array_iter.go b/vendor/github.com/syndtr/goleveldb/leveldb/iterator/array_iter.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/iterator/array_iter.go rename to vendor/github.com/syndtr/goleveldb/leveldb/iterator/array_iter.go diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/iterator/array_iter_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/iterator/array_iter_test.go new file mode 100644 index 0000000..1ed6d07 --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/iterator/array_iter_test.go @@ -0,0 +1,30 @@ +// Copyright (c) 2014, Suryandaru Triandana +// All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package iterator_test + +import ( + . "github.com/onsi/ginkgo" + + . "github.com/syndtr/goleveldb/leveldb/iterator" + "github.com/syndtr/goleveldb/leveldb/testutil" +) + +var _ = testutil.Defer(func() { + Describe("Array iterator", func() { + It("Should iterates and seeks correctly", func() { + // Build key/value. + kv := testutil.KeyValue_Generate(nil, 70, 1, 5, 3, 3) + + // Test the iterator. + t := testutil.IteratorTesting{ + KeyValue: kv.Clone(), + Iter: NewArrayIterator(kv), + } + testutil.DoIteratorTesting(&t) + }) + }) +}) diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/iterator/indexed_iter.go b/vendor/github.com/syndtr/goleveldb/leveldb/iterator/indexed_iter.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/iterator/indexed_iter.go rename to vendor/github.com/syndtr/goleveldb/leveldb/iterator/indexed_iter.go diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/iterator/indexed_iter_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/iterator/indexed_iter_test.go new file mode 100644 index 0000000..72a7978 --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/iterator/indexed_iter_test.go @@ -0,0 +1,83 @@ +// Copyright (c) 2014, Suryandaru Triandana +// All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package iterator_test + +import ( + "sort" + + . "github.com/onsi/ginkgo" + + "github.com/syndtr/goleveldb/leveldb/comparer" + . "github.com/syndtr/goleveldb/leveldb/iterator" + "github.com/syndtr/goleveldb/leveldb/testutil" +) + +type keyValue struct { + key []byte + testutil.KeyValue +} + +type keyValueIndex []keyValue + +func (x keyValueIndex) Search(key []byte) int { + return sort.Search(x.Len(), func(i int) bool { + return comparer.DefaultComparer.Compare(x[i].key, key) >= 0 + }) +} + +func (x keyValueIndex) Len() int { return len(x) } +func (x keyValueIndex) Index(i int) (key, value []byte) { return x[i].key, nil } +func (x keyValueIndex) Get(i int) Iterator { return NewArrayIterator(x[i]) } + +var _ = testutil.Defer(func() { + Describe("Indexed iterator", func() { + Test := func(n ...int) func() { + if len(n) == 0 { + rnd := testutil.NewRand() + n = make([]int, rnd.Intn(17)+3) + for i := range n { + n[i] = rnd.Intn(19) + 1 + } + } + + return func() { + It("Should iterates and seeks correctly", func(done Done) { + // Build key/value. + index := make(keyValueIndex, len(n)) + sum := 0 + for _, x := range n { + sum += x + } + kv := testutil.KeyValue_Generate(nil, sum, 1, 10, 4, 4) + for i, j := 0, 0; i < len(n); i++ { + for x := n[i]; x > 0; x-- { + key, value := kv.Index(j) + index[i].key = key + index[i].Put(key, value) + j++ + } + } + + // Test the iterator. + t := testutil.IteratorTesting{ + KeyValue: kv.Clone(), + Iter: NewIndexedIterator(NewArrayIndexer(index), true), + } + testutil.DoIteratorTesting(&t) + done <- true + }, 1.5) + } + } + + Describe("with 100 keys", Test(100)) + Describe("with 50-50 keys", Test(50, 50)) + Describe("with 50-1 keys", Test(50, 1)) + Describe("with 50-1-50 keys", Test(50, 1, 50)) + Describe("with 1-50 keys", Test(1, 50)) + Describe("with random N-keys", Test()) + }) +}) diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/iterator/iter.go b/vendor/github.com/syndtr/goleveldb/leveldb/iterator/iter.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/iterator/iter.go rename to vendor/github.com/syndtr/goleveldb/leveldb/iterator/iter.go diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/iterator/iter_suite_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/iterator/iter_suite_test.go new file mode 100644 index 0000000..5ef8d5b --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/iterator/iter_suite_test.go @@ -0,0 +1,11 @@ +package iterator_test + +import ( + "testing" + + "github.com/syndtr/goleveldb/leveldb/testutil" +) + +func TestIterator(t *testing.T) { + testutil.RunSuite(t, "Iterator Suite") +} diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/iterator/merged_iter.go b/vendor/github.com/syndtr/goleveldb/leveldb/iterator/merged_iter.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/iterator/merged_iter.go rename to vendor/github.com/syndtr/goleveldb/leveldb/iterator/merged_iter.go diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/iterator/merged_iter_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/iterator/merged_iter_test.go new file mode 100644 index 0000000..e523b63 --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/iterator/merged_iter_test.go @@ -0,0 +1,60 @@ +// Copyright (c) 2014, Suryandaru Triandana +// All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package iterator_test + +import ( + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + + "github.com/syndtr/goleveldb/leveldb/comparer" + . "github.com/syndtr/goleveldb/leveldb/iterator" + "github.com/syndtr/goleveldb/leveldb/testutil" +) + +var _ = testutil.Defer(func() { + Describe("Merged iterator", func() { + Test := func(filled int, empty int) func() { + return func() { + It("Should iterates and seeks correctly", func(done Done) { + rnd := testutil.NewRand() + + // Build key/value. + filledKV := make([]testutil.KeyValue, filled) + kv := testutil.KeyValue_Generate(nil, 100, 1, 10, 4, 4) + kv.Iterate(func(i int, key, value []byte) { + filledKV[rnd.Intn(filled)].Put(key, value) + }) + + // Create itearators. + iters := make([]Iterator, filled+empty) + for i := range iters { + if empty == 0 || (rnd.Int()%2 == 0 && filled > 0) { + filled-- + Expect(filledKV[filled].Len()).ShouldNot(BeZero()) + iters[i] = NewArrayIterator(filledKV[filled]) + } else { + empty-- + iters[i] = NewEmptyIterator(nil) + } + } + + // Test the iterator. + t := testutil.IteratorTesting{ + KeyValue: kv.Clone(), + Iter: NewMergedIterator(iters, comparer.DefaultComparer, true), + } + testutil.DoIteratorTesting(&t) + done <- true + }, 1.5) + } + } + + Describe("with three, all filled iterators", Test(3, 0)) + Describe("with one filled, one empty iterators", Test(1, 1)) + Describe("with one filled, two empty iterators", Test(1, 2)) + }) +}) diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/journal/journal.go b/vendor/github.com/syndtr/goleveldb/leveldb/journal/journal.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/journal/journal.go rename to vendor/github.com/syndtr/goleveldb/leveldb/journal/journal.go diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/journal/journal_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/journal/journal_test.go new file mode 100644 index 0000000..0fcf225 --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/journal/journal_test.go @@ -0,0 +1,818 @@ +// Copyright 2011 The LevelDB-Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Taken from: https://code.google.com/p/leveldb-go/source/browse/leveldb/record/record_test.go?r=df1fa28f7f3be6c3935548169002309c12967135 +// License, authors and contributors informations can be found at bellow URLs respectively: +// https://code.google.com/p/leveldb-go/source/browse/LICENSE +// https://code.google.com/p/leveldb-go/source/browse/AUTHORS +// https://code.google.com/p/leveldb-go/source/browse/CONTRIBUTORS + +package journal + +import ( + "bytes" + "encoding/binary" + "fmt" + "io" + "io/ioutil" + "math/rand" + "strings" + "testing" +) + +type dropper struct { + t *testing.T +} + +func (d dropper) Drop(err error) { + d.t.Log(err) +} + +func short(s string) string { + if len(s) < 64 { + return s + } + return fmt.Sprintf("%s...(skipping %d bytes)...%s", s[:20], len(s)-40, s[len(s)-20:]) +} + +// big returns a string of length n, composed of repetitions of partial. +func big(partial string, n int) string { + return strings.Repeat(partial, n/len(partial)+1)[:n] +} + +func TestEmpty(t *testing.T) { + buf := new(bytes.Buffer) + r := NewReader(buf, dropper{t}, true, true) + if _, err := r.Next(); err != io.EOF { + t.Fatalf("got %v, want %v", err, io.EOF) + } +} + +func testGenerator(t *testing.T, reset func(), gen func() (string, bool)) { + buf := new(bytes.Buffer) + + reset() + w := NewWriter(buf) + for { + s, ok := gen() + if !ok { + break + } + ww, err := w.Next() + if err != nil { + t.Fatal(err) + } + if _, err := ww.Write([]byte(s)); err != nil { + t.Fatal(err) + } + } + if err := w.Close(); err != nil { + t.Fatal(err) + } + + reset() + r := NewReader(buf, dropper{t}, true, true) + for { + s, ok := gen() + if !ok { + break + } + rr, err := r.Next() + if err != nil { + t.Fatal(err) + } + x, err := ioutil.ReadAll(rr) + if err != nil { + t.Fatal(err) + } + if string(x) != s { + t.Fatalf("got %q, want %q", short(string(x)), short(s)) + } + } + if _, err := r.Next(); err != io.EOF { + t.Fatalf("got %v, want %v", err, io.EOF) + } +} + +func testLiterals(t *testing.T, s []string) { + var i int + reset := func() { + i = 0 + } + gen := func() (string, bool) { + if i == len(s) { + return "", false + } + i++ + return s[i-1], true + } + testGenerator(t, reset, gen) +} + +func TestMany(t *testing.T) { + const n = 1e5 + var i int + reset := func() { + i = 0 + } + gen := func() (string, bool) { + if i == n { + return "", false + } + i++ + return fmt.Sprintf("%d.", i-1), true + } + testGenerator(t, reset, gen) +} + +func TestRandom(t *testing.T) { + const n = 1e2 + var ( + i int + r *rand.Rand + ) + reset := func() { + i, r = 0, rand.New(rand.NewSource(0)) + } + gen := func() (string, bool) { + if i == n { + return "", false + } + i++ + return strings.Repeat(string(uint8(i)), r.Intn(2*blockSize+16)), true + } + testGenerator(t, reset, gen) +} + +func TestBasic(t *testing.T) { + testLiterals(t, []string{ + strings.Repeat("a", 1000), + strings.Repeat("b", 97270), + strings.Repeat("c", 8000), + }) +} + +func TestBoundary(t *testing.T) { + for i := blockSize - 16; i < blockSize+16; i++ { + s0 := big("abcd", i) + for j := blockSize - 16; j < blockSize+16; j++ { + s1 := big("ABCDE", j) + testLiterals(t, []string{s0, s1}) + testLiterals(t, []string{s0, "", s1}) + testLiterals(t, []string{s0, "x", s1}) + } + } +} + +func TestFlush(t *testing.T) { + buf := new(bytes.Buffer) + w := NewWriter(buf) + // Write a couple of records. Everything should still be held + // in the record.Writer buffer, so that buf.Len should be 0. + w0, _ := w.Next() + w0.Write([]byte("0")) + w1, _ := w.Next() + w1.Write([]byte("11")) + if got, want := buf.Len(), 0; got != want { + t.Fatalf("buffer length #0: got %d want %d", got, want) + } + // Flush the record.Writer buffer, which should yield 17 bytes. + // 17 = 2*7 + 1 + 2, which is two headers and 1 + 2 payload bytes. + if err := w.Flush(); err != nil { + t.Fatal(err) + } + if got, want := buf.Len(), 17; got != want { + t.Fatalf("buffer length #1: got %d want %d", got, want) + } + // Do another write, one that isn't large enough to complete the block. + // The write should not have flowed through to buf. + w2, _ := w.Next() + w2.Write(bytes.Repeat([]byte("2"), 10000)) + if got, want := buf.Len(), 17; got != want { + t.Fatalf("buffer length #2: got %d want %d", got, want) + } + // Flushing should get us up to 10024 bytes written. + // 10024 = 17 + 7 + 10000. + if err := w.Flush(); err != nil { + t.Fatal(err) + } + if got, want := buf.Len(), 10024; got != want { + t.Fatalf("buffer length #3: got %d want %d", got, want) + } + // Do a bigger write, one that completes the current block. + // We should now have 32768 bytes (a complete block), without + // an explicit flush. + w3, _ := w.Next() + w3.Write(bytes.Repeat([]byte("3"), 40000)) + if got, want := buf.Len(), 32768; got != want { + t.Fatalf("buffer length #4: got %d want %d", got, want) + } + // Flushing should get us up to 50038 bytes written. + // 50038 = 10024 + 2*7 + 40000. There are two headers because + // the one record was split into two chunks. + if err := w.Flush(); err != nil { + t.Fatal(err) + } + if got, want := buf.Len(), 50038; got != want { + t.Fatalf("buffer length #5: got %d want %d", got, want) + } + // Check that reading those records give the right lengths. + r := NewReader(buf, dropper{t}, true, true) + wants := []int64{1, 2, 10000, 40000} + for i, want := range wants { + rr, _ := r.Next() + n, err := io.Copy(ioutil.Discard, rr) + if err != nil { + t.Fatalf("read #%d: %v", i, err) + } + if n != want { + t.Fatalf("read #%d: got %d bytes want %d", i, n, want) + } + } +} + +func TestNonExhaustiveRead(t *testing.T) { + const n = 100 + buf := new(bytes.Buffer) + p := make([]byte, 10) + rnd := rand.New(rand.NewSource(1)) + + w := NewWriter(buf) + for i := 0; i < n; i++ { + length := len(p) + rnd.Intn(3*blockSize) + s := string(uint8(i)) + "123456789abcdefgh" + ww, _ := w.Next() + ww.Write([]byte(big(s, length))) + } + if err := w.Close(); err != nil { + t.Fatal(err) + } + + r := NewReader(buf, dropper{t}, true, true) + for i := 0; i < n; i++ { + rr, _ := r.Next() + _, err := io.ReadFull(rr, p) + if err != nil { + t.Fatal(err) + } + want := string(uint8(i)) + "123456789" + if got := string(p); got != want { + t.Fatalf("read #%d: got %q want %q", i, got, want) + } + } +} + +func TestStaleReader(t *testing.T) { + buf := new(bytes.Buffer) + + w := NewWriter(buf) + w0, err := w.Next() + if err != nil { + t.Fatal(err) + } + w0.Write([]byte("0")) + w1, err := w.Next() + if err != nil { + t.Fatal(err) + } + w1.Write([]byte("11")) + if err := w.Close(); err != nil { + t.Fatal(err) + } + + r := NewReader(buf, dropper{t}, true, true) + r0, err := r.Next() + if err != nil { + t.Fatal(err) + } + r1, err := r.Next() + if err != nil { + t.Fatal(err) + } + p := make([]byte, 1) + if _, err := r0.Read(p); err == nil || !strings.Contains(err.Error(), "stale") { + t.Fatalf("stale read #0: unexpected error: %v", err) + } + if _, err := r1.Read(p); err != nil { + t.Fatalf("fresh read #1: got %v want nil error", err) + } + if p[0] != '1' { + t.Fatalf("fresh read #1: byte contents: got '%c' want '1'", p[0]) + } +} + +func TestStaleWriter(t *testing.T) { + buf := new(bytes.Buffer) + + w := NewWriter(buf) + w0, err := w.Next() + if err != nil { + t.Fatal(err) + } + w1, err := w.Next() + if err != nil { + t.Fatal(err) + } + if _, err := w0.Write([]byte("0")); err == nil || !strings.Contains(err.Error(), "stale") { + t.Fatalf("stale write #0: unexpected error: %v", err) + } + if _, err := w1.Write([]byte("11")); err != nil { + t.Fatalf("fresh write #1: got %v want nil error", err) + } + if err := w.Flush(); err != nil { + t.Fatalf("flush: %v", err) + } + if _, err := w1.Write([]byte("0")); err == nil || !strings.Contains(err.Error(), "stale") { + t.Fatalf("stale write #1: unexpected error: %v", err) + } +} + +func TestCorrupt_MissingLastBlock(t *testing.T) { + buf := new(bytes.Buffer) + + w := NewWriter(buf) + + // First record. + ww, err := w.Next() + if err != nil { + t.Fatal(err) + } + if _, err := ww.Write(bytes.Repeat([]byte("0"), blockSize-1024)); err != nil { + t.Fatalf("write #0: unexpected error: %v", err) + } + + // Second record. + ww, err = w.Next() + if err != nil { + t.Fatal(err) + } + if _, err := ww.Write(bytes.Repeat([]byte("0"), blockSize-headerSize)); err != nil { + t.Fatalf("write #1: unexpected error: %v", err) + } + + if err := w.Close(); err != nil { + t.Fatal(err) + } + + // Cut the last block. + b := buf.Bytes()[:blockSize] + r := NewReader(bytes.NewReader(b), dropper{t}, false, true) + + // First read. + rr, err := r.Next() + if err != nil { + t.Fatal(err) + } + n, err := io.Copy(ioutil.Discard, rr) + if err != nil { + t.Fatalf("read #0: %v", err) + } + if n != blockSize-1024 { + t.Fatalf("read #0: got %d bytes want %d", n, blockSize-1024) + } + + // Second read. + rr, err = r.Next() + if err != nil { + t.Fatal(err) + } + n, err = io.Copy(ioutil.Discard, rr) + if err != io.ErrUnexpectedEOF { + t.Fatalf("read #1: unexpected error: %v", err) + } + + if _, err := r.Next(); err != io.EOF { + t.Fatalf("last next: unexpected error: %v", err) + } +} + +func TestCorrupt_CorruptedFirstBlock(t *testing.T) { + buf := new(bytes.Buffer) + + w := NewWriter(buf) + + // First record. + ww, err := w.Next() + if err != nil { + t.Fatal(err) + } + if _, err := ww.Write(bytes.Repeat([]byte("0"), blockSize/2)); err != nil { + t.Fatalf("write #0: unexpected error: %v", err) + } + + // Second record. + ww, err = w.Next() + if err != nil { + t.Fatal(err) + } + if _, err := ww.Write(bytes.Repeat([]byte("0"), blockSize-headerSize)); err != nil { + t.Fatalf("write #1: unexpected error: %v", err) + } + + // Third record. + ww, err = w.Next() + if err != nil { + t.Fatal(err) + } + if _, err := ww.Write(bytes.Repeat([]byte("0"), (blockSize-headerSize)+1)); err != nil { + t.Fatalf("write #2: unexpected error: %v", err) + } + + // Fourth record. + ww, err = w.Next() + if err != nil { + t.Fatal(err) + } + if _, err := ww.Write(bytes.Repeat([]byte("0"), (blockSize-headerSize)+2)); err != nil { + t.Fatalf("write #3: unexpected error: %v", err) + } + + if err := w.Close(); err != nil { + t.Fatal(err) + } + + b := buf.Bytes() + // Corrupting block #0. + for i := 0; i < 1024; i++ { + b[i] = '1' + } + + r := NewReader(bytes.NewReader(b), dropper{t}, false, true) + + // First read (third record). + rr, err := r.Next() + if err != nil { + t.Fatal(err) + } + n, err := io.Copy(ioutil.Discard, rr) + if err != nil { + t.Fatalf("read #0: %v", err) + } + if want := int64(blockSize-headerSize) + 1; n != want { + t.Fatalf("read #0: got %d bytes want %d", n, want) + } + + // Second read (fourth record). + rr, err = r.Next() + if err != nil { + t.Fatal(err) + } + n, err = io.Copy(ioutil.Discard, rr) + if err != nil { + t.Fatalf("read #1: %v", err) + } + if want := int64(blockSize-headerSize) + 2; n != want { + t.Fatalf("read #1: got %d bytes want %d", n, want) + } + + if _, err := r.Next(); err != io.EOF { + t.Fatalf("last next: unexpected error: %v", err) + } +} + +func TestCorrupt_CorruptedMiddleBlock(t *testing.T) { + buf := new(bytes.Buffer) + + w := NewWriter(buf) + + // First record. + ww, err := w.Next() + if err != nil { + t.Fatal(err) + } + if _, err := ww.Write(bytes.Repeat([]byte("0"), blockSize/2)); err != nil { + t.Fatalf("write #0: unexpected error: %v", err) + } + + // Second record. + ww, err = w.Next() + if err != nil { + t.Fatal(err) + } + if _, err := ww.Write(bytes.Repeat([]byte("0"), blockSize-headerSize)); err != nil { + t.Fatalf("write #1: unexpected error: %v", err) + } + + // Third record. + ww, err = w.Next() + if err != nil { + t.Fatal(err) + } + if _, err := ww.Write(bytes.Repeat([]byte("0"), (blockSize-headerSize)+1)); err != nil { + t.Fatalf("write #2: unexpected error: %v", err) + } + + // Fourth record. + ww, err = w.Next() + if err != nil { + t.Fatal(err) + } + if _, err := ww.Write(bytes.Repeat([]byte("0"), (blockSize-headerSize)+2)); err != nil { + t.Fatalf("write #3: unexpected error: %v", err) + } + + if err := w.Close(); err != nil { + t.Fatal(err) + } + + b := buf.Bytes() + // Corrupting block #1. + for i := 0; i < 1024; i++ { + b[blockSize+i] = '1' + } + + r := NewReader(bytes.NewReader(b), dropper{t}, false, true) + + // First read (first record). + rr, err := r.Next() + if err != nil { + t.Fatal(err) + } + n, err := io.Copy(ioutil.Discard, rr) + if err != nil { + t.Fatalf("read #0: %v", err) + } + if want := int64(blockSize / 2); n != want { + t.Fatalf("read #0: got %d bytes want %d", n, want) + } + + // Second read (second record). + rr, err = r.Next() + if err != nil { + t.Fatal(err) + } + n, err = io.Copy(ioutil.Discard, rr) + if err != io.ErrUnexpectedEOF { + t.Fatalf("read #1: unexpected error: %v", err) + } + + // Third read (fourth record). + rr, err = r.Next() + if err != nil { + t.Fatal(err) + } + n, err = io.Copy(ioutil.Discard, rr) + if err != nil { + t.Fatalf("read #2: %v", err) + } + if want := int64(blockSize-headerSize) + 2; n != want { + t.Fatalf("read #2: got %d bytes want %d", n, want) + } + + if _, err := r.Next(); err != io.EOF { + t.Fatalf("last next: unexpected error: %v", err) + } +} + +func TestCorrupt_CorruptedLastBlock(t *testing.T) { + buf := new(bytes.Buffer) + + w := NewWriter(buf) + + // First record. + ww, err := w.Next() + if err != nil { + t.Fatal(err) + } + if _, err := ww.Write(bytes.Repeat([]byte("0"), blockSize/2)); err != nil { + t.Fatalf("write #0: unexpected error: %v", err) + } + + // Second record. + ww, err = w.Next() + if err != nil { + t.Fatal(err) + } + if _, err := ww.Write(bytes.Repeat([]byte("0"), blockSize-headerSize)); err != nil { + t.Fatalf("write #1: unexpected error: %v", err) + } + + // Third record. + ww, err = w.Next() + if err != nil { + t.Fatal(err) + } + if _, err := ww.Write(bytes.Repeat([]byte("0"), (blockSize-headerSize)+1)); err != nil { + t.Fatalf("write #2: unexpected error: %v", err) + } + + // Fourth record. + ww, err = w.Next() + if err != nil { + t.Fatal(err) + } + if _, err := ww.Write(bytes.Repeat([]byte("0"), (blockSize-headerSize)+2)); err != nil { + t.Fatalf("write #3: unexpected error: %v", err) + } + + if err := w.Close(); err != nil { + t.Fatal(err) + } + + b := buf.Bytes() + // Corrupting block #3. + for i := len(b) - 1; i > len(b)-1024; i-- { + b[i] = '1' + } + + r := NewReader(bytes.NewReader(b), dropper{t}, false, true) + + // First read (first record). + rr, err := r.Next() + if err != nil { + t.Fatal(err) + } + n, err := io.Copy(ioutil.Discard, rr) + if err != nil { + t.Fatalf("read #0: %v", err) + } + if want := int64(blockSize / 2); n != want { + t.Fatalf("read #0: got %d bytes want %d", n, want) + } + + // Second read (second record). + rr, err = r.Next() + if err != nil { + t.Fatal(err) + } + n, err = io.Copy(ioutil.Discard, rr) + if err != nil { + t.Fatalf("read #1: %v", err) + } + if want := int64(blockSize - headerSize); n != want { + t.Fatalf("read #1: got %d bytes want %d", n, want) + } + + // Third read (third record). + rr, err = r.Next() + if err != nil { + t.Fatal(err) + } + n, err = io.Copy(ioutil.Discard, rr) + if err != nil { + t.Fatalf("read #2: %v", err) + } + if want := int64(blockSize-headerSize) + 1; n != want { + t.Fatalf("read #2: got %d bytes want %d", n, want) + } + + // Fourth read (fourth record). + rr, err = r.Next() + if err != nil { + t.Fatal(err) + } + n, err = io.Copy(ioutil.Discard, rr) + if err != io.ErrUnexpectedEOF { + t.Fatalf("read #3: unexpected error: %v", err) + } + + if _, err := r.Next(); err != io.EOF { + t.Fatalf("last next: unexpected error: %v", err) + } +} + +func TestCorrupt_FirstChuckLengthOverflow(t *testing.T) { + buf := new(bytes.Buffer) + + w := NewWriter(buf) + + // First record. + ww, err := w.Next() + if err != nil { + t.Fatal(err) + } + if _, err := ww.Write(bytes.Repeat([]byte("0"), blockSize/2)); err != nil { + t.Fatalf("write #0: unexpected error: %v", err) + } + + // Second record. + ww, err = w.Next() + if err != nil { + t.Fatal(err) + } + if _, err := ww.Write(bytes.Repeat([]byte("0"), blockSize-headerSize)); err != nil { + t.Fatalf("write #1: unexpected error: %v", err) + } + + // Third record. + ww, err = w.Next() + if err != nil { + t.Fatal(err) + } + if _, err := ww.Write(bytes.Repeat([]byte("0"), (blockSize-headerSize)+1)); err != nil { + t.Fatalf("write #2: unexpected error: %v", err) + } + + if err := w.Close(); err != nil { + t.Fatal(err) + } + + b := buf.Bytes() + // Corrupting record #1. + x := blockSize + binary.LittleEndian.PutUint16(b[x+4:], 0xffff) + + r := NewReader(bytes.NewReader(b), dropper{t}, false, true) + + // First read (first record). + rr, err := r.Next() + if err != nil { + t.Fatal(err) + } + n, err := io.Copy(ioutil.Discard, rr) + if err != nil { + t.Fatalf("read #0: %v", err) + } + if want := int64(blockSize / 2); n != want { + t.Fatalf("read #0: got %d bytes want %d", n, want) + } + + // Second read (second record). + rr, err = r.Next() + if err != nil { + t.Fatal(err) + } + n, err = io.Copy(ioutil.Discard, rr) + if err != io.ErrUnexpectedEOF { + t.Fatalf("read #1: unexpected error: %v", err) + } + + if _, err := r.Next(); err != io.EOF { + t.Fatalf("last next: unexpected error: %v", err) + } +} + +func TestCorrupt_MiddleChuckLengthOverflow(t *testing.T) { + buf := new(bytes.Buffer) + + w := NewWriter(buf) + + // First record. + ww, err := w.Next() + if err != nil { + t.Fatal(err) + } + if _, err := ww.Write(bytes.Repeat([]byte("0"), blockSize/2)); err != nil { + t.Fatalf("write #0: unexpected error: %v", err) + } + + // Second record. + ww, err = w.Next() + if err != nil { + t.Fatal(err) + } + if _, err := ww.Write(bytes.Repeat([]byte("0"), blockSize-headerSize)); err != nil { + t.Fatalf("write #1: unexpected error: %v", err) + } + + // Third record. + ww, err = w.Next() + if err != nil { + t.Fatal(err) + } + if _, err := ww.Write(bytes.Repeat([]byte("0"), (blockSize-headerSize)+1)); err != nil { + t.Fatalf("write #2: unexpected error: %v", err) + } + + if err := w.Close(); err != nil { + t.Fatal(err) + } + + b := buf.Bytes() + // Corrupting record #1. + x := blockSize/2 + headerSize + binary.LittleEndian.PutUint16(b[x+4:], 0xffff) + + r := NewReader(bytes.NewReader(b), dropper{t}, false, true) + + // First read (first record). + rr, err := r.Next() + if err != nil { + t.Fatal(err) + } + n, err := io.Copy(ioutil.Discard, rr) + if err != nil { + t.Fatalf("read #0: %v", err) + } + if want := int64(blockSize / 2); n != want { + t.Fatalf("read #0: got %d bytes want %d", n, want) + } + + // Second read (third record). + rr, err = r.Next() + if err != nil { + t.Fatal(err) + } + n, err = io.Copy(ioutil.Discard, rr) + if err != nil { + t.Fatalf("read #1: %v", err) + } + if want := int64(blockSize-headerSize) + 1; n != want { + t.Fatalf("read #1: got %d bytes want %d", n, want) + } + + if _, err := r.Next(); err != io.EOF { + t.Fatalf("last next: unexpected error: %v", err) + } +} diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/key.go b/vendor/github.com/syndtr/goleveldb/leveldb/key.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/key.go rename to vendor/github.com/syndtr/goleveldb/leveldb/key.go diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/key_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/key_test.go new file mode 100644 index 0000000..2f33ccb --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/key_test.go @@ -0,0 +1,133 @@ +// Copyright (c) 2012, Suryandaru Triandana +// All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package leveldb + +import ( + "bytes" + "testing" + + "github.com/syndtr/goleveldb/leveldb/comparer" +) + +var defaultIComparer = &iComparer{comparer.DefaultComparer} + +func ikey(key string, seq uint64, kt keyType) internalKey { + return makeInternalKey(nil, []byte(key), uint64(seq), kt) +} + +func shortSep(a, b []byte) []byte { + dst := make([]byte, len(a)) + dst = defaultIComparer.Separator(dst[:0], a, b) + if dst == nil { + return a + } + return dst +} + +func shortSuccessor(b []byte) []byte { + dst := make([]byte, len(b)) + dst = defaultIComparer.Successor(dst[:0], b) + if dst == nil { + return b + } + return dst +} + +func testSingleKey(t *testing.T, key string, seq uint64, kt keyType) { + ik := ikey(key, seq, kt) + + if !bytes.Equal(ik.ukey(), []byte(key)) { + t.Errorf("user key does not equal, got %v, want %v", string(ik.ukey()), key) + } + + rseq, rt := ik.parseNum() + if rseq != seq { + t.Errorf("seq number does not equal, got %v, want %v", rseq, seq) + } + if rt != kt { + t.Errorf("type does not equal, got %v, want %v", rt, kt) + } + + if rukey, rseq, rt, kerr := parseInternalKey(ik); kerr == nil { + if !bytes.Equal(rukey, []byte(key)) { + t.Errorf("user key does not equal, got %v, want %v", string(ik.ukey()), key) + } + if rseq != seq { + t.Errorf("seq number does not equal, got %v, want %v", rseq, seq) + } + if rt != kt { + t.Errorf("type does not equal, got %v, want %v", rt, kt) + } + } else { + t.Errorf("key error: %v", kerr) + } +} + +func TestInternalKey_EncodeDecode(t *testing.T) { + keys := []string{"", "k", "hello", "longggggggggggggggggggggg"} + seqs := []uint64{ + 1, 2, 3, + (1 << 8) - 1, 1 << 8, (1 << 8) + 1, + (1 << 16) - 1, 1 << 16, (1 << 16) + 1, + (1 << 32) - 1, 1 << 32, (1 << 32) + 1, + } + for _, key := range keys { + for _, seq := range seqs { + testSingleKey(t, key, seq, keyTypeVal) + testSingleKey(t, "hello", 1, keyTypeDel) + } + } +} + +func assertBytes(t *testing.T, want, got []byte) { + if !bytes.Equal(got, want) { + t.Errorf("assert failed, got %v, want %v", got, want) + } +} + +func TestInternalKeyShortSeparator(t *testing.T) { + // When user keys are same + assertBytes(t, ikey("foo", 100, keyTypeVal), + shortSep(ikey("foo", 100, keyTypeVal), + ikey("foo", 99, keyTypeVal))) + assertBytes(t, ikey("foo", 100, keyTypeVal), + shortSep(ikey("foo", 100, keyTypeVal), + ikey("foo", 101, keyTypeVal))) + assertBytes(t, ikey("foo", 100, keyTypeVal), + shortSep(ikey("foo", 100, keyTypeVal), + ikey("foo", 100, keyTypeVal))) + assertBytes(t, ikey("foo", 100, keyTypeVal), + shortSep(ikey("foo", 100, keyTypeVal), + ikey("foo", 100, keyTypeDel))) + + // When user keys are misordered + assertBytes(t, ikey("foo", 100, keyTypeVal), + shortSep(ikey("foo", 100, keyTypeVal), + ikey("bar", 99, keyTypeVal))) + + // When user keys are different, but correctly ordered + assertBytes(t, ikey("g", uint64(keyMaxSeq), keyTypeSeek), + shortSep(ikey("foo", 100, keyTypeVal), + ikey("hello", 200, keyTypeVal))) + + // When start user key is prefix of limit user key + assertBytes(t, ikey("foo", 100, keyTypeVal), + shortSep(ikey("foo", 100, keyTypeVal), + ikey("foobar", 200, keyTypeVal))) + + // When limit user key is prefix of start user key + assertBytes(t, ikey("foobar", 100, keyTypeVal), + shortSep(ikey("foobar", 100, keyTypeVal), + ikey("foo", 200, keyTypeVal))) +} + +func TestInternalKeyShortestSuccessor(t *testing.T) { + assertBytes(t, ikey("g", uint64(keyMaxSeq), keyTypeSeek), + shortSuccessor(ikey("foo", 100, keyTypeVal))) + assertBytes(t, ikey("\xff\xff", 100, keyTypeVal), + shortSuccessor(ikey("\xff\xff", 100, keyTypeVal))) +} diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/leveldb_suite_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/leveldb_suite_test.go new file mode 100644 index 0000000..fefa007 --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/leveldb_suite_test.go @@ -0,0 +1,11 @@ +package leveldb + +import ( + "testing" + + "github.com/syndtr/goleveldb/leveldb/testutil" +) + +func TestLevelDB(t *testing.T) { + testutil.RunSuite(t, "LevelDB Suite") +} diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/memdb/bench_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/memdb/bench_test.go new file mode 100644 index 0000000..b05084c --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/memdb/bench_test.go @@ -0,0 +1,75 @@ +// Copyright (c) 2012, Suryandaru Triandana +// All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package memdb + +import ( + "encoding/binary" + "math/rand" + "testing" + + "github.com/syndtr/goleveldb/leveldb/comparer" +) + +func BenchmarkPut(b *testing.B) { + buf := make([][4]byte, b.N) + for i := range buf { + binary.LittleEndian.PutUint32(buf[i][:], uint32(i)) + } + + b.ResetTimer() + p := New(comparer.DefaultComparer, 0) + for i := range buf { + p.Put(buf[i][:], nil) + } +} + +func BenchmarkPutRandom(b *testing.B) { + buf := make([][4]byte, b.N) + for i := range buf { + binary.LittleEndian.PutUint32(buf[i][:], uint32(rand.Int())) + } + + b.ResetTimer() + p := New(comparer.DefaultComparer, 0) + for i := range buf { + p.Put(buf[i][:], nil) + } +} + +func BenchmarkGet(b *testing.B) { + buf := make([][4]byte, b.N) + for i := range buf { + binary.LittleEndian.PutUint32(buf[i][:], uint32(i)) + } + + p := New(comparer.DefaultComparer, 0) + for i := range buf { + p.Put(buf[i][:], nil) + } + + b.ResetTimer() + for i := range buf { + p.Get(buf[i][:]) + } +} + +func BenchmarkGetRandom(b *testing.B) { + buf := make([][4]byte, b.N) + for i := range buf { + binary.LittleEndian.PutUint32(buf[i][:], uint32(i)) + } + + p := New(comparer.DefaultComparer, 0) + for i := range buf { + p.Put(buf[i][:], nil) + } + + b.ResetTimer() + for i := 0; i < b.N; i++ { + p.Get(buf[rand.Int()%b.N][:]) + } +} diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/memdb/memdb.go b/vendor/github.com/syndtr/goleveldb/leveldb/memdb/memdb.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/memdb/memdb.go rename to vendor/github.com/syndtr/goleveldb/leveldb/memdb/memdb.go diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/memdb/memdb_suite_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/memdb/memdb_suite_test.go new file mode 100644 index 0000000..18c304b --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/memdb/memdb_suite_test.go @@ -0,0 +1,11 @@ +package memdb + +import ( + "testing" + + "github.com/syndtr/goleveldb/leveldb/testutil" +) + +func TestMemDB(t *testing.T) { + testutil.RunSuite(t, "MemDB Suite") +} diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/memdb/memdb_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/memdb/memdb_test.go new file mode 100644 index 0000000..5dd6dbc --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/memdb/memdb_test.go @@ -0,0 +1,135 @@ +// Copyright (c) 2014, Suryandaru Triandana +// All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package memdb + +import ( + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + + "github.com/syndtr/goleveldb/leveldb/comparer" + "github.com/syndtr/goleveldb/leveldb/iterator" + "github.com/syndtr/goleveldb/leveldb/testutil" + "github.com/syndtr/goleveldb/leveldb/util" +) + +func (p *DB) TestFindLT(key []byte) (rkey, value []byte, err error) { + p.mu.RLock() + if node := p.findLT(key); node != 0 { + n := p.nodeData[node] + m := n + p.nodeData[node+nKey] + rkey = p.kvData[n:m] + value = p.kvData[m : m+p.nodeData[node+nVal]] + } else { + err = ErrNotFound + } + p.mu.RUnlock() + return +} + +func (p *DB) TestFindLast() (rkey, value []byte, err error) { + p.mu.RLock() + if node := p.findLast(); node != 0 { + n := p.nodeData[node] + m := n + p.nodeData[node+nKey] + rkey = p.kvData[n:m] + value = p.kvData[m : m+p.nodeData[node+nVal]] + } else { + err = ErrNotFound + } + p.mu.RUnlock() + return +} + +func (p *DB) TestPut(key []byte, value []byte) error { + p.Put(key, value) + return nil +} + +func (p *DB) TestDelete(key []byte) error { + p.Delete(key) + return nil +} + +func (p *DB) TestFind(key []byte) (rkey, rvalue []byte, err error) { + return p.Find(key) +} + +func (p *DB) TestGet(key []byte) (value []byte, err error) { + return p.Get(key) +} + +func (p *DB) TestNewIterator(slice *util.Range) iterator.Iterator { + return p.NewIterator(slice) +} + +var _ = testutil.Defer(func() { + Describe("Memdb", func() { + Describe("write test", func() { + It("should do write correctly", func() { + db := New(comparer.DefaultComparer, 0) + t := testutil.DBTesting{ + DB: db, + Deleted: testutil.KeyValue_Generate(nil, 1000, 1, 30, 5, 5).Clone(), + PostFn: func(t *testutil.DBTesting) { + Expect(db.Len()).Should(Equal(t.Present.Len())) + Expect(db.Size()).Should(Equal(t.Present.Size())) + switch t.Act { + case testutil.DBPut, testutil.DBOverwrite: + Expect(db.Contains(t.ActKey)).Should(BeTrue()) + default: + Expect(db.Contains(t.ActKey)).Should(BeFalse()) + } + }, + } + testutil.DoDBTesting(&t) + }) + }) + + Describe("read test", func() { + testutil.AllKeyValueTesting(nil, func(kv testutil.KeyValue) testutil.DB { + // Building the DB. + db := New(comparer.DefaultComparer, 0) + kv.IterateShuffled(nil, func(i int, key, value []byte) { + db.Put(key, value) + }) + + if kv.Len() > 1 { + It("Should find correct keys with findLT", func() { + testutil.ShuffledIndex(nil, kv.Len()-1, 1, func(i int) { + key_, key, _ := kv.IndexInexact(i + 1) + expectedKey, expectedValue := kv.Index(i) + + // Using key that exist. + rkey, rvalue, err := db.TestFindLT(key) + Expect(err).ShouldNot(HaveOccurred(), "Error for key %q -> %q", key, expectedKey) + Expect(rkey).Should(Equal(expectedKey), "Key") + Expect(rvalue).Should(Equal(expectedValue), "Value for key %q -> %q", key, expectedKey) + + // Using key that doesn't exist. + rkey, rvalue, err = db.TestFindLT(key_) + Expect(err).ShouldNot(HaveOccurred(), "Error for key %q (%q) -> %q", key_, key, expectedKey) + Expect(rkey).Should(Equal(expectedKey)) + Expect(rvalue).Should(Equal(expectedValue), "Value for key %q (%q) -> %q", key_, key, expectedKey) + }) + }) + } + + if kv.Len() > 0 { + It("Should find last key with findLast", func() { + key, value := kv.Index(kv.Len() - 1) + rkey, rvalue, err := db.TestFindLast() + Expect(err).ShouldNot(HaveOccurred()) + Expect(rkey).Should(Equal(key)) + Expect(rvalue).Should(Equal(value)) + }) + } + + return db + }, nil, nil) + }) + }) +}) diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/opt/options.go b/vendor/github.com/syndtr/goleveldb/leveldb/opt/options.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/opt/options.go rename to vendor/github.com/syndtr/goleveldb/leveldb/opt/options.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/options.go b/vendor/github.com/syndtr/goleveldb/leveldb/options.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/options.go rename to vendor/github.com/syndtr/goleveldb/leveldb/options.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/session.go b/vendor/github.com/syndtr/goleveldb/leveldb/session.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/session.go rename to vendor/github.com/syndtr/goleveldb/leveldb/session.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/session_compaction.go b/vendor/github.com/syndtr/goleveldb/leveldb/session_compaction.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/session_compaction.go rename to vendor/github.com/syndtr/goleveldb/leveldb/session_compaction.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/session_record.go b/vendor/github.com/syndtr/goleveldb/leveldb/session_record.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/session_record.go rename to vendor/github.com/syndtr/goleveldb/leveldb/session_record.go diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/session_record_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/session_record_test.go new file mode 100644 index 0000000..5af399f --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/session_record_test.go @@ -0,0 +1,62 @@ +// Copyright (c) 2012, Suryandaru Triandana +// All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package leveldb + +import ( + "bytes" + "testing" +) + +func decodeEncode(v *sessionRecord) (res bool, err error) { + b := new(bytes.Buffer) + err = v.encode(b) + if err != nil { + return + } + v2 := &sessionRecord{} + err = v.decode(b) + if err != nil { + return + } + b2 := new(bytes.Buffer) + err = v2.encode(b2) + if err != nil { + return + } + return bytes.Equal(b.Bytes(), b2.Bytes()), nil +} + +func TestSessionRecord_EncodeDecode(t *testing.T) { + big := int64(1) << 50 + v := &sessionRecord{} + i := int64(0) + test := func() { + res, err := decodeEncode(v) + if err != nil { + t.Fatalf("error when testing encode/decode sessionRecord: %v", err) + } + if !res { + t.Error("encode/decode test failed at iteration:", i) + } + } + + for ; i < 4; i++ { + test() + v.addTable(3, big+300+i, big+400+i, + makeInternalKey(nil, []byte("foo"), uint64(big+500+1), keyTypeVal), + makeInternalKey(nil, []byte("zoo"), uint64(big+600+1), keyTypeDel)) + v.delTable(4, big+700+i) + v.addCompPtr(int(i), makeInternalKey(nil, []byte("x"), uint64(big+900+1), keyTypeVal)) + } + + v.setComparer("foo") + v.setJournalNum(big + 100) + v.setPrevJournalNum(big + 99) + v.setNextFileNum(big + 200) + v.setSeqNum(uint64(big + 1000)) + test() +} diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/session_util.go b/vendor/github.com/syndtr/goleveldb/leveldb/session_util.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/session_util.go rename to vendor/github.com/syndtr/goleveldb/leveldb/session_util.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage.go b/vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage.go rename to vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_plan9.go b/vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_plan9.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_plan9.go rename to vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_plan9.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_solaris.go b/vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_solaris.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_solaris.go rename to vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_solaris.go diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_test.go new file mode 100644 index 0000000..7a77f28 --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_test.go @@ -0,0 +1,176 @@ +// Copyright (c) 2012, Suryandaru Triandana +// All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package storage + +import ( + "fmt" + "os" + "path/filepath" + "testing" +) + +var cases = []struct { + oldName []string + name string + ftype FileType + num int64 +}{ + {nil, "000100.log", TypeJournal, 100}, + {nil, "000000.log", TypeJournal, 0}, + {[]string{"000000.sst"}, "000000.ldb", TypeTable, 0}, + {nil, "MANIFEST-000002", TypeManifest, 2}, + {nil, "MANIFEST-000007", TypeManifest, 7}, + {nil, "9223372036854775807.log", TypeJournal, 9223372036854775807}, + {nil, "000100.tmp", TypeTemp, 100}, +} + +var invalidCases = []string{ + "", + "foo", + "foo-dx-100.log", + ".log", + "", + "manifest", + "CURREN", + "CURRENTX", + "MANIFES", + "MANIFEST", + "MANIFEST-", + "XMANIFEST-3", + "MANIFEST-3x", + "LOC", + "LOCKx", + "LO", + "LOGx", + "18446744073709551616.log", + "184467440737095516150.log", + "100", + "100.", + "100.lop", +} + +func TestFileStorage_CreateFileName(t *testing.T) { + for _, c := range cases { + if name := fsGenName(FileDesc{c.ftype, c.num}); name != c.name { + t.Errorf("invalid filename got '%s', want '%s'", name, c.name) + } + } +} + +func TestFileStorage_ParseFileName(t *testing.T) { + for _, c := range cases { + for _, name := range append([]string{c.name}, c.oldName...) { + fd, ok := fsParseName(name) + if !ok { + t.Errorf("cannot parse filename '%s'", name) + continue + } + if fd.Type != c.ftype { + t.Errorf("filename '%s' invalid type got '%d', want '%d'", name, fd.Type, c.ftype) + } + if fd.Num != c.num { + t.Errorf("filename '%s' invalid number got '%d', want '%d'", name, fd.Num, c.num) + } + } + } +} + +func TestFileStorage_InvalidFileName(t *testing.T) { + for _, name := range invalidCases { + if fsParseNamePtr(name, nil) { + t.Errorf("filename '%s' should be invalid", name) + } + } +} + +func TestFileStorage_Locking(t *testing.T) { + path := filepath.Join(os.TempDir(), fmt.Sprintf("goleveldb-testrwlock-%d", os.Getuid())) + if err := os.RemoveAll(path); err != nil && !os.IsNotExist(err) { + t.Fatal("RemoveAll: got error: ", err) + } + defer os.RemoveAll(path) + + p1, err := OpenFile(path, false) + if err != nil { + t.Fatal("OpenFile(1): got error: ", err) + } + + p2, err := OpenFile(path, false) + if err != nil { + t.Logf("OpenFile(2): got error: %s (expected)", err) + } else { + p2.Close() + p1.Close() + t.Fatal("OpenFile(2): expect error") + } + + p1.Close() + + p3, err := OpenFile(path, false) + if err != nil { + t.Fatal("OpenFile(3): got error: ", err) + } + defer p3.Close() + + l, err := p3.Lock() + if err != nil { + t.Fatal("storage lock failed(1): ", err) + } + _, err = p3.Lock() + if err == nil { + t.Fatal("expect error for second storage lock attempt") + } else { + t.Logf("storage lock got error: %s (expected)", err) + } + l.Release() + _, err = p3.Lock() + if err != nil { + t.Fatal("storage lock failed(2): ", err) + } +} + +func TestFileStorage_ReadOnlyLocking(t *testing.T) { + path := filepath.Join(os.TempDir(), fmt.Sprintf("goleveldb-testrolock-%d", os.Getuid())) + if err := os.RemoveAll(path); err != nil && !os.IsNotExist(err) { + t.Fatal("RemoveAll: got error: ", err) + } + defer os.RemoveAll(path) + + p1, err := OpenFile(path, false) + if err != nil { + t.Fatal("OpenFile(1): got error: ", err) + } + + _, err = OpenFile(path, true) + if err != nil { + t.Logf("OpenFile(2): got error: %s (expected)", err) + } else { + t.Fatal("OpenFile(2): expect error") + } + + p1.Close() + + p3, err := OpenFile(path, true) + if err != nil { + t.Fatal("OpenFile(3): got error: ", err) + } + + p4, err := OpenFile(path, true) + if err != nil { + t.Fatal("OpenFile(4): got error: ", err) + } + + _, err = OpenFile(path, false) + if err != nil { + t.Logf("OpenFile(5): got error: %s (expected)", err) + } else { + t.Fatal("OpenFile(2): expect error") + } + + p3.Close() + p4.Close() +} diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_unix.go b/vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_unix.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_unix.go rename to vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_unix.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_windows.go b/vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_windows.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_windows.go rename to vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_windows.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/storage/mem_storage.go b/vendor/github.com/syndtr/goleveldb/leveldb/storage/mem_storage.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/storage/mem_storage.go rename to vendor/github.com/syndtr/goleveldb/leveldb/storage/mem_storage.go diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/storage/mem_storage_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/storage/mem_storage_test.go new file mode 100644 index 0000000..7295075 --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/storage/mem_storage_test.go @@ -0,0 +1,65 @@ +// Copyright (c) 2013, Suryandaru Triandana +// All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package storage + +import ( + "bytes" + "testing" +) + +func TestMemStorage(t *testing.T) { + m := NewMemStorage() + + l, err := m.Lock() + if err != nil { + t.Fatal("storage lock failed(1): ", err) + } + _, err = m.Lock() + if err == nil { + t.Fatal("expect error for second storage lock attempt") + } else { + t.Logf("storage lock got error: %s (expected)", err) + } + l.Release() + _, err = m.Lock() + if err != nil { + t.Fatal("storage lock failed(2): ", err) + } + + w, err := m.Create(FileDesc{TypeTable, 1}) + if err != nil { + t.Fatal("Storage.Create: ", err) + } + w.Write([]byte("abc")) + w.Close() + if fds, _ := m.List(TypeAll); len(fds) != 1 { + t.Fatal("invalid GetFiles len") + } + buf := new(bytes.Buffer) + r, err := m.Open(FileDesc{TypeTable, 1}) + if err != nil { + t.Fatal("Open: got error: ", err) + } + buf.ReadFrom(r) + r.Close() + if got := buf.String(); got != "abc" { + t.Fatalf("Read: invalid value, want=abc got=%s", got) + } + if _, err := m.Open(FileDesc{TypeTable, 1}); err != nil { + t.Fatal("Open: got error: ", err) + } + if _, err := m.Open(FileDesc{TypeTable, 1}); err == nil { + t.Fatal("expecting error") + } + m.Remove(FileDesc{TypeTable, 1}) + if fds, _ := m.List(TypeAll); len(fds) != 0 { + t.Fatal("invalid GetFiles len", len(fds)) + } + if _, err := m.Open(FileDesc{TypeTable, 1}); err == nil { + t.Fatal("expecting error") + } +} diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/storage/storage.go b/vendor/github.com/syndtr/goleveldb/leveldb/storage/storage.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/storage/storage.go rename to vendor/github.com/syndtr/goleveldb/leveldb/storage/storage.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/table.go b/vendor/github.com/syndtr/goleveldb/leveldb/table.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/table.go rename to vendor/github.com/syndtr/goleveldb/leveldb/table.go diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/table/block_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/table/block_test.go new file mode 100644 index 0000000..00e6f9e --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/table/block_test.go @@ -0,0 +1,139 @@ +// Copyright (c) 2014, Suryandaru Triandana +// All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package table + +import ( + "encoding/binary" + "fmt" + + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + + "github.com/syndtr/goleveldb/leveldb/comparer" + "github.com/syndtr/goleveldb/leveldb/iterator" + "github.com/syndtr/goleveldb/leveldb/testutil" + "github.com/syndtr/goleveldb/leveldb/util" +) + +type blockTesting struct { + tr *Reader + b *block +} + +func (t *blockTesting) TestNewIterator(slice *util.Range) iterator.Iterator { + return t.tr.newBlockIter(t.b, nil, slice, false) +} + +var _ = testutil.Defer(func() { + Describe("Block", func() { + Build := func(kv *testutil.KeyValue, restartInterval int) *blockTesting { + // Building the block. + bw := &blockWriter{ + restartInterval: restartInterval, + scratch: make([]byte, 30), + } + kv.Iterate(func(i int, key, value []byte) { + bw.append(key, value) + }) + bw.finish() + + // Opening the block. + data := bw.buf.Bytes() + restartsLen := int(binary.LittleEndian.Uint32(data[len(data)-4:])) + return &blockTesting{ + tr: &Reader{cmp: comparer.DefaultComparer}, + b: &block{ + data: data, + restartsLen: restartsLen, + restartsOffset: len(data) - (restartsLen+1)*4, + }, + } + } + + Describe("read test", func() { + for restartInterval := 1; restartInterval <= 5; restartInterval++ { + Describe(fmt.Sprintf("with restart interval of %d", restartInterval), func() { + kv := &testutil.KeyValue{} + Text := func() string { + return fmt.Sprintf("and %d keys", kv.Len()) + } + + Test := func() { + // Make block. + br := Build(kv, restartInterval) + // Do testing. + testutil.KeyValueTesting(nil, kv.Clone(), br, nil, nil) + } + + Describe(Text(), Test) + + kv.PutString("", "empty") + Describe(Text(), Test) + + kv.PutString("a1", "foo") + Describe(Text(), Test) + + kv.PutString("a2", "v") + Describe(Text(), Test) + + kv.PutString("a3qqwrkks", "hello") + Describe(Text(), Test) + + kv.PutString("a4", "bar") + Describe(Text(), Test) + + kv.PutString("a5111111", "v5") + kv.PutString("a6", "") + kv.PutString("a7", "v7") + kv.PutString("a8", "vvvvvvvvvvvvvvvvvvvvvv8") + kv.PutString("b", "v9") + kv.PutString("c9", "v9") + kv.PutString("c91", "v9") + kv.PutString("d0", "v9") + Describe(Text(), Test) + }) + } + }) + + Describe("out-of-bound slice test", func() { + kv := &testutil.KeyValue{} + kv.PutString("k1", "v1") + kv.PutString("k2", "v2") + kv.PutString("k3abcdefgg", "v3") + kv.PutString("k4", "v4") + kv.PutString("k5", "v5") + for restartInterval := 1; restartInterval <= 5; restartInterval++ { + Describe(fmt.Sprintf("with restart interval of %d", restartInterval), func() { + // Make block. + bt := Build(kv, restartInterval) + + Test := func(r *util.Range) func(done Done) { + return func(done Done) { + iter := bt.TestNewIterator(r) + Expect(iter.Error()).ShouldNot(HaveOccurred()) + + t := testutil.IteratorTesting{ + KeyValue: kv.Clone(), + Iter: iter, + } + + testutil.DoIteratorTesting(&t) + iter.Release() + done <- true + } + } + + It("Should do iterations and seeks correctly #0", + Test(&util.Range{Start: []byte("k0"), Limit: []byte("k6")}), 2.0) + + It("Should do iterations and seeks correctly #1", + Test(&util.Range{Start: []byte(""), Limit: []byte("zzzzzzz")}), 2.0) + }) + } + }) + }) +}) diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/table/reader.go b/vendor/github.com/syndtr/goleveldb/leveldb/table/reader.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/table/reader.go rename to vendor/github.com/syndtr/goleveldb/leveldb/table/reader.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/table/table.go b/vendor/github.com/syndtr/goleveldb/leveldb/table/table.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/table/table.go rename to vendor/github.com/syndtr/goleveldb/leveldb/table/table.go diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/table/table_suite_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/table/table_suite_test.go new file mode 100644 index 0000000..6465da6 --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/table/table_suite_test.go @@ -0,0 +1,11 @@ +package table + +import ( + "testing" + + "github.com/syndtr/goleveldb/leveldb/testutil" +) + +func TestTable(t *testing.T) { + testutil.RunSuite(t, "Table Suite") +} diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/table/table_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/table/table_test.go new file mode 100644 index 0000000..1bc73ed --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/table/table_test.go @@ -0,0 +1,123 @@ +// Copyright (c) 2014, Suryandaru Triandana +// All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package table + +import ( + "bytes" + + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + + "github.com/syndtr/goleveldb/leveldb/iterator" + "github.com/syndtr/goleveldb/leveldb/opt" + "github.com/syndtr/goleveldb/leveldb/storage" + "github.com/syndtr/goleveldb/leveldb/testutil" + "github.com/syndtr/goleveldb/leveldb/util" +) + +type tableWrapper struct { + *Reader +} + +func (t tableWrapper) TestFind(key []byte) (rkey, rvalue []byte, err error) { + return t.Reader.Find(key, false, nil) +} + +func (t tableWrapper) TestGet(key []byte) (value []byte, err error) { + return t.Reader.Get(key, nil) +} + +func (t tableWrapper) TestNewIterator(slice *util.Range) iterator.Iterator { + return t.Reader.NewIterator(slice, nil) +} + +var _ = testutil.Defer(func() { + Describe("Table", func() { + Describe("approximate offset test", func() { + var ( + buf = &bytes.Buffer{} + o = &opt.Options{ + BlockSize: 1024, + Compression: opt.NoCompression, + } + ) + + // Building the table. + tw := NewWriter(buf, o) + tw.Append([]byte("k01"), []byte("hello")) + tw.Append([]byte("k02"), []byte("hello2")) + tw.Append([]byte("k03"), bytes.Repeat([]byte{'x'}, 10000)) + tw.Append([]byte("k04"), bytes.Repeat([]byte{'x'}, 200000)) + tw.Append([]byte("k05"), bytes.Repeat([]byte{'x'}, 300000)) + tw.Append([]byte("k06"), []byte("hello3")) + tw.Append([]byte("k07"), bytes.Repeat([]byte{'x'}, 100000)) + err := tw.Close() + + It("Should be able to approximate offset of a key correctly", func() { + Expect(err).ShouldNot(HaveOccurred()) + + tr, err := NewReader(bytes.NewReader(buf.Bytes()), int64(buf.Len()), storage.FileDesc{}, nil, nil, o) + Expect(err).ShouldNot(HaveOccurred()) + CheckOffset := func(key string, expect, threshold int) { + offset, err := tr.OffsetOf([]byte(key)) + Expect(err).ShouldNot(HaveOccurred()) + Expect(offset).Should(BeNumerically("~", expect, threshold), "Offset of key %q", key) + } + + CheckOffset("k0", 0, 0) + CheckOffset("k01a", 0, 0) + CheckOffset("k02", 0, 0) + CheckOffset("k03", 0, 0) + CheckOffset("k04", 10000, 1000) + CheckOffset("k04a", 210000, 1000) + CheckOffset("k05", 210000, 1000) + CheckOffset("k06", 510000, 1000) + CheckOffset("k07", 510000, 1000) + CheckOffset("xyz", 610000, 2000) + }) + }) + + Describe("read test", func() { + Build := func(kv testutil.KeyValue) testutil.DB { + o := &opt.Options{ + BlockSize: 512, + BlockRestartInterval: 3, + } + buf := &bytes.Buffer{} + + // Building the table. + tw := NewWriter(buf, o) + kv.Iterate(func(i int, key, value []byte) { + tw.Append(key, value) + }) + tw.Close() + + // Opening the table. + tr, _ := NewReader(bytes.NewReader(buf.Bytes()), int64(buf.Len()), storage.FileDesc{}, nil, nil, o) + return tableWrapper{tr} + } + Test := func(kv *testutil.KeyValue, body func(r *Reader)) func() { + return func() { + db := Build(*kv) + if body != nil { + body(db.(tableWrapper).Reader) + } + testutil.KeyValueTesting(nil, *kv, db, nil, nil) + } + } + + testutil.AllKeyValueTesting(nil, Build, nil, nil) + Describe("with one key per block", Test(testutil.KeyValue_Generate(nil, 9, 1, 10, 512, 512), func(r *Reader) { + It("should have correct blocks number", func() { + indexBlock, err := r.readBlock(r.indexBH, true) + Expect(err).To(BeNil()) + Expect(indexBlock.restartsLen).Should(Equal(9)) + }) + })) + }) + }) +}) diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/table/writer.go b/vendor/github.com/syndtr/goleveldb/leveldb/table/writer.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/table/writer.go rename to vendor/github.com/syndtr/goleveldb/leveldb/table/writer.go diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/testutil_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/testutil_test.go new file mode 100644 index 0000000..c8cb44c --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/testutil_test.go @@ -0,0 +1,91 @@ +// Copyright (c) 2014, Suryandaru Triandana +// All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package leveldb + +import ( + . "github.com/onsi/gomega" + + "github.com/syndtr/goleveldb/leveldb/iterator" + "github.com/syndtr/goleveldb/leveldb/opt" + "github.com/syndtr/goleveldb/leveldb/testutil" + "github.com/syndtr/goleveldb/leveldb/util" +) + +type testingDB struct { + *DB + ro *opt.ReadOptions + wo *opt.WriteOptions + stor *testutil.Storage +} + +func (t *testingDB) TestPut(key []byte, value []byte) error { + return t.Put(key, value, t.wo) +} + +func (t *testingDB) TestDelete(key []byte) error { + return t.Delete(key, t.wo) +} + +func (t *testingDB) TestGet(key []byte) (value []byte, err error) { + return t.Get(key, t.ro) +} + +func (t *testingDB) TestHas(key []byte) (ret bool, err error) { + return t.Has(key, t.ro) +} + +func (t *testingDB) TestNewIterator(slice *util.Range) iterator.Iterator { + return t.NewIterator(slice, t.ro) +} + +func (t *testingDB) TestClose() { + err := t.Close() + ExpectWithOffset(1, err).NotTo(HaveOccurred()) + err = t.stor.Close() + ExpectWithOffset(1, err).NotTo(HaveOccurred()) +} + +func newTestingDB(o *opt.Options, ro *opt.ReadOptions, wo *opt.WriteOptions) *testingDB { + stor := testutil.NewStorage() + db, err := Open(stor, o) + // FIXME: This may be called from outside It, which may cause panic. + Expect(err).NotTo(HaveOccurred()) + return &testingDB{ + DB: db, + ro: ro, + wo: wo, + stor: stor, + } +} + +type testingTransaction struct { + *Transaction + ro *opt.ReadOptions + wo *opt.WriteOptions +} + +func (t *testingTransaction) TestPut(key []byte, value []byte) error { + return t.Put(key, value, t.wo) +} + +func (t *testingTransaction) TestDelete(key []byte) error { + return t.Delete(key, t.wo) +} + +func (t *testingTransaction) TestGet(key []byte) (value []byte, err error) { + return t.Get(key, t.ro) +} + +func (t *testingTransaction) TestHas(key []byte) (ret bool, err error) { + return t.Has(key, t.ro) +} + +func (t *testingTransaction) TestNewIterator(slice *util.Range) iterator.Iterator { + return t.NewIterator(slice, t.ro) +} + +func (t *testingTransaction) TestClose() {} diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/util.go b/vendor/github.com/syndtr/goleveldb/leveldb/util.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/util.go rename to vendor/github.com/syndtr/goleveldb/leveldb/util.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/util/buffer.go b/vendor/github.com/syndtr/goleveldb/leveldb/util/buffer.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/util/buffer.go rename to vendor/github.com/syndtr/goleveldb/leveldb/util/buffer.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/util/buffer_pool.go b/vendor/github.com/syndtr/goleveldb/leveldb/util/buffer_pool.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/util/buffer_pool.go rename to vendor/github.com/syndtr/goleveldb/leveldb/util/buffer_pool.go diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/util/buffer_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/util/buffer_test.go new file mode 100644 index 0000000..87d9673 --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/util/buffer_test.go @@ -0,0 +1,369 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package util + +import ( + "bytes" + "io" + "math/rand" + "runtime" + "testing" +) + +const N = 10000 // make this bigger for a larger (and slower) test +var data string // test data for write tests +var testBytes []byte // test data; same as data but as a slice. + +func init() { + testBytes = make([]byte, N) + for i := 0; i < N; i++ { + testBytes[i] = 'a' + byte(i%26) + } + data = string(testBytes) +} + +// Verify that contents of buf match the string s. +func check(t *testing.T, testname string, buf *Buffer, s string) { + bytes := buf.Bytes() + str := buf.String() + if buf.Len() != len(bytes) { + t.Errorf("%s: buf.Len() == %d, len(buf.Bytes()) == %d", testname, buf.Len(), len(bytes)) + } + + if buf.Len() != len(str) { + t.Errorf("%s: buf.Len() == %d, len(buf.String()) == %d", testname, buf.Len(), len(str)) + } + + if buf.Len() != len(s) { + t.Errorf("%s: buf.Len() == %d, len(s) == %d", testname, buf.Len(), len(s)) + } + + if string(bytes) != s { + t.Errorf("%s: string(buf.Bytes()) == %q, s == %q", testname, string(bytes), s) + } +} + +// Fill buf through n writes of byte slice fub. +// The initial contents of buf corresponds to the string s; +// the result is the final contents of buf returned as a string. +func fillBytes(t *testing.T, testname string, buf *Buffer, s string, n int, fub []byte) string { + check(t, testname+" (fill 1)", buf, s) + for ; n > 0; n-- { + m, err := buf.Write(fub) + if m != len(fub) { + t.Errorf(testname+" (fill 2): m == %d, expected %d", m, len(fub)) + } + if err != nil { + t.Errorf(testname+" (fill 3): err should always be nil, found err == %s", err) + } + s += string(fub) + check(t, testname+" (fill 4)", buf, s) + } + return s +} + +func TestNewBuffer(t *testing.T) { + buf := NewBuffer(testBytes) + check(t, "NewBuffer", buf, data) +} + +// Empty buf through repeated reads into fub. +// The initial contents of buf corresponds to the string s. +func empty(t *testing.T, testname string, buf *Buffer, s string, fub []byte) { + check(t, testname+" (empty 1)", buf, s) + + for { + n, err := buf.Read(fub) + if n == 0 { + break + } + if err != nil { + t.Errorf(testname+" (empty 2): err should always be nil, found err == %s", err) + } + s = s[n:] + check(t, testname+" (empty 3)", buf, s) + } + + check(t, testname+" (empty 4)", buf, "") +} + +func TestBasicOperations(t *testing.T) { + var buf Buffer + + for i := 0; i < 5; i++ { + check(t, "TestBasicOperations (1)", &buf, "") + + buf.Reset() + check(t, "TestBasicOperations (2)", &buf, "") + + buf.Truncate(0) + check(t, "TestBasicOperations (3)", &buf, "") + + n, err := buf.Write([]byte(data[0:1])) + if n != 1 { + t.Errorf("wrote 1 byte, but n == %d", n) + } + if err != nil { + t.Errorf("err should always be nil, but err == %s", err) + } + check(t, "TestBasicOperations (4)", &buf, "a") + + buf.WriteByte(data[1]) + check(t, "TestBasicOperations (5)", &buf, "ab") + + n, err = buf.Write([]byte(data[2:26])) + if n != 24 { + t.Errorf("wrote 25 bytes, but n == %d", n) + } + check(t, "TestBasicOperations (6)", &buf, string(data[0:26])) + + buf.Truncate(26) + check(t, "TestBasicOperations (7)", &buf, string(data[0:26])) + + buf.Truncate(20) + check(t, "TestBasicOperations (8)", &buf, string(data[0:20])) + + empty(t, "TestBasicOperations (9)", &buf, string(data[0:20]), make([]byte, 5)) + empty(t, "TestBasicOperations (10)", &buf, "", make([]byte, 100)) + + buf.WriteByte(data[1]) + c, err := buf.ReadByte() + if err != nil { + t.Error("ReadByte unexpected eof") + } + if c != data[1] { + t.Errorf("ReadByte wrong value c=%v", c) + } + c, err = buf.ReadByte() + if err == nil { + t.Error("ReadByte unexpected not eof") + } + } +} + +func TestLargeByteWrites(t *testing.T) { + var buf Buffer + limit := 30 + if testing.Short() { + limit = 9 + } + for i := 3; i < limit; i += 3 { + s := fillBytes(t, "TestLargeWrites (1)", &buf, "", 5, testBytes) + empty(t, "TestLargeByteWrites (2)", &buf, s, make([]byte, len(data)/i)) + } + check(t, "TestLargeByteWrites (3)", &buf, "") +} + +func TestLargeByteReads(t *testing.T) { + var buf Buffer + for i := 3; i < 30; i += 3 { + s := fillBytes(t, "TestLargeReads (1)", &buf, "", 5, testBytes[0:len(testBytes)/i]) + empty(t, "TestLargeReads (2)", &buf, s, make([]byte, len(data))) + } + check(t, "TestLargeByteReads (3)", &buf, "") +} + +func TestMixedReadsAndWrites(t *testing.T) { + var buf Buffer + s := "" + for i := 0; i < 50; i++ { + wlen := rand.Intn(len(data)) + s = fillBytes(t, "TestMixedReadsAndWrites (1)", &buf, s, 1, testBytes[0:wlen]) + rlen := rand.Intn(len(data)) + fub := make([]byte, rlen) + n, _ := buf.Read(fub) + s = s[n:] + } + empty(t, "TestMixedReadsAndWrites (2)", &buf, s, make([]byte, buf.Len())) +} + +func TestNil(t *testing.T) { + var b *Buffer + if b.String() != "" { + t.Errorf("expected ; got %q", b.String()) + } +} + +func TestReadFrom(t *testing.T) { + var buf Buffer + for i := 3; i < 30; i += 3 { + s := fillBytes(t, "TestReadFrom (1)", &buf, "", 5, testBytes[0:len(testBytes)/i]) + var b Buffer + b.ReadFrom(&buf) + empty(t, "TestReadFrom (2)", &b, s, make([]byte, len(data))) + } +} + +func TestWriteTo(t *testing.T) { + var buf Buffer + for i := 3; i < 30; i += 3 { + s := fillBytes(t, "TestWriteTo (1)", &buf, "", 5, testBytes[0:len(testBytes)/i]) + var b Buffer + buf.WriteTo(&b) + empty(t, "TestWriteTo (2)", &b, s, make([]byte, len(data))) + } +} + +func TestNext(t *testing.T) { + b := []byte{0, 1, 2, 3, 4} + tmp := make([]byte, 5) + for i := 0; i <= 5; i++ { + for j := i; j <= 5; j++ { + for k := 0; k <= 6; k++ { + // 0 <= i <= j <= 5; 0 <= k <= 6 + // Check that if we start with a buffer + // of length j at offset i and ask for + // Next(k), we get the right bytes. + buf := NewBuffer(b[0:j]) + n, _ := buf.Read(tmp[0:i]) + if n != i { + t.Fatalf("Read %d returned %d", i, n) + } + bb := buf.Next(k) + want := k + if want > j-i { + want = j - i + } + if len(bb) != want { + t.Fatalf("in %d,%d: len(Next(%d)) == %d", i, j, k, len(bb)) + } + for l, v := range bb { + if v != byte(l+i) { + t.Fatalf("in %d,%d: Next(%d)[%d] = %d, want %d", i, j, k, l, v, l+i) + } + } + } + } + } +} + +var readBytesTests = []struct { + buffer string + delim byte + expected []string + err error +}{ + {"", 0, []string{""}, io.EOF}, + {"a\x00", 0, []string{"a\x00"}, nil}, + {"abbbaaaba", 'b', []string{"ab", "b", "b", "aaab"}, nil}, + {"hello\x01world", 1, []string{"hello\x01"}, nil}, + {"foo\nbar", 0, []string{"foo\nbar"}, io.EOF}, + {"alpha\nbeta\ngamma\n", '\n', []string{"alpha\n", "beta\n", "gamma\n"}, nil}, + {"alpha\nbeta\ngamma", '\n', []string{"alpha\n", "beta\n", "gamma"}, io.EOF}, +} + +func TestReadBytes(t *testing.T) { + for _, test := range readBytesTests { + buf := NewBuffer([]byte(test.buffer)) + var err error + for _, expected := range test.expected { + var bytes []byte + bytes, err = buf.ReadBytes(test.delim) + if string(bytes) != expected { + t.Errorf("expected %q, got %q", expected, bytes) + } + if err != nil { + break + } + } + if err != test.err { + t.Errorf("expected error %v, got %v", test.err, err) + } + } +} + +func TestGrow(t *testing.T) { + x := []byte{'x'} + y := []byte{'y'} + tmp := make([]byte, 72) + for _, startLen := range []int{0, 100, 1000, 10000, 100000} { + xBytes := bytes.Repeat(x, startLen) + for _, growLen := range []int{0, 100, 1000, 10000, 100000} { + buf := NewBuffer(xBytes) + // If we read, this affects buf.off, which is good to test. + readBytes, _ := buf.Read(tmp) + buf.Grow(growLen) + yBytes := bytes.Repeat(y, growLen) + // Check no allocation occurs in write, as long as we're single-threaded. + var m1, m2 runtime.MemStats + runtime.ReadMemStats(&m1) + buf.Write(yBytes) + runtime.ReadMemStats(&m2) + if runtime.GOMAXPROCS(-1) == 1 && m1.Mallocs != m2.Mallocs { + t.Errorf("allocation occurred during write") + } + // Check that buffer has correct data. + if !bytes.Equal(buf.Bytes()[0:startLen-readBytes], xBytes[readBytes:]) { + t.Errorf("bad initial data at %d %d", startLen, growLen) + } + if !bytes.Equal(buf.Bytes()[startLen-readBytes:startLen-readBytes+growLen], yBytes) { + t.Errorf("bad written data at %d %d", startLen, growLen) + } + } + } +} + +// Was a bug: used to give EOF reading empty slice at EOF. +func TestReadEmptyAtEOF(t *testing.T) { + b := new(Buffer) + slice := make([]byte, 0) + n, err := b.Read(slice) + if err != nil { + t.Errorf("read error: %v", err) + } + if n != 0 { + t.Errorf("wrong count; got %d want 0", n) + } +} + +// Tests that we occasionally compact. Issue 5154. +func TestBufferGrowth(t *testing.T) { + var b Buffer + buf := make([]byte, 1024) + b.Write(buf[0:1]) + var cap0 int + for i := 0; i < 5<<10; i++ { + b.Write(buf) + b.Read(buf) + if i == 0 { + cap0 = cap(b.buf) + } + } + cap1 := cap(b.buf) + // (*Buffer).grow allows for 2x capacity slop before sliding, + // so set our error threshold at 3x. + if cap1 > cap0*3 { + t.Errorf("buffer cap = %d; too big (grew from %d)", cap1, cap0) + } +} + +// From Issue 5154. +func BenchmarkBufferNotEmptyWriteRead(b *testing.B) { + buf := make([]byte, 1024) + for i := 0; i < b.N; i++ { + var b Buffer + b.Write(buf[0:1]) + for i := 0; i < 5<<10; i++ { + b.Write(buf) + b.Read(buf) + } + } +} + +// Check that we don't compact too often. From Issue 5154. +func BenchmarkBufferFullSmallReads(b *testing.B) { + buf := make([]byte, 1024) + for i := 0; i < b.N; i++ { + var b Buffer + b.Write(buf) + for b.Len()+20 < cap(b.buf) { + b.Write(buf[:10]) + } + for i := 0; i < 5<<10; i++ { + b.Read(buf[:1]) + b.Write(buf[:1]) + } + } +} diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/util/crc32.go b/vendor/github.com/syndtr/goleveldb/leveldb/util/crc32.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/util/crc32.go rename to vendor/github.com/syndtr/goleveldb/leveldb/util/crc32.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/util/hash.go b/vendor/github.com/syndtr/goleveldb/leveldb/util/hash.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/util/hash.go rename to vendor/github.com/syndtr/goleveldb/leveldb/util/hash.go diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/util/hash_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/util/hash_test.go new file mode 100644 index 0000000..a35d273 --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/util/hash_test.go @@ -0,0 +1,46 @@ +// Copyright (c) 2012, Suryandaru Triandana +// All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package util + +import ( + "testing" +) + +var hashTests = []struct { + data []byte + seed uint32 + hash uint32 +}{ + {nil, 0xbc9f1d34, 0xbc9f1d34}, + {[]byte{0x62}, 0xbc9f1d34, 0xef1345c4}, + {[]byte{0xc3, 0x97}, 0xbc9f1d34, 0x5b663814}, + {[]byte{0xe2, 0x99, 0xa5}, 0xbc9f1d34, 0x323c078f}, + {[]byte{0xe1, 0x80, 0xb9, 0x32}, 0xbc9f1d34, 0xed21633a}, + {[]byte{ + 0x01, 0xc0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x00, + 0x00, 0x00, 0x00, 0x14, + 0x00, 0x00, 0x00, 0x18, + 0x28, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + }, 0x12345678, 0xf333dabb}, +} + +func TestHash(t *testing.T) { + for i, x := range hashTests { + h := Hash(x.data, x.seed) + if h != x.hash { + t.Fatalf("test-%d: invalid hash, %#x vs %#x", i, h, x.hash) + } + } +} diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/util/range.go b/vendor/github.com/syndtr/goleveldb/leveldb/util/range.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/util/range.go rename to vendor/github.com/syndtr/goleveldb/leveldb/util/range.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/util/util.go b/vendor/github.com/syndtr/goleveldb/leveldb/util/util.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/util/util.go rename to vendor/github.com/syndtr/goleveldb/leveldb/util/util.go diff --git a/_vendor/vendor/github.com/syndtr/goleveldb/leveldb/version.go b/vendor/github.com/syndtr/goleveldb/leveldb/version.go similarity index 100% rename from _vendor/vendor/github.com/syndtr/goleveldb/leveldb/version.go rename to vendor/github.com/syndtr/goleveldb/leveldb/version.go diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/version_test.go b/vendor/github.com/syndtr/goleveldb/leveldb/version_test.go new file mode 100644 index 0000000..a643be1 --- /dev/null +++ b/vendor/github.com/syndtr/goleveldb/leveldb/version_test.go @@ -0,0 +1,181 @@ +package leveldb + +import ( + "encoding/binary" + "reflect" + "testing" + + "github.com/onsi/gomega" + + "github.com/syndtr/goleveldb/leveldb/testutil" +) + +type testFileRec struct { + level int + num int64 +} + +func TestVersionStaging(t *testing.T) { + gomega.RegisterTestingT(t) + stor := testutil.NewStorage() + defer stor.Close() + s, err := newSession(stor, nil) + if err != nil { + t.Fatal(err) + } + + v := newVersion(s) + v.newStaging() + + tmp := make([]byte, 4) + mik := func(i uint64) []byte { + binary.BigEndian.PutUint32(tmp, uint32(i)) + return []byte(makeInternalKey(nil, tmp, 0, keyTypeVal)) + } + + for i, x := range []struct { + add, del []testFileRec + levels [][]int64 + }{ + { + add: []testFileRec{ + {1, 1}, + }, + levels: [][]int64{ + {}, + {1}, + }, + }, + { + add: []testFileRec{ + {1, 1}, + }, + levels: [][]int64{ + {}, + {1}, + }, + }, + { + del: []testFileRec{ + {1, 1}, + }, + levels: [][]int64{}, + }, + { + add: []testFileRec{ + {0, 1}, + {0, 3}, + {0, 2}, + {2, 5}, + {1, 4}, + }, + levels: [][]int64{ + {3, 2, 1}, + {4}, + {5}, + }, + }, + { + add: []testFileRec{ + {1, 6}, + {2, 5}, + }, + del: []testFileRec{ + {0, 1}, + {0, 4}, + }, + levels: [][]int64{ + {3, 2}, + {4, 6}, + {5}, + }, + }, + { + del: []testFileRec{ + {0, 3}, + {0, 2}, + {1, 4}, + {1, 6}, + {2, 5}, + }, + levels: [][]int64{}, + }, + { + add: []testFileRec{ + {0, 1}, + }, + levels: [][]int64{ + {1}, + }, + }, + { + add: []testFileRec{ + {1, 2}, + }, + levels: [][]int64{ + {1}, + {2}, + }, + }, + { + add: []testFileRec{ + {0, 3}, + }, + levels: [][]int64{ + {3, 1}, + {2}, + }, + }, + { + add: []testFileRec{ + {6, 9}, + }, + levels: [][]int64{ + {3, 1}, + {2}, + {}, + {}, + {}, + {}, + {9}, + }, + }, + { + del: []testFileRec{ + {6, 9}, + }, + levels: [][]int64{ + {3, 1}, + {2}, + }, + }, + } { + rec := &sessionRecord{} + for _, f := range x.add { + ik := mik(uint64(f.num)) + rec.addTable(f.level, f.num, 1, ik, ik) + } + for _, f := range x.del { + rec.delTable(f.level, f.num) + } + vs := v.newStaging() + vs.commit(rec) + v = vs.finish() + if len(v.levels) != len(x.levels) { + t.Fatalf("#%d: invalid level count: want=%d got=%d", i, len(x.levels), len(v.levels)) + } + for j, want := range x.levels { + tables := v.levels[j] + if len(want) != len(tables) { + t.Fatalf("#%d.%d: invalid tables count: want=%d got=%d", i, j, len(want), len(tables)) + } + got := make([]int64, len(tables)) + for k, t := range tables { + got[k] = t.fd.Num + } + if !reflect.DeepEqual(want, got) { + t.Fatalf("#%d.%d: invalid tables: want=%v got=%v", i, j, want, got) + } + } + } +} diff --git a/vendor/github.com/ugorji/go/.travis.yml b/vendor/github.com/ugorji/go/.travis.yml new file mode 100644 index 0000000..05e5934 --- /dev/null +++ b/vendor/github.com/ugorji/go/.travis.yml @@ -0,0 +1,11 @@ +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 + - 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/vendor/github.com/ugorji/go/LICENSE b/vendor/github.com/ugorji/go/LICENSE similarity index 100% rename from _vendor/vendor/github.com/ugorji/go/LICENSE rename to vendor/github.com/ugorji/go/LICENSE diff --git a/vendor/github.com/ugorji/go/README.md b/vendor/github.com/ugorji/go/README.md new file mode 100644 index 0000000..8867438 --- /dev/null +++ b/vendor/github.com/ugorji/go/README.md @@ -0,0 +1,27 @@ +[![Sourcegraph](https://sourcegraph.com/github.com/ugorji/go/-/badge.svg)](https://sourcegraph.com/github.com/ugorji/go/-/blob/codec) +[![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)](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=2)](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) + +# go/codec + +This repository contains the `go-codec` library, +a High Performance and Feature-Rich Idiomatic encode/decode and rpc library for + + - 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 + +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 + diff --git a/_vendor/vendor/github.com/ugorji/go/codec/0doc.go b/vendor/github.com/ugorji/go/codec/0doc.go similarity index 65% rename from _vendor/vendor/github.com/ugorji/go/codec/0doc.go rename to vendor/github.com/ugorji/go/codec/0doc.go index bd7361c..63003b4 100644 --- a/_vendor/vendor/github.com/ugorji/go/codec/0doc.go +++ b/vendor/github.com/ugorji/go/codec/0doc.go @@ -2,8 +2,9 @@ // Use of this source code is governed by a MIT license found in the LICENSE file. /* -High Performance, Feature-Rich Idiomatic Go codec/encoding library for -binc, msgpack, cbor, json. +Package codec provides a +High Performance, Feature-Rich Idiomatic Go 1.4+ codec/encoding library +for binc, msgpack, cbor, json. Supported Serialization formats are: @@ -11,21 +12,17 @@ Supported Serialization formats are: - 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: + - simple: To install: go get github.com/ugorji/go/codec -This package understands the 'unsafe' tag, to allow using unsafe semantics: - - - When decoding into a struct, you need to read the field name as a string - so you can find the struct field it is mapped to. - Using `unsafe` will bypass the allocation and copying overhead of []byte->string conversion. - -To install using unsafe, pass the 'unsafe' tag: - - go get -tags=unsafe 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 . @@ -35,12 +32,17 @@ 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 + - Good code coverage ( > 70% ) - 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 - Multiple conversions: - Package coerces types where appropriate + Package coerces types where appropriate e.g. decode an int in the stream into a float, etc. - - Corner Cases: + - Corner Cases: Overflows, nil maps/slices, nil values in streams are handled correctly - Standard field renaming via tags - Support for omitting empty fields during an encoding @@ -56,7 +58,7 @@ Rich Feature Set includes: - 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 + - 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. @@ -68,12 +70,12 @@ Rich Feature Set includes: - 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. - - Handle unique idiosynchracies of codecs e.g. - - For messagepack, configure how ambiguities in handling raw bytes are resolved - - For messagepack, provide rpc server/client codec to support + - 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 Users can register a function to handle the encoding or decoding of @@ -92,6 +94,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? + - 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 @@ -160,40 +183,38 @@ Sample usage model: //OR rpcCodec := codec.MsgpackSpecRpc.ClientCodec(conn, h) client := rpc.NewClientWithCodec(rpcCodec) +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 embedded non-struct + - unexported 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 - -// Benefits of go-codec: -// -// - encoding/json always reads whole file into memory first. -// This makes it unsuitable for parsing very large files. -// - encoding/xml cannot parse into a map[string]interface{} -// I found this out on reading https://github.com/clbanning/mxj - -// TODO: -// -// - optimization for codecgen: -// if len of entity is <= 3 words, then support a value receiver for encode. -// - (En|De)coder should store an error when it occurs. -// Until reset, subsequent calls return that error that was stored. -// This means that free panics must go away. -// All errors must be raised through errorf method. -// - Decoding using a chan is good, but incurs concurrency costs. -// This is because there's no fast way to use a channel without it -// having to switch goroutines constantly. -// Callback pattern is still the best. Maybe cnsider supporting something like: -// type X struct { -// Name string -// Ys []Y -// Ys chan <- Y -// Ys func(Y) -> call this function for each entry -// } -// - Consider adding a isZeroer interface { isZero() bool } -// It is used within isEmpty, for omitEmpty support. -// - Consider making Handle used AS-IS within the encoding/decoding session. -// This means that we don't cache Handle information within the (En|De)coder, -// except we really need it at Reset(...) -// - Consider adding math/big support -// - Consider reducing the size of the generated functions: -// Maybe use one loop, and put the conditionals in the loop. -// for ... { if cLen > 0 { if j == cLen { break } } else if dd.CheckBreak() { break } } diff --git a/vendor/github.com/ugorji/go/codec/README.md b/vendor/github.com/ugorji/go/codec/README.md new file mode 100644 index 0000000..3d85f89 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/README.md @@ -0,0 +1,201 @@ +# Codec + +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 + - 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. + +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). + +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, 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 + - Multiple conversions: + Package coerces types where appropriate + e.g. decode an int in the stream into a float, etc. + - Corner Cases: + Overflows, nil maps/slices, nil values in streams are handled correctly + - Standard field renaming via tags + - 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) + - Extensions to support efficient encoding/decoding of any named types + - Support encoding.(Binary|Text)(M|Unm)arshaler interfaces + - 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{} + - Encode a struct as an array, and decode struct from an array in the data stream + - 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. + - 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 + +Users can register a function to handle the encoding or decoding of +their custom types. + +There are no restrictions on what the custom type can be. Some examples: + + type BisSet []int + type BitSet64 uint64 + type UUID string + type MyStructWithUnexportedFields struct { a int; b bool; c []int; } + type GifImage struct { ... } + +As an illustration, MyStructWithUnexportedFields would normally be +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? + - 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 +with the standard net/rpc package. + +## Usage + +Typical 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.SetExt(reflect.TypeOf(time.Time{}), 1, myExt) + + // create and use decoder/encoder + var ( + r io.Reader + w io.Writer + b []byte + h = &bh // or mh to use msgpack + ) + + dec = codec.NewDecoder(r, h) + dec = codec.NewDecoderBytes(b, h) + err = dec.Decode(&v) + + enc = codec.NewEncoder(w, h) + enc = codec.NewEncoderBytes(&b, h) + err = enc.Encode(v) + + //RPC Server + go func() { + for { + conn, err := listener.Accept() + rpcCodec := codec.GoRpc.ServerCodec(conn, h) + //OR rpcCodec := codec.MsgpackSpecRpc.ServerCodec(conn, h) + rpc.ServeCodec(rpcCodec) + } + }() + + //RPC Communication (client side) + conn, err = net.Dial("tcp", "localhost:5555") + rpcCodec := codec.GoRpc.ClientCodec(conn, h) + //OR rpcCodec := codec.MsgpackSpecRpc.ClientCodec(conn, h) + client := rpc.NewClientWithCodec(rpcCodec) + +## 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 embedded non-struct + - unexported 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/vendor/github.com/ugorji/go/codec/binc.go b/vendor/github.com/ugorji/go/codec/binc.go similarity index 86% rename from _vendor/vendor/github.com/ugorji/go/codec/binc.go rename to vendor/github.com/ugorji/go/codec/binc.go index 766d26c..e2dcab7 100644 --- a/_vendor/vendor/github.com/ugorji/go/codec/binc.go +++ b/vendor/github.com/ugorji/go/codec/binc.go @@ -61,33 +61,37 @@ type bincEncDriver struct { m map[string]uint16 // symbols b [scratchByteArrayLen]byte s uint16 // symbols sequencer - encNoSeparator + // encNoSeparator + encDriverNoopContainerWriter + noBuiltInTypes } -func (e *bincEncDriver) IsBuiltinType(rt uintptr) bool { - return rt == timeTypId -} - -func (e *bincEncDriver) EncodeBuiltin(rt uintptr, v interface{}) { - if rt == timeTypId { - var bs []byte - switch x := v.(type) { - case time.Time: - bs = encodeTime(x) - case *time.Time: - bs = encodeTime(*x) - default: - e.e.errorf("binc error encoding builtin: expect time.Time, received %T", v) - } - e.w.writen1(bincVdTimestamp<<4 | uint8(len(bs))) - e.w.writeb(bs) - } -} +// 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{}) { +// if rt == timeTypId { +// e.EncodeTime(v.(time.Time)) +// return +// } +// e.e.errorf("binc error encoding builtin: expect time.Time, received %T", v) +// } + +func (e *bincEncDriver) EncodeTime(t time.Time) { + if t.IsZero() { + e.EncodeNil() + } else { + bs := encodeTime(t) + e.w.writen1(bincVdTimestamp<<4 | uint8(len(bs))) + e.w.writeb(bs) + } +} + func (e *bincEncDriver) EncodeBool(b bool) { if b { e.w.writen1(bincVdSpecial<<4 | bincSpTrue) @@ -195,11 +199,11 @@ func (e *bincEncDriver) encodeExtPreamble(xtag byte, length int) { e.w.writen1(xtag) } -func (e *bincEncDriver) EncodeArrayStart(length int) { +func (e *bincEncDriver) WriteArrayStart(length int) { e.encLen(bincVdArray<<4, uint64(length)) } -func (e *bincEncDriver) EncodeMapStart(length int) { +func (e *bincEncDriver) WriteMapStart(length int) { e.encLen(bincVdMap<<4, uint64(length)) } @@ -213,7 +217,7 @@ func (e *bincEncDriver) EncodeString(c charEncoding, v string) { func (e *bincEncDriver) EncodeSymbol(v string) { // if WriteSymbolsNoRefs { - // e.encodeString(c_UTF8, v) + // e.encodeString(cUTF8, v) // return // } @@ -223,10 +227,10 @@ func (e *bincEncDriver) EncodeSymbol(v string) { l := len(v) if l == 0 { - e.encBytesLen(c_UTF8, 0) + e.encBytesLen(cUTF8, 0) return } else if l == 1 { - e.encBytesLen(c_UTF8, 1) + e.encBytesLen(cUTF8, 1) e.w.writen1(v[0]) return } @@ -276,6 +280,10 @@ func (e *bincEncDriver) EncodeSymbol(v string) { } 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 { @@ -285,7 +293,7 @@ func (e *bincEncDriver) EncodeStringBytes(c charEncoding, v []byte) { 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) @@ -332,13 +340,15 @@ type bincDecDriver struct { bd byte vd byte vs byte - noStreamingCodec - decNoSeparator + // noStreamingCodec + // decNoSeparator b [scratchByteArrayLen]byte // linear searching on this slice is ok, // because we typically expect < 32 symbols in each stream. s []bincDecSymbol + decDriverNoopContainerReader + noBuiltInTypes } func (d *bincDecDriver) readNextBd() { @@ -348,7 +358,17 @@ func (d *bincDecDriver) readNextBd() { d.bdRead = true } +func (d *bincDecDriver) uncacheRead() { + if d.bdRead { + d.r.unreadn1() + d.bdRead = false + } +} + 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 { @@ -359,9 +379,10 @@ func (d *bincDecDriver) ContainerType() (vt valueType) { return valueTypeArray } else if d.vd == bincVdMap { return valueTypeMap - } else { - // d.d.errorf("isContainerType: unsupported parameter: %v", vt) } + // else { + // d.d.errorf("isContainerType: unsupported parameter: %v", vt) + // } return valueTypeUnset } @@ -376,29 +397,39 @@ func (d *bincDecDriver) TryDecodeAsNil() bool { return false } -func (d *bincDecDriver) IsBuiltinType(rt uintptr) bool { - return rt == timeTypId -} +// func (d *bincDecDriver) IsBuiltinType(rt uintptr) bool { +// return rt == timeTypId +// } -func (d *bincDecDriver) DecodeBuiltin(rt uintptr, v interface{}) { +func (d *bincDecDriver) DecodeTime() (t time.Time) { if !d.bdRead { d.readNextBd() } - if rt == timeTypId { - if d.vd != bincVdTimestamp { - d.d.errorf("Invalid d.vd. Expecting 0x%x. Received: 0x%x", bincVdTimestamp, d.vd) - return - } - tt, err := decodeTime(d.r.readx(int(d.vs))) - if err != nil { - panic(err) - } - var vt *time.Time = v.(*time.Time) - *vt = tt + if d.bd == bincVdSpecial<<4|bincSpNil { d.bdRead = false + return } + if d.vd != bincVdTimestamp { + d.d.errorf("Invalid d.vd. Expecting 0x%x. Received: 0x%x", bincVdTimestamp, d.vd) + return + } + t, err := decodeTime(d.r.readx(int(d.vs))) + if err != nil { + panic(err) + } + d.bdRead = false + return } +// func (d *bincDecDriver) DecodeBuiltin(rt uintptr, v interface{}) { +// if rt == timeTypId { +// var vt = v.(*time.Time) +// *vt = d.DecodeTime() +// return +// } +// d.d.errorf("binc error decoding builtin: expect *time.Time, received %T", v) +// } + func (d *bincDecDriver) decFloatPre(vs, defaultLen byte) { if vs&0x8 == 0 { d.r.readb(d.b[0:defaultLen]) @@ -502,7 +533,7 @@ func (d *bincDecDriver) DecodeInt(bitsize uint8) (i int64) { i = -i } if chkOvf.Int(i, bitsize) { - d.d.errorf("binc: overflow integer: %v", i) + d.d.errorf("binc: overflow integer: %v for num bits: %v", i, bitsize) return } d.bdRead = false @@ -573,6 +604,9 @@ func (d *bincDecDriver) DecodeBool() (b bool) { } func (d *bincDecDriver) ReadMapStart() (length int) { + if !d.bdRead { + d.readNextBd() + } if d.vd != bincVdMap { d.d.errorf("Invalid d.vd for map. Expecting 0x%x. Got: 0x%x", bincVdMap, d.vd) return @@ -583,6 +617,9 @@ func (d *bincDecDriver) ReadMapStart() (length int) { } func (d *bincDecDriver) ReadArrayStart() (length int) { + if !d.bdRead { + d.readNextBd() + } if d.vd != bincVdArray { d.d.errorf("Invalid d.vd for array. Expecting 0x%x. Got: 0x%x", bincVdArray, d.vd) return @@ -623,7 +660,7 @@ func (d *bincDecDriver) decStringAndBytes(bs []byte, withString, zerocopy bool) d.bdRead = false return } - var slen int = -1 + var slen = -1 // var ok bool switch d.vd { case bincVdString, bincVdByteArray: @@ -632,12 +669,12 @@ func (d *bincDecDriver) decStringAndBytes(bs []byte, withString, zerocopy bool) if d.br { bs2 = d.r.readx(slen) } else if len(bs) == 0 { - bs2 = decByteSlice(d.r, slen, d.b[:]) + bs2 = decByteSlice(d.r, slen, d.d.h.MaxInitLen, d.b[:]) } else { - bs2 = decByteSlice(d.r, slen, bs) + bs2 = decByteSlice(d.r, slen, d.d.h.MaxInitLen, bs) } } else { - bs2 = decByteSlice(d.r, slen, bs) + bs2 = decByteSlice(d.r, slen, d.d.h.MaxInitLen, bs) } if withString { s = string(bs2) @@ -689,7 +726,7 @@ func (d *bincDecDriver) decStringAndBytes(bs []byte, withString, zerocopy bool) // 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, nil) + bs2 = decByteSlice(d.r, slen, d.d.h.MaxInitLen, nil) if withString { s = string(bs2) } @@ -705,18 +742,19 @@ func (d *bincDecDriver) decStringAndBytes(bs []byte, withString, zerocopy bool) } func (d *bincDecDriver) DecodeString() (s string) { - // DecodeBytes does not accomodate symbols, whose impl stores string version in map. + // 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) DecodeBytes(bs []byte, isstring, zerocopy bool) (bsOut []byte) { - if isstring { - bsOut, _ = d.decStringAndBytes(bs, false, zerocopy) - 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() } @@ -724,6 +762,11 @@ func (d *bincDecDriver) DecodeBytes(bs []byte, isstring, zerocopy bool) (bsOut [ 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 if d.vd == bincVdString || d.vd == bincVdByteArray { clen = d.decLen() @@ -740,7 +783,7 @@ func (d *bincDecDriver) DecodeBytes(bs []byte, isstring, zerocopy bool) (bsOut [ bs = d.b[:] } } - return decByteSlice(d.r, clen, bs) + return decByteSlice(d.r, clen, d.d.h.MaxInitLen, bs) } func (d *bincDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) (realxtag uint64) { @@ -773,7 +816,7 @@ func (d *bincDecDriver) decodeExtV(verifyTag bool, tag byte) (xtag byte, xbs []b } xbs = d.r.readx(l) } else if d.vd == bincVdByteArray { - xbs = d.DecodeBytes(nil, false, true) + xbs = d.DecodeBytes(nil, true) } else { d.d.errorf("Invalid d.vd for extensions (Expecting extensions or byte array). Got: 0x%x", d.vd) return @@ -787,7 +830,7 @@ func (d *bincDecDriver) DecodeNaked() { d.readNextBd() } - n := &d.d.n + n := d.d.n var decodeFurther bool switch d.vd { @@ -842,9 +885,9 @@ func (d *bincDecDriver) DecodeNaked() { n.s = d.DecodeString() case bincVdByteArray: n.v = valueTypeBytes - n.l = d.DecodeBytes(nil, false, false) + n.l = d.DecodeBytes(nil, false) case bincVdTimestamp: - n.v = valueTypeTimestamp + n.v = valueTypeTime tt, err := decodeTime(d.r.readx(int(d.vs))) if err != nil { panic(err) @@ -892,8 +935,10 @@ func (d *bincDecDriver) DecodeNaked() { type BincHandle struct { BasicHandle binaryEncodingType + noElemSeparators } +// SetBytesExt sets an extension func (h *BincHandle) SetBytesExt(rt reflect.Type, tag uint64, ext BytesExt) (err error) { return h.SetExt(rt, tag, &setExtWrapper{b: ext}) } @@ -903,9 +948,15 @@ func (h *BincHandle) newEncDriver(e *Encoder) encDriver { } func (h *BincHandle) newDecDriver(d *Decoder) decDriver { - return &bincDecDriver{d: d, r: d.r, h: h, br: d.bytes} + return &bincDecDriver{d: d, h: h, r: d.r, br: d.bytes} } +// // IsBuiltinType returns true for time.Time, else false. +// // only time.Time is builtin. +// func (h *BincHandle) IsBuiltinType(rt uintptr) bool { +// return rt == timeTypId +// } + func (e *bincEncDriver) reset() { e.w = e.e.w e.s = 0 @@ -913,7 +964,7 @@ func (e *bincEncDriver) reset() { } func (d *bincDecDriver) reset() { - d.r = d.d.r + 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 } diff --git a/_vendor/vendor/github.com/ugorji/go/codec/cbor.go b/vendor/github.com/ugorji/go/codec/cbor.go similarity index 71% rename from _vendor/vendor/github.com/ugorji/go/codec/cbor.go rename to vendor/github.com/ugorji/go/codec/cbor.go index a224cd3..b100d2c 100644 --- a/_vendor/vendor/github.com/ugorji/go/codec/cbor.go +++ b/vendor/github.com/ugorji/go/codec/cbor.go @@ -6,6 +6,7 @@ package codec import ( "math" "reflect" + "time" ) const ( @@ -38,6 +39,8 @@ const ( cborBdBreak = 0xff ) +// These define some in-stream descriptors for +// manual encoding e.g. when doing explicit indefinite-length const ( CborStreamBytes byte = 0x5f CborStreamString = 0x7f @@ -61,7 +64,8 @@ const ( type cborEncDriver struct { noBuiltInTypes - encNoSeparator + encDriverNoopContainerWriter + // encNoSeparator e *Encoder w encWriter h *CborHandle @@ -123,6 +127,24 @@ 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.EncodeString(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 { @@ -134,39 +156,91 @@ func (e *cborEncDriver) EncodeExt(rv interface{}, xtag uint64, ext Ext, en *Enco func (e *cborEncDriver) EncodeRawExt(re *RawExt, en *Encoder) { e.encUint(uint64(re.Tag), cborBaseTag) - if re.Data != nil { + if false && re.Data != nil { en.encode(re.Data) - } else if re.Value == nil { - e.EncodeNil() - } else { + } else if re.Value != nil { en.encode(re.Value) + } else { + e.EncodeNil() } } -func (e *cborEncDriver) EncodeArrayStart(length int) { - e.encLen(cborBaseArray, length) +func (e *cborEncDriver) WriteArrayStart(length int) { + if e.h.IndefiniteLength { + e.w.writen1(cborBdIndefiniteArray) + } else { + e.encLen(cborBaseArray, length) + } } -func (e *cborEncDriver) EncodeMapStart(length int) { - e.encLen(cborBaseMap, length) +func (e *cborEncDriver) WriteMapStart(length int) { + if e.h.IndefiniteLength { + e.w.writen1(cborBdIndefiniteMap) + } else { + e.encLen(cborBaseMap, length) + } } -func (e *cborEncDriver) EncodeString(c charEncoding, v string) { - e.encLen(cborBaseString, len(v)) - e.w.writestr(v) +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) EncodeSymbol(v string) { - e.EncodeString(c_UTF8, v) + e.encStringBytesS(cborBaseString, v) +} + +func (e *cborEncDriver) EncodeString(c charEncoding, v string) { + e.encStringBytesS(cborBaseString, v) } func (e *cborEncDriver) EncodeStringBytes(c charEncoding, v []byte) { - if c == c_RAW { - e.encLen(cborBaseBytes, len(v)) + if v == nil { + e.EncodeNil() + } else if c == cRAW { + e.encStringBytesS(cborBaseBytes, stringView(v)) } else { - e.encLen(cborBaseString, len(v)) + e.encStringBytesS(cborBaseString, 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) + } + blen := len(v) / 4 + if blen == 0 { + blen = 64 + } else if blen > 1024 { + blen = 1024 + } + for i := 0; i < len(v); { + var v2 string + i2 := i + blen + if i2 < len(v) { + 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) } - e.w.writeb(v) } // ---------------------- @@ -180,7 +254,8 @@ type cborDecDriver struct { bdRead bool bd byte noBuiltInTypes - decNoSeparator + // decNoSeparator + decDriverNoopContainerReader } func (d *cborDecDriver) readNextBd() { @@ -188,7 +263,17 @@ func (d *cborDecDriver) readNextBd() { 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) { @@ -199,9 +284,10 @@ func (d *cborDecDriver) ContainerType() (vt valueType) { return valueTypeArray } else if d.bd == cborBdIndefiniteMap || (d.bd >= cborBaseMap && d.bd < cborBaseTag) { return valueTypeMap - } else { - // d.d.errorf("isContainerType: unsupported parameter: %v", vt) } + // else { + // d.d.errorf("isContainerType: unsupported parameter: %v", vt) + // } return valueTypeUnset } @@ -344,6 +430,9 @@ func (d *cborDecDriver) DecodeBool() (b bool) { } func (d *cborDecDriver) ReadMapStart() (length int) { + if !d.bdRead { + d.readNextBd() + } d.bdRead = false if d.bd == cborBdIndefiniteMap { return -1 @@ -352,6 +441,9 @@ func (d *cborDecDriver) ReadMapStart() (length int) { } func (d *cborDecDriver) ReadArrayStart() (length int) { + if !d.bdRead { + d.readNextBd() + } d.bdRead = false if d.bd == cborBdIndefiniteArray { return -1 @@ -391,7 +483,7 @@ func (d *cborDecDriver) decAppendIndefiniteBytes(bs []byte) []byte { return bs } -func (d *cborDecDriver) DecodeBytes(bs []byte, isstring, zerocopy bool) (bsOut []byte) { +func (d *cborDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) { if !d.bdRead { d.readNextBd() } @@ -400,11 +492,17 @@ func (d *cborDecDriver) DecodeBytes(bs []byte, isstring, zerocopy bool) (bsOut [ return nil } if d.bd == cborBdIndefiniteBytes || d.bd == cborBdIndefiniteString { + d.bdRead = false if bs == nil { - return d.decAppendIndefiniteBytes(nil) + 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 { @@ -414,11 +512,60 @@ func (d *cborDecDriver) DecodeBytes(bs []byte, isstring, zerocopy bool) (bsOut [ bs = d.b[:] } } - return decByteSlice(d.r, clen, bs) + return decByteSlice(d.r, clen, d.d.h.MaxInitLen, bs) } func (d *cborDecDriver) DecodeString() (s string) { - return string(d.DecodeBytes(d.b[:], true, true)) + return string(d.DecodeBytes(d.b[:], true)) +} + +func (d *cborDecDriver) DecodeStringAsBytes() (s []byte) { + return d.DecodeBytes(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.error(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.DecodeFloat(true)) + t = time.Unix(int64(f1), int64(f2*1e9)) + case d.bd == cborBdFloat64: + f1, f2 := math.Modf(d.DecodeFloat(false)) + 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.DecodeInt(64), 0) + default: + d.d.errorf("cbor: time.Time can only be decoded from a number (or RFC3339 string)") + } + default: + d.d.errorf("cbor: 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) { @@ -449,7 +596,7 @@ func (d *cborDecDriver) DecodeNaked() { d.readNextBd() } - n := &d.d.n + n := d.d.n var decodeFurther bool switch d.bd { @@ -469,7 +616,7 @@ func (d *cborDecDriver) DecodeNaked() { n.f = d.DecodeFloat(false) case cborBdIndefiniteBytes: n.v = valueTypeBytes - n.l = d.DecodeBytes(nil, false, false) + n.l = d.DecodeBytes(nil, false) case cborBdIndefiniteString: n.v = valueTypeString n.s = d.DecodeString() @@ -494,7 +641,7 @@ func (d *cborDecDriver) DecodeNaked() { n.i = d.DecodeInt(64) case d.bd >= cborBaseBytes && d.bd < cborBaseString: n.v = valueTypeBytes - n.l = d.DecodeBytes(nil, false, false) + n.l = d.DecodeBytes(nil, false) case d.bd >= cborBaseString && d.bd < cborBaseArray: n.v = valueTypeString n.s = d.DecodeString() @@ -508,6 +655,11 @@ func (d *cborDecDriver) DecodeNaked() { 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 @@ -538,28 +690,22 @@ func (d *cborDecDriver) DecodeNaked() { // // 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. -// -// To encode with indefinite lengths (streaming), users will use -// (Must)Encode methods of *Encoder, along with writing CborStreamXXX constants. -// -// For example, to encode "one-byte" as an indefinite length string: -// var buf bytes.Buffer -// e := NewEncoder(&buf, new(CborHandle)) -// buf.WriteByte(CborStreamString) -// e.MustEncode("one-") -// e.MustEncode("byte") -// buf.WriteByte(CborStreamBreak) -// encodedBytes := buf.Bytes() -// var vv interface{} -// NewDecoderBytes(buf.Bytes(), new(CborHandle)).MustDecode(&vv) -// // Now, vv contains the same string "one-byte" -// +// - 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 } +// SetInterfaceExt sets an extension func (h *CborHandle) SetInterfaceExt(rt reflect.Type, tag uint64, ext InterfaceExt) (err error) { return h.SetExt(rt, tag, &setExtWrapper{i: ext}) } @@ -569,7 +715,7 @@ func (h *CborHandle) newEncDriver(e *Encoder) encDriver { } func (h *CborHandle) newDecDriver(d *Decoder) decDriver { - return &cborDecDriver{d: d, r: d.r, h: h, br: d.bytes} + return &cborDecDriver{d: d, h: h, r: d.r, br: d.bytes} } func (e *cborEncDriver) reset() { @@ -577,7 +723,7 @@ func (e *cborEncDriver) reset() { } func (d *cborDecDriver) reset() { - d.r = d.d.r + d.r, d.br = d.d.r, d.d.bytes d.bd, d.bdRead = 0, false } 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 0000000..af94027 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/cbor_test.go @@ -0,0 +1,230 @@ +// 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 + +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, 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 0000000..a1056eb --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/codec_test.go @@ -0,0 +1,2907 @@ +// 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 + +import ( + "bufio" + "bytes" + "encoding/gob" + "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 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 value + return v2.UTC().UnixNano() + // return x.ts + // switch v2 := v.(type) { + // case time.Time: + // x.ts = v2.UTC().UnixNano() + // case *time.Time: + // x.ts = v2.UTC().UnixNano() + // default: + // panic(fmt.Sprintf("unsupported format for time conversion: expecting time.Time; got %T", v)) + // } + // return &x.ts +} + +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)) +} + +// ---- + +type timeExt struct{} + +func (x timeExt) WriteExt(v interface{}) (bs []byte) { + switch v2 := v.(type) { + case time.Time: + bs = encodeTime(v2) + case *time.Time: + bs = encodeTime(*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 := decodeTime(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, h.getBasicHandle()) +} + +func testCodecDecode(bs []byte, ts interface{}, h Handle) (err error) { + return sTestCodecDecode(bs, ts, h, h.getBasicHandle()) +} + +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 := v.getBasicHandle() + // pre-fill them first + bh.EncodeOptions = testEncodeOptions + bh.DecodeOptions = testDecodeOptions + // bh.InterfaceReset = true // TODO: remove + // bh.PreferArrayOverSlice = true // TODO: remove + // modify from flag'ish things + bh.InternString = testInternStr + bh.Canonical = testCanonical + bh.CheckCircularRef = testCheckCircRef + bh.StructToArray = testStructToArray + bh.MaxInitLen = testMaxInitLen + } + + testMsgpackH.RawToString = 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(&err) + bs = x.WriteExt(rv.Interface()) + return + } + myExtDecFn = func(x BytesExt, rv reflect.Value, bs []byte) (err error) { + defer panicToErr(&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, oldRawToString bool + _, _ = oldWriteExt, oldRawToString + oldWriteExt, v.WriteExt = v.WriteExt, true + oldRawToString, v.RawToString = v.RawToString, true + // defer func() { v.WriteExt, v.RawToString = oldWriteExt, oldRawToString }() + doTestCodecTableOne(t, false, h, table, tableVerify) + v.WriteExt = oldWriteExt + v.RawToString = oldRawToString + 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 := h.getBasicHandle() + + 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 := new(TestStrucFlex) + 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") + // 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 + 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 { + 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 := h.getBasicHandle() + 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 := h.getBasicHandle() + 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 := h.getBasicHandle().getTypeInfo(rtid, rt) + logT(t, "pti: %v", pti) +} + +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 := h.getBasicHandle() + 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 := h.getBasicHandle() + + 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() != 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 := h.getBasicHandle() + // 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 := h.getBasicHandle() + 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, handle Handle) { + testOnce.Do(testInitAll) + type Struct struct { + Field map[uint16]map[uint32]struct{} + } + + bh := handle.getBasicHandle() + 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 := handle.(*JsonHandle) + + toEncode := Struct{Field: map[uint16]map[uint32]struct{}{ + 1: nil, + }} + + bs, err := testMarshal(toEncode, handle) + 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, handle) + 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 := h.getBasicHandle() + 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, + math.MaxInt64, math.MaxInt64 - 4, + + math.MaxUint8, math.MaxUint8 + 4, math.MaxUint8 - 4, + math.MaxUint16, math.MaxUint16 + 4, math.MaxUint16 - 4, + math.MaxUint32, math.MaxUint32 + 4, math.MaxUint32 - 4, + } { + 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, "-") + + // TODO: skip rest if 32-bit + + // 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 + + bh := h.getBasicHandle() + oldAsSymbols := bh.AsSymbols + defer func() { bh.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 + + bh.AsSymbols = AsSymbolNone + 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") + + // now, do as symbols + bh.AsSymbols = AsSymbolAll + 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: + v.SetString(strings.Repeat(strconv.FormatInt(rand.Int63n(99), 10), rand.Intn(8))) + 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 := h.getBasicHandle() + 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 := h.getBasicHandle() + 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 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{r: r, buf: make([]byte, 0, 13)} + b, err := ioutil.ReadAll(br) + 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{r: strings.NewReader(s), buf: make([]byte, 0, 7)} + // 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{r: strings.NewReader(s), buf: make([]byte, 0, 7)} + // 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.UnreadByte() + } + br = &bufioDecReader{r: strings.NewReader(s), buf: make([]byte, 0, 7)} + // 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.UnreadByte() + } + // println() +} + +// ----------- + +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 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) +} + +// ----- 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, old2 := testMsgpackH.RawToString, testMsgpackH.WriteExt + defer func() { testMsgpackH.RawToString, testMsgpackH.WriteExt = old1, old2 }() + testMsgpackH.RawToString = true + 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) +} + +// TODO: +// +// Add Tests for: +// - 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 +// +// 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{}, +// +// encode.go (standalone) +// - nil and 0-len slices and maps for non-fastpath things diff --git a/vendor/github.com/ugorji/go/codec/decode.go b/vendor/github.com/ugorji/go/codec/decode.go new file mode 100644 index 0000000..e9ea930 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/decode.go @@ -0,0 +1,2435 @@ +// 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 + +import ( + "encoding" + "errors" + "fmt" + "io" + "reflect" + "sync" + "time" +) + +// Some tagging information for error messages. +const ( + msgBadDesc = "Unrecognized descriptor byte" + msgDecCannotExpandArr = "cannot expand go array from %v to stream length: %v" +) + +var ( + errOnlyMapOrArrayCanDecodeIntoStruct = errors.New("only encoded map or array can be decoded into a struct") + errCannotDecodeIntoNil = errors.New("cannot decode into nil") + + 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") +) + +// decReader abstracts the reading source, allowing implementations that can +// read from an io.Reader or directly off a byte slice with zero-copying. +type decReader interface { + 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 + numread() int // 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 { + // this will check if the next token is a break. + CheckBreak() bool + // 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 + // vt is one of: Bytes, String, Nil, Slice or Map. Return unSet if not known. + ContainerType() (vt valueType) + // IsBuiltinType(rt uintptr) bool + + // Deprecated: left here for now so that old codecgen'ed filed will work. TODO: remove. + DecodeBuiltin(rt uintptr, v interface{}) + + // 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() + DecodeInt(bitsize uint8) (i int64) + DecodeUint(bitsize uint8) (ui uint64) + DecodeFloat(chkOverflow32 bool) (f float64) + DecodeBool() (b bool) + DecodeTime() (t time.Time) + // 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) + ReadArrayStart() int + ReadArrayElem() + ReadArrayEnd() + ReadMapStart() int + ReadMapElemKey() + ReadMapElemValue() + ReadMapEnd() + + reset() + uncacheRead() +} + +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 { + // MapType specifies type to use during schema-less decoding of a map in the stream. + // If nil (unset), we default to map[string]interface{} for json and + // map[interface{}]interface{} for all other formats. + MapType reflect.Type + + // 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 + + // 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 length, to prevent Out-Of-Memory crash. + // Instead, we provision up to MaxInitLen, fill that up, and start appending after that. + MaxInitLen int + + // If ErrorIfNoField, return an error when decoding a map + // from a codec stream into a struct, and no matching struct field is found. + ErrorIfNoField bool + + // 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 + + // ReaderBufferSize is the size of the buffer used when reading. + // + // if > 0, we use a smart buffer internally for performance purposes. + ReaderBufferSize int +} + +// ------------------------------------ + +type bufioDecReader struct { + buf []byte + r io.Reader + + c int // cursor + n int // num read + err error + + trb bool + tr []byte + + b [8]byte +} + +func (z *bufioDecReader) reset(r io.Reader) { + z.r, z.c, z.n, z.err, z.trb = r, 0, 0, nil, false + if z.tr != nil { + z.tr = z.tr[:0] + } +} + +func (z *bufioDecReader) Read(p []byte) (n int, err error) { + if z.err != nil { + return 0, z.err + } + p0 := p + n = copy(p, z.buf[z.c:]) + z.c += n + if z.c == len(z.buf) { + z.c = 0 + } + z.n += n + if len(p) == n { + 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]...) + } + return + } + p = p[n:] + var n2 int + // if we are here, then z.buf is all read + if len(p) > len(z.buf) { + n2, err = decReadFull(z.r, p) + n += n2 + z.n += n2 + z.err = err + // don't return EOF if some bytes were read. keep for next time. + if n > 0 && err == io.EOF { + err = nil + } + // 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 + } + // z.c is now 0, and len(p) <= len(z.buf) + for len(p) > 0 && z.err == nil { + // println("len(p) loop starting ... ") + z.c = 0 + z.buf = z.buf[0:cap(z.buf)] + n2, err = z.r.Read(z.buf) + if n2 > 0 { + if err == io.EOF { + err = nil + } + z.buf = z.buf[:n2] + n2 = copy(p, z.buf) + z.c = n2 + n += n2 + z.n += n2 + p = p[n2:] + } + z.err = err + // println("... len(p) loop done") + } + 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]...) + } + return +} + +func (z *bufioDecReader) ReadByte() (b byte, err error) { + z.b[0] = 0 + _, err = z.Read(z.b[:1]) + b = z.b[0] + return +} + +func (z *bufioDecReader) UnreadByte() (err error) { + if z.err != nil { + return z.err + } + if z.c > 0 { + z.c-- + z.n-- + if z.trb { + z.tr = z.tr[:len(z.tr)-1] + } + return + } + return errDecUnreadByteNothingToRead +} + +func (z *bufioDecReader) numread() int { + return z.n +} + +func (z *bufioDecReader) readx(n int) (bs []byte) { + if n <= 0 || z.err != nil { + return + } + if z.c+n <= 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...) + } + return + } + bs = make([]byte, n) + _, err := z.Read(bs) + if err != nil { + panic(err) + } + return +} + +func (z *bufioDecReader) readb(bs []byte) { + _, err := z.Read(bs) + if err != nil { + panic(err) + } +} + +// func (z *bufioDecReader) readn1eof() (b uint8, eof bool) { +// b, err := z.ReadByte() +// if err != nil { +// if err == io.EOF { +// eof = true +// } else { +// panic(err) +// } +// } +// return +// } + +func (z *bufioDecReader) readn1() (b uint8) { + b, err := z.ReadByte() + if err != nil { + panic(err) + } + return +} + +func (z *bufioDecReader) search(in []byte, accept *bitset256, stop, flag uint8) (token byte, out []byte) { + // flag: 1 (skip), 2 (readTo), 4 (readUntil) + if flag == 4 { + for i := z.c; i < len(z.buf); i++ { + if z.buf[i] == stop { + token = z.buf[i] + z.n = z.n + (i - z.c) - 1 + i++ + out = z.buf[z.c:i] + if z.trb { + z.tr = append(z.tr, z.buf[z.c:i]...) + } + z.c = i + return + } + } + } else { + for i := z.c; i < len(z.buf); i++ { + if !accept.isset(z.buf[i]) { + token = z.buf[i] + z.n = z.n + (i - z.c) - 1 + if flag == 1 { + i++ + } else { + out = z.buf[z.c:i] + } + if z.trb { + z.tr = append(z.tr, z.buf[z.c:i]...) + } + z.c = i + return + } + } + } + z.n += len(z.buf) - z.c + if flag != 1 { + out = append(in, z.buf[z.c:]...) + } + if z.trb { + z.tr = append(z.tr, z.buf[z.c:]...) + } + var n2 int + if z.err != nil { + return + } + for { + z.c = 0 + z.buf = z.buf[0:cap(z.buf)] + n2, z.err = z.r.Read(z.buf) + if n2 > 0 && z.err != nil { + z.err = nil + } + z.buf = z.buf[:n2] + if flag == 4 { + for i := 0; i < n2; i++ { + if z.buf[i] == stop { + token = z.buf[i] + z.n += i - 1 + i++ + out = append(out, z.buf[z.c:i]...) + if z.trb { + z.tr = append(z.tr, z.buf[z.c:i]...) + } + z.c = i + return + } + } + } else { + for i := 0; i < n2; i++ { + if !accept.isset(z.buf[i]) { + token = z.buf[i] + z.n += i - 1 + if flag == 1 { + i++ + } + if flag != 1 { + out = append(out, z.buf[z.c:i]...) + } + if z.trb { + z.tr = append(z.tr, z.buf[z.c:i]...) + } + z.c = i + return + } + } + } + if flag != 1 { + out = append(out, z.buf[:n2]...) + } + z.n += n2 + if z.err != nil { + return + } + if z.trb { + z.tr = append(z.tr, z.buf[:n2]...) + } + } +} + +func (z *bufioDecReader) skip(accept *bitset256) (token byte) { + token, _ = z.search(nil, accept, 0, 1) + return +} + +func (z *bufioDecReader) readTo(in []byte, accept *bitset256) (out []byte) { + _, out = z.search(in, accept, 0, 2) + return +} + +func (z *bufioDecReader) readUntil(in []byte, stop byte) (out []byte) { + _, out = z.search(in, nil, stop, 4) + return +} + +func (z *bufioDecReader) unreadn1() { + err := z.UnreadByte() + if err != nil { + panic(err) + } +} + +func (z *bufioDecReader) track() { + if z.tr != nil { + z.tr = z.tr[:0] + } + z.trb = true +} + +func (z *bufioDecReader) 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 // the reader passed in + + rr io.Reader + br io.ByteScanner + + l byte // last byte + ls byte // last byte status. 0: init-canDoNothing, 1: canRead, 2: canUnread + b [4]byte // tiny buffer for reading single bytes + trb bool // tracking bytes turned on + + // temp byte array re-used internally for efficiency during read. + // shares buffer with Decoder, so we keep size of struct within 8 words. + x *[scratchByteArrayLen]byte + n int // num read + tr []byte // tracking bytes read +} + +func (z *ioDecReader) reset(r io.Reader) { + z.r = r + z.rr = r + z.l, z.ls, z.n, z.trb = 0, 0, 0, false + if z.tr != nil { + z.tr = z.tr[:0] + } + var ok bool + if z.br, ok = r.(io.ByteScanner); !ok { + z.br = z + z.rr = z + } +} + +func (z *ioDecReader) Read(p []byte) (n int, err error) { + if len(p) == 0 { + return + } + var firstByte bool + if z.ls == 1 { + z.ls = 2 + 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 = 2 + } + 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 2: + z.ls = 1 + case 0: + err = errDecUnreadByteNothingToRead + case 1: + err = errDecUnreadByteLastByteNotRead + default: + err = errDecUnreadByteUnknown + } + return +} + +func (z *ioDecReader) numread() int { + return z.n +} + +func (z *ioDecReader) readx(n int) (bs []byte) { + if n <= 0 { + return + } + if n < len(z.x) { + bs = z.x[:n] + } else { + bs = make([]byte, n) + } + if _, err := decReadFull(z.rr, bs); err != nil { + panic(err) + } + z.n += len(bs) + if z.trb { + z.tr = append(z.tr, bs...) + } + return +} + +func (z *ioDecReader) readb(bs []byte) { + // if len(bs) == 0 { + // return + // } + if _, err := decReadFull(z.rr, bs); err != nil { + panic(err) + } + z.n += len(bs) + if z.trb { + z.tr = append(z.tr, bs...) + } +} + +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) + } + } else if err == io.EOF { + eof = true + } else { + panic(err) + } + return +} + +func (z *ioDecReader) readn1() (b uint8) { + var err error + if b, err = z.br.ReadByte(); err == nil { + z.n++ + if z.trb { + z.tr = append(z.tr, b) + } + return + } + panic(err) +} + +func (z *ioDecReader) skip(accept *bitset256) (token byte) { + for { + var eof bool + token, eof = z.readn1eof() + if eof { + return + } + if accept.isset(token) { + continue + } + return + } +} + +func (z *ioDecReader) readTo(in []byte, accept *bitset256) (out []byte) { + out = in + for { + token, eof := z.readn1eof() + if eof { + return + } + if accept.isset(token) { + out = append(out, token) + } else { + z.unreadn1() + return + } + } +} + +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 + } + } +} + +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] + } + } +} + +func (z *ioDecReader) track() { + if z.tr != nil { + z.tr = z.tr[:0] + } + z.trb = true +} + +func (z *ioDecReader) stopTrack() (bs []byte) { + z.trb = false + return z.tr +} + +// ------------------------------------ + +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 int // cursor + a int // available + t int // track start +} + +func (z *bytesDecReader) reset(in []byte) { + z.b = in + z.a = len(in) + z.c = 0 + z.t = 0 +} + +func (z *bytesDecReader) numread() int { + return z.c +} + +func (z *bytesDecReader) unreadn1() { + if z.c == 0 || len(z.b) == 0 { + panic(errBytesDecReaderCannotUnread) + } + z.c-- + z.a++ + return +} + +func (z *bytesDecReader) readx(n int) (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 +} + +func (z *bytesDecReader) readb(bs []byte) { + copy(bs, z.readx(len(bs))) +} + +func (z *bytesDecReader) readn1() (v uint8) { + if z.a == 0 { + panic(io.EOF) + } + v = z.b[z.c] + z.c++ + z.a-- + return +} + +// 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) { + if z.a == 0 { + return + } + blen := len(z.b) + 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 + } + } + z.a, z.c = 0, blen + return +} + +func (z *bytesDecReader) readTo(_ []byte, accept *bitset256) (out []byte) { + if z.a == 0 { + return + } + blen := len(z.b) + 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 +} + +func (z *bytesDecReader) readUntil(_ []byte, stop byte) (out []byte) { + if z.a == 0 { + panic(io.EOF) + } + blen := len(z.b) + 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 + } + } + z.a, z.c = 0, blen + panic(io.EOF) +} + +func (z *bytesDecReader) track() { + z.t = z.c +} + +func (z *bytesDecReader) stopTrack() (bs []byte) { + return z.b[z.t:z.c] +} + +// ---------------------------------------- + +// func (d *Decoder) builtin(f *codecFnInfo, rv reflect.Value) { +// d.d.DecodeBuiltin(f.ti.rtid, rv2i(rv)) +// } + +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 decode it appropriately + // based on the detected next value in the stream. + n := d.naked() + d.d.DecodeNaked() + if n.v == valueTypeNil { + return + } + // We cannot decode non-nil stream value into nil interface with methods (e.g. io.Reader). + // if num := f.ti.rt.NumMethod(); num > 0 { + 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 useRvn bool + switch n.v { + case valueTypeMap: + // if json, default to a map type with string keys + mtid := d.mtid + if mtid == 0 { + if d.js { + mtid = mapStrIntfTypId + } else { + mtid = mapIntfIntfTypId + } + } + if mtid == mapIntfIntfTypId { + if n.lm < arrayCacheLen { + n.ma[n.lm] = nil + rvn = n.rr[decNakedMapIntfIntfIdx*arrayCacheLen+n.lm] + n.lm++ + d.decode(&n.ma[n.lm-1]) + n.lm-- + } else { + var v2 map[interface{}]interface{} + d.decode(&v2) + rvn = reflect.ValueOf(&v2).Elem() + } + } else if mtid == mapStrIntfTypId { // for json performance + if n.ln < arrayCacheLen { + n.na[n.ln] = nil + rvn = n.rr[decNakedMapStrIntfIdx*arrayCacheLen+n.ln] + n.ln++ + d.decode(&n.na[n.ln-1]) + n.ln-- + } else { + var v2 map[string]interface{} + d.decode(&v2) + rvn = reflect.ValueOf(&v2).Elem() + } + } else { + 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 d.stid == 0 || d.stid == intfSliceTypId { + if n.ls < arrayCacheLen { + n.sa[n.ls] = nil + rvn = n.rr[decNakedSliceIntfIdx*arrayCacheLen+n.ls] + n.ls++ + d.decode(&n.sa[n.ls-1]) + n.ls-- + } else { + 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 { + 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: + var v interface{} + tag, bytes := n.u, n.l // calling decode below might taint the values + if bytes == nil { + if n.li < arrayCacheLen { + n.ia[n.li] = nil + n.li++ + d.decode(&n.ia[n.li-1]) + // v = *(&n.ia[l]) + n.li-- + v = n.ia[n.li] + n.ia[n.li] = nil + } else { + d.decode(&v) + } + } + bfn := d.h.getExtForTag(tag) + if bfn == nil { + 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() + } + case valueTypeNil: + // no-op + case valueTypeInt: + rvn = n.rr[decNakedIntIdx] // d.np.get(&n.i) + case valueTypeUint: + rvn = n.rr[decNakedUintIdx] // d.np.get(&n.u) + case valueTypeFloat: + rvn = n.rr[decNakedFloatIdx] // d.np.get(&n.f) + case valueTypeBool: + rvn = n.rr[decNakedBoolIdx] // d.np.get(&n.b) + case valueTypeString, valueTypeSymbol: + rvn = n.rr[decNakedStringIdx] // d.np.get(&n.s) + case valueTypeBytes: + rvn = n.rr[decNakedBytesIdx] // d.np.get(&n.l) + case valueTypeTime: + rvn = n.rr[decNakedTimeIdx] // d.np.get(&n.t) + default: + panic(fmt.Errorf("kInterfaceNaked: unexpected valueType: %d", n.v)) + } + 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() { + if rvn = d.kInterfaceNaked(f); rvn.IsValid() { + rv.Set(rvn) + } + return + } + if d.h.InterfaceReset { + if rvn = d.kInterfaceNaked(f); rvn.IsValid() { + rv.Set(rvn) + } else { + // reset to zero value based on current type in there. + rv.Set(reflect.Zero(rv.Elem().Type())) + } + return + } + + // now we have a non-nil interface value, meaning it contains a type + rvn = rv.Elem() + 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 (d *Decoder) kStruct(f *codecFnInfo, rv reflect.Value) { + fti := f.ti + dd := d.d + elemsep := d.hh.hasElemSeparators() + sfn := structFieldNode{v: rv, update: true} + ctyp := dd.ContainerType() + if ctyp == valueTypeMap { + containerLen := dd.ReadMapStart() + if containerLen == 0 { + dd.ReadMapEnd() + return + } + tisfi := fti.sfi + hasLen := containerLen >= 0 + + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + // rvkencname := dd.DecodeString() + if elemsep { + dd.ReadMapElemKey() + } + rvkencnameB := dd.DecodeStringAsBytes() + rvkencname := stringView(rvkencnameB) + // rvksi := ti.getForEncName(rvkencname) + if elemsep { + dd.ReadMapElemValue() + } + if k := fti.indexForEncName(rvkencname); k > -1 { + si := tisfi[k] + if dd.TryDecodeAsNil() { + si.setToZeroValue(rv) + } else { + d.decodeValue(sfn.field(si), nil, true) + } + } else { + d.structFieldNotFound(-1, rvkencname) + } + // keepAlive4StringView(rvkencnameB) // maintain ref 4 stringView // not needed, as reference is outside loop + } + dd.ReadMapEnd() + } else if ctyp == valueTypeArray { + containerLen := dd.ReadArrayStart() + if containerLen == 0 { + dd.ReadArrayEnd() + return + } + // Not much gain from doing it two ways for array. + // Arrays are not used as much for structs. + hasLen := containerLen >= 0 + for j, si := range fti.sfip { + if (hasLen && j == containerLen) || (!hasLen && dd.CheckBreak()) { + break + } + if elemsep { + dd.ReadArrayElem() + } + if dd.TryDecodeAsNil() { + si.setToZeroValue(rv) + } else { + d.decodeValue(sfn.field(si), nil, true) + } + } + if containerLen > len(fti.sfip) { + // read remaining values and throw away + for j := len(fti.sfip); j < containerLen; j++ { + if elemsep { + dd.ReadArrayElem() + } + d.structFieldNotFound(j, "") + } + } + dd.ReadArrayEnd() + } else { + d.error(errOnlyMapOrArrayCanDecodeIntoStruct) + return + } +} + +func (d *Decoder) kSlice(f *codecFnInfo, rv reflect.Value) { + // A slice can be set from a map or array in stream. + // This way, the order can be kept (as order is lost with map). + ti := f.ti + if f.seq == seqTypeChan && ti.rt.ChanDir()&reflect.SendDir == 0 { + d.errorf("receive-only channel cannot be used for sending byte(s)") + } + dd := d.d + rtelem0 := ti.rt.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 or string in the stream must be decoded into a slice or 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 + } + + // 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)) + } + } + } + slh.End() + return + } + + 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") + // } + } + } + + // 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 { + rvlen = 8 + } + 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.cf.get(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)) // uses append logic, plus varargs + var rvcap2 int + rv9, rvcap2, rvChanged = d.expandSliceRV(rv, ti.rt, rvCanset, rtelem0Size, 1, rvlen, rvcap) + 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 + } + + if fn == nil { + fn = d.cf.get(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) + } +} + +// 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.hh.hasElemSeparators() + ti := f.ti + if rv.IsNil() { + rv.Set(makeMapReflect(ti.rt, containerLen)) + } + + if containerLen == 0 { + dd.ReadMapEnd() + return + } + + ktype, vtype := ti.rt.Key(), ti.rt.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 { + 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.cf.get(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.cf.get(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() +} + +// 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. + u uint64 + i int64 + f float64 + l []byte + s string + t time.Time + + b bool + + inited bool + + v valueType + + li, lm, ln, ls int8 + + // array/stacks for reducing allocation + // keep arrays at the bottom? Chance is that they are not used much. + ia [arrayCacheLen]interface{} + ma [arrayCacheLen]map[interface{}]interface{} + na [arrayCacheLen]map[string]interface{} + sa [arrayCacheLen][]interface{} + // ra [2]RawExt + + rr [5 * arrayCacheLen]reflect.Value +} + +const ( + decNakedUintIdx = iota + decNakedIntIdx + decNakedFloatIdx + decNakedBytesIdx + decNakedStringIdx + decNakedTimeIdx + decNakedBoolIdx +) +const ( + _ = iota // maps to the scalars above + decNakedIntfIdx + decNakedMapIntfIntfIdx + decNakedMapStrIntfIdx + decNakedSliceIntfIdx +) + +func (n *decNaked) init() { + if n.inited { + return + } + // n.ms = n.ma[:0] + // n.is = n.ia[:0] + // n.ns = n.na[:0] + // n.ss = n.sa[:0] + + n.rr[decNakedUintIdx] = reflect.ValueOf(&n.u).Elem() + n.rr[decNakedIntIdx] = reflect.ValueOf(&n.i).Elem() + n.rr[decNakedFloatIdx] = reflect.ValueOf(&n.f).Elem() + n.rr[decNakedBytesIdx] = reflect.ValueOf(&n.l).Elem() + n.rr[decNakedStringIdx] = reflect.ValueOf(&n.s).Elem() + n.rr[decNakedTimeIdx] = reflect.ValueOf(&n.t).Elem() + n.rr[decNakedBoolIdx] = reflect.ValueOf(&n.b).Elem() + + for i := range [arrayCacheLen]struct{}{} { + n.rr[decNakedIntfIdx*arrayCacheLen+i] = reflect.ValueOf(&(n.ia[i])).Elem() + n.rr[decNakedMapIntfIntfIdx*arrayCacheLen+i] = reflect.ValueOf(&(n.ma[i])).Elem() + n.rr[decNakedMapStrIntfIdx*arrayCacheLen+i] = reflect.ValueOf(&(n.na[i])).Elem() + n.rr[decNakedSliceIntfIdx*arrayCacheLen+i] = reflect.ValueOf(&(n.sa[i])).Elem() + } + n.inited = true + // n.rr[] = reflect.ValueOf(&n.) +} + +func (n *decNaked) reset() { + if n == nil { + return + } + n.li, n.lm, n.ln, n.ls = 0, 0, 0, 0 +} + +type rtid2rv struct { + rtid uintptr + rv reflect.Value +} + +// A Decoder reads and decodes an object from an input stream in the codec format. +type Decoder struct { + // 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). + + d decDriver + // NOTE: Decoder shouldn't call it's read methods, + // as the handler MAY need to do some coordination. + r decReader + hh Handle + h *BasicHandle + + mtr, str bool // whether maptype or slicetype are known types + + be bool // is binary encoding + bytes bool // is bytes reader + js bool // is json handle + + // ---- cpu cache line boundary? + + rb bytesDecReader + ri ioDecReader + bi bufioDecReader + + // cr containerStateRecv + + n *decNaked + nsp *sync.Pool + + // ---- cpu cache line boundary? + + is map[string]string // used for interning strings + + // cache the mapTypeId and sliceTypeId for faster comparisons + mtid uintptr + stid uintptr + + b [scratchByteArrayLen]byte + // _ uintptr // for alignment purposes, so next one starts from a cache line + + err error + // ---- cpu cache line boundary? + + cf codecFner + // _ [64]byte // force alignment??? +} + +// 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 reader +// (eg bufio.Reader, bytes.Buffer). +func NewDecoder(r io.Reader, h Handle) *Decoder { + 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 { + d := newDecoder(h) + d.ResetBytes(in) + return d +} + +var defaultDecNaked decNaked + +func newDecoder(h Handle) *Decoder { + d := &Decoder{hh: h, h: h.getBasicHandle(), be: h.isBinary()} + + // NOTE: do not initialize d.n here. It is lazily initialized in d.naked() + + _, d.js = h.(*JsonHandle) + if d.h.InternString { + d.is = make(map[string]string, 32) + } + d.d = h.newDecDriver(d) + // d.cr, _ = d.d.(containerStateRecv) + return d +} + +// naked must be called before each call to .DecodeNaked, +// as they will use it. +func (d *Decoder) 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 *Decoder) resetCommon() { + d.n.reset() + d.d.reset() + d.cf.reset(d.hh) + d.err = nil + // 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 d.h.ReaderBufferSize > 0 { + d.bi.buf = make([]byte, 0, d.h.ReaderBufferSize) + d.bi.reset(r) + d.r = &d.bi + } else { + d.ri.x = &d.b + // d.s = d.sa[:0] + d.ri.reset(r) + d.r = &d.ri + } + 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) { + d.bytes = true + d.rb.reset(in) + d.r = &d.rb + d.resetCommon() +} + +// Decode decodes the stream from reader and stores the result in the +// value pointed to by v. v cannot be a nil pointer. v can also be +// a reflect.Value of a pointer. +// +// Note that a pointer to a nil interface is not a nil pointer. +// If you do not know what type of stream it is, pass in a pointer to a nil interface. +// We will decode and store a value in that nil interface. +// +// Sample usages: +// // Decoding into a non-nil typed value +// var f float32 +// err = codec.NewDecoder(r, handle).Decode(&f) +// +// // Decoding into nil interface +// var v interface{} +// dec := codec.NewDecoder(r, handle) +// err = dec.Decode(&v) +// +// When decoding into a nil interface{}, we will decode into an appropriate value based +// on the contents of the stream: +// - Numbers are decoded as float64, int64 or uint64. +// - Other values are decoded appropriately depending on the type: +// bool, string, []byte, time.Time, etc +// - Extensions are decoded as RawExt (if no ext function registered for the tag) +// Configurations exist on the Handle to override defaults +// (e.g. for MapType, SliceType and how to decode raw bytes). +// +// When decoding into a non-nil interface{} value, the mode of encoding is based on the +// type of the value. When a value is seen: +// - If an extension is registered for it, call that extension function +// - If it implements BinaryUnmarshaler, call its UnmarshalBinary(data []byte) error +// - 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. +// - 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. +// - A slice can be decoded from a stream map, by decoding as if +// it contains a sequence of key-value pairs. +// - A struct can be decoded from a stream map, by updating matching fields. +// - 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, +// 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 panicToErrs2(&d.err, &err) + d.MustDecode(v) + return +} + +// 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.err != nil { + panic(d.err) + } + if d.d.TryDecodeAsNil() { + setZero(v) + } else { + d.decode(v) + } + if d.nsp != nil { + if d.n != nil { + d.nsp.Put(d.n) + d.n = nil + } + d.nsp = nil + } + d.n = nil + // xprintf(">>>>>>>> >>>>>>>> num decFns: %v\n", d.cf.sn) +} + +// // 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.hh.hasElemSeparators() + switch dd.ContainerType() { + case valueTypeMap: + containerLen := dd.ReadMapStart() + 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() + case valueTypeArray: + containerLen := dd.ReadArrayStart() + hasLen := containerLen >= 0 + for j := 0; (hasLen && j < containerLen) || !(hasLen || dd.CheckBreak()); j++ { + if elemsep { + dd.ReadArrayElem() + } + d.swallow() + } + dd.ReadArrayEnd() + 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 { + if n.li < arrayCacheLen { + n.ia[n.li] = nil + n.li++ + d.decode(&n.ia[n.li-1]) + n.ia[n.li-1] = nil + n.li-- + } else { + 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 = "" + case *bool: + *v = false + case *int: + *v = 0 + case *int8: + *v = 0 + case *int16: + *v = 0 + case *int32: + *v = 0 + case *int64: + *v = 0 + case *uint: + *v = 0 + case *uint8: + *v = 0 + case *uint16: + *v = 0 + case *uint32: + *v = 0 + case *uint64: + *v = 0 + case *float32: + *v = 0 + case *float64: + *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: + 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) decode(iv interface{}) { + // check nil and interfaces explicitly, + // so that type switches just have a run of constant non-interface types. + if iv == nil { + d.error(errCannotDecodeIntoNil) + return + } + if v, ok := iv.(Selfer); ok { + v.CodecDecodeSelf(d) + return + } + + 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(d.d.DecodeInt(intBitsize)) + case *int8: + *v = int8(d.d.DecodeInt(8)) + case *int16: + *v = int16(d.d.DecodeInt(16)) + case *int32: + *v = int32(d.d.DecodeInt(32)) + case *int64: + *v = d.d.DecodeInt(64) + case *uint: + *v = uint(d.d.DecodeUint(uintBitsize)) + case *uint8: + *v = uint8(d.d.DecodeUint(8)) + case *uint16: + *v = uint16(d.d.DecodeUint(16)) + case *uint32: + *v = uint32(d.d.DecodeUint(32)) + case *uint64: + *v = d.d.DecodeUint(64) + case *float32: + *v = float32(d.d.DecodeFloat(true)) + case *float64: + *v = d.d.DecodeFloat(false) + 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() + + case *interface{}: + d.decodeValue(reflect.ValueOf(iv).Elem(), nil, true) + // d.decodeValueNotNil(reflect.ValueOf(iv).Elem()) + + default: + if !fastpathDecodeTypeSwitch(iv, d) { + v := reflect.ValueOf(iv) + v = d.ensureDecodeable(v) + d.decodeValue(v, nil, false) + // d.decodeValueFallback(v) + } + } +} + +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 fn == nil { + // always pass checkCodecSelfer=true, in case T or ****T is passed, where *T is a Selfer + fn = d.cf.get(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 { + d.errorf("cannot decode into a non-pointer value") + } + } 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() +} + +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, true + 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) 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() { + d.error(errCannotDecodeIntoNil) + return + } + if !rv.CanInterface() { + d.errorf("cannot decode into a value without an interface: %v", rv) + return + } + 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) chkPtrValue(rv reflect.Value) { +// // We can only decode into a non-nil pointer +// if rv.Kind() == reflect.Ptr && !rv.IsNil() { +// return +// } +// d.errNotValidPtrValue(rv) +// } + +// func (d *Decoder) errNotValidPtrValue(rv reflect.Value) { +// if !rv.IsValid() { +// d.error(errCannotDecodeIntoNil) +// return +// } +// if !rv.CanInterface() { +// d.errorf("cannot decode into a value without an interface: %v", rv) +// return +// } +// rvi := rv2i(rv) +// d.errorf("cannot decode into non-pointer or nil pointer. Got: %v, %T, %v", rv.Kind(), rvi, rvi) +// } + +func (d *Decoder) error(err error) { + panic(err) +} + +func (d *Decoder) errorvf(format string, params ...interface{}) (err error) { + params2 := make([]interface{}, len(params)+1) + params2[0] = d.r.numread() + copy(params2[1:], params) + return fmt.Errorf("[pos %d]: "+format, params2...) +} + +func (d *Decoder) errorf(format string, params ...interface{}) { + panic(d.errorvf(format, params...)) +} + +// 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 + } + 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 +} + +// -------------------------------------------------- + +// 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() + if ctyp == valueTypeArray { + x.array = true + clen = dd.ReadArrayStart() + } else if ctyp == valueTypeMap { + clen = dd.ReadMapStart() * 2 + } else { + d.errorf("only encoded map or array can be decoded into a slice (%d)", ctyp) + } + // x.ct = ctyp + x.d = d + return +} + +func (x decSliceHelper) End() { + if x.array { + x.d.d.ReadArrayEnd() + } else { + x.d.d.ReadMapEnd() + } +} + +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 decByteSlice(r decReader, clen, maxInitLen int, bs []byte) (bsOut []byte) { + if clen == 0 { + return zeroByteSlice + } + 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 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 (d *Decoder) expandSliceRV(s reflect.Value, st reflect.Type, canChange bool, stElemSize, num, slen, scap int) ( + s2 reflect.Value, scap2 int, changed bool) { + l1 := slen + num // new slice length + if l1 < slen { + d.errorf("expand slice: slice overflow") + } + if l1 <= scap { + if s.CanSet() { + s.SetLen(l1) + } else if canChange { + s2 = s.Slice(0, l1) + scap2 = scap + changed = true + } else { + d.errorf("expand slice: cannot change") + } + return + } + if !canChange { + d.errorf("expand slice: cannot change") + } + scap2 = growCap(scap, stElemSize, num) + s2 = reflect.MakeSlice(st, l1, scap2) + changed = true + reflect.Copy(s2, s) + return +} + +func decReadFull(r io.Reader, bs []byte) (n int, err error) { + var nn int + for n < 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 += nn + } + } + + // do not do this - it serves no purpose + // if n != len(bs) && err == io.EOF { err = io.ErrUnexpectedEOF } + return +} diff --git a/vendor/github.com/ugorji/go/codec/encode.go b/vendor/github.com/ugorji/go/codec/encode.go new file mode 100644 index 0000000..a22c185 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/encode.go @@ -0,0 +1,1362 @@ +// 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 + +import ( + "bufio" + "encoding" + "fmt" + "io" + "reflect" + "sort" + "sync" + "time" +) + +const defEncByteBufSize = 1 << 6 // 4:16, 6:64, 8:256, 10:1024 + +// AsSymbolFlag defines what should be encoded as symbols. +type AsSymbolFlag uint8 + +const ( + // AsSymbolDefault means only encode struct field names as symbols. + AsSymbolDefault AsSymbolFlag = iota + + // AsSymbolAll means encode anything which could be a symbol as a symbol. + AsSymbolAll = 0xfe + + // AsSymbolNone means do not encode anything as a symbol. + AsSymbolNone = 1 << iota + + // AsSymbolMapStringKeysFlag means encode keys in map[string]XXX as symbols. + AsSymbolMapStringKeysFlag + + // AsSymbolStructFieldNameFlag means encode struct field names as symbols. + AsSymbolStructFieldNameFlag +) + +// encWriter abstracts writing to a byte array or to an io.Writer. +type encWriter interface { + writeb([]byte) + writestr(string) + writen1(byte) + writen2(byte, byte) + atEndOfEncode() +} + +// encDriver abstracts the actual codec (binc vs msgpack, etc) +type encDriver interface { + // IsBuiltinType(rt uintptr) bool + + // Deprecated: left here for now so that old codecgen'ed filed will work. TODO: remove. + 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) + EncodeRawExt(re *RawExt, e *Encoder) + EncodeExt(v interface{}, xtag uint64, ext Ext, e *Encoder) + WriteArrayStart(length int) + WriteArrayElem() + WriteArrayEnd() + WriteMapStart(length int) + WriteMapElemKey() + WriteMapElemValue() + WriteMapEnd() + EncodeString(c charEncoding, v string) + EncodeSymbol(v string) + EncodeStringBytes(c charEncoding, v []byte) + EncodeTime(time.Time) + //TODO + //encBignum(f *big.Int) + //encStringRunes(c charEncoding, v []rune) + + reset() + atEndOfEncode() +} + +type ioEncStringWriter interface { + WriteString(s string) (n int, err error) +} + +type encDriverAsis interface { + EncodeAsis(v []byte) +} + +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 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 + StructToArray bool + + // Canonical representation means that encoding a value will always result in the same + // sequence of bytes. + // + // This only affects maps, as the iteration order for maps is random. + // + // The implementation MAY use the natural sort order for the map keys if possible: + // + // - If there is a natural sort order (ie for number, bool, string or []byte keys), + // then the map keys are first sorted in natural order and then written + // with corresponding map values to the strema. + // - If there is no natural sort order, then the map keys will first be + // encoded into []byte, and then sorted, + // before writing the sorted keys and the corresponding map values to the stream. + // + Canonical bool + + // 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 + + // 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 + + // 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 + + // 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 + + // WriterBufferSize is the size of the buffer used when writing. + // + // if > 0, we use a smart buffer internally for performance purposes. + WriterBufferSize int +} + +// --------------------------------------------- + +type simpleIoEncWriter struct { + io.Writer +} + +// type bufIoEncWriter struct { +// w io.Writer +// buf []byte +// err error +// } + +// func (x *bufIoEncWriter) Write(b []byte) (n int, err error) { +// if x.err != nil { +// return 0, x.err +// } +// if cap(x.buf)-len(x.buf) >= len(b) { +// x.buf = append(x.buf, b) +// return len(b), nil +// } +// n, err = x.w.Write(x.buf) +// if err != nil { +// x.err = err +// return 0, x.err +// } +// n, err = x.w.Write(b) +// x.err = err +// return +// } + +// ioEncWriter implements encWriter and can write to an io.Writer implementation +type ioEncWriter struct { + w io.Writer + ww io.Writer + bw io.ByteWriter + sw ioEncStringWriter + fw ioFlusher + b [8]byte +} + +func (z *ioEncWriter) WriteByte(b byte) (err error) { + // x.bs[0] = b + // _, err = x.ww.Write(x.bs[:]) + z.b[0] = b + _, err = z.w.Write(z.b[:1]) + return +} + +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 + // } + if _, err := z.ww.Write(bs); err != nil { + panic(err) + } +} + +func (z *ioEncWriter) writestr(s string) { + // if len(s) == 0 { + // return + // } + if _, err := z.sw.WriteString(s); err != nil { + panic(err) + } +} + +func (z *ioEncWriter) writen1(b byte) { + if err := z.bw.WriteByte(b); err != nil { + panic(err) + } +} + +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) 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) +// } +// } + +func (z *ioEncWriter) atEndOfEncode() { + if z.fw != nil { + z.fw.Flush() + } +} + +// ---------------------------------------- + +// 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 +} + +func (z *bytesEncWriter) writeb(s []byte) { + oc, a := z.growNoAlloc(len(s)) + if a { + z.growAlloc(len(s), oc) + } + copy(z.b[oc:], s) +} + +func (z *bytesEncWriter) writestr(s string) { + oc, a := z.growNoAlloc(len(s)) + if a { + z.growAlloc(len(s), oc) + } + copy(z.b[oc:], s) +} + +func (z *bytesEncWriter) writen1(b1 byte) { + oc, a := z.growNoAlloc(1) + if a { + z.growAlloc(1, oc) + } + z.b[oc] = b1 +} + +func (z *bytesEncWriter) writen2(b1, b2 byte) { + oc, a := z.growNoAlloc(2) + if a { + z.growAlloc(2, oc) + } + z.b[oc+1] = b2 + z.b[oc] = b1 +} + +func (z *bytesEncWriter) atEndOfEncode() { + *(z.out) = z.b[:z.c] +} + +// have a growNoalloc(n int), which can be inlined. +// if allocation is needed, then call growAlloc(n int) + +func (z *bytesEncWriter) growNoAlloc(n int) (oldcursor int, allocNeeded bool) { + oldcursor = z.c + z.c = z.c + n + if z.c > len(z.b) { + if z.c > cap(z.b) { + allocNeeded = true + } else { + z.b = z.b[:cap(z.b)] + } + } + return +} + +func (z *bytesEncWriter) growAlloc(n int, oldcursor int) { + // appendslice logic (if cap < 1024, *2, else *1.25): more expensive. many copy calls. + // bytes.Buffer model (2*cap + n): much better + // bs := make([]byte, 2*cap(z.b)+n) + bs := make([]byte, growCap(cap(z.b), 1, n)) + copy(bs, z.b[:oldcursor]) + z.b = bs +} + +// --------------------------------------------- + +// func (e *Encoder) builtin(f *codecFnInfo, rv reflect.Value) { +// e.e.EncodeBuiltin(f.ti.rtid, rv2i(rv)) +// } + +func (e *Encoder) rawExt(f *codecFnInfo, rv reflect.Value) { + // rev := rv2i(rv).(RawExt) + // e.e.EncodeRawExt(&rev, e) + // var re *RawExt + // if rv.CanAddr() { + // re = rv2i(rv.Addr()).(*RawExt) + // } else { + // rev := rv2i(rv).(RawExt) + // re = &rev + // } + // e.e.EncodeRawExt(re, e) + e.e.EncodeRawExt(rv2i(rv).(*RawExt), e) +} + +func (e *Encoder) ext(f *codecFnInfo, rv reflect.Value) { + // if this is a struct|array and it was addressable, then pass the address directly (not the value) + // if k := rv.Kind(); (k == reflect.Struct || k == reflect.Array) && rv.CanAddr() { + // rv = rv.Addr() + // } + e.e.EncodeExt(rv2i(rv), f.xfTag, f.xfFn, e) +} + +// func rviptr(rv reflect.Value) (v interface{}) { +// // If a non-pointer was passed to Encode(), then that value is not addressable. +// // Take addr if addressable, else copy value to an addressable value. +// if rv.CanAddr() { +// v = rv2i(rv.Addr()) +// } else { +// rv2 := reflect.New(rv.Type()) +// rv2.Elem().Set(rv) +// v = rv2i(rv2) +// } +// return v +// } + +func (e *Encoder) selferMarshal(f *codecFnInfo, rv reflect.Value) { + rv2i(rv).(Selfer).CodecEncodeSelf(e) +} + +func (e *Encoder) binaryMarshal(f *codecFnInfo, rv reflect.Value) { + bs, fnerr := rv2i(rv).(encoding.BinaryMarshaler).MarshalBinary() + e.marshal(bs, fnerr, false, cRAW) +} + +func (e *Encoder) textMarshal(f *codecFnInfo, rv reflect.Value) { + bs, fnerr := rv2i(rv).(encoding.TextMarshaler).MarshalText() + e.marshal(bs, fnerr, false, cUTF8) +} + +func (e *Encoder) jsonMarshal(f *codecFnInfo, rv reflect.Value) { + bs, fnerr := rv2i(rv).(jsonMarshaler).MarshalJSON() + e.marshal(bs, fnerr, true, cUTF8) +} + +func (e *Encoder) raw(f *codecFnInfo, rv reflect.Value) { + e.rawBytes(rv2i(rv).(Raw)) +} + +func (e *Encoder) kInvalid(f *codecFnInfo, rv reflect.Value) { + e.e.EncodeNil() +} + +func (e *Encoder) kErr(f *codecFnInfo, rv reflect.Value) { + e.errorf("unsupported kind %s, for %#v", rv.Kind(), rv) +} + +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 + } + // If in this method, then there was no extension function defined. + // So it's okay to treat as []byte. + if ti.rtid == uint8SliceTypId { + ee.EncodeStringBytes(cRAW, rv.Bytes()) + return + } + } + if f.seq == seqTypeChan && ti.rt.ChanDir()&reflect.RecvDir == 0 { + e.errorf("send-only channel cannot be used for receiving byte(s)") + } + elemsep := e.hh.hasElemSeparators() + l := rv.Len() + rtelem := ti.rt.Elem() + rtelemIsByte := uint8TypId == rt2id(rtelem) // NOT rtelem.Kind() == reflect.Uint8 + // if a slice, array or chan of bytes, treat specially + if rtelemIsByte { + switch f.seq { + case seqTypeSlice: + ee.EncodeStringBytes(cRAW, rv.Bytes()) + case seqTypeArray: + if rv.CanAddr() { + ee.EncodeStringBytes(cRAW, 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.EncodeStringBytes(cRAW, bs) + } + case seqTypeChan: + bs := e.b[:0] + // 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. + irv := rv2i(rv) + ch, ok := irv.(<-chan byte) + if !ok { + ch = irv.(chan byte) + } + for i := 0; i < l; i++ { + bs = append(bs, <-ch) + } + ee.EncodeStringBytes(cRAW, bs) + } + return + } + + if ti.mbs { + if l%2 == 1 { + e.errorf("mapBySlice requires even slice length, but got %v", l) + return + } + ee.WriteMapStart(l / 2) + } else { + ee.WriteArrayStart(l) + } + + 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.cf.get(rtelem, true, true) + } + // TODO: Consider perf implication of encoding odd index values as symbols if type is string + for j := 0; j < l; j++ { + if elemsep { + if ti.mbs { + if j%2 == 0 { + ee.WriteMapElemKey() + } else { + ee.WriteMapElemValue() + } + } else { + ee.WriteArrayElem() + } + } + if f.seq == seqTypeChan { + if rv2, ok2 := rv.Recv(); ok2 { + e.encodeValue(rv2, fn, true) + } else { + ee.EncodeNil() // WE HAVE TO DO SOMETHING, so nil if nothing received. + } + } else { + e.encodeValue(rv.Index(j), fn, true) + } + } + } + + if ti.mbs { + ee.WriteMapEnd() + } else { + ee.WriteArrayEnd() + } +} + +func (e *Encoder) kStructNoOmitempty(f *codecFnInfo, rv reflect.Value) { + fti := f.ti + elemsep := e.hh.hasElemSeparators() + tisfi := fti.sfip + toMap := !(fti.toArray || e.h.StructToArray) + if toMap { + tisfi = fti.sfi + } + ee := e.e + + sfn := structFieldNode{v: rv, update: false} + if toMap { + ee.WriteMapStart(len(tisfi)) + // asSymbols := e.h.AsSymbols&AsSymbolStructFieldNameFlag != 0 + asSymbols := e.h.AsSymbols == AsSymbolDefault || e.h.AsSymbols&AsSymbolStructFieldNameFlag != 0 + if !elemsep { + for _, si := range tisfi { + if asSymbols { + ee.EncodeSymbol(si.encName) + } else { + ee.EncodeString(cUTF8, si.encName) + } + e.encodeValue(sfn.field(si), nil, true) + } + } else { + for _, si := range tisfi { + ee.WriteMapElemKey() + if asSymbols { + ee.EncodeSymbol(si.encName) + } else { + ee.EncodeString(cUTF8, si.encName) + } + ee.WriteMapElemValue() + e.encodeValue(sfn.field(si), nil, true) + } + } + ee.WriteMapEnd() + } else { + ee.WriteArrayStart(len(tisfi)) + if !elemsep { + for _, si := range tisfi { + e.encodeValue(sfn.field(si), nil, true) + } + } else { + for _, si := range tisfi { + ee.WriteArrayElem() + e.encodeValue(sfn.field(si), nil, true) + } + } + ee.WriteArrayEnd() + } +} + +func (e *Encoder) kStruct(f *codecFnInfo, rv reflect.Value) { + fti := f.ti + elemsep := e.hh.hasElemSeparators() + tisfi := fti.sfip + toMap := !(fti.toArray || e.h.StructToArray) + // if toMap, use the sorted array. If toArray, use unsorted array (to match sequence in struct) + if toMap { + tisfi = fti.sfi + } + newlen := len(fti.sfi) + 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. + + var spool *sync.Pool + var poolv interface{} + var fkvs []stringRv + if newlen <= 8 { + spool, poolv = pool.stringRv8() + fkvs = poolv.(*[8]stringRv)[:newlen] + } else if newlen <= 16 { + spool, poolv = pool.stringRv16() + fkvs = poolv.(*[16]stringRv)[:newlen] + } else if newlen <= 32 { + spool, poolv = pool.stringRv32() + fkvs = poolv.(*[32]stringRv)[:newlen] + } else if newlen <= 64 { + spool, poolv = pool.stringRv64() + fkvs = poolv.(*[64]stringRv)[:newlen] + } else if newlen <= 128 { + spool, poolv = pool.stringRv128() + fkvs = poolv.(*[128]stringRv)[:newlen] + } else { + fkvs = make([]stringRv, newlen) + } + + newlen = 0 + var kv stringRv + recur := e.h.RecursiveEmptyCheck + sfn := structFieldNode{v: rv, update: false} + for _, si := range tisfi { + // kv.r = si.field(rv, false) + kv.r = sfn.field(si) + if toMap { + if si.omitEmpty && isEmptyValue(kv.r, recur, recur) { + continue + } + kv.v = si.encName + } else { + // use the zero value. + // if a reference or struct, set to nil (so you do not output too much) + if si.omitEmpty && isEmptyValue(kv.r, 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++ + } + + if toMap { + ee.WriteMapStart(newlen) + // asSymbols := e.h.AsSymbols&AsSymbolStructFieldNameFlag != 0 + asSymbols := e.h.AsSymbols == AsSymbolDefault || e.h.AsSymbols&AsSymbolStructFieldNameFlag != 0 + if !elemsep { + for j := 0; j < newlen; j++ { + kv = fkvs[j] + if asSymbols { + ee.EncodeSymbol(kv.v) + } else { + ee.EncodeString(cUTF8, kv.v) + } + e.encodeValue(kv.r, nil, true) + } + } else { + for j := 0; j < newlen; j++ { + kv = fkvs[j] + ee.WriteMapElemKey() + if asSymbols { + ee.EncodeSymbol(kv.v) + } else { + ee.EncodeString(cUTF8, kv.v) + } + ee.WriteMapElemValue() + e.encodeValue(kv.r, nil, true) + } + } + ee.WriteMapEnd() + } else { + ee.WriteArrayStart(newlen) + if !elemsep { + for j := 0; j < newlen; j++ { + e.encodeValue(fkvs[j].r, nil, true) + } + } else { + for j := 0; j < newlen; j++ { + ee.WriteArrayElem() + e.encodeValue(fkvs[j].r, nil, true) + } + } + ee.WriteArrayEnd() + } + + // 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. + if spool != nil { + spool.Put(poolv) + } +} + +func (e *Encoder) kMap(f *codecFnInfo, rv reflect.Value) { + ee := e.e + if rv.IsNil() { + ee.EncodeNil() + return + } + + l := rv.Len() + ee.WriteMapStart(l) + elemsep := e.hh.hasElemSeparators() + if l == 0 { + ee.WriteMapEnd() + return + } + 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.rt.Key() + rtkey := rtkey0 + rtval0 := ti.rt.Elem() + rtval := rtval0 + // rtkeyid := rt2id(rtkey0) + for rtval.Kind() == reflect.Ptr { + rtval = rtval.Elem() + } + if rtval.Kind() != reflect.Interface { + valFn = e.cf.get(rtval, true, true) + } + mks := rv.MapKeys() + + if e.h.Canonical { + e.kMapCanonical(rtkey, rv, mks, valFn, asSymbols) + ee.WriteMapEnd() + return + } + + var keyTypeIsString = stringTypId == rt2id(rtkey0) // rtkeyid + if keyTypeIsString { + asSymbols = e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 + } else { + for rtkey.Kind() == reflect.Ptr { + rtkey = rtkey.Elem() + } + if rtkey.Kind() != reflect.Interface { + // rtkeyid = rt2id(rtkey) + keyFn = e.cf.get(rtkey, true, true) + } + } + + // for j, lmks := 0, len(mks); j < lmks; j++ { + for j := range mks { + if elemsep { + ee.WriteMapElemKey() + } + if keyTypeIsString { + if asSymbols { + ee.EncodeSymbol(mks[j].String()) + } else { + ee.EncodeString(cUTF8, mks[j].String()) + } + } else { + e.encodeValue(mks[j], keyFn, true) + } + if elemsep { + 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, asSymbols bool) { + ee := e.e + elemsep := e.hh.hasElemSeparators() + // we previously did out-of-band if an extension was registered. + // This is not necessary, as the natural kind is sufficient for ordering. + + // WHAT IS THIS? rtkeyid can never be a []uint8, per spec + // if rtkeyid == uint8SliceTypId { + // mksv := make([]bytesRv, len(mks)) + // for i, k := range mks { + // v := &mksv[i] + // v.r = k + // v.v = k.Bytes() + // } + // sort.Sort(bytesRvSlice(mksv)) + // for i := range mksv { + // if elemsep { + // ee.WriteMapElemKey() + // } + // ee.EncodeStringBytes(cRAW, mksv[i].v) + // if elemsep { + // ee.WriteMapElemValue() + // } + // e.encodeValue(rv.MapIndex(mksv[i].r), valFn, true) + // } + // return + // } + + 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 asSymbols { + ee.EncodeSymbol(mksv[i].v) + } else { + ee.EncodeString(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) + } + 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) + } + } +} + +// // -------------------------------------------------- + +// An Encoder writes an object to an output stream in the codec format. +type Encoder struct { + // 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 encWriter + + hh Handle + h *BasicHandle + + // ---- cpu cache line boundary? + + wi ioEncWriter + wb bytesEncWriter + bw bufio.Writer + + // cr containerStateRecv + as encDriverAsis + // ---- cpu cache line boundary? + + ci set + err error + + b [scratchByteArrayLen]byte + cf codecFner +} + +// 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). +func NewEncoder(w io.Writer, h Handle) *Encoder { + e := newEncoder(h) + e.Reset(w) + return e +} + +// NewEncoderBytes returns an encoder for encoding directly and efficiently +// into a byte slice, using zero-copying to temporary slices. +// +// 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 { + e := newEncoder(h) + e.ResetBytes(out) + return e +} + +func newEncoder(h Handle) *Encoder { + e := &Encoder{hh: h, h: h.getBasicHandle()} + e.e = h.newEncDriver(e) + e.as, _ = e.e.(encDriverAsis) + // e.cr, _ = e.e.(containerStateRecv) + return e +} + +// 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) { + var ok bool + e.wi.w = w + if e.h.WriterBufferSize > 0 { + bw := bufio.NewWriterSize(w, e.h.WriterBufferSize) + e.bw = *bw + e.wi.bw = &e.bw + e.wi.sw = &e.bw + e.wi.fw = &e.bw + e.wi.ww = &e.bw + } else { + if e.wi.bw, ok = w.(io.ByteWriter); !ok { + e.wi.bw = &e.wi + } + if e.wi.sw, ok = w.(ioEncStringWriter); !ok { + e.wi.sw = &e.wi + } + e.wi.fw, _ = w.(ioFlusher) + e.wi.ww = w + } + e.w = &e.wi + e.e.reset() + e.cf.reset(e.hh) + e.err = nil +} + +// ResetBytes resets the Encoder with a new destination output []byte. +func (e *Encoder) ResetBytes(out *[]byte) { + in := *out + if in == nil { + in = make([]byte, defEncByteBufSize) + } + e.wb.b, e.wb.out, e.wb.c = in, out, 0 + e.w = &e.wb + e.e.reset() + e.cf.reset(e.hh) + e.err = nil +} + +// Encode writes an object into a stream. +// +// Encoding can be configured via the struct tag for the fields. +// The "codec" key in struct field's tag value is the key name, +// followed by an optional comma and options. +// Note that the "json" key is used in the absence of the "codec" key. +// +// 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. +// +// Struct values "usually" encode as maps. Each exported struct field is encoded unless: +// - 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. +// +// However, struct values may encode as arrays. This happens when: +// - StructToArray Encode option is set, OR +// - 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 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:",toarray"` //encode struct as an array +// } +// +// 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 encoding.(Binary|Text|JSON)Marshaler, call its 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 panicToErrs2(&e.err, &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.encode(v) + e.e.atEndOfEncode() + e.w.atEndOfEncode() +} + +func (e *Encoder) encode(iv interface{}) { + if iv == nil || definitelyNil(iv) { + e.e.EncodeNil() + return + } + if v, ok := iv.(Selfer); ok { + v.CodecEncodeSelf(e) + return + } + + switch v := iv.(type) { + // case nil: + // e.e.EncodeNil() + // case Selfer: + // v.CodecEncodeSelf(e) + case Raw: + e.rawBytes(v) + case reflect.Value: + e.encodeValue(v, nil, true) + + case string: + e.e.EncodeString(cUTF8, v) + case bool: + e.e.EncodeBool(v) + case int: + e.e.EncodeInt(int64(v)) + case int8: + e.e.EncodeInt(int64(v)) + case int16: + e.e.EncodeInt(int64(v)) + case int32: + e.e.EncodeInt(int64(v)) + case int64: + e.e.EncodeInt(v) + case uint: + e.e.EncodeUint(uint64(v)) + case uint8: + e.e.EncodeUint(uint64(v)) + case uint16: + e.e.EncodeUint(uint64(v)) + case uint32: + e.e.EncodeUint(uint64(v)) + case uint64: + e.e.EncodeUint(v) + case uintptr: + e.e.EncodeUint(uint64(v)) + case float32: + e.e.EncodeFloat32(v) + case float64: + e.e.EncodeFloat64(v) + case time.Time: + e.e.EncodeTime(v) + case []uint8: + e.e.EncodeStringBytes(cRAW, v) + + case *Raw: + e.rawBytes(*v) + + case *string: + e.e.EncodeString(cUTF8, *v) + case *bool: + e.e.EncodeBool(*v) + case *int: + e.e.EncodeInt(int64(*v)) + case *int8: + e.e.EncodeInt(int64(*v)) + case *int16: + e.e.EncodeInt(int64(*v)) + case *int32: + e.e.EncodeInt(int64(*v)) + case *int64: + e.e.EncodeInt(*v) + case *uint: + e.e.EncodeUint(uint64(*v)) + case *uint8: + e.e.EncodeUint(uint64(*v)) + case *uint16: + e.e.EncodeUint(uint64(*v)) + case *uint32: + e.e.EncodeUint(uint64(*v)) + case *uint64: + e.e.EncodeUint(*v) + case *uintptr: + e.e.EncodeUint(uint64(*v)) + case *float32: + e.e.EncodeFloat32(*v) + case *float64: + e.e.EncodeFloat64(*v) + case *time.Time: + e.e.EncodeTime(*v) + + case *[]uint8: + e.e.EncodeStringBytes(cRAW, *v) + + default: + 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, 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() + return + } + rvpValid = true + rvp = rv + rv = rv.Elem() + if e.h.CheckCircularRef && rv.Kind() == reflect.Struct { + // TODO: Movable pointers will be an issue here. Future problem. + sptr = rv.UnsafeAddr() + break TOP + } + 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 + } + + if sptr != 0 && (&e.ci).add(sptr) { + e.errorf("circular reference found: # %d", sptr) + } + + if fn == nil { + rt := rv.Type() + // always pass checkCodecSelfer=true, in case T or ****T is passed, where *T is a Selfer + fn = e.cf.get(rt, checkFastpath, true) + } + 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 { + fn.fe(e, &fn.i, rv) + } + if sptr != 0 { + (&e.ci).remove(sptr) + } +} + +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.EncodeStringBytes(c, bs) + } +} + +func (e *Encoder) asis(v []byte) { + if e.as == nil { + e.w.writeb(v) + } else { + e.as.EncodeAsis(v) + } +} + +func (e *Encoder) rawBytes(vv Raw) { + v := []byte(vv) + if !e.h.Raw { + e.errorf("Raw values cannot be encoded: %v", v) + } + if e.as == nil { + e.w.writeb(v) + } else { + e.as.EncodeAsis(v) + } +} + +func (e *Encoder) errorf(format string, params ...interface{}) { + err := fmt.Errorf(format, params...) + panic(err) +} + +func (e *Encoder) error(err error) { + panic(err) +} 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 0000000..f87e119 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/fast-path.generated.go @@ -0,0 +1,33002 @@ +// +build !notfastpath + +// 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. + +// 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 + +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) + h, i, j := 0, 0, 271 // len(x) + for i < j { + h = i + (j-i)/2 + if x[h].rtid < rtid { + i = h + 1 + } else { + j = h + } + } + if i < 271 && x[i].rtid == rtid { + return i + } + return -1 +} + +type fastpathAslice []fastpathE + +func (x fastpathAslice) Len() int { return len(x) } +func (x fastpathAslice) Less(i, j int) bool { return x[i].rtid < x[j].rtid } +func (x fastpathAslice) Swap(i, j int) { x[i], x[j] = x[j], x[i] } + +var fastpathAV fastpathA + +// due to possible initialization loop error, make fastpath in an init() +func init() { + i := 0 + fn := func(v interface{}, + fe func(*Encoder, *codecFnInfo, reflect.Value), + fd func(*Decoder, *codecFnInfo, reflect.Value)) (f fastpathE) { + xrt := reflect.TypeOf(v) + xptr := rt2id(xrt) + fastpathAV[i] = fastpathE{xptr, xrt, fe, fd} + i++ + return + } + + 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 // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release) + 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("mapBySlice requires even slice length, but got %v", 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() + } + ee.EncodeString(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("mapBySlice requires even slice length, but got %v", 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.EncodeString(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("mapBySlice requires even slice length, but got %v", 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("mapBySlice requires even slice length, but got %v", 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("mapBySlice requires even slice length, but got %v", 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("mapBySlice requires even slice length, but got %v", 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("mapBySlice requires even slice length, but got %v", 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("mapBySlice requires even slice length, but got %v", 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("mapBySlice requires even slice length, but got %v", 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("mapBySlice requires even slice length, but got %v", 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("mapBySlice requires even slice length, but got %v", 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("mapBySlice requires even slice length, but got %v", 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("mapBySlice requires even slice length, but got %v", 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("mapBySlice requires even slice length, but got %v", 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("mapBySlice requires even slice length, but got %v", 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("mapBySlice requires even slice length, but got %v", 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 int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + 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 int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + 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.EncodeString(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 int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + 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 int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + 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 int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + 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 int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + 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 int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + 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 int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + 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 int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + 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 int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + 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 int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + 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 int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + 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 int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + 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 int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + 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 int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + 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 int + var vp *bytesI + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + 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)) + asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + e.encode(v[string(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(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)) + asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeString(cUTF8, v[string(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeString(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)) + asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(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)) + asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(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)) + asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(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)) + asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(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)) + asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(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)) + asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + e.encode(v[string(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(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)) + asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(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)) + asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(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)) + asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(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)) + asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(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)) + asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[string(k2)])) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(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)) + asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v[string(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(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)) + asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v[string(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(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)) + asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 + if e.h.Canonical { + v2 := make([]string, len(v)) + var i int + for k, _ := range v { + v2[i] = string(k) + i++ + } + sort.Sort(stringSlice(v2)) + for _, k2 := range v2 { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(cUTF8, k2) + } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v[string(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + if asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(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 int + 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 int + 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.EncodeString(cUTF8, v[float32(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeString(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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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.EncodeString(cUTF8, v[float64(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeString(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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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.EncodeString(cUTF8, v[uint(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeString(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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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.EncodeString(cUTF8, v[uint8(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeString(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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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.EncodeString(cUTF8, v[uint16(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeString(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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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.EncodeString(cUTF8, v[uint32(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeString(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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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.EncodeString(cUTF8, v[uint64(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeString(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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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.EncodeString(cUTF8, v[uintptr(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + e.encode(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeString(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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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.EncodeString(cUTF8, v[int(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeString(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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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.EncodeString(cUTF8, v[int8(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeString(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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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.EncodeString(cUTF8, v[int16(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeString(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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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.EncodeString(cUTF8, v[int32(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeString(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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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.EncodeString(cUTF8, v[int64(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeString(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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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.EncodeString(cUTF8, v[bool(k2)]) + } + } else { + for k2, v2 := range v { + if esep { + ee.WriteMapElemKey() + } + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() + } + ee.EncodeString(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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 int + 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 // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release) + 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 // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release) + 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 + } + 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[:xlen] + } else { + v = make([]interface{}, xlen) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + j := 0 + for ; (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{}, 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[j] = nil + } else { + d.decode(&v[j]) + } + } + if canChange { + if j < len(v) { + v = v[:j] + changed = true + } else if j == 0 && v == nil { + v = make([]interface{}, 0) + changed = true + } + } + slh.End() + 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 + } + 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[:xlen] + } else { + v = make([]string, xlen) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + j := 0 + for ; (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, 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[j] = "" + } else { + v[j] = dd.DecodeString() + } + } + if canChange { + if j < len(v) { + v = v[:j] + changed = true + } else if j == 0 && v == nil { + v = make([]string, 0) + changed = true + } + } + slh.End() + 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 + } + 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[:xlen] + } else { + v = make([]float32, xlen) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + j := 0 + for ; (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, 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[j] = 0 + } else { + v[j] = float32(dd.DecodeFloat(true)) + } + } + if canChange { + if j < len(v) { + v = v[:j] + changed = true + } else if j == 0 && v == nil { + v = make([]float32, 0) + changed = true + } + } + slh.End() + 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 + } + 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[:xlen] + } else { + v = make([]float64, xlen) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + j := 0 + for ; (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, 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[j] = 0 + } else { + v[j] = dd.DecodeFloat(false) + } + } + if canChange { + if j < len(v) { + v = v[:j] + changed = true + } else if j == 0 && v == nil { + v = make([]float64, 0) + changed = true + } + } + slh.End() + 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 + } + 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[:xlen] + } else { + v = make([]uint, xlen) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + j := 0 + for ; (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, 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[j] = 0 + } else { + v[j] = uint(dd.DecodeUint(uintBitsize)) + } + } + if canChange { + if j < len(v) { + v = v[:j] + changed = true + } else if j == 0 && v == nil { + v = make([]uint, 0) + changed = true + } + } + slh.End() + 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 + } + 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[:xlen] + } else { + v = make([]uint8, xlen) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + j := 0 + for ; (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, 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[j] = 0 + } else { + v[j] = uint8(dd.DecodeUint(8)) + } + } + if canChange { + if j < len(v) { + v = v[:j] + changed = true + } else if j == 0 && v == nil { + v = make([]uint8, 0) + changed = true + } + } + slh.End() + 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 + } + 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[:xlen] + } else { + v = make([]uint16, xlen) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + j := 0 + for ; (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, 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[j] = 0 + } else { + v[j] = uint16(dd.DecodeUint(16)) + } + } + if canChange { + if j < len(v) { + v = v[:j] + changed = true + } else if j == 0 && v == nil { + v = make([]uint16, 0) + changed = true + } + } + slh.End() + 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 + } + 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[:xlen] + } else { + v = make([]uint32, xlen) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + j := 0 + for ; (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, 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[j] = 0 + } else { + v[j] = uint32(dd.DecodeUint(32)) + } + } + if canChange { + if j < len(v) { + v = v[:j] + changed = true + } else if j == 0 && v == nil { + v = make([]uint32, 0) + changed = true + } + } + slh.End() + 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 + } + 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[:xlen] + } else { + v = make([]uint64, xlen) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + j := 0 + for ; (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, 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[j] = 0 + } else { + v[j] = dd.DecodeUint(64) + } + } + if canChange { + if j < len(v) { + v = v[:j] + changed = true + } else if j == 0 && v == nil { + v = make([]uint64, 0) + changed = true + } + } + slh.End() + 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 + } + 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[:xlen] + } else { + v = make([]uintptr, xlen) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + j := 0 + for ; (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, 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[j] = 0 + } else { + v[j] = uintptr(dd.DecodeUint(uintBitsize)) + } + } + if canChange { + if j < len(v) { + v = v[:j] + changed = true + } else if j == 0 && v == nil { + v = make([]uintptr, 0) + changed = true + } + } + slh.End() + 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 + } + 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[:xlen] + } else { + v = make([]int, xlen) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + j := 0 + for ; (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, 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[j] = 0 + } else { + v[j] = int(dd.DecodeInt(intBitsize)) + } + } + if canChange { + if j < len(v) { + v = v[:j] + changed = true + } else if j == 0 && v == nil { + v = make([]int, 0) + changed = true + } + } + slh.End() + 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 + } + 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[:xlen] + } else { + v = make([]int8, xlen) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + j := 0 + for ; (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, 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[j] = 0 + } else { + v[j] = int8(dd.DecodeInt(8)) + } + } + if canChange { + if j < len(v) { + v = v[:j] + changed = true + } else if j == 0 && v == nil { + v = make([]int8, 0) + changed = true + } + } + slh.End() + 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 + } + 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[:xlen] + } else { + v = make([]int16, xlen) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + j := 0 + for ; (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, 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[j] = 0 + } else { + v[j] = int16(dd.DecodeInt(16)) + } + } + if canChange { + if j < len(v) { + v = v[:j] + changed = true + } else if j == 0 && v == nil { + v = make([]int16, 0) + changed = true + } + } + slh.End() + 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 + } + 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[:xlen] + } else { + v = make([]int32, xlen) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + j := 0 + for ; (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, 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[j] = 0 + } else { + v[j] = int32(dd.DecodeInt(32)) + } + } + if canChange { + if j < len(v) { + v = v[:j] + changed = true + } else if j == 0 && v == nil { + v = make([]int32, 0) + changed = true + } + } + slh.End() + 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 + } + 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[:xlen] + } else { + v = make([]int64, xlen) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + j := 0 + for ; (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, 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[j] = 0 + } else { + v[j] = dd.DecodeInt(64) + } + } + if canChange { + if j < len(v) { + v = v[:j] + changed = true + } else if j == 0 && v == nil { + v = make([]int64, 0) + changed = true + } + } + slh.End() + 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 + } + 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[:xlen] + } else { + v = make([]bool, xlen) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + j := 0 + for ; (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, 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[j] = false + } else { + v[j] = dd.DecodeBool() + } + } + if canChange { + if j < len(v) { + v = v[:j] + changed = true + } else if j == 0 && v == nil { + v = make([]bool, 0) + changed = true + } + } + slh.End() + 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 + } + 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() + 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 + } + 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() + 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 + } + 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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeUint(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeInt(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeFloat(true)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeFloat(false) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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() + 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 + } + 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() + 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 + } + 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() + 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 + } + 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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeUint(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeInt(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeFloat(true)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeFloat(false) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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() + 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 + } + 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(dd.DecodeFloat(true)) + 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() + 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 + } + 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(dd.DecodeFloat(true)) + 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() + 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 + } + 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(dd.DecodeFloat(true)) + 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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeFloat(true)) + 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(dd.DecodeUint(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeFloat(true)) + 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(dd.DecodeUint(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeFloat(true)) + 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(dd.DecodeUint(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeFloat(true)) + 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.DecodeUint(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeFloat(true)) + 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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeFloat(true)) + 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(dd.DecodeInt(intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeFloat(true)) + 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(dd.DecodeInt(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeFloat(true)) + 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(dd.DecodeInt(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeFloat(true)) + 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(dd.DecodeInt(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeFloat(true)) + 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.DecodeInt(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeFloat(true)) + 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(dd.DecodeFloat(true)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeFloat(true)) + 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.DecodeFloat(false) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeFloat(true)) + 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() + 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 + } + 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.DecodeFloat(false) + 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() + 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 + } + 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.DecodeFloat(false) + 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() + 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 + } + 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.DecodeFloat(false) + 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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeFloat(false) + 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(dd.DecodeUint(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeFloat(false) + 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(dd.DecodeUint(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeFloat(false) + 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(dd.DecodeUint(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeFloat(false) + 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.DecodeUint(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeFloat(false) + 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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeFloat(false) + 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(dd.DecodeInt(intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeFloat(false) + 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(dd.DecodeInt(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeFloat(false) + 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(dd.DecodeInt(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeFloat(false) + 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(dd.DecodeInt(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeFloat(false) + 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.DecodeInt(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeFloat(false) + 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(dd.DecodeFloat(true)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeFloat(false) + 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.DecodeFloat(false) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeFloat(false) + 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() + 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 + } + 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(dd.DecodeUint(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() + 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 + } + 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(dd.DecodeUint(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() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeUint(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeUint(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeUint(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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.DecodeUint(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeInt(intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeInt(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeInt(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeInt(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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.DecodeInt(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeFloat(true)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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.DecodeFloat(false) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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() + 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 + } + 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(dd.DecodeUint(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() + 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 + } + 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(dd.DecodeUint(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() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeUint(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeUint(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeUint(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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.DecodeUint(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeInt(intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeInt(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeInt(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeInt(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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.DecodeInt(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeFloat(true)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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.DecodeFloat(false) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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() + 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 + } + 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(dd.DecodeUint(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() + 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 + } + 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(dd.DecodeUint(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() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeUint(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeUint(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeUint(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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.DecodeUint(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeInt(intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeInt(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeInt(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeInt(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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.DecodeInt(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeFloat(true)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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.DecodeFloat(false) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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() + 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 + } + 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(dd.DecodeUint(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() + 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 + } + 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(dd.DecodeUint(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() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeUint(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeUint(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeUint(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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.DecodeUint(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeInt(intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeInt(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeInt(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeInt(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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.DecodeInt(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeFloat(true)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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.DecodeFloat(false) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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() + 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 + } + 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.DecodeUint(64) + 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() + 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 + } + 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.DecodeUint(64) + 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() + 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 + } + 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.DecodeUint(64) + 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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeUint(64) + 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(dd.DecodeUint(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeUint(64) + 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(dd.DecodeUint(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeUint(64) + 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(dd.DecodeUint(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeUint(64) + 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.DecodeUint(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeUint(64) + 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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeUint(64) + 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(dd.DecodeInt(intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeUint(64) + 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(dd.DecodeInt(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeUint(64) + 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(dd.DecodeInt(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeUint(64) + 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(dd.DecodeInt(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeUint(64) + 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.DecodeInt(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeUint(64) + 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(dd.DecodeFloat(true)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeUint(64) + 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.DecodeFloat(false) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeUint(64) + 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() + 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 + } + 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(dd.DecodeUint(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() + 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 + } + 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(dd.DecodeUint(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() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeUint(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeUint(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeUint(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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.DecodeUint(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeInt(intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeInt(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeInt(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeInt(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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.DecodeInt(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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(dd.DecodeFloat(true)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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.DecodeFloat(false) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(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() + 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 + } + 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(dd.DecodeInt(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() + 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 + } + 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(dd.DecodeInt(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() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeUint(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeUint(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeUint(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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.DecodeUint(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeInt(intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeInt(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeInt(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeInt(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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.DecodeInt(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeFloat(true)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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.DecodeFloat(false) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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() + 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 + } + 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(dd.DecodeInt(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() + 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 + } + 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(dd.DecodeInt(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() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeUint(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeUint(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeUint(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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.DecodeUint(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeInt(intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeInt(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeInt(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeInt(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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.DecodeInt(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeFloat(true)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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.DecodeFloat(false) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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() + 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 + } + 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(dd.DecodeInt(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() + 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 + } + 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(dd.DecodeInt(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() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeUint(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeUint(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeUint(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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.DecodeUint(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeInt(intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeInt(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeInt(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeInt(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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.DecodeInt(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeFloat(true)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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.DecodeFloat(false) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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() + 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 + } + 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(dd.DecodeInt(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() + 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 + } + 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(dd.DecodeInt(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() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeUint(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeUint(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeUint(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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.DecodeUint(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeInt(intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeInt(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeInt(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeInt(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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.DecodeInt(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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(dd.DecodeFloat(true)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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.DecodeFloat(false) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(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() + 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 + } + 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.DecodeInt(64) + 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() + 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 + } + 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.DecodeInt(64) + 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() + 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 + } + 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.DecodeInt(64) + 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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeInt(64) + 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(dd.DecodeUint(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeInt(64) + 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(dd.DecodeUint(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeInt(64) + 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(dd.DecodeUint(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeInt(64) + 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.DecodeUint(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeInt(64) + 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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeInt(64) + 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(dd.DecodeInt(intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeInt(64) + 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(dd.DecodeInt(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeInt(64) + 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(dd.DecodeInt(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeInt(64) + 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(dd.DecodeInt(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeInt(64) + 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.DecodeInt(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeInt(64) + 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(dd.DecodeFloat(true)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeInt(64) + 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.DecodeFloat(false) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeInt(64) + 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() + 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 + } + 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() + 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 + } + 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() + 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 + } + 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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeUint(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeUint(uintBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(intBitsize)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(8)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(16)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeInt(32)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeInt(64) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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(dd.DecodeFloat(true)) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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.DecodeFloat(false) + if v != nil { + v[mk] = mv + } + } + dd.ReadMapEnd() + 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 + } + 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() + 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 0000000..300fa17 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/fast-path.go.tmpl @@ -0,0 +1,490 @@ +// +build !notfastpath + +// 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. + +// 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 + +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) + h, i, j := 0, 0, {{ .FastpathLen }} // len(x) + for i < j { + h = i + (j-i)/2 + if x[h].rtid < rtid { + i = h + 1 + } else { + j = h + } + } + if i < {{ .FastpathLen }} && x[i].rtid == rtid { + return i + } + return -1 +} + +type fastpathAslice []fastpathE + +func (x fastpathAslice) Len() int { return len(x) } +func (x fastpathAslice) Less(i, j int) bool { return x[i].rtid < x[j].rtid } +func (x fastpathAslice) Swap(i, j int) { x[i], x[j] = x[j], x[i] } + +var fastpathAV fastpathA + +// due to possible initialization loop error, make fastpath in an init() +func init() { + i := 0 + fn := func(v interface{}, + fe func(*Encoder, *codecFnInfo, reflect.Value), + fd func(*Decoder, *codecFnInfo, reflect.Value)) (f fastpathE) { + xrt := reflect.TypeOf(v) + xptr := rt2id(xrt) + fastpathAV[i] = fastpathE{xptr, xrt, fe, fd} + i++ + return + } + {{/* 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 // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release) + 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 // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release) + 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 // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release) + 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("mapBySlice requires even slice length, but got %v", 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 eq .MapKey "string"}}asSymbols := e.h.AsSymbols&AsSymbolMapStringKeysFlag != 0 + {{end}}if e.h.Canonical { + {{if eq .MapKey "interface{}"}}{{/* out of band + */}}var mksv []byte = make([]byte, 0, len(v)*16) // temporary byte slice for the encoding + e2 := NewEncoderBytes(&mksv, e.hh) + v2 := make([]bytesI, len(v)) + var i, l int + var vp *bytesI {{/* put loop variables outside. seems currently needed for better perf */}} + for k2, _ := range v { + l = len(mksv) + e2.MustEncode(k2) + vp = &v2[i] + vp.v = mksv[l:] + vp.i = k2 + i++ + } + sort.Sort(bytesISlice(v2)) + for j := range v2 { + 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 int + 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 asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(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 asSymbols { + ee.EncodeSymbol(k2) + } else { + ee.EncodeString(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 // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release) + 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 // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release) + 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 + } + 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[:xlen] + } else { + v = make([]{{ .Elem }}, xlen) + } + changed = true + } else if containerLenS != len(v) { + v = v[:containerLenS] + changed = true + } + } + j := 0 + for ; (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 }}, 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[j] = {{ zerocmd .Elem }} + } else { + {{ if eq .Elem "interface{}" }}d.decode(&v[j]){{ else }}v[j] = {{ decmd .Elem }}{{ end }} + } + } + if canChange { + if j < len(v) { + v = v[:j] + changed = true + } else if j == 0 && v == nil { + v = make([]{{ .Elem }}, 0) + changed = true + } + } + slh.End() + 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 + } + {{ 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() + return v, changed +} +{{end}}{{end}}{{end}} diff --git a/_vendor/vendor/github.com/ugorji/go/codec/fast-path.not.go b/vendor/github.com/ugorji/go/codec/fast-path.not.go similarity index 67% rename from _vendor/vendor/github.com/ugorji/go/codec/fast-path.not.go rename to vendor/github.com/ugorji/go/codec/fast-path.not.go index 63e5911..2e78833 100644 --- a/_vendor/vendor/github.com/ugorji/go/codec/fast-path.not.go +++ b/vendor/github.com/ugorji/go/codec/fast-path.not.go @@ -18,17 +18,27 @@ func fastpathDecodeTypeSwitch(iv interface{}, d *Decoder) bool { return fal 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(*encFnInfo, reflect.Value) - decfn func(*decFnInfo, reflect.Value) + 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.cf.get(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 0000000..d9940c0 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/gen-dec-array.go.tmpl @@ -0,0 +1,77 @@ +{{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 + } {{end}} {{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 "hl"}} && {{var "j"}} < {{var "l"}}) || !({{var "hl"}} || r.CheckBreak()); {{var "j"}}++ { + {{if not isArray}} if {{var "j"}} == 0 && len({{var "v"}}) == 0 { + if {{var "hl"}} { + {{var "rl"}} = z.DecInferLen({{var "l"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }}) + } else { + {{var "rl"}} = 8 + } + {{var "v"}} = make([]{{ .Typ }}, {{var "rl"}}) + {{var "c"}} = true + }{{end}} + {{var "h"}}.ElemContainerState({{var "j"}}) + // {{var "dn"}} = r.TryDecodeAsNil() + {{if isChan}}{{ $x := printf "%[1]vv%[2]v" .TempVar .Rand }}var {{var $x}} {{ .Typ }} + {{ decLineVar $x }} + {{var "v"}} <- {{ $x }} + {{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 0000000..8323b54 --- /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/vendor/github.com/ugorji/go/codec/gen-helper.generated.go b/vendor/github.com/ugorji/go/codec/gen-helper.generated.go similarity index 62% rename from _vendor/vendor/github.com/ugorji/go/codec/gen-helper.generated.go rename to vendor/github.com/ugorji/go/codec/gen-helper.generated.go index 22bce77..f32fdbd 100644 --- a/_vendor/vendor/github.com/ugorji/go/codec/gen-helper.generated.go +++ b/vendor/github.com/ugorji/go/codec/gen-helper.generated.go @@ -1,12 +1,9 @@ -// //+build ignore +/* // +build ignore */ // 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. -// ************************************************************ -// DO NOT EDIT. -// THIS FILE IS AUTO-GENERATED from gen-helper.go.tmpl -// ************************************************************ +// Code generated from gen-helper.go.tmpl - DO NOT EDIT. package codec @@ -15,9 +12,12 @@ import ( "reflect" ) +// GenVersion is the current version of codecgen. +const GenVersion = 8 + // 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 continously and without notice. +// 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). @@ -26,15 +26,21 @@ import ( // 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) (genHelperEncoder, encDriver) { - return genHelperEncoder{e: e}, e.e +func GenHelperEncoder(e *Encoder) (ge genHelperEncoder, ee encDriver) { + ge = genHelperEncoder{e: e} + ee = 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) (genHelperDecoder, decDriver) { - return genHelperDecoder{d: d}, d.d +func GenHelperDecoder(d *Decoder) (gd genHelperDecoder, dd decDriver) { + gd = genHelperDecoder{d: d} + dd = d.d + return } // FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* @@ -56,44 +62,67 @@ func (f genHelperEncoder) EncBasicHandle() *BasicHandle { // 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() + return f.e.cf.be // f.e.hh.isBinaryEncoding() } // 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.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.marshal(bs, fnerr, false, c_UTF8) + f.e.marshal(bs, fnerr, false, cUTF8) } // 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.marshal(bs, fnerr, true, c_UTF8) + f.e.marshal(bs, fnerr, true, cUTF8) } // 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.marshal(bs, fnerr, false, c_RAW) + f.e.marshal(bs, fnerr, false, cRAW) } // FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperEncoder) TimeRtidIfBinc() uintptr { - if _, ok := f.e.hh.(*BincHandle); ok { - return timeTypId - } - return 0 -} +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) IsJSONHandle() bool { - return f.e.js + return f.e.cf.js +} + +// 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* @@ -103,25 +132,14 @@ func (f genHelperEncoder) HasExtensions() bool { // FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* func (f genHelperEncoder) EncExt(v interface{}) (r bool) { - rt := reflect.TypeOf(v) - if rt.Kind() == reflect.Ptr { - rt = rt.Elem() - } - rtid := reflect.ValueOf(rt).Pointer() - if xfFn := f.e.h.getExt(rtid); xfFn != nil { + xfFn := f.e.h.getExt(i2rtid(v)) + if xfFn != nil { f.e.e.EncodeExt(v, xfFn.tag, xfFn.ext, f.e) return true } return false } -// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperEncoder) EncSendContainerState(c containerState) { - if f.e.cr != nil { - f.e.cr.sendContainerState(c) - } -} - // ---------------- DECODER FOLLOWS ----------------- // FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* @@ -135,9 +153,7 @@ func (f genHelperDecoder) DecBinary() bool { } // FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperDecoder) DecSwallow() { - f.d.swallow() -} +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 { @@ -147,7 +163,12 @@ func (f genHelperDecoder) DecScratchBuffer() []byte { // FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* func (f genHelperDecoder) DecFallback(iv interface{}, chkPtr bool) { // println(">>>>>>>>> DecFallback") - f.d.decodeI(iv, chkPtr, false, false, false) + 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* @@ -167,7 +188,7 @@ func (f genHelperDecoder) DecArrayCannotExpand(sliceLen, streamLen int) { // 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.DecodeBytes(f.d.b[:], true, true)) + fnerr := tm.UnmarshalText(f.d.d.DecodeStringAsBytes()) if fnerr != nil { panic(fnerr) } @@ -175,7 +196,7 @@ func (f genHelperDecoder) DecTextUnmarshal(tm encoding.TextUnmarshaler) { // FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* func (f genHelperDecoder) DecJSONUnmarshal(tm jsonUnmarshaler) { - // bs := f.dd.DecodeBytes(f.d.b[:], true, true) + // 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 { @@ -185,25 +206,49 @@ func (f genHelperDecoder) DecJSONUnmarshal(tm jsonUnmarshaler) { // 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, false, true)) + 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) TimeRtidIfBinc() uintptr { - if _, ok := f.d.hh.(*BincHandle); ok { - return timeTypId - } - return 0 -} +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* func (f genHelperDecoder) HasExtensions() bool { return len(f.d.h.extHandle) != 0 @@ -211,9 +256,8 @@ func (f genHelperDecoder) HasExtensions() bool { // FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* func (f genHelperDecoder) DecExt(v interface{}) (r bool) { - rt := reflect.TypeOf(v).Elem() - rtid := reflect.ValueOf(rt).Pointer() - if xfFn := f.d.h.getExt(rtid); xfFn != nil { + xfFn := f.d.h.getExt(i2rtid(v)) + if xfFn != nil { f.d.d.DecodeExt(v, xfFn.tag, xfFn.ext) return true } @@ -221,13 +265,12 @@ func (f genHelperDecoder) DecExt(v interface{}) (r bool) { } // FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* -func (f genHelperDecoder) DecInferLen(clen, maxlen, unit int) (rvlen int, truncated bool) { +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* -func (f genHelperDecoder) DecSendContainerState(c containerState) { - if f.d.cr != nil { - f.d.cr.sendContainerState(c) - } -} +// +// 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 0000000..a5bf5a2 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/gen-helper.go.tmpl @@ -0,0 +1,244 @@ +/* // +build ignore */ + +// 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. + +// 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 encDriver) { + ge = genHelperEncoder{e:e} + ee = 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 decDriver) { + gd = genHelperDecoder{d:d} + dd = d.d + return +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +type genHelperEncoder struct { + e *Encoder + F fastpathT +} + +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +type genHelperDecoder struct { + 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.cf.be // f.e.hh.isBinaryEncoding() +} +// 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.marshal(bs, fnerr, false, cUTF8) +} +// 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.marshal(bs, fnerr, true, cUTF8) +} +// 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.marshal(bs, fnerr, false, cRAW) +} +// 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) IsJSONHandle() bool { + return f.e.cf.js +} +// 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) HasExtensions() bool { + return len(f.e.h.extHandle) != 0 +} +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) EncExt(v interface{}) (r bool) { + xfFn := f.e.h.getExt(i2rtid(v)) + if 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) 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* +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* +func (f genHelperDecoder) DecExt(v interface{}) (r bool) { + xfFn := f.d.h.getExt(i2rtid(v)) + if 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 0000000..2add68d --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/gen.generated.go @@ -0,0 +1,134 @@ +// +build codecgen.exec + +// 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 + +// 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 + } {{end}} {{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 "hl"}} && {{var "j"}} < {{var "l"}}) || !({{var "hl"}} || r.CheckBreak()); {{var "j"}}++ { + {{if not isArray}} if {{var "j"}} == 0 && len({{var "v"}}) == 0 { + if {{var "hl"}} { + {{var "rl"}} = z.DecInferLen({{var "l"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }}) + } else { + {{var "rl"}} = 8 + } + {{var "v"}} = make([]{{ .Typ }}, {{var "rl"}}) + {{var "c"}} = true + }{{end}} + {{var "h"}}.ElemContainerState({{var "j"}}) + // {{var "dn"}} = r.TryDecodeAsNil() + {{if isChan}}{{ $x := printf "%[1]vv%[2]v" .TempVar .Rand }}var {{var $x}} {{ .Typ }} + {{ decLineVar $x }} + {{var "v"}} <- {{ $x }} + {{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/vendor/github.com/ugorji/go/codec/gen.go b/vendor/github.com/ugorji/go/codec/gen.go similarity index 78% rename from _vendor/vendor/github.com/ugorji/go/codec/gen.go rename to vendor/github.com/ugorji/go/codec/gen.go index ac8cc6d..3342694 100644 --- a/_vendor/vendor/github.com/ugorji/go/codec/gen.go +++ b/vendor/github.com/ugorji/go/codec/gen.go @@ -1,3 +1,5 @@ +// +build codecgen.exec + // 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. @@ -27,7 +29,7 @@ import ( // --------------------------------------------------- // codecgen supports the full cycle of reflection-based codec: // - RawExt -// - Builtins +// - Raw // - Extensions // - (Binary|Text|JSON)(Unm|M)arshal // - generic by-kind @@ -77,8 +79,12 @@ import ( // codecgen will panic if the file was generated with an old version of the library in use. // // Note: -// It was a concious decision to have gen.go always explicitly call EncodeNil or TryDecodeAsNil. +// 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. // @@ -93,7 +99,8 @@ import ( // 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. -const GenVersion = 5 +// v6: removed unsafe from gen, and now uses codecgen.exec tag +const genVersion = 8 const ( genCodecPkg = "codec1978" @@ -121,11 +128,11 @@ const ( ) var ( - genAllTypesSamePkgErr = errors.New("All types must be in the same package") - genExpectArrayOrMapErr = errors.New("unexpected type. Expecting array/map/slice") - genBase64enc = base64.NewEncoding("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789__") - genQNameRegex = regexp.MustCompile(`[A-Za-z_.]+`) - genCheckVendor bool + 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_.]+`) ) // genRunner holds some state used during a Gen run. @@ -146,8 +153,7 @@ type genRunner struct { 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 - unsafe bool // is unsafe to be used in generated code? + 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 @@ -157,40 +163,37 @@ type genRunner struct { 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 CONTINOUSLY WITHOUT NOTICE.* -func Gen(w io.Writer, buildTags, pkgName, uid string, useUnsafe bool, ti *TypeInfos, typ ...reflect.Type) { - // trim out all types which already implement Selfer - typ2 := make([]reflect.Type, 0, len(typ)) - for _, t := range typ { - if reflect.PtrTo(t).Implements(selferTyp) || t.Implements(selferTyp) { - continue - } - typ2 = append(typ2, t) - } - typ = typ2 +// 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{ - unsafe: useUnsafe, - 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, + 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 @@ -206,20 +209,17 @@ func Gen(w io.Writer, buildTags, pkgName, uid string, useUnsafe bool, ti *TypeIn for _, t := range typ { // fmt.Printf("###########: PkgPath: '%v', Name: '%s'\n", genImportPath(t), t.Name()) if genImportPath(t) != x.bp { - panic(genAllTypesSamePkgErr) + panic(errGenAllTypesSamePkg) } x.genRefPkgs(t) } if buildTags != "" { - x.line("//+build " + buildTags) + x.line("// +build " + buildTags) x.line("") } x.line(` -// ************************************************************ -// DO NOT EDIT. -// THIS FILE IS AUTO-GENERATED BY codecgen. -// ************************************************************ +// Code generated by codecgen - DO NOT EDIT. `) x.line("package " + pkgName) @@ -231,7 +231,7 @@ func Gen(w io.Writer, buildTags, pkgName, uid string, useUnsafe bool, ti *TypeIn } // 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 { + for k := range x.im { imKeys = append(imKeys, k) } sort.Strings(imKeys) @@ -239,11 +239,8 @@ func Gen(w io.Writer, buildTags, pkgName, uid string, useUnsafe bool, ti *TypeIn x.linef("%s \"%s\"", x.imn[k], k) } // add required packages - for _, k := range [...]string{"reflect", "unsafe", "runtime", "fmt", "errors"} { + for _, k := range [...]string{"reflect", "runtime", "fmt", "errors"} { if _, ok := x.im[k]; !ok { - if k == "unsafe" && !x.unsafe { - continue - } x.line("\"" + k + "\"") } } @@ -252,38 +249,35 @@ func Gen(w io.Writer, buildTags, pkgName, uid string, useUnsafe bool, ti *TypeIn x.line("const (") x.linef("// ----- content types ----") - x.linef("codecSelferC_UTF8%s = %v", x.xs, int64(c_UTF8)) - x.linef("codecSelferC_RAW%s = %v", x.xs, int64(c_RAW)) + x.linef("codecSelferCcUTF8%s = %v", x.xs, int64(cUTF8)) + x.linef("codecSelferCcRAW%s = %v", x.xs, int64(cRAW)) x.linef("// ----- value types used ----") x.linef("codecSelferValueTypeArray%s = %v", x.xs, int64(valueTypeArray)) x.linef("codecSelferValueTypeMap%s = %v", x.xs, int64(valueTypeMap)) - x.linef("// ----- containerStateValues ----") - x.linef("codecSelfer_containerMapKey%s = %v", x.xs, int64(containerMapKey)) - x.linef("codecSelfer_containerMapValue%s = %v", x.xs, int64(containerMapValue)) - x.linef("codecSelfer_containerMapEnd%s = %v", x.xs, int64(containerMapEnd)) - x.linef("codecSelfer_containerArrayElem%s = %v", x.xs, int64(containerArrayElem)) - x.linef("codecSelfer_containerArrayEnd%s = %v", x.xs, int64(containerArrayEnd)) + // These are no longer needed, as there are functions created for them + // x.linef("// ----- containerStateValues ----") + // x.linef("codecSelferKcontainerMapKey%s = %v", x.xs, int64(containerMapKey)) + // x.linef("codecSelferKcontainerMapValue%s = %v", x.xs, int64(containerMapValue)) + // x.linef("codecSelferKcontainerMapEnd%s = %v", x.xs, int64(containerMapEnd)) + // x.linef("codecSelferKcontainerArrayElem%s = %v", x.xs, int64(containerArrayElem)) + // x.linef("codecSelferKcontainerArrayEnd%s = %v", x.xs, int64(containerArrayEnd)) x.line(")") x.line("var (") x.line("codecSelferBitsize" + x.xs + " = uint8(reflect.TypeOf(uint(0)).Bits())") - x.line("codecSelferOnlyMapOrArrayEncodeToStructErr" + x.xs + " = errors.New(`only encoded map or array can be decoded into a struct`)") + x.line("errCodecSelferOnlyMapOrArrayEncodeToStruct" + x.xs + " = errors.New(`only encoded map or array can be decoded into a struct`)") x.line(")") x.line("") - if x.unsafe { - x.line("type codecSelferUnsafeString" + x.xs + " struct { Data uintptr; Len int}") - 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.linef("if %sGenVersion != %v {", x.cpfx, genVersion) x.line("_, file, _, _ := runtime.Caller(0)") x.line(`err := fmt.Errorf("codecgen version mismatch: current: %v, need %v. Re-generate file: %v", `) - x.linef(`%v, %sGenVersion, file)`, GenVersion, x.cpfx) + x.linef(`%v, %sGenVersion, file)`, genVersion, x.cpfx) x.line("panic(err)") x.linef("}") x.line("if false { // reference the types, but skip this branch at build/run time") @@ -294,10 +288,6 @@ func Gen(w io.Writer, buildTags, pkgName, uid string, useUnsafe bool, ti *TypeIn x.linef("var v%v %s.%s", n, x.imn[k], t.Name()) n++ } - if x.unsafe { - x.linef("var v%v unsafe.Pointer", n) - n++ - } if n > 0 { x.out("_") for i := 1; i < n; i++ { @@ -320,7 +310,7 @@ func Gen(w io.Writer, buildTags, pkgName, uid string, useUnsafe bool, ti *TypeIn } for _, t := range x.ts { - rtid := reflect.ValueOf(t).Pointer() + 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) @@ -331,7 +321,7 @@ func Gen(w io.Writer, buildTags, pkgName, uid string, useUnsafe bool, ti *TypeIn case reflect.Map: x.encMapFallback("v", t) default: - panic(genExpectArrayOrMapErr) + panic(errGenExpectArrayOrMap) } x.line("}") x.line("") @@ -346,7 +336,7 @@ func Gen(w io.Writer, buildTags, pkgName, uid string, useUnsafe bool, ti *TypeIn case reflect.Map: x.decMapFallback("v", rtid, t) default: - panic(genExpectArrayOrMapErr) + panic(errGenExpectArrayOrMap) } x.line("}") x.line("") @@ -512,7 +502,7 @@ func (x *genRunner) selfer(encode bool) { t0 := t // always make decode use a pointer receiver, // and structs always use a ptr receiver (encode|decode) - isptr := !encode || t.Kind() == reflect.Struct + isptr := !encode || (t.Kind() == reflect.Struct || t.Kind() == reflect.Array) x.varsfxreset() fnSigPfx := "func (x " if isptr { @@ -550,21 +540,21 @@ func (x *genRunner) selfer(encode bool) { x.out(fnSigPfx) x.line(") codecDecodeSelfFromMap(l int, d *" + x.cpfx + "Decoder) {") x.genRequiredMethodVars(false) - x.decStructMap(genTopLevelVarName, "l", reflect.ValueOf(t0).Pointer(), t0, genStructMapStyleConsolidated) + 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", reflect.ValueOf(t0).Pointer(), t0, genStructMapStyleLenPrefix) + 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", reflect.ValueOf(t0).Pointer(), t0, genStructMapStyleCheckBreak) + x.decStructMap(genTopLevelVarName, "l", rt2id(t0), t0, genStructMapStyleCheckBreak) x.line("}") x.line("") } @@ -573,7 +563,7 @@ func (x *genRunner) selfer(encode bool) { x.out(fnSigPfx) x.line(") codecDecodeSelfFromArray(l int, d *" + x.cpfx + "Decoder) {") x.genRequiredMethodVars(false) - x.decStructArray(genTopLevelVarName, "l", "return", reflect.ValueOf(t0).Pointer(), t0) + x.decStructArray(genTopLevelVarName, "l", "return", rt2id(t0), t0) x.line("}") x.line("") @@ -650,7 +640,7 @@ func (x *genRunner) encVar(varname string, t reflect.Type) { // enc will encode a variable (varname) of type t, // except t is of kind reflect.Struct or reflect.Array, wherein varname is of type ptrTo(T) (to prevent copying) func (x *genRunner) enc(varname string, t reflect.Type) { - rtid := reflect.ValueOf(t).Pointer() + rtid := rt2id(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 @@ -701,31 +691,49 @@ func (x *genRunner) enc(varname string, t reflect.Type) { } // check if - // - type is RawExt + // - type is RawExt, Raw // - the type implements (Text|JSON|Binary)(Unm|M)arshal x.linef("%sm%s := z.EncBinary()", genTempVarPfx, mi) x.linef("_ = %sm%s", genTempVarPfx, mi) x.line("if false {") //start if block defer func() { x.line("}") }() //end if block + if t == rawTyp { + x.linef("} else { z.EncRaw(%s)", varname) + return + } if t == rawExtTyp { - x.linef("} else { r.EncodeRawExt(%v, e)", varname) + x.linef("} else { r.EncodeRawExt(%s, e)", varname) return } // HACK: Support for Builtins. // Currently, only Binc supports builtins, and the only builtin type is time.Time. // Have a method that returns the rtid for time.Time if Handle is Binc. - if t == timeTyp { - vrtid := genTempVarPfx + "m" + x.varsfx() - x.linef("} else if %s := z.TimeRtidIfBinc(); %s != 0 { ", vrtid, vrtid) - x.linef("r.EncodeBuiltin(%s, %s)", vrtid, varname) - } + // 2017-11-12: builtin no longer supported - comment out + // if t == timeTyp { + // vrtid := genTempVarPfx + "m" + x.varsfx() + // x.linef("} else if %s := z.TimeRtidIfBinc(); %s != 0 { ", vrtid, vrtid) + // x.linef("r.EncodeBuiltin(%s, *%s)", vrtid, varname) + // } // only check for extensions if the type is named, and has a packagePath. - if genImportPath(t) != "" && t.Name() != "" { + var arrayOrStruct = tk == reflect.Array || tk == reflect.Struct // meaning varname if of type *T + 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.EncExt(%s) {", varname) + // x.linef("} else if z.HasExtensions() && z.EncExt(%s) {", varname) + // + // yy := fmt.Sprintf("%sxt%s", genTempVarPfx, mi) + // // always pass a ptr, so if not array or struct, then take the address + // var zz string + // if !arrayOrStruct { + // // zz = "&" // taking address is more expensive. instead, let it optimize itself. + // } + // x.linef("} else if %s := z.Extension(z.I2Rtid(%s%s)); %s != nil { z.EncExtension(%s%s, %s) ", + // yy, zz, varname, yy, zz, varname, yy) + // + 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 tk == reflect.Array || tk == reflect.Struct { // varname is of type *T + if arrayOrStruct { // varname is of type *T if t.Implements(binaryMarshalerTyp) || tptr.Implements(binaryMarshalerTyp) { x.linef("} else if %sm%s { z.EncBinaryMarshal(%v) ", genTempVarPfx, mi, varname) } @@ -764,7 +772,7 @@ func (x *genRunner) enc(varname string, t reflect.Type) { case reflect.Bool: x.line("r.EncodeBool(bool(" + varname + "))") case reflect.String: - x.line("r.EncodeString(codecSelferC_UTF8" + x.xs + ", string(" + varname + "))") + x.line("r.EncodeString(codecSelferCcUTF8" + x.xs + ", string(" + varname + "))") case reflect.Chan: x.xtraSM(varname, true, t) // x.encListFallback(varname, rtid, t) @@ -778,10 +786,10 @@ func (x *genRunner) enc(varname string, t reflect.Type) { // - 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.EncodeStringBytes(codecSelferC_RAW" + x.xs + ", []byte(" + varname + "))") + x.line("r.EncodeStringBytes(codecSelferCcRAW" + x.xs + ", []byte(" + varname + "))") } else if fastpathAV.index(rtid) != -1 { g := x.newGenV(t) - x.line("z.F." + g.MethodNamePfx("Enc", false) + "V(" + varname + ", false, e)") + x.line("z.F." + g.MethodNamePfx("Enc", false) + "V(" + varname + ", e)") } else { x.xtraSM(varname, true, t) // x.encListFallback(varname, rtid, t) @@ -795,7 +803,7 @@ func (x *genRunner) enc(varname string, t reflect.Type) { // 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 + ", false, e)") + x.line("z.F." + g.MethodNamePfx("Enc", false) + "V(" + varname + ", e)") } else { x.xtraSM(varname, true, t) // x.encMapFallback(varname, rtid, t) @@ -828,7 +836,7 @@ func (x *genRunner) encZero(t reflect.Type) { case reflect.Bool: x.line("r.EncodeBool(false)") case reflect.String: - x.line("r.EncodeString(codecSelferC_UTF8" + x.xs + `, "")`) + x.line("r.EncodeString(codecSelferCcUTF8" + x.xs + `, "")`) default: x.line("r.EncodeNil()") } @@ -853,55 +861,68 @@ func (x *genRunner) encStruct(varname string, rtid uintptr, t reflect.Type) { // 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. - x.linef("var %s [%v]bool", numfieldsvar, len(tisfi)) - x.linef("_, _, _ = %s, %s, %s", sepVarname, numfieldsvar, struct2arrvar) + if ti.anyOmitEmpty { + x.linef("var %s [%v]bool", numfieldsvar, len(tisfi)) + x.linef("_ = %s", numfieldsvar) + } + x.linef("_, _ = %s, %s", sepVarname, struct2arrvar) x.linef("const %s bool = %v", ti2arrayvar, ti.toArray) - nn := 0 - for j, si := range tisfi { - if !si.omitEmpty { - nn++ - continue - } - var t2 reflect.StructField - var omitline string - if si.i != -1 { - t2 = t.Field(int(si.i)) - } else { - t2typ := t - varname3 := varname - for _, ix := range si.is { - for t2typ.Kind() == reflect.Ptr { - t2typ = t2typ.Elem() - } - t2 = t2typ.Field(ix) - t2typ = t2.Type - varname3 = varname3 + "." + t2.Name - if t2typ.Kind() == reflect.Ptr { - omitline += varname3 + " != nil && " + var nn int + if ti.anyOmitEmpty { + for j, si := range tisfi { + if !si.omitEmpty { + nn++ + continue + } + var t2 reflect.StructField + var omitline string + { + 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 += varname3 + " != nil && " + } } } + // never 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) + switch t2.Type.Kind() { + case reflect.Struct: + omitline += " true" + case reflect.Map, reflect.Slice, reflect.Array, reflect.Chan: + omitline += "len(" + varname + "." + t2.Name + ") != 0" + default: + omitline += varname + "." + t2.Name + " != " + x.genZeroValueR(t2.Type) + } + x.linef("%s[%v] = %s", numfieldsvar, j, omitline) } - // never 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) - switch t2.Type.Kind() { - case reflect.Struct: - omitline += " true" - case reflect.Map, reflect.Slice, reflect.Array, reflect.Chan: - omitline += "len(" + varname + "." + t2.Name + ") != 0" - default: - omitline += varname + "." + t2.Name + " != " + x.genZeroValueR(t2.Type) - } - x.linef("%s[%v] = %s", numfieldsvar, j, omitline) } - x.linef("var %snn%s int", genTempVarPfx, i) + // x.linef("var %snn%s int", genTempVarPfx, i) x.linef("if %s || %s {", ti2arrayvar, struct2arrvar) // if ti.toArray { - x.line("r.EncodeArrayStart(" + strconv.FormatInt(int64(len(tisfi)), 10) + ")") + x.linef("r.WriteArrayStart(%d)", len(tisfi)) x.linef("} else {") // if not ti.toArray - x.linef("%snn%s = %v", genTempVarPfx, i, nn) - x.linef("for _, b := range %s { if b { %snn%s++ } }", numfieldsvar, genTempVarPfx, i) - x.linef("r.EncodeMapStart(%snn%s)", genTempVarPfx, i) - x.linef("%snn%s = %v", genTempVarPfx, i, 0) - // x.line("r.EncodeMapStart(" + strconv.FormatInt(int64(len(tisfi)), 10) + ")") + if ti.anyOmitEmpty { + x.linef("var %snn%s = %v", genTempVarPfx, i, nn) + 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 { @@ -909,17 +930,18 @@ func (x *genRunner) encStruct(varname string, rtid uintptr, t reflect.Type) { isNilVarName := genTempVarPfx + "n" + i var labelUsed bool var t2 reflect.StructField - if si.i != -1 { - t2 = t.Field(int(si.i)) - } else { + { t2typ := t varname3 := varname - for _, ix := range si.is { + for ij, ix := range si.is { + if uint8(ij) == si.nis { + break + } // fmt.Printf("%%%% %v, ix: %v\n", t2typ, ix) for t2typ.Kind() == reflect.Ptr { t2typ = t2typ.Elem() } - t2 = t2typ.Field(ix) + t2 = t2typ.Field(int(ix)) t2typ = t2.Type varname3 = varname3 + "." + t2.Name if t2typ.Kind() == reflect.Ptr { @@ -942,9 +964,10 @@ func (x *genRunner) encStruct(varname string, rtid uintptr, t reflect.Type) { x.linef("if %s || %s {", ti2arrayvar, struct2arrvar) // if ti.toArray if labelUsed { - x.line("if " + isNilVarName + " { r.EncodeNil() } else { ") + x.linef("if %s { r.WriteArrayElem(); r.EncodeNil() } else { ", isNilVarName) + // x.linef("if %s { z.EncSendContainerState(codecSelferKcontainerArrayElem%s); r.EncodeNil() } else { ", isNilVarName, x.xs) } - x.linef("z.EncSendContainerState(codecSelfer_containerArrayElem%s)", x.xs) + x.line("r.WriteArrayElem()") // x.linef("z.EncSendContainerState(codecSelferKcontainerArrayElem%s)", x.xs) if si.omitEmpty { x.linef("if %s[%v] {", numfieldsvar, j) } @@ -963,9 +986,9 @@ func (x *genRunner) encStruct(varname string, rtid uintptr, t reflect.Type) { if si.omitEmpty { x.linef("if %s[%v] {", numfieldsvar, j) } - x.linef("z.EncSendContainerState(codecSelfer_containerMapKey%s)", x.xs) - x.line("r.EncodeString(codecSelferC_UTF8" + x.xs + ", string(\"" + si.encName + "\"))") - x.linef("z.EncSendContainerState(codecSelfer_containerMapValue%s)", x.xs) + x.line("r.WriteMapElemKey()") // x.linef("z.EncSendContainerState(codecSelferKcontainerMapKey%s)", x.xs) + x.line("r.EncodeString(codecSelferCcUTF8" + x.xs + ", `" + si.encName + "`)") + x.line("r.WriteMapElemValue()") // x.linef("z.EncSendContainerState(codecSelferKcontainerMapValue%s)", x.xs) if labelUsed { x.line("if " + isNilVarName + " { r.EncodeNil() } else { ") x.encVar(varname+"."+t2.Name, t2.Type) @@ -979,46 +1002,54 @@ func (x *genRunner) encStruct(varname string, rtid uintptr, t reflect.Type) { x.linef("} ") // end if/else ti.toArray } x.linef("if %s || %s {", ti2arrayvar, struct2arrvar) // if ti.toArray { - x.linef("z.EncSendContainerState(codecSelfer_containerArrayEnd%s)", x.xs) + x.line("r.WriteArrayEnd()") // x.linef("z.EncSendContainerState(codecSelferKcontainerArrayEnd%s)", x.xs) x.line("} else {") - x.linef("z.EncSendContainerState(codecSelfer_containerMapEnd%s)", x.xs) + x.line("r.WriteMapEnd()") // x.linef("z.EncSendContainerState(codecSelferKcontainerMapEnd%s)", x.xs) x.line("}") } func (x *genRunner) encListFallback(varname string, t reflect.Type) { + if t.AssignableTo(uint8SliceTyp) { + x.linef("r.EncodeStringBytes(codecSelferCcRAW%s, []byte(%s))", x.xs, varname) + return + } + if t.Kind() == reflect.Array && t.Elem().Kind() == reflect.Uint8 { + x.linef("r.EncodeStringBytes(codecSelferCcRAW%s, ((*[%d]byte)(%s))[:])", x.xs, t.Len(), varname) + return + } i := x.varsfx() g := genTempVarPfx - x.line("r.EncodeArrayStart(len(" + varname + "))") + x.line("r.WriteArrayStart(len(" + varname + "))") if t.Kind() == reflect.Chan { x.linef("for %si%s, %si2%s := 0, len(%s); %si%s < %si2%s; %si%s++ {", g, i, g, i, varname, g, i, g, i, g, i) - x.linef("z.EncSendContainerState(codecSelfer_containerArrayElem%s)", x.xs) + x.line("r.WriteArrayElem()") // x.linef("z.EncSendContainerState(codecSelferKcontainerArrayElem%s)", x.xs) x.linef("%sv%s := <-%s", g, i, varname) } else { // x.linef("for %si%s, %sv%s := range %s {", genTempVarPfx, i, genTempVarPfx, i, varname) x.linef("for _, %sv%s := range %s {", genTempVarPfx, i, varname) - x.linef("z.EncSendContainerState(codecSelfer_containerArrayElem%s)", x.xs) + x.line("r.WriteArrayElem()") // x.linef("z.EncSendContainerState(codecSelferKcontainerArrayElem%s)", x.xs) } x.encVar(genTempVarPfx+"v"+i, t.Elem()) x.line("}") - x.linef("z.EncSendContainerState(codecSelfer_containerArrayEnd%s)", x.xs) + x.line("r.WriteArrayEnd()") // x.linef("z.EncSendContainerState(codecSelferKcontainerArrayEnd%s)", x.xs) } func (x *genRunner) encMapFallback(varname string, t reflect.Type) { // TODO: expand this to handle canonical. i := x.varsfx() - x.line("r.EncodeMapStart(len(" + varname + "))") + x.line("r.WriteMapStart(len(" + varname + "))") x.linef("for %sk%s, %sv%s := range %s {", genTempVarPfx, i, genTempVarPfx, i, varname) // x.line("for " + genTempVarPfx + "k" + i + ", " + genTempVarPfx + "v" + i + " := range " + varname + " {") - x.linef("z.EncSendContainerState(codecSelfer_containerMapKey%s)", x.xs) + x.line("r.WriteMapElemKey()") // f("z.EncSendContainerState(codecSelferKcontainerMapKey%s)", x.xs) x.encVar(genTempVarPfx+"k"+i, t.Key()) - x.linef("z.EncSendContainerState(codecSelfer_containerMapValue%s)", x.xs) + x.line("r.WriteMapElemValue()") // f("z.EncSendContainerState(codecSelferKcontainerMapValue%s)", x.xs) x.encVar(genTempVarPfx+"v"+i, t.Elem()) x.line("}") - x.linef("z.EncSendContainerState(codecSelfer_containerMapEnd%s)", x.xs) + x.line("r.WriteMapEnd()") // f("z.EncSendContainerState(codecSelferKcontainerMapEnd%s)", x.xs) } -func (x *genRunner) decVar(varname string, t reflect.Type, canBeNil bool) { +func (x *genRunner) decVar(varname, decodedNilVarname string, t reflect.Type, canBeNil 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 @@ -1031,7 +1062,9 @@ func (x *genRunner) decVar(varname string, t reflect.Type, canBeNil bool) { } if canBeNil { x.line("if r.TryDecodeAsNil() {") - if t.Kind() == reflect.Ptr { + if decodedNilVarname != "" { + x.line(decodedNilVarname + " = true") + } else if t.Kind() == reflect.Ptr { x.line("if " + varname + " != nil { ") // if varname is a field of a struct (has a dot in it), @@ -1091,7 +1124,7 @@ func (x *genRunner) dec(varname string, t reflect.Type) { // 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 := reflect.ValueOf(t).Pointer() + rtid := rt2id(t) tptr := reflect.PtrTo(t) if x.checkForSelfer(t, varname) { if t.Implements(selferTyp) || tptr.Implements(selferTyp) { @@ -1123,7 +1156,7 @@ func (x *genRunner) dec(varname string, t reflect.Type) { } // check if - // - type is RawExt + // - type is Raw, RawExt // - the type implements (Text|JSON|Binary)(Unm|M)arshal mi := x.varsfx() x.linef("%sm%s := z.DecBinary()", genTempVarPfx, mi) @@ -1131,6 +1164,10 @@ func (x *genRunner) dec(varname string, t reflect.Type) { x.line("if false {") //start if block defer func() { x.line("}") }() //end if block + if t == rawTyp { + x.linef("} else { *%v = z.DecRaw()", varname) + return + } if t == rawExtTyp { x.linef("} else { r.DecodeExt(%v, 0, nil)", varname) return @@ -1139,15 +1176,18 @@ func (x *genRunner) dec(varname string, t reflect.Type) { // HACK: Support for Builtins. // Currently, only Binc supports builtins, and the only builtin type is time.Time. // Have a method that returns the rtid for time.Time if Handle is Binc. - if t == timeTyp { - vrtid := genTempVarPfx + "m" + x.varsfx() - x.linef("} else if %s := z.TimeRtidIfBinc(); %s != 0 { ", vrtid, vrtid) - x.linef("r.DecodeBuiltin(%s, %s)", vrtid, varname) - } + // 2017-11-12: builtin no longer supported - comment out + // if t == timeTyp { + // vrtid := genTempVarPfx + "m" + x.varsfx() + // x.linef("} else if %s := z.TimeRtidIfBinc(); %s != 0 { ", vrtid, vrtid) + // x.linef("r.DecodeBuiltin(%s, %s)", vrtid, varname) + // } // only check for extensions if the type is named, and has a packagePath. - if genImportPath(t) != "" && t.Name() != "" { + 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) + // 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 t.Implements(binaryUnmarshalerTyp) || tptr.Implements(binaryUnmarshalerTyp) { @@ -1220,10 +1260,10 @@ func (x *genRunner) dec(varname string, t reflect.Type) { // - if elements are primitives or Selfers, call dedicated function on each member. // - else call Encoder.encode(XXX) on it. if rtid == uint8SliceTypId { - x.line("*" + varname + " = r.DecodeBytes(*(*[]byte)(" + varname + "), false, false)") + x.line("*" + varname + " = r.DecodeBytes(*(*[]byte)(" + varname + "), false)") } else if fastpathAV.index(rtid) != -1 { g := x.newGenV(t) - x.line("z.F." + g.MethodNamePfx("Dec", false) + "X(" + varname + ", false, d)") + x.line("z.F." + g.MethodNamePfx("Dec", false) + "X(" + varname + ", d)") } else { x.xtraSM(varname, false, t) // x.decListFallback(varname, rtid, false, t) @@ -1235,7 +1275,7 @@ func (x *genRunner) dec(varname string, t reflect.Type) { // - else call Encoder.encode(XXX) on it. if fastpathAV.index(rtid) != -1 { g := x.newGenV(t) - x.line("z.F." + g.MethodNamePfx("Dec", false) + "X(" + varname + ", false, d)") + x.line("z.F." + g.MethodNamePfx("Dec", false) + "X(" + varname + ", d)") } else { x.xtraSM(varname, false, t) // x.decMapFallback(varname, rtid, t) @@ -1306,6 +1346,14 @@ func (x *genRunner) decTryAssignPrimitive(varname string, t reflect.Type) (tryAs } 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 @@ -1321,13 +1369,13 @@ func (x *genRunner) decListFallback(varname string, rtid uintptr, t reflect.Type funcs := make(template.FuncMap) funcs["decLineVar"] = func(varname string) string { - x.decVar(varname, telem, false) - return "" - } - funcs["decLine"] = func(pfx string) string { - x.decVar(ts.TempVar+pfx+ts.Rand, reflect.PtrTo(telem), false) + x.decVar(varname, "", telem, false) return "" } + // funcs["decLine"] = func(pfx string) string { + // x.decVar(ts.TempVar+pfx+ts.Rand, "", reflect.PtrTo(telem), false) + // return "" + // } funcs["var"] = func(s string) string { return ts.TempVar + s + ts.Rand } @@ -1383,21 +1431,21 @@ func (x *genRunner) decMapFallback(varname string, rtid uintptr, t reflect.Type) return telem.Kind() == reflect.Interface } funcs["decLineVarK"] = func(varname string) string { - x.decVar(varname, tkey, false) + x.decVar(varname, "", tkey, false) return "" } - funcs["decLineVar"] = func(varname string) string { - x.decVar(varname, telem, false) - return "" - } - funcs["decLineK"] = func(pfx string) string { - x.decVar(ts.TempVar+pfx+ts.Rand, reflect.PtrTo(tkey), false) - return "" - } - funcs["decLine"] = func(pfx string) string { - x.decVar(ts.TempVar+pfx+ts.Rand, reflect.PtrTo(telem), false) + funcs["decLineVar"] = func(varname, decodedNilVarname string) string { + x.decVar(varname, decodedNilVarname, telem, false) return "" } + // funcs["decLineK"] = func(pfx string) string { + // x.decVar(ts.TempVar+pfx+ts.Rand, reflect.PtrTo(tkey), false) + // return "" + // } + // funcs["decLine"] = func(pfx string) string { + // x.decVar(ts.TempVar+pfx+ts.Rand, reflect.PtrTo(telem), false) + // return "" + // } funcs["var"] = func(s string) string { return ts.TempVar + s + ts.Rand } @@ -1418,18 +1466,19 @@ func (x *genRunner) decStructMapSwitch(kName string, varname string, rtid uintpt for _, si := range tisfi { x.line("case \"" + si.encName + "\":") var t2 reflect.StructField - if si.i != -1 { - t2 = t.Field(int(si.i)) - } else { - //we must accomodate anonymous fields, where the embedded field is a nil pointer in the value. + { + //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 - for _, ix := range si.is { + for ij, ix := range si.is { + if uint8(ij) == si.nis { + break + } for t2typ.Kind() == reflect.Ptr { t2typ = t2typ.Elem() } - t2 = t2typ.Field(ix) + t2 = t2typ.Field(int(ix)) t2typ = t2.Type varname3 = varname3 + "." + t2.Name if t2typ.Kind() == reflect.Ptr { @@ -1437,7 +1486,7 @@ func (x *genRunner) decStructMapSwitch(kName string, varname string, rtid uintpt } } } - x.decVar(varname+"."+t2.Name, t2.Type, false) + x.decVar(varname+"."+t2.Name, "", t2.Type, false) } x.line("default:") // pass the slice here, so that the string will not escape, and maybe save allocation @@ -1450,17 +1499,6 @@ func (x *genRunner) decStructMap(varname, lenvarname string, rtid uintptr, t ref i := x.varsfx() kName := tpfx + "s" + i - // We thought to use ReadStringAsBytes, as go compiler might optimize the copy out. - // However, using that was more expensive, as it seems that the switch expression - // is evaluated each time. - // - // We could depend on decodeString using a temporary/shared buffer internally. - // However, this model of creating a byte array, and using explicitly is faster, - // and allows optional use of unsafe []byte->string conversion without alloc. - - // Also, ensure that the slice array doesn't escape. - // That will help escape analysis prevent allocation when it gets better. - // x.line("var " + kName + "Arr = [32]byte{} // default string to decode into") // x.line("var " + kName + "Slc = " + kName + "Arr[:] // default slice to decode into") // use the scratch buffer to avoid allocation (most field names are < 32). @@ -1479,21 +1517,15 @@ func (x *genRunner) decStructMap(varname, lenvarname string, rtid uintptr, t ref x.linef("if %shl%s { if %sj%s >= %s { break }", tpfx, i, tpfx, i, lenvarname) x.line("} else { if r.CheckBreak() { break }; }") } - x.linef("z.DecSendContainerState(codecSelfer_containerMapKey%s)", x.xs) - x.line(kName + "Slc = r.DecodeBytes(" + kName + "Slc, true, true)") + x.line("r.ReadMapElemKey()") // f("z.DecSendContainerState(codecSelferKcontainerMapKey%s)", x.xs) + x.line(kName + "Slc = r.DecodeStringAsBytes()") // let string be scoped to this loop alone, so it doesn't escape. - if x.unsafe { - x.line(kName + "SlcHdr := codecSelferUnsafeString" + x.xs + "{uintptr(unsafe.Pointer(&" + - kName + "Slc[0])), len(" + kName + "Slc)}") - x.line(kName + " := *(*string)(unsafe.Pointer(&" + kName + "SlcHdr))") - } else { - x.line(kName + " := string(" + kName + "Slc)") - } - x.linef("z.DecSendContainerState(codecSelfer_containerMapValue%s)", x.xs) + x.line(kName + " := string(" + kName + "Slc)") + x.line("r.ReadMapElemValue()") // f("z.DecSendContainerState(codecSelferKcontainerMapValue%s)", x.xs) x.decStructMapSwitch(kName, varname, rtid, t) x.line("} // end for " + tpfx + "j" + i) - x.linef("z.DecSendContainerState(codecSelfer_containerMapEnd%s)", x.xs) + x.line("r.ReadMapEnd()") // f("z.DecSendContainerState(codecSelferKcontainerMapEnd%s)", x.xs) } func (x *genRunner) decStructArray(varname, lenvarname, breakString string, rtid uintptr, t reflect.Type) { @@ -1506,18 +1538,19 @@ func (x *genRunner) decStructArray(varname, lenvarname, breakString string, rtid x.linef("var %shl%s bool = %s >= 0", tpfx, i, lenvarname) // has length for _, si := range tisfi { var t2 reflect.StructField - if si.i != -1 { - t2 = t.Field(int(si.i)) - } else { - //we must accomodate anonymous fields, where the embedded field is a nil pointer in the value. + { + //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 - for _, ix := range si.is { + for ij, ix := range si.is { + if uint8(ij) == si.nis { + break + } for t2typ.Kind() == reflect.Ptr { t2typ = t2typ.Elem() } - t2 = t2typ.Field(ix) + t2 = t2typ.Field(int(ix)) t2typ = t2.Type varname3 = varname3 + "." + t2.Name if t2typ.Kind() == reflect.Ptr { @@ -1529,10 +1562,10 @@ func (x *genRunner) decStructArray(varname, lenvarname, breakString string, rtid 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 { z.DecSendContainerState(codecSelfer_containerArrayEnd%s); %s }", - tpfx, i, x.xs, breakString) - x.linef("z.DecSendContainerState(codecSelfer_containerArrayElem%s)", x.xs) - x.decVar(varname+"."+t2.Name, t2.Type, true) + x.linef("if %sb%s { r.ReadArrayEnd(); %s }", tpfx, i, breakString) + // x.linef("if %sb%s { z.DecSendContainerState(codecSelferKcontainerArrayEnd%s); %s }", tpfx, i, x.xs, breakString) + x.line("r.ReadArrayElem()") // f("z.DecSendContainerState(codecSelferKcontainerArrayElem%s)", x.xs) + x.decVar(varname+"."+t2.Name, "", t2.Type, true) } // read remaining values and throw away. x.line("for {") @@ -1540,10 +1573,10 @@ func (x *genRunner) decStructArray(varname, lenvarname, breakString string, rtid tpfx, i, tpfx, i, tpfx, i, tpfx, i, lenvarname, tpfx, i) x.linef("if %sb%s { break }", tpfx, i) - x.linef("z.DecSendContainerState(codecSelfer_containerArrayElem%s)", x.xs) + x.line("r.ReadArrayElem()") // f("z.DecSendContainerState(codecSelferKcontainerArrayElem%s)", x.xs) x.linef(`z.DecStructFieldNotFound(%sj%s - 1, "")`, tpfx, i) x.line("}") - x.linef("z.DecSendContainerState(codecSelfer_containerArrayEnd%s)", x.xs) + x.line("r.ReadArrayEnd()") // f("z.DecSendContainerState(codecSelferKcontainerArrayEnd%s)", x.xs) } func (x *genRunner) decStruct(varname string, rtid uintptr, t reflect.Type) { @@ -1553,7 +1586,7 @@ func (x *genRunner) decStruct(varname string, rtid uintptr, t reflect.Type) { 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.linef("z.DecSendContainerState(codecSelfer_containerMapEnd%s)", x.xs) + x.line("r.ReadMapEnd()") // f("z.DecSendContainerState(codecSelferKcontainerMapEnd%s)", x.xs) if genUseOneFunctionForDecStructMap { x.line("} else { ") x.linef("x.codecDecodeSelfFromMap(%sl%s, d)", genTempVarPfx, i) @@ -1569,13 +1602,13 @@ func (x *genRunner) decStruct(varname string, rtid uintptr, t reflect.Type) { 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.linef("z.DecSendContainerState(codecSelfer_containerArrayEnd%s)", x.xs) + x.line("r.ReadArrayEnd()") // f("z.DecSendContainerState(codecSelferKcontainerArrayEnd%s)", x.xs) x.line("} else { ") x.linef("x.codecDecodeSelfFromArray(%sl%s, d)", genTempVarPfx, i) x.line("}") // else panic x.line("} else { ") - x.line("panic(codecSelferOnlyMapOrArrayEncodeToStructErr" + x.xs + ")") + x.line("panic(errCodecSelferOnlyMapOrArrayEncodeToStruct" + x.xs + ")") x.line("} ") } @@ -1634,15 +1667,8 @@ func (x *genV) MethodNamePfx(prefix string, prim bool) string { func genImportPath(t reflect.Type) (s string) { s = t.PkgPath() if genCheckVendor { - // 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):] - } + // HACK: always handle vendoring. It should be typically on in go 1.6, 1.7 + s = stripVendor(s) } return } @@ -1764,13 +1790,13 @@ func genIsImmutable(t reflect.Type) (v bool) { } type genInternal struct { - Values []genV - Unsafe bool + Version int + Values []genV } func (x genInternal) FastpathLen() (l int) { for _, v := range x.Values { - if v.Primitive == "" { + if v.Primitive == "" && !(v.MapKey == "" && v.Elem == "uint8") { l++ } } @@ -1790,6 +1816,32 @@ func genInternalZeroValue(s string) string { } } +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": @@ -1797,7 +1849,7 @@ func genInternalEncCommandAsString(s string, vname string) string { case "int", "int8", "int16", "int32", "int64": return "ee.EncodeInt(int64(" + vname + "))" case "string": - return "ee.EncodeString(c_UTF8, " + vname + ")" + return "ee.EncodeString(cUTF8, " + vname + ")" case "float32": return "ee.EncodeFloat32(" + vname + ")" case "float64": @@ -1865,8 +1917,21 @@ func genInternalSortType(s string, elem bool) string { panic("sorttype: unexpected type: " + s) } +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 +} + // var genInternalMu sync.Mutex -var genInternalV genInternal +var genInternalV = genInternal{Version: genVersion} var genInternalTmplFuncs template.FuncMap var genInternalOnce sync.Once @@ -1929,14 +1994,15 @@ func genInternalInit() { "float64": 8, "bool": 1, } - var gt genInternal + var gt = genInternal{Version: genVersion} - // For each slice or map type, there must be a (symetrical) Encode and Decode fast-path function + // 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]}) - } + // 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]}) } @@ -1950,6 +2016,7 @@ func genInternalInit() { funcs["encmd"] = genInternalEncCommandAsString funcs["decmd"] = genInternalDecCommandAsString funcs["zerocmd"] = genInternalZeroValue + funcs["nonzerocmd"] = genInternalNonZeroValue funcs["hasprefix"] = strings.HasPrefix funcs["sorttype"] = genInternalSortType @@ -1961,11 +2028,10 @@ func genInternalInit() { // It is run by the program author alone. // Unfortunately, it has to be exported so that it can be called from a command line tool. // *** DO NOT USE *** -func genInternalGoFile(r io.Reader, w io.Writer, safe bool) (err error) { +func genInternalGoFile(r io.Reader, w io.Writer) (err error) { genInternalOnce.Do(genInternalInit) gt := genInternalV - gt.Unsafe = !safe t := template.New("").Funcs(genInternalTmplFuncs) 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 0000000..7567e2c --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/goversion_arrayof_gte_go15.go @@ -0,0 +1,14 @@ +// 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. + +// +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 0000000..ec94bd0 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/goversion_arrayof_lt_go15.go @@ -0,0 +1,14 @@ +// 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. + +// +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 0000000..51fe40e --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/goversion_makemap_gte_go19.go @@ -0,0 +1,15 @@ +// 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. + +// +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 0000000..d4b9c2c --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/goversion_makemap_lt_go19.go @@ -0,0 +1,12 @@ +// 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. + +// +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 0000000..5f33c6b --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_gte_go110.go @@ -0,0 +1,8 @@ +// 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. + +// +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 0000000..924491b --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_lt_go110.go @@ -0,0 +1,8 @@ +// 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. + +// +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 0000000..dcd8c3d --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/goversion_unsupported_lt_go14.go @@ -0,0 +1,17 @@ +// 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. + +// +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/vendor/github.com/ugorji/go/codec/gen_15.go b/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go15.go similarity index 72% rename from _vendor/vendor/github.com/ugorji/go/codec/gen_15.go rename to vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go15.go index ab76c31..68626e1 100644 --- a/_vendor/vendor/github.com/ugorji/go/codec/gen_15.go +++ b/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go15.go @@ -7,6 +7,4 @@ package codec import "os" -func init() { - genCheckVendor = os.Getenv("GO15VENDOREXPERIMENT") == "1" -} +var genCheckVendor = os.Getenv("GO15VENDOREXPERIMENT") == "1" diff --git a/_vendor/vendor/github.com/ugorji/go/codec/gen_16.go b/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go16.go similarity index 65% rename from _vendor/vendor/github.com/ugorji/go/codec/gen_16.go rename to vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go16.go index 87c04e2..344f596 100644 --- a/_vendor/vendor/github.com/ugorji/go/codec/gen_16.go +++ b/vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go16.go @@ -1,12 +1,10 @@ // 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. -// +build go1.6 +// +build go1.6,!go1.7 package codec import "os" -func init() { - genCheckVendor = os.Getenv("GO15VENDOREXPERIMENT") != "0" -} +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 0000000..de91d29 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/goversion_vendor_gte_go17.go @@ -0,0 +1,8 @@ +// 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. + +// +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 0000000..9d007bf --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/goversion_vendor_lt_go15.go @@ -0,0 +1,8 @@ +// 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. + +// +build !go1.5 + +package codec + +var genCheckVendor = false diff --git a/_vendor/vendor/github.com/ugorji/go/codec/helper.go b/vendor/github.com/ugorji/go/codec/helper.go similarity index 50% rename from _vendor/vendor/github.com/ugorji/go/codec/helper.go rename to vendor/github.com/ugorji/go/codec/helper.go index ec8dedf..1a1436a 100644 --- a/_vendor/vendor/github.com/ugorji/go/codec/helper.go +++ b/vendor/github.com/ugorji/go/codec/helper.go @@ -38,10 +38,6 @@ package codec // 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. // -// The only codec that may suffer (slightly) is cbor, and only when decoding indefinite-length. -// It may suffer because we treat it like a text-based codec, and read separators. -// However, this read is a no-op and the cost is insignificant. -// // Philosophy // ------------ // On decode, this codec will update containers appropriately: @@ -107,8 +103,10 @@ import ( "errors" "fmt" "math" + "os" "reflect" "sort" + "strconv" "strings" "sync" "time" @@ -116,39 +114,22 @@ import ( const ( scratchByteArrayLen = 32 - initCollectionCap = 32 // 32 is defensive. 16 is preferred. + // initCollectionCap = 16 // 32 is defensive. 16 is preferred. // Support encoding.(Binary|Text)(Unm|M)arshaler. // This constant flag will enable or disable it. supportMarshalInterfaces = 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. - // - // From benchmarks, slices with linear search perform better with < 32 entries. - // We have typically seen a high threshold of about 24 entries. - useMapForCodecCache = false - // 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 - // if checkStructForEmptyValue, check structs fields to see if an empty value. - // This could be an expensive call, so possibly disable it. - checkStructForEmptyValue = false + // arrayCacheLen is the length of the cache used in encoder or decoder for + // allowing zero-alloc initialization. + arrayCacheLen = 8 - // if derefForIsEmptyValue, deref pointers and interfaces when checking isEmptyValue - derefForIsEmptyValue = false - - // if resetSliceElemToZeroValue, then on decoding a slice, reset the element to a zero value first. - // Only concern is that, if the slice already contained some garbage, we will decode into that garbage. - // The chances of this are slim, so leave this "optimization". - // TODO: should this be true, to ensure that we always decode into a "zero" "empty" value? - resetSliceElemToZeroValue bool = false + // always set xDebug = false before releasing software + xDebug = true ) var ( @@ -156,15 +137,36 @@ var ( zeroByteSlice = oneByteArr[:0:0] ) +var refBitset bitset32 + +var pool pooler + +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 findCodecFnMode uint8 + +// const ( +// findCodecFnModeMap findCodecFnMode = iota +// findCodecFnModeBinarySearch +// findCodecFnModeLinearSearch +// ) + type charEncoding uint8 const ( - c_RAW charEncoding = iota - c_UTF8 - c_UTF16LE - c_UTF16BE - c_UTF32LE - c_UTF32BE + cRAW charEncoding = iota + cUTF8 + cUTF16LE + cUTF16BE + cUTF32LE + cUTF32BE ) // valueType is the stream type @@ -182,12 +184,35 @@ const ( valueTypeBytes valueTypeMap valueTypeArray - valueTypeTimestamp + valueTypeTime valueTypeExt // 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 ( @@ -213,10 +238,10 @@ const ( containerArrayEnd ) -// sfiIdx used for tracking where a fieldName is seen in a []*structFieldInfo +// sfiIdx used for tracking where a (field/enc)Name is seen in a []*structFieldInfo type sfiIdx struct { - fieldName string - index int + name string + index int } // do not recurse if a containing type refers to an embedded type @@ -227,30 +252,26 @@ const rgetMaxRecursion = 2 // Anecdotally, we believe most types have <= 12 fields. // Java's PMD rules set TooManyFields threshold to 15. -const rgetPoolTArrayLen = 12 +const typeInfoLoadArrayLen = 12 -type rgetT struct { +type typeInfoLoad struct { fNames []string encNames []string etypes []uintptr sfis []*structFieldInfo } -type rgetPoolT struct { - fNames [rgetPoolTArrayLen]string - encNames [rgetPoolTArrayLen]string - etypes [rgetPoolTArrayLen]uintptr - sfis [rgetPoolTArrayLen]*structFieldInfo - sfiidx [rgetPoolTArrayLen]sfiIdx +type typeInfoLoadArray struct { + fNames [typeInfoLoadArrayLen]string + encNames [typeInfoLoadArrayLen]string + etypes [typeInfoLoadArrayLen]uintptr + sfis [typeInfoLoadArrayLen]*structFieldInfo + sfiidx [typeInfoLoadArrayLen]sfiIdx } -var rgetPool = sync.Pool{ - New: func() interface{} { return new(rgetPoolT) }, -} - -type containerStateRecv interface { - sendContainerState(containerState) -} +// type containerStateRecv interface { +// sendContainerState(containerState) +// } // mirror json.Marshaler and json.Unmarshaler here, // so we don't import the encoding/json package @@ -261,6 +282,8 @@ type jsonUnmarshaler interface { UnmarshalJSON([]byte) error } +// type byteAccepter func(byte) bool + var ( bigen = binary.BigEndian structInfoFieldName = "_struct" @@ -273,6 +296,8 @@ var ( stringTyp = reflect.TypeOf("") timeTyp = reflect.TypeOf(time.Time{}) rawExtTyp = reflect.TypeOf(RawExt{}) + rawTyp = reflect.TypeOf(Raw{}) + uint8Typ = reflect.TypeOf(uint8(0)) uint8SliceTyp = reflect.TypeOf([]uint8(nil)) mapBySliceTyp = reflect.TypeOf((*MapBySlice)(nil)).Elem() @@ -288,16 +313,18 @@ var ( selferTyp = reflect.TypeOf((*Selfer)(nil)).Elem() - uint8SliceTypId = reflect.ValueOf(uint8SliceTyp).Pointer() - rawExtTypId = reflect.ValueOf(rawExtTyp).Pointer() - intfTypId = reflect.ValueOf(intfTyp).Pointer() - timeTypId = reflect.ValueOf(timeTyp).Pointer() - stringTypId = reflect.ValueOf(stringTyp).Pointer() + uint8TypId = rt2id(uint8Typ) + uint8SliceTypId = rt2id(uint8SliceTyp) + rawExtTypId = rt2id(rawExtTyp) + rawTypId = rt2id(rawTyp) + intfTypId = rt2id(intfTyp) + timeTypId = rt2id(timeTyp) + stringTypId = rt2id(stringTyp) - mapStrIntfTypId = reflect.ValueOf(mapStrIntfTyp).Pointer() - mapIntfIntfTypId = reflect.ValueOf(mapIntfIntfTyp).Pointer() - intfSliceTypId = reflect.ValueOf(intfSliceTyp).Pointer() - // mapBySliceTypId = reflect.ValueOf(mapBySliceTyp).Pointer() + mapStrIntfTypId = rt2id(mapStrIntfTyp) + mapIntfIntfTypId = rt2id(mapIntfIntfTyp) + intfSliceTypId = rt2id(intfSliceTyp) + // mapBySliceTypId = rt2id(mapBySliceTyp) intBitsize uint8 = uint8(reflect.TypeOf(int(0)).Bits()) uintBitsize uint8 = uint8(reflect.TypeOf(uint(0)).Bits()) @@ -307,11 +334,41 @@ var ( chkOvf checkOverflow - noFieldNameToStructFieldInfoErr = errors.New("no field name passed to parseStructFieldInfo") + errNoFieldNameToStructFieldInfo = errors.New("no field name passed to parseStructFieldInfo") ) 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. @@ -333,9 +390,9 @@ 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 { // TypeInfos is used to get the type info for any type. // @@ -345,6 +402,7 @@ type BasicHandle struct { extHandle EncodeOptions DecodeOptions + noBuiltInTypeChecker } func (x *BasicHandle) getBasicHandle() *BasicHandle { @@ -352,10 +410,10 @@ func (x *BasicHandle) getBasicHandle() *BasicHandle { } func (x *BasicHandle) getTypeInfo(rtid uintptr, rt reflect.Type) (pti *typeInfo) { - if x.TypeInfos != nil { - return x.TypeInfos.get(rtid, rt) + if x.TypeInfos == nil { + return defTypeInfos.get(rtid, rt) } - return defTypeInfos.get(rtid, rt) + return x.TypeInfos.get(rtid, rt) } // Handle is the interface for a specific encoding format. @@ -368,8 +426,15 @@ type Handle interface { 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. // @@ -380,7 +445,7 @@ type RawExt struct { // Data is used by codecs (e.g. binc, msgpack, simple) which do custom serialization of the types Data []byte // Value represents the extension, if Data is nil. - // Value is used by codecs (e.g. cbor) which use the format to do custom serialization of the types. + // Value is used by codecs (e.g. cbor, json) which use the format to do custom serialization of the types. Value interface{} } @@ -449,59 +514,58 @@ type setExtWrapper struct { i InterfaceExt } -func (x *setExtWrapper) WriteExt(v interface{}) []byte { - if x.b == nil { - panic("BytesExt.WriteExt is not supported") +func (x *setExtWrapper) check(v bool, s string) { + if v { + panic(fmt.Errorf("%s is not supported", s)) } +} +func (x *setExtWrapper) WriteExt(v interface{}) []byte { + x.check(x.b == nil, "BytesExt.WriteExt") return x.b.WriteExt(v) } func (x *setExtWrapper) ReadExt(v interface{}, bs []byte) { - if x.b == nil { - panic("BytesExt.WriteExt is not supported") - - } + x.check(x.b == nil, "BytesExt.ReadExt") x.b.ReadExt(v, bs) } func (x *setExtWrapper) ConvertExt(v interface{}) interface{} { - if x.i == nil { - panic("InterfaceExt.ConvertExt is not supported") - - } + x.check(x.i == nil, "InterfaceExt.ConvertExt") return x.i.ConvertExt(v) } func (x *setExtWrapper) UpdateExt(dest interface{}, v interface{}) { - if x.i == nil { - panic("InterfaceExxt.UpdateExt is not supported") - - } + x.check(x.i == nil, "InterfaceExt.UpdateExt") x.i.UpdateExt(dest, v) } -// type errorString string -// func (x errorString) Error() string { return string(x) } - type binaryEncodingType struct{} -func (_ binaryEncodingType) isBinary() bool { return true } +func (binaryEncodingType) isBinary() bool { return true } type textEncodingType struct{} -func (_ textEncodingType) isBinary() bool { return false } +func (textEncodingType) isBinary() bool { return false } // noBuiltInTypes is embedded into many types which do not support builtins // e.g. msgpack, simple, cbor. -type noBuiltInTypes struct{} -func (_ noBuiltInTypes) IsBuiltinType(rt uintptr) bool { return false } -func (_ noBuiltInTypes) EncodeBuiltin(rt uintptr, v interface{}) {} -func (_ noBuiltInTypes) DecodeBuiltin(rt uintptr, v interface{}) {} +type noBuiltInTypeChecker struct{} -type noStreamingCodec struct{} +func (noBuiltInTypeChecker) IsBuiltinType(rt uintptr) bool { return false } -func (_ noStreamingCodec) CheckBreak() bool { return false } +type noBuiltInTypes struct{ noBuiltInTypeChecker } + +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 } // bigenHelper. // Users must already slice the x completely, because we will not reslice. @@ -526,19 +590,20 @@ func (z bigenHelper) writeUint64(v uint64) { } type extTypeTagFn struct { - rtid uintptr - rt reflect.Type - tag uint64 - ext Ext + rtid uintptr + rtidptr uintptr + rt reflect.Type + tag uint64 + ext Ext } type extHandle []extTypeTagFn -// DEPRECATED: Use SetBytesExt or SetInterfaceExt on the Handle instead. -// // AddExt registes an encode and decode function for a reflect.Type. // AddExt internally calls SetExt. // 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, @@ -549,32 +614,44 @@ func (o *extHandle) AddExt( return o.SetExt(rt, uint64(tag), addExtWrapper{encfn, decfn}) } -// DEPRECATED: Use SetBytesExt or SetInterfaceExt on the Handle instead. -// // 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. // -// 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 - if rt.PkgPath() == "" || rt.Kind() == reflect.Interface { - err = fmt.Errorf("codec.Handle.AddExt: Takes named type, not a pointer or interface: %T", - reflect.Zero(rt).Interface()) - return + rk := rt.Kind() + for rk == reflect.Ptr { + rt = rt.Elem() + rk = rt.Kind() } - rtid := reflect.ValueOf(rt).Pointer() - for _, v := range *o { - if v.rtid == rtid { - v.tag, v.ext = tag, ext - 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) + } + + 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??? + } + o2 := *o + if o2 == nil { + o2 = make([]extTypeTagFn, 0, 4) + *o = o2 + } else { + for i := range o2 { + v := &o2[i] + if v.rtid == rtid { + v.tag, v.ext = tag, ext + return + } } } - - if *o == nil { - *o = make([]extTypeTagFn, 0, 4) - } - *o = append(*o, extTypeTagFn{rtid, rt, tag, ext}) + rtidptr := rt2id(reflect.PtrTo(rt)) + *o = append(o2, extTypeTagFn{rtid, rtidptr, rt, tag, ext}) return } @@ -582,7 +659,7 @@ func (o extHandle) getExt(rtid uintptr) *extTypeTagFn { var v *extTypeTagFn for i := range o { v = &o[i] - if v.rtid == rtid { + if v.rtid == rtid || v.rtidptr == rtid { return v } } @@ -600,69 +677,49 @@ func (o extHandle) getExtForTag(tag uint64) *extTypeTagFn { return nil } +const maxLevelsEmbedding = 16 + type structFieldInfo struct { encName string // encode name fieldName string // field name - // only one of 'i' or 'is' can be set. If 'i' is -1, then 'is' has been set. - - is []int // (recursive/embedded) field index in struct - i int16 // field index in struct + is [maxLevelsEmbedding]uint16 // (recursive/embedded) field index in struct + nis uint8 // num levels of embedding. if 1, then it's not embedded. omitEmpty bool toArray bool // if field is _struct, is the toArray set? } -// func (si *structFieldInfo) isZero() bool { -// return si.encName == "" && len(si.is) == 0 && si.i == 0 && !si.omitEmpty && !si.toArray -// } +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) { - if si.i != -1 { - v = v.Field(int(si.i)) - return v - } +func (si *structFieldInfo) field(v reflect.Value, update bool) (rv2 reflect.Value, valid bool) { // replicate FieldByIndex - for _, x := range si.is { - for v.Kind() == reflect.Ptr { - if v.IsNil() { - if !update { - return - } - v.Set(reflect.New(v.Type().Elem())) - } - v = v.Elem() + for i, x := range si.is { + if uint8(i) == si.nis { + break } - v = v.Field(x) + if v, valid = baseStructRv(v, update); !valid { + return + } + v = v.Field(int(x)) } - return v + + return v, true } -func (si *structFieldInfo) setToZeroValue(v reflect.Value) { - if si.i != -1 { - v = v.Field(int(si.i)) - v.Set(reflect.Zero(v.Type())) - // v.Set(reflect.New(v.Type()).Elem()) - // v.Set(reflect.New(v.Type())) - } else { - // replicate FieldByIndex - for _, x := range si.is { - for v.Kind() == reflect.Ptr { - if v.IsNil() { - return - } - v = v.Elem() - } - v = v.Field(x) - } - v.Set(reflect.Zero(v.Type())) - } -} +// func (si *structFieldInfo) fieldval(v reflect.Value, update bool) reflect.Value { +// v, _ = si.field(v, update) +// return v +// } func parseStructFieldInfo(fname string, stag string) *structFieldInfo { // if fname == "" { - // panic(noFieldNameToStructFieldInfoErr) + // panic(errNoFieldNameToStructFieldInfo) // } si := structFieldInfo{ encName: fname, @@ -701,7 +758,98 @@ func (p sfiSortedByEncName) Swap(i, j int) { p[i], p[j] = p[j], p[i] } -// typeInfo keeps information about each type referenced in the encode/decode sequence. +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) { + // defer func() { fmt.Printf(">>>> found in cache2? %v\n", valid) }() + 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 +} + +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() + } + return v, true +} + +// 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 @@ -715,74 +863,79 @@ type typeInfo struct { rt reflect.Type rtid uintptr + // rv0 reflect.Value // saved zero value, used if immutableKind numMeth uint16 // number of methods - // 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 + anyOmitEmpty bool mbs bool // base type (T or *T) is a MapBySlice - bm bool // base type (T or *T) is a binaryMarshaler - bunm bool // base type (T or *T) is a binaryUnmarshaler - bmIndir int8 // number of indirections to get to binaryMarshaler type - bunmIndir int8 // number of indirections to get to binaryUnmarshaler type + // format of marshal type fields below: [btj][mu]p? OR csp? - tm bool // base type (T or *T) is a textMarshaler - tunm bool // base type (T or *T) is a textUnmarshaler - tmIndir int8 // number of indirections to get to textMarshaler type - tunmIndir int8 // number of indirections to get to textUnmarshaler type - - jm bool // base type (T or *T) is a jsonMarshaler - junm bool // base type (T or *T) is a jsonUnmarshaler - jmIndir int8 // number of indirections to get to jsonMarshaler type - junmIndir int8 // number of indirections to get to jsonUnmarshaler type - - cs bool // base type (T or *T) is a Selfer - csIndir int8 // number of indirections to get to Selfer type + 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 toArray bool // whether this (struct) type should be encoded as an array } +// define length beyond which we do a binary search instead of a linear search. +// From our testing, linear search seems faster than binary search up to 16-field structs. +// However, we set to 8 similar to what python does for hashtables. +const indexForEncNameBinarySearchThreshold = 8 + func (ti *typeInfo) indexForEncName(name string) int { // NOTE: name may be a stringView, so don't pass it to another function. //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. + sfilen := len(ti.sfi) + if sfilen < indexForEncNameBinarySearchThreshold { 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 + return -1 + } + // 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 + } return -1 } +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 map[uintptr]*typeInfo - mu sync.RWMutex + infos atomicTypeInfoSlice // formerly map[uintptr]*typeInfo, now *[]rtid2ti + mu sync.Mutex tags []string } @@ -791,7 +944,7 @@ type TypeInfos struct { // This allows users customize the struct tag keys which contain configuration // of their types. func NewTypeInfos(tags []string) *TypeInfos { - return &TypeInfos{tags: tags, infos: make(map[uintptr]*typeInfo, 64)} + return &TypeInfos{tags: tags} } func (x *TypeInfos) structTag(t reflect.StructTag) (s string) { @@ -806,90 +959,101 @@ func (x *TypeInfos) structTag(t reflect.StructTag) (s string) { return } +func (x *TypeInfos) find(sp *[]rtid2ti, rtid uintptr) (idx int, ti *typeInfo) { + // binary search. adapted from sort/search.go. + // if sp == nil { + // return -1, nil + // } + s := *sp + h, i, j := 0, 0, len(s) + for i < j { + h = i + (j-i)/2 + if s[h].rtid < rtid { + i = h + 1 + } else { + j = h + } + } + if i < len(s) && s[i].rtid == rtid { + return i, s[i].ti + } + return i, nil +} + func (x *TypeInfos) get(rtid uintptr, rt reflect.Type) (pti *typeInfo) { - var ok bool - x.mu.RLock() - pti, ok = x.infos[rtid] - x.mu.RUnlock() - if ok { - return + sp := x.infos.load() + var idx int + if sp != nil { + idx, pti = x.find(sp, rtid) + if pti != nil { + return + } + } + + rk := rt.Kind() + + if rk == reflect.Ptr { // || (rk == reflect.Interface && rtid != intfTypId) { + panic(fmt.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} + // ti.rv0 = reflect.Zero(rt) + ti.numMeth = uint16(rt.NumMethod()) - var indir int8 - if ok, indir = implementsIntf(rt, binaryMarshalerTyp); ok { - ti.bm, ti.bmIndir = true, indir - } - if ok, indir = implementsIntf(rt, binaryUnmarshalerTyp); ok { - ti.bunm, ti.bunmIndir = true, indir - } - if ok, indir = implementsIntf(rt, textMarshalerTyp); ok { - ti.tm, ti.tmIndir = true, indir - } - if ok, indir = implementsIntf(rt, textUnmarshalerTyp); ok { - ti.tunm, ti.tunmIndir = true, indir - } - if ok, indir = implementsIntf(rt, jsonMarshalerTyp); ok { - ti.jm, ti.jmIndir = true, indir - } - if ok, indir = implementsIntf(rt, jsonUnmarshalerTyp); ok { - ti.junm, ti.junmIndir = true, indir - } - if ok, indir = implementsIntf(rt, selferTyp); ok { - ti.cs, ti.csIndir = true, indir - } - if ok, _ = implementsIntf(rt, mapBySliceTyp); ok { - ti.mbs = true - } + 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.mbs, _ = implIntf(rt, mapBySliceTyp) - 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++ - } - if ptIndir == 0 { - ti.base = rt - ti.baseId = rtid - } else { - ti.base = pt - ti.baseId = reflect.ValueOf(pt).Pointer() - ti.baseIndir = ptIndir - } - - if rt.Kind() == reflect.Struct { + if rk == reflect.Struct { var omitEmpty bool if f, ok := rt.FieldByName(structInfoFieldName); ok { siInfo := parseStructFieldInfo(structInfoFieldName, x.structTag(f.Tag)) ti.toArray = siInfo.toArray omitEmpty = siInfo.omitEmpty } - pi := rgetPool.Get() - pv := pi.(*rgetPoolT) - pv.etypes[0] = ti.baseId - vv := rgetT{pv.fNames[:0], pv.encNames[:0], pv.etypes[:1], pv.sfis[:0]} + pp, pi := pool.tiLoad() + pv := pi.(*typeInfoLoadArray) + pv.etypes[0] = ti.rtid + vv := typeInfoLoad{pv.fNames[:0], pv.encNames[:0], pv.etypes[:1], pv.sfis[:0]} x.rget(rt, rtid, omitEmpty, nil, &vv) - ti.sfip, ti.sfi = rgetResolveSFI(vv.sfis, pv.sfiidx[:0]) - rgetPool.Put(pi) + ti.sfip, ti.sfi, ti.anyOmitEmpty = rgetResolveSFI(vv.sfis, pv.sfiidx[:0]) + pp.Put(pi) } // sfi = sfip + var vs []rtid2ti x.mu.Lock() - if pti, ok = x.infos[rtid]; !ok { + sp = x.infos.load() + if sp == nil { pti = &ti - x.infos[rtid] = pti + vs = []rtid2ti{{rtid, pti}} + x.infos.store(&vs) + } else { + idx, pti = x.find(sp, rtid) + if pti == nil { + s := *sp + pti = &ti + vs = make([]rtid2ti, len(s)+1) + copy(vs, s[:idx]) + vs[idx] = rtid2ti{rtid, pti} + copy(vs[idx+1:], s[idx:]) + x.infos.store(&vs) + } } x.mu.Unlock() return } func (x *TypeInfos) rget(rt reflect.Type, rtid uintptr, omitEmpty bool, - indexstack []int, pv *rgetT, + indexstack []uint16, pv *typeInfoLoad, ) { // Read up fields and store how to access the value. // @@ -899,10 +1063,13 @@ func (x *TypeInfos) rget(rt reflect.Type, rtid uintptr, omitEmpty bool, // 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< maxLevelsEmbedding-1 { + panic(fmt.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.omitEmpty = true @@ -1003,26 +1175,35 @@ LOOP: } } -// resolves the struct field info get from a call to rget2. +// resolves the struct field info got from a call to rget. // Returns a trimmed, unsorted and sorted []*structFieldInfo. -func rgetResolveSFI(x []*structFieldInfo, pv []sfiIdx) (y, z []*structFieldInfo) { +func rgetResolveSFI(x []*structFieldInfo, pv []sfiIdx) (y, z []*structFieldInfo, anyOmitEmpty bool) { var n int for i, v := range x { - xf := v.fieldName + xn := v.encName // TODO: fieldName or encName? use encName for now. var found bool - for _, k := range pv { - if k.fieldName == xf { - if len(v.is) < len(x[k.index].is) { - x[k.index] = nil - k.index = i - n++ + for j, k := range pv { + if k.name == xn { + // one of them must be reset to nil, and the index updated appropriately to the other one + if v.nis == x[k.index].nis { + } else if v.nis < x[k.index].nis { + pv[j].index = i + if x[k.index] != nil { + x[k.index] = nil + n++ + } + } else { + if x[i] != nil { + x[i] = nil + n++ + } } found = true break } } if !found { - pv = append(pv, sfiIdx{xf, i}) + pv = append(pv, sfiIdx{xn, i}) } } @@ -1033,6 +1214,9 @@ func rgetResolveSFI(x []*structFieldInfo, pv []sfiIdx) (y, z []*structFieldInfo) if v == nil { continue } + if !anyOmitEmpty && v.omitEmpty { + anyOmitEmpty = true + } y[n] = v n++ } @@ -1043,15 +1227,45 @@ func rgetResolveSFI(x []*structFieldInfo, pv []sfiIdx) (y, z []*structFieldInfo) return } +func implIntf(rt, iTyp reflect.Type) (base bool, indir bool) { + return rt.Implements(iTyp), reflect.PtrTo(rt).Implements(iTyp) +} + +// func round(x float64) float64 { +// t := math.Trunc(x) +// if math.Abs(x-t) >= 0.5 { +// return t + math.Copysign(1, x) +// } +// return t +// } + +func xprintf(format string, a ...interface{}) { + if xDebug { + fmt.Fprintf(os.Stderr, format, a...) + } +} + func panicToErr(err *error) { if recoverPanicToErr { if x := recover(); x != nil { - //debug.PrintStack() + // if false && xDebug { + // fmt.Printf("panic'ing with: %v\n", x) + // debug.PrintStack() + // } panicValToErr(x, err) } } } +func panicToErrs2(err1, err2 *error) { + if recoverPanicToErr { + if x := recover(); x != nil { + panicValToErr(x, err1) + panicValToErr(x, err2) + } + } +} + // func doPanic(tag string, format string, params ...interface{}) { // params2 := make([]interface{}, len(params)+1) // params2[0] = tag @@ -1060,35 +1274,315 @@ func panicToErr(err *error) { // } 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 + return immutableKindsSet[k] + // 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 } +// ---- + +// type codecFnInfoAddrKind uint8 +// const ( +// codecFnInfoAddrAddr codecFnInfoAddrKind = iota // default +// codecFnInfoAddrBase +// codecFnInfoAddrAddrElseBase +// ) + +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) +} + +type codecRtidFn struct { + rtid uintptr + fn codecFn +} + +type codecFner struct { + hh Handle + h *BasicHandle + cs [arrayCacheLen]*[arrayCacheLen]codecRtidFn + s []*[arrayCacheLen]codecRtidFn + sn uint32 + be bool + js bool + cf [arrayCacheLen]codecRtidFn +} + +func (c *codecFner) reset(hh Handle) { + c.hh = hh + c.h = hh.getBasicHandle() + _, c.js = hh.(*JsonHandle) + c.be = hh.isBinary() +} + +func (c *codecFner) get(rt reflect.Type, checkFastpath, checkCodecSelfer bool) (fn *codecFn) { + rtid := rt2id(rt) + var j uint32 + var sn uint32 = c.sn + if sn == 0 { + c.s = c.cs[:1] + c.s[0] = &c.cf + c.cf[0].rtid = rtid + fn = &(c.cf[0].fn) + c.sn = 1 + } else { + LOOP1: + for _, x := range c.s { + for i := range x { + if j == sn { + break LOOP1 + } + if x[i].rtid == rtid { + fn = &(x[i].fn) + return + } + j++ + } + } + sx, sy := sn/arrayCacheLen, sn%arrayCacheLen + if sy == 0 { + c.s = append(c.s, &[arrayCacheLen]codecRtidFn{}) + } + c.s[sx][sy].rtid = rtid + fn = &(c.s[sx][sy].fn) + c.sn++ + } + + ti := c.h.getTypeInfo(rtid, rt) + fi := &(fn.i) + fi.ti = ti + + rk := rt.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 { + 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 false && c.hh.IsBuiltinType(rtid) { + // TODO: remove this whole block. currently turned off with the "false &&" + // fn.fe = (*Encoder).builtin + // fn.fd = (*Decoder).builtin + // fi.addrF = true + // fi.addrD = true + } else if xfFn := c.h.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 rt.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(rt.Key(), rt.Elem()) + } else { + rtu = reflect.SliceOf(rt.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 + xfnf2 := fastpathAV[idx].decfn + fn.fd = func(d *Decoder, xf *codecFnInfo, xrv reflect.Value) { + xfnf2(d, xf, xrv.Convert(reflect.PtrTo(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.Ptr: + // fn.fd = (*Decoder).kPtr + 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(rt.Elem()) + fn.fd = func(d *Decoder, xf *codecFnInfo, xrv reflect.Value) { + // println(">>>>>> decoding an array ... ") + d.cf.get(rt2, true, false).fd(d, xf, xrv.Slice(0, xrv.Len())) + // println(">>>>>> decoding an array ... DONE") + } + // fn.fd = (*Decoder).kArray + case reflect.Struct: + if ti.anyOmitEmpty { + fn.fe = (*Encoder).kStruct + } else { + fn.fe = (*Encoder).kStructNoOmitempty + } + fn.fd = (*Decoder).kStruct + // reflect.Ptr and reflect.Interface are handled already by preEncodeValue + // case reflect.Ptr: + // fn.fe = (*Encoder).kPtr + // case reflect.Interface: + // fn.fe = (*Encoder).kInterface + 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: + fn.fe = (*Encoder).kErr + fn.fd = (*Decoder).kErr + } + } + } + + return +} + +// ---- + // these functions must be inlinable, and not call anybody type checkOverflow struct{} -func (_ checkOverflow) Float32(f float64) (overflow bool) { +func (checkOverflow) Float32(f float64) (overflow bool) { if f < 0 { f = -f } return math.MaxFloat32 < f && f <= math.MaxFloat64 } -func (_ checkOverflow) Uint(v uint64, bitsize uint8) (overflow bool) { +func (checkOverflow) Uint(v uint64, bitsize uint8) (overflow bool) { if bitsize == 0 || bitsize >= 64 || v == 0 { return } @@ -1098,7 +1592,7 @@ func (_ checkOverflow) Uint(v uint64, bitsize uint8) (overflow bool) { return } -func (_ checkOverflow) Int(v int64, bitsize uint8) (overflow bool) { +func (checkOverflow) Int(v int64, bitsize uint8) (overflow bool) { if bitsize == 0 || bitsize >= 64 || v == 0 { return } @@ -1108,7 +1602,7 @@ func (_ checkOverflow) Int(v int64, bitsize uint8) (overflow bool) { return } -func (_ checkOverflow) SignedInt(v uint64) (i int64, overflow bool) { +func (checkOverflow) SignedInt(v uint64) (i int64, overflow bool) { //e.g. -127 to 128 for int8 pos := (v >> 63) == 0 ui2 := v & 0x7fffffffffffffff @@ -1133,8 +1627,15 @@ func isNaN(f float64) bool { return f != f } // ----------------------- +type ioFlusher interface { + Flush() error +} + +// ----------------------- + type intSlice []int64 type uintSlice []uint64 +type uintptrSlice []uintptr type floatSlice []float64 type boolSlice []bool type stringSlice []string @@ -1148,6 +1649,10 @@ func (p uintSlice) Len() int { return len(p) } func (p uintSlice) Less(i, j int) bool { return p[i] < p[j] } func (p uintSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } +func (p uintptrSlice) Len() int { return len(p) } +func (p uintptrSlice) Less(i, j int) bool { return p[i] < p[j] } +func (p uintptrSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } + func (p floatSlice) Len() int { return len(p) } func (p floatSlice) Less(i, j int) bool { return p[i] < p[j] || isNaN(p[i]) && !isNaN(p[j]) @@ -1198,6 +1703,11 @@ type bytesRv struct { 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[i].v < p[j].v } @@ -1225,6 +1735,10 @@ func (p boolRvSlice) Len() int { return len(p) } func (p boolRvSlice) Less(i, j int) bool { return !p[i].v && p[j].v } func (p boolRvSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } +func (p timeRvSlice) Len() int { return len(p) } +func (p timeRvSlice) Less(i, j int) bool { return p[i].v.Before(p[j].v) } +func (p timeRvSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } + // ----------------- type bytesI struct { @@ -1244,7 +1758,6 @@ type set []uintptr func (s *set) add(v uintptr) (exists bool) { // e.ci is always nil, or len >= 1 - // defer func() { fmt.Printf("$$$$$$$$$$$ cirRef Add: %v, exists: %v\n", v, exists) }() x := *s if x == nil { x = make([]uintptr, 1, 8) @@ -1285,7 +1798,6 @@ func (s *set) add(v uintptr) (exists bool) { } func (s *set) remove(v uintptr) (exists bool) { - // defer func() { fmt.Printf("$$$$$$$$$$$ cirRef Rm: %v, exists: %v\n", v, exists) }() x := *s if len(x) == 0 { return @@ -1307,3 +1819,92 @@ func (s *set) remove(v uintptr) (exists bool) { } 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. + +// 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) set(pos byte) { + x[pos>>3] |= (1 << (pos & 7)) +} + +// func (x *bitset256) unset(pos byte) { +// x[pos>>3] &^= (1 << (pos & 7)) +// } + +type bitset128 [16]byte + +func (x *bitset128) isset(pos byte) bool { + return x[pos>>3]&(1<<(pos&7)) != 0 +} +func (x *bitset128) set(pos byte) { + x[pos>>3] |= (1 << (pos & 7)) +} + +// func (x *bitset128) unset(pos byte) { +// x[pos>>3] &^= (1 << (pos & 7)) +// } + +type bitset32 [4]byte + +func (x *bitset32) isset(pos byte) bool { + return x[pos>>3]&(1<<(pos&7)) != 0 +} +func (x *bitset32) set(pos byte) { + x[pos>>3] |= (1 << (pos & 7)) +} + +// func (x *bitset32) unset(pos byte) { +// x[pos>>3] &^= (1 << (pos & 7)) +// } + +// ------------ + +type pooler struct { + // for stringRV + strRv8, strRv16, strRv32, strRv64, strRv128 sync.Pool + // for the decNaked + dn sync.Pool + tiload sync.Pool +} + +func (p *pooler) init() { + p.strRv8.New = func() interface{} { return new([8]stringRv) } + p.strRv16.New = func() interface{} { return new([16]stringRv) } + p.strRv32.New = func() interface{} { return new([32]stringRv) } + p.strRv64.New = func() interface{} { return new([64]stringRv) } + p.strRv128.New = func() interface{} { return new([128]stringRv) } + p.dn.New = func() interface{} { x := new(decNaked); x.init(); return x } + p.tiload.New = func() interface{} { return new(typeInfoLoadArray) } +} + +func (p *pooler) stringRv8() (sp *sync.Pool, v interface{}) { + return &p.strRv8, p.strRv8.Get() +} +func (p *pooler) stringRv16() (sp *sync.Pool, v interface{}) { + return &p.strRv16, p.strRv16.Get() +} +func (p *pooler) stringRv32() (sp *sync.Pool, v interface{}) { + return &p.strRv32, p.strRv32.Get() +} +func (p *pooler) stringRv64() (sp *sync.Pool, v interface{}) { + return &p.strRv64, p.strRv64.Get() +} +func (p *pooler) stringRv128() (sp *sync.Pool, v interface{}) { + return &p.strRv128, p.strRv128.Get() +} +func (p *pooler) decNaked() (sp *sync.Pool, v interface{}) { + return &p.dn, p.dn.Get() +} +func (p *pooler) tiLoad() (sp *sync.Pool, v interface{}) { + return &p.tiload, p.tiload.Get() +} diff --git a/_vendor/vendor/github.com/ugorji/go/codec/helper_internal.go b/vendor/github.com/ugorji/go/codec/helper_internal.go similarity index 72% rename from _vendor/vendor/github.com/ugorji/go/codec/helper_internal.go rename to vendor/github.com/ugorji/go/codec/helper_internal.go index dea981f..f585203 100644 --- a/_vendor/vendor/github.com/ugorji/go/codec/helper_internal.go +++ b/vendor/github.com/ugorji/go/codec/helper_internal.go @@ -9,16 +9,13 @@ package codec import ( "errors" "fmt" - "math" "reflect" + "time" ) func panicValToErr(panicVal interface{}, err *error) { - if panicVal == nil { - return - } - // case nil switch xerr := panicVal.(type) { + case nil: case error: *err = xerr case string: @@ -49,10 +46,13 @@ func hIsEmptyValue(v reflect.Value, deref, checkStruct bool) bool { return true } return hIsEmptyValue(v.Elem(), deref, checkStruct) - } else { - return v.IsNil() } + return v.IsNil() case reflect.Struct: + // check for time.Time, and return true if IsZero + if rv2rtid(v) == timeTypId { + return rv2i(v).(time.Time).IsZero() + } if !checkStruct { return false } @@ -70,8 +70,8 @@ func hIsEmptyValue(v reflect.Value, deref, checkStruct bool) bool { return false } -func isEmptyValue(v reflect.Value) bool { - return hIsEmptyValue(v, derefForIsEmptyValue, checkStructForEmptyValue) +func isEmptyValue(v reflect.Value, deref, checkStruct bool) bool { + return hIsEmptyValue(v, deref, checkStruct) } func pruneSignExt(v []byte, pos bool) (n int) { @@ -86,37 +86,6 @@ func pruneSignExt(v []byte, pos bool) (n int) { return } -func implementsIntf(typ, iTyp reflect.Type) (success bool, indir int8) { - if typ == nil { - return - } - 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 - } - 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 - } - } - return false, 0 -} - // 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) @@ -129,21 +98,20 @@ func halfFloatToFloatBits(yy uint16) (d uint32) { if e == 0 { if m == 0 { // plu or minus 0 return s << 31 - } else { // Denormalized number -- renormalize it - for (m & 0x00000400) == 0 { - m <<= 1 - e -= 1 - } - e += 1 - const zz uint32 = 0x0400 - m &= ^zz } + // Denormalized number -- renormalize it + for (m & 0x00000400) == 0 { + m <<= 1 + e -= 1 + } + e += 1 + const zz uint32 = 0x0400 + m &= ^zz } else if e == 31 { if m == 0 { // Inf return (s << 31) | 0x7f800000 - } else { // NaN - return (s << 31) | 0x7f800000 | (m << 13) } + return (s << 31) | 0x7f800000 | (m << 13) // NaN } e = e + (127 - 15) m = m << 13 @@ -219,24 +187,3 @@ func growCap(oldCap, unit, num int) (newCap int) { } return } - -func expandSliceValue(s reflect.Value, num int) reflect.Value { - if num <= 0 { - return s - } - l0 := s.Len() - l1 := l0 + num // new slice length - if l1 < l0 { - panic("ExpandSlice: slice overflow") - } - c0 := s.Cap() - if l1 <= c0 { - return s.Slice(0, l1) - } - st := s.Type() - c1 := growCap(c0, int(st.Elem().Size()), num) - s2 := reflect.MakeSlice(st, l1, c1) - // println("expandslicevalue: cap-old: ", c0, ", cap-new: ", c1, ", len-new: ", l1) - reflect.Copy(s2, s) - return s2 -} 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 0000000..9afb192 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/helper_not_unsafe.go @@ -0,0 +1,235 @@ +// +build !go1.7 safe appengine + +// 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 + +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 unneessarily incur the cost of reflection this early. + return false + // 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 + // } +} + +// // 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 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() +} + +// -------------------------- +// type ptrToRvMap struct{} + +// func (*ptrToRvMap) init() {} +// func (*ptrToRvMap) get(i interface{}) reflect.Value { +// return reflect.ValueOf(i).Elem() +// } + +// -------------------------- +type atomicTypeInfoSlice struct { + v atomic.Value +} + +func (x *atomicTypeInfoSlice) load() *[]rtid2ti { + i := x.v.Load() + if i == nil { + return nil + } + return i.(*[]rtid2ti) +} + +func (x *atomicTypeInfoSlice) store(p *[]rtid2ti) { + x.v.Store(p) +} + +// -------------------------- +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) { + rv.SetFloat(d.d.DecodeFloat(true)) +} + +func (d *Decoder) kFloat64(f *codecFnInfo, rv reflect.Value) { + rv.SetFloat(d.d.DecodeFloat(false)) +} + +func (d *Decoder) kInt(f *codecFnInfo, rv reflect.Value) { + rv.SetInt(d.d.DecodeInt(intBitsize)) +} + +func (d *Decoder) kInt8(f *codecFnInfo, rv reflect.Value) { + rv.SetInt(d.d.DecodeInt(8)) +} + +func (d *Decoder) kInt16(f *codecFnInfo, rv reflect.Value) { + rv.SetInt(d.d.DecodeInt(16)) +} + +func (d *Decoder) kInt32(f *codecFnInfo, rv reflect.Value) { + rv.SetInt(d.d.DecodeInt(32)) +} + +func (d *Decoder) kInt64(f *codecFnInfo, rv reflect.Value) { + rv.SetInt(d.d.DecodeInt(64)) +} + +func (d *Decoder) kUint(f *codecFnInfo, rv reflect.Value) { + rv.SetUint(d.d.DecodeUint(uintBitsize)) +} + +func (d *Decoder) kUintptr(f *codecFnInfo, rv reflect.Value) { + rv.SetUint(d.d.DecodeUint(uintBitsize)) +} + +func (d *Decoder) kUint8(f *codecFnInfo, rv reflect.Value) { + rv.SetUint(d.d.DecodeUint(8)) +} + +func (d *Decoder) kUint16(f *codecFnInfo, rv reflect.Value) { + rv.SetUint(d.d.DecodeUint(16)) +} + +func (d *Decoder) kUint32(f *codecFnInfo, rv reflect.Value) { + rv.SetUint(d.d.DecodeUint(32)) +} + +func (d *Decoder) kUint64(f *codecFnInfo, rv reflect.Value) { + rv.SetUint(d.d.DecodeUint(64)) +} + +// ---------------- + +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) { + e.e.EncodeString(cUTF8, rv.String()) +} + +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()) +} 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 0000000..a765fd4 --- /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 0000000..9b4102f --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/helper_unsafe.go @@ -0,0 +1,534 @@ +// +build !safe +// +build !appengine +// +build go1.7 + +// 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 + +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 uintptr + Len int +} + +type unsafeSlice struct { + Data uintptr + 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)) + sx := unsafeString{bx.Data, bx.Len} + return *(*string)(unsafe.Pointer(&sx)) +} + +func bytesView(v string) []byte { + if len(v) == 0 { + return zeroByteSlice + } + + sx := (*unsafeString)(unsafe.Pointer(&v)) + bx := unsafeSlice{sx.Data, sx.Len, sx.Len} + return *(*[]byte)(unsafe.Pointer(&bx)) +} + +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 + + // 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) +// } + +// 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. +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 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 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}) +// } + +// -------------------------- +type atomicTypeInfoSlice struct { + v unsafe.Pointer +} + +func (x *atomicTypeInfoSlice) load() *[]rtid2ti { + return (*[]rtid2ti)(atomic.LoadPointer(&x.v)) +} + +func (x *atomicTypeInfoSlice) store(p *[]rtid2ti) { + atomic.StorePointer(&x.v, unsafe.Pointer(p)) +} + +// -------------------------- +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 (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) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*float32)(urv.ptr) = float32(d.d.DecodeFloat(true)) +} + +func (d *Decoder) kFloat64(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*float64)(urv.ptr) = d.d.DecodeFloat(false) +} + +func (d *Decoder) kInt(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*int)(urv.ptr) = int(d.d.DecodeInt(intBitsize)) +} + +func (d *Decoder) kInt8(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*int8)(urv.ptr) = int8(d.d.DecodeInt(8)) +} + +func (d *Decoder) kInt16(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*int16)(urv.ptr) = int16(d.d.DecodeInt(16)) +} + +func (d *Decoder) kInt32(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*int32)(urv.ptr) = int32(d.d.DecodeInt(32)) +} + +func (d *Decoder) kInt64(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*int64)(urv.ptr) = d.d.DecodeInt(64) +} + +func (d *Decoder) kUint(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*uint)(urv.ptr) = uint(d.d.DecodeUint(uintBitsize)) +} + +func (d *Decoder) kUintptr(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*uintptr)(urv.ptr) = uintptr(d.d.DecodeUint(uintBitsize)) +} + +func (d *Decoder) kUint8(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*uint8)(urv.ptr) = uint8(d.d.DecodeUint(8)) +} + +func (d *Decoder) kUint16(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*uint16)(urv.ptr) = uint16(d.d.DecodeUint(16)) +} + +func (d *Decoder) kUint32(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*uint32)(urv.ptr) = uint32(d.d.DecodeUint(32)) +} + +func (d *Decoder) kUint64(f *codecFnInfo, rv reflect.Value) { + urv := (*unsafeReflectValue)(unsafe.Pointer(&rv)) + *(*uint64)(urv.ptr) = d.d.DecodeUint(64) +} + +// ------------ + +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)) + e.e.EncodeString(cUTF8, *(*string)(v.ptr)) +} + +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 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 0000000..54972f8 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/json.go @@ -0,0 +1,1210 @@ +// 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 + +// 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. +// - Also, strconv.ParseXXX for floats and integers +// - only works on strings resulting in unnecessary allocation and []byte-string conversion. +// - it does a lot of redundant checks, because json numbers are simpler that what it supports. +// - We parse numbers (floats and integers) directly here. +// We only delegate parsing floats if it is a hairy float which could cause a loss of precision. +// In that case, we delegate to strconv.ParseFloat. +// +// Note: +// - encode does not beautify. There is no whitespace when encoding. +// - rpc calls which take single integer arguments or write single numeric arguments will need care. + +// Top-level methods of json(End|Dec)Driver (which are implementations of (en|de)cDriver +// MUST not call one-another. + +import ( + "bytes" + "encoding/base64" + "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 ( + // jsonFloat64Pow10 = [...]float64{ + // 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, + // 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, + // 1e20, 1e21, 1e22, + // } + + // jsonUint64Pow10 = [...]uint64{ + // 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, + // 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, + // } + + // jsonTabs and jsonSpaces are used as caches for indents + jsonTabs, jsonSpaces string + + jsonCharHtmlSafeSet bitset128 + jsonCharSafeSet bitset128 + jsonCharWhitespaceSet bitset256 + jsonNumSet bitset256 + // jsonIsFloatSet bitset256 + + jsonU4Set [256]byte +) + +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 + + jsonU4SetErrVal = 128 + + jsonAlwaysReturnInternString = false +) + +func init() { + var bs [jsonSpacesOrTabsLen]byte + for i := 0; i < jsonSpacesOrTabsLen; i++ { + bs[i] = ' ' + } + jsonSpaces = string(bs[:]) + + for i := 0; i < jsonSpacesOrTabsLen; i++ { + bs[i] = '\t' + } + jsonTabs = string(bs[:]) + + // 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) " \ < > & + var i byte + 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) + } + } + for j := range jsonU4Set { + switch i = byte(j); i { + case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': + jsonU4Set[i] = i - '0' + case 'a', 'b', 'c', 'd', 'e', 'f': + jsonU4Set[i] = i - 'a' + 10 + case 'A', 'B', 'C', 'D', 'E', 'F': + jsonU4Set[i] = i - 'A' + 10 + default: + jsonU4Set[i] = jsonU4SetErrVal + } + // switch i = byte(j); i { + // case 'e', 'E', '.': + // jsonIsFloatSet.set(i) + // } + } + // jsonU4Set[255] = jsonU4SetErrVal +} + +type jsonEncDriver struct { + e *Encoder + w encWriter + h *JsonHandle + b [64]byte // scratch + bs []byte // scratch + se setExtWrapper + ds string // indent string + dl uint16 // indent level + dt bool // indent using tabs + d bool // indent + c containerState + noBuiltInTypes +} + +// 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 *jsonEncDriver) WriteArrayStart(length int) { + if e.d { + e.dl++ + } + e.w.writen1('[') + e.c = containerArrayStart +} + +func (e *jsonEncDriver) WriteArrayElem() { + if e.c != containerArrayStart { + e.w.writen1(',') + } + if e.d { + e.writeIndent() + } + e.c = containerArrayElem +} + +func (e *jsonEncDriver) WriteArrayEnd() { + if e.d { + e.dl-- + if e.c != containerArrayStart { + e.writeIndent() + } + } + e.w.writen1(']') + e.c = containerArrayEnd +} + +func (e *jsonEncDriver) WriteMapStart(length int) { + if e.d { + e.dl++ + } + e.w.writen1('{') + e.c = containerMapStart +} + +func (e *jsonEncDriver) WriteMapElemKey() { + if e.c != containerMapStart { + e.w.writen1(',') + } + if e.d { + e.writeIndent() + } + e.c = containerMapKey +} + +func (e *jsonEncDriver) WriteMapElemValue() { + if e.d { + e.w.writen2(':', ' ') + } else { + e.w.writen1(':') + } + e.c = containerMapValue +} + +func (e *jsonEncDriver) WriteMapEnd() { + if e.d { + e.dl-- + if e.c != containerMapStart { + e.writeIndent() + } + } + e.w.writen1('}') + e.c = containerMapEnd +} + +func (e *jsonEncDriver) writeIndent() { + e.w.writen1('\n') + if x := len(e.ds) * int(e.dl); x <= jsonSpacesOrTabsLen { + if e.dt { + e.w.writestr(jsonTabs[:x]) + } else { + e.w.writestr(jsonSpaces[:x]) + } + } else { + for i := uint16(0); i < e.dl; i++ { + e.w.writestr(e.ds) + } + } +} + +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.w.writeb(jsonLiterals[jsonLitNull : jsonLitNull+4]) + + // if e.h.MapKeyAsString && e.c == containerMapKey { + // e.w.writeb(jsonLiterals[jsonLitNullQ : jsonLitNullQ+6]) + // } else { + // e.w.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.w.writeb(e.b[:len(b)+2]) + } + // fmt.Printf(">>>> time as a string: '%s'\n", e.b[:len(b)+2]) + // v, err := t.MarshalJSON(); if err != nil { e.e.error(err) } e.w.writeb(v) +} + +func (e *jsonEncDriver) EncodeBool(b bool) { + if e.h.MapKeyAsString && 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 *jsonEncDriver) EncodeFloat32(f float32) { + e.encodeFloat(float64(f), 32) +} + +func (e *jsonEncDriver) EncodeFloat64(f float64) { + e.encodeFloat(f, 64) +} + +func (e *jsonEncDriver) encodeFloat(f float64, numbits int) { + var blen int + var x []byte + if e.h.MapKeyAsString && e.c == containerMapKey { + e.b[0] = '"' + x = strconv.AppendFloat(e.b[1:1], f, 'G', -1, numbits) + blen = 1 + len(x) + if jsonIsFloatBytesB2(x) { + e.b[blen] = '"' + blen += 1 + } else { + e.b[blen] = '.' + e.b[blen+1] = '0' + e.b[blen+2] = '"' + blen += 3 + } + } else { + x = strconv.AppendFloat(e.b[:0], f, 'G', -1, numbits) + blen = len(x) + if !jsonIsFloatBytesB2(x) { + e.b[blen] = '.' + e.b[blen+1] = '0' + blen += 2 + } + } + e.w.writeb(e.b[:blen]) +} + +func (e *jsonEncDriver) EncodeInt(v int64) { + x := e.h.IntegerAsString + if x == 'A' || x == 'L' && (v > 1<<53 || v < -(1<<53)) || (e.h.MapKeyAsString && 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 *jsonEncDriver) EncodeUint(v uint64) { + x := e.h.IntegerAsString + if x == 'A' || x == 'L' && v > 1<<53 || (e.h.MapKeyAsString && 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 *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) EncodeSymbol(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.i != nil { + e.EncodeExt(v, 0, &e.se, e.e) + return + } + + slen := base64.StdEncoding.EncodedLen(len(v)) + if cap(e.bs) >= slen { + e.bs = e.bs[:slen] + } else { + e.bs = make([]byte, slen) + } + base64.StdEncoding.Encode(e.bs, v) + e.w.writen1('"') + e.w.writeb(e.bs) + e.w.writen1('"') + } else { + e.quoteStr(stringView(v)) + } +} + +func (e *jsonEncDriver) EncodeAsis(v []byte) { + e.w.writeb(v) +} + +func (e *jsonEncDriver) quoteStr(s string) { + // adapted from std pkg encoding/json + const hex = "0123456789abcdef" + w := e.w + 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 jsonCharHtmlSafeSet.isset(b) || (e.h.HTMLCharsAsIs && 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('"') +} + +func (e *jsonEncDriver) atEndOfEncode() { + if e.h.TermWhitespace { + if e.d { + e.w.writen1('\n') + } else { + e.w.writen1(' ') + } + } +} + +type jsonDecDriver struct { + noBuiltInTypes + d *Decoder + h *JsonHandle + r decReader + + c containerState + // tok is used to store the token read right after skipWhiteSpace. + tok uint8 + + fnull bool // found null from appendStringAsBytes + + bstr [8]byte // scratch used for string \UXXX parsing + b [64]byte // scratch, used for parsing strings or numbers or time.Time + b2 [64]byte // scratch, used only for decodeBytes (after base64) + bs []byte // scratch. Initialized from b. Used for parsing strings or numbers. + + se setExtWrapper + + // 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) + } + if d.tok != '{' { + d.d.errorf("json: expect char '%c' but got char '%c'", '{', 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) + } + if d.tok != '[' { + d.d.errorf("json: expect char '%c' but got char '%c'", '[', 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 == ']' +} + +func (d *jsonDecDriver) ReadArrayElem() { + if d.tok == 0 { + d.tok = d.r.skip(&jsonCharWhitespaceSet) + } + if d.c != containerArrayStart { + const xc uint8 = ',' + if d.tok != xc { + d.d.errorf("json: expect char '%c' but got char '%c'", xc, d.tok) + } + d.tok = 0 + } + d.c = containerArrayElem +} + +func (d *jsonDecDriver) ReadArrayEnd() { + if d.tok == 0 { + d.tok = d.r.skip(&jsonCharWhitespaceSet) + } + const xc uint8 = ']' + if d.tok != xc { + d.d.errorf("json: expect char '%c' but got char '%c'", xc, d.tok) + } + d.tok = 0 + d.c = containerArrayEnd +} + +func (d *jsonDecDriver) ReadMapElemKey() { + if d.tok == 0 { + d.tok = d.r.skip(&jsonCharWhitespaceSet) + } + if d.c != containerMapStart { + const xc uint8 = ',' + if d.tok != xc { + d.d.errorf("json: expect char '%c' but got char '%c'", xc, d.tok) + } + d.tok = 0 + } + d.c = containerMapKey +} + +func (d *jsonDecDriver) ReadMapElemValue() { + if d.tok == 0 { + d.tok = d.r.skip(&jsonCharWhitespaceSet) + } + const xc uint8 = ':' + if d.tok != xc { + d.d.errorf("json: expect char '%c' but got char '%c'", xc, d.tok) + } + d.tok = 0 + d.c = containerMapValue +} + +func (d *jsonDecDriver) ReadMapEnd() { + if d.tok == 0 { + d.tok = d.r.skip(&jsonCharWhitespaceSet) + } + const xc uint8 = '}' + if d.tok != xc { + d.d.errorf("json: expect char '%c' but got char '%c'", xc, d.tok) + } + d.tok = 0 + d.c = containerMapEnd +} + +// func (d *jsonDecDriver) readContainerState(c containerState, xc uint8, check bool) { +// if d.tok == 0 { +// d.tok = d.r.skip(&jsonCharWhitespaceSet) +// } +// if check { +// if d.tok != xc { +// d.d.errorf("json: expect char '%c' but got char '%c'", xc, d.tok) +// } +// d.tok = 0 +// } +// d.c = c +// } + +func (d *jsonDecDriver) readLit(length, fromIdx uint8) { + bs := d.r.readx(int(length)) + d.tok = 0 + if jsonValidateSymbols && !bytes.Equal(bs, jsonLiterals[fromIdx:fromIdx+length]) { + d.d.errorf("json: expecting %s: got %s", jsonLiterals[fromIdx:fromIdx+length], bs) + return + } +} + +func (d *jsonDecDriver) TryDecodeAsNil() bool { + if d.tok == 0 { + d.tok = d.r.skip(&jsonCharWhitespaceSet) + } + // TODO: we shouldn't try to see if "null" was here, right? + // only "null" denotes a nil + if d.tok == 'n' { + d.readLit(3, jsonLitNull+1) // (n)ull + 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.readLit(4, jsonLitFalse+1) // (f)alse + // v = false + case 't': + d.readLit(3, jsonLitTrue+1) // (t)rue + v = true + default: + d.d.errorf("json: 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.error(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) + } + 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 + // d.d.errorf("isContainerType: unsupported parameter: %v", vt) + // return false // "unreachable" +} + +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) DecodeUint(bitsize uint8) (u uint64) { + bs := d.decNumBytes() + u, err := strconv.ParseUint(stringView(bs), 10, int(bitsize)) + if err != nil { + d.d.errorf("json: decode uint from %s: %v", bs, err) + return + } + return +} + +func (d *jsonDecDriver) DecodeInt(bitsize uint8) (i int64) { + bs := d.decNumBytes() + i, err := strconv.ParseInt(stringView(bs), 10, int(bitsize)) + if err != nil { + d.d.errorf("json: decode int from %s: %v", bs, err) + return + } + return +} + +func (d *jsonDecDriver) DecodeFloat(chkOverflow32 bool) (f float64) { + bs := d.decNumBytes() + bitsize := 64 + if chkOverflow32 { + bitsize = 32 + } + f, err := strconv.ParseFloat(stringView(bs), bitsize) + if err != nil { + d.d.errorf("json: decode float from %s: %v", bs, err) + return + } + 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.i != 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("json: 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("json: 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.readLit(3, jsonLitNull+1) // (n)ull + d.bs = d.bs[:0] + d.fnull = true + case 'f': + d.readLit(4, jsonLitFalse+1) // (f)alse + d.bs = d.bs[:5] + copy(d.bs, "false") + case 't': + d.readLit(3, jsonLitTrue+1) // (t)rue + d.bs = d.bs[:4] + copy(d.bs, "true") + default: + // try to parse a valid number + bs := d.decNumBytes() + d.bs = d.bs[:len(bs)] + copy(d.bs, bs) + } + return + } + + d.tok = 0 + r := d.r + var cs = r.readUntil(d.b2[:0], '"') + var cslen = 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 + for i, cursor := 0, 0; ; { + if i == cslen { + v = append(v, cs[cursor:]...) + cs = r.readUntil(d.b2[:0], '"') + cslen = 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 len(cs) < i+4 { // may help reduce bounds-checking + d.d.errorf(`json: need at least 4 more bytes for unicode sequence`) + } + // c = cs[i+4] // may help reduce bounds-checking + for j := 1; j < 5; j++ { + c = jsonU4Set[cs[i+j]] + if c == jsonU4SetErrVal { + // d.d.errorf(`json: unquoteStr: invalid hex char in \u unicode sequence: %q`, c) + r = unicode.ReplacementChar + i += 4 + goto encode_rune + } + rr = rr*16 + uint32(c) + } + r = rune(rr) + i += 4 + if utf16.IsSurrogate(r) { + if len(cs) >= i+6 && cs[i+2] == 'u' && cs[i+1] == '\\' { + i += 2 + // c = cs[i+4] // may help reduce bounds-checking + var rr1 uint32 + for j := 1; j < 5; j++ { + c = jsonU4Set[cs[i+j]] + if c == jsonU4SetErrVal { + // d.d.errorf(`json: unquoteStr: invalid hex char in \u unicode sequence: %q`, c) + r = unicode.ReplacementChar + i += 4 + goto encode_rune + } + rr1 = rr1*16 + uint32(c) + } + r = utf16.DecodeRune(r, rune(rr1)) + i += 4 + } else { + r = unicode.ReplacementChar + goto encode_rune + } + } + encode_rune: + w2 := utf8.EncodeRune(d.bstr[:], r) + v = append(v, d.bstr[:w2]...) + default: + d.d.errorf("json: unsupported escaped value: %c", c) + } + i++ + cursor = i + } + d.bs = v +} + +func (d *jsonDecDriver) nakedNum(z *decNaked, bs []byte) (err error) { + if d.h.PreferFloat || jsonIsFloatBytesB3(bs) { // bytes.IndexByte(bs, '.') != -1 ||... + // } else if d.h.PreferFloat || bytes.ContainsAny(bs, ".eE") { + z.v = valueTypeFloat + z.f, err = strconv.ParseFloat(stringView(bs), 64) + } else if d.h.SignedInteger || bs[0] == '-' { + z.v = valueTypeInt + z.i, err = strconv.ParseInt(stringView(bs), 10, 64) + } else { + z.v = valueTypeUint + z.u, err = strconv.ParseUint(stringView(bs), 10, 64) + } + if err != nil && z.v != valueTypeFloat { + if v, ok := err.(*strconv.NumError); ok && (v.Err == strconv.ErrRange || v.Err == strconv.ErrSyntax) { + 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.n + // var decodeFurther bool + + if d.tok == 0 { + d.tok = d.r.skip(&jsonCharWhitespaceSet) + } + switch d.tok { + case 'n': + d.readLit(3, jsonLitNull+1) // (n)ull + z.v = valueTypeNil + case 'f': + d.readLit(4, jsonLitFalse+1) // (f)alse + z.v = valueTypeBool + z.b = false + case 't': + d.readLit(3, jsonLitTrue+1) // (t)rue + 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("json: decode number from empty string") + return + } + if err := d.nakedNum(z, bs); err != nil { + d.d.errorf("json: decode number from %s: %v", bs, err) + return + } + } + // if decodeFurther { + // d.s.sc.retryRead() + // } + return +} + +//---------------------- + +// JsonHandle is a handle for JSON encoding format. +// +// Json is comprehensively supported: +// - decodes numbers into interface{} as int, uint or float64 +// - 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 and +// minimizing allocations. +// +// 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 + + // 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 + + // 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 uint8 + + // 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 +} + +func (h *JsonHandle) hasElemSeparators() bool { return true } + +// SetInterfaceExt sets an extension +func (h *JsonHandle) SetInterfaceExt(rt reflect.Type, tag uint64, ext InterfaceExt) (err error) { + return h.SetExt(rt, tag, &setExtWrapper{i: ext}) +} + +func (h *JsonHandle) newEncDriver(e *Encoder) encDriver { + hd := jsonEncDriver{e: e, h: h} + hd.bs = hd.b[:0] + + hd.reset() + + return &hd +} + +func (h *JsonHandle) newDecDriver(d *Decoder) decDriver { + // d := jsonDecDriver{r: r.(*bytesDecReader), h: h} + hd := jsonDecDriver{d: d, h: h} + hd.bs = hd.b[:0] + hd.reset() + return &hd +} + +func (e *jsonEncDriver) reset() { + e.w = e.e.w + e.se.i = e.h.RawBytesExt + if e.bs != nil { + e.bs = e.bs[:0] + } + e.d, e.dt, e.dl, e.ds = false, false, 0, "" + e.c = 0 + if e.h.Indent > 0 { + e.d = true + e.ds = jsonSpaces[:e.h.Indent] + } else if e.h.Indent < 0 { + e.d = true + e.dt = true + e.ds = jsonTabs[:-(e.h.Indent)] + } +} + +func (d *jsonDecDriver) reset() { + d.r = d.d.r + d.se.i = d.h.RawBytesExt + if d.bs != nil { + d.bs = d.bs[:0] + } + d.c, d.tok = 0, 0 + // d.n.reset() +} + +// func jsonIsFloatBytes(bs []byte) bool { +// for _, v := range bs { +// // if v == '.' || v == 'e' || v == 'E' { +// if jsonIsFloatSet.isset(v) { +// return true +// } +// } +// return false +// } + +func jsonIsFloatBytesB2(bs []byte) bool { + return bytes.IndexByte(bs, '.') != -1 || + bytes.IndexByte(bs, 'E') != -1 +} + +func jsonIsFloatBytesB3(bs []byte) bool { + return bytes.IndexByte(bs, '.') != -1 || + bytes.IndexByte(bs, 'E') != -1 || + bytes.IndexByte(bs, 'e') != -1 +} + +var _ decDriver = (*jsonDecDriver)(nil) +var _ encDriver = (*jsonEncDriver)(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 0000000..90d758c --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/mammoth-test.go.tmpl @@ -0,0 +1,154 @@ +// 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. + +// 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 0000000..7cdf8f5 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/mammoth2-test.go.tmpl @@ -0,0 +1,94 @@ +// +build !notfastpath + +// 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. + +// 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 0000000..9b80fe1 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/mammoth2_codecgen_generated_test.go @@ -0,0 +1,44995 @@ +// +build !notfastpath + +// Code generated by codecgen - DO NOT EDIT. + +package codec + +import ( + "errors" + "fmt" + "reflect" + "runtime" +) + +const ( + // ----- content types ---- + codecSelferCcUTF819781 = 1 + codecSelferCcRAW19781 = 0 + // ----- value types used ---- + codecSelferValueTypeArray19781 = 10 + codecSelferValueTypeMap19781 = 9 +) + +var ( + codecSelferBitsize19781 = uint8(reflect.TypeOf(uint(0)).Bits()) + errCodecSelferOnlyMapOrArrayEncodeToStruct19781 = errors.New(`only encoded map or array can be decoded into a struct`) +) + +type codecSelfer19781 struct{} + +func init() { + if GenVersion != 8 { + _, file, _, _ := runtime.Caller(0) + err := fmt.Errorf("codecgen version mismatch: current: %v, need %v. Re-generate file: %v", + 8, GenVersion, file) + panic(err) + } + if false { // 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 { + yym1 := z.EncBinary() + _ = yym1 + 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 + if yyr2 || yy2arr2 { + r.WriteArrayStart(576) + } else { + r.WriteMapStart(576) + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FIntf == nil { + r.EncodeNil() + } else { + yym4 := z.EncBinary() + _ = yym4 + if false { + } else { + z.EncFallback(x.FIntf) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FIntf`) + r.WriteMapElemValue() + if x.FIntf == nil { + r.EncodeNil() + } else { + yym5 := z.EncBinary() + _ = yym5 + 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 + yym8 := z.EncBinary() + _ = yym8 + if false { + } else { + z.EncFallback(yy7) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrIntf`) + r.WriteMapElemValue() + if yyn6 { + r.EncodeNil() + } else { + if x.FptrIntf == nil { + r.EncodeNil() + } else { + yy9 := *x.FptrIntf + yym10 := z.EncBinary() + _ = yym10 + if false { + } else { + z.EncFallback(yy9) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + yym12 := z.EncBinary() + _ = yym12 + if false { + } else { + r.EncodeString(codecSelferCcUTF819781, string(x.FString)) + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FString`) + r.WriteMapElemValue() + yym13 := z.EncBinary() + _ = yym13 + if false { + } else { + r.EncodeString(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 + yym16 := z.EncBinary() + _ = yym16 + if false { + } else { + r.EncodeString(codecSelferCcUTF819781, string(yy15)) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrString`) + r.WriteMapElemValue() + if yyn14 { + r.EncodeNil() + } else { + if x.FptrString == nil { + r.EncodeNil() + } else { + yy17 := *x.FptrString + yym18 := z.EncBinary() + _ = yym18 + if false { + } else { + r.EncodeString(codecSelferCcUTF819781, string(yy17)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + yym20 := z.EncBinary() + _ = yym20 + if false { + } else { + r.EncodeFloat32(float32(x.FFloat32)) + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FFloat32`) + r.WriteMapElemValue() + yym21 := z.EncBinary() + _ = yym21 + 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 + yym24 := z.EncBinary() + _ = yym24 + if false { + } else { + r.EncodeFloat32(float32(yy23)) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrFloat32`) + r.WriteMapElemValue() + if yyn22 { + r.EncodeNil() + } else { + if x.FptrFloat32 == nil { + r.EncodeNil() + } else { + yy25 := *x.FptrFloat32 + yym26 := z.EncBinary() + _ = yym26 + if false { + } else { + r.EncodeFloat32(float32(yy25)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + yym28 := z.EncBinary() + _ = yym28 + if false { + } else { + r.EncodeFloat64(float64(x.FFloat64)) + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FFloat64`) + r.WriteMapElemValue() + yym29 := z.EncBinary() + _ = yym29 + 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 + yym32 := z.EncBinary() + _ = yym32 + if false { + } else { + r.EncodeFloat64(float64(yy31)) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrFloat64`) + r.WriteMapElemValue() + if yyn30 { + r.EncodeNil() + } else { + if x.FptrFloat64 == nil { + r.EncodeNil() + } else { + yy33 := *x.FptrFloat64 + yym34 := z.EncBinary() + _ = yym34 + if false { + } else { + r.EncodeFloat64(float64(yy33)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + yym36 := z.EncBinary() + _ = yym36 + if false { + } else { + r.EncodeUint(uint64(x.FUint)) + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FUint`) + r.WriteMapElemValue() + yym37 := z.EncBinary() + _ = yym37 + 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 + yym40 := z.EncBinary() + _ = yym40 + if false { + } else { + r.EncodeUint(uint64(yy39)) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrUint`) + r.WriteMapElemValue() + if yyn38 { + r.EncodeNil() + } else { + if x.FptrUint == nil { + r.EncodeNil() + } else { + yy41 := *x.FptrUint + yym42 := z.EncBinary() + _ = yym42 + if false { + } else { + r.EncodeUint(uint64(yy41)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + yym44 := z.EncBinary() + _ = yym44 + if false { + } else { + r.EncodeUint(uint64(x.FUint8)) + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FUint8`) + r.WriteMapElemValue() + yym45 := z.EncBinary() + _ = yym45 + 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 + yym48 := z.EncBinary() + _ = yym48 + if false { + } else { + r.EncodeUint(uint64(yy47)) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrUint8`) + r.WriteMapElemValue() + if yyn46 { + r.EncodeNil() + } else { + if x.FptrUint8 == nil { + r.EncodeNil() + } else { + yy49 := *x.FptrUint8 + yym50 := z.EncBinary() + _ = yym50 + if false { + } else { + r.EncodeUint(uint64(yy49)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + yym52 := z.EncBinary() + _ = yym52 + if false { + } else { + r.EncodeUint(uint64(x.FUint16)) + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FUint16`) + r.WriteMapElemValue() + yym53 := z.EncBinary() + _ = yym53 + 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 + yym56 := z.EncBinary() + _ = yym56 + if false { + } else { + r.EncodeUint(uint64(yy55)) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrUint16`) + r.WriteMapElemValue() + if yyn54 { + r.EncodeNil() + } else { + if x.FptrUint16 == nil { + r.EncodeNil() + } else { + yy57 := *x.FptrUint16 + yym58 := z.EncBinary() + _ = yym58 + if false { + } else { + r.EncodeUint(uint64(yy57)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + yym60 := z.EncBinary() + _ = yym60 + if false { + } else { + r.EncodeUint(uint64(x.FUint32)) + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FUint32`) + r.WriteMapElemValue() + yym61 := z.EncBinary() + _ = yym61 + 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 + yym64 := z.EncBinary() + _ = yym64 + if false { + } else { + r.EncodeUint(uint64(yy63)) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrUint32`) + r.WriteMapElemValue() + if yyn62 { + r.EncodeNil() + } else { + if x.FptrUint32 == nil { + r.EncodeNil() + } else { + yy65 := *x.FptrUint32 + yym66 := z.EncBinary() + _ = yym66 + if false { + } else { + r.EncodeUint(uint64(yy65)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + yym68 := z.EncBinary() + _ = yym68 + if false { + } else { + r.EncodeUint(uint64(x.FUint64)) + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FUint64`) + r.WriteMapElemValue() + yym69 := z.EncBinary() + _ = yym69 + 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 + yym72 := z.EncBinary() + _ = yym72 + if false { + } else { + r.EncodeUint(uint64(yy71)) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrUint64`) + r.WriteMapElemValue() + if yyn70 { + r.EncodeNil() + } else { + if x.FptrUint64 == nil { + r.EncodeNil() + } else { + yy73 := *x.FptrUint64 + yym74 := z.EncBinary() + _ = yym74 + if false { + } else { + r.EncodeUint(uint64(yy73)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + yym76 := z.EncBinary() + _ = yym76 + if false { + } else { + r.EncodeUint(uint64(x.FUintptr)) + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FUintptr`) + r.WriteMapElemValue() + yym77 := z.EncBinary() + _ = yym77 + 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 + yym80 := z.EncBinary() + _ = yym80 + if false { + } else { + r.EncodeUint(uint64(yy79)) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrUintptr`) + r.WriteMapElemValue() + if yyn78 { + r.EncodeNil() + } else { + if x.FptrUintptr == nil { + r.EncodeNil() + } else { + yy81 := *x.FptrUintptr + yym82 := z.EncBinary() + _ = yym82 + if false { + } else { + r.EncodeUint(uint64(yy81)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + yym84 := z.EncBinary() + _ = yym84 + if false { + } else { + r.EncodeInt(int64(x.FInt)) + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FInt`) + r.WriteMapElemValue() + yym85 := z.EncBinary() + _ = yym85 + 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 + yym88 := z.EncBinary() + _ = yym88 + if false { + } else { + r.EncodeInt(int64(yy87)) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrInt`) + r.WriteMapElemValue() + if yyn86 { + r.EncodeNil() + } else { + if x.FptrInt == nil { + r.EncodeNil() + } else { + yy89 := *x.FptrInt + yym90 := z.EncBinary() + _ = yym90 + if false { + } else { + r.EncodeInt(int64(yy89)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + yym92 := z.EncBinary() + _ = yym92 + if false { + } else { + r.EncodeInt(int64(x.FInt8)) + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FInt8`) + r.WriteMapElemValue() + yym93 := z.EncBinary() + _ = yym93 + 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 + yym96 := z.EncBinary() + _ = yym96 + if false { + } else { + r.EncodeInt(int64(yy95)) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrInt8`) + r.WriteMapElemValue() + if yyn94 { + r.EncodeNil() + } else { + if x.FptrInt8 == nil { + r.EncodeNil() + } else { + yy97 := *x.FptrInt8 + yym98 := z.EncBinary() + _ = yym98 + if false { + } else { + r.EncodeInt(int64(yy97)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + yym100 := z.EncBinary() + _ = yym100 + if false { + } else { + r.EncodeInt(int64(x.FInt16)) + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FInt16`) + r.WriteMapElemValue() + yym101 := z.EncBinary() + _ = yym101 + 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 + yym104 := z.EncBinary() + _ = yym104 + if false { + } else { + r.EncodeInt(int64(yy103)) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrInt16`) + r.WriteMapElemValue() + if yyn102 { + r.EncodeNil() + } else { + if x.FptrInt16 == nil { + r.EncodeNil() + } else { + yy105 := *x.FptrInt16 + yym106 := z.EncBinary() + _ = yym106 + if false { + } else { + r.EncodeInt(int64(yy105)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + yym108 := z.EncBinary() + _ = yym108 + if false { + } else { + r.EncodeInt(int64(x.FInt32)) + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FInt32`) + r.WriteMapElemValue() + yym109 := z.EncBinary() + _ = yym109 + 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 + yym112 := z.EncBinary() + _ = yym112 + if false { + } else { + r.EncodeInt(int64(yy111)) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrInt32`) + r.WriteMapElemValue() + if yyn110 { + r.EncodeNil() + } else { + if x.FptrInt32 == nil { + r.EncodeNil() + } else { + yy113 := *x.FptrInt32 + yym114 := z.EncBinary() + _ = yym114 + if false { + } else { + r.EncodeInt(int64(yy113)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + yym116 := z.EncBinary() + _ = yym116 + if false { + } else { + r.EncodeInt(int64(x.FInt64)) + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FInt64`) + r.WriteMapElemValue() + yym117 := z.EncBinary() + _ = yym117 + 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 + yym120 := z.EncBinary() + _ = yym120 + if false { + } else { + r.EncodeInt(int64(yy119)) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrInt64`) + r.WriteMapElemValue() + if yyn118 { + r.EncodeNil() + } else { + if x.FptrInt64 == nil { + r.EncodeNil() + } else { + yy121 := *x.FptrInt64 + yym122 := z.EncBinary() + _ = yym122 + if false { + } else { + r.EncodeInt(int64(yy121)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + yym124 := z.EncBinary() + _ = yym124 + if false { + } else { + r.EncodeBool(bool(x.FBool)) + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FBool`) + r.WriteMapElemValue() + yym125 := z.EncBinary() + _ = yym125 + 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 + yym128 := z.EncBinary() + _ = yym128 + if false { + } else { + r.EncodeBool(bool(yy127)) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrBool`) + r.WriteMapElemValue() + if yyn126 { + r.EncodeNil() + } else { + if x.FptrBool == nil { + r.EncodeNil() + } else { + yy129 := *x.FptrBool + yym130 := z.EncBinary() + _ = yym130 + if false { + } else { + r.EncodeBool(bool(yy129)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceIntf == nil { + r.EncodeNil() + } else { + yym132 := z.EncBinary() + _ = yym132 + if false { + } else { + z.F.EncSliceIntfV(x.FSliceIntf, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FSliceIntf`) + r.WriteMapElemValue() + if x.FSliceIntf == nil { + r.EncodeNil() + } else { + yym133 := z.EncBinary() + _ = yym133 + 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 + yym136 := z.EncBinary() + _ = yym136 + if false { + } else { + z.F.EncSliceIntfV(yy135, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrSliceIntf`) + r.WriteMapElemValue() + if yyn134 { + r.EncodeNil() + } else { + if x.FptrSliceIntf == nil { + r.EncodeNil() + } else { + yy137 := *x.FptrSliceIntf + yym138 := z.EncBinary() + _ = yym138 + if false { + } else { + z.F.EncSliceIntfV(yy137, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceString == nil { + r.EncodeNil() + } else { + yym140 := z.EncBinary() + _ = yym140 + if false { + } else { + z.F.EncSliceStringV(x.FSliceString, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FSliceString`) + r.WriteMapElemValue() + if x.FSliceString == nil { + r.EncodeNil() + } else { + yym141 := z.EncBinary() + _ = yym141 + 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 + yym144 := z.EncBinary() + _ = yym144 + if false { + } else { + z.F.EncSliceStringV(yy143, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrSliceString`) + r.WriteMapElemValue() + if yyn142 { + r.EncodeNil() + } else { + if x.FptrSliceString == nil { + r.EncodeNil() + } else { + yy145 := *x.FptrSliceString + yym146 := z.EncBinary() + _ = yym146 + if false { + } else { + z.F.EncSliceStringV(yy145, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceFloat32 == nil { + r.EncodeNil() + } else { + yym148 := z.EncBinary() + _ = yym148 + if false { + } else { + z.F.EncSliceFloat32V(x.FSliceFloat32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FSliceFloat32`) + r.WriteMapElemValue() + if x.FSliceFloat32 == nil { + r.EncodeNil() + } else { + yym149 := z.EncBinary() + _ = yym149 + 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 + yym152 := z.EncBinary() + _ = yym152 + if false { + } else { + z.F.EncSliceFloat32V(yy151, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrSliceFloat32`) + r.WriteMapElemValue() + if yyn150 { + r.EncodeNil() + } else { + if x.FptrSliceFloat32 == nil { + r.EncodeNil() + } else { + yy153 := *x.FptrSliceFloat32 + yym154 := z.EncBinary() + _ = yym154 + if false { + } else { + z.F.EncSliceFloat32V(yy153, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceFloat64 == nil { + r.EncodeNil() + } else { + yym156 := z.EncBinary() + _ = yym156 + if false { + } else { + z.F.EncSliceFloat64V(x.FSliceFloat64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FSliceFloat64`) + r.WriteMapElemValue() + if x.FSliceFloat64 == nil { + r.EncodeNil() + } else { + yym157 := z.EncBinary() + _ = yym157 + 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 + yym160 := z.EncBinary() + _ = yym160 + if false { + } else { + z.F.EncSliceFloat64V(yy159, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrSliceFloat64`) + r.WriteMapElemValue() + if yyn158 { + r.EncodeNil() + } else { + if x.FptrSliceFloat64 == nil { + r.EncodeNil() + } else { + yy161 := *x.FptrSliceFloat64 + yym162 := z.EncBinary() + _ = yym162 + if false { + } else { + z.F.EncSliceFloat64V(yy161, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceUint == nil { + r.EncodeNil() + } else { + yym164 := z.EncBinary() + _ = yym164 + if false { + } else { + z.F.EncSliceUintV(x.FSliceUint, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FSliceUint`) + r.WriteMapElemValue() + if x.FSliceUint == nil { + r.EncodeNil() + } else { + yym165 := z.EncBinary() + _ = yym165 + 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 + yym168 := z.EncBinary() + _ = yym168 + if false { + } else { + z.F.EncSliceUintV(yy167, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrSliceUint`) + r.WriteMapElemValue() + if yyn166 { + r.EncodeNil() + } else { + if x.FptrSliceUint == nil { + r.EncodeNil() + } else { + yy169 := *x.FptrSliceUint + yym170 := z.EncBinary() + _ = yym170 + if false { + } else { + z.F.EncSliceUintV(yy169, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceUint8 == nil { + r.EncodeNil() + } else { + yym172 := z.EncBinary() + _ = yym172 + if false { + } else { + r.EncodeStringBytes(codecSelferCcRAW19781, []byte(x.FSliceUint8)) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FSliceUint8`) + r.WriteMapElemValue() + if x.FSliceUint8 == nil { + r.EncodeNil() + } else { + yym173 := z.EncBinary() + _ = yym173 + if false { + } else { + r.EncodeStringBytes(codecSelferCcRAW19781, []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 + yym176 := z.EncBinary() + _ = yym176 + if false { + } else { + r.EncodeStringBytes(codecSelferCcRAW19781, []byte(yy175)) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrSliceUint8`) + r.WriteMapElemValue() + if yyn174 { + r.EncodeNil() + } else { + if x.FptrSliceUint8 == nil { + r.EncodeNil() + } else { + yy177 := *x.FptrSliceUint8 + yym178 := z.EncBinary() + _ = yym178 + if false { + } else { + r.EncodeStringBytes(codecSelferCcRAW19781, []byte(yy177)) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceUint16 == nil { + r.EncodeNil() + } else { + yym180 := z.EncBinary() + _ = yym180 + if false { + } else { + z.F.EncSliceUint16V(x.FSliceUint16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FSliceUint16`) + r.WriteMapElemValue() + if x.FSliceUint16 == nil { + r.EncodeNil() + } else { + yym181 := z.EncBinary() + _ = yym181 + 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 + yym184 := z.EncBinary() + _ = yym184 + if false { + } else { + z.F.EncSliceUint16V(yy183, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrSliceUint16`) + r.WriteMapElemValue() + if yyn182 { + r.EncodeNil() + } else { + if x.FptrSliceUint16 == nil { + r.EncodeNil() + } else { + yy185 := *x.FptrSliceUint16 + yym186 := z.EncBinary() + _ = yym186 + if false { + } else { + z.F.EncSliceUint16V(yy185, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceUint32 == nil { + r.EncodeNil() + } else { + yym188 := z.EncBinary() + _ = yym188 + if false { + } else { + z.F.EncSliceUint32V(x.FSliceUint32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FSliceUint32`) + r.WriteMapElemValue() + if x.FSliceUint32 == nil { + r.EncodeNil() + } else { + yym189 := z.EncBinary() + _ = yym189 + 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 + yym192 := z.EncBinary() + _ = yym192 + if false { + } else { + z.F.EncSliceUint32V(yy191, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrSliceUint32`) + r.WriteMapElemValue() + if yyn190 { + r.EncodeNil() + } else { + if x.FptrSliceUint32 == nil { + r.EncodeNil() + } else { + yy193 := *x.FptrSliceUint32 + yym194 := z.EncBinary() + _ = yym194 + if false { + } else { + z.F.EncSliceUint32V(yy193, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceUint64 == nil { + r.EncodeNil() + } else { + yym196 := z.EncBinary() + _ = yym196 + if false { + } else { + z.F.EncSliceUint64V(x.FSliceUint64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FSliceUint64`) + r.WriteMapElemValue() + if x.FSliceUint64 == nil { + r.EncodeNil() + } else { + yym197 := z.EncBinary() + _ = yym197 + 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 + yym200 := z.EncBinary() + _ = yym200 + if false { + } else { + z.F.EncSliceUint64V(yy199, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrSliceUint64`) + r.WriteMapElemValue() + if yyn198 { + r.EncodeNil() + } else { + if x.FptrSliceUint64 == nil { + r.EncodeNil() + } else { + yy201 := *x.FptrSliceUint64 + yym202 := z.EncBinary() + _ = yym202 + if false { + } else { + z.F.EncSliceUint64V(yy201, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceUintptr == nil { + r.EncodeNil() + } else { + yym204 := z.EncBinary() + _ = yym204 + if false { + } else { + z.F.EncSliceUintptrV(x.FSliceUintptr, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FSliceUintptr`) + r.WriteMapElemValue() + if x.FSliceUintptr == nil { + r.EncodeNil() + } else { + yym205 := z.EncBinary() + _ = yym205 + 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 + yym208 := z.EncBinary() + _ = yym208 + if false { + } else { + z.F.EncSliceUintptrV(yy207, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrSliceUintptr`) + r.WriteMapElemValue() + if yyn206 { + r.EncodeNil() + } else { + if x.FptrSliceUintptr == nil { + r.EncodeNil() + } else { + yy209 := *x.FptrSliceUintptr + yym210 := z.EncBinary() + _ = yym210 + if false { + } else { + z.F.EncSliceUintptrV(yy209, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceInt == nil { + r.EncodeNil() + } else { + yym212 := z.EncBinary() + _ = yym212 + if false { + } else { + z.F.EncSliceIntV(x.FSliceInt, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FSliceInt`) + r.WriteMapElemValue() + if x.FSliceInt == nil { + r.EncodeNil() + } else { + yym213 := z.EncBinary() + _ = yym213 + 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 + yym216 := z.EncBinary() + _ = yym216 + if false { + } else { + z.F.EncSliceIntV(yy215, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrSliceInt`) + r.WriteMapElemValue() + if yyn214 { + r.EncodeNil() + } else { + if x.FptrSliceInt == nil { + r.EncodeNil() + } else { + yy217 := *x.FptrSliceInt + yym218 := z.EncBinary() + _ = yym218 + if false { + } else { + z.F.EncSliceIntV(yy217, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceInt8 == nil { + r.EncodeNil() + } else { + yym220 := z.EncBinary() + _ = yym220 + if false { + } else { + z.F.EncSliceInt8V(x.FSliceInt8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FSliceInt8`) + r.WriteMapElemValue() + if x.FSliceInt8 == nil { + r.EncodeNil() + } else { + yym221 := z.EncBinary() + _ = yym221 + 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 + yym224 := z.EncBinary() + _ = yym224 + if false { + } else { + z.F.EncSliceInt8V(yy223, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrSliceInt8`) + r.WriteMapElemValue() + if yyn222 { + r.EncodeNil() + } else { + if x.FptrSliceInt8 == nil { + r.EncodeNil() + } else { + yy225 := *x.FptrSliceInt8 + yym226 := z.EncBinary() + _ = yym226 + if false { + } else { + z.F.EncSliceInt8V(yy225, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceInt16 == nil { + r.EncodeNil() + } else { + yym228 := z.EncBinary() + _ = yym228 + if false { + } else { + z.F.EncSliceInt16V(x.FSliceInt16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FSliceInt16`) + r.WriteMapElemValue() + if x.FSliceInt16 == nil { + r.EncodeNil() + } else { + yym229 := z.EncBinary() + _ = yym229 + 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 + yym232 := z.EncBinary() + _ = yym232 + if false { + } else { + z.F.EncSliceInt16V(yy231, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrSliceInt16`) + r.WriteMapElemValue() + if yyn230 { + r.EncodeNil() + } else { + if x.FptrSliceInt16 == nil { + r.EncodeNil() + } else { + yy233 := *x.FptrSliceInt16 + yym234 := z.EncBinary() + _ = yym234 + if false { + } else { + z.F.EncSliceInt16V(yy233, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceInt32 == nil { + r.EncodeNil() + } else { + yym236 := z.EncBinary() + _ = yym236 + if false { + } else { + z.F.EncSliceInt32V(x.FSliceInt32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FSliceInt32`) + r.WriteMapElemValue() + if x.FSliceInt32 == nil { + r.EncodeNil() + } else { + yym237 := z.EncBinary() + _ = yym237 + 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 + yym240 := z.EncBinary() + _ = yym240 + if false { + } else { + z.F.EncSliceInt32V(yy239, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrSliceInt32`) + r.WriteMapElemValue() + if yyn238 { + r.EncodeNil() + } else { + if x.FptrSliceInt32 == nil { + r.EncodeNil() + } else { + yy241 := *x.FptrSliceInt32 + yym242 := z.EncBinary() + _ = yym242 + if false { + } else { + z.F.EncSliceInt32V(yy241, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceInt64 == nil { + r.EncodeNil() + } else { + yym244 := z.EncBinary() + _ = yym244 + if false { + } else { + z.F.EncSliceInt64V(x.FSliceInt64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FSliceInt64`) + r.WriteMapElemValue() + if x.FSliceInt64 == nil { + r.EncodeNil() + } else { + yym245 := z.EncBinary() + _ = yym245 + 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 + yym248 := z.EncBinary() + _ = yym248 + if false { + } else { + z.F.EncSliceInt64V(yy247, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrSliceInt64`) + r.WriteMapElemValue() + if yyn246 { + r.EncodeNil() + } else { + if x.FptrSliceInt64 == nil { + r.EncodeNil() + } else { + yy249 := *x.FptrSliceInt64 + yym250 := z.EncBinary() + _ = yym250 + if false { + } else { + z.F.EncSliceInt64V(yy249, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FSliceBool == nil { + r.EncodeNil() + } else { + yym252 := z.EncBinary() + _ = yym252 + if false { + } else { + z.F.EncSliceBoolV(x.FSliceBool, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FSliceBool`) + r.WriteMapElemValue() + if x.FSliceBool == nil { + r.EncodeNil() + } else { + yym253 := z.EncBinary() + _ = yym253 + 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 + yym256 := z.EncBinary() + _ = yym256 + if false { + } else { + z.F.EncSliceBoolV(yy255, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrSliceBool`) + r.WriteMapElemValue() + if yyn254 { + r.EncodeNil() + } else { + if x.FptrSliceBool == nil { + r.EncodeNil() + } else { + yy257 := *x.FptrSliceBool + yym258 := z.EncBinary() + _ = yym258 + if false { + } else { + z.F.EncSliceBoolV(yy257, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfIntf == nil { + r.EncodeNil() + } else { + yym260 := z.EncBinary() + _ = yym260 + if false { + } else { + z.F.EncMapIntfIntfV(x.FMapIntfIntf, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntfIntf`) + r.WriteMapElemValue() + if x.FMapIntfIntf == nil { + r.EncodeNil() + } else { + yym261 := z.EncBinary() + _ = yym261 + 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 + yym264 := z.EncBinary() + _ = yym264 + if false { + } else { + z.F.EncMapIntfIntfV(yy263, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntfIntf`) + r.WriteMapElemValue() + if yyn262 { + r.EncodeNil() + } else { + if x.FptrMapIntfIntf == nil { + r.EncodeNil() + } else { + yy265 := *x.FptrMapIntfIntf + yym266 := z.EncBinary() + _ = yym266 + if false { + } else { + z.F.EncMapIntfIntfV(yy265, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfString == nil { + r.EncodeNil() + } else { + yym268 := z.EncBinary() + _ = yym268 + if false { + } else { + z.F.EncMapIntfStringV(x.FMapIntfString, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntfString`) + r.WriteMapElemValue() + if x.FMapIntfString == nil { + r.EncodeNil() + } else { + yym269 := z.EncBinary() + _ = yym269 + 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 + yym272 := z.EncBinary() + _ = yym272 + if false { + } else { + z.F.EncMapIntfStringV(yy271, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntfString`) + r.WriteMapElemValue() + if yyn270 { + r.EncodeNil() + } else { + if x.FptrMapIntfString == nil { + r.EncodeNil() + } else { + yy273 := *x.FptrMapIntfString + yym274 := z.EncBinary() + _ = yym274 + if false { + } else { + z.F.EncMapIntfStringV(yy273, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfUint == nil { + r.EncodeNil() + } else { + yym276 := z.EncBinary() + _ = yym276 + if false { + } else { + z.F.EncMapIntfUintV(x.FMapIntfUint, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntfUint`) + r.WriteMapElemValue() + if x.FMapIntfUint == nil { + r.EncodeNil() + } else { + yym277 := z.EncBinary() + _ = yym277 + 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 + yym280 := z.EncBinary() + _ = yym280 + if false { + } else { + z.F.EncMapIntfUintV(yy279, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntfUint`) + r.WriteMapElemValue() + if yyn278 { + r.EncodeNil() + } else { + if x.FptrMapIntfUint == nil { + r.EncodeNil() + } else { + yy281 := *x.FptrMapIntfUint + yym282 := z.EncBinary() + _ = yym282 + if false { + } else { + z.F.EncMapIntfUintV(yy281, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfUint8 == nil { + r.EncodeNil() + } else { + yym284 := z.EncBinary() + _ = yym284 + if false { + } else { + z.F.EncMapIntfUint8V(x.FMapIntfUint8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntfUint8`) + r.WriteMapElemValue() + if x.FMapIntfUint8 == nil { + r.EncodeNil() + } else { + yym285 := z.EncBinary() + _ = yym285 + 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 + yym288 := z.EncBinary() + _ = yym288 + if false { + } else { + z.F.EncMapIntfUint8V(yy287, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntfUint8`) + r.WriteMapElemValue() + if yyn286 { + r.EncodeNil() + } else { + if x.FptrMapIntfUint8 == nil { + r.EncodeNil() + } else { + yy289 := *x.FptrMapIntfUint8 + yym290 := z.EncBinary() + _ = yym290 + if false { + } else { + z.F.EncMapIntfUint8V(yy289, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfUint16 == nil { + r.EncodeNil() + } else { + yym292 := z.EncBinary() + _ = yym292 + if false { + } else { + z.F.EncMapIntfUint16V(x.FMapIntfUint16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntfUint16`) + r.WriteMapElemValue() + if x.FMapIntfUint16 == nil { + r.EncodeNil() + } else { + yym293 := z.EncBinary() + _ = yym293 + 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 + yym296 := z.EncBinary() + _ = yym296 + if false { + } else { + z.F.EncMapIntfUint16V(yy295, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntfUint16`) + r.WriteMapElemValue() + if yyn294 { + r.EncodeNil() + } else { + if x.FptrMapIntfUint16 == nil { + r.EncodeNil() + } else { + yy297 := *x.FptrMapIntfUint16 + yym298 := z.EncBinary() + _ = yym298 + if false { + } else { + z.F.EncMapIntfUint16V(yy297, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfUint32 == nil { + r.EncodeNil() + } else { + yym300 := z.EncBinary() + _ = yym300 + if false { + } else { + z.F.EncMapIntfUint32V(x.FMapIntfUint32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntfUint32`) + r.WriteMapElemValue() + if x.FMapIntfUint32 == nil { + r.EncodeNil() + } else { + yym301 := z.EncBinary() + _ = yym301 + 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 + yym304 := z.EncBinary() + _ = yym304 + if false { + } else { + z.F.EncMapIntfUint32V(yy303, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntfUint32`) + r.WriteMapElemValue() + if yyn302 { + r.EncodeNil() + } else { + if x.FptrMapIntfUint32 == nil { + r.EncodeNil() + } else { + yy305 := *x.FptrMapIntfUint32 + yym306 := z.EncBinary() + _ = yym306 + if false { + } else { + z.F.EncMapIntfUint32V(yy305, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfUint64 == nil { + r.EncodeNil() + } else { + yym308 := z.EncBinary() + _ = yym308 + if false { + } else { + z.F.EncMapIntfUint64V(x.FMapIntfUint64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntfUint64`) + r.WriteMapElemValue() + if x.FMapIntfUint64 == nil { + r.EncodeNil() + } else { + yym309 := z.EncBinary() + _ = yym309 + 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 + yym312 := z.EncBinary() + _ = yym312 + if false { + } else { + z.F.EncMapIntfUint64V(yy311, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntfUint64`) + r.WriteMapElemValue() + if yyn310 { + r.EncodeNil() + } else { + if x.FptrMapIntfUint64 == nil { + r.EncodeNil() + } else { + yy313 := *x.FptrMapIntfUint64 + yym314 := z.EncBinary() + _ = yym314 + if false { + } else { + z.F.EncMapIntfUint64V(yy313, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfUintptr == nil { + r.EncodeNil() + } else { + yym316 := z.EncBinary() + _ = yym316 + if false { + } else { + z.F.EncMapIntfUintptrV(x.FMapIntfUintptr, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntfUintptr`) + r.WriteMapElemValue() + if x.FMapIntfUintptr == nil { + r.EncodeNil() + } else { + yym317 := z.EncBinary() + _ = yym317 + 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 + yym320 := z.EncBinary() + _ = yym320 + if false { + } else { + z.F.EncMapIntfUintptrV(yy319, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntfUintptr`) + r.WriteMapElemValue() + if yyn318 { + r.EncodeNil() + } else { + if x.FptrMapIntfUintptr == nil { + r.EncodeNil() + } else { + yy321 := *x.FptrMapIntfUintptr + yym322 := z.EncBinary() + _ = yym322 + if false { + } else { + z.F.EncMapIntfUintptrV(yy321, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfInt == nil { + r.EncodeNil() + } else { + yym324 := z.EncBinary() + _ = yym324 + if false { + } else { + z.F.EncMapIntfIntV(x.FMapIntfInt, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntfInt`) + r.WriteMapElemValue() + if x.FMapIntfInt == nil { + r.EncodeNil() + } else { + yym325 := z.EncBinary() + _ = yym325 + 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 + yym328 := z.EncBinary() + _ = yym328 + if false { + } else { + z.F.EncMapIntfIntV(yy327, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntfInt`) + r.WriteMapElemValue() + if yyn326 { + r.EncodeNil() + } else { + if x.FptrMapIntfInt == nil { + r.EncodeNil() + } else { + yy329 := *x.FptrMapIntfInt + yym330 := z.EncBinary() + _ = yym330 + if false { + } else { + z.F.EncMapIntfIntV(yy329, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfInt8 == nil { + r.EncodeNil() + } else { + yym332 := z.EncBinary() + _ = yym332 + if false { + } else { + z.F.EncMapIntfInt8V(x.FMapIntfInt8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntfInt8`) + r.WriteMapElemValue() + if x.FMapIntfInt8 == nil { + r.EncodeNil() + } else { + yym333 := z.EncBinary() + _ = yym333 + 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 + yym336 := z.EncBinary() + _ = yym336 + if false { + } else { + z.F.EncMapIntfInt8V(yy335, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntfInt8`) + r.WriteMapElemValue() + if yyn334 { + r.EncodeNil() + } else { + if x.FptrMapIntfInt8 == nil { + r.EncodeNil() + } else { + yy337 := *x.FptrMapIntfInt8 + yym338 := z.EncBinary() + _ = yym338 + if false { + } else { + z.F.EncMapIntfInt8V(yy337, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfInt16 == nil { + r.EncodeNil() + } else { + yym340 := z.EncBinary() + _ = yym340 + if false { + } else { + z.F.EncMapIntfInt16V(x.FMapIntfInt16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntfInt16`) + r.WriteMapElemValue() + if x.FMapIntfInt16 == nil { + r.EncodeNil() + } else { + yym341 := z.EncBinary() + _ = yym341 + 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 + yym344 := z.EncBinary() + _ = yym344 + if false { + } else { + z.F.EncMapIntfInt16V(yy343, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntfInt16`) + r.WriteMapElemValue() + if yyn342 { + r.EncodeNil() + } else { + if x.FptrMapIntfInt16 == nil { + r.EncodeNil() + } else { + yy345 := *x.FptrMapIntfInt16 + yym346 := z.EncBinary() + _ = yym346 + if false { + } else { + z.F.EncMapIntfInt16V(yy345, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfInt32 == nil { + r.EncodeNil() + } else { + yym348 := z.EncBinary() + _ = yym348 + if false { + } else { + z.F.EncMapIntfInt32V(x.FMapIntfInt32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntfInt32`) + r.WriteMapElemValue() + if x.FMapIntfInt32 == nil { + r.EncodeNil() + } else { + yym349 := z.EncBinary() + _ = yym349 + 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 + yym352 := z.EncBinary() + _ = yym352 + if false { + } else { + z.F.EncMapIntfInt32V(yy351, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntfInt32`) + r.WriteMapElemValue() + if yyn350 { + r.EncodeNil() + } else { + if x.FptrMapIntfInt32 == nil { + r.EncodeNil() + } else { + yy353 := *x.FptrMapIntfInt32 + yym354 := z.EncBinary() + _ = yym354 + if false { + } else { + z.F.EncMapIntfInt32V(yy353, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfInt64 == nil { + r.EncodeNil() + } else { + yym356 := z.EncBinary() + _ = yym356 + if false { + } else { + z.F.EncMapIntfInt64V(x.FMapIntfInt64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntfInt64`) + r.WriteMapElemValue() + if x.FMapIntfInt64 == nil { + r.EncodeNil() + } else { + yym357 := z.EncBinary() + _ = yym357 + 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 + yym360 := z.EncBinary() + _ = yym360 + if false { + } else { + z.F.EncMapIntfInt64V(yy359, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntfInt64`) + r.WriteMapElemValue() + if yyn358 { + r.EncodeNil() + } else { + if x.FptrMapIntfInt64 == nil { + r.EncodeNil() + } else { + yy361 := *x.FptrMapIntfInt64 + yym362 := z.EncBinary() + _ = yym362 + if false { + } else { + z.F.EncMapIntfInt64V(yy361, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfFloat32 == nil { + r.EncodeNil() + } else { + yym364 := z.EncBinary() + _ = yym364 + if false { + } else { + z.F.EncMapIntfFloat32V(x.FMapIntfFloat32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntfFloat32`) + r.WriteMapElemValue() + if x.FMapIntfFloat32 == nil { + r.EncodeNil() + } else { + yym365 := z.EncBinary() + _ = yym365 + 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 + yym368 := z.EncBinary() + _ = yym368 + if false { + } else { + z.F.EncMapIntfFloat32V(yy367, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntfFloat32`) + r.WriteMapElemValue() + if yyn366 { + r.EncodeNil() + } else { + if x.FptrMapIntfFloat32 == nil { + r.EncodeNil() + } else { + yy369 := *x.FptrMapIntfFloat32 + yym370 := z.EncBinary() + _ = yym370 + if false { + } else { + z.F.EncMapIntfFloat32V(yy369, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfFloat64 == nil { + r.EncodeNil() + } else { + yym372 := z.EncBinary() + _ = yym372 + if false { + } else { + z.F.EncMapIntfFloat64V(x.FMapIntfFloat64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntfFloat64`) + r.WriteMapElemValue() + if x.FMapIntfFloat64 == nil { + r.EncodeNil() + } else { + yym373 := z.EncBinary() + _ = yym373 + 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 + yym376 := z.EncBinary() + _ = yym376 + if false { + } else { + z.F.EncMapIntfFloat64V(yy375, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntfFloat64`) + r.WriteMapElemValue() + if yyn374 { + r.EncodeNil() + } else { + if x.FptrMapIntfFloat64 == nil { + r.EncodeNil() + } else { + yy377 := *x.FptrMapIntfFloat64 + yym378 := z.EncBinary() + _ = yym378 + if false { + } else { + z.F.EncMapIntfFloat64V(yy377, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntfBool == nil { + r.EncodeNil() + } else { + yym380 := z.EncBinary() + _ = yym380 + if false { + } else { + z.F.EncMapIntfBoolV(x.FMapIntfBool, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntfBool`) + r.WriteMapElemValue() + if x.FMapIntfBool == nil { + r.EncodeNil() + } else { + yym381 := z.EncBinary() + _ = yym381 + 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 + yym384 := z.EncBinary() + _ = yym384 + if false { + } else { + z.F.EncMapIntfBoolV(yy383, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntfBool`) + r.WriteMapElemValue() + if yyn382 { + r.EncodeNil() + } else { + if x.FptrMapIntfBool == nil { + r.EncodeNil() + } else { + yy385 := *x.FptrMapIntfBool + yym386 := z.EncBinary() + _ = yym386 + if false { + } else { + z.F.EncMapIntfBoolV(yy385, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringIntf == nil { + r.EncodeNil() + } else { + yym388 := z.EncBinary() + _ = yym388 + if false { + } else { + z.F.EncMapStringIntfV(x.FMapStringIntf, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapStringIntf`) + r.WriteMapElemValue() + if x.FMapStringIntf == nil { + r.EncodeNil() + } else { + yym389 := z.EncBinary() + _ = yym389 + 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 + yym392 := z.EncBinary() + _ = yym392 + if false { + } else { + z.F.EncMapStringIntfV(yy391, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapStringIntf`) + r.WriteMapElemValue() + if yyn390 { + r.EncodeNil() + } else { + if x.FptrMapStringIntf == nil { + r.EncodeNil() + } else { + yy393 := *x.FptrMapStringIntf + yym394 := z.EncBinary() + _ = yym394 + if false { + } else { + z.F.EncMapStringIntfV(yy393, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringString == nil { + r.EncodeNil() + } else { + yym396 := z.EncBinary() + _ = yym396 + if false { + } else { + z.F.EncMapStringStringV(x.FMapStringString, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapStringString`) + r.WriteMapElemValue() + if x.FMapStringString == nil { + r.EncodeNil() + } else { + yym397 := z.EncBinary() + _ = yym397 + 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 + yym400 := z.EncBinary() + _ = yym400 + if false { + } else { + z.F.EncMapStringStringV(yy399, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapStringString`) + r.WriteMapElemValue() + if yyn398 { + r.EncodeNil() + } else { + if x.FptrMapStringString == nil { + r.EncodeNil() + } else { + yy401 := *x.FptrMapStringString + yym402 := z.EncBinary() + _ = yym402 + if false { + } else { + z.F.EncMapStringStringV(yy401, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringUint == nil { + r.EncodeNil() + } else { + yym404 := z.EncBinary() + _ = yym404 + if false { + } else { + z.F.EncMapStringUintV(x.FMapStringUint, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapStringUint`) + r.WriteMapElemValue() + if x.FMapStringUint == nil { + r.EncodeNil() + } else { + yym405 := z.EncBinary() + _ = yym405 + 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 + yym408 := z.EncBinary() + _ = yym408 + if false { + } else { + z.F.EncMapStringUintV(yy407, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapStringUint`) + r.WriteMapElemValue() + if yyn406 { + r.EncodeNil() + } else { + if x.FptrMapStringUint == nil { + r.EncodeNil() + } else { + yy409 := *x.FptrMapStringUint + yym410 := z.EncBinary() + _ = yym410 + if false { + } else { + z.F.EncMapStringUintV(yy409, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringUint8 == nil { + r.EncodeNil() + } else { + yym412 := z.EncBinary() + _ = yym412 + if false { + } else { + z.F.EncMapStringUint8V(x.FMapStringUint8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapStringUint8`) + r.WriteMapElemValue() + if x.FMapStringUint8 == nil { + r.EncodeNil() + } else { + yym413 := z.EncBinary() + _ = yym413 + 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 + yym416 := z.EncBinary() + _ = yym416 + if false { + } else { + z.F.EncMapStringUint8V(yy415, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapStringUint8`) + r.WriteMapElemValue() + if yyn414 { + r.EncodeNil() + } else { + if x.FptrMapStringUint8 == nil { + r.EncodeNil() + } else { + yy417 := *x.FptrMapStringUint8 + yym418 := z.EncBinary() + _ = yym418 + if false { + } else { + z.F.EncMapStringUint8V(yy417, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringUint16 == nil { + r.EncodeNil() + } else { + yym420 := z.EncBinary() + _ = yym420 + if false { + } else { + z.F.EncMapStringUint16V(x.FMapStringUint16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapStringUint16`) + r.WriteMapElemValue() + if x.FMapStringUint16 == nil { + r.EncodeNil() + } else { + yym421 := z.EncBinary() + _ = yym421 + 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 + yym424 := z.EncBinary() + _ = yym424 + if false { + } else { + z.F.EncMapStringUint16V(yy423, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapStringUint16`) + r.WriteMapElemValue() + if yyn422 { + r.EncodeNil() + } else { + if x.FptrMapStringUint16 == nil { + r.EncodeNil() + } else { + yy425 := *x.FptrMapStringUint16 + yym426 := z.EncBinary() + _ = yym426 + if false { + } else { + z.F.EncMapStringUint16V(yy425, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringUint32 == nil { + r.EncodeNil() + } else { + yym428 := z.EncBinary() + _ = yym428 + if false { + } else { + z.F.EncMapStringUint32V(x.FMapStringUint32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapStringUint32`) + r.WriteMapElemValue() + if x.FMapStringUint32 == nil { + r.EncodeNil() + } else { + yym429 := z.EncBinary() + _ = yym429 + 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 + yym432 := z.EncBinary() + _ = yym432 + if false { + } else { + z.F.EncMapStringUint32V(yy431, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapStringUint32`) + r.WriteMapElemValue() + if yyn430 { + r.EncodeNil() + } else { + if x.FptrMapStringUint32 == nil { + r.EncodeNil() + } else { + yy433 := *x.FptrMapStringUint32 + yym434 := z.EncBinary() + _ = yym434 + if false { + } else { + z.F.EncMapStringUint32V(yy433, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringUint64 == nil { + r.EncodeNil() + } else { + yym436 := z.EncBinary() + _ = yym436 + if false { + } else { + z.F.EncMapStringUint64V(x.FMapStringUint64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapStringUint64`) + r.WriteMapElemValue() + if x.FMapStringUint64 == nil { + r.EncodeNil() + } else { + yym437 := z.EncBinary() + _ = yym437 + 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 + yym440 := z.EncBinary() + _ = yym440 + if false { + } else { + z.F.EncMapStringUint64V(yy439, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapStringUint64`) + r.WriteMapElemValue() + if yyn438 { + r.EncodeNil() + } else { + if x.FptrMapStringUint64 == nil { + r.EncodeNil() + } else { + yy441 := *x.FptrMapStringUint64 + yym442 := z.EncBinary() + _ = yym442 + if false { + } else { + z.F.EncMapStringUint64V(yy441, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringUintptr == nil { + r.EncodeNil() + } else { + yym444 := z.EncBinary() + _ = yym444 + if false { + } else { + z.F.EncMapStringUintptrV(x.FMapStringUintptr, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapStringUintptr`) + r.WriteMapElemValue() + if x.FMapStringUintptr == nil { + r.EncodeNil() + } else { + yym445 := z.EncBinary() + _ = yym445 + 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 + yym448 := z.EncBinary() + _ = yym448 + if false { + } else { + z.F.EncMapStringUintptrV(yy447, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapStringUintptr`) + r.WriteMapElemValue() + if yyn446 { + r.EncodeNil() + } else { + if x.FptrMapStringUintptr == nil { + r.EncodeNil() + } else { + yy449 := *x.FptrMapStringUintptr + yym450 := z.EncBinary() + _ = yym450 + if false { + } else { + z.F.EncMapStringUintptrV(yy449, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringInt == nil { + r.EncodeNil() + } else { + yym452 := z.EncBinary() + _ = yym452 + if false { + } else { + z.F.EncMapStringIntV(x.FMapStringInt, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapStringInt`) + r.WriteMapElemValue() + if x.FMapStringInt == nil { + r.EncodeNil() + } else { + yym453 := z.EncBinary() + _ = yym453 + 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 + yym456 := z.EncBinary() + _ = yym456 + if false { + } else { + z.F.EncMapStringIntV(yy455, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapStringInt`) + r.WriteMapElemValue() + if yyn454 { + r.EncodeNil() + } else { + if x.FptrMapStringInt == nil { + r.EncodeNil() + } else { + yy457 := *x.FptrMapStringInt + yym458 := z.EncBinary() + _ = yym458 + if false { + } else { + z.F.EncMapStringIntV(yy457, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringInt8 == nil { + r.EncodeNil() + } else { + yym460 := z.EncBinary() + _ = yym460 + if false { + } else { + z.F.EncMapStringInt8V(x.FMapStringInt8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapStringInt8`) + r.WriteMapElemValue() + if x.FMapStringInt8 == nil { + r.EncodeNil() + } else { + yym461 := z.EncBinary() + _ = yym461 + 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 + yym464 := z.EncBinary() + _ = yym464 + if false { + } else { + z.F.EncMapStringInt8V(yy463, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapStringInt8`) + r.WriteMapElemValue() + if yyn462 { + r.EncodeNil() + } else { + if x.FptrMapStringInt8 == nil { + r.EncodeNil() + } else { + yy465 := *x.FptrMapStringInt8 + yym466 := z.EncBinary() + _ = yym466 + if false { + } else { + z.F.EncMapStringInt8V(yy465, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringInt16 == nil { + r.EncodeNil() + } else { + yym468 := z.EncBinary() + _ = yym468 + if false { + } else { + z.F.EncMapStringInt16V(x.FMapStringInt16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapStringInt16`) + r.WriteMapElemValue() + if x.FMapStringInt16 == nil { + r.EncodeNil() + } else { + yym469 := z.EncBinary() + _ = yym469 + 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 + yym472 := z.EncBinary() + _ = yym472 + if false { + } else { + z.F.EncMapStringInt16V(yy471, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapStringInt16`) + r.WriteMapElemValue() + if yyn470 { + r.EncodeNil() + } else { + if x.FptrMapStringInt16 == nil { + r.EncodeNil() + } else { + yy473 := *x.FptrMapStringInt16 + yym474 := z.EncBinary() + _ = yym474 + if false { + } else { + z.F.EncMapStringInt16V(yy473, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringInt32 == nil { + r.EncodeNil() + } else { + yym476 := z.EncBinary() + _ = yym476 + if false { + } else { + z.F.EncMapStringInt32V(x.FMapStringInt32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapStringInt32`) + r.WriteMapElemValue() + if x.FMapStringInt32 == nil { + r.EncodeNil() + } else { + yym477 := z.EncBinary() + _ = yym477 + 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 + yym480 := z.EncBinary() + _ = yym480 + if false { + } else { + z.F.EncMapStringInt32V(yy479, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapStringInt32`) + r.WriteMapElemValue() + if yyn478 { + r.EncodeNil() + } else { + if x.FptrMapStringInt32 == nil { + r.EncodeNil() + } else { + yy481 := *x.FptrMapStringInt32 + yym482 := z.EncBinary() + _ = yym482 + if false { + } else { + z.F.EncMapStringInt32V(yy481, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringInt64 == nil { + r.EncodeNil() + } else { + yym484 := z.EncBinary() + _ = yym484 + if false { + } else { + z.F.EncMapStringInt64V(x.FMapStringInt64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapStringInt64`) + r.WriteMapElemValue() + if x.FMapStringInt64 == nil { + r.EncodeNil() + } else { + yym485 := z.EncBinary() + _ = yym485 + 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 + yym488 := z.EncBinary() + _ = yym488 + if false { + } else { + z.F.EncMapStringInt64V(yy487, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapStringInt64`) + r.WriteMapElemValue() + if yyn486 { + r.EncodeNil() + } else { + if x.FptrMapStringInt64 == nil { + r.EncodeNil() + } else { + yy489 := *x.FptrMapStringInt64 + yym490 := z.EncBinary() + _ = yym490 + if false { + } else { + z.F.EncMapStringInt64V(yy489, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringFloat32 == nil { + r.EncodeNil() + } else { + yym492 := z.EncBinary() + _ = yym492 + if false { + } else { + z.F.EncMapStringFloat32V(x.FMapStringFloat32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapStringFloat32`) + r.WriteMapElemValue() + if x.FMapStringFloat32 == nil { + r.EncodeNil() + } else { + yym493 := z.EncBinary() + _ = yym493 + 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 + yym496 := z.EncBinary() + _ = yym496 + if false { + } else { + z.F.EncMapStringFloat32V(yy495, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapStringFloat32`) + r.WriteMapElemValue() + if yyn494 { + r.EncodeNil() + } else { + if x.FptrMapStringFloat32 == nil { + r.EncodeNil() + } else { + yy497 := *x.FptrMapStringFloat32 + yym498 := z.EncBinary() + _ = yym498 + if false { + } else { + z.F.EncMapStringFloat32V(yy497, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringFloat64 == nil { + r.EncodeNil() + } else { + yym500 := z.EncBinary() + _ = yym500 + if false { + } else { + z.F.EncMapStringFloat64V(x.FMapStringFloat64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapStringFloat64`) + r.WriteMapElemValue() + if x.FMapStringFloat64 == nil { + r.EncodeNil() + } else { + yym501 := z.EncBinary() + _ = yym501 + 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 + yym504 := z.EncBinary() + _ = yym504 + if false { + } else { + z.F.EncMapStringFloat64V(yy503, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapStringFloat64`) + r.WriteMapElemValue() + if yyn502 { + r.EncodeNil() + } else { + if x.FptrMapStringFloat64 == nil { + r.EncodeNil() + } else { + yy505 := *x.FptrMapStringFloat64 + yym506 := z.EncBinary() + _ = yym506 + if false { + } else { + z.F.EncMapStringFloat64V(yy505, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapStringBool == nil { + r.EncodeNil() + } else { + yym508 := z.EncBinary() + _ = yym508 + if false { + } else { + z.F.EncMapStringBoolV(x.FMapStringBool, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapStringBool`) + r.WriteMapElemValue() + if x.FMapStringBool == nil { + r.EncodeNil() + } else { + yym509 := z.EncBinary() + _ = yym509 + 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 + yym512 := z.EncBinary() + _ = yym512 + if false { + } else { + z.F.EncMapStringBoolV(yy511, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapStringBool`) + r.WriteMapElemValue() + if yyn510 { + r.EncodeNil() + } else { + if x.FptrMapStringBool == nil { + r.EncodeNil() + } else { + yy513 := *x.FptrMapStringBool + yym514 := z.EncBinary() + _ = yym514 + if false { + } else { + z.F.EncMapStringBoolV(yy513, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Intf == nil { + r.EncodeNil() + } else { + yym516 := z.EncBinary() + _ = yym516 + if false { + } else { + z.F.EncMapFloat32IntfV(x.FMapFloat32Intf, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat32Intf`) + r.WriteMapElemValue() + if x.FMapFloat32Intf == nil { + r.EncodeNil() + } else { + yym517 := z.EncBinary() + _ = yym517 + 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 + yym520 := z.EncBinary() + _ = yym520 + if false { + } else { + z.F.EncMapFloat32IntfV(yy519, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat32Intf`) + r.WriteMapElemValue() + if yyn518 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Intf == nil { + r.EncodeNil() + } else { + yy521 := *x.FptrMapFloat32Intf + yym522 := z.EncBinary() + _ = yym522 + if false { + } else { + z.F.EncMapFloat32IntfV(yy521, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32String == nil { + r.EncodeNil() + } else { + yym524 := z.EncBinary() + _ = yym524 + if false { + } else { + z.F.EncMapFloat32StringV(x.FMapFloat32String, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat32String`) + r.WriteMapElemValue() + if x.FMapFloat32String == nil { + r.EncodeNil() + } else { + yym525 := z.EncBinary() + _ = yym525 + 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 + yym528 := z.EncBinary() + _ = yym528 + if false { + } else { + z.F.EncMapFloat32StringV(yy527, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat32String`) + r.WriteMapElemValue() + if yyn526 { + r.EncodeNil() + } else { + if x.FptrMapFloat32String == nil { + r.EncodeNil() + } else { + yy529 := *x.FptrMapFloat32String + yym530 := z.EncBinary() + _ = yym530 + if false { + } else { + z.F.EncMapFloat32StringV(yy529, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Uint == nil { + r.EncodeNil() + } else { + yym532 := z.EncBinary() + _ = yym532 + if false { + } else { + z.F.EncMapFloat32UintV(x.FMapFloat32Uint, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat32Uint`) + r.WriteMapElemValue() + if x.FMapFloat32Uint == nil { + r.EncodeNil() + } else { + yym533 := z.EncBinary() + _ = yym533 + 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 + yym536 := z.EncBinary() + _ = yym536 + if false { + } else { + z.F.EncMapFloat32UintV(yy535, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat32Uint`) + r.WriteMapElemValue() + if yyn534 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Uint == nil { + r.EncodeNil() + } else { + yy537 := *x.FptrMapFloat32Uint + yym538 := z.EncBinary() + _ = yym538 + if false { + } else { + z.F.EncMapFloat32UintV(yy537, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Uint8 == nil { + r.EncodeNil() + } else { + yym540 := z.EncBinary() + _ = yym540 + if false { + } else { + z.F.EncMapFloat32Uint8V(x.FMapFloat32Uint8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat32Uint8`) + r.WriteMapElemValue() + if x.FMapFloat32Uint8 == nil { + r.EncodeNil() + } else { + yym541 := z.EncBinary() + _ = yym541 + 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 + yym544 := z.EncBinary() + _ = yym544 + if false { + } else { + z.F.EncMapFloat32Uint8V(yy543, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat32Uint8`) + r.WriteMapElemValue() + if yyn542 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Uint8 == nil { + r.EncodeNil() + } else { + yy545 := *x.FptrMapFloat32Uint8 + yym546 := z.EncBinary() + _ = yym546 + if false { + } else { + z.F.EncMapFloat32Uint8V(yy545, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Uint16 == nil { + r.EncodeNil() + } else { + yym548 := z.EncBinary() + _ = yym548 + if false { + } else { + z.F.EncMapFloat32Uint16V(x.FMapFloat32Uint16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat32Uint16`) + r.WriteMapElemValue() + if x.FMapFloat32Uint16 == nil { + r.EncodeNil() + } else { + yym549 := z.EncBinary() + _ = yym549 + 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 + yym552 := z.EncBinary() + _ = yym552 + if false { + } else { + z.F.EncMapFloat32Uint16V(yy551, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat32Uint16`) + r.WriteMapElemValue() + if yyn550 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Uint16 == nil { + r.EncodeNil() + } else { + yy553 := *x.FptrMapFloat32Uint16 + yym554 := z.EncBinary() + _ = yym554 + if false { + } else { + z.F.EncMapFloat32Uint16V(yy553, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Uint32 == nil { + r.EncodeNil() + } else { + yym556 := z.EncBinary() + _ = yym556 + if false { + } else { + z.F.EncMapFloat32Uint32V(x.FMapFloat32Uint32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat32Uint32`) + r.WriteMapElemValue() + if x.FMapFloat32Uint32 == nil { + r.EncodeNil() + } else { + yym557 := z.EncBinary() + _ = yym557 + 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 + yym560 := z.EncBinary() + _ = yym560 + if false { + } else { + z.F.EncMapFloat32Uint32V(yy559, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat32Uint32`) + r.WriteMapElemValue() + if yyn558 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Uint32 == nil { + r.EncodeNil() + } else { + yy561 := *x.FptrMapFloat32Uint32 + yym562 := z.EncBinary() + _ = yym562 + if false { + } else { + z.F.EncMapFloat32Uint32V(yy561, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Uint64 == nil { + r.EncodeNil() + } else { + yym564 := z.EncBinary() + _ = yym564 + if false { + } else { + z.F.EncMapFloat32Uint64V(x.FMapFloat32Uint64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat32Uint64`) + r.WriteMapElemValue() + if x.FMapFloat32Uint64 == nil { + r.EncodeNil() + } else { + yym565 := z.EncBinary() + _ = yym565 + 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 + yym568 := z.EncBinary() + _ = yym568 + if false { + } else { + z.F.EncMapFloat32Uint64V(yy567, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat32Uint64`) + r.WriteMapElemValue() + if yyn566 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Uint64 == nil { + r.EncodeNil() + } else { + yy569 := *x.FptrMapFloat32Uint64 + yym570 := z.EncBinary() + _ = yym570 + if false { + } else { + z.F.EncMapFloat32Uint64V(yy569, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Uintptr == nil { + r.EncodeNil() + } else { + yym572 := z.EncBinary() + _ = yym572 + if false { + } else { + z.F.EncMapFloat32UintptrV(x.FMapFloat32Uintptr, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat32Uintptr`) + r.WriteMapElemValue() + if x.FMapFloat32Uintptr == nil { + r.EncodeNil() + } else { + yym573 := z.EncBinary() + _ = yym573 + 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 + yym576 := z.EncBinary() + _ = yym576 + if false { + } else { + z.F.EncMapFloat32UintptrV(yy575, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat32Uintptr`) + r.WriteMapElemValue() + if yyn574 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Uintptr == nil { + r.EncodeNil() + } else { + yy577 := *x.FptrMapFloat32Uintptr + yym578 := z.EncBinary() + _ = yym578 + if false { + } else { + z.F.EncMapFloat32UintptrV(yy577, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Int == nil { + r.EncodeNil() + } else { + yym580 := z.EncBinary() + _ = yym580 + if false { + } else { + z.F.EncMapFloat32IntV(x.FMapFloat32Int, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat32Int`) + r.WriteMapElemValue() + if x.FMapFloat32Int == nil { + r.EncodeNil() + } else { + yym581 := z.EncBinary() + _ = yym581 + 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 + yym584 := z.EncBinary() + _ = yym584 + if false { + } else { + z.F.EncMapFloat32IntV(yy583, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat32Int`) + r.WriteMapElemValue() + if yyn582 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Int == nil { + r.EncodeNil() + } else { + yy585 := *x.FptrMapFloat32Int + yym586 := z.EncBinary() + _ = yym586 + if false { + } else { + z.F.EncMapFloat32IntV(yy585, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Int8 == nil { + r.EncodeNil() + } else { + yym588 := z.EncBinary() + _ = yym588 + if false { + } else { + z.F.EncMapFloat32Int8V(x.FMapFloat32Int8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat32Int8`) + r.WriteMapElemValue() + if x.FMapFloat32Int8 == nil { + r.EncodeNil() + } else { + yym589 := z.EncBinary() + _ = yym589 + 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 + yym592 := z.EncBinary() + _ = yym592 + if false { + } else { + z.F.EncMapFloat32Int8V(yy591, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat32Int8`) + r.WriteMapElemValue() + if yyn590 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Int8 == nil { + r.EncodeNil() + } else { + yy593 := *x.FptrMapFloat32Int8 + yym594 := z.EncBinary() + _ = yym594 + if false { + } else { + z.F.EncMapFloat32Int8V(yy593, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Int16 == nil { + r.EncodeNil() + } else { + yym596 := z.EncBinary() + _ = yym596 + if false { + } else { + z.F.EncMapFloat32Int16V(x.FMapFloat32Int16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat32Int16`) + r.WriteMapElemValue() + if x.FMapFloat32Int16 == nil { + r.EncodeNil() + } else { + yym597 := z.EncBinary() + _ = yym597 + 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 + yym600 := z.EncBinary() + _ = yym600 + if false { + } else { + z.F.EncMapFloat32Int16V(yy599, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat32Int16`) + r.WriteMapElemValue() + if yyn598 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Int16 == nil { + r.EncodeNil() + } else { + yy601 := *x.FptrMapFloat32Int16 + yym602 := z.EncBinary() + _ = yym602 + if false { + } else { + z.F.EncMapFloat32Int16V(yy601, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Int32 == nil { + r.EncodeNil() + } else { + yym604 := z.EncBinary() + _ = yym604 + if false { + } else { + z.F.EncMapFloat32Int32V(x.FMapFloat32Int32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat32Int32`) + r.WriteMapElemValue() + if x.FMapFloat32Int32 == nil { + r.EncodeNil() + } else { + yym605 := z.EncBinary() + _ = yym605 + 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 + yym608 := z.EncBinary() + _ = yym608 + if false { + } else { + z.F.EncMapFloat32Int32V(yy607, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat32Int32`) + r.WriteMapElemValue() + if yyn606 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Int32 == nil { + r.EncodeNil() + } else { + yy609 := *x.FptrMapFloat32Int32 + yym610 := z.EncBinary() + _ = yym610 + if false { + } else { + z.F.EncMapFloat32Int32V(yy609, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Int64 == nil { + r.EncodeNil() + } else { + yym612 := z.EncBinary() + _ = yym612 + if false { + } else { + z.F.EncMapFloat32Int64V(x.FMapFloat32Int64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat32Int64`) + r.WriteMapElemValue() + if x.FMapFloat32Int64 == nil { + r.EncodeNil() + } else { + yym613 := z.EncBinary() + _ = yym613 + 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 + yym616 := z.EncBinary() + _ = yym616 + if false { + } else { + z.F.EncMapFloat32Int64V(yy615, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat32Int64`) + r.WriteMapElemValue() + if yyn614 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Int64 == nil { + r.EncodeNil() + } else { + yy617 := *x.FptrMapFloat32Int64 + yym618 := z.EncBinary() + _ = yym618 + if false { + } else { + z.F.EncMapFloat32Int64V(yy617, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Float32 == nil { + r.EncodeNil() + } else { + yym620 := z.EncBinary() + _ = yym620 + if false { + } else { + z.F.EncMapFloat32Float32V(x.FMapFloat32Float32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat32Float32`) + r.WriteMapElemValue() + if x.FMapFloat32Float32 == nil { + r.EncodeNil() + } else { + yym621 := z.EncBinary() + _ = yym621 + 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 + yym624 := z.EncBinary() + _ = yym624 + if false { + } else { + z.F.EncMapFloat32Float32V(yy623, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat32Float32`) + r.WriteMapElemValue() + if yyn622 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Float32 == nil { + r.EncodeNil() + } else { + yy625 := *x.FptrMapFloat32Float32 + yym626 := z.EncBinary() + _ = yym626 + if false { + } else { + z.F.EncMapFloat32Float32V(yy625, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Float64 == nil { + r.EncodeNil() + } else { + yym628 := z.EncBinary() + _ = yym628 + if false { + } else { + z.F.EncMapFloat32Float64V(x.FMapFloat32Float64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat32Float64`) + r.WriteMapElemValue() + if x.FMapFloat32Float64 == nil { + r.EncodeNil() + } else { + yym629 := z.EncBinary() + _ = yym629 + 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 + yym632 := z.EncBinary() + _ = yym632 + if false { + } else { + z.F.EncMapFloat32Float64V(yy631, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat32Float64`) + r.WriteMapElemValue() + if yyn630 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Float64 == nil { + r.EncodeNil() + } else { + yy633 := *x.FptrMapFloat32Float64 + yym634 := z.EncBinary() + _ = yym634 + if false { + } else { + z.F.EncMapFloat32Float64V(yy633, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat32Bool == nil { + r.EncodeNil() + } else { + yym636 := z.EncBinary() + _ = yym636 + if false { + } else { + z.F.EncMapFloat32BoolV(x.FMapFloat32Bool, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat32Bool`) + r.WriteMapElemValue() + if x.FMapFloat32Bool == nil { + r.EncodeNil() + } else { + yym637 := z.EncBinary() + _ = yym637 + 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 + yym640 := z.EncBinary() + _ = yym640 + if false { + } else { + z.F.EncMapFloat32BoolV(yy639, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat32Bool`) + r.WriteMapElemValue() + if yyn638 { + r.EncodeNil() + } else { + if x.FptrMapFloat32Bool == nil { + r.EncodeNil() + } else { + yy641 := *x.FptrMapFloat32Bool + yym642 := z.EncBinary() + _ = yym642 + if false { + } else { + z.F.EncMapFloat32BoolV(yy641, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Intf == nil { + r.EncodeNil() + } else { + yym644 := z.EncBinary() + _ = yym644 + if false { + } else { + z.F.EncMapFloat64IntfV(x.FMapFloat64Intf, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat64Intf`) + r.WriteMapElemValue() + if x.FMapFloat64Intf == nil { + r.EncodeNil() + } else { + yym645 := z.EncBinary() + _ = yym645 + 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 + yym648 := z.EncBinary() + _ = yym648 + if false { + } else { + z.F.EncMapFloat64IntfV(yy647, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat64Intf`) + r.WriteMapElemValue() + if yyn646 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Intf == nil { + r.EncodeNil() + } else { + yy649 := *x.FptrMapFloat64Intf + yym650 := z.EncBinary() + _ = yym650 + if false { + } else { + z.F.EncMapFloat64IntfV(yy649, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64String == nil { + r.EncodeNil() + } else { + yym652 := z.EncBinary() + _ = yym652 + if false { + } else { + z.F.EncMapFloat64StringV(x.FMapFloat64String, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat64String`) + r.WriteMapElemValue() + if x.FMapFloat64String == nil { + r.EncodeNil() + } else { + yym653 := z.EncBinary() + _ = yym653 + 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 + yym656 := z.EncBinary() + _ = yym656 + if false { + } else { + z.F.EncMapFloat64StringV(yy655, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat64String`) + r.WriteMapElemValue() + if yyn654 { + r.EncodeNil() + } else { + if x.FptrMapFloat64String == nil { + r.EncodeNil() + } else { + yy657 := *x.FptrMapFloat64String + yym658 := z.EncBinary() + _ = yym658 + if false { + } else { + z.F.EncMapFloat64StringV(yy657, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Uint == nil { + r.EncodeNil() + } else { + yym660 := z.EncBinary() + _ = yym660 + if false { + } else { + z.F.EncMapFloat64UintV(x.FMapFloat64Uint, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat64Uint`) + r.WriteMapElemValue() + if x.FMapFloat64Uint == nil { + r.EncodeNil() + } else { + yym661 := z.EncBinary() + _ = yym661 + 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 + yym664 := z.EncBinary() + _ = yym664 + if false { + } else { + z.F.EncMapFloat64UintV(yy663, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat64Uint`) + r.WriteMapElemValue() + if yyn662 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Uint == nil { + r.EncodeNil() + } else { + yy665 := *x.FptrMapFloat64Uint + yym666 := z.EncBinary() + _ = yym666 + if false { + } else { + z.F.EncMapFloat64UintV(yy665, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Uint8 == nil { + r.EncodeNil() + } else { + yym668 := z.EncBinary() + _ = yym668 + if false { + } else { + z.F.EncMapFloat64Uint8V(x.FMapFloat64Uint8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat64Uint8`) + r.WriteMapElemValue() + if x.FMapFloat64Uint8 == nil { + r.EncodeNil() + } else { + yym669 := z.EncBinary() + _ = yym669 + 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 + yym672 := z.EncBinary() + _ = yym672 + if false { + } else { + z.F.EncMapFloat64Uint8V(yy671, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat64Uint8`) + r.WriteMapElemValue() + if yyn670 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Uint8 == nil { + r.EncodeNil() + } else { + yy673 := *x.FptrMapFloat64Uint8 + yym674 := z.EncBinary() + _ = yym674 + if false { + } else { + z.F.EncMapFloat64Uint8V(yy673, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Uint16 == nil { + r.EncodeNil() + } else { + yym676 := z.EncBinary() + _ = yym676 + if false { + } else { + z.F.EncMapFloat64Uint16V(x.FMapFloat64Uint16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat64Uint16`) + r.WriteMapElemValue() + if x.FMapFloat64Uint16 == nil { + r.EncodeNil() + } else { + yym677 := z.EncBinary() + _ = yym677 + 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 + yym680 := z.EncBinary() + _ = yym680 + if false { + } else { + z.F.EncMapFloat64Uint16V(yy679, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat64Uint16`) + r.WriteMapElemValue() + if yyn678 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Uint16 == nil { + r.EncodeNil() + } else { + yy681 := *x.FptrMapFloat64Uint16 + yym682 := z.EncBinary() + _ = yym682 + if false { + } else { + z.F.EncMapFloat64Uint16V(yy681, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Uint32 == nil { + r.EncodeNil() + } else { + yym684 := z.EncBinary() + _ = yym684 + if false { + } else { + z.F.EncMapFloat64Uint32V(x.FMapFloat64Uint32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat64Uint32`) + r.WriteMapElemValue() + if x.FMapFloat64Uint32 == nil { + r.EncodeNil() + } else { + yym685 := z.EncBinary() + _ = yym685 + 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 + yym688 := z.EncBinary() + _ = yym688 + if false { + } else { + z.F.EncMapFloat64Uint32V(yy687, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat64Uint32`) + r.WriteMapElemValue() + if yyn686 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Uint32 == nil { + r.EncodeNil() + } else { + yy689 := *x.FptrMapFloat64Uint32 + yym690 := z.EncBinary() + _ = yym690 + if false { + } else { + z.F.EncMapFloat64Uint32V(yy689, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Uint64 == nil { + r.EncodeNil() + } else { + yym692 := z.EncBinary() + _ = yym692 + if false { + } else { + z.F.EncMapFloat64Uint64V(x.FMapFloat64Uint64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat64Uint64`) + r.WriteMapElemValue() + if x.FMapFloat64Uint64 == nil { + r.EncodeNil() + } else { + yym693 := z.EncBinary() + _ = yym693 + 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 + yym696 := z.EncBinary() + _ = yym696 + if false { + } else { + z.F.EncMapFloat64Uint64V(yy695, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat64Uint64`) + r.WriteMapElemValue() + if yyn694 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Uint64 == nil { + r.EncodeNil() + } else { + yy697 := *x.FptrMapFloat64Uint64 + yym698 := z.EncBinary() + _ = yym698 + if false { + } else { + z.F.EncMapFloat64Uint64V(yy697, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Uintptr == nil { + r.EncodeNil() + } else { + yym700 := z.EncBinary() + _ = yym700 + if false { + } else { + z.F.EncMapFloat64UintptrV(x.FMapFloat64Uintptr, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat64Uintptr`) + r.WriteMapElemValue() + if x.FMapFloat64Uintptr == nil { + r.EncodeNil() + } else { + yym701 := z.EncBinary() + _ = yym701 + 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 + yym704 := z.EncBinary() + _ = yym704 + if false { + } else { + z.F.EncMapFloat64UintptrV(yy703, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat64Uintptr`) + r.WriteMapElemValue() + if yyn702 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Uintptr == nil { + r.EncodeNil() + } else { + yy705 := *x.FptrMapFloat64Uintptr + yym706 := z.EncBinary() + _ = yym706 + if false { + } else { + z.F.EncMapFloat64UintptrV(yy705, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Int == nil { + r.EncodeNil() + } else { + yym708 := z.EncBinary() + _ = yym708 + if false { + } else { + z.F.EncMapFloat64IntV(x.FMapFloat64Int, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat64Int`) + r.WriteMapElemValue() + if x.FMapFloat64Int == nil { + r.EncodeNil() + } else { + yym709 := z.EncBinary() + _ = yym709 + 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 + yym712 := z.EncBinary() + _ = yym712 + if false { + } else { + z.F.EncMapFloat64IntV(yy711, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat64Int`) + r.WriteMapElemValue() + if yyn710 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Int == nil { + r.EncodeNil() + } else { + yy713 := *x.FptrMapFloat64Int + yym714 := z.EncBinary() + _ = yym714 + if false { + } else { + z.F.EncMapFloat64IntV(yy713, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Int8 == nil { + r.EncodeNil() + } else { + yym716 := z.EncBinary() + _ = yym716 + if false { + } else { + z.F.EncMapFloat64Int8V(x.FMapFloat64Int8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat64Int8`) + r.WriteMapElemValue() + if x.FMapFloat64Int8 == nil { + r.EncodeNil() + } else { + yym717 := z.EncBinary() + _ = yym717 + 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 + yym720 := z.EncBinary() + _ = yym720 + if false { + } else { + z.F.EncMapFloat64Int8V(yy719, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat64Int8`) + r.WriteMapElemValue() + if yyn718 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Int8 == nil { + r.EncodeNil() + } else { + yy721 := *x.FptrMapFloat64Int8 + yym722 := z.EncBinary() + _ = yym722 + if false { + } else { + z.F.EncMapFloat64Int8V(yy721, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Int16 == nil { + r.EncodeNil() + } else { + yym724 := z.EncBinary() + _ = yym724 + if false { + } else { + z.F.EncMapFloat64Int16V(x.FMapFloat64Int16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat64Int16`) + r.WriteMapElemValue() + if x.FMapFloat64Int16 == nil { + r.EncodeNil() + } else { + yym725 := z.EncBinary() + _ = yym725 + 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 + yym728 := z.EncBinary() + _ = yym728 + if false { + } else { + z.F.EncMapFloat64Int16V(yy727, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat64Int16`) + r.WriteMapElemValue() + if yyn726 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Int16 == nil { + r.EncodeNil() + } else { + yy729 := *x.FptrMapFloat64Int16 + yym730 := z.EncBinary() + _ = yym730 + if false { + } else { + z.F.EncMapFloat64Int16V(yy729, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Int32 == nil { + r.EncodeNil() + } else { + yym732 := z.EncBinary() + _ = yym732 + if false { + } else { + z.F.EncMapFloat64Int32V(x.FMapFloat64Int32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat64Int32`) + r.WriteMapElemValue() + if x.FMapFloat64Int32 == nil { + r.EncodeNil() + } else { + yym733 := z.EncBinary() + _ = yym733 + 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 + yym736 := z.EncBinary() + _ = yym736 + if false { + } else { + z.F.EncMapFloat64Int32V(yy735, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat64Int32`) + r.WriteMapElemValue() + if yyn734 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Int32 == nil { + r.EncodeNil() + } else { + yy737 := *x.FptrMapFloat64Int32 + yym738 := z.EncBinary() + _ = yym738 + if false { + } else { + z.F.EncMapFloat64Int32V(yy737, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Int64 == nil { + r.EncodeNil() + } else { + yym740 := z.EncBinary() + _ = yym740 + if false { + } else { + z.F.EncMapFloat64Int64V(x.FMapFloat64Int64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat64Int64`) + r.WriteMapElemValue() + if x.FMapFloat64Int64 == nil { + r.EncodeNil() + } else { + yym741 := z.EncBinary() + _ = yym741 + 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 + yym744 := z.EncBinary() + _ = yym744 + if false { + } else { + z.F.EncMapFloat64Int64V(yy743, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat64Int64`) + r.WriteMapElemValue() + if yyn742 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Int64 == nil { + r.EncodeNil() + } else { + yy745 := *x.FptrMapFloat64Int64 + yym746 := z.EncBinary() + _ = yym746 + if false { + } else { + z.F.EncMapFloat64Int64V(yy745, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Float32 == nil { + r.EncodeNil() + } else { + yym748 := z.EncBinary() + _ = yym748 + if false { + } else { + z.F.EncMapFloat64Float32V(x.FMapFloat64Float32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat64Float32`) + r.WriteMapElemValue() + if x.FMapFloat64Float32 == nil { + r.EncodeNil() + } else { + yym749 := z.EncBinary() + _ = yym749 + 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 + yym752 := z.EncBinary() + _ = yym752 + if false { + } else { + z.F.EncMapFloat64Float32V(yy751, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat64Float32`) + r.WriteMapElemValue() + if yyn750 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Float32 == nil { + r.EncodeNil() + } else { + yy753 := *x.FptrMapFloat64Float32 + yym754 := z.EncBinary() + _ = yym754 + if false { + } else { + z.F.EncMapFloat64Float32V(yy753, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Float64 == nil { + r.EncodeNil() + } else { + yym756 := z.EncBinary() + _ = yym756 + if false { + } else { + z.F.EncMapFloat64Float64V(x.FMapFloat64Float64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat64Float64`) + r.WriteMapElemValue() + if x.FMapFloat64Float64 == nil { + r.EncodeNil() + } else { + yym757 := z.EncBinary() + _ = yym757 + 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 + yym760 := z.EncBinary() + _ = yym760 + if false { + } else { + z.F.EncMapFloat64Float64V(yy759, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat64Float64`) + r.WriteMapElemValue() + if yyn758 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Float64 == nil { + r.EncodeNil() + } else { + yy761 := *x.FptrMapFloat64Float64 + yym762 := z.EncBinary() + _ = yym762 + if false { + } else { + z.F.EncMapFloat64Float64V(yy761, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapFloat64Bool == nil { + r.EncodeNil() + } else { + yym764 := z.EncBinary() + _ = yym764 + if false { + } else { + z.F.EncMapFloat64BoolV(x.FMapFloat64Bool, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapFloat64Bool`) + r.WriteMapElemValue() + if x.FMapFloat64Bool == nil { + r.EncodeNil() + } else { + yym765 := z.EncBinary() + _ = yym765 + 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 + yym768 := z.EncBinary() + _ = yym768 + if false { + } else { + z.F.EncMapFloat64BoolV(yy767, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapFloat64Bool`) + r.WriteMapElemValue() + if yyn766 { + r.EncodeNil() + } else { + if x.FptrMapFloat64Bool == nil { + r.EncodeNil() + } else { + yy769 := *x.FptrMapFloat64Bool + yym770 := z.EncBinary() + _ = yym770 + if false { + } else { + z.F.EncMapFloat64BoolV(yy769, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintIntf == nil { + r.EncodeNil() + } else { + yym772 := z.EncBinary() + _ = yym772 + if false { + } else { + z.F.EncMapUintIntfV(x.FMapUintIntf, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintIntf`) + r.WriteMapElemValue() + if x.FMapUintIntf == nil { + r.EncodeNil() + } else { + yym773 := z.EncBinary() + _ = yym773 + 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 + yym776 := z.EncBinary() + _ = yym776 + if false { + } else { + z.F.EncMapUintIntfV(yy775, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintIntf`) + r.WriteMapElemValue() + if yyn774 { + r.EncodeNil() + } else { + if x.FptrMapUintIntf == nil { + r.EncodeNil() + } else { + yy777 := *x.FptrMapUintIntf + yym778 := z.EncBinary() + _ = yym778 + if false { + } else { + z.F.EncMapUintIntfV(yy777, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintString == nil { + r.EncodeNil() + } else { + yym780 := z.EncBinary() + _ = yym780 + if false { + } else { + z.F.EncMapUintStringV(x.FMapUintString, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintString`) + r.WriteMapElemValue() + if x.FMapUintString == nil { + r.EncodeNil() + } else { + yym781 := z.EncBinary() + _ = yym781 + 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 + yym784 := z.EncBinary() + _ = yym784 + if false { + } else { + z.F.EncMapUintStringV(yy783, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintString`) + r.WriteMapElemValue() + if yyn782 { + r.EncodeNil() + } else { + if x.FptrMapUintString == nil { + r.EncodeNil() + } else { + yy785 := *x.FptrMapUintString + yym786 := z.EncBinary() + _ = yym786 + if false { + } else { + z.F.EncMapUintStringV(yy785, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintUint == nil { + r.EncodeNil() + } else { + yym788 := z.EncBinary() + _ = yym788 + if false { + } else { + z.F.EncMapUintUintV(x.FMapUintUint, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintUint`) + r.WriteMapElemValue() + if x.FMapUintUint == nil { + r.EncodeNil() + } else { + yym789 := z.EncBinary() + _ = yym789 + 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 + yym792 := z.EncBinary() + _ = yym792 + if false { + } else { + z.F.EncMapUintUintV(yy791, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintUint`) + r.WriteMapElemValue() + if yyn790 { + r.EncodeNil() + } else { + if x.FptrMapUintUint == nil { + r.EncodeNil() + } else { + yy793 := *x.FptrMapUintUint + yym794 := z.EncBinary() + _ = yym794 + if false { + } else { + z.F.EncMapUintUintV(yy793, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintUint8 == nil { + r.EncodeNil() + } else { + yym796 := z.EncBinary() + _ = yym796 + if false { + } else { + z.F.EncMapUintUint8V(x.FMapUintUint8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintUint8`) + r.WriteMapElemValue() + if x.FMapUintUint8 == nil { + r.EncodeNil() + } else { + yym797 := z.EncBinary() + _ = yym797 + 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 + yym800 := z.EncBinary() + _ = yym800 + if false { + } else { + z.F.EncMapUintUint8V(yy799, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintUint8`) + r.WriteMapElemValue() + if yyn798 { + r.EncodeNil() + } else { + if x.FptrMapUintUint8 == nil { + r.EncodeNil() + } else { + yy801 := *x.FptrMapUintUint8 + yym802 := z.EncBinary() + _ = yym802 + if false { + } else { + z.F.EncMapUintUint8V(yy801, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintUint16 == nil { + r.EncodeNil() + } else { + yym804 := z.EncBinary() + _ = yym804 + if false { + } else { + z.F.EncMapUintUint16V(x.FMapUintUint16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintUint16`) + r.WriteMapElemValue() + if x.FMapUintUint16 == nil { + r.EncodeNil() + } else { + yym805 := z.EncBinary() + _ = yym805 + 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 + yym808 := z.EncBinary() + _ = yym808 + if false { + } else { + z.F.EncMapUintUint16V(yy807, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintUint16`) + r.WriteMapElemValue() + if yyn806 { + r.EncodeNil() + } else { + if x.FptrMapUintUint16 == nil { + r.EncodeNil() + } else { + yy809 := *x.FptrMapUintUint16 + yym810 := z.EncBinary() + _ = yym810 + if false { + } else { + z.F.EncMapUintUint16V(yy809, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintUint32 == nil { + r.EncodeNil() + } else { + yym812 := z.EncBinary() + _ = yym812 + if false { + } else { + z.F.EncMapUintUint32V(x.FMapUintUint32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintUint32`) + r.WriteMapElemValue() + if x.FMapUintUint32 == nil { + r.EncodeNil() + } else { + yym813 := z.EncBinary() + _ = yym813 + 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 + yym816 := z.EncBinary() + _ = yym816 + if false { + } else { + z.F.EncMapUintUint32V(yy815, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintUint32`) + r.WriteMapElemValue() + if yyn814 { + r.EncodeNil() + } else { + if x.FptrMapUintUint32 == nil { + r.EncodeNil() + } else { + yy817 := *x.FptrMapUintUint32 + yym818 := z.EncBinary() + _ = yym818 + if false { + } else { + z.F.EncMapUintUint32V(yy817, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintUint64 == nil { + r.EncodeNil() + } else { + yym820 := z.EncBinary() + _ = yym820 + if false { + } else { + z.F.EncMapUintUint64V(x.FMapUintUint64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintUint64`) + r.WriteMapElemValue() + if x.FMapUintUint64 == nil { + r.EncodeNil() + } else { + yym821 := z.EncBinary() + _ = yym821 + 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 + yym824 := z.EncBinary() + _ = yym824 + if false { + } else { + z.F.EncMapUintUint64V(yy823, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintUint64`) + r.WriteMapElemValue() + if yyn822 { + r.EncodeNil() + } else { + if x.FptrMapUintUint64 == nil { + r.EncodeNil() + } else { + yy825 := *x.FptrMapUintUint64 + yym826 := z.EncBinary() + _ = yym826 + if false { + } else { + z.F.EncMapUintUint64V(yy825, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintUintptr == nil { + r.EncodeNil() + } else { + yym828 := z.EncBinary() + _ = yym828 + if false { + } else { + z.F.EncMapUintUintptrV(x.FMapUintUintptr, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintUintptr`) + r.WriteMapElemValue() + if x.FMapUintUintptr == nil { + r.EncodeNil() + } else { + yym829 := z.EncBinary() + _ = yym829 + 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 + yym832 := z.EncBinary() + _ = yym832 + if false { + } else { + z.F.EncMapUintUintptrV(yy831, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintUintptr`) + r.WriteMapElemValue() + if yyn830 { + r.EncodeNil() + } else { + if x.FptrMapUintUintptr == nil { + r.EncodeNil() + } else { + yy833 := *x.FptrMapUintUintptr + yym834 := z.EncBinary() + _ = yym834 + if false { + } else { + z.F.EncMapUintUintptrV(yy833, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintInt == nil { + r.EncodeNil() + } else { + yym836 := z.EncBinary() + _ = yym836 + if false { + } else { + z.F.EncMapUintIntV(x.FMapUintInt, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintInt`) + r.WriteMapElemValue() + if x.FMapUintInt == nil { + r.EncodeNil() + } else { + yym837 := z.EncBinary() + _ = yym837 + 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 + yym840 := z.EncBinary() + _ = yym840 + if false { + } else { + z.F.EncMapUintIntV(yy839, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintInt`) + r.WriteMapElemValue() + if yyn838 { + r.EncodeNil() + } else { + if x.FptrMapUintInt == nil { + r.EncodeNil() + } else { + yy841 := *x.FptrMapUintInt + yym842 := z.EncBinary() + _ = yym842 + if false { + } else { + z.F.EncMapUintIntV(yy841, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintInt8 == nil { + r.EncodeNil() + } else { + yym844 := z.EncBinary() + _ = yym844 + if false { + } else { + z.F.EncMapUintInt8V(x.FMapUintInt8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintInt8`) + r.WriteMapElemValue() + if x.FMapUintInt8 == nil { + r.EncodeNil() + } else { + yym845 := z.EncBinary() + _ = yym845 + 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 + yym848 := z.EncBinary() + _ = yym848 + if false { + } else { + z.F.EncMapUintInt8V(yy847, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintInt8`) + r.WriteMapElemValue() + if yyn846 { + r.EncodeNil() + } else { + if x.FptrMapUintInt8 == nil { + r.EncodeNil() + } else { + yy849 := *x.FptrMapUintInt8 + yym850 := z.EncBinary() + _ = yym850 + if false { + } else { + z.F.EncMapUintInt8V(yy849, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintInt16 == nil { + r.EncodeNil() + } else { + yym852 := z.EncBinary() + _ = yym852 + if false { + } else { + z.F.EncMapUintInt16V(x.FMapUintInt16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintInt16`) + r.WriteMapElemValue() + if x.FMapUintInt16 == nil { + r.EncodeNil() + } else { + yym853 := z.EncBinary() + _ = yym853 + 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 + yym856 := z.EncBinary() + _ = yym856 + if false { + } else { + z.F.EncMapUintInt16V(yy855, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintInt16`) + r.WriteMapElemValue() + if yyn854 { + r.EncodeNil() + } else { + if x.FptrMapUintInt16 == nil { + r.EncodeNil() + } else { + yy857 := *x.FptrMapUintInt16 + yym858 := z.EncBinary() + _ = yym858 + if false { + } else { + z.F.EncMapUintInt16V(yy857, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintInt32 == nil { + r.EncodeNil() + } else { + yym860 := z.EncBinary() + _ = yym860 + if false { + } else { + z.F.EncMapUintInt32V(x.FMapUintInt32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintInt32`) + r.WriteMapElemValue() + if x.FMapUintInt32 == nil { + r.EncodeNil() + } else { + yym861 := z.EncBinary() + _ = yym861 + 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 + yym864 := z.EncBinary() + _ = yym864 + if false { + } else { + z.F.EncMapUintInt32V(yy863, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintInt32`) + r.WriteMapElemValue() + if yyn862 { + r.EncodeNil() + } else { + if x.FptrMapUintInt32 == nil { + r.EncodeNil() + } else { + yy865 := *x.FptrMapUintInt32 + yym866 := z.EncBinary() + _ = yym866 + if false { + } else { + z.F.EncMapUintInt32V(yy865, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintInt64 == nil { + r.EncodeNil() + } else { + yym868 := z.EncBinary() + _ = yym868 + if false { + } else { + z.F.EncMapUintInt64V(x.FMapUintInt64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintInt64`) + r.WriteMapElemValue() + if x.FMapUintInt64 == nil { + r.EncodeNil() + } else { + yym869 := z.EncBinary() + _ = yym869 + 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 + yym872 := z.EncBinary() + _ = yym872 + if false { + } else { + z.F.EncMapUintInt64V(yy871, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintInt64`) + r.WriteMapElemValue() + if yyn870 { + r.EncodeNil() + } else { + if x.FptrMapUintInt64 == nil { + r.EncodeNil() + } else { + yy873 := *x.FptrMapUintInt64 + yym874 := z.EncBinary() + _ = yym874 + if false { + } else { + z.F.EncMapUintInt64V(yy873, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintFloat32 == nil { + r.EncodeNil() + } else { + yym876 := z.EncBinary() + _ = yym876 + if false { + } else { + z.F.EncMapUintFloat32V(x.FMapUintFloat32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintFloat32`) + r.WriteMapElemValue() + if x.FMapUintFloat32 == nil { + r.EncodeNil() + } else { + yym877 := z.EncBinary() + _ = yym877 + 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 + yym880 := z.EncBinary() + _ = yym880 + if false { + } else { + z.F.EncMapUintFloat32V(yy879, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintFloat32`) + r.WriteMapElemValue() + if yyn878 { + r.EncodeNil() + } else { + if x.FptrMapUintFloat32 == nil { + r.EncodeNil() + } else { + yy881 := *x.FptrMapUintFloat32 + yym882 := z.EncBinary() + _ = yym882 + if false { + } else { + z.F.EncMapUintFloat32V(yy881, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintFloat64 == nil { + r.EncodeNil() + } else { + yym884 := z.EncBinary() + _ = yym884 + if false { + } else { + z.F.EncMapUintFloat64V(x.FMapUintFloat64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintFloat64`) + r.WriteMapElemValue() + if x.FMapUintFloat64 == nil { + r.EncodeNil() + } else { + yym885 := z.EncBinary() + _ = yym885 + 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 + yym888 := z.EncBinary() + _ = yym888 + if false { + } else { + z.F.EncMapUintFloat64V(yy887, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintFloat64`) + r.WriteMapElemValue() + if yyn886 { + r.EncodeNil() + } else { + if x.FptrMapUintFloat64 == nil { + r.EncodeNil() + } else { + yy889 := *x.FptrMapUintFloat64 + yym890 := z.EncBinary() + _ = yym890 + if false { + } else { + z.F.EncMapUintFloat64V(yy889, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintBool == nil { + r.EncodeNil() + } else { + yym892 := z.EncBinary() + _ = yym892 + if false { + } else { + z.F.EncMapUintBoolV(x.FMapUintBool, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintBool`) + r.WriteMapElemValue() + if x.FMapUintBool == nil { + r.EncodeNil() + } else { + yym893 := z.EncBinary() + _ = yym893 + 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 + yym896 := z.EncBinary() + _ = yym896 + if false { + } else { + z.F.EncMapUintBoolV(yy895, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintBool`) + r.WriteMapElemValue() + if yyn894 { + r.EncodeNil() + } else { + if x.FptrMapUintBool == nil { + r.EncodeNil() + } else { + yy897 := *x.FptrMapUintBool + yym898 := z.EncBinary() + _ = yym898 + if false { + } else { + z.F.EncMapUintBoolV(yy897, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Intf == nil { + r.EncodeNil() + } else { + yym900 := z.EncBinary() + _ = yym900 + if false { + } else { + z.F.EncMapUint8IntfV(x.FMapUint8Intf, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint8Intf`) + r.WriteMapElemValue() + if x.FMapUint8Intf == nil { + r.EncodeNil() + } else { + yym901 := z.EncBinary() + _ = yym901 + 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 + yym904 := z.EncBinary() + _ = yym904 + if false { + } else { + z.F.EncMapUint8IntfV(yy903, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint8Intf`) + r.WriteMapElemValue() + if yyn902 { + r.EncodeNil() + } else { + if x.FptrMapUint8Intf == nil { + r.EncodeNil() + } else { + yy905 := *x.FptrMapUint8Intf + yym906 := z.EncBinary() + _ = yym906 + if false { + } else { + z.F.EncMapUint8IntfV(yy905, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8String == nil { + r.EncodeNil() + } else { + yym908 := z.EncBinary() + _ = yym908 + if false { + } else { + z.F.EncMapUint8StringV(x.FMapUint8String, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint8String`) + r.WriteMapElemValue() + if x.FMapUint8String == nil { + r.EncodeNil() + } else { + yym909 := z.EncBinary() + _ = yym909 + 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 + yym912 := z.EncBinary() + _ = yym912 + if false { + } else { + z.F.EncMapUint8StringV(yy911, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint8String`) + r.WriteMapElemValue() + if yyn910 { + r.EncodeNil() + } else { + if x.FptrMapUint8String == nil { + r.EncodeNil() + } else { + yy913 := *x.FptrMapUint8String + yym914 := z.EncBinary() + _ = yym914 + if false { + } else { + z.F.EncMapUint8StringV(yy913, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Uint == nil { + r.EncodeNil() + } else { + yym916 := z.EncBinary() + _ = yym916 + if false { + } else { + z.F.EncMapUint8UintV(x.FMapUint8Uint, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint8Uint`) + r.WriteMapElemValue() + if x.FMapUint8Uint == nil { + r.EncodeNil() + } else { + yym917 := z.EncBinary() + _ = yym917 + 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 + yym920 := z.EncBinary() + _ = yym920 + if false { + } else { + z.F.EncMapUint8UintV(yy919, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint8Uint`) + r.WriteMapElemValue() + if yyn918 { + r.EncodeNil() + } else { + if x.FptrMapUint8Uint == nil { + r.EncodeNil() + } else { + yy921 := *x.FptrMapUint8Uint + yym922 := z.EncBinary() + _ = yym922 + if false { + } else { + z.F.EncMapUint8UintV(yy921, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Uint8 == nil { + r.EncodeNil() + } else { + yym924 := z.EncBinary() + _ = yym924 + if false { + } else { + z.F.EncMapUint8Uint8V(x.FMapUint8Uint8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint8Uint8`) + r.WriteMapElemValue() + if x.FMapUint8Uint8 == nil { + r.EncodeNil() + } else { + yym925 := z.EncBinary() + _ = yym925 + 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 + yym928 := z.EncBinary() + _ = yym928 + if false { + } else { + z.F.EncMapUint8Uint8V(yy927, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint8Uint8`) + r.WriteMapElemValue() + if yyn926 { + r.EncodeNil() + } else { + if x.FptrMapUint8Uint8 == nil { + r.EncodeNil() + } else { + yy929 := *x.FptrMapUint8Uint8 + yym930 := z.EncBinary() + _ = yym930 + if false { + } else { + z.F.EncMapUint8Uint8V(yy929, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Uint16 == nil { + r.EncodeNil() + } else { + yym932 := z.EncBinary() + _ = yym932 + if false { + } else { + z.F.EncMapUint8Uint16V(x.FMapUint8Uint16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint8Uint16`) + r.WriteMapElemValue() + if x.FMapUint8Uint16 == nil { + r.EncodeNil() + } else { + yym933 := z.EncBinary() + _ = yym933 + 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 + yym936 := z.EncBinary() + _ = yym936 + if false { + } else { + z.F.EncMapUint8Uint16V(yy935, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint8Uint16`) + r.WriteMapElemValue() + if yyn934 { + r.EncodeNil() + } else { + if x.FptrMapUint8Uint16 == nil { + r.EncodeNil() + } else { + yy937 := *x.FptrMapUint8Uint16 + yym938 := z.EncBinary() + _ = yym938 + if false { + } else { + z.F.EncMapUint8Uint16V(yy937, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Uint32 == nil { + r.EncodeNil() + } else { + yym940 := z.EncBinary() + _ = yym940 + if false { + } else { + z.F.EncMapUint8Uint32V(x.FMapUint8Uint32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint8Uint32`) + r.WriteMapElemValue() + if x.FMapUint8Uint32 == nil { + r.EncodeNil() + } else { + yym941 := z.EncBinary() + _ = yym941 + 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 + yym944 := z.EncBinary() + _ = yym944 + if false { + } else { + z.F.EncMapUint8Uint32V(yy943, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint8Uint32`) + r.WriteMapElemValue() + if yyn942 { + r.EncodeNil() + } else { + if x.FptrMapUint8Uint32 == nil { + r.EncodeNil() + } else { + yy945 := *x.FptrMapUint8Uint32 + yym946 := z.EncBinary() + _ = yym946 + if false { + } else { + z.F.EncMapUint8Uint32V(yy945, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Uint64 == nil { + r.EncodeNil() + } else { + yym948 := z.EncBinary() + _ = yym948 + if false { + } else { + z.F.EncMapUint8Uint64V(x.FMapUint8Uint64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint8Uint64`) + r.WriteMapElemValue() + if x.FMapUint8Uint64 == nil { + r.EncodeNil() + } else { + yym949 := z.EncBinary() + _ = yym949 + 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 + yym952 := z.EncBinary() + _ = yym952 + if false { + } else { + z.F.EncMapUint8Uint64V(yy951, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint8Uint64`) + r.WriteMapElemValue() + if yyn950 { + r.EncodeNil() + } else { + if x.FptrMapUint8Uint64 == nil { + r.EncodeNil() + } else { + yy953 := *x.FptrMapUint8Uint64 + yym954 := z.EncBinary() + _ = yym954 + if false { + } else { + z.F.EncMapUint8Uint64V(yy953, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Uintptr == nil { + r.EncodeNil() + } else { + yym956 := z.EncBinary() + _ = yym956 + if false { + } else { + z.F.EncMapUint8UintptrV(x.FMapUint8Uintptr, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint8Uintptr`) + r.WriteMapElemValue() + if x.FMapUint8Uintptr == nil { + r.EncodeNil() + } else { + yym957 := z.EncBinary() + _ = yym957 + 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 + yym960 := z.EncBinary() + _ = yym960 + if false { + } else { + z.F.EncMapUint8UintptrV(yy959, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint8Uintptr`) + r.WriteMapElemValue() + if yyn958 { + r.EncodeNil() + } else { + if x.FptrMapUint8Uintptr == nil { + r.EncodeNil() + } else { + yy961 := *x.FptrMapUint8Uintptr + yym962 := z.EncBinary() + _ = yym962 + if false { + } else { + z.F.EncMapUint8UintptrV(yy961, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Int == nil { + r.EncodeNil() + } else { + yym964 := z.EncBinary() + _ = yym964 + if false { + } else { + z.F.EncMapUint8IntV(x.FMapUint8Int, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint8Int`) + r.WriteMapElemValue() + if x.FMapUint8Int == nil { + r.EncodeNil() + } else { + yym965 := z.EncBinary() + _ = yym965 + 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 + yym968 := z.EncBinary() + _ = yym968 + if false { + } else { + z.F.EncMapUint8IntV(yy967, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint8Int`) + r.WriteMapElemValue() + if yyn966 { + r.EncodeNil() + } else { + if x.FptrMapUint8Int == nil { + r.EncodeNil() + } else { + yy969 := *x.FptrMapUint8Int + yym970 := z.EncBinary() + _ = yym970 + if false { + } else { + z.F.EncMapUint8IntV(yy969, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Int8 == nil { + r.EncodeNil() + } else { + yym972 := z.EncBinary() + _ = yym972 + if false { + } else { + z.F.EncMapUint8Int8V(x.FMapUint8Int8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint8Int8`) + r.WriteMapElemValue() + if x.FMapUint8Int8 == nil { + r.EncodeNil() + } else { + yym973 := z.EncBinary() + _ = yym973 + 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 + yym976 := z.EncBinary() + _ = yym976 + if false { + } else { + z.F.EncMapUint8Int8V(yy975, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint8Int8`) + r.WriteMapElemValue() + if yyn974 { + r.EncodeNil() + } else { + if x.FptrMapUint8Int8 == nil { + r.EncodeNil() + } else { + yy977 := *x.FptrMapUint8Int8 + yym978 := z.EncBinary() + _ = yym978 + if false { + } else { + z.F.EncMapUint8Int8V(yy977, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Int16 == nil { + r.EncodeNil() + } else { + yym980 := z.EncBinary() + _ = yym980 + if false { + } else { + z.F.EncMapUint8Int16V(x.FMapUint8Int16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint8Int16`) + r.WriteMapElemValue() + if x.FMapUint8Int16 == nil { + r.EncodeNil() + } else { + yym981 := z.EncBinary() + _ = yym981 + 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 + yym984 := z.EncBinary() + _ = yym984 + if false { + } else { + z.F.EncMapUint8Int16V(yy983, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint8Int16`) + r.WriteMapElemValue() + if yyn982 { + r.EncodeNil() + } else { + if x.FptrMapUint8Int16 == nil { + r.EncodeNil() + } else { + yy985 := *x.FptrMapUint8Int16 + yym986 := z.EncBinary() + _ = yym986 + if false { + } else { + z.F.EncMapUint8Int16V(yy985, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Int32 == nil { + r.EncodeNil() + } else { + yym988 := z.EncBinary() + _ = yym988 + if false { + } else { + z.F.EncMapUint8Int32V(x.FMapUint8Int32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint8Int32`) + r.WriteMapElemValue() + if x.FMapUint8Int32 == nil { + r.EncodeNil() + } else { + yym989 := z.EncBinary() + _ = yym989 + 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 + yym992 := z.EncBinary() + _ = yym992 + if false { + } else { + z.F.EncMapUint8Int32V(yy991, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint8Int32`) + r.WriteMapElemValue() + if yyn990 { + r.EncodeNil() + } else { + if x.FptrMapUint8Int32 == nil { + r.EncodeNil() + } else { + yy993 := *x.FptrMapUint8Int32 + yym994 := z.EncBinary() + _ = yym994 + if false { + } else { + z.F.EncMapUint8Int32V(yy993, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Int64 == nil { + r.EncodeNil() + } else { + yym996 := z.EncBinary() + _ = yym996 + if false { + } else { + z.F.EncMapUint8Int64V(x.FMapUint8Int64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint8Int64`) + r.WriteMapElemValue() + if x.FMapUint8Int64 == nil { + r.EncodeNil() + } else { + yym997 := z.EncBinary() + _ = yym997 + 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 + yym1000 := z.EncBinary() + _ = yym1000 + if false { + } else { + z.F.EncMapUint8Int64V(yy999, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint8Int64`) + r.WriteMapElemValue() + if yyn998 { + r.EncodeNil() + } else { + if x.FptrMapUint8Int64 == nil { + r.EncodeNil() + } else { + yy1001 := *x.FptrMapUint8Int64 + yym1002 := z.EncBinary() + _ = yym1002 + if false { + } else { + z.F.EncMapUint8Int64V(yy1001, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Float32 == nil { + r.EncodeNil() + } else { + yym1004 := z.EncBinary() + _ = yym1004 + if false { + } else { + z.F.EncMapUint8Float32V(x.FMapUint8Float32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint8Float32`) + r.WriteMapElemValue() + if x.FMapUint8Float32 == nil { + r.EncodeNil() + } else { + yym1005 := z.EncBinary() + _ = yym1005 + 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 + yym1008 := z.EncBinary() + _ = yym1008 + if false { + } else { + z.F.EncMapUint8Float32V(yy1007, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint8Float32`) + r.WriteMapElemValue() + if yyn1006 { + r.EncodeNil() + } else { + if x.FptrMapUint8Float32 == nil { + r.EncodeNil() + } else { + yy1009 := *x.FptrMapUint8Float32 + yym1010 := z.EncBinary() + _ = yym1010 + if false { + } else { + z.F.EncMapUint8Float32V(yy1009, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Float64 == nil { + r.EncodeNil() + } else { + yym1012 := z.EncBinary() + _ = yym1012 + if false { + } else { + z.F.EncMapUint8Float64V(x.FMapUint8Float64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint8Float64`) + r.WriteMapElemValue() + if x.FMapUint8Float64 == nil { + r.EncodeNil() + } else { + yym1013 := z.EncBinary() + _ = yym1013 + 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 + yym1016 := z.EncBinary() + _ = yym1016 + if false { + } else { + z.F.EncMapUint8Float64V(yy1015, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint8Float64`) + r.WriteMapElemValue() + if yyn1014 { + r.EncodeNil() + } else { + if x.FptrMapUint8Float64 == nil { + r.EncodeNil() + } else { + yy1017 := *x.FptrMapUint8Float64 + yym1018 := z.EncBinary() + _ = yym1018 + if false { + } else { + z.F.EncMapUint8Float64V(yy1017, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint8Bool == nil { + r.EncodeNil() + } else { + yym1020 := z.EncBinary() + _ = yym1020 + if false { + } else { + z.F.EncMapUint8BoolV(x.FMapUint8Bool, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint8Bool`) + r.WriteMapElemValue() + if x.FMapUint8Bool == nil { + r.EncodeNil() + } else { + yym1021 := z.EncBinary() + _ = yym1021 + 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 + yym1024 := z.EncBinary() + _ = yym1024 + if false { + } else { + z.F.EncMapUint8BoolV(yy1023, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint8Bool`) + r.WriteMapElemValue() + if yyn1022 { + r.EncodeNil() + } else { + if x.FptrMapUint8Bool == nil { + r.EncodeNil() + } else { + yy1025 := *x.FptrMapUint8Bool + yym1026 := z.EncBinary() + _ = yym1026 + if false { + } else { + z.F.EncMapUint8BoolV(yy1025, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Intf == nil { + r.EncodeNil() + } else { + yym1028 := z.EncBinary() + _ = yym1028 + if false { + } else { + z.F.EncMapUint16IntfV(x.FMapUint16Intf, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint16Intf`) + r.WriteMapElemValue() + if x.FMapUint16Intf == nil { + r.EncodeNil() + } else { + yym1029 := z.EncBinary() + _ = yym1029 + 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 + yym1032 := z.EncBinary() + _ = yym1032 + if false { + } else { + z.F.EncMapUint16IntfV(yy1031, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint16Intf`) + r.WriteMapElemValue() + if yyn1030 { + r.EncodeNil() + } else { + if x.FptrMapUint16Intf == nil { + r.EncodeNil() + } else { + yy1033 := *x.FptrMapUint16Intf + yym1034 := z.EncBinary() + _ = yym1034 + if false { + } else { + z.F.EncMapUint16IntfV(yy1033, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16String == nil { + r.EncodeNil() + } else { + yym1036 := z.EncBinary() + _ = yym1036 + if false { + } else { + z.F.EncMapUint16StringV(x.FMapUint16String, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint16String`) + r.WriteMapElemValue() + if x.FMapUint16String == nil { + r.EncodeNil() + } else { + yym1037 := z.EncBinary() + _ = yym1037 + 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 + yym1040 := z.EncBinary() + _ = yym1040 + if false { + } else { + z.F.EncMapUint16StringV(yy1039, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint16String`) + r.WriteMapElemValue() + if yyn1038 { + r.EncodeNil() + } else { + if x.FptrMapUint16String == nil { + r.EncodeNil() + } else { + yy1041 := *x.FptrMapUint16String + yym1042 := z.EncBinary() + _ = yym1042 + if false { + } else { + z.F.EncMapUint16StringV(yy1041, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Uint == nil { + r.EncodeNil() + } else { + yym1044 := z.EncBinary() + _ = yym1044 + if false { + } else { + z.F.EncMapUint16UintV(x.FMapUint16Uint, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint16Uint`) + r.WriteMapElemValue() + if x.FMapUint16Uint == nil { + r.EncodeNil() + } else { + yym1045 := z.EncBinary() + _ = yym1045 + 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 + yym1048 := z.EncBinary() + _ = yym1048 + if false { + } else { + z.F.EncMapUint16UintV(yy1047, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint16Uint`) + r.WriteMapElemValue() + if yyn1046 { + r.EncodeNil() + } else { + if x.FptrMapUint16Uint == nil { + r.EncodeNil() + } else { + yy1049 := *x.FptrMapUint16Uint + yym1050 := z.EncBinary() + _ = yym1050 + if false { + } else { + z.F.EncMapUint16UintV(yy1049, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Uint8 == nil { + r.EncodeNil() + } else { + yym1052 := z.EncBinary() + _ = yym1052 + if false { + } else { + z.F.EncMapUint16Uint8V(x.FMapUint16Uint8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint16Uint8`) + r.WriteMapElemValue() + if x.FMapUint16Uint8 == nil { + r.EncodeNil() + } else { + yym1053 := z.EncBinary() + _ = yym1053 + 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 + yym1056 := z.EncBinary() + _ = yym1056 + if false { + } else { + z.F.EncMapUint16Uint8V(yy1055, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint16Uint8`) + r.WriteMapElemValue() + if yyn1054 { + r.EncodeNil() + } else { + if x.FptrMapUint16Uint8 == nil { + r.EncodeNil() + } else { + yy1057 := *x.FptrMapUint16Uint8 + yym1058 := z.EncBinary() + _ = yym1058 + if false { + } else { + z.F.EncMapUint16Uint8V(yy1057, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Uint16 == nil { + r.EncodeNil() + } else { + yym1060 := z.EncBinary() + _ = yym1060 + if false { + } else { + z.F.EncMapUint16Uint16V(x.FMapUint16Uint16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint16Uint16`) + r.WriteMapElemValue() + if x.FMapUint16Uint16 == nil { + r.EncodeNil() + } else { + yym1061 := z.EncBinary() + _ = yym1061 + 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 + yym1064 := z.EncBinary() + _ = yym1064 + if false { + } else { + z.F.EncMapUint16Uint16V(yy1063, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint16Uint16`) + r.WriteMapElemValue() + if yyn1062 { + r.EncodeNil() + } else { + if x.FptrMapUint16Uint16 == nil { + r.EncodeNil() + } else { + yy1065 := *x.FptrMapUint16Uint16 + yym1066 := z.EncBinary() + _ = yym1066 + if false { + } else { + z.F.EncMapUint16Uint16V(yy1065, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Uint32 == nil { + r.EncodeNil() + } else { + yym1068 := z.EncBinary() + _ = yym1068 + if false { + } else { + z.F.EncMapUint16Uint32V(x.FMapUint16Uint32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint16Uint32`) + r.WriteMapElemValue() + if x.FMapUint16Uint32 == nil { + r.EncodeNil() + } else { + yym1069 := z.EncBinary() + _ = yym1069 + 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 + yym1072 := z.EncBinary() + _ = yym1072 + if false { + } else { + z.F.EncMapUint16Uint32V(yy1071, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint16Uint32`) + r.WriteMapElemValue() + if yyn1070 { + r.EncodeNil() + } else { + if x.FptrMapUint16Uint32 == nil { + r.EncodeNil() + } else { + yy1073 := *x.FptrMapUint16Uint32 + yym1074 := z.EncBinary() + _ = yym1074 + if false { + } else { + z.F.EncMapUint16Uint32V(yy1073, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Uint64 == nil { + r.EncodeNil() + } else { + yym1076 := z.EncBinary() + _ = yym1076 + if false { + } else { + z.F.EncMapUint16Uint64V(x.FMapUint16Uint64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint16Uint64`) + r.WriteMapElemValue() + if x.FMapUint16Uint64 == nil { + r.EncodeNil() + } else { + yym1077 := z.EncBinary() + _ = yym1077 + 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 + yym1080 := z.EncBinary() + _ = yym1080 + if false { + } else { + z.F.EncMapUint16Uint64V(yy1079, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint16Uint64`) + r.WriteMapElemValue() + if yyn1078 { + r.EncodeNil() + } else { + if x.FptrMapUint16Uint64 == nil { + r.EncodeNil() + } else { + yy1081 := *x.FptrMapUint16Uint64 + yym1082 := z.EncBinary() + _ = yym1082 + if false { + } else { + z.F.EncMapUint16Uint64V(yy1081, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Uintptr == nil { + r.EncodeNil() + } else { + yym1084 := z.EncBinary() + _ = yym1084 + if false { + } else { + z.F.EncMapUint16UintptrV(x.FMapUint16Uintptr, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint16Uintptr`) + r.WriteMapElemValue() + if x.FMapUint16Uintptr == nil { + r.EncodeNil() + } else { + yym1085 := z.EncBinary() + _ = yym1085 + 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 + yym1088 := z.EncBinary() + _ = yym1088 + if false { + } else { + z.F.EncMapUint16UintptrV(yy1087, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint16Uintptr`) + r.WriteMapElemValue() + if yyn1086 { + r.EncodeNil() + } else { + if x.FptrMapUint16Uintptr == nil { + r.EncodeNil() + } else { + yy1089 := *x.FptrMapUint16Uintptr + yym1090 := z.EncBinary() + _ = yym1090 + if false { + } else { + z.F.EncMapUint16UintptrV(yy1089, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Int == nil { + r.EncodeNil() + } else { + yym1092 := z.EncBinary() + _ = yym1092 + if false { + } else { + z.F.EncMapUint16IntV(x.FMapUint16Int, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint16Int`) + r.WriteMapElemValue() + if x.FMapUint16Int == nil { + r.EncodeNil() + } else { + yym1093 := z.EncBinary() + _ = yym1093 + 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 + yym1096 := z.EncBinary() + _ = yym1096 + if false { + } else { + z.F.EncMapUint16IntV(yy1095, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint16Int`) + r.WriteMapElemValue() + if yyn1094 { + r.EncodeNil() + } else { + if x.FptrMapUint16Int == nil { + r.EncodeNil() + } else { + yy1097 := *x.FptrMapUint16Int + yym1098 := z.EncBinary() + _ = yym1098 + if false { + } else { + z.F.EncMapUint16IntV(yy1097, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Int8 == nil { + r.EncodeNil() + } else { + yym1100 := z.EncBinary() + _ = yym1100 + if false { + } else { + z.F.EncMapUint16Int8V(x.FMapUint16Int8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint16Int8`) + r.WriteMapElemValue() + if x.FMapUint16Int8 == nil { + r.EncodeNil() + } else { + yym1101 := z.EncBinary() + _ = yym1101 + 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 + yym1104 := z.EncBinary() + _ = yym1104 + if false { + } else { + z.F.EncMapUint16Int8V(yy1103, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint16Int8`) + r.WriteMapElemValue() + if yyn1102 { + r.EncodeNil() + } else { + if x.FptrMapUint16Int8 == nil { + r.EncodeNil() + } else { + yy1105 := *x.FptrMapUint16Int8 + yym1106 := z.EncBinary() + _ = yym1106 + if false { + } else { + z.F.EncMapUint16Int8V(yy1105, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Int16 == nil { + r.EncodeNil() + } else { + yym1108 := z.EncBinary() + _ = yym1108 + if false { + } else { + z.F.EncMapUint16Int16V(x.FMapUint16Int16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint16Int16`) + r.WriteMapElemValue() + if x.FMapUint16Int16 == nil { + r.EncodeNil() + } else { + yym1109 := z.EncBinary() + _ = yym1109 + 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 + yym1112 := z.EncBinary() + _ = yym1112 + if false { + } else { + z.F.EncMapUint16Int16V(yy1111, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint16Int16`) + r.WriteMapElemValue() + if yyn1110 { + r.EncodeNil() + } else { + if x.FptrMapUint16Int16 == nil { + r.EncodeNil() + } else { + yy1113 := *x.FptrMapUint16Int16 + yym1114 := z.EncBinary() + _ = yym1114 + if false { + } else { + z.F.EncMapUint16Int16V(yy1113, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Int32 == nil { + r.EncodeNil() + } else { + yym1116 := z.EncBinary() + _ = yym1116 + if false { + } else { + z.F.EncMapUint16Int32V(x.FMapUint16Int32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint16Int32`) + r.WriteMapElemValue() + if x.FMapUint16Int32 == nil { + r.EncodeNil() + } else { + yym1117 := z.EncBinary() + _ = yym1117 + 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 + yym1120 := z.EncBinary() + _ = yym1120 + if false { + } else { + z.F.EncMapUint16Int32V(yy1119, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint16Int32`) + r.WriteMapElemValue() + if yyn1118 { + r.EncodeNil() + } else { + if x.FptrMapUint16Int32 == nil { + r.EncodeNil() + } else { + yy1121 := *x.FptrMapUint16Int32 + yym1122 := z.EncBinary() + _ = yym1122 + if false { + } else { + z.F.EncMapUint16Int32V(yy1121, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Int64 == nil { + r.EncodeNil() + } else { + yym1124 := z.EncBinary() + _ = yym1124 + if false { + } else { + z.F.EncMapUint16Int64V(x.FMapUint16Int64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint16Int64`) + r.WriteMapElemValue() + if x.FMapUint16Int64 == nil { + r.EncodeNil() + } else { + yym1125 := z.EncBinary() + _ = yym1125 + 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 + yym1128 := z.EncBinary() + _ = yym1128 + if false { + } else { + z.F.EncMapUint16Int64V(yy1127, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint16Int64`) + r.WriteMapElemValue() + if yyn1126 { + r.EncodeNil() + } else { + if x.FptrMapUint16Int64 == nil { + r.EncodeNil() + } else { + yy1129 := *x.FptrMapUint16Int64 + yym1130 := z.EncBinary() + _ = yym1130 + if false { + } else { + z.F.EncMapUint16Int64V(yy1129, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Float32 == nil { + r.EncodeNil() + } else { + yym1132 := z.EncBinary() + _ = yym1132 + if false { + } else { + z.F.EncMapUint16Float32V(x.FMapUint16Float32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint16Float32`) + r.WriteMapElemValue() + if x.FMapUint16Float32 == nil { + r.EncodeNil() + } else { + yym1133 := z.EncBinary() + _ = yym1133 + 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 + yym1136 := z.EncBinary() + _ = yym1136 + if false { + } else { + z.F.EncMapUint16Float32V(yy1135, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint16Float32`) + r.WriteMapElemValue() + if yyn1134 { + r.EncodeNil() + } else { + if x.FptrMapUint16Float32 == nil { + r.EncodeNil() + } else { + yy1137 := *x.FptrMapUint16Float32 + yym1138 := z.EncBinary() + _ = yym1138 + if false { + } else { + z.F.EncMapUint16Float32V(yy1137, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Float64 == nil { + r.EncodeNil() + } else { + yym1140 := z.EncBinary() + _ = yym1140 + if false { + } else { + z.F.EncMapUint16Float64V(x.FMapUint16Float64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint16Float64`) + r.WriteMapElemValue() + if x.FMapUint16Float64 == nil { + r.EncodeNil() + } else { + yym1141 := z.EncBinary() + _ = yym1141 + 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 + yym1144 := z.EncBinary() + _ = yym1144 + if false { + } else { + z.F.EncMapUint16Float64V(yy1143, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint16Float64`) + r.WriteMapElemValue() + if yyn1142 { + r.EncodeNil() + } else { + if x.FptrMapUint16Float64 == nil { + r.EncodeNil() + } else { + yy1145 := *x.FptrMapUint16Float64 + yym1146 := z.EncBinary() + _ = yym1146 + if false { + } else { + z.F.EncMapUint16Float64V(yy1145, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint16Bool == nil { + r.EncodeNil() + } else { + yym1148 := z.EncBinary() + _ = yym1148 + if false { + } else { + z.F.EncMapUint16BoolV(x.FMapUint16Bool, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint16Bool`) + r.WriteMapElemValue() + if x.FMapUint16Bool == nil { + r.EncodeNil() + } else { + yym1149 := z.EncBinary() + _ = yym1149 + 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 + yym1152 := z.EncBinary() + _ = yym1152 + if false { + } else { + z.F.EncMapUint16BoolV(yy1151, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint16Bool`) + r.WriteMapElemValue() + if yyn1150 { + r.EncodeNil() + } else { + if x.FptrMapUint16Bool == nil { + r.EncodeNil() + } else { + yy1153 := *x.FptrMapUint16Bool + yym1154 := z.EncBinary() + _ = yym1154 + if false { + } else { + z.F.EncMapUint16BoolV(yy1153, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Intf == nil { + r.EncodeNil() + } else { + yym1156 := z.EncBinary() + _ = yym1156 + if false { + } else { + z.F.EncMapUint32IntfV(x.FMapUint32Intf, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint32Intf`) + r.WriteMapElemValue() + if x.FMapUint32Intf == nil { + r.EncodeNil() + } else { + yym1157 := z.EncBinary() + _ = yym1157 + 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 + yym1160 := z.EncBinary() + _ = yym1160 + if false { + } else { + z.F.EncMapUint32IntfV(yy1159, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint32Intf`) + r.WriteMapElemValue() + if yyn1158 { + r.EncodeNil() + } else { + if x.FptrMapUint32Intf == nil { + r.EncodeNil() + } else { + yy1161 := *x.FptrMapUint32Intf + yym1162 := z.EncBinary() + _ = yym1162 + if false { + } else { + z.F.EncMapUint32IntfV(yy1161, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32String == nil { + r.EncodeNil() + } else { + yym1164 := z.EncBinary() + _ = yym1164 + if false { + } else { + z.F.EncMapUint32StringV(x.FMapUint32String, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint32String`) + r.WriteMapElemValue() + if x.FMapUint32String == nil { + r.EncodeNil() + } else { + yym1165 := z.EncBinary() + _ = yym1165 + 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 + yym1168 := z.EncBinary() + _ = yym1168 + if false { + } else { + z.F.EncMapUint32StringV(yy1167, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint32String`) + r.WriteMapElemValue() + if yyn1166 { + r.EncodeNil() + } else { + if x.FptrMapUint32String == nil { + r.EncodeNil() + } else { + yy1169 := *x.FptrMapUint32String + yym1170 := z.EncBinary() + _ = yym1170 + if false { + } else { + z.F.EncMapUint32StringV(yy1169, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Uint == nil { + r.EncodeNil() + } else { + yym1172 := z.EncBinary() + _ = yym1172 + if false { + } else { + z.F.EncMapUint32UintV(x.FMapUint32Uint, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint32Uint`) + r.WriteMapElemValue() + if x.FMapUint32Uint == nil { + r.EncodeNil() + } else { + yym1173 := z.EncBinary() + _ = yym1173 + 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 + yym1176 := z.EncBinary() + _ = yym1176 + if false { + } else { + z.F.EncMapUint32UintV(yy1175, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint32Uint`) + r.WriteMapElemValue() + if yyn1174 { + r.EncodeNil() + } else { + if x.FptrMapUint32Uint == nil { + r.EncodeNil() + } else { + yy1177 := *x.FptrMapUint32Uint + yym1178 := z.EncBinary() + _ = yym1178 + if false { + } else { + z.F.EncMapUint32UintV(yy1177, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Uint8 == nil { + r.EncodeNil() + } else { + yym1180 := z.EncBinary() + _ = yym1180 + if false { + } else { + z.F.EncMapUint32Uint8V(x.FMapUint32Uint8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint32Uint8`) + r.WriteMapElemValue() + if x.FMapUint32Uint8 == nil { + r.EncodeNil() + } else { + yym1181 := z.EncBinary() + _ = yym1181 + 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 + yym1184 := z.EncBinary() + _ = yym1184 + if false { + } else { + z.F.EncMapUint32Uint8V(yy1183, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint32Uint8`) + r.WriteMapElemValue() + if yyn1182 { + r.EncodeNil() + } else { + if x.FptrMapUint32Uint8 == nil { + r.EncodeNil() + } else { + yy1185 := *x.FptrMapUint32Uint8 + yym1186 := z.EncBinary() + _ = yym1186 + if false { + } else { + z.F.EncMapUint32Uint8V(yy1185, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Uint16 == nil { + r.EncodeNil() + } else { + yym1188 := z.EncBinary() + _ = yym1188 + if false { + } else { + z.F.EncMapUint32Uint16V(x.FMapUint32Uint16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint32Uint16`) + r.WriteMapElemValue() + if x.FMapUint32Uint16 == nil { + r.EncodeNil() + } else { + yym1189 := z.EncBinary() + _ = yym1189 + 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 + yym1192 := z.EncBinary() + _ = yym1192 + if false { + } else { + z.F.EncMapUint32Uint16V(yy1191, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint32Uint16`) + r.WriteMapElemValue() + if yyn1190 { + r.EncodeNil() + } else { + if x.FptrMapUint32Uint16 == nil { + r.EncodeNil() + } else { + yy1193 := *x.FptrMapUint32Uint16 + yym1194 := z.EncBinary() + _ = yym1194 + if false { + } else { + z.F.EncMapUint32Uint16V(yy1193, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Uint32 == nil { + r.EncodeNil() + } else { + yym1196 := z.EncBinary() + _ = yym1196 + if false { + } else { + z.F.EncMapUint32Uint32V(x.FMapUint32Uint32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint32Uint32`) + r.WriteMapElemValue() + if x.FMapUint32Uint32 == nil { + r.EncodeNil() + } else { + yym1197 := z.EncBinary() + _ = yym1197 + 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 + yym1200 := z.EncBinary() + _ = yym1200 + if false { + } else { + z.F.EncMapUint32Uint32V(yy1199, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint32Uint32`) + r.WriteMapElemValue() + if yyn1198 { + r.EncodeNil() + } else { + if x.FptrMapUint32Uint32 == nil { + r.EncodeNil() + } else { + yy1201 := *x.FptrMapUint32Uint32 + yym1202 := z.EncBinary() + _ = yym1202 + if false { + } else { + z.F.EncMapUint32Uint32V(yy1201, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Uint64 == nil { + r.EncodeNil() + } else { + yym1204 := z.EncBinary() + _ = yym1204 + if false { + } else { + z.F.EncMapUint32Uint64V(x.FMapUint32Uint64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint32Uint64`) + r.WriteMapElemValue() + if x.FMapUint32Uint64 == nil { + r.EncodeNil() + } else { + yym1205 := z.EncBinary() + _ = yym1205 + 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 + yym1208 := z.EncBinary() + _ = yym1208 + if false { + } else { + z.F.EncMapUint32Uint64V(yy1207, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint32Uint64`) + r.WriteMapElemValue() + if yyn1206 { + r.EncodeNil() + } else { + if x.FptrMapUint32Uint64 == nil { + r.EncodeNil() + } else { + yy1209 := *x.FptrMapUint32Uint64 + yym1210 := z.EncBinary() + _ = yym1210 + if false { + } else { + z.F.EncMapUint32Uint64V(yy1209, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Uintptr == nil { + r.EncodeNil() + } else { + yym1212 := z.EncBinary() + _ = yym1212 + if false { + } else { + z.F.EncMapUint32UintptrV(x.FMapUint32Uintptr, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint32Uintptr`) + r.WriteMapElemValue() + if x.FMapUint32Uintptr == nil { + r.EncodeNil() + } else { + yym1213 := z.EncBinary() + _ = yym1213 + 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 + yym1216 := z.EncBinary() + _ = yym1216 + if false { + } else { + z.F.EncMapUint32UintptrV(yy1215, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint32Uintptr`) + r.WriteMapElemValue() + if yyn1214 { + r.EncodeNil() + } else { + if x.FptrMapUint32Uintptr == nil { + r.EncodeNil() + } else { + yy1217 := *x.FptrMapUint32Uintptr + yym1218 := z.EncBinary() + _ = yym1218 + if false { + } else { + z.F.EncMapUint32UintptrV(yy1217, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Int == nil { + r.EncodeNil() + } else { + yym1220 := z.EncBinary() + _ = yym1220 + if false { + } else { + z.F.EncMapUint32IntV(x.FMapUint32Int, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint32Int`) + r.WriteMapElemValue() + if x.FMapUint32Int == nil { + r.EncodeNil() + } else { + yym1221 := z.EncBinary() + _ = yym1221 + 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 + yym1224 := z.EncBinary() + _ = yym1224 + if false { + } else { + z.F.EncMapUint32IntV(yy1223, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint32Int`) + r.WriteMapElemValue() + if yyn1222 { + r.EncodeNil() + } else { + if x.FptrMapUint32Int == nil { + r.EncodeNil() + } else { + yy1225 := *x.FptrMapUint32Int + yym1226 := z.EncBinary() + _ = yym1226 + if false { + } else { + z.F.EncMapUint32IntV(yy1225, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Int8 == nil { + r.EncodeNil() + } else { + yym1228 := z.EncBinary() + _ = yym1228 + if false { + } else { + z.F.EncMapUint32Int8V(x.FMapUint32Int8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint32Int8`) + r.WriteMapElemValue() + if x.FMapUint32Int8 == nil { + r.EncodeNil() + } else { + yym1229 := z.EncBinary() + _ = yym1229 + 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 + yym1232 := z.EncBinary() + _ = yym1232 + if false { + } else { + z.F.EncMapUint32Int8V(yy1231, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint32Int8`) + r.WriteMapElemValue() + if yyn1230 { + r.EncodeNil() + } else { + if x.FptrMapUint32Int8 == nil { + r.EncodeNil() + } else { + yy1233 := *x.FptrMapUint32Int8 + yym1234 := z.EncBinary() + _ = yym1234 + if false { + } else { + z.F.EncMapUint32Int8V(yy1233, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Int16 == nil { + r.EncodeNil() + } else { + yym1236 := z.EncBinary() + _ = yym1236 + if false { + } else { + z.F.EncMapUint32Int16V(x.FMapUint32Int16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint32Int16`) + r.WriteMapElemValue() + if x.FMapUint32Int16 == nil { + r.EncodeNil() + } else { + yym1237 := z.EncBinary() + _ = yym1237 + 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 + yym1240 := z.EncBinary() + _ = yym1240 + if false { + } else { + z.F.EncMapUint32Int16V(yy1239, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint32Int16`) + r.WriteMapElemValue() + if yyn1238 { + r.EncodeNil() + } else { + if x.FptrMapUint32Int16 == nil { + r.EncodeNil() + } else { + yy1241 := *x.FptrMapUint32Int16 + yym1242 := z.EncBinary() + _ = yym1242 + if false { + } else { + z.F.EncMapUint32Int16V(yy1241, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Int32 == nil { + r.EncodeNil() + } else { + yym1244 := z.EncBinary() + _ = yym1244 + if false { + } else { + z.F.EncMapUint32Int32V(x.FMapUint32Int32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint32Int32`) + r.WriteMapElemValue() + if x.FMapUint32Int32 == nil { + r.EncodeNil() + } else { + yym1245 := z.EncBinary() + _ = yym1245 + 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 + yym1248 := z.EncBinary() + _ = yym1248 + if false { + } else { + z.F.EncMapUint32Int32V(yy1247, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint32Int32`) + r.WriteMapElemValue() + if yyn1246 { + r.EncodeNil() + } else { + if x.FptrMapUint32Int32 == nil { + r.EncodeNil() + } else { + yy1249 := *x.FptrMapUint32Int32 + yym1250 := z.EncBinary() + _ = yym1250 + if false { + } else { + z.F.EncMapUint32Int32V(yy1249, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Int64 == nil { + r.EncodeNil() + } else { + yym1252 := z.EncBinary() + _ = yym1252 + if false { + } else { + z.F.EncMapUint32Int64V(x.FMapUint32Int64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint32Int64`) + r.WriteMapElemValue() + if x.FMapUint32Int64 == nil { + r.EncodeNil() + } else { + yym1253 := z.EncBinary() + _ = yym1253 + 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 + yym1256 := z.EncBinary() + _ = yym1256 + if false { + } else { + z.F.EncMapUint32Int64V(yy1255, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint32Int64`) + r.WriteMapElemValue() + if yyn1254 { + r.EncodeNil() + } else { + if x.FptrMapUint32Int64 == nil { + r.EncodeNil() + } else { + yy1257 := *x.FptrMapUint32Int64 + yym1258 := z.EncBinary() + _ = yym1258 + if false { + } else { + z.F.EncMapUint32Int64V(yy1257, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Float32 == nil { + r.EncodeNil() + } else { + yym1260 := z.EncBinary() + _ = yym1260 + if false { + } else { + z.F.EncMapUint32Float32V(x.FMapUint32Float32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint32Float32`) + r.WriteMapElemValue() + if x.FMapUint32Float32 == nil { + r.EncodeNil() + } else { + yym1261 := z.EncBinary() + _ = yym1261 + 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 + yym1264 := z.EncBinary() + _ = yym1264 + if false { + } else { + z.F.EncMapUint32Float32V(yy1263, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint32Float32`) + r.WriteMapElemValue() + if yyn1262 { + r.EncodeNil() + } else { + if x.FptrMapUint32Float32 == nil { + r.EncodeNil() + } else { + yy1265 := *x.FptrMapUint32Float32 + yym1266 := z.EncBinary() + _ = yym1266 + if false { + } else { + z.F.EncMapUint32Float32V(yy1265, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Float64 == nil { + r.EncodeNil() + } else { + yym1268 := z.EncBinary() + _ = yym1268 + if false { + } else { + z.F.EncMapUint32Float64V(x.FMapUint32Float64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint32Float64`) + r.WriteMapElemValue() + if x.FMapUint32Float64 == nil { + r.EncodeNil() + } else { + yym1269 := z.EncBinary() + _ = yym1269 + 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 + yym1272 := z.EncBinary() + _ = yym1272 + if false { + } else { + z.F.EncMapUint32Float64V(yy1271, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint32Float64`) + r.WriteMapElemValue() + if yyn1270 { + r.EncodeNil() + } else { + if x.FptrMapUint32Float64 == nil { + r.EncodeNil() + } else { + yy1273 := *x.FptrMapUint32Float64 + yym1274 := z.EncBinary() + _ = yym1274 + if false { + } else { + z.F.EncMapUint32Float64V(yy1273, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint32Bool == nil { + r.EncodeNil() + } else { + yym1276 := z.EncBinary() + _ = yym1276 + if false { + } else { + z.F.EncMapUint32BoolV(x.FMapUint32Bool, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint32Bool`) + r.WriteMapElemValue() + if x.FMapUint32Bool == nil { + r.EncodeNil() + } else { + yym1277 := z.EncBinary() + _ = yym1277 + 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 + yym1280 := z.EncBinary() + _ = yym1280 + if false { + } else { + z.F.EncMapUint32BoolV(yy1279, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint32Bool`) + r.WriteMapElemValue() + if yyn1278 { + r.EncodeNil() + } else { + if x.FptrMapUint32Bool == nil { + r.EncodeNil() + } else { + yy1281 := *x.FptrMapUint32Bool + yym1282 := z.EncBinary() + _ = yym1282 + if false { + } else { + z.F.EncMapUint32BoolV(yy1281, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Intf == nil { + r.EncodeNil() + } else { + yym1284 := z.EncBinary() + _ = yym1284 + if false { + } else { + z.F.EncMapUint64IntfV(x.FMapUint64Intf, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint64Intf`) + r.WriteMapElemValue() + if x.FMapUint64Intf == nil { + r.EncodeNil() + } else { + yym1285 := z.EncBinary() + _ = yym1285 + 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 + yym1288 := z.EncBinary() + _ = yym1288 + if false { + } else { + z.F.EncMapUint64IntfV(yy1287, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint64Intf`) + r.WriteMapElemValue() + if yyn1286 { + r.EncodeNil() + } else { + if x.FptrMapUint64Intf == nil { + r.EncodeNil() + } else { + yy1289 := *x.FptrMapUint64Intf + yym1290 := z.EncBinary() + _ = yym1290 + if false { + } else { + z.F.EncMapUint64IntfV(yy1289, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64String == nil { + r.EncodeNil() + } else { + yym1292 := z.EncBinary() + _ = yym1292 + if false { + } else { + z.F.EncMapUint64StringV(x.FMapUint64String, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint64String`) + r.WriteMapElemValue() + if x.FMapUint64String == nil { + r.EncodeNil() + } else { + yym1293 := z.EncBinary() + _ = yym1293 + 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 + yym1296 := z.EncBinary() + _ = yym1296 + if false { + } else { + z.F.EncMapUint64StringV(yy1295, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint64String`) + r.WriteMapElemValue() + if yyn1294 { + r.EncodeNil() + } else { + if x.FptrMapUint64String == nil { + r.EncodeNil() + } else { + yy1297 := *x.FptrMapUint64String + yym1298 := z.EncBinary() + _ = yym1298 + if false { + } else { + z.F.EncMapUint64StringV(yy1297, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Uint == nil { + r.EncodeNil() + } else { + yym1300 := z.EncBinary() + _ = yym1300 + if false { + } else { + z.F.EncMapUint64UintV(x.FMapUint64Uint, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint64Uint`) + r.WriteMapElemValue() + if x.FMapUint64Uint == nil { + r.EncodeNil() + } else { + yym1301 := z.EncBinary() + _ = yym1301 + 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 + yym1304 := z.EncBinary() + _ = yym1304 + if false { + } else { + z.F.EncMapUint64UintV(yy1303, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint64Uint`) + r.WriteMapElemValue() + if yyn1302 { + r.EncodeNil() + } else { + if x.FptrMapUint64Uint == nil { + r.EncodeNil() + } else { + yy1305 := *x.FptrMapUint64Uint + yym1306 := z.EncBinary() + _ = yym1306 + if false { + } else { + z.F.EncMapUint64UintV(yy1305, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Uint8 == nil { + r.EncodeNil() + } else { + yym1308 := z.EncBinary() + _ = yym1308 + if false { + } else { + z.F.EncMapUint64Uint8V(x.FMapUint64Uint8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint64Uint8`) + r.WriteMapElemValue() + if x.FMapUint64Uint8 == nil { + r.EncodeNil() + } else { + yym1309 := z.EncBinary() + _ = yym1309 + 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 + yym1312 := z.EncBinary() + _ = yym1312 + if false { + } else { + z.F.EncMapUint64Uint8V(yy1311, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint64Uint8`) + r.WriteMapElemValue() + if yyn1310 { + r.EncodeNil() + } else { + if x.FptrMapUint64Uint8 == nil { + r.EncodeNil() + } else { + yy1313 := *x.FptrMapUint64Uint8 + yym1314 := z.EncBinary() + _ = yym1314 + if false { + } else { + z.F.EncMapUint64Uint8V(yy1313, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Uint16 == nil { + r.EncodeNil() + } else { + yym1316 := z.EncBinary() + _ = yym1316 + if false { + } else { + z.F.EncMapUint64Uint16V(x.FMapUint64Uint16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint64Uint16`) + r.WriteMapElemValue() + if x.FMapUint64Uint16 == nil { + r.EncodeNil() + } else { + yym1317 := z.EncBinary() + _ = yym1317 + 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 + yym1320 := z.EncBinary() + _ = yym1320 + if false { + } else { + z.F.EncMapUint64Uint16V(yy1319, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint64Uint16`) + r.WriteMapElemValue() + if yyn1318 { + r.EncodeNil() + } else { + if x.FptrMapUint64Uint16 == nil { + r.EncodeNil() + } else { + yy1321 := *x.FptrMapUint64Uint16 + yym1322 := z.EncBinary() + _ = yym1322 + if false { + } else { + z.F.EncMapUint64Uint16V(yy1321, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Uint32 == nil { + r.EncodeNil() + } else { + yym1324 := z.EncBinary() + _ = yym1324 + if false { + } else { + z.F.EncMapUint64Uint32V(x.FMapUint64Uint32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint64Uint32`) + r.WriteMapElemValue() + if x.FMapUint64Uint32 == nil { + r.EncodeNil() + } else { + yym1325 := z.EncBinary() + _ = yym1325 + 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 + yym1328 := z.EncBinary() + _ = yym1328 + if false { + } else { + z.F.EncMapUint64Uint32V(yy1327, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint64Uint32`) + r.WriteMapElemValue() + if yyn1326 { + r.EncodeNil() + } else { + if x.FptrMapUint64Uint32 == nil { + r.EncodeNil() + } else { + yy1329 := *x.FptrMapUint64Uint32 + yym1330 := z.EncBinary() + _ = yym1330 + if false { + } else { + z.F.EncMapUint64Uint32V(yy1329, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Uint64 == nil { + r.EncodeNil() + } else { + yym1332 := z.EncBinary() + _ = yym1332 + if false { + } else { + z.F.EncMapUint64Uint64V(x.FMapUint64Uint64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint64Uint64`) + r.WriteMapElemValue() + if x.FMapUint64Uint64 == nil { + r.EncodeNil() + } else { + yym1333 := z.EncBinary() + _ = yym1333 + 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 + yym1336 := z.EncBinary() + _ = yym1336 + if false { + } else { + z.F.EncMapUint64Uint64V(yy1335, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint64Uint64`) + r.WriteMapElemValue() + if yyn1334 { + r.EncodeNil() + } else { + if x.FptrMapUint64Uint64 == nil { + r.EncodeNil() + } else { + yy1337 := *x.FptrMapUint64Uint64 + yym1338 := z.EncBinary() + _ = yym1338 + if false { + } else { + z.F.EncMapUint64Uint64V(yy1337, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Uintptr == nil { + r.EncodeNil() + } else { + yym1340 := z.EncBinary() + _ = yym1340 + if false { + } else { + z.F.EncMapUint64UintptrV(x.FMapUint64Uintptr, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint64Uintptr`) + r.WriteMapElemValue() + if x.FMapUint64Uintptr == nil { + r.EncodeNil() + } else { + yym1341 := z.EncBinary() + _ = yym1341 + 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 + yym1344 := z.EncBinary() + _ = yym1344 + if false { + } else { + z.F.EncMapUint64UintptrV(yy1343, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint64Uintptr`) + r.WriteMapElemValue() + if yyn1342 { + r.EncodeNil() + } else { + if x.FptrMapUint64Uintptr == nil { + r.EncodeNil() + } else { + yy1345 := *x.FptrMapUint64Uintptr + yym1346 := z.EncBinary() + _ = yym1346 + if false { + } else { + z.F.EncMapUint64UintptrV(yy1345, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Int == nil { + r.EncodeNil() + } else { + yym1348 := z.EncBinary() + _ = yym1348 + if false { + } else { + z.F.EncMapUint64IntV(x.FMapUint64Int, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint64Int`) + r.WriteMapElemValue() + if x.FMapUint64Int == nil { + r.EncodeNil() + } else { + yym1349 := z.EncBinary() + _ = yym1349 + 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 + yym1352 := z.EncBinary() + _ = yym1352 + if false { + } else { + z.F.EncMapUint64IntV(yy1351, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint64Int`) + r.WriteMapElemValue() + if yyn1350 { + r.EncodeNil() + } else { + if x.FptrMapUint64Int == nil { + r.EncodeNil() + } else { + yy1353 := *x.FptrMapUint64Int + yym1354 := z.EncBinary() + _ = yym1354 + if false { + } else { + z.F.EncMapUint64IntV(yy1353, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Int8 == nil { + r.EncodeNil() + } else { + yym1356 := z.EncBinary() + _ = yym1356 + if false { + } else { + z.F.EncMapUint64Int8V(x.FMapUint64Int8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint64Int8`) + r.WriteMapElemValue() + if x.FMapUint64Int8 == nil { + r.EncodeNil() + } else { + yym1357 := z.EncBinary() + _ = yym1357 + 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 + yym1360 := z.EncBinary() + _ = yym1360 + if false { + } else { + z.F.EncMapUint64Int8V(yy1359, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint64Int8`) + r.WriteMapElemValue() + if yyn1358 { + r.EncodeNil() + } else { + if x.FptrMapUint64Int8 == nil { + r.EncodeNil() + } else { + yy1361 := *x.FptrMapUint64Int8 + yym1362 := z.EncBinary() + _ = yym1362 + if false { + } else { + z.F.EncMapUint64Int8V(yy1361, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Int16 == nil { + r.EncodeNil() + } else { + yym1364 := z.EncBinary() + _ = yym1364 + if false { + } else { + z.F.EncMapUint64Int16V(x.FMapUint64Int16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint64Int16`) + r.WriteMapElemValue() + if x.FMapUint64Int16 == nil { + r.EncodeNil() + } else { + yym1365 := z.EncBinary() + _ = yym1365 + 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 + yym1368 := z.EncBinary() + _ = yym1368 + if false { + } else { + z.F.EncMapUint64Int16V(yy1367, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint64Int16`) + r.WriteMapElemValue() + if yyn1366 { + r.EncodeNil() + } else { + if x.FptrMapUint64Int16 == nil { + r.EncodeNil() + } else { + yy1369 := *x.FptrMapUint64Int16 + yym1370 := z.EncBinary() + _ = yym1370 + if false { + } else { + z.F.EncMapUint64Int16V(yy1369, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Int32 == nil { + r.EncodeNil() + } else { + yym1372 := z.EncBinary() + _ = yym1372 + if false { + } else { + z.F.EncMapUint64Int32V(x.FMapUint64Int32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint64Int32`) + r.WriteMapElemValue() + if x.FMapUint64Int32 == nil { + r.EncodeNil() + } else { + yym1373 := z.EncBinary() + _ = yym1373 + 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 + yym1376 := z.EncBinary() + _ = yym1376 + if false { + } else { + z.F.EncMapUint64Int32V(yy1375, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint64Int32`) + r.WriteMapElemValue() + if yyn1374 { + r.EncodeNil() + } else { + if x.FptrMapUint64Int32 == nil { + r.EncodeNil() + } else { + yy1377 := *x.FptrMapUint64Int32 + yym1378 := z.EncBinary() + _ = yym1378 + if false { + } else { + z.F.EncMapUint64Int32V(yy1377, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Int64 == nil { + r.EncodeNil() + } else { + yym1380 := z.EncBinary() + _ = yym1380 + if false { + } else { + z.F.EncMapUint64Int64V(x.FMapUint64Int64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint64Int64`) + r.WriteMapElemValue() + if x.FMapUint64Int64 == nil { + r.EncodeNil() + } else { + yym1381 := z.EncBinary() + _ = yym1381 + 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 + yym1384 := z.EncBinary() + _ = yym1384 + if false { + } else { + z.F.EncMapUint64Int64V(yy1383, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint64Int64`) + r.WriteMapElemValue() + if yyn1382 { + r.EncodeNil() + } else { + if x.FptrMapUint64Int64 == nil { + r.EncodeNil() + } else { + yy1385 := *x.FptrMapUint64Int64 + yym1386 := z.EncBinary() + _ = yym1386 + if false { + } else { + z.F.EncMapUint64Int64V(yy1385, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Float32 == nil { + r.EncodeNil() + } else { + yym1388 := z.EncBinary() + _ = yym1388 + if false { + } else { + z.F.EncMapUint64Float32V(x.FMapUint64Float32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint64Float32`) + r.WriteMapElemValue() + if x.FMapUint64Float32 == nil { + r.EncodeNil() + } else { + yym1389 := z.EncBinary() + _ = yym1389 + 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 + yym1392 := z.EncBinary() + _ = yym1392 + if false { + } else { + z.F.EncMapUint64Float32V(yy1391, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint64Float32`) + r.WriteMapElemValue() + if yyn1390 { + r.EncodeNil() + } else { + if x.FptrMapUint64Float32 == nil { + r.EncodeNil() + } else { + yy1393 := *x.FptrMapUint64Float32 + yym1394 := z.EncBinary() + _ = yym1394 + if false { + } else { + z.F.EncMapUint64Float32V(yy1393, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Float64 == nil { + r.EncodeNil() + } else { + yym1396 := z.EncBinary() + _ = yym1396 + if false { + } else { + z.F.EncMapUint64Float64V(x.FMapUint64Float64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint64Float64`) + r.WriteMapElemValue() + if x.FMapUint64Float64 == nil { + r.EncodeNil() + } else { + yym1397 := z.EncBinary() + _ = yym1397 + 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 + yym1400 := z.EncBinary() + _ = yym1400 + if false { + } else { + z.F.EncMapUint64Float64V(yy1399, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint64Float64`) + r.WriteMapElemValue() + if yyn1398 { + r.EncodeNil() + } else { + if x.FptrMapUint64Float64 == nil { + r.EncodeNil() + } else { + yy1401 := *x.FptrMapUint64Float64 + yym1402 := z.EncBinary() + _ = yym1402 + if false { + } else { + z.F.EncMapUint64Float64V(yy1401, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUint64Bool == nil { + r.EncodeNil() + } else { + yym1404 := z.EncBinary() + _ = yym1404 + if false { + } else { + z.F.EncMapUint64BoolV(x.FMapUint64Bool, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUint64Bool`) + r.WriteMapElemValue() + if x.FMapUint64Bool == nil { + r.EncodeNil() + } else { + yym1405 := z.EncBinary() + _ = yym1405 + 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 + yym1408 := z.EncBinary() + _ = yym1408 + if false { + } else { + z.F.EncMapUint64BoolV(yy1407, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUint64Bool`) + r.WriteMapElemValue() + if yyn1406 { + r.EncodeNil() + } else { + if x.FptrMapUint64Bool == nil { + r.EncodeNil() + } else { + yy1409 := *x.FptrMapUint64Bool + yym1410 := z.EncBinary() + _ = yym1410 + if false { + } else { + z.F.EncMapUint64BoolV(yy1409, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrIntf == nil { + r.EncodeNil() + } else { + yym1412 := z.EncBinary() + _ = yym1412 + if false { + } else { + z.F.EncMapUintptrIntfV(x.FMapUintptrIntf, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintptrIntf`) + r.WriteMapElemValue() + if x.FMapUintptrIntf == nil { + r.EncodeNil() + } else { + yym1413 := z.EncBinary() + _ = yym1413 + 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 + yym1416 := z.EncBinary() + _ = yym1416 + if false { + } else { + z.F.EncMapUintptrIntfV(yy1415, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintptrIntf`) + r.WriteMapElemValue() + if yyn1414 { + r.EncodeNil() + } else { + if x.FptrMapUintptrIntf == nil { + r.EncodeNil() + } else { + yy1417 := *x.FptrMapUintptrIntf + yym1418 := z.EncBinary() + _ = yym1418 + if false { + } else { + z.F.EncMapUintptrIntfV(yy1417, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrString == nil { + r.EncodeNil() + } else { + yym1420 := z.EncBinary() + _ = yym1420 + if false { + } else { + z.F.EncMapUintptrStringV(x.FMapUintptrString, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintptrString`) + r.WriteMapElemValue() + if x.FMapUintptrString == nil { + r.EncodeNil() + } else { + yym1421 := z.EncBinary() + _ = yym1421 + 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 + yym1424 := z.EncBinary() + _ = yym1424 + if false { + } else { + z.F.EncMapUintptrStringV(yy1423, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintptrString`) + r.WriteMapElemValue() + if yyn1422 { + r.EncodeNil() + } else { + if x.FptrMapUintptrString == nil { + r.EncodeNil() + } else { + yy1425 := *x.FptrMapUintptrString + yym1426 := z.EncBinary() + _ = yym1426 + if false { + } else { + z.F.EncMapUintptrStringV(yy1425, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrUint == nil { + r.EncodeNil() + } else { + yym1428 := z.EncBinary() + _ = yym1428 + if false { + } else { + z.F.EncMapUintptrUintV(x.FMapUintptrUint, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintptrUint`) + r.WriteMapElemValue() + if x.FMapUintptrUint == nil { + r.EncodeNil() + } else { + yym1429 := z.EncBinary() + _ = yym1429 + 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 + yym1432 := z.EncBinary() + _ = yym1432 + if false { + } else { + z.F.EncMapUintptrUintV(yy1431, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintptrUint`) + r.WriteMapElemValue() + if yyn1430 { + r.EncodeNil() + } else { + if x.FptrMapUintptrUint == nil { + r.EncodeNil() + } else { + yy1433 := *x.FptrMapUintptrUint + yym1434 := z.EncBinary() + _ = yym1434 + if false { + } else { + z.F.EncMapUintptrUintV(yy1433, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrUint8 == nil { + r.EncodeNil() + } else { + yym1436 := z.EncBinary() + _ = yym1436 + if false { + } else { + z.F.EncMapUintptrUint8V(x.FMapUintptrUint8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintptrUint8`) + r.WriteMapElemValue() + if x.FMapUintptrUint8 == nil { + r.EncodeNil() + } else { + yym1437 := z.EncBinary() + _ = yym1437 + 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 + yym1440 := z.EncBinary() + _ = yym1440 + if false { + } else { + z.F.EncMapUintptrUint8V(yy1439, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintptrUint8`) + r.WriteMapElemValue() + if yyn1438 { + r.EncodeNil() + } else { + if x.FptrMapUintptrUint8 == nil { + r.EncodeNil() + } else { + yy1441 := *x.FptrMapUintptrUint8 + yym1442 := z.EncBinary() + _ = yym1442 + if false { + } else { + z.F.EncMapUintptrUint8V(yy1441, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrUint16 == nil { + r.EncodeNil() + } else { + yym1444 := z.EncBinary() + _ = yym1444 + if false { + } else { + z.F.EncMapUintptrUint16V(x.FMapUintptrUint16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintptrUint16`) + r.WriteMapElemValue() + if x.FMapUintptrUint16 == nil { + r.EncodeNil() + } else { + yym1445 := z.EncBinary() + _ = yym1445 + 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 + yym1448 := z.EncBinary() + _ = yym1448 + if false { + } else { + z.F.EncMapUintptrUint16V(yy1447, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintptrUint16`) + r.WriteMapElemValue() + if yyn1446 { + r.EncodeNil() + } else { + if x.FptrMapUintptrUint16 == nil { + r.EncodeNil() + } else { + yy1449 := *x.FptrMapUintptrUint16 + yym1450 := z.EncBinary() + _ = yym1450 + if false { + } else { + z.F.EncMapUintptrUint16V(yy1449, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrUint32 == nil { + r.EncodeNil() + } else { + yym1452 := z.EncBinary() + _ = yym1452 + if false { + } else { + z.F.EncMapUintptrUint32V(x.FMapUintptrUint32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintptrUint32`) + r.WriteMapElemValue() + if x.FMapUintptrUint32 == nil { + r.EncodeNil() + } else { + yym1453 := z.EncBinary() + _ = yym1453 + 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 + yym1456 := z.EncBinary() + _ = yym1456 + if false { + } else { + z.F.EncMapUintptrUint32V(yy1455, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintptrUint32`) + r.WriteMapElemValue() + if yyn1454 { + r.EncodeNil() + } else { + if x.FptrMapUintptrUint32 == nil { + r.EncodeNil() + } else { + yy1457 := *x.FptrMapUintptrUint32 + yym1458 := z.EncBinary() + _ = yym1458 + if false { + } else { + z.F.EncMapUintptrUint32V(yy1457, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrUint64 == nil { + r.EncodeNil() + } else { + yym1460 := z.EncBinary() + _ = yym1460 + if false { + } else { + z.F.EncMapUintptrUint64V(x.FMapUintptrUint64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintptrUint64`) + r.WriteMapElemValue() + if x.FMapUintptrUint64 == nil { + r.EncodeNil() + } else { + yym1461 := z.EncBinary() + _ = yym1461 + 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 + yym1464 := z.EncBinary() + _ = yym1464 + if false { + } else { + z.F.EncMapUintptrUint64V(yy1463, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintptrUint64`) + r.WriteMapElemValue() + if yyn1462 { + r.EncodeNil() + } else { + if x.FptrMapUintptrUint64 == nil { + r.EncodeNil() + } else { + yy1465 := *x.FptrMapUintptrUint64 + yym1466 := z.EncBinary() + _ = yym1466 + if false { + } else { + z.F.EncMapUintptrUint64V(yy1465, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrUintptr == nil { + r.EncodeNil() + } else { + yym1468 := z.EncBinary() + _ = yym1468 + if false { + } else { + z.F.EncMapUintptrUintptrV(x.FMapUintptrUintptr, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintptrUintptr`) + r.WriteMapElemValue() + if x.FMapUintptrUintptr == nil { + r.EncodeNil() + } else { + yym1469 := z.EncBinary() + _ = yym1469 + 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 + yym1472 := z.EncBinary() + _ = yym1472 + if false { + } else { + z.F.EncMapUintptrUintptrV(yy1471, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintptrUintptr`) + r.WriteMapElemValue() + if yyn1470 { + r.EncodeNil() + } else { + if x.FptrMapUintptrUintptr == nil { + r.EncodeNil() + } else { + yy1473 := *x.FptrMapUintptrUintptr + yym1474 := z.EncBinary() + _ = yym1474 + if false { + } else { + z.F.EncMapUintptrUintptrV(yy1473, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrInt == nil { + r.EncodeNil() + } else { + yym1476 := z.EncBinary() + _ = yym1476 + if false { + } else { + z.F.EncMapUintptrIntV(x.FMapUintptrInt, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintptrInt`) + r.WriteMapElemValue() + if x.FMapUintptrInt == nil { + r.EncodeNil() + } else { + yym1477 := z.EncBinary() + _ = yym1477 + 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 + yym1480 := z.EncBinary() + _ = yym1480 + if false { + } else { + z.F.EncMapUintptrIntV(yy1479, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintptrInt`) + r.WriteMapElemValue() + if yyn1478 { + r.EncodeNil() + } else { + if x.FptrMapUintptrInt == nil { + r.EncodeNil() + } else { + yy1481 := *x.FptrMapUintptrInt + yym1482 := z.EncBinary() + _ = yym1482 + if false { + } else { + z.F.EncMapUintptrIntV(yy1481, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrInt8 == nil { + r.EncodeNil() + } else { + yym1484 := z.EncBinary() + _ = yym1484 + if false { + } else { + z.F.EncMapUintptrInt8V(x.FMapUintptrInt8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintptrInt8`) + r.WriteMapElemValue() + if x.FMapUintptrInt8 == nil { + r.EncodeNil() + } else { + yym1485 := z.EncBinary() + _ = yym1485 + 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 + yym1488 := z.EncBinary() + _ = yym1488 + if false { + } else { + z.F.EncMapUintptrInt8V(yy1487, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintptrInt8`) + r.WriteMapElemValue() + if yyn1486 { + r.EncodeNil() + } else { + if x.FptrMapUintptrInt8 == nil { + r.EncodeNil() + } else { + yy1489 := *x.FptrMapUintptrInt8 + yym1490 := z.EncBinary() + _ = yym1490 + if false { + } else { + z.F.EncMapUintptrInt8V(yy1489, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrInt16 == nil { + r.EncodeNil() + } else { + yym1492 := z.EncBinary() + _ = yym1492 + if false { + } else { + z.F.EncMapUintptrInt16V(x.FMapUintptrInt16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintptrInt16`) + r.WriteMapElemValue() + if x.FMapUintptrInt16 == nil { + r.EncodeNil() + } else { + yym1493 := z.EncBinary() + _ = yym1493 + 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 + yym1496 := z.EncBinary() + _ = yym1496 + if false { + } else { + z.F.EncMapUintptrInt16V(yy1495, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintptrInt16`) + r.WriteMapElemValue() + if yyn1494 { + r.EncodeNil() + } else { + if x.FptrMapUintptrInt16 == nil { + r.EncodeNil() + } else { + yy1497 := *x.FptrMapUintptrInt16 + yym1498 := z.EncBinary() + _ = yym1498 + if false { + } else { + z.F.EncMapUintptrInt16V(yy1497, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrInt32 == nil { + r.EncodeNil() + } else { + yym1500 := z.EncBinary() + _ = yym1500 + if false { + } else { + z.F.EncMapUintptrInt32V(x.FMapUintptrInt32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintptrInt32`) + r.WriteMapElemValue() + if x.FMapUintptrInt32 == nil { + r.EncodeNil() + } else { + yym1501 := z.EncBinary() + _ = yym1501 + 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 + yym1504 := z.EncBinary() + _ = yym1504 + if false { + } else { + z.F.EncMapUintptrInt32V(yy1503, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintptrInt32`) + r.WriteMapElemValue() + if yyn1502 { + r.EncodeNil() + } else { + if x.FptrMapUintptrInt32 == nil { + r.EncodeNil() + } else { + yy1505 := *x.FptrMapUintptrInt32 + yym1506 := z.EncBinary() + _ = yym1506 + if false { + } else { + z.F.EncMapUintptrInt32V(yy1505, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrInt64 == nil { + r.EncodeNil() + } else { + yym1508 := z.EncBinary() + _ = yym1508 + if false { + } else { + z.F.EncMapUintptrInt64V(x.FMapUintptrInt64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintptrInt64`) + r.WriteMapElemValue() + if x.FMapUintptrInt64 == nil { + r.EncodeNil() + } else { + yym1509 := z.EncBinary() + _ = yym1509 + 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 + yym1512 := z.EncBinary() + _ = yym1512 + if false { + } else { + z.F.EncMapUintptrInt64V(yy1511, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintptrInt64`) + r.WriteMapElemValue() + if yyn1510 { + r.EncodeNil() + } else { + if x.FptrMapUintptrInt64 == nil { + r.EncodeNil() + } else { + yy1513 := *x.FptrMapUintptrInt64 + yym1514 := z.EncBinary() + _ = yym1514 + if false { + } else { + z.F.EncMapUintptrInt64V(yy1513, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrFloat32 == nil { + r.EncodeNil() + } else { + yym1516 := z.EncBinary() + _ = yym1516 + if false { + } else { + z.F.EncMapUintptrFloat32V(x.FMapUintptrFloat32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintptrFloat32`) + r.WriteMapElemValue() + if x.FMapUintptrFloat32 == nil { + r.EncodeNil() + } else { + yym1517 := z.EncBinary() + _ = yym1517 + 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 + yym1520 := z.EncBinary() + _ = yym1520 + if false { + } else { + z.F.EncMapUintptrFloat32V(yy1519, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintptrFloat32`) + r.WriteMapElemValue() + if yyn1518 { + r.EncodeNil() + } else { + if x.FptrMapUintptrFloat32 == nil { + r.EncodeNil() + } else { + yy1521 := *x.FptrMapUintptrFloat32 + yym1522 := z.EncBinary() + _ = yym1522 + if false { + } else { + z.F.EncMapUintptrFloat32V(yy1521, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrFloat64 == nil { + r.EncodeNil() + } else { + yym1524 := z.EncBinary() + _ = yym1524 + if false { + } else { + z.F.EncMapUintptrFloat64V(x.FMapUintptrFloat64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintptrFloat64`) + r.WriteMapElemValue() + if x.FMapUintptrFloat64 == nil { + r.EncodeNil() + } else { + yym1525 := z.EncBinary() + _ = yym1525 + 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 + yym1528 := z.EncBinary() + _ = yym1528 + if false { + } else { + z.F.EncMapUintptrFloat64V(yy1527, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintptrFloat64`) + r.WriteMapElemValue() + if yyn1526 { + r.EncodeNil() + } else { + if x.FptrMapUintptrFloat64 == nil { + r.EncodeNil() + } else { + yy1529 := *x.FptrMapUintptrFloat64 + yym1530 := z.EncBinary() + _ = yym1530 + if false { + } else { + z.F.EncMapUintptrFloat64V(yy1529, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapUintptrBool == nil { + r.EncodeNil() + } else { + yym1532 := z.EncBinary() + _ = yym1532 + if false { + } else { + z.F.EncMapUintptrBoolV(x.FMapUintptrBool, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapUintptrBool`) + r.WriteMapElemValue() + if x.FMapUintptrBool == nil { + r.EncodeNil() + } else { + yym1533 := z.EncBinary() + _ = yym1533 + 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 + yym1536 := z.EncBinary() + _ = yym1536 + if false { + } else { + z.F.EncMapUintptrBoolV(yy1535, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapUintptrBool`) + r.WriteMapElemValue() + if yyn1534 { + r.EncodeNil() + } else { + if x.FptrMapUintptrBool == nil { + r.EncodeNil() + } else { + yy1537 := *x.FptrMapUintptrBool + yym1538 := z.EncBinary() + _ = yym1538 + if false { + } else { + z.F.EncMapUintptrBoolV(yy1537, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntIntf == nil { + r.EncodeNil() + } else { + yym1540 := z.EncBinary() + _ = yym1540 + if false { + } else { + z.F.EncMapIntIntfV(x.FMapIntIntf, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntIntf`) + r.WriteMapElemValue() + if x.FMapIntIntf == nil { + r.EncodeNil() + } else { + yym1541 := z.EncBinary() + _ = yym1541 + 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 + yym1544 := z.EncBinary() + _ = yym1544 + if false { + } else { + z.F.EncMapIntIntfV(yy1543, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntIntf`) + r.WriteMapElemValue() + if yyn1542 { + r.EncodeNil() + } else { + if x.FptrMapIntIntf == nil { + r.EncodeNil() + } else { + yy1545 := *x.FptrMapIntIntf + yym1546 := z.EncBinary() + _ = yym1546 + if false { + } else { + z.F.EncMapIntIntfV(yy1545, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntString == nil { + r.EncodeNil() + } else { + yym1548 := z.EncBinary() + _ = yym1548 + if false { + } else { + z.F.EncMapIntStringV(x.FMapIntString, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntString`) + r.WriteMapElemValue() + if x.FMapIntString == nil { + r.EncodeNil() + } else { + yym1549 := z.EncBinary() + _ = yym1549 + 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 + yym1552 := z.EncBinary() + _ = yym1552 + if false { + } else { + z.F.EncMapIntStringV(yy1551, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntString`) + r.WriteMapElemValue() + if yyn1550 { + r.EncodeNil() + } else { + if x.FptrMapIntString == nil { + r.EncodeNil() + } else { + yy1553 := *x.FptrMapIntString + yym1554 := z.EncBinary() + _ = yym1554 + if false { + } else { + z.F.EncMapIntStringV(yy1553, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntUint == nil { + r.EncodeNil() + } else { + yym1556 := z.EncBinary() + _ = yym1556 + if false { + } else { + z.F.EncMapIntUintV(x.FMapIntUint, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntUint`) + r.WriteMapElemValue() + if x.FMapIntUint == nil { + r.EncodeNil() + } else { + yym1557 := z.EncBinary() + _ = yym1557 + 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 + yym1560 := z.EncBinary() + _ = yym1560 + if false { + } else { + z.F.EncMapIntUintV(yy1559, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntUint`) + r.WriteMapElemValue() + if yyn1558 { + r.EncodeNil() + } else { + if x.FptrMapIntUint == nil { + r.EncodeNil() + } else { + yy1561 := *x.FptrMapIntUint + yym1562 := z.EncBinary() + _ = yym1562 + if false { + } else { + z.F.EncMapIntUintV(yy1561, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntUint8 == nil { + r.EncodeNil() + } else { + yym1564 := z.EncBinary() + _ = yym1564 + if false { + } else { + z.F.EncMapIntUint8V(x.FMapIntUint8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntUint8`) + r.WriteMapElemValue() + if x.FMapIntUint8 == nil { + r.EncodeNil() + } else { + yym1565 := z.EncBinary() + _ = yym1565 + 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 + yym1568 := z.EncBinary() + _ = yym1568 + if false { + } else { + z.F.EncMapIntUint8V(yy1567, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntUint8`) + r.WriteMapElemValue() + if yyn1566 { + r.EncodeNil() + } else { + if x.FptrMapIntUint8 == nil { + r.EncodeNil() + } else { + yy1569 := *x.FptrMapIntUint8 + yym1570 := z.EncBinary() + _ = yym1570 + if false { + } else { + z.F.EncMapIntUint8V(yy1569, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntUint16 == nil { + r.EncodeNil() + } else { + yym1572 := z.EncBinary() + _ = yym1572 + if false { + } else { + z.F.EncMapIntUint16V(x.FMapIntUint16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntUint16`) + r.WriteMapElemValue() + if x.FMapIntUint16 == nil { + r.EncodeNil() + } else { + yym1573 := z.EncBinary() + _ = yym1573 + 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 + yym1576 := z.EncBinary() + _ = yym1576 + if false { + } else { + z.F.EncMapIntUint16V(yy1575, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntUint16`) + r.WriteMapElemValue() + if yyn1574 { + r.EncodeNil() + } else { + if x.FptrMapIntUint16 == nil { + r.EncodeNil() + } else { + yy1577 := *x.FptrMapIntUint16 + yym1578 := z.EncBinary() + _ = yym1578 + if false { + } else { + z.F.EncMapIntUint16V(yy1577, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntUint32 == nil { + r.EncodeNil() + } else { + yym1580 := z.EncBinary() + _ = yym1580 + if false { + } else { + z.F.EncMapIntUint32V(x.FMapIntUint32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntUint32`) + r.WriteMapElemValue() + if x.FMapIntUint32 == nil { + r.EncodeNil() + } else { + yym1581 := z.EncBinary() + _ = yym1581 + 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 + yym1584 := z.EncBinary() + _ = yym1584 + if false { + } else { + z.F.EncMapIntUint32V(yy1583, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntUint32`) + r.WriteMapElemValue() + if yyn1582 { + r.EncodeNil() + } else { + if x.FptrMapIntUint32 == nil { + r.EncodeNil() + } else { + yy1585 := *x.FptrMapIntUint32 + yym1586 := z.EncBinary() + _ = yym1586 + if false { + } else { + z.F.EncMapIntUint32V(yy1585, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntUint64 == nil { + r.EncodeNil() + } else { + yym1588 := z.EncBinary() + _ = yym1588 + if false { + } else { + z.F.EncMapIntUint64V(x.FMapIntUint64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntUint64`) + r.WriteMapElemValue() + if x.FMapIntUint64 == nil { + r.EncodeNil() + } else { + yym1589 := z.EncBinary() + _ = yym1589 + 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 + yym1592 := z.EncBinary() + _ = yym1592 + if false { + } else { + z.F.EncMapIntUint64V(yy1591, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntUint64`) + r.WriteMapElemValue() + if yyn1590 { + r.EncodeNil() + } else { + if x.FptrMapIntUint64 == nil { + r.EncodeNil() + } else { + yy1593 := *x.FptrMapIntUint64 + yym1594 := z.EncBinary() + _ = yym1594 + if false { + } else { + z.F.EncMapIntUint64V(yy1593, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntUintptr == nil { + r.EncodeNil() + } else { + yym1596 := z.EncBinary() + _ = yym1596 + if false { + } else { + z.F.EncMapIntUintptrV(x.FMapIntUintptr, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntUintptr`) + r.WriteMapElemValue() + if x.FMapIntUintptr == nil { + r.EncodeNil() + } else { + yym1597 := z.EncBinary() + _ = yym1597 + 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 + yym1600 := z.EncBinary() + _ = yym1600 + if false { + } else { + z.F.EncMapIntUintptrV(yy1599, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntUintptr`) + r.WriteMapElemValue() + if yyn1598 { + r.EncodeNil() + } else { + if x.FptrMapIntUintptr == nil { + r.EncodeNil() + } else { + yy1601 := *x.FptrMapIntUintptr + yym1602 := z.EncBinary() + _ = yym1602 + if false { + } else { + z.F.EncMapIntUintptrV(yy1601, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntInt == nil { + r.EncodeNil() + } else { + yym1604 := z.EncBinary() + _ = yym1604 + if false { + } else { + z.F.EncMapIntIntV(x.FMapIntInt, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntInt`) + r.WriteMapElemValue() + if x.FMapIntInt == nil { + r.EncodeNil() + } else { + yym1605 := z.EncBinary() + _ = yym1605 + 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 + yym1608 := z.EncBinary() + _ = yym1608 + if false { + } else { + z.F.EncMapIntIntV(yy1607, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntInt`) + r.WriteMapElemValue() + if yyn1606 { + r.EncodeNil() + } else { + if x.FptrMapIntInt == nil { + r.EncodeNil() + } else { + yy1609 := *x.FptrMapIntInt + yym1610 := z.EncBinary() + _ = yym1610 + if false { + } else { + z.F.EncMapIntIntV(yy1609, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntInt8 == nil { + r.EncodeNil() + } else { + yym1612 := z.EncBinary() + _ = yym1612 + if false { + } else { + z.F.EncMapIntInt8V(x.FMapIntInt8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntInt8`) + r.WriteMapElemValue() + if x.FMapIntInt8 == nil { + r.EncodeNil() + } else { + yym1613 := z.EncBinary() + _ = yym1613 + 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 + yym1616 := z.EncBinary() + _ = yym1616 + if false { + } else { + z.F.EncMapIntInt8V(yy1615, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntInt8`) + r.WriteMapElemValue() + if yyn1614 { + r.EncodeNil() + } else { + if x.FptrMapIntInt8 == nil { + r.EncodeNil() + } else { + yy1617 := *x.FptrMapIntInt8 + yym1618 := z.EncBinary() + _ = yym1618 + if false { + } else { + z.F.EncMapIntInt8V(yy1617, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntInt16 == nil { + r.EncodeNil() + } else { + yym1620 := z.EncBinary() + _ = yym1620 + if false { + } else { + z.F.EncMapIntInt16V(x.FMapIntInt16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntInt16`) + r.WriteMapElemValue() + if x.FMapIntInt16 == nil { + r.EncodeNil() + } else { + yym1621 := z.EncBinary() + _ = yym1621 + 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 + yym1624 := z.EncBinary() + _ = yym1624 + if false { + } else { + z.F.EncMapIntInt16V(yy1623, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntInt16`) + r.WriteMapElemValue() + if yyn1622 { + r.EncodeNil() + } else { + if x.FptrMapIntInt16 == nil { + r.EncodeNil() + } else { + yy1625 := *x.FptrMapIntInt16 + yym1626 := z.EncBinary() + _ = yym1626 + if false { + } else { + z.F.EncMapIntInt16V(yy1625, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntInt32 == nil { + r.EncodeNil() + } else { + yym1628 := z.EncBinary() + _ = yym1628 + if false { + } else { + z.F.EncMapIntInt32V(x.FMapIntInt32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntInt32`) + r.WriteMapElemValue() + if x.FMapIntInt32 == nil { + r.EncodeNil() + } else { + yym1629 := z.EncBinary() + _ = yym1629 + 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 + yym1632 := z.EncBinary() + _ = yym1632 + if false { + } else { + z.F.EncMapIntInt32V(yy1631, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntInt32`) + r.WriteMapElemValue() + if yyn1630 { + r.EncodeNil() + } else { + if x.FptrMapIntInt32 == nil { + r.EncodeNil() + } else { + yy1633 := *x.FptrMapIntInt32 + yym1634 := z.EncBinary() + _ = yym1634 + if false { + } else { + z.F.EncMapIntInt32V(yy1633, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntInt64 == nil { + r.EncodeNil() + } else { + yym1636 := z.EncBinary() + _ = yym1636 + if false { + } else { + z.F.EncMapIntInt64V(x.FMapIntInt64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntInt64`) + r.WriteMapElemValue() + if x.FMapIntInt64 == nil { + r.EncodeNil() + } else { + yym1637 := z.EncBinary() + _ = yym1637 + 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 + yym1640 := z.EncBinary() + _ = yym1640 + if false { + } else { + z.F.EncMapIntInt64V(yy1639, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntInt64`) + r.WriteMapElemValue() + if yyn1638 { + r.EncodeNil() + } else { + if x.FptrMapIntInt64 == nil { + r.EncodeNil() + } else { + yy1641 := *x.FptrMapIntInt64 + yym1642 := z.EncBinary() + _ = yym1642 + if false { + } else { + z.F.EncMapIntInt64V(yy1641, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntFloat32 == nil { + r.EncodeNil() + } else { + yym1644 := z.EncBinary() + _ = yym1644 + if false { + } else { + z.F.EncMapIntFloat32V(x.FMapIntFloat32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntFloat32`) + r.WriteMapElemValue() + if x.FMapIntFloat32 == nil { + r.EncodeNil() + } else { + yym1645 := z.EncBinary() + _ = yym1645 + 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 + yym1648 := z.EncBinary() + _ = yym1648 + if false { + } else { + z.F.EncMapIntFloat32V(yy1647, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntFloat32`) + r.WriteMapElemValue() + if yyn1646 { + r.EncodeNil() + } else { + if x.FptrMapIntFloat32 == nil { + r.EncodeNil() + } else { + yy1649 := *x.FptrMapIntFloat32 + yym1650 := z.EncBinary() + _ = yym1650 + if false { + } else { + z.F.EncMapIntFloat32V(yy1649, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntFloat64 == nil { + r.EncodeNil() + } else { + yym1652 := z.EncBinary() + _ = yym1652 + if false { + } else { + z.F.EncMapIntFloat64V(x.FMapIntFloat64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntFloat64`) + r.WriteMapElemValue() + if x.FMapIntFloat64 == nil { + r.EncodeNil() + } else { + yym1653 := z.EncBinary() + _ = yym1653 + 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 + yym1656 := z.EncBinary() + _ = yym1656 + if false { + } else { + z.F.EncMapIntFloat64V(yy1655, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntFloat64`) + r.WriteMapElemValue() + if yyn1654 { + r.EncodeNil() + } else { + if x.FptrMapIntFloat64 == nil { + r.EncodeNil() + } else { + yy1657 := *x.FptrMapIntFloat64 + yym1658 := z.EncBinary() + _ = yym1658 + if false { + } else { + z.F.EncMapIntFloat64V(yy1657, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapIntBool == nil { + r.EncodeNil() + } else { + yym1660 := z.EncBinary() + _ = yym1660 + if false { + } else { + z.F.EncMapIntBoolV(x.FMapIntBool, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapIntBool`) + r.WriteMapElemValue() + if x.FMapIntBool == nil { + r.EncodeNil() + } else { + yym1661 := z.EncBinary() + _ = yym1661 + 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 + yym1664 := z.EncBinary() + _ = yym1664 + if false { + } else { + z.F.EncMapIntBoolV(yy1663, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapIntBool`) + r.WriteMapElemValue() + if yyn1662 { + r.EncodeNil() + } else { + if x.FptrMapIntBool == nil { + r.EncodeNil() + } else { + yy1665 := *x.FptrMapIntBool + yym1666 := z.EncBinary() + _ = yym1666 + if false { + } else { + z.F.EncMapIntBoolV(yy1665, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Intf == nil { + r.EncodeNil() + } else { + yym1668 := z.EncBinary() + _ = yym1668 + if false { + } else { + z.F.EncMapInt8IntfV(x.FMapInt8Intf, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt8Intf`) + r.WriteMapElemValue() + if x.FMapInt8Intf == nil { + r.EncodeNil() + } else { + yym1669 := z.EncBinary() + _ = yym1669 + 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 + yym1672 := z.EncBinary() + _ = yym1672 + if false { + } else { + z.F.EncMapInt8IntfV(yy1671, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt8Intf`) + r.WriteMapElemValue() + if yyn1670 { + r.EncodeNil() + } else { + if x.FptrMapInt8Intf == nil { + r.EncodeNil() + } else { + yy1673 := *x.FptrMapInt8Intf + yym1674 := z.EncBinary() + _ = yym1674 + if false { + } else { + z.F.EncMapInt8IntfV(yy1673, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8String == nil { + r.EncodeNil() + } else { + yym1676 := z.EncBinary() + _ = yym1676 + if false { + } else { + z.F.EncMapInt8StringV(x.FMapInt8String, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt8String`) + r.WriteMapElemValue() + if x.FMapInt8String == nil { + r.EncodeNil() + } else { + yym1677 := z.EncBinary() + _ = yym1677 + 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 + yym1680 := z.EncBinary() + _ = yym1680 + if false { + } else { + z.F.EncMapInt8StringV(yy1679, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt8String`) + r.WriteMapElemValue() + if yyn1678 { + r.EncodeNil() + } else { + if x.FptrMapInt8String == nil { + r.EncodeNil() + } else { + yy1681 := *x.FptrMapInt8String + yym1682 := z.EncBinary() + _ = yym1682 + if false { + } else { + z.F.EncMapInt8StringV(yy1681, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Uint == nil { + r.EncodeNil() + } else { + yym1684 := z.EncBinary() + _ = yym1684 + if false { + } else { + z.F.EncMapInt8UintV(x.FMapInt8Uint, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt8Uint`) + r.WriteMapElemValue() + if x.FMapInt8Uint == nil { + r.EncodeNil() + } else { + yym1685 := z.EncBinary() + _ = yym1685 + 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 + yym1688 := z.EncBinary() + _ = yym1688 + if false { + } else { + z.F.EncMapInt8UintV(yy1687, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt8Uint`) + r.WriteMapElemValue() + if yyn1686 { + r.EncodeNil() + } else { + if x.FptrMapInt8Uint == nil { + r.EncodeNil() + } else { + yy1689 := *x.FptrMapInt8Uint + yym1690 := z.EncBinary() + _ = yym1690 + if false { + } else { + z.F.EncMapInt8UintV(yy1689, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Uint8 == nil { + r.EncodeNil() + } else { + yym1692 := z.EncBinary() + _ = yym1692 + if false { + } else { + z.F.EncMapInt8Uint8V(x.FMapInt8Uint8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt8Uint8`) + r.WriteMapElemValue() + if x.FMapInt8Uint8 == nil { + r.EncodeNil() + } else { + yym1693 := z.EncBinary() + _ = yym1693 + 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 + yym1696 := z.EncBinary() + _ = yym1696 + if false { + } else { + z.F.EncMapInt8Uint8V(yy1695, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt8Uint8`) + r.WriteMapElemValue() + if yyn1694 { + r.EncodeNil() + } else { + if x.FptrMapInt8Uint8 == nil { + r.EncodeNil() + } else { + yy1697 := *x.FptrMapInt8Uint8 + yym1698 := z.EncBinary() + _ = yym1698 + if false { + } else { + z.F.EncMapInt8Uint8V(yy1697, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Uint16 == nil { + r.EncodeNil() + } else { + yym1700 := z.EncBinary() + _ = yym1700 + if false { + } else { + z.F.EncMapInt8Uint16V(x.FMapInt8Uint16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt8Uint16`) + r.WriteMapElemValue() + if x.FMapInt8Uint16 == nil { + r.EncodeNil() + } else { + yym1701 := z.EncBinary() + _ = yym1701 + 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 + yym1704 := z.EncBinary() + _ = yym1704 + if false { + } else { + z.F.EncMapInt8Uint16V(yy1703, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt8Uint16`) + r.WriteMapElemValue() + if yyn1702 { + r.EncodeNil() + } else { + if x.FptrMapInt8Uint16 == nil { + r.EncodeNil() + } else { + yy1705 := *x.FptrMapInt8Uint16 + yym1706 := z.EncBinary() + _ = yym1706 + if false { + } else { + z.F.EncMapInt8Uint16V(yy1705, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Uint32 == nil { + r.EncodeNil() + } else { + yym1708 := z.EncBinary() + _ = yym1708 + if false { + } else { + z.F.EncMapInt8Uint32V(x.FMapInt8Uint32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt8Uint32`) + r.WriteMapElemValue() + if x.FMapInt8Uint32 == nil { + r.EncodeNil() + } else { + yym1709 := z.EncBinary() + _ = yym1709 + 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 + yym1712 := z.EncBinary() + _ = yym1712 + if false { + } else { + z.F.EncMapInt8Uint32V(yy1711, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt8Uint32`) + r.WriteMapElemValue() + if yyn1710 { + r.EncodeNil() + } else { + if x.FptrMapInt8Uint32 == nil { + r.EncodeNil() + } else { + yy1713 := *x.FptrMapInt8Uint32 + yym1714 := z.EncBinary() + _ = yym1714 + if false { + } else { + z.F.EncMapInt8Uint32V(yy1713, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Uint64 == nil { + r.EncodeNil() + } else { + yym1716 := z.EncBinary() + _ = yym1716 + if false { + } else { + z.F.EncMapInt8Uint64V(x.FMapInt8Uint64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt8Uint64`) + r.WriteMapElemValue() + if x.FMapInt8Uint64 == nil { + r.EncodeNil() + } else { + yym1717 := z.EncBinary() + _ = yym1717 + 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 + yym1720 := z.EncBinary() + _ = yym1720 + if false { + } else { + z.F.EncMapInt8Uint64V(yy1719, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt8Uint64`) + r.WriteMapElemValue() + if yyn1718 { + r.EncodeNil() + } else { + if x.FptrMapInt8Uint64 == nil { + r.EncodeNil() + } else { + yy1721 := *x.FptrMapInt8Uint64 + yym1722 := z.EncBinary() + _ = yym1722 + if false { + } else { + z.F.EncMapInt8Uint64V(yy1721, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Uintptr == nil { + r.EncodeNil() + } else { + yym1724 := z.EncBinary() + _ = yym1724 + if false { + } else { + z.F.EncMapInt8UintptrV(x.FMapInt8Uintptr, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt8Uintptr`) + r.WriteMapElemValue() + if x.FMapInt8Uintptr == nil { + r.EncodeNil() + } else { + yym1725 := z.EncBinary() + _ = yym1725 + 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 + yym1728 := z.EncBinary() + _ = yym1728 + if false { + } else { + z.F.EncMapInt8UintptrV(yy1727, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt8Uintptr`) + r.WriteMapElemValue() + if yyn1726 { + r.EncodeNil() + } else { + if x.FptrMapInt8Uintptr == nil { + r.EncodeNil() + } else { + yy1729 := *x.FptrMapInt8Uintptr + yym1730 := z.EncBinary() + _ = yym1730 + if false { + } else { + z.F.EncMapInt8UintptrV(yy1729, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Int == nil { + r.EncodeNil() + } else { + yym1732 := z.EncBinary() + _ = yym1732 + if false { + } else { + z.F.EncMapInt8IntV(x.FMapInt8Int, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt8Int`) + r.WriteMapElemValue() + if x.FMapInt8Int == nil { + r.EncodeNil() + } else { + yym1733 := z.EncBinary() + _ = yym1733 + 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 + yym1736 := z.EncBinary() + _ = yym1736 + if false { + } else { + z.F.EncMapInt8IntV(yy1735, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt8Int`) + r.WriteMapElemValue() + if yyn1734 { + r.EncodeNil() + } else { + if x.FptrMapInt8Int == nil { + r.EncodeNil() + } else { + yy1737 := *x.FptrMapInt8Int + yym1738 := z.EncBinary() + _ = yym1738 + if false { + } else { + z.F.EncMapInt8IntV(yy1737, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Int8 == nil { + r.EncodeNil() + } else { + yym1740 := z.EncBinary() + _ = yym1740 + if false { + } else { + z.F.EncMapInt8Int8V(x.FMapInt8Int8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt8Int8`) + r.WriteMapElemValue() + if x.FMapInt8Int8 == nil { + r.EncodeNil() + } else { + yym1741 := z.EncBinary() + _ = yym1741 + 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 + yym1744 := z.EncBinary() + _ = yym1744 + if false { + } else { + z.F.EncMapInt8Int8V(yy1743, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt8Int8`) + r.WriteMapElemValue() + if yyn1742 { + r.EncodeNil() + } else { + if x.FptrMapInt8Int8 == nil { + r.EncodeNil() + } else { + yy1745 := *x.FptrMapInt8Int8 + yym1746 := z.EncBinary() + _ = yym1746 + if false { + } else { + z.F.EncMapInt8Int8V(yy1745, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Int16 == nil { + r.EncodeNil() + } else { + yym1748 := z.EncBinary() + _ = yym1748 + if false { + } else { + z.F.EncMapInt8Int16V(x.FMapInt8Int16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt8Int16`) + r.WriteMapElemValue() + if x.FMapInt8Int16 == nil { + r.EncodeNil() + } else { + yym1749 := z.EncBinary() + _ = yym1749 + 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 + yym1752 := z.EncBinary() + _ = yym1752 + if false { + } else { + z.F.EncMapInt8Int16V(yy1751, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt8Int16`) + r.WriteMapElemValue() + if yyn1750 { + r.EncodeNil() + } else { + if x.FptrMapInt8Int16 == nil { + r.EncodeNil() + } else { + yy1753 := *x.FptrMapInt8Int16 + yym1754 := z.EncBinary() + _ = yym1754 + if false { + } else { + z.F.EncMapInt8Int16V(yy1753, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Int32 == nil { + r.EncodeNil() + } else { + yym1756 := z.EncBinary() + _ = yym1756 + if false { + } else { + z.F.EncMapInt8Int32V(x.FMapInt8Int32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt8Int32`) + r.WriteMapElemValue() + if x.FMapInt8Int32 == nil { + r.EncodeNil() + } else { + yym1757 := z.EncBinary() + _ = yym1757 + 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 + yym1760 := z.EncBinary() + _ = yym1760 + if false { + } else { + z.F.EncMapInt8Int32V(yy1759, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt8Int32`) + r.WriteMapElemValue() + if yyn1758 { + r.EncodeNil() + } else { + if x.FptrMapInt8Int32 == nil { + r.EncodeNil() + } else { + yy1761 := *x.FptrMapInt8Int32 + yym1762 := z.EncBinary() + _ = yym1762 + if false { + } else { + z.F.EncMapInt8Int32V(yy1761, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Int64 == nil { + r.EncodeNil() + } else { + yym1764 := z.EncBinary() + _ = yym1764 + if false { + } else { + z.F.EncMapInt8Int64V(x.FMapInt8Int64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt8Int64`) + r.WriteMapElemValue() + if x.FMapInt8Int64 == nil { + r.EncodeNil() + } else { + yym1765 := z.EncBinary() + _ = yym1765 + 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 + yym1768 := z.EncBinary() + _ = yym1768 + if false { + } else { + z.F.EncMapInt8Int64V(yy1767, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt8Int64`) + r.WriteMapElemValue() + if yyn1766 { + r.EncodeNil() + } else { + if x.FptrMapInt8Int64 == nil { + r.EncodeNil() + } else { + yy1769 := *x.FptrMapInt8Int64 + yym1770 := z.EncBinary() + _ = yym1770 + if false { + } else { + z.F.EncMapInt8Int64V(yy1769, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Float32 == nil { + r.EncodeNil() + } else { + yym1772 := z.EncBinary() + _ = yym1772 + if false { + } else { + z.F.EncMapInt8Float32V(x.FMapInt8Float32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt8Float32`) + r.WriteMapElemValue() + if x.FMapInt8Float32 == nil { + r.EncodeNil() + } else { + yym1773 := z.EncBinary() + _ = yym1773 + 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 + yym1776 := z.EncBinary() + _ = yym1776 + if false { + } else { + z.F.EncMapInt8Float32V(yy1775, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt8Float32`) + r.WriteMapElemValue() + if yyn1774 { + r.EncodeNil() + } else { + if x.FptrMapInt8Float32 == nil { + r.EncodeNil() + } else { + yy1777 := *x.FptrMapInt8Float32 + yym1778 := z.EncBinary() + _ = yym1778 + if false { + } else { + z.F.EncMapInt8Float32V(yy1777, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Float64 == nil { + r.EncodeNil() + } else { + yym1780 := z.EncBinary() + _ = yym1780 + if false { + } else { + z.F.EncMapInt8Float64V(x.FMapInt8Float64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt8Float64`) + r.WriteMapElemValue() + if x.FMapInt8Float64 == nil { + r.EncodeNil() + } else { + yym1781 := z.EncBinary() + _ = yym1781 + 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 + yym1784 := z.EncBinary() + _ = yym1784 + if false { + } else { + z.F.EncMapInt8Float64V(yy1783, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt8Float64`) + r.WriteMapElemValue() + if yyn1782 { + r.EncodeNil() + } else { + if x.FptrMapInt8Float64 == nil { + r.EncodeNil() + } else { + yy1785 := *x.FptrMapInt8Float64 + yym1786 := z.EncBinary() + _ = yym1786 + if false { + } else { + z.F.EncMapInt8Float64V(yy1785, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt8Bool == nil { + r.EncodeNil() + } else { + yym1788 := z.EncBinary() + _ = yym1788 + if false { + } else { + z.F.EncMapInt8BoolV(x.FMapInt8Bool, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt8Bool`) + r.WriteMapElemValue() + if x.FMapInt8Bool == nil { + r.EncodeNil() + } else { + yym1789 := z.EncBinary() + _ = yym1789 + 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 + yym1792 := z.EncBinary() + _ = yym1792 + if false { + } else { + z.F.EncMapInt8BoolV(yy1791, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt8Bool`) + r.WriteMapElemValue() + if yyn1790 { + r.EncodeNil() + } else { + if x.FptrMapInt8Bool == nil { + r.EncodeNil() + } else { + yy1793 := *x.FptrMapInt8Bool + yym1794 := z.EncBinary() + _ = yym1794 + if false { + } else { + z.F.EncMapInt8BoolV(yy1793, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Intf == nil { + r.EncodeNil() + } else { + yym1796 := z.EncBinary() + _ = yym1796 + if false { + } else { + z.F.EncMapInt16IntfV(x.FMapInt16Intf, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt16Intf`) + r.WriteMapElemValue() + if x.FMapInt16Intf == nil { + r.EncodeNil() + } else { + yym1797 := z.EncBinary() + _ = yym1797 + 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 + yym1800 := z.EncBinary() + _ = yym1800 + if false { + } else { + z.F.EncMapInt16IntfV(yy1799, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt16Intf`) + r.WriteMapElemValue() + if yyn1798 { + r.EncodeNil() + } else { + if x.FptrMapInt16Intf == nil { + r.EncodeNil() + } else { + yy1801 := *x.FptrMapInt16Intf + yym1802 := z.EncBinary() + _ = yym1802 + if false { + } else { + z.F.EncMapInt16IntfV(yy1801, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16String == nil { + r.EncodeNil() + } else { + yym1804 := z.EncBinary() + _ = yym1804 + if false { + } else { + z.F.EncMapInt16StringV(x.FMapInt16String, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt16String`) + r.WriteMapElemValue() + if x.FMapInt16String == nil { + r.EncodeNil() + } else { + yym1805 := z.EncBinary() + _ = yym1805 + 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 + yym1808 := z.EncBinary() + _ = yym1808 + if false { + } else { + z.F.EncMapInt16StringV(yy1807, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt16String`) + r.WriteMapElemValue() + if yyn1806 { + r.EncodeNil() + } else { + if x.FptrMapInt16String == nil { + r.EncodeNil() + } else { + yy1809 := *x.FptrMapInt16String + yym1810 := z.EncBinary() + _ = yym1810 + if false { + } else { + z.F.EncMapInt16StringV(yy1809, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Uint == nil { + r.EncodeNil() + } else { + yym1812 := z.EncBinary() + _ = yym1812 + if false { + } else { + z.F.EncMapInt16UintV(x.FMapInt16Uint, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt16Uint`) + r.WriteMapElemValue() + if x.FMapInt16Uint == nil { + r.EncodeNil() + } else { + yym1813 := z.EncBinary() + _ = yym1813 + 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 + yym1816 := z.EncBinary() + _ = yym1816 + if false { + } else { + z.F.EncMapInt16UintV(yy1815, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt16Uint`) + r.WriteMapElemValue() + if yyn1814 { + r.EncodeNil() + } else { + if x.FptrMapInt16Uint == nil { + r.EncodeNil() + } else { + yy1817 := *x.FptrMapInt16Uint + yym1818 := z.EncBinary() + _ = yym1818 + if false { + } else { + z.F.EncMapInt16UintV(yy1817, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Uint8 == nil { + r.EncodeNil() + } else { + yym1820 := z.EncBinary() + _ = yym1820 + if false { + } else { + z.F.EncMapInt16Uint8V(x.FMapInt16Uint8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt16Uint8`) + r.WriteMapElemValue() + if x.FMapInt16Uint8 == nil { + r.EncodeNil() + } else { + yym1821 := z.EncBinary() + _ = yym1821 + 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 + yym1824 := z.EncBinary() + _ = yym1824 + if false { + } else { + z.F.EncMapInt16Uint8V(yy1823, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt16Uint8`) + r.WriteMapElemValue() + if yyn1822 { + r.EncodeNil() + } else { + if x.FptrMapInt16Uint8 == nil { + r.EncodeNil() + } else { + yy1825 := *x.FptrMapInt16Uint8 + yym1826 := z.EncBinary() + _ = yym1826 + if false { + } else { + z.F.EncMapInt16Uint8V(yy1825, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Uint16 == nil { + r.EncodeNil() + } else { + yym1828 := z.EncBinary() + _ = yym1828 + if false { + } else { + z.F.EncMapInt16Uint16V(x.FMapInt16Uint16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt16Uint16`) + r.WriteMapElemValue() + if x.FMapInt16Uint16 == nil { + r.EncodeNil() + } else { + yym1829 := z.EncBinary() + _ = yym1829 + 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 + yym1832 := z.EncBinary() + _ = yym1832 + if false { + } else { + z.F.EncMapInt16Uint16V(yy1831, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt16Uint16`) + r.WriteMapElemValue() + if yyn1830 { + r.EncodeNil() + } else { + if x.FptrMapInt16Uint16 == nil { + r.EncodeNil() + } else { + yy1833 := *x.FptrMapInt16Uint16 + yym1834 := z.EncBinary() + _ = yym1834 + if false { + } else { + z.F.EncMapInt16Uint16V(yy1833, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Uint32 == nil { + r.EncodeNil() + } else { + yym1836 := z.EncBinary() + _ = yym1836 + if false { + } else { + z.F.EncMapInt16Uint32V(x.FMapInt16Uint32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt16Uint32`) + r.WriteMapElemValue() + if x.FMapInt16Uint32 == nil { + r.EncodeNil() + } else { + yym1837 := z.EncBinary() + _ = yym1837 + 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 + yym1840 := z.EncBinary() + _ = yym1840 + if false { + } else { + z.F.EncMapInt16Uint32V(yy1839, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt16Uint32`) + r.WriteMapElemValue() + if yyn1838 { + r.EncodeNil() + } else { + if x.FptrMapInt16Uint32 == nil { + r.EncodeNil() + } else { + yy1841 := *x.FptrMapInt16Uint32 + yym1842 := z.EncBinary() + _ = yym1842 + if false { + } else { + z.F.EncMapInt16Uint32V(yy1841, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Uint64 == nil { + r.EncodeNil() + } else { + yym1844 := z.EncBinary() + _ = yym1844 + if false { + } else { + z.F.EncMapInt16Uint64V(x.FMapInt16Uint64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt16Uint64`) + r.WriteMapElemValue() + if x.FMapInt16Uint64 == nil { + r.EncodeNil() + } else { + yym1845 := z.EncBinary() + _ = yym1845 + 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 + yym1848 := z.EncBinary() + _ = yym1848 + if false { + } else { + z.F.EncMapInt16Uint64V(yy1847, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt16Uint64`) + r.WriteMapElemValue() + if yyn1846 { + r.EncodeNil() + } else { + if x.FptrMapInt16Uint64 == nil { + r.EncodeNil() + } else { + yy1849 := *x.FptrMapInt16Uint64 + yym1850 := z.EncBinary() + _ = yym1850 + if false { + } else { + z.F.EncMapInt16Uint64V(yy1849, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Uintptr == nil { + r.EncodeNil() + } else { + yym1852 := z.EncBinary() + _ = yym1852 + if false { + } else { + z.F.EncMapInt16UintptrV(x.FMapInt16Uintptr, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt16Uintptr`) + r.WriteMapElemValue() + if x.FMapInt16Uintptr == nil { + r.EncodeNil() + } else { + yym1853 := z.EncBinary() + _ = yym1853 + 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 + yym1856 := z.EncBinary() + _ = yym1856 + if false { + } else { + z.F.EncMapInt16UintptrV(yy1855, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt16Uintptr`) + r.WriteMapElemValue() + if yyn1854 { + r.EncodeNil() + } else { + if x.FptrMapInt16Uintptr == nil { + r.EncodeNil() + } else { + yy1857 := *x.FptrMapInt16Uintptr + yym1858 := z.EncBinary() + _ = yym1858 + if false { + } else { + z.F.EncMapInt16UintptrV(yy1857, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Int == nil { + r.EncodeNil() + } else { + yym1860 := z.EncBinary() + _ = yym1860 + if false { + } else { + z.F.EncMapInt16IntV(x.FMapInt16Int, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt16Int`) + r.WriteMapElemValue() + if x.FMapInt16Int == nil { + r.EncodeNil() + } else { + yym1861 := z.EncBinary() + _ = yym1861 + 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 + yym1864 := z.EncBinary() + _ = yym1864 + if false { + } else { + z.F.EncMapInt16IntV(yy1863, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt16Int`) + r.WriteMapElemValue() + if yyn1862 { + r.EncodeNil() + } else { + if x.FptrMapInt16Int == nil { + r.EncodeNil() + } else { + yy1865 := *x.FptrMapInt16Int + yym1866 := z.EncBinary() + _ = yym1866 + if false { + } else { + z.F.EncMapInt16IntV(yy1865, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Int8 == nil { + r.EncodeNil() + } else { + yym1868 := z.EncBinary() + _ = yym1868 + if false { + } else { + z.F.EncMapInt16Int8V(x.FMapInt16Int8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt16Int8`) + r.WriteMapElemValue() + if x.FMapInt16Int8 == nil { + r.EncodeNil() + } else { + yym1869 := z.EncBinary() + _ = yym1869 + 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 + yym1872 := z.EncBinary() + _ = yym1872 + if false { + } else { + z.F.EncMapInt16Int8V(yy1871, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt16Int8`) + r.WriteMapElemValue() + if yyn1870 { + r.EncodeNil() + } else { + if x.FptrMapInt16Int8 == nil { + r.EncodeNil() + } else { + yy1873 := *x.FptrMapInt16Int8 + yym1874 := z.EncBinary() + _ = yym1874 + if false { + } else { + z.F.EncMapInt16Int8V(yy1873, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Int16 == nil { + r.EncodeNil() + } else { + yym1876 := z.EncBinary() + _ = yym1876 + if false { + } else { + z.F.EncMapInt16Int16V(x.FMapInt16Int16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt16Int16`) + r.WriteMapElemValue() + if x.FMapInt16Int16 == nil { + r.EncodeNil() + } else { + yym1877 := z.EncBinary() + _ = yym1877 + 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 + yym1880 := z.EncBinary() + _ = yym1880 + if false { + } else { + z.F.EncMapInt16Int16V(yy1879, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt16Int16`) + r.WriteMapElemValue() + if yyn1878 { + r.EncodeNil() + } else { + if x.FptrMapInt16Int16 == nil { + r.EncodeNil() + } else { + yy1881 := *x.FptrMapInt16Int16 + yym1882 := z.EncBinary() + _ = yym1882 + if false { + } else { + z.F.EncMapInt16Int16V(yy1881, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Int32 == nil { + r.EncodeNil() + } else { + yym1884 := z.EncBinary() + _ = yym1884 + if false { + } else { + z.F.EncMapInt16Int32V(x.FMapInt16Int32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt16Int32`) + r.WriteMapElemValue() + if x.FMapInt16Int32 == nil { + r.EncodeNil() + } else { + yym1885 := z.EncBinary() + _ = yym1885 + 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 + yym1888 := z.EncBinary() + _ = yym1888 + if false { + } else { + z.F.EncMapInt16Int32V(yy1887, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt16Int32`) + r.WriteMapElemValue() + if yyn1886 { + r.EncodeNil() + } else { + if x.FptrMapInt16Int32 == nil { + r.EncodeNil() + } else { + yy1889 := *x.FptrMapInt16Int32 + yym1890 := z.EncBinary() + _ = yym1890 + if false { + } else { + z.F.EncMapInt16Int32V(yy1889, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Int64 == nil { + r.EncodeNil() + } else { + yym1892 := z.EncBinary() + _ = yym1892 + if false { + } else { + z.F.EncMapInt16Int64V(x.FMapInt16Int64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt16Int64`) + r.WriteMapElemValue() + if x.FMapInt16Int64 == nil { + r.EncodeNil() + } else { + yym1893 := z.EncBinary() + _ = yym1893 + 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 + yym1896 := z.EncBinary() + _ = yym1896 + if false { + } else { + z.F.EncMapInt16Int64V(yy1895, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt16Int64`) + r.WriteMapElemValue() + if yyn1894 { + r.EncodeNil() + } else { + if x.FptrMapInt16Int64 == nil { + r.EncodeNil() + } else { + yy1897 := *x.FptrMapInt16Int64 + yym1898 := z.EncBinary() + _ = yym1898 + if false { + } else { + z.F.EncMapInt16Int64V(yy1897, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Float32 == nil { + r.EncodeNil() + } else { + yym1900 := z.EncBinary() + _ = yym1900 + if false { + } else { + z.F.EncMapInt16Float32V(x.FMapInt16Float32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt16Float32`) + r.WriteMapElemValue() + if x.FMapInt16Float32 == nil { + r.EncodeNil() + } else { + yym1901 := z.EncBinary() + _ = yym1901 + 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 + yym1904 := z.EncBinary() + _ = yym1904 + if false { + } else { + z.F.EncMapInt16Float32V(yy1903, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt16Float32`) + r.WriteMapElemValue() + if yyn1902 { + r.EncodeNil() + } else { + if x.FptrMapInt16Float32 == nil { + r.EncodeNil() + } else { + yy1905 := *x.FptrMapInt16Float32 + yym1906 := z.EncBinary() + _ = yym1906 + if false { + } else { + z.F.EncMapInt16Float32V(yy1905, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Float64 == nil { + r.EncodeNil() + } else { + yym1908 := z.EncBinary() + _ = yym1908 + if false { + } else { + z.F.EncMapInt16Float64V(x.FMapInt16Float64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt16Float64`) + r.WriteMapElemValue() + if x.FMapInt16Float64 == nil { + r.EncodeNil() + } else { + yym1909 := z.EncBinary() + _ = yym1909 + 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 + yym1912 := z.EncBinary() + _ = yym1912 + if false { + } else { + z.F.EncMapInt16Float64V(yy1911, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt16Float64`) + r.WriteMapElemValue() + if yyn1910 { + r.EncodeNil() + } else { + if x.FptrMapInt16Float64 == nil { + r.EncodeNil() + } else { + yy1913 := *x.FptrMapInt16Float64 + yym1914 := z.EncBinary() + _ = yym1914 + if false { + } else { + z.F.EncMapInt16Float64V(yy1913, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt16Bool == nil { + r.EncodeNil() + } else { + yym1916 := z.EncBinary() + _ = yym1916 + if false { + } else { + z.F.EncMapInt16BoolV(x.FMapInt16Bool, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt16Bool`) + r.WriteMapElemValue() + if x.FMapInt16Bool == nil { + r.EncodeNil() + } else { + yym1917 := z.EncBinary() + _ = yym1917 + 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 + yym1920 := z.EncBinary() + _ = yym1920 + if false { + } else { + z.F.EncMapInt16BoolV(yy1919, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt16Bool`) + r.WriteMapElemValue() + if yyn1918 { + r.EncodeNil() + } else { + if x.FptrMapInt16Bool == nil { + r.EncodeNil() + } else { + yy1921 := *x.FptrMapInt16Bool + yym1922 := z.EncBinary() + _ = yym1922 + if false { + } else { + z.F.EncMapInt16BoolV(yy1921, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Intf == nil { + r.EncodeNil() + } else { + yym1924 := z.EncBinary() + _ = yym1924 + if false { + } else { + z.F.EncMapInt32IntfV(x.FMapInt32Intf, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt32Intf`) + r.WriteMapElemValue() + if x.FMapInt32Intf == nil { + r.EncodeNil() + } else { + yym1925 := z.EncBinary() + _ = yym1925 + 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 + yym1928 := z.EncBinary() + _ = yym1928 + if false { + } else { + z.F.EncMapInt32IntfV(yy1927, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt32Intf`) + r.WriteMapElemValue() + if yyn1926 { + r.EncodeNil() + } else { + if x.FptrMapInt32Intf == nil { + r.EncodeNil() + } else { + yy1929 := *x.FptrMapInt32Intf + yym1930 := z.EncBinary() + _ = yym1930 + if false { + } else { + z.F.EncMapInt32IntfV(yy1929, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32String == nil { + r.EncodeNil() + } else { + yym1932 := z.EncBinary() + _ = yym1932 + if false { + } else { + z.F.EncMapInt32StringV(x.FMapInt32String, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt32String`) + r.WriteMapElemValue() + if x.FMapInt32String == nil { + r.EncodeNil() + } else { + yym1933 := z.EncBinary() + _ = yym1933 + 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 + yym1936 := z.EncBinary() + _ = yym1936 + if false { + } else { + z.F.EncMapInt32StringV(yy1935, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt32String`) + r.WriteMapElemValue() + if yyn1934 { + r.EncodeNil() + } else { + if x.FptrMapInt32String == nil { + r.EncodeNil() + } else { + yy1937 := *x.FptrMapInt32String + yym1938 := z.EncBinary() + _ = yym1938 + if false { + } else { + z.F.EncMapInt32StringV(yy1937, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Uint == nil { + r.EncodeNil() + } else { + yym1940 := z.EncBinary() + _ = yym1940 + if false { + } else { + z.F.EncMapInt32UintV(x.FMapInt32Uint, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt32Uint`) + r.WriteMapElemValue() + if x.FMapInt32Uint == nil { + r.EncodeNil() + } else { + yym1941 := z.EncBinary() + _ = yym1941 + 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 + yym1944 := z.EncBinary() + _ = yym1944 + if false { + } else { + z.F.EncMapInt32UintV(yy1943, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt32Uint`) + r.WriteMapElemValue() + if yyn1942 { + r.EncodeNil() + } else { + if x.FptrMapInt32Uint == nil { + r.EncodeNil() + } else { + yy1945 := *x.FptrMapInt32Uint + yym1946 := z.EncBinary() + _ = yym1946 + if false { + } else { + z.F.EncMapInt32UintV(yy1945, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Uint8 == nil { + r.EncodeNil() + } else { + yym1948 := z.EncBinary() + _ = yym1948 + if false { + } else { + z.F.EncMapInt32Uint8V(x.FMapInt32Uint8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt32Uint8`) + r.WriteMapElemValue() + if x.FMapInt32Uint8 == nil { + r.EncodeNil() + } else { + yym1949 := z.EncBinary() + _ = yym1949 + 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 + yym1952 := z.EncBinary() + _ = yym1952 + if false { + } else { + z.F.EncMapInt32Uint8V(yy1951, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt32Uint8`) + r.WriteMapElemValue() + if yyn1950 { + r.EncodeNil() + } else { + if x.FptrMapInt32Uint8 == nil { + r.EncodeNil() + } else { + yy1953 := *x.FptrMapInt32Uint8 + yym1954 := z.EncBinary() + _ = yym1954 + if false { + } else { + z.F.EncMapInt32Uint8V(yy1953, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Uint16 == nil { + r.EncodeNil() + } else { + yym1956 := z.EncBinary() + _ = yym1956 + if false { + } else { + z.F.EncMapInt32Uint16V(x.FMapInt32Uint16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt32Uint16`) + r.WriteMapElemValue() + if x.FMapInt32Uint16 == nil { + r.EncodeNil() + } else { + yym1957 := z.EncBinary() + _ = yym1957 + 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 + yym1960 := z.EncBinary() + _ = yym1960 + if false { + } else { + z.F.EncMapInt32Uint16V(yy1959, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt32Uint16`) + r.WriteMapElemValue() + if yyn1958 { + r.EncodeNil() + } else { + if x.FptrMapInt32Uint16 == nil { + r.EncodeNil() + } else { + yy1961 := *x.FptrMapInt32Uint16 + yym1962 := z.EncBinary() + _ = yym1962 + if false { + } else { + z.F.EncMapInt32Uint16V(yy1961, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Uint32 == nil { + r.EncodeNil() + } else { + yym1964 := z.EncBinary() + _ = yym1964 + if false { + } else { + z.F.EncMapInt32Uint32V(x.FMapInt32Uint32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt32Uint32`) + r.WriteMapElemValue() + if x.FMapInt32Uint32 == nil { + r.EncodeNil() + } else { + yym1965 := z.EncBinary() + _ = yym1965 + 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 + yym1968 := z.EncBinary() + _ = yym1968 + if false { + } else { + z.F.EncMapInt32Uint32V(yy1967, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt32Uint32`) + r.WriteMapElemValue() + if yyn1966 { + r.EncodeNil() + } else { + if x.FptrMapInt32Uint32 == nil { + r.EncodeNil() + } else { + yy1969 := *x.FptrMapInt32Uint32 + yym1970 := z.EncBinary() + _ = yym1970 + if false { + } else { + z.F.EncMapInt32Uint32V(yy1969, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Uint64 == nil { + r.EncodeNil() + } else { + yym1972 := z.EncBinary() + _ = yym1972 + if false { + } else { + z.F.EncMapInt32Uint64V(x.FMapInt32Uint64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt32Uint64`) + r.WriteMapElemValue() + if x.FMapInt32Uint64 == nil { + r.EncodeNil() + } else { + yym1973 := z.EncBinary() + _ = yym1973 + 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 + yym1976 := z.EncBinary() + _ = yym1976 + if false { + } else { + z.F.EncMapInt32Uint64V(yy1975, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt32Uint64`) + r.WriteMapElemValue() + if yyn1974 { + r.EncodeNil() + } else { + if x.FptrMapInt32Uint64 == nil { + r.EncodeNil() + } else { + yy1977 := *x.FptrMapInt32Uint64 + yym1978 := z.EncBinary() + _ = yym1978 + if false { + } else { + z.F.EncMapInt32Uint64V(yy1977, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Uintptr == nil { + r.EncodeNil() + } else { + yym1980 := z.EncBinary() + _ = yym1980 + if false { + } else { + z.F.EncMapInt32UintptrV(x.FMapInt32Uintptr, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt32Uintptr`) + r.WriteMapElemValue() + if x.FMapInt32Uintptr == nil { + r.EncodeNil() + } else { + yym1981 := z.EncBinary() + _ = yym1981 + 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 + yym1984 := z.EncBinary() + _ = yym1984 + if false { + } else { + z.F.EncMapInt32UintptrV(yy1983, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt32Uintptr`) + r.WriteMapElemValue() + if yyn1982 { + r.EncodeNil() + } else { + if x.FptrMapInt32Uintptr == nil { + r.EncodeNil() + } else { + yy1985 := *x.FptrMapInt32Uintptr + yym1986 := z.EncBinary() + _ = yym1986 + if false { + } else { + z.F.EncMapInt32UintptrV(yy1985, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Int == nil { + r.EncodeNil() + } else { + yym1988 := z.EncBinary() + _ = yym1988 + if false { + } else { + z.F.EncMapInt32IntV(x.FMapInt32Int, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt32Int`) + r.WriteMapElemValue() + if x.FMapInt32Int == nil { + r.EncodeNil() + } else { + yym1989 := z.EncBinary() + _ = yym1989 + 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 + yym1992 := z.EncBinary() + _ = yym1992 + if false { + } else { + z.F.EncMapInt32IntV(yy1991, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt32Int`) + r.WriteMapElemValue() + if yyn1990 { + r.EncodeNil() + } else { + if x.FptrMapInt32Int == nil { + r.EncodeNil() + } else { + yy1993 := *x.FptrMapInt32Int + yym1994 := z.EncBinary() + _ = yym1994 + if false { + } else { + z.F.EncMapInt32IntV(yy1993, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Int8 == nil { + r.EncodeNil() + } else { + yym1996 := z.EncBinary() + _ = yym1996 + if false { + } else { + z.F.EncMapInt32Int8V(x.FMapInt32Int8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt32Int8`) + r.WriteMapElemValue() + if x.FMapInt32Int8 == nil { + r.EncodeNil() + } else { + yym1997 := z.EncBinary() + _ = yym1997 + 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 + yym2000 := z.EncBinary() + _ = yym2000 + if false { + } else { + z.F.EncMapInt32Int8V(yy1999, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt32Int8`) + r.WriteMapElemValue() + if yyn1998 { + r.EncodeNil() + } else { + if x.FptrMapInt32Int8 == nil { + r.EncodeNil() + } else { + yy2001 := *x.FptrMapInt32Int8 + yym2002 := z.EncBinary() + _ = yym2002 + if false { + } else { + z.F.EncMapInt32Int8V(yy2001, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Int16 == nil { + r.EncodeNil() + } else { + yym2004 := z.EncBinary() + _ = yym2004 + if false { + } else { + z.F.EncMapInt32Int16V(x.FMapInt32Int16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt32Int16`) + r.WriteMapElemValue() + if x.FMapInt32Int16 == nil { + r.EncodeNil() + } else { + yym2005 := z.EncBinary() + _ = yym2005 + 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 + yym2008 := z.EncBinary() + _ = yym2008 + if false { + } else { + z.F.EncMapInt32Int16V(yy2007, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt32Int16`) + r.WriteMapElemValue() + if yyn2006 { + r.EncodeNil() + } else { + if x.FptrMapInt32Int16 == nil { + r.EncodeNil() + } else { + yy2009 := *x.FptrMapInt32Int16 + yym2010 := z.EncBinary() + _ = yym2010 + if false { + } else { + z.F.EncMapInt32Int16V(yy2009, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Int32 == nil { + r.EncodeNil() + } else { + yym2012 := z.EncBinary() + _ = yym2012 + if false { + } else { + z.F.EncMapInt32Int32V(x.FMapInt32Int32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt32Int32`) + r.WriteMapElemValue() + if x.FMapInt32Int32 == nil { + r.EncodeNil() + } else { + yym2013 := z.EncBinary() + _ = yym2013 + 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 + yym2016 := z.EncBinary() + _ = yym2016 + if false { + } else { + z.F.EncMapInt32Int32V(yy2015, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt32Int32`) + r.WriteMapElemValue() + if yyn2014 { + r.EncodeNil() + } else { + if x.FptrMapInt32Int32 == nil { + r.EncodeNil() + } else { + yy2017 := *x.FptrMapInt32Int32 + yym2018 := z.EncBinary() + _ = yym2018 + if false { + } else { + z.F.EncMapInt32Int32V(yy2017, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Int64 == nil { + r.EncodeNil() + } else { + yym2020 := z.EncBinary() + _ = yym2020 + if false { + } else { + z.F.EncMapInt32Int64V(x.FMapInt32Int64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt32Int64`) + r.WriteMapElemValue() + if x.FMapInt32Int64 == nil { + r.EncodeNil() + } else { + yym2021 := z.EncBinary() + _ = yym2021 + 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 + yym2024 := z.EncBinary() + _ = yym2024 + if false { + } else { + z.F.EncMapInt32Int64V(yy2023, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt32Int64`) + r.WriteMapElemValue() + if yyn2022 { + r.EncodeNil() + } else { + if x.FptrMapInt32Int64 == nil { + r.EncodeNil() + } else { + yy2025 := *x.FptrMapInt32Int64 + yym2026 := z.EncBinary() + _ = yym2026 + if false { + } else { + z.F.EncMapInt32Int64V(yy2025, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Float32 == nil { + r.EncodeNil() + } else { + yym2028 := z.EncBinary() + _ = yym2028 + if false { + } else { + z.F.EncMapInt32Float32V(x.FMapInt32Float32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt32Float32`) + r.WriteMapElemValue() + if x.FMapInt32Float32 == nil { + r.EncodeNil() + } else { + yym2029 := z.EncBinary() + _ = yym2029 + 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 + yym2032 := z.EncBinary() + _ = yym2032 + if false { + } else { + z.F.EncMapInt32Float32V(yy2031, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt32Float32`) + r.WriteMapElemValue() + if yyn2030 { + r.EncodeNil() + } else { + if x.FptrMapInt32Float32 == nil { + r.EncodeNil() + } else { + yy2033 := *x.FptrMapInt32Float32 + yym2034 := z.EncBinary() + _ = yym2034 + if false { + } else { + z.F.EncMapInt32Float32V(yy2033, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Float64 == nil { + r.EncodeNil() + } else { + yym2036 := z.EncBinary() + _ = yym2036 + if false { + } else { + z.F.EncMapInt32Float64V(x.FMapInt32Float64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt32Float64`) + r.WriteMapElemValue() + if x.FMapInt32Float64 == nil { + r.EncodeNil() + } else { + yym2037 := z.EncBinary() + _ = yym2037 + 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 + yym2040 := z.EncBinary() + _ = yym2040 + if false { + } else { + z.F.EncMapInt32Float64V(yy2039, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt32Float64`) + r.WriteMapElemValue() + if yyn2038 { + r.EncodeNil() + } else { + if x.FptrMapInt32Float64 == nil { + r.EncodeNil() + } else { + yy2041 := *x.FptrMapInt32Float64 + yym2042 := z.EncBinary() + _ = yym2042 + if false { + } else { + z.F.EncMapInt32Float64V(yy2041, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt32Bool == nil { + r.EncodeNil() + } else { + yym2044 := z.EncBinary() + _ = yym2044 + if false { + } else { + z.F.EncMapInt32BoolV(x.FMapInt32Bool, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt32Bool`) + r.WriteMapElemValue() + if x.FMapInt32Bool == nil { + r.EncodeNil() + } else { + yym2045 := z.EncBinary() + _ = yym2045 + 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 + yym2048 := z.EncBinary() + _ = yym2048 + if false { + } else { + z.F.EncMapInt32BoolV(yy2047, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt32Bool`) + r.WriteMapElemValue() + if yyn2046 { + r.EncodeNil() + } else { + if x.FptrMapInt32Bool == nil { + r.EncodeNil() + } else { + yy2049 := *x.FptrMapInt32Bool + yym2050 := z.EncBinary() + _ = yym2050 + if false { + } else { + z.F.EncMapInt32BoolV(yy2049, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Intf == nil { + r.EncodeNil() + } else { + yym2052 := z.EncBinary() + _ = yym2052 + if false { + } else { + z.F.EncMapInt64IntfV(x.FMapInt64Intf, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt64Intf`) + r.WriteMapElemValue() + if x.FMapInt64Intf == nil { + r.EncodeNil() + } else { + yym2053 := z.EncBinary() + _ = yym2053 + 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 + yym2056 := z.EncBinary() + _ = yym2056 + if false { + } else { + z.F.EncMapInt64IntfV(yy2055, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt64Intf`) + r.WriteMapElemValue() + if yyn2054 { + r.EncodeNil() + } else { + if x.FptrMapInt64Intf == nil { + r.EncodeNil() + } else { + yy2057 := *x.FptrMapInt64Intf + yym2058 := z.EncBinary() + _ = yym2058 + if false { + } else { + z.F.EncMapInt64IntfV(yy2057, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64String == nil { + r.EncodeNil() + } else { + yym2060 := z.EncBinary() + _ = yym2060 + if false { + } else { + z.F.EncMapInt64StringV(x.FMapInt64String, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt64String`) + r.WriteMapElemValue() + if x.FMapInt64String == nil { + r.EncodeNil() + } else { + yym2061 := z.EncBinary() + _ = yym2061 + 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 + yym2064 := z.EncBinary() + _ = yym2064 + if false { + } else { + z.F.EncMapInt64StringV(yy2063, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt64String`) + r.WriteMapElemValue() + if yyn2062 { + r.EncodeNil() + } else { + if x.FptrMapInt64String == nil { + r.EncodeNil() + } else { + yy2065 := *x.FptrMapInt64String + yym2066 := z.EncBinary() + _ = yym2066 + if false { + } else { + z.F.EncMapInt64StringV(yy2065, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Uint == nil { + r.EncodeNil() + } else { + yym2068 := z.EncBinary() + _ = yym2068 + if false { + } else { + z.F.EncMapInt64UintV(x.FMapInt64Uint, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt64Uint`) + r.WriteMapElemValue() + if x.FMapInt64Uint == nil { + r.EncodeNil() + } else { + yym2069 := z.EncBinary() + _ = yym2069 + 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 + yym2072 := z.EncBinary() + _ = yym2072 + if false { + } else { + z.F.EncMapInt64UintV(yy2071, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt64Uint`) + r.WriteMapElemValue() + if yyn2070 { + r.EncodeNil() + } else { + if x.FptrMapInt64Uint == nil { + r.EncodeNil() + } else { + yy2073 := *x.FptrMapInt64Uint + yym2074 := z.EncBinary() + _ = yym2074 + if false { + } else { + z.F.EncMapInt64UintV(yy2073, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Uint8 == nil { + r.EncodeNil() + } else { + yym2076 := z.EncBinary() + _ = yym2076 + if false { + } else { + z.F.EncMapInt64Uint8V(x.FMapInt64Uint8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt64Uint8`) + r.WriteMapElemValue() + if x.FMapInt64Uint8 == nil { + r.EncodeNil() + } else { + yym2077 := z.EncBinary() + _ = yym2077 + 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 + yym2080 := z.EncBinary() + _ = yym2080 + if false { + } else { + z.F.EncMapInt64Uint8V(yy2079, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt64Uint8`) + r.WriteMapElemValue() + if yyn2078 { + r.EncodeNil() + } else { + if x.FptrMapInt64Uint8 == nil { + r.EncodeNil() + } else { + yy2081 := *x.FptrMapInt64Uint8 + yym2082 := z.EncBinary() + _ = yym2082 + if false { + } else { + z.F.EncMapInt64Uint8V(yy2081, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Uint16 == nil { + r.EncodeNil() + } else { + yym2084 := z.EncBinary() + _ = yym2084 + if false { + } else { + z.F.EncMapInt64Uint16V(x.FMapInt64Uint16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt64Uint16`) + r.WriteMapElemValue() + if x.FMapInt64Uint16 == nil { + r.EncodeNil() + } else { + yym2085 := z.EncBinary() + _ = yym2085 + 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 + yym2088 := z.EncBinary() + _ = yym2088 + if false { + } else { + z.F.EncMapInt64Uint16V(yy2087, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt64Uint16`) + r.WriteMapElemValue() + if yyn2086 { + r.EncodeNil() + } else { + if x.FptrMapInt64Uint16 == nil { + r.EncodeNil() + } else { + yy2089 := *x.FptrMapInt64Uint16 + yym2090 := z.EncBinary() + _ = yym2090 + if false { + } else { + z.F.EncMapInt64Uint16V(yy2089, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Uint32 == nil { + r.EncodeNil() + } else { + yym2092 := z.EncBinary() + _ = yym2092 + if false { + } else { + z.F.EncMapInt64Uint32V(x.FMapInt64Uint32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt64Uint32`) + r.WriteMapElemValue() + if x.FMapInt64Uint32 == nil { + r.EncodeNil() + } else { + yym2093 := z.EncBinary() + _ = yym2093 + 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 + yym2096 := z.EncBinary() + _ = yym2096 + if false { + } else { + z.F.EncMapInt64Uint32V(yy2095, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt64Uint32`) + r.WriteMapElemValue() + if yyn2094 { + r.EncodeNil() + } else { + if x.FptrMapInt64Uint32 == nil { + r.EncodeNil() + } else { + yy2097 := *x.FptrMapInt64Uint32 + yym2098 := z.EncBinary() + _ = yym2098 + if false { + } else { + z.F.EncMapInt64Uint32V(yy2097, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Uint64 == nil { + r.EncodeNil() + } else { + yym2100 := z.EncBinary() + _ = yym2100 + if false { + } else { + z.F.EncMapInt64Uint64V(x.FMapInt64Uint64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt64Uint64`) + r.WriteMapElemValue() + if x.FMapInt64Uint64 == nil { + r.EncodeNil() + } else { + yym2101 := z.EncBinary() + _ = yym2101 + 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 + yym2104 := z.EncBinary() + _ = yym2104 + if false { + } else { + z.F.EncMapInt64Uint64V(yy2103, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt64Uint64`) + r.WriteMapElemValue() + if yyn2102 { + r.EncodeNil() + } else { + if x.FptrMapInt64Uint64 == nil { + r.EncodeNil() + } else { + yy2105 := *x.FptrMapInt64Uint64 + yym2106 := z.EncBinary() + _ = yym2106 + if false { + } else { + z.F.EncMapInt64Uint64V(yy2105, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Uintptr == nil { + r.EncodeNil() + } else { + yym2108 := z.EncBinary() + _ = yym2108 + if false { + } else { + z.F.EncMapInt64UintptrV(x.FMapInt64Uintptr, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt64Uintptr`) + r.WriteMapElemValue() + if x.FMapInt64Uintptr == nil { + r.EncodeNil() + } else { + yym2109 := z.EncBinary() + _ = yym2109 + 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 + yym2112 := z.EncBinary() + _ = yym2112 + if false { + } else { + z.F.EncMapInt64UintptrV(yy2111, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt64Uintptr`) + r.WriteMapElemValue() + if yyn2110 { + r.EncodeNil() + } else { + if x.FptrMapInt64Uintptr == nil { + r.EncodeNil() + } else { + yy2113 := *x.FptrMapInt64Uintptr + yym2114 := z.EncBinary() + _ = yym2114 + if false { + } else { + z.F.EncMapInt64UintptrV(yy2113, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Int == nil { + r.EncodeNil() + } else { + yym2116 := z.EncBinary() + _ = yym2116 + if false { + } else { + z.F.EncMapInt64IntV(x.FMapInt64Int, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt64Int`) + r.WriteMapElemValue() + if x.FMapInt64Int == nil { + r.EncodeNil() + } else { + yym2117 := z.EncBinary() + _ = yym2117 + 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 + yym2120 := z.EncBinary() + _ = yym2120 + if false { + } else { + z.F.EncMapInt64IntV(yy2119, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt64Int`) + r.WriteMapElemValue() + if yyn2118 { + r.EncodeNil() + } else { + if x.FptrMapInt64Int == nil { + r.EncodeNil() + } else { + yy2121 := *x.FptrMapInt64Int + yym2122 := z.EncBinary() + _ = yym2122 + if false { + } else { + z.F.EncMapInt64IntV(yy2121, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Int8 == nil { + r.EncodeNil() + } else { + yym2124 := z.EncBinary() + _ = yym2124 + if false { + } else { + z.F.EncMapInt64Int8V(x.FMapInt64Int8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt64Int8`) + r.WriteMapElemValue() + if x.FMapInt64Int8 == nil { + r.EncodeNil() + } else { + yym2125 := z.EncBinary() + _ = yym2125 + 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 + yym2128 := z.EncBinary() + _ = yym2128 + if false { + } else { + z.F.EncMapInt64Int8V(yy2127, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt64Int8`) + r.WriteMapElemValue() + if yyn2126 { + r.EncodeNil() + } else { + if x.FptrMapInt64Int8 == nil { + r.EncodeNil() + } else { + yy2129 := *x.FptrMapInt64Int8 + yym2130 := z.EncBinary() + _ = yym2130 + if false { + } else { + z.F.EncMapInt64Int8V(yy2129, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Int16 == nil { + r.EncodeNil() + } else { + yym2132 := z.EncBinary() + _ = yym2132 + if false { + } else { + z.F.EncMapInt64Int16V(x.FMapInt64Int16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt64Int16`) + r.WriteMapElemValue() + if x.FMapInt64Int16 == nil { + r.EncodeNil() + } else { + yym2133 := z.EncBinary() + _ = yym2133 + 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 + yym2136 := z.EncBinary() + _ = yym2136 + if false { + } else { + z.F.EncMapInt64Int16V(yy2135, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt64Int16`) + r.WriteMapElemValue() + if yyn2134 { + r.EncodeNil() + } else { + if x.FptrMapInt64Int16 == nil { + r.EncodeNil() + } else { + yy2137 := *x.FptrMapInt64Int16 + yym2138 := z.EncBinary() + _ = yym2138 + if false { + } else { + z.F.EncMapInt64Int16V(yy2137, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Int32 == nil { + r.EncodeNil() + } else { + yym2140 := z.EncBinary() + _ = yym2140 + if false { + } else { + z.F.EncMapInt64Int32V(x.FMapInt64Int32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt64Int32`) + r.WriteMapElemValue() + if x.FMapInt64Int32 == nil { + r.EncodeNil() + } else { + yym2141 := z.EncBinary() + _ = yym2141 + 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 + yym2144 := z.EncBinary() + _ = yym2144 + if false { + } else { + z.F.EncMapInt64Int32V(yy2143, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt64Int32`) + r.WriteMapElemValue() + if yyn2142 { + r.EncodeNil() + } else { + if x.FptrMapInt64Int32 == nil { + r.EncodeNil() + } else { + yy2145 := *x.FptrMapInt64Int32 + yym2146 := z.EncBinary() + _ = yym2146 + if false { + } else { + z.F.EncMapInt64Int32V(yy2145, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Int64 == nil { + r.EncodeNil() + } else { + yym2148 := z.EncBinary() + _ = yym2148 + if false { + } else { + z.F.EncMapInt64Int64V(x.FMapInt64Int64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt64Int64`) + r.WriteMapElemValue() + if x.FMapInt64Int64 == nil { + r.EncodeNil() + } else { + yym2149 := z.EncBinary() + _ = yym2149 + 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 + yym2152 := z.EncBinary() + _ = yym2152 + if false { + } else { + z.F.EncMapInt64Int64V(yy2151, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt64Int64`) + r.WriteMapElemValue() + if yyn2150 { + r.EncodeNil() + } else { + if x.FptrMapInt64Int64 == nil { + r.EncodeNil() + } else { + yy2153 := *x.FptrMapInt64Int64 + yym2154 := z.EncBinary() + _ = yym2154 + if false { + } else { + z.F.EncMapInt64Int64V(yy2153, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Float32 == nil { + r.EncodeNil() + } else { + yym2156 := z.EncBinary() + _ = yym2156 + if false { + } else { + z.F.EncMapInt64Float32V(x.FMapInt64Float32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt64Float32`) + r.WriteMapElemValue() + if x.FMapInt64Float32 == nil { + r.EncodeNil() + } else { + yym2157 := z.EncBinary() + _ = yym2157 + 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 + yym2160 := z.EncBinary() + _ = yym2160 + if false { + } else { + z.F.EncMapInt64Float32V(yy2159, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt64Float32`) + r.WriteMapElemValue() + if yyn2158 { + r.EncodeNil() + } else { + if x.FptrMapInt64Float32 == nil { + r.EncodeNil() + } else { + yy2161 := *x.FptrMapInt64Float32 + yym2162 := z.EncBinary() + _ = yym2162 + if false { + } else { + z.F.EncMapInt64Float32V(yy2161, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Float64 == nil { + r.EncodeNil() + } else { + yym2164 := z.EncBinary() + _ = yym2164 + if false { + } else { + z.F.EncMapInt64Float64V(x.FMapInt64Float64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt64Float64`) + r.WriteMapElemValue() + if x.FMapInt64Float64 == nil { + r.EncodeNil() + } else { + yym2165 := z.EncBinary() + _ = yym2165 + 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 + yym2168 := z.EncBinary() + _ = yym2168 + if false { + } else { + z.F.EncMapInt64Float64V(yy2167, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt64Float64`) + r.WriteMapElemValue() + if yyn2166 { + r.EncodeNil() + } else { + if x.FptrMapInt64Float64 == nil { + r.EncodeNil() + } else { + yy2169 := *x.FptrMapInt64Float64 + yym2170 := z.EncBinary() + _ = yym2170 + if false { + } else { + z.F.EncMapInt64Float64V(yy2169, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapInt64Bool == nil { + r.EncodeNil() + } else { + yym2172 := z.EncBinary() + _ = yym2172 + if false { + } else { + z.F.EncMapInt64BoolV(x.FMapInt64Bool, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapInt64Bool`) + r.WriteMapElemValue() + if x.FMapInt64Bool == nil { + r.EncodeNil() + } else { + yym2173 := z.EncBinary() + _ = yym2173 + 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 + yym2176 := z.EncBinary() + _ = yym2176 + if false { + } else { + z.F.EncMapInt64BoolV(yy2175, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapInt64Bool`) + r.WriteMapElemValue() + if yyn2174 { + r.EncodeNil() + } else { + if x.FptrMapInt64Bool == nil { + r.EncodeNil() + } else { + yy2177 := *x.FptrMapInt64Bool + yym2178 := z.EncBinary() + _ = yym2178 + if false { + } else { + z.F.EncMapInt64BoolV(yy2177, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolIntf == nil { + r.EncodeNil() + } else { + yym2180 := z.EncBinary() + _ = yym2180 + if false { + } else { + z.F.EncMapBoolIntfV(x.FMapBoolIntf, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapBoolIntf`) + r.WriteMapElemValue() + if x.FMapBoolIntf == nil { + r.EncodeNil() + } else { + yym2181 := z.EncBinary() + _ = yym2181 + 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 + yym2184 := z.EncBinary() + _ = yym2184 + if false { + } else { + z.F.EncMapBoolIntfV(yy2183, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapBoolIntf`) + r.WriteMapElemValue() + if yyn2182 { + r.EncodeNil() + } else { + if x.FptrMapBoolIntf == nil { + r.EncodeNil() + } else { + yy2185 := *x.FptrMapBoolIntf + yym2186 := z.EncBinary() + _ = yym2186 + if false { + } else { + z.F.EncMapBoolIntfV(yy2185, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolString == nil { + r.EncodeNil() + } else { + yym2188 := z.EncBinary() + _ = yym2188 + if false { + } else { + z.F.EncMapBoolStringV(x.FMapBoolString, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapBoolString`) + r.WriteMapElemValue() + if x.FMapBoolString == nil { + r.EncodeNil() + } else { + yym2189 := z.EncBinary() + _ = yym2189 + 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 + yym2192 := z.EncBinary() + _ = yym2192 + if false { + } else { + z.F.EncMapBoolStringV(yy2191, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapBoolString`) + r.WriteMapElemValue() + if yyn2190 { + r.EncodeNil() + } else { + if x.FptrMapBoolString == nil { + r.EncodeNil() + } else { + yy2193 := *x.FptrMapBoolString + yym2194 := z.EncBinary() + _ = yym2194 + if false { + } else { + z.F.EncMapBoolStringV(yy2193, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolUint == nil { + r.EncodeNil() + } else { + yym2196 := z.EncBinary() + _ = yym2196 + if false { + } else { + z.F.EncMapBoolUintV(x.FMapBoolUint, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapBoolUint`) + r.WriteMapElemValue() + if x.FMapBoolUint == nil { + r.EncodeNil() + } else { + yym2197 := z.EncBinary() + _ = yym2197 + 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 + yym2200 := z.EncBinary() + _ = yym2200 + if false { + } else { + z.F.EncMapBoolUintV(yy2199, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapBoolUint`) + r.WriteMapElemValue() + if yyn2198 { + r.EncodeNil() + } else { + if x.FptrMapBoolUint == nil { + r.EncodeNil() + } else { + yy2201 := *x.FptrMapBoolUint + yym2202 := z.EncBinary() + _ = yym2202 + if false { + } else { + z.F.EncMapBoolUintV(yy2201, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolUint8 == nil { + r.EncodeNil() + } else { + yym2204 := z.EncBinary() + _ = yym2204 + if false { + } else { + z.F.EncMapBoolUint8V(x.FMapBoolUint8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapBoolUint8`) + r.WriteMapElemValue() + if x.FMapBoolUint8 == nil { + r.EncodeNil() + } else { + yym2205 := z.EncBinary() + _ = yym2205 + 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 + yym2208 := z.EncBinary() + _ = yym2208 + if false { + } else { + z.F.EncMapBoolUint8V(yy2207, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapBoolUint8`) + r.WriteMapElemValue() + if yyn2206 { + r.EncodeNil() + } else { + if x.FptrMapBoolUint8 == nil { + r.EncodeNil() + } else { + yy2209 := *x.FptrMapBoolUint8 + yym2210 := z.EncBinary() + _ = yym2210 + if false { + } else { + z.F.EncMapBoolUint8V(yy2209, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolUint16 == nil { + r.EncodeNil() + } else { + yym2212 := z.EncBinary() + _ = yym2212 + if false { + } else { + z.F.EncMapBoolUint16V(x.FMapBoolUint16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapBoolUint16`) + r.WriteMapElemValue() + if x.FMapBoolUint16 == nil { + r.EncodeNil() + } else { + yym2213 := z.EncBinary() + _ = yym2213 + 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 + yym2216 := z.EncBinary() + _ = yym2216 + if false { + } else { + z.F.EncMapBoolUint16V(yy2215, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapBoolUint16`) + r.WriteMapElemValue() + if yyn2214 { + r.EncodeNil() + } else { + if x.FptrMapBoolUint16 == nil { + r.EncodeNil() + } else { + yy2217 := *x.FptrMapBoolUint16 + yym2218 := z.EncBinary() + _ = yym2218 + if false { + } else { + z.F.EncMapBoolUint16V(yy2217, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolUint32 == nil { + r.EncodeNil() + } else { + yym2220 := z.EncBinary() + _ = yym2220 + if false { + } else { + z.F.EncMapBoolUint32V(x.FMapBoolUint32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapBoolUint32`) + r.WriteMapElemValue() + if x.FMapBoolUint32 == nil { + r.EncodeNil() + } else { + yym2221 := z.EncBinary() + _ = yym2221 + 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 + yym2224 := z.EncBinary() + _ = yym2224 + if false { + } else { + z.F.EncMapBoolUint32V(yy2223, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapBoolUint32`) + r.WriteMapElemValue() + if yyn2222 { + r.EncodeNil() + } else { + if x.FptrMapBoolUint32 == nil { + r.EncodeNil() + } else { + yy2225 := *x.FptrMapBoolUint32 + yym2226 := z.EncBinary() + _ = yym2226 + if false { + } else { + z.F.EncMapBoolUint32V(yy2225, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolUint64 == nil { + r.EncodeNil() + } else { + yym2228 := z.EncBinary() + _ = yym2228 + if false { + } else { + z.F.EncMapBoolUint64V(x.FMapBoolUint64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapBoolUint64`) + r.WriteMapElemValue() + if x.FMapBoolUint64 == nil { + r.EncodeNil() + } else { + yym2229 := z.EncBinary() + _ = yym2229 + 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 + yym2232 := z.EncBinary() + _ = yym2232 + if false { + } else { + z.F.EncMapBoolUint64V(yy2231, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapBoolUint64`) + r.WriteMapElemValue() + if yyn2230 { + r.EncodeNil() + } else { + if x.FptrMapBoolUint64 == nil { + r.EncodeNil() + } else { + yy2233 := *x.FptrMapBoolUint64 + yym2234 := z.EncBinary() + _ = yym2234 + if false { + } else { + z.F.EncMapBoolUint64V(yy2233, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolUintptr == nil { + r.EncodeNil() + } else { + yym2236 := z.EncBinary() + _ = yym2236 + if false { + } else { + z.F.EncMapBoolUintptrV(x.FMapBoolUintptr, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapBoolUintptr`) + r.WriteMapElemValue() + if x.FMapBoolUintptr == nil { + r.EncodeNil() + } else { + yym2237 := z.EncBinary() + _ = yym2237 + 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 + yym2240 := z.EncBinary() + _ = yym2240 + if false { + } else { + z.F.EncMapBoolUintptrV(yy2239, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapBoolUintptr`) + r.WriteMapElemValue() + if yyn2238 { + r.EncodeNil() + } else { + if x.FptrMapBoolUintptr == nil { + r.EncodeNil() + } else { + yy2241 := *x.FptrMapBoolUintptr + yym2242 := z.EncBinary() + _ = yym2242 + if false { + } else { + z.F.EncMapBoolUintptrV(yy2241, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolInt == nil { + r.EncodeNil() + } else { + yym2244 := z.EncBinary() + _ = yym2244 + if false { + } else { + z.F.EncMapBoolIntV(x.FMapBoolInt, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapBoolInt`) + r.WriteMapElemValue() + if x.FMapBoolInt == nil { + r.EncodeNil() + } else { + yym2245 := z.EncBinary() + _ = yym2245 + 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 + yym2248 := z.EncBinary() + _ = yym2248 + if false { + } else { + z.F.EncMapBoolIntV(yy2247, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapBoolInt`) + r.WriteMapElemValue() + if yyn2246 { + r.EncodeNil() + } else { + if x.FptrMapBoolInt == nil { + r.EncodeNil() + } else { + yy2249 := *x.FptrMapBoolInt + yym2250 := z.EncBinary() + _ = yym2250 + if false { + } else { + z.F.EncMapBoolIntV(yy2249, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolInt8 == nil { + r.EncodeNil() + } else { + yym2252 := z.EncBinary() + _ = yym2252 + if false { + } else { + z.F.EncMapBoolInt8V(x.FMapBoolInt8, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapBoolInt8`) + r.WriteMapElemValue() + if x.FMapBoolInt8 == nil { + r.EncodeNil() + } else { + yym2253 := z.EncBinary() + _ = yym2253 + 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 + yym2256 := z.EncBinary() + _ = yym2256 + if false { + } else { + z.F.EncMapBoolInt8V(yy2255, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapBoolInt8`) + r.WriteMapElemValue() + if yyn2254 { + r.EncodeNil() + } else { + if x.FptrMapBoolInt8 == nil { + r.EncodeNil() + } else { + yy2257 := *x.FptrMapBoolInt8 + yym2258 := z.EncBinary() + _ = yym2258 + if false { + } else { + z.F.EncMapBoolInt8V(yy2257, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolInt16 == nil { + r.EncodeNil() + } else { + yym2260 := z.EncBinary() + _ = yym2260 + if false { + } else { + z.F.EncMapBoolInt16V(x.FMapBoolInt16, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapBoolInt16`) + r.WriteMapElemValue() + if x.FMapBoolInt16 == nil { + r.EncodeNil() + } else { + yym2261 := z.EncBinary() + _ = yym2261 + 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 + yym2264 := z.EncBinary() + _ = yym2264 + if false { + } else { + z.F.EncMapBoolInt16V(yy2263, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapBoolInt16`) + r.WriteMapElemValue() + if yyn2262 { + r.EncodeNil() + } else { + if x.FptrMapBoolInt16 == nil { + r.EncodeNil() + } else { + yy2265 := *x.FptrMapBoolInt16 + yym2266 := z.EncBinary() + _ = yym2266 + if false { + } else { + z.F.EncMapBoolInt16V(yy2265, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolInt32 == nil { + r.EncodeNil() + } else { + yym2268 := z.EncBinary() + _ = yym2268 + if false { + } else { + z.F.EncMapBoolInt32V(x.FMapBoolInt32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapBoolInt32`) + r.WriteMapElemValue() + if x.FMapBoolInt32 == nil { + r.EncodeNil() + } else { + yym2269 := z.EncBinary() + _ = yym2269 + 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 + yym2272 := z.EncBinary() + _ = yym2272 + if false { + } else { + z.F.EncMapBoolInt32V(yy2271, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapBoolInt32`) + r.WriteMapElemValue() + if yyn2270 { + r.EncodeNil() + } else { + if x.FptrMapBoolInt32 == nil { + r.EncodeNil() + } else { + yy2273 := *x.FptrMapBoolInt32 + yym2274 := z.EncBinary() + _ = yym2274 + if false { + } else { + z.F.EncMapBoolInt32V(yy2273, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolInt64 == nil { + r.EncodeNil() + } else { + yym2276 := z.EncBinary() + _ = yym2276 + if false { + } else { + z.F.EncMapBoolInt64V(x.FMapBoolInt64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapBoolInt64`) + r.WriteMapElemValue() + if x.FMapBoolInt64 == nil { + r.EncodeNil() + } else { + yym2277 := z.EncBinary() + _ = yym2277 + 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 + yym2280 := z.EncBinary() + _ = yym2280 + if false { + } else { + z.F.EncMapBoolInt64V(yy2279, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapBoolInt64`) + r.WriteMapElemValue() + if yyn2278 { + r.EncodeNil() + } else { + if x.FptrMapBoolInt64 == nil { + r.EncodeNil() + } else { + yy2281 := *x.FptrMapBoolInt64 + yym2282 := z.EncBinary() + _ = yym2282 + if false { + } else { + z.F.EncMapBoolInt64V(yy2281, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolFloat32 == nil { + r.EncodeNil() + } else { + yym2284 := z.EncBinary() + _ = yym2284 + if false { + } else { + z.F.EncMapBoolFloat32V(x.FMapBoolFloat32, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapBoolFloat32`) + r.WriteMapElemValue() + if x.FMapBoolFloat32 == nil { + r.EncodeNil() + } else { + yym2285 := z.EncBinary() + _ = yym2285 + 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 + yym2288 := z.EncBinary() + _ = yym2288 + if false { + } else { + z.F.EncMapBoolFloat32V(yy2287, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapBoolFloat32`) + r.WriteMapElemValue() + if yyn2286 { + r.EncodeNil() + } else { + if x.FptrMapBoolFloat32 == nil { + r.EncodeNil() + } else { + yy2289 := *x.FptrMapBoolFloat32 + yym2290 := z.EncBinary() + _ = yym2290 + if false { + } else { + z.F.EncMapBoolFloat32V(yy2289, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolFloat64 == nil { + r.EncodeNil() + } else { + yym2292 := z.EncBinary() + _ = yym2292 + if false { + } else { + z.F.EncMapBoolFloat64V(x.FMapBoolFloat64, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapBoolFloat64`) + r.WriteMapElemValue() + if x.FMapBoolFloat64 == nil { + r.EncodeNil() + } else { + yym2293 := z.EncBinary() + _ = yym2293 + 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 + yym2296 := z.EncBinary() + _ = yym2296 + if false { + } else { + z.F.EncMapBoolFloat64V(yy2295, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapBoolFloat64`) + r.WriteMapElemValue() + if yyn2294 { + r.EncodeNil() + } else { + if x.FptrMapBoolFloat64 == nil { + r.EncodeNil() + } else { + yy2297 := *x.FptrMapBoolFloat64 + yym2298 := z.EncBinary() + _ = yym2298 + if false { + } else { + z.F.EncMapBoolFloat64V(yy2297, e) + } + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.FMapBoolBool == nil { + r.EncodeNil() + } else { + yym2300 := z.EncBinary() + _ = yym2300 + if false { + } else { + z.F.EncMapBoolBoolV(x.FMapBoolBool, e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FMapBoolBool`) + r.WriteMapElemValue() + if x.FMapBoolBool == nil { + r.EncodeNil() + } else { + yym2301 := z.EncBinary() + _ = yym2301 + 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 + yym2304 := z.EncBinary() + _ = yym2304 + if false { + } else { + z.F.EncMapBoolBoolV(yy2303, e) + } + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `FptrMapBoolBool`) + r.WriteMapElemValue() + if yyn2302 { + r.EncodeNil() + } else { + if x.FptrMapBoolBool == nil { + r.EncodeNil() + } else { + yy2305 := *x.FptrMapBoolBool + yym2306 := z.EncBinary() + _ = yym2306 + 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 + yym1 := z.DecBinary() + _ = yym1 + 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 yys3Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3Slc + var yyhl3 bool = l >= 0 + for yyj3 := 0; ; yyj3++ { + if yyhl3 { + if yyj3 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + r.ReadMapElemKey() + yys3Slc = r.DecodeStringAsBytes() + yys3 := string(yys3Slc) + r.ReadMapElemValue() + switch yys3 { + case "FIntf": + if r.TryDecodeAsNil() { + x.FIntf = nil + } else { + yyv4 := &x.FIntf + yym5 := z.DecBinary() + _ = yym5 + if false { + } else { + z.DecFallback(yyv4, true) + } + } + case "FptrIntf": + if x.FptrIntf == nil { + x.FptrIntf = new(interface{}) + } + if r.TryDecodeAsNil() { + if x.FptrIntf != nil { + x.FptrIntf = nil + } + } else { + if x.FptrIntf == nil { + x.FptrIntf = new(interface{}) + } + yym7 := z.DecBinary() + _ = yym7 + if false { + } else { + z.DecFallback(x.FptrIntf, true) + } + } + case "FString": + if r.TryDecodeAsNil() { + x.FString = "" + } else { + yyv8 := &x.FString + yym9 := z.DecBinary() + _ = yym9 + if false { + } else { + *((*string)(yyv8)) = r.DecodeString() + } + } + case "FptrString": + if x.FptrString == nil { + x.FptrString = new(string) + } + if r.TryDecodeAsNil() { + if x.FptrString != nil { + x.FptrString = nil + } + } else { + if x.FptrString == nil { + x.FptrString = new(string) + } + yym11 := z.DecBinary() + _ = yym11 + if false { + } else { + *((*string)(x.FptrString)) = r.DecodeString() + } + } + case "FFloat32": + if r.TryDecodeAsNil() { + x.FFloat32 = 0 + } else { + yyv12 := &x.FFloat32 + yym13 := z.DecBinary() + _ = yym13 + if false { + } else { + *((*float32)(yyv12)) = float32(r.DecodeFloat(true)) + } + } + case "FptrFloat32": + if x.FptrFloat32 == nil { + x.FptrFloat32 = new(float32) + } + if r.TryDecodeAsNil() { + if x.FptrFloat32 != nil { + x.FptrFloat32 = nil + } + } else { + if x.FptrFloat32 == nil { + x.FptrFloat32 = new(float32) + } + yym15 := z.DecBinary() + _ = yym15 + if false { + } else { + *((*float32)(x.FptrFloat32)) = float32(r.DecodeFloat(true)) + } + } + case "FFloat64": + if r.TryDecodeAsNil() { + x.FFloat64 = 0 + } else { + yyv16 := &x.FFloat64 + yym17 := z.DecBinary() + _ = yym17 + if false { + } else { + *((*float64)(yyv16)) = float64(r.DecodeFloat(false)) + } + } + case "FptrFloat64": + if x.FptrFloat64 == nil { + x.FptrFloat64 = new(float64) + } + if r.TryDecodeAsNil() { + if x.FptrFloat64 != nil { + x.FptrFloat64 = nil + } + } else { + if x.FptrFloat64 == nil { + x.FptrFloat64 = new(float64) + } + yym19 := z.DecBinary() + _ = yym19 + if false { + } else { + *((*float64)(x.FptrFloat64)) = float64(r.DecodeFloat(false)) + } + } + case "FUint": + if r.TryDecodeAsNil() { + x.FUint = 0 + } else { + yyv20 := &x.FUint + yym21 := z.DecBinary() + _ = yym21 + if false { + } else { + *((*uint)(yyv20)) = uint(r.DecodeUint(codecSelferBitsize19781)) + } + } + case "FptrUint": + if x.FptrUint == nil { + x.FptrUint = new(uint) + } + if r.TryDecodeAsNil() { + if x.FptrUint != nil { + x.FptrUint = nil + } + } else { + if x.FptrUint == nil { + x.FptrUint = new(uint) + } + yym23 := z.DecBinary() + _ = yym23 + if false { + } else { + *((*uint)(x.FptrUint)) = uint(r.DecodeUint(codecSelferBitsize19781)) + } + } + case "FUint8": + if r.TryDecodeAsNil() { + x.FUint8 = 0 + } else { + yyv24 := &x.FUint8 + yym25 := z.DecBinary() + _ = yym25 + if false { + } else { + *((*uint8)(yyv24)) = uint8(r.DecodeUint(8)) + } + } + case "FptrUint8": + if x.FptrUint8 == nil { + x.FptrUint8 = new(uint8) + } + if r.TryDecodeAsNil() { + if x.FptrUint8 != nil { + x.FptrUint8 = nil + } + } else { + if x.FptrUint8 == nil { + x.FptrUint8 = new(uint8) + } + yym27 := z.DecBinary() + _ = yym27 + if false { + } else { + *((*uint8)(x.FptrUint8)) = uint8(r.DecodeUint(8)) + } + } + case "FUint16": + if r.TryDecodeAsNil() { + x.FUint16 = 0 + } else { + yyv28 := &x.FUint16 + yym29 := z.DecBinary() + _ = yym29 + if false { + } else { + *((*uint16)(yyv28)) = uint16(r.DecodeUint(16)) + } + } + case "FptrUint16": + if x.FptrUint16 == nil { + x.FptrUint16 = new(uint16) + } + if r.TryDecodeAsNil() { + if x.FptrUint16 != nil { + x.FptrUint16 = nil + } + } else { + if x.FptrUint16 == nil { + x.FptrUint16 = new(uint16) + } + yym31 := z.DecBinary() + _ = yym31 + if false { + } else { + *((*uint16)(x.FptrUint16)) = uint16(r.DecodeUint(16)) + } + } + case "FUint32": + if r.TryDecodeAsNil() { + x.FUint32 = 0 + } else { + yyv32 := &x.FUint32 + yym33 := z.DecBinary() + _ = yym33 + if false { + } else { + *((*uint32)(yyv32)) = uint32(r.DecodeUint(32)) + } + } + case "FptrUint32": + if x.FptrUint32 == nil { + x.FptrUint32 = new(uint32) + } + if r.TryDecodeAsNil() { + if x.FptrUint32 != nil { + x.FptrUint32 = nil + } + } else { + if x.FptrUint32 == nil { + x.FptrUint32 = new(uint32) + } + yym35 := z.DecBinary() + _ = yym35 + if false { + } else { + *((*uint32)(x.FptrUint32)) = uint32(r.DecodeUint(32)) + } + } + case "FUint64": + if r.TryDecodeAsNil() { + x.FUint64 = 0 + } else { + yyv36 := &x.FUint64 + yym37 := z.DecBinary() + _ = yym37 + if false { + } else { + *((*uint64)(yyv36)) = uint64(r.DecodeUint(64)) + } + } + case "FptrUint64": + if x.FptrUint64 == nil { + x.FptrUint64 = new(uint64) + } + if r.TryDecodeAsNil() { + if x.FptrUint64 != nil { + x.FptrUint64 = nil + } + } else { + if x.FptrUint64 == nil { + x.FptrUint64 = new(uint64) + } + yym39 := z.DecBinary() + _ = yym39 + if false { + } else { + *((*uint64)(x.FptrUint64)) = uint64(r.DecodeUint(64)) + } + } + case "FUintptr": + if r.TryDecodeAsNil() { + x.FUintptr = 0 + } else { + yyv40 := &x.FUintptr + yym41 := z.DecBinary() + _ = yym41 + if false { + } else { + *((*uintptr)(yyv40)) = uintptr(r.DecodeUint(codecSelferBitsize19781)) + } + } + case "FptrUintptr": + if x.FptrUintptr == nil { + x.FptrUintptr = new(uintptr) + } + if r.TryDecodeAsNil() { + if x.FptrUintptr != nil { + x.FptrUintptr = nil + } + } else { + if x.FptrUintptr == nil { + x.FptrUintptr = new(uintptr) + } + yym43 := z.DecBinary() + _ = yym43 + if false { + } else { + *((*uintptr)(x.FptrUintptr)) = uintptr(r.DecodeUint(codecSelferBitsize19781)) + } + } + case "FInt": + if r.TryDecodeAsNil() { + x.FInt = 0 + } else { + yyv44 := &x.FInt + yym45 := z.DecBinary() + _ = yym45 + if false { + } else { + *((*int)(yyv44)) = int(r.DecodeInt(codecSelferBitsize19781)) + } + } + case "FptrInt": + if x.FptrInt == nil { + x.FptrInt = new(int) + } + if r.TryDecodeAsNil() { + if x.FptrInt != nil { + x.FptrInt = nil + } + } else { + if x.FptrInt == nil { + x.FptrInt = new(int) + } + yym47 := z.DecBinary() + _ = yym47 + if false { + } else { + *((*int)(x.FptrInt)) = int(r.DecodeInt(codecSelferBitsize19781)) + } + } + case "FInt8": + if r.TryDecodeAsNil() { + x.FInt8 = 0 + } else { + yyv48 := &x.FInt8 + yym49 := z.DecBinary() + _ = yym49 + if false { + } else { + *((*int8)(yyv48)) = int8(r.DecodeInt(8)) + } + } + case "FptrInt8": + if x.FptrInt8 == nil { + x.FptrInt8 = new(int8) + } + if r.TryDecodeAsNil() { + if x.FptrInt8 != nil { + x.FptrInt8 = nil + } + } else { + if x.FptrInt8 == nil { + x.FptrInt8 = new(int8) + } + yym51 := z.DecBinary() + _ = yym51 + if false { + } else { + *((*int8)(x.FptrInt8)) = int8(r.DecodeInt(8)) + } + } + case "FInt16": + if r.TryDecodeAsNil() { + x.FInt16 = 0 + } else { + yyv52 := &x.FInt16 + yym53 := z.DecBinary() + _ = yym53 + if false { + } else { + *((*int16)(yyv52)) = int16(r.DecodeInt(16)) + } + } + case "FptrInt16": + if x.FptrInt16 == nil { + x.FptrInt16 = new(int16) + } + if r.TryDecodeAsNil() { + if x.FptrInt16 != nil { + x.FptrInt16 = nil + } + } else { + if x.FptrInt16 == nil { + x.FptrInt16 = new(int16) + } + yym55 := z.DecBinary() + _ = yym55 + if false { + } else { + *((*int16)(x.FptrInt16)) = int16(r.DecodeInt(16)) + } + } + case "FInt32": + if r.TryDecodeAsNil() { + x.FInt32 = 0 + } else { + yyv56 := &x.FInt32 + yym57 := z.DecBinary() + _ = yym57 + if false { + } else { + *((*int32)(yyv56)) = int32(r.DecodeInt(32)) + } + } + case "FptrInt32": + if x.FptrInt32 == nil { + x.FptrInt32 = new(int32) + } + if r.TryDecodeAsNil() { + if x.FptrInt32 != nil { + x.FptrInt32 = nil + } + } else { + if x.FptrInt32 == nil { + x.FptrInt32 = new(int32) + } + yym59 := z.DecBinary() + _ = yym59 + if false { + } else { + *((*int32)(x.FptrInt32)) = int32(r.DecodeInt(32)) + } + } + case "FInt64": + if r.TryDecodeAsNil() { + x.FInt64 = 0 + } else { + yyv60 := &x.FInt64 + yym61 := z.DecBinary() + _ = yym61 + if false { + } else { + *((*int64)(yyv60)) = int64(r.DecodeInt(64)) + } + } + case "FptrInt64": + if x.FptrInt64 == nil { + x.FptrInt64 = new(int64) + } + if r.TryDecodeAsNil() { + if x.FptrInt64 != nil { + x.FptrInt64 = nil + } + } else { + if x.FptrInt64 == nil { + x.FptrInt64 = new(int64) + } + yym63 := z.DecBinary() + _ = yym63 + if false { + } else { + *((*int64)(x.FptrInt64)) = int64(r.DecodeInt(64)) + } + } + case "FBool": + if r.TryDecodeAsNil() { + x.FBool = false + } else { + yyv64 := &x.FBool + yym65 := z.DecBinary() + _ = yym65 + if false { + } else { + *((*bool)(yyv64)) = r.DecodeBool() + } + } + case "FptrBool": + if x.FptrBool == nil { + x.FptrBool = new(bool) + } + if r.TryDecodeAsNil() { + if x.FptrBool != nil { + x.FptrBool = nil + } + } else { + if x.FptrBool == nil { + x.FptrBool = new(bool) + } + yym67 := z.DecBinary() + _ = yym67 + if false { + } else { + *((*bool)(x.FptrBool)) = r.DecodeBool() + } + } + case "FSliceIntf": + if r.TryDecodeAsNil() { + x.FSliceIntf = nil + } else { + yyv68 := &x.FSliceIntf + yym69 := z.DecBinary() + _ = yym69 + if false { + } else { + z.F.DecSliceIntfX(yyv68, d) + } + } + case "FptrSliceIntf": + if x.FptrSliceIntf == nil { + x.FptrSliceIntf = new([]interface{}) + } + if r.TryDecodeAsNil() { + if x.FptrSliceIntf != nil { + x.FptrSliceIntf = nil + } + } else { + if x.FptrSliceIntf == nil { + x.FptrSliceIntf = new([]interface{}) + } + yym71 := z.DecBinary() + _ = yym71 + if false { + } else { + z.F.DecSliceIntfX(x.FptrSliceIntf, d) + } + } + case "FSliceString": + if r.TryDecodeAsNil() { + x.FSliceString = nil + } else { + yyv72 := &x.FSliceString + yym73 := z.DecBinary() + _ = yym73 + if false { + } else { + z.F.DecSliceStringX(yyv72, d) + } + } + case "FptrSliceString": + if x.FptrSliceString == nil { + x.FptrSliceString = new([]string) + } + if r.TryDecodeAsNil() { + if x.FptrSliceString != nil { + x.FptrSliceString = nil + } + } else { + if x.FptrSliceString == nil { + x.FptrSliceString = new([]string) + } + yym75 := z.DecBinary() + _ = yym75 + if false { + } else { + z.F.DecSliceStringX(x.FptrSliceString, d) + } + } + case "FSliceFloat32": + if r.TryDecodeAsNil() { + x.FSliceFloat32 = nil + } else { + yyv76 := &x.FSliceFloat32 + yym77 := z.DecBinary() + _ = yym77 + if false { + } else { + z.F.DecSliceFloat32X(yyv76, d) + } + } + case "FptrSliceFloat32": + if x.FptrSliceFloat32 == nil { + x.FptrSliceFloat32 = new([]float32) + } + if r.TryDecodeAsNil() { + if x.FptrSliceFloat32 != nil { + x.FptrSliceFloat32 = nil + } + } else { + if x.FptrSliceFloat32 == nil { + x.FptrSliceFloat32 = new([]float32) + } + yym79 := z.DecBinary() + _ = yym79 + if false { + } else { + z.F.DecSliceFloat32X(x.FptrSliceFloat32, d) + } + } + case "FSliceFloat64": + if r.TryDecodeAsNil() { + x.FSliceFloat64 = nil + } else { + yyv80 := &x.FSliceFloat64 + yym81 := z.DecBinary() + _ = yym81 + if false { + } else { + z.F.DecSliceFloat64X(yyv80, d) + } + } + case "FptrSliceFloat64": + if x.FptrSliceFloat64 == nil { + x.FptrSliceFloat64 = new([]float64) + } + if r.TryDecodeAsNil() { + if x.FptrSliceFloat64 != nil { + x.FptrSliceFloat64 = nil + } + } else { + if x.FptrSliceFloat64 == nil { + x.FptrSliceFloat64 = new([]float64) + } + yym83 := z.DecBinary() + _ = yym83 + if false { + } else { + z.F.DecSliceFloat64X(x.FptrSliceFloat64, d) + } + } + case "FSliceUint": + if r.TryDecodeAsNil() { + x.FSliceUint = nil + } else { + yyv84 := &x.FSliceUint + yym85 := z.DecBinary() + _ = yym85 + if false { + } else { + z.F.DecSliceUintX(yyv84, d) + } + } + case "FptrSliceUint": + if x.FptrSliceUint == nil { + x.FptrSliceUint = new([]uint) + } + if r.TryDecodeAsNil() { + if x.FptrSliceUint != nil { + x.FptrSliceUint = nil + } + } else { + if x.FptrSliceUint == nil { + x.FptrSliceUint = new([]uint) + } + yym87 := z.DecBinary() + _ = yym87 + if false { + } else { + z.F.DecSliceUintX(x.FptrSliceUint, d) + } + } + case "FSliceUint8": + if r.TryDecodeAsNil() { + x.FSliceUint8 = nil + } else { + yyv88 := &x.FSliceUint8 + yym89 := z.DecBinary() + _ = yym89 + if false { + } else { + *yyv88 = r.DecodeBytes(*(*[]byte)(yyv88), false) + } + } + case "FptrSliceUint8": + if x.FptrSliceUint8 == nil { + x.FptrSliceUint8 = new([]uint8) + } + if r.TryDecodeAsNil() { + if x.FptrSliceUint8 != nil { + x.FptrSliceUint8 = nil + } + } else { + if x.FptrSliceUint8 == nil { + x.FptrSliceUint8 = new([]uint8) + } + yym91 := z.DecBinary() + _ = yym91 + if false { + } else { + *x.FptrSliceUint8 = r.DecodeBytes(*(*[]byte)(x.FptrSliceUint8), false) + } + } + case "FSliceUint16": + if r.TryDecodeAsNil() { + x.FSliceUint16 = nil + } else { + yyv92 := &x.FSliceUint16 + yym93 := z.DecBinary() + _ = yym93 + if false { + } else { + z.F.DecSliceUint16X(yyv92, d) + } + } + case "FptrSliceUint16": + if x.FptrSliceUint16 == nil { + x.FptrSliceUint16 = new([]uint16) + } + if r.TryDecodeAsNil() { + if x.FptrSliceUint16 != nil { + x.FptrSliceUint16 = nil + } + } else { + if x.FptrSliceUint16 == nil { + x.FptrSliceUint16 = new([]uint16) + } + yym95 := z.DecBinary() + _ = yym95 + if false { + } else { + z.F.DecSliceUint16X(x.FptrSliceUint16, d) + } + } + case "FSliceUint32": + if r.TryDecodeAsNil() { + x.FSliceUint32 = nil + } else { + yyv96 := &x.FSliceUint32 + yym97 := z.DecBinary() + _ = yym97 + if false { + } else { + z.F.DecSliceUint32X(yyv96, d) + } + } + case "FptrSliceUint32": + if x.FptrSliceUint32 == nil { + x.FptrSliceUint32 = new([]uint32) + } + if r.TryDecodeAsNil() { + if x.FptrSliceUint32 != nil { + x.FptrSliceUint32 = nil + } + } else { + if x.FptrSliceUint32 == nil { + x.FptrSliceUint32 = new([]uint32) + } + yym99 := z.DecBinary() + _ = yym99 + if false { + } else { + z.F.DecSliceUint32X(x.FptrSliceUint32, d) + } + } + case "FSliceUint64": + if r.TryDecodeAsNil() { + x.FSliceUint64 = nil + } else { + yyv100 := &x.FSliceUint64 + yym101 := z.DecBinary() + _ = yym101 + if false { + } else { + z.F.DecSliceUint64X(yyv100, d) + } + } + case "FptrSliceUint64": + if x.FptrSliceUint64 == nil { + x.FptrSliceUint64 = new([]uint64) + } + if r.TryDecodeAsNil() { + if x.FptrSliceUint64 != nil { + x.FptrSliceUint64 = nil + } + } else { + if x.FptrSliceUint64 == nil { + x.FptrSliceUint64 = new([]uint64) + } + yym103 := z.DecBinary() + _ = yym103 + if false { + } else { + z.F.DecSliceUint64X(x.FptrSliceUint64, d) + } + } + case "FSliceUintptr": + if r.TryDecodeAsNil() { + x.FSliceUintptr = nil + } else { + yyv104 := &x.FSliceUintptr + yym105 := z.DecBinary() + _ = yym105 + if false { + } else { + z.F.DecSliceUintptrX(yyv104, d) + } + } + case "FptrSliceUintptr": + if x.FptrSliceUintptr == nil { + x.FptrSliceUintptr = new([]uintptr) + } + if r.TryDecodeAsNil() { + if x.FptrSliceUintptr != nil { + x.FptrSliceUintptr = nil + } + } else { + if x.FptrSliceUintptr == nil { + x.FptrSliceUintptr = new([]uintptr) + } + yym107 := z.DecBinary() + _ = yym107 + if false { + } else { + z.F.DecSliceUintptrX(x.FptrSliceUintptr, d) + } + } + case "FSliceInt": + if r.TryDecodeAsNil() { + x.FSliceInt = nil + } else { + yyv108 := &x.FSliceInt + yym109 := z.DecBinary() + _ = yym109 + if false { + } else { + z.F.DecSliceIntX(yyv108, d) + } + } + case "FptrSliceInt": + if x.FptrSliceInt == nil { + x.FptrSliceInt = new([]int) + } + if r.TryDecodeAsNil() { + if x.FptrSliceInt != nil { + x.FptrSliceInt = nil + } + } else { + if x.FptrSliceInt == nil { + x.FptrSliceInt = new([]int) + } + yym111 := z.DecBinary() + _ = yym111 + if false { + } else { + z.F.DecSliceIntX(x.FptrSliceInt, d) + } + } + case "FSliceInt8": + if r.TryDecodeAsNil() { + x.FSliceInt8 = nil + } else { + yyv112 := &x.FSliceInt8 + yym113 := z.DecBinary() + _ = yym113 + if false { + } else { + z.F.DecSliceInt8X(yyv112, d) + } + } + case "FptrSliceInt8": + if x.FptrSliceInt8 == nil { + x.FptrSliceInt8 = new([]int8) + } + if r.TryDecodeAsNil() { + if x.FptrSliceInt8 != nil { + x.FptrSliceInt8 = nil + } + } else { + if x.FptrSliceInt8 == nil { + x.FptrSliceInt8 = new([]int8) + } + yym115 := z.DecBinary() + _ = yym115 + if false { + } else { + z.F.DecSliceInt8X(x.FptrSliceInt8, d) + } + } + case "FSliceInt16": + if r.TryDecodeAsNil() { + x.FSliceInt16 = nil + } else { + yyv116 := &x.FSliceInt16 + yym117 := z.DecBinary() + _ = yym117 + if false { + } else { + z.F.DecSliceInt16X(yyv116, d) + } + } + case "FptrSliceInt16": + if x.FptrSliceInt16 == nil { + x.FptrSliceInt16 = new([]int16) + } + if r.TryDecodeAsNil() { + if x.FptrSliceInt16 != nil { + x.FptrSliceInt16 = nil + } + } else { + if x.FptrSliceInt16 == nil { + x.FptrSliceInt16 = new([]int16) + } + yym119 := z.DecBinary() + _ = yym119 + if false { + } else { + z.F.DecSliceInt16X(x.FptrSliceInt16, d) + } + } + case "FSliceInt32": + if r.TryDecodeAsNil() { + x.FSliceInt32 = nil + } else { + yyv120 := &x.FSliceInt32 + yym121 := z.DecBinary() + _ = yym121 + if false { + } else { + z.F.DecSliceInt32X(yyv120, d) + } + } + case "FptrSliceInt32": + if x.FptrSliceInt32 == nil { + x.FptrSliceInt32 = new([]int32) + } + if r.TryDecodeAsNil() { + if x.FptrSliceInt32 != nil { + x.FptrSliceInt32 = nil + } + } else { + if x.FptrSliceInt32 == nil { + x.FptrSliceInt32 = new([]int32) + } + yym123 := z.DecBinary() + _ = yym123 + if false { + } else { + z.F.DecSliceInt32X(x.FptrSliceInt32, d) + } + } + case "FSliceInt64": + if r.TryDecodeAsNil() { + x.FSliceInt64 = nil + } else { + yyv124 := &x.FSliceInt64 + yym125 := z.DecBinary() + _ = yym125 + if false { + } else { + z.F.DecSliceInt64X(yyv124, d) + } + } + case "FptrSliceInt64": + if x.FptrSliceInt64 == nil { + x.FptrSliceInt64 = new([]int64) + } + if r.TryDecodeAsNil() { + if x.FptrSliceInt64 != nil { + x.FptrSliceInt64 = nil + } + } else { + if x.FptrSliceInt64 == nil { + x.FptrSliceInt64 = new([]int64) + } + yym127 := z.DecBinary() + _ = yym127 + if false { + } else { + z.F.DecSliceInt64X(x.FptrSliceInt64, d) + } + } + case "FSliceBool": + if r.TryDecodeAsNil() { + x.FSliceBool = nil + } else { + yyv128 := &x.FSliceBool + yym129 := z.DecBinary() + _ = yym129 + if false { + } else { + z.F.DecSliceBoolX(yyv128, d) + } + } + case "FptrSliceBool": + if x.FptrSliceBool == nil { + x.FptrSliceBool = new([]bool) + } + if r.TryDecodeAsNil() { + if x.FptrSliceBool != nil { + x.FptrSliceBool = nil + } + } else { + if x.FptrSliceBool == nil { + x.FptrSliceBool = new([]bool) + } + yym131 := z.DecBinary() + _ = yym131 + if false { + } else { + z.F.DecSliceBoolX(x.FptrSliceBool, d) + } + } + case "FMapIntfIntf": + if r.TryDecodeAsNil() { + x.FMapIntfIntf = nil + } else { + yyv132 := &x.FMapIntfIntf + yym133 := z.DecBinary() + _ = yym133 + if false { + } else { + z.F.DecMapIntfIntfX(yyv132, d) + } + } + case "FptrMapIntfIntf": + if x.FptrMapIntfIntf == nil { + x.FptrMapIntfIntf = new(map[interface{}]interface{}) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntfIntf != nil { + x.FptrMapIntfIntf = nil + } + } else { + if x.FptrMapIntfIntf == nil { + x.FptrMapIntfIntf = new(map[interface{}]interface{}) + } + yym135 := z.DecBinary() + _ = yym135 + if false { + } else { + z.F.DecMapIntfIntfX(x.FptrMapIntfIntf, d) + } + } + case "FMapIntfString": + if r.TryDecodeAsNil() { + x.FMapIntfString = nil + } else { + yyv136 := &x.FMapIntfString + yym137 := z.DecBinary() + _ = yym137 + if false { + } else { + z.F.DecMapIntfStringX(yyv136, d) + } + } + case "FptrMapIntfString": + if x.FptrMapIntfString == nil { + x.FptrMapIntfString = new(map[interface{}]string) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntfString != nil { + x.FptrMapIntfString = nil + } + } else { + if x.FptrMapIntfString == nil { + x.FptrMapIntfString = new(map[interface{}]string) + } + yym139 := z.DecBinary() + _ = yym139 + if false { + } else { + z.F.DecMapIntfStringX(x.FptrMapIntfString, d) + } + } + case "FMapIntfUint": + if r.TryDecodeAsNil() { + x.FMapIntfUint = nil + } else { + yyv140 := &x.FMapIntfUint + yym141 := z.DecBinary() + _ = yym141 + if false { + } else { + z.F.DecMapIntfUintX(yyv140, d) + } + } + case "FptrMapIntfUint": + if x.FptrMapIntfUint == nil { + x.FptrMapIntfUint = new(map[interface{}]uint) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntfUint != nil { + x.FptrMapIntfUint = nil + } + } else { + if x.FptrMapIntfUint == nil { + x.FptrMapIntfUint = new(map[interface{}]uint) + } + yym143 := z.DecBinary() + _ = yym143 + if false { + } else { + z.F.DecMapIntfUintX(x.FptrMapIntfUint, d) + } + } + case "FMapIntfUint8": + if r.TryDecodeAsNil() { + x.FMapIntfUint8 = nil + } else { + yyv144 := &x.FMapIntfUint8 + yym145 := z.DecBinary() + _ = yym145 + if false { + } else { + z.F.DecMapIntfUint8X(yyv144, d) + } + } + case "FptrMapIntfUint8": + if x.FptrMapIntfUint8 == nil { + x.FptrMapIntfUint8 = new(map[interface{}]uint8) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntfUint8 != nil { + x.FptrMapIntfUint8 = nil + } + } else { + if x.FptrMapIntfUint8 == nil { + x.FptrMapIntfUint8 = new(map[interface{}]uint8) + } + yym147 := z.DecBinary() + _ = yym147 + if false { + } else { + z.F.DecMapIntfUint8X(x.FptrMapIntfUint8, d) + } + } + case "FMapIntfUint16": + if r.TryDecodeAsNil() { + x.FMapIntfUint16 = nil + } else { + yyv148 := &x.FMapIntfUint16 + yym149 := z.DecBinary() + _ = yym149 + if false { + } else { + z.F.DecMapIntfUint16X(yyv148, d) + } + } + case "FptrMapIntfUint16": + if x.FptrMapIntfUint16 == nil { + x.FptrMapIntfUint16 = new(map[interface{}]uint16) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntfUint16 != nil { + x.FptrMapIntfUint16 = nil + } + } else { + if x.FptrMapIntfUint16 == nil { + x.FptrMapIntfUint16 = new(map[interface{}]uint16) + } + yym151 := z.DecBinary() + _ = yym151 + if false { + } else { + z.F.DecMapIntfUint16X(x.FptrMapIntfUint16, d) + } + } + case "FMapIntfUint32": + if r.TryDecodeAsNil() { + x.FMapIntfUint32 = nil + } else { + yyv152 := &x.FMapIntfUint32 + yym153 := z.DecBinary() + _ = yym153 + if false { + } else { + z.F.DecMapIntfUint32X(yyv152, d) + } + } + case "FptrMapIntfUint32": + if x.FptrMapIntfUint32 == nil { + x.FptrMapIntfUint32 = new(map[interface{}]uint32) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntfUint32 != nil { + x.FptrMapIntfUint32 = nil + } + } else { + if x.FptrMapIntfUint32 == nil { + x.FptrMapIntfUint32 = new(map[interface{}]uint32) + } + yym155 := z.DecBinary() + _ = yym155 + if false { + } else { + z.F.DecMapIntfUint32X(x.FptrMapIntfUint32, d) + } + } + case "FMapIntfUint64": + if r.TryDecodeAsNil() { + x.FMapIntfUint64 = nil + } else { + yyv156 := &x.FMapIntfUint64 + yym157 := z.DecBinary() + _ = yym157 + if false { + } else { + z.F.DecMapIntfUint64X(yyv156, d) + } + } + case "FptrMapIntfUint64": + if x.FptrMapIntfUint64 == nil { + x.FptrMapIntfUint64 = new(map[interface{}]uint64) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntfUint64 != nil { + x.FptrMapIntfUint64 = nil + } + } else { + if x.FptrMapIntfUint64 == nil { + x.FptrMapIntfUint64 = new(map[interface{}]uint64) + } + yym159 := z.DecBinary() + _ = yym159 + if false { + } else { + z.F.DecMapIntfUint64X(x.FptrMapIntfUint64, d) + } + } + case "FMapIntfUintptr": + if r.TryDecodeAsNil() { + x.FMapIntfUintptr = nil + } else { + yyv160 := &x.FMapIntfUintptr + yym161 := z.DecBinary() + _ = yym161 + if false { + } else { + z.F.DecMapIntfUintptrX(yyv160, d) + } + } + case "FptrMapIntfUintptr": + if x.FptrMapIntfUintptr == nil { + x.FptrMapIntfUintptr = new(map[interface{}]uintptr) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntfUintptr != nil { + x.FptrMapIntfUintptr = nil + } + } else { + if x.FptrMapIntfUintptr == nil { + x.FptrMapIntfUintptr = new(map[interface{}]uintptr) + } + yym163 := z.DecBinary() + _ = yym163 + if false { + } else { + z.F.DecMapIntfUintptrX(x.FptrMapIntfUintptr, d) + } + } + case "FMapIntfInt": + if r.TryDecodeAsNil() { + x.FMapIntfInt = nil + } else { + yyv164 := &x.FMapIntfInt + yym165 := z.DecBinary() + _ = yym165 + if false { + } else { + z.F.DecMapIntfIntX(yyv164, d) + } + } + case "FptrMapIntfInt": + if x.FptrMapIntfInt == nil { + x.FptrMapIntfInt = new(map[interface{}]int) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntfInt != nil { + x.FptrMapIntfInt = nil + } + } else { + if x.FptrMapIntfInt == nil { + x.FptrMapIntfInt = new(map[interface{}]int) + } + yym167 := z.DecBinary() + _ = yym167 + if false { + } else { + z.F.DecMapIntfIntX(x.FptrMapIntfInt, d) + } + } + case "FMapIntfInt8": + if r.TryDecodeAsNil() { + x.FMapIntfInt8 = nil + } else { + yyv168 := &x.FMapIntfInt8 + yym169 := z.DecBinary() + _ = yym169 + if false { + } else { + z.F.DecMapIntfInt8X(yyv168, d) + } + } + case "FptrMapIntfInt8": + if x.FptrMapIntfInt8 == nil { + x.FptrMapIntfInt8 = new(map[interface{}]int8) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntfInt8 != nil { + x.FptrMapIntfInt8 = nil + } + } else { + if x.FptrMapIntfInt8 == nil { + x.FptrMapIntfInt8 = new(map[interface{}]int8) + } + yym171 := z.DecBinary() + _ = yym171 + if false { + } else { + z.F.DecMapIntfInt8X(x.FptrMapIntfInt8, d) + } + } + case "FMapIntfInt16": + if r.TryDecodeAsNil() { + x.FMapIntfInt16 = nil + } else { + yyv172 := &x.FMapIntfInt16 + yym173 := z.DecBinary() + _ = yym173 + if false { + } else { + z.F.DecMapIntfInt16X(yyv172, d) + } + } + case "FptrMapIntfInt16": + if x.FptrMapIntfInt16 == nil { + x.FptrMapIntfInt16 = new(map[interface{}]int16) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntfInt16 != nil { + x.FptrMapIntfInt16 = nil + } + } else { + if x.FptrMapIntfInt16 == nil { + x.FptrMapIntfInt16 = new(map[interface{}]int16) + } + yym175 := z.DecBinary() + _ = yym175 + if false { + } else { + z.F.DecMapIntfInt16X(x.FptrMapIntfInt16, d) + } + } + case "FMapIntfInt32": + if r.TryDecodeAsNil() { + x.FMapIntfInt32 = nil + } else { + yyv176 := &x.FMapIntfInt32 + yym177 := z.DecBinary() + _ = yym177 + if false { + } else { + z.F.DecMapIntfInt32X(yyv176, d) + } + } + case "FptrMapIntfInt32": + if x.FptrMapIntfInt32 == nil { + x.FptrMapIntfInt32 = new(map[interface{}]int32) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntfInt32 != nil { + x.FptrMapIntfInt32 = nil + } + } else { + if x.FptrMapIntfInt32 == nil { + x.FptrMapIntfInt32 = new(map[interface{}]int32) + } + yym179 := z.DecBinary() + _ = yym179 + if false { + } else { + z.F.DecMapIntfInt32X(x.FptrMapIntfInt32, d) + } + } + case "FMapIntfInt64": + if r.TryDecodeAsNil() { + x.FMapIntfInt64 = nil + } else { + yyv180 := &x.FMapIntfInt64 + yym181 := z.DecBinary() + _ = yym181 + if false { + } else { + z.F.DecMapIntfInt64X(yyv180, d) + } + } + case "FptrMapIntfInt64": + if x.FptrMapIntfInt64 == nil { + x.FptrMapIntfInt64 = new(map[interface{}]int64) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntfInt64 != nil { + x.FptrMapIntfInt64 = nil + } + } else { + if x.FptrMapIntfInt64 == nil { + x.FptrMapIntfInt64 = new(map[interface{}]int64) + } + yym183 := z.DecBinary() + _ = yym183 + if false { + } else { + z.F.DecMapIntfInt64X(x.FptrMapIntfInt64, d) + } + } + case "FMapIntfFloat32": + if r.TryDecodeAsNil() { + x.FMapIntfFloat32 = nil + } else { + yyv184 := &x.FMapIntfFloat32 + yym185 := z.DecBinary() + _ = yym185 + if false { + } else { + z.F.DecMapIntfFloat32X(yyv184, d) + } + } + case "FptrMapIntfFloat32": + if x.FptrMapIntfFloat32 == nil { + x.FptrMapIntfFloat32 = new(map[interface{}]float32) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntfFloat32 != nil { + x.FptrMapIntfFloat32 = nil + } + } else { + if x.FptrMapIntfFloat32 == nil { + x.FptrMapIntfFloat32 = new(map[interface{}]float32) + } + yym187 := z.DecBinary() + _ = yym187 + if false { + } else { + z.F.DecMapIntfFloat32X(x.FptrMapIntfFloat32, d) + } + } + case "FMapIntfFloat64": + if r.TryDecodeAsNil() { + x.FMapIntfFloat64 = nil + } else { + yyv188 := &x.FMapIntfFloat64 + yym189 := z.DecBinary() + _ = yym189 + if false { + } else { + z.F.DecMapIntfFloat64X(yyv188, d) + } + } + case "FptrMapIntfFloat64": + if x.FptrMapIntfFloat64 == nil { + x.FptrMapIntfFloat64 = new(map[interface{}]float64) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntfFloat64 != nil { + x.FptrMapIntfFloat64 = nil + } + } else { + if x.FptrMapIntfFloat64 == nil { + x.FptrMapIntfFloat64 = new(map[interface{}]float64) + } + yym191 := z.DecBinary() + _ = yym191 + if false { + } else { + z.F.DecMapIntfFloat64X(x.FptrMapIntfFloat64, d) + } + } + case "FMapIntfBool": + if r.TryDecodeAsNil() { + x.FMapIntfBool = nil + } else { + yyv192 := &x.FMapIntfBool + yym193 := z.DecBinary() + _ = yym193 + if false { + } else { + z.F.DecMapIntfBoolX(yyv192, d) + } + } + case "FptrMapIntfBool": + if x.FptrMapIntfBool == nil { + x.FptrMapIntfBool = new(map[interface{}]bool) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntfBool != nil { + x.FptrMapIntfBool = nil + } + } else { + if x.FptrMapIntfBool == nil { + x.FptrMapIntfBool = new(map[interface{}]bool) + } + yym195 := z.DecBinary() + _ = yym195 + if false { + } else { + z.F.DecMapIntfBoolX(x.FptrMapIntfBool, d) + } + } + case "FMapStringIntf": + if r.TryDecodeAsNil() { + x.FMapStringIntf = nil + } else { + yyv196 := &x.FMapStringIntf + yym197 := z.DecBinary() + _ = yym197 + if false { + } else { + z.F.DecMapStringIntfX(yyv196, d) + } + } + case "FptrMapStringIntf": + if x.FptrMapStringIntf == nil { + x.FptrMapStringIntf = new(map[string]interface{}) + } + if r.TryDecodeAsNil() { + if x.FptrMapStringIntf != nil { + x.FptrMapStringIntf = nil + } + } else { + if x.FptrMapStringIntf == nil { + x.FptrMapStringIntf = new(map[string]interface{}) + } + yym199 := z.DecBinary() + _ = yym199 + if false { + } else { + z.F.DecMapStringIntfX(x.FptrMapStringIntf, d) + } + } + case "FMapStringString": + if r.TryDecodeAsNil() { + x.FMapStringString = nil + } else { + yyv200 := &x.FMapStringString + yym201 := z.DecBinary() + _ = yym201 + if false { + } else { + z.F.DecMapStringStringX(yyv200, d) + } + } + case "FptrMapStringString": + if x.FptrMapStringString == nil { + x.FptrMapStringString = new(map[string]string) + } + if r.TryDecodeAsNil() { + if x.FptrMapStringString != nil { + x.FptrMapStringString = nil + } + } else { + if x.FptrMapStringString == nil { + x.FptrMapStringString = new(map[string]string) + } + yym203 := z.DecBinary() + _ = yym203 + if false { + } else { + z.F.DecMapStringStringX(x.FptrMapStringString, d) + } + } + case "FMapStringUint": + if r.TryDecodeAsNil() { + x.FMapStringUint = nil + } else { + yyv204 := &x.FMapStringUint + yym205 := z.DecBinary() + _ = yym205 + if false { + } else { + z.F.DecMapStringUintX(yyv204, d) + } + } + case "FptrMapStringUint": + if x.FptrMapStringUint == nil { + x.FptrMapStringUint = new(map[string]uint) + } + if r.TryDecodeAsNil() { + if x.FptrMapStringUint != nil { + x.FptrMapStringUint = nil + } + } else { + if x.FptrMapStringUint == nil { + x.FptrMapStringUint = new(map[string]uint) + } + yym207 := z.DecBinary() + _ = yym207 + if false { + } else { + z.F.DecMapStringUintX(x.FptrMapStringUint, d) + } + } + case "FMapStringUint8": + if r.TryDecodeAsNil() { + x.FMapStringUint8 = nil + } else { + yyv208 := &x.FMapStringUint8 + yym209 := z.DecBinary() + _ = yym209 + if false { + } else { + z.F.DecMapStringUint8X(yyv208, d) + } + } + case "FptrMapStringUint8": + if x.FptrMapStringUint8 == nil { + x.FptrMapStringUint8 = new(map[string]uint8) + } + if r.TryDecodeAsNil() { + if x.FptrMapStringUint8 != nil { + x.FptrMapStringUint8 = nil + } + } else { + if x.FptrMapStringUint8 == nil { + x.FptrMapStringUint8 = new(map[string]uint8) + } + yym211 := z.DecBinary() + _ = yym211 + if false { + } else { + z.F.DecMapStringUint8X(x.FptrMapStringUint8, d) + } + } + case "FMapStringUint16": + if r.TryDecodeAsNil() { + x.FMapStringUint16 = nil + } else { + yyv212 := &x.FMapStringUint16 + yym213 := z.DecBinary() + _ = yym213 + if false { + } else { + z.F.DecMapStringUint16X(yyv212, d) + } + } + case "FptrMapStringUint16": + if x.FptrMapStringUint16 == nil { + x.FptrMapStringUint16 = new(map[string]uint16) + } + if r.TryDecodeAsNil() { + if x.FptrMapStringUint16 != nil { + x.FptrMapStringUint16 = nil + } + } else { + if x.FptrMapStringUint16 == nil { + x.FptrMapStringUint16 = new(map[string]uint16) + } + yym215 := z.DecBinary() + _ = yym215 + if false { + } else { + z.F.DecMapStringUint16X(x.FptrMapStringUint16, d) + } + } + case "FMapStringUint32": + if r.TryDecodeAsNil() { + x.FMapStringUint32 = nil + } else { + yyv216 := &x.FMapStringUint32 + yym217 := z.DecBinary() + _ = yym217 + if false { + } else { + z.F.DecMapStringUint32X(yyv216, d) + } + } + case "FptrMapStringUint32": + if x.FptrMapStringUint32 == nil { + x.FptrMapStringUint32 = new(map[string]uint32) + } + if r.TryDecodeAsNil() { + if x.FptrMapStringUint32 != nil { + x.FptrMapStringUint32 = nil + } + } else { + if x.FptrMapStringUint32 == nil { + x.FptrMapStringUint32 = new(map[string]uint32) + } + yym219 := z.DecBinary() + _ = yym219 + if false { + } else { + z.F.DecMapStringUint32X(x.FptrMapStringUint32, d) + } + } + case "FMapStringUint64": + if r.TryDecodeAsNil() { + x.FMapStringUint64 = nil + } else { + yyv220 := &x.FMapStringUint64 + yym221 := z.DecBinary() + _ = yym221 + if false { + } else { + z.F.DecMapStringUint64X(yyv220, d) + } + } + case "FptrMapStringUint64": + if x.FptrMapStringUint64 == nil { + x.FptrMapStringUint64 = new(map[string]uint64) + } + if r.TryDecodeAsNil() { + if x.FptrMapStringUint64 != nil { + x.FptrMapStringUint64 = nil + } + } else { + if x.FptrMapStringUint64 == nil { + x.FptrMapStringUint64 = new(map[string]uint64) + } + yym223 := z.DecBinary() + _ = yym223 + if false { + } else { + z.F.DecMapStringUint64X(x.FptrMapStringUint64, d) + } + } + case "FMapStringUintptr": + if r.TryDecodeAsNil() { + x.FMapStringUintptr = nil + } else { + yyv224 := &x.FMapStringUintptr + yym225 := z.DecBinary() + _ = yym225 + if false { + } else { + z.F.DecMapStringUintptrX(yyv224, d) + } + } + case "FptrMapStringUintptr": + if x.FptrMapStringUintptr == nil { + x.FptrMapStringUintptr = new(map[string]uintptr) + } + if r.TryDecodeAsNil() { + if x.FptrMapStringUintptr != nil { + x.FptrMapStringUintptr = nil + } + } else { + if x.FptrMapStringUintptr == nil { + x.FptrMapStringUintptr = new(map[string]uintptr) + } + yym227 := z.DecBinary() + _ = yym227 + if false { + } else { + z.F.DecMapStringUintptrX(x.FptrMapStringUintptr, d) + } + } + case "FMapStringInt": + if r.TryDecodeAsNil() { + x.FMapStringInt = nil + } else { + yyv228 := &x.FMapStringInt + yym229 := z.DecBinary() + _ = yym229 + if false { + } else { + z.F.DecMapStringIntX(yyv228, d) + } + } + case "FptrMapStringInt": + if x.FptrMapStringInt == nil { + x.FptrMapStringInt = new(map[string]int) + } + if r.TryDecodeAsNil() { + if x.FptrMapStringInt != nil { + x.FptrMapStringInt = nil + } + } else { + if x.FptrMapStringInt == nil { + x.FptrMapStringInt = new(map[string]int) + } + yym231 := z.DecBinary() + _ = yym231 + if false { + } else { + z.F.DecMapStringIntX(x.FptrMapStringInt, d) + } + } + case "FMapStringInt8": + if r.TryDecodeAsNil() { + x.FMapStringInt8 = nil + } else { + yyv232 := &x.FMapStringInt8 + yym233 := z.DecBinary() + _ = yym233 + if false { + } else { + z.F.DecMapStringInt8X(yyv232, d) + } + } + case "FptrMapStringInt8": + if x.FptrMapStringInt8 == nil { + x.FptrMapStringInt8 = new(map[string]int8) + } + if r.TryDecodeAsNil() { + if x.FptrMapStringInt8 != nil { + x.FptrMapStringInt8 = nil + } + } else { + if x.FptrMapStringInt8 == nil { + x.FptrMapStringInt8 = new(map[string]int8) + } + yym235 := z.DecBinary() + _ = yym235 + if false { + } else { + z.F.DecMapStringInt8X(x.FptrMapStringInt8, d) + } + } + case "FMapStringInt16": + if r.TryDecodeAsNil() { + x.FMapStringInt16 = nil + } else { + yyv236 := &x.FMapStringInt16 + yym237 := z.DecBinary() + _ = yym237 + if false { + } else { + z.F.DecMapStringInt16X(yyv236, d) + } + } + case "FptrMapStringInt16": + if x.FptrMapStringInt16 == nil { + x.FptrMapStringInt16 = new(map[string]int16) + } + if r.TryDecodeAsNil() { + if x.FptrMapStringInt16 != nil { + x.FptrMapStringInt16 = nil + } + } else { + if x.FptrMapStringInt16 == nil { + x.FptrMapStringInt16 = new(map[string]int16) + } + yym239 := z.DecBinary() + _ = yym239 + if false { + } else { + z.F.DecMapStringInt16X(x.FptrMapStringInt16, d) + } + } + case "FMapStringInt32": + if r.TryDecodeAsNil() { + x.FMapStringInt32 = nil + } else { + yyv240 := &x.FMapStringInt32 + yym241 := z.DecBinary() + _ = yym241 + if false { + } else { + z.F.DecMapStringInt32X(yyv240, d) + } + } + case "FptrMapStringInt32": + if x.FptrMapStringInt32 == nil { + x.FptrMapStringInt32 = new(map[string]int32) + } + if r.TryDecodeAsNil() { + if x.FptrMapStringInt32 != nil { + x.FptrMapStringInt32 = nil + } + } else { + if x.FptrMapStringInt32 == nil { + x.FptrMapStringInt32 = new(map[string]int32) + } + yym243 := z.DecBinary() + _ = yym243 + if false { + } else { + z.F.DecMapStringInt32X(x.FptrMapStringInt32, d) + } + } + case "FMapStringInt64": + if r.TryDecodeAsNil() { + x.FMapStringInt64 = nil + } else { + yyv244 := &x.FMapStringInt64 + yym245 := z.DecBinary() + _ = yym245 + if false { + } else { + z.F.DecMapStringInt64X(yyv244, d) + } + } + case "FptrMapStringInt64": + if x.FptrMapStringInt64 == nil { + x.FptrMapStringInt64 = new(map[string]int64) + } + if r.TryDecodeAsNil() { + if x.FptrMapStringInt64 != nil { + x.FptrMapStringInt64 = nil + } + } else { + if x.FptrMapStringInt64 == nil { + x.FptrMapStringInt64 = new(map[string]int64) + } + yym247 := z.DecBinary() + _ = yym247 + if false { + } else { + z.F.DecMapStringInt64X(x.FptrMapStringInt64, d) + } + } + case "FMapStringFloat32": + if r.TryDecodeAsNil() { + x.FMapStringFloat32 = nil + } else { + yyv248 := &x.FMapStringFloat32 + yym249 := z.DecBinary() + _ = yym249 + if false { + } else { + z.F.DecMapStringFloat32X(yyv248, d) + } + } + case "FptrMapStringFloat32": + if x.FptrMapStringFloat32 == nil { + x.FptrMapStringFloat32 = new(map[string]float32) + } + if r.TryDecodeAsNil() { + if x.FptrMapStringFloat32 != nil { + x.FptrMapStringFloat32 = nil + } + } else { + if x.FptrMapStringFloat32 == nil { + x.FptrMapStringFloat32 = new(map[string]float32) + } + yym251 := z.DecBinary() + _ = yym251 + if false { + } else { + z.F.DecMapStringFloat32X(x.FptrMapStringFloat32, d) + } + } + case "FMapStringFloat64": + if r.TryDecodeAsNil() { + x.FMapStringFloat64 = nil + } else { + yyv252 := &x.FMapStringFloat64 + yym253 := z.DecBinary() + _ = yym253 + if false { + } else { + z.F.DecMapStringFloat64X(yyv252, d) + } + } + case "FptrMapStringFloat64": + if x.FptrMapStringFloat64 == nil { + x.FptrMapStringFloat64 = new(map[string]float64) + } + if r.TryDecodeAsNil() { + if x.FptrMapStringFloat64 != nil { + x.FptrMapStringFloat64 = nil + } + } else { + if x.FptrMapStringFloat64 == nil { + x.FptrMapStringFloat64 = new(map[string]float64) + } + yym255 := z.DecBinary() + _ = yym255 + if false { + } else { + z.F.DecMapStringFloat64X(x.FptrMapStringFloat64, d) + } + } + case "FMapStringBool": + if r.TryDecodeAsNil() { + x.FMapStringBool = nil + } else { + yyv256 := &x.FMapStringBool + yym257 := z.DecBinary() + _ = yym257 + if false { + } else { + z.F.DecMapStringBoolX(yyv256, d) + } + } + case "FptrMapStringBool": + if x.FptrMapStringBool == nil { + x.FptrMapStringBool = new(map[string]bool) + } + if r.TryDecodeAsNil() { + if x.FptrMapStringBool != nil { + x.FptrMapStringBool = nil + } + } else { + if x.FptrMapStringBool == nil { + x.FptrMapStringBool = new(map[string]bool) + } + yym259 := z.DecBinary() + _ = yym259 + if false { + } else { + z.F.DecMapStringBoolX(x.FptrMapStringBool, d) + } + } + case "FMapFloat32Intf": + if r.TryDecodeAsNil() { + x.FMapFloat32Intf = nil + } else { + yyv260 := &x.FMapFloat32Intf + yym261 := z.DecBinary() + _ = yym261 + if false { + } else { + z.F.DecMapFloat32IntfX(yyv260, d) + } + } + case "FptrMapFloat32Intf": + if x.FptrMapFloat32Intf == nil { + x.FptrMapFloat32Intf = new(map[float32]interface{}) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Intf != nil { + x.FptrMapFloat32Intf = nil + } + } else { + if x.FptrMapFloat32Intf == nil { + x.FptrMapFloat32Intf = new(map[float32]interface{}) + } + yym263 := z.DecBinary() + _ = yym263 + if false { + } else { + z.F.DecMapFloat32IntfX(x.FptrMapFloat32Intf, d) + } + } + case "FMapFloat32String": + if r.TryDecodeAsNil() { + x.FMapFloat32String = nil + } else { + yyv264 := &x.FMapFloat32String + yym265 := z.DecBinary() + _ = yym265 + if false { + } else { + z.F.DecMapFloat32StringX(yyv264, d) + } + } + case "FptrMapFloat32String": + if x.FptrMapFloat32String == nil { + x.FptrMapFloat32String = new(map[float32]string) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat32String != nil { + x.FptrMapFloat32String = nil + } + } else { + if x.FptrMapFloat32String == nil { + x.FptrMapFloat32String = new(map[float32]string) + } + yym267 := z.DecBinary() + _ = yym267 + if false { + } else { + z.F.DecMapFloat32StringX(x.FptrMapFloat32String, d) + } + } + case "FMapFloat32Uint": + if r.TryDecodeAsNil() { + x.FMapFloat32Uint = nil + } else { + yyv268 := &x.FMapFloat32Uint + yym269 := z.DecBinary() + _ = yym269 + if false { + } else { + z.F.DecMapFloat32UintX(yyv268, d) + } + } + case "FptrMapFloat32Uint": + if x.FptrMapFloat32Uint == nil { + x.FptrMapFloat32Uint = new(map[float32]uint) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Uint != nil { + x.FptrMapFloat32Uint = nil + } + } else { + if x.FptrMapFloat32Uint == nil { + x.FptrMapFloat32Uint = new(map[float32]uint) + } + yym271 := z.DecBinary() + _ = yym271 + if false { + } else { + z.F.DecMapFloat32UintX(x.FptrMapFloat32Uint, d) + } + } + case "FMapFloat32Uint8": + if r.TryDecodeAsNil() { + x.FMapFloat32Uint8 = nil + } else { + yyv272 := &x.FMapFloat32Uint8 + yym273 := z.DecBinary() + _ = yym273 + if false { + } else { + z.F.DecMapFloat32Uint8X(yyv272, d) + } + } + case "FptrMapFloat32Uint8": + if x.FptrMapFloat32Uint8 == nil { + x.FptrMapFloat32Uint8 = new(map[float32]uint8) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Uint8 != nil { + x.FptrMapFloat32Uint8 = nil + } + } else { + if x.FptrMapFloat32Uint8 == nil { + x.FptrMapFloat32Uint8 = new(map[float32]uint8) + } + yym275 := z.DecBinary() + _ = yym275 + if false { + } else { + z.F.DecMapFloat32Uint8X(x.FptrMapFloat32Uint8, d) + } + } + case "FMapFloat32Uint16": + if r.TryDecodeAsNil() { + x.FMapFloat32Uint16 = nil + } else { + yyv276 := &x.FMapFloat32Uint16 + yym277 := z.DecBinary() + _ = yym277 + if false { + } else { + z.F.DecMapFloat32Uint16X(yyv276, d) + } + } + case "FptrMapFloat32Uint16": + if x.FptrMapFloat32Uint16 == nil { + x.FptrMapFloat32Uint16 = new(map[float32]uint16) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Uint16 != nil { + x.FptrMapFloat32Uint16 = nil + } + } else { + if x.FptrMapFloat32Uint16 == nil { + x.FptrMapFloat32Uint16 = new(map[float32]uint16) + } + yym279 := z.DecBinary() + _ = yym279 + if false { + } else { + z.F.DecMapFloat32Uint16X(x.FptrMapFloat32Uint16, d) + } + } + case "FMapFloat32Uint32": + if r.TryDecodeAsNil() { + x.FMapFloat32Uint32 = nil + } else { + yyv280 := &x.FMapFloat32Uint32 + yym281 := z.DecBinary() + _ = yym281 + if false { + } else { + z.F.DecMapFloat32Uint32X(yyv280, d) + } + } + case "FptrMapFloat32Uint32": + if x.FptrMapFloat32Uint32 == nil { + x.FptrMapFloat32Uint32 = new(map[float32]uint32) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Uint32 != nil { + x.FptrMapFloat32Uint32 = nil + } + } else { + if x.FptrMapFloat32Uint32 == nil { + x.FptrMapFloat32Uint32 = new(map[float32]uint32) + } + yym283 := z.DecBinary() + _ = yym283 + if false { + } else { + z.F.DecMapFloat32Uint32X(x.FptrMapFloat32Uint32, d) + } + } + case "FMapFloat32Uint64": + if r.TryDecodeAsNil() { + x.FMapFloat32Uint64 = nil + } else { + yyv284 := &x.FMapFloat32Uint64 + yym285 := z.DecBinary() + _ = yym285 + if false { + } else { + z.F.DecMapFloat32Uint64X(yyv284, d) + } + } + case "FptrMapFloat32Uint64": + if x.FptrMapFloat32Uint64 == nil { + x.FptrMapFloat32Uint64 = new(map[float32]uint64) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Uint64 != nil { + x.FptrMapFloat32Uint64 = nil + } + } else { + if x.FptrMapFloat32Uint64 == nil { + x.FptrMapFloat32Uint64 = new(map[float32]uint64) + } + yym287 := z.DecBinary() + _ = yym287 + if false { + } else { + z.F.DecMapFloat32Uint64X(x.FptrMapFloat32Uint64, d) + } + } + case "FMapFloat32Uintptr": + if r.TryDecodeAsNil() { + x.FMapFloat32Uintptr = nil + } else { + yyv288 := &x.FMapFloat32Uintptr + yym289 := z.DecBinary() + _ = yym289 + if false { + } else { + z.F.DecMapFloat32UintptrX(yyv288, d) + } + } + case "FptrMapFloat32Uintptr": + if x.FptrMapFloat32Uintptr == nil { + x.FptrMapFloat32Uintptr = new(map[float32]uintptr) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Uintptr != nil { + x.FptrMapFloat32Uintptr = nil + } + } else { + if x.FptrMapFloat32Uintptr == nil { + x.FptrMapFloat32Uintptr = new(map[float32]uintptr) + } + yym291 := z.DecBinary() + _ = yym291 + if false { + } else { + z.F.DecMapFloat32UintptrX(x.FptrMapFloat32Uintptr, d) + } + } + case "FMapFloat32Int": + if r.TryDecodeAsNil() { + x.FMapFloat32Int = nil + } else { + yyv292 := &x.FMapFloat32Int + yym293 := z.DecBinary() + _ = yym293 + if false { + } else { + z.F.DecMapFloat32IntX(yyv292, d) + } + } + case "FptrMapFloat32Int": + if x.FptrMapFloat32Int == nil { + x.FptrMapFloat32Int = new(map[float32]int) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Int != nil { + x.FptrMapFloat32Int = nil + } + } else { + if x.FptrMapFloat32Int == nil { + x.FptrMapFloat32Int = new(map[float32]int) + } + yym295 := z.DecBinary() + _ = yym295 + if false { + } else { + z.F.DecMapFloat32IntX(x.FptrMapFloat32Int, d) + } + } + case "FMapFloat32Int8": + if r.TryDecodeAsNil() { + x.FMapFloat32Int8 = nil + } else { + yyv296 := &x.FMapFloat32Int8 + yym297 := z.DecBinary() + _ = yym297 + if false { + } else { + z.F.DecMapFloat32Int8X(yyv296, d) + } + } + case "FptrMapFloat32Int8": + if x.FptrMapFloat32Int8 == nil { + x.FptrMapFloat32Int8 = new(map[float32]int8) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Int8 != nil { + x.FptrMapFloat32Int8 = nil + } + } else { + if x.FptrMapFloat32Int8 == nil { + x.FptrMapFloat32Int8 = new(map[float32]int8) + } + yym299 := z.DecBinary() + _ = yym299 + if false { + } else { + z.F.DecMapFloat32Int8X(x.FptrMapFloat32Int8, d) + } + } + case "FMapFloat32Int16": + if r.TryDecodeAsNil() { + x.FMapFloat32Int16 = nil + } else { + yyv300 := &x.FMapFloat32Int16 + yym301 := z.DecBinary() + _ = yym301 + if false { + } else { + z.F.DecMapFloat32Int16X(yyv300, d) + } + } + case "FptrMapFloat32Int16": + if x.FptrMapFloat32Int16 == nil { + x.FptrMapFloat32Int16 = new(map[float32]int16) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Int16 != nil { + x.FptrMapFloat32Int16 = nil + } + } else { + if x.FptrMapFloat32Int16 == nil { + x.FptrMapFloat32Int16 = new(map[float32]int16) + } + yym303 := z.DecBinary() + _ = yym303 + if false { + } else { + z.F.DecMapFloat32Int16X(x.FptrMapFloat32Int16, d) + } + } + case "FMapFloat32Int32": + if r.TryDecodeAsNil() { + x.FMapFloat32Int32 = nil + } else { + yyv304 := &x.FMapFloat32Int32 + yym305 := z.DecBinary() + _ = yym305 + if false { + } else { + z.F.DecMapFloat32Int32X(yyv304, d) + } + } + case "FptrMapFloat32Int32": + if x.FptrMapFloat32Int32 == nil { + x.FptrMapFloat32Int32 = new(map[float32]int32) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Int32 != nil { + x.FptrMapFloat32Int32 = nil + } + } else { + if x.FptrMapFloat32Int32 == nil { + x.FptrMapFloat32Int32 = new(map[float32]int32) + } + yym307 := z.DecBinary() + _ = yym307 + if false { + } else { + z.F.DecMapFloat32Int32X(x.FptrMapFloat32Int32, d) + } + } + case "FMapFloat32Int64": + if r.TryDecodeAsNil() { + x.FMapFloat32Int64 = nil + } else { + yyv308 := &x.FMapFloat32Int64 + yym309 := z.DecBinary() + _ = yym309 + if false { + } else { + z.F.DecMapFloat32Int64X(yyv308, d) + } + } + case "FptrMapFloat32Int64": + if x.FptrMapFloat32Int64 == nil { + x.FptrMapFloat32Int64 = new(map[float32]int64) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Int64 != nil { + x.FptrMapFloat32Int64 = nil + } + } else { + if x.FptrMapFloat32Int64 == nil { + x.FptrMapFloat32Int64 = new(map[float32]int64) + } + yym311 := z.DecBinary() + _ = yym311 + if false { + } else { + z.F.DecMapFloat32Int64X(x.FptrMapFloat32Int64, d) + } + } + case "FMapFloat32Float32": + if r.TryDecodeAsNil() { + x.FMapFloat32Float32 = nil + } else { + yyv312 := &x.FMapFloat32Float32 + yym313 := z.DecBinary() + _ = yym313 + if false { + } else { + z.F.DecMapFloat32Float32X(yyv312, d) + } + } + case "FptrMapFloat32Float32": + if x.FptrMapFloat32Float32 == nil { + x.FptrMapFloat32Float32 = new(map[float32]float32) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Float32 != nil { + x.FptrMapFloat32Float32 = nil + } + } else { + if x.FptrMapFloat32Float32 == nil { + x.FptrMapFloat32Float32 = new(map[float32]float32) + } + yym315 := z.DecBinary() + _ = yym315 + if false { + } else { + z.F.DecMapFloat32Float32X(x.FptrMapFloat32Float32, d) + } + } + case "FMapFloat32Float64": + if r.TryDecodeAsNil() { + x.FMapFloat32Float64 = nil + } else { + yyv316 := &x.FMapFloat32Float64 + yym317 := z.DecBinary() + _ = yym317 + if false { + } else { + z.F.DecMapFloat32Float64X(yyv316, d) + } + } + case "FptrMapFloat32Float64": + if x.FptrMapFloat32Float64 == nil { + x.FptrMapFloat32Float64 = new(map[float32]float64) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Float64 != nil { + x.FptrMapFloat32Float64 = nil + } + } else { + if x.FptrMapFloat32Float64 == nil { + x.FptrMapFloat32Float64 = new(map[float32]float64) + } + yym319 := z.DecBinary() + _ = yym319 + if false { + } else { + z.F.DecMapFloat32Float64X(x.FptrMapFloat32Float64, d) + } + } + case "FMapFloat32Bool": + if r.TryDecodeAsNil() { + x.FMapFloat32Bool = nil + } else { + yyv320 := &x.FMapFloat32Bool + yym321 := z.DecBinary() + _ = yym321 + if false { + } else { + z.F.DecMapFloat32BoolX(yyv320, d) + } + } + case "FptrMapFloat32Bool": + if x.FptrMapFloat32Bool == nil { + x.FptrMapFloat32Bool = new(map[float32]bool) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Bool != nil { + x.FptrMapFloat32Bool = nil + } + } else { + if x.FptrMapFloat32Bool == nil { + x.FptrMapFloat32Bool = new(map[float32]bool) + } + yym323 := z.DecBinary() + _ = yym323 + if false { + } else { + z.F.DecMapFloat32BoolX(x.FptrMapFloat32Bool, d) + } + } + case "FMapFloat64Intf": + if r.TryDecodeAsNil() { + x.FMapFloat64Intf = nil + } else { + yyv324 := &x.FMapFloat64Intf + yym325 := z.DecBinary() + _ = yym325 + if false { + } else { + z.F.DecMapFloat64IntfX(yyv324, d) + } + } + case "FptrMapFloat64Intf": + if x.FptrMapFloat64Intf == nil { + x.FptrMapFloat64Intf = new(map[float64]interface{}) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Intf != nil { + x.FptrMapFloat64Intf = nil + } + } else { + if x.FptrMapFloat64Intf == nil { + x.FptrMapFloat64Intf = new(map[float64]interface{}) + } + yym327 := z.DecBinary() + _ = yym327 + if false { + } else { + z.F.DecMapFloat64IntfX(x.FptrMapFloat64Intf, d) + } + } + case "FMapFloat64String": + if r.TryDecodeAsNil() { + x.FMapFloat64String = nil + } else { + yyv328 := &x.FMapFloat64String + yym329 := z.DecBinary() + _ = yym329 + if false { + } else { + z.F.DecMapFloat64StringX(yyv328, d) + } + } + case "FptrMapFloat64String": + if x.FptrMapFloat64String == nil { + x.FptrMapFloat64String = new(map[float64]string) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat64String != nil { + x.FptrMapFloat64String = nil + } + } else { + if x.FptrMapFloat64String == nil { + x.FptrMapFloat64String = new(map[float64]string) + } + yym331 := z.DecBinary() + _ = yym331 + if false { + } else { + z.F.DecMapFloat64StringX(x.FptrMapFloat64String, d) + } + } + case "FMapFloat64Uint": + if r.TryDecodeAsNil() { + x.FMapFloat64Uint = nil + } else { + yyv332 := &x.FMapFloat64Uint + yym333 := z.DecBinary() + _ = yym333 + if false { + } else { + z.F.DecMapFloat64UintX(yyv332, d) + } + } + case "FptrMapFloat64Uint": + if x.FptrMapFloat64Uint == nil { + x.FptrMapFloat64Uint = new(map[float64]uint) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Uint != nil { + x.FptrMapFloat64Uint = nil + } + } else { + if x.FptrMapFloat64Uint == nil { + x.FptrMapFloat64Uint = new(map[float64]uint) + } + yym335 := z.DecBinary() + _ = yym335 + if false { + } else { + z.F.DecMapFloat64UintX(x.FptrMapFloat64Uint, d) + } + } + case "FMapFloat64Uint8": + if r.TryDecodeAsNil() { + x.FMapFloat64Uint8 = nil + } else { + yyv336 := &x.FMapFloat64Uint8 + yym337 := z.DecBinary() + _ = yym337 + if false { + } else { + z.F.DecMapFloat64Uint8X(yyv336, d) + } + } + case "FptrMapFloat64Uint8": + if x.FptrMapFloat64Uint8 == nil { + x.FptrMapFloat64Uint8 = new(map[float64]uint8) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Uint8 != nil { + x.FptrMapFloat64Uint8 = nil + } + } else { + if x.FptrMapFloat64Uint8 == nil { + x.FptrMapFloat64Uint8 = new(map[float64]uint8) + } + yym339 := z.DecBinary() + _ = yym339 + if false { + } else { + z.F.DecMapFloat64Uint8X(x.FptrMapFloat64Uint8, d) + } + } + case "FMapFloat64Uint16": + if r.TryDecodeAsNil() { + x.FMapFloat64Uint16 = nil + } else { + yyv340 := &x.FMapFloat64Uint16 + yym341 := z.DecBinary() + _ = yym341 + if false { + } else { + z.F.DecMapFloat64Uint16X(yyv340, d) + } + } + case "FptrMapFloat64Uint16": + if x.FptrMapFloat64Uint16 == nil { + x.FptrMapFloat64Uint16 = new(map[float64]uint16) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Uint16 != nil { + x.FptrMapFloat64Uint16 = nil + } + } else { + if x.FptrMapFloat64Uint16 == nil { + x.FptrMapFloat64Uint16 = new(map[float64]uint16) + } + yym343 := z.DecBinary() + _ = yym343 + if false { + } else { + z.F.DecMapFloat64Uint16X(x.FptrMapFloat64Uint16, d) + } + } + case "FMapFloat64Uint32": + if r.TryDecodeAsNil() { + x.FMapFloat64Uint32 = nil + } else { + yyv344 := &x.FMapFloat64Uint32 + yym345 := z.DecBinary() + _ = yym345 + if false { + } else { + z.F.DecMapFloat64Uint32X(yyv344, d) + } + } + case "FptrMapFloat64Uint32": + if x.FptrMapFloat64Uint32 == nil { + x.FptrMapFloat64Uint32 = new(map[float64]uint32) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Uint32 != nil { + x.FptrMapFloat64Uint32 = nil + } + } else { + if x.FptrMapFloat64Uint32 == nil { + x.FptrMapFloat64Uint32 = new(map[float64]uint32) + } + yym347 := z.DecBinary() + _ = yym347 + if false { + } else { + z.F.DecMapFloat64Uint32X(x.FptrMapFloat64Uint32, d) + } + } + case "FMapFloat64Uint64": + if r.TryDecodeAsNil() { + x.FMapFloat64Uint64 = nil + } else { + yyv348 := &x.FMapFloat64Uint64 + yym349 := z.DecBinary() + _ = yym349 + if false { + } else { + z.F.DecMapFloat64Uint64X(yyv348, d) + } + } + case "FptrMapFloat64Uint64": + if x.FptrMapFloat64Uint64 == nil { + x.FptrMapFloat64Uint64 = new(map[float64]uint64) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Uint64 != nil { + x.FptrMapFloat64Uint64 = nil + } + } else { + if x.FptrMapFloat64Uint64 == nil { + x.FptrMapFloat64Uint64 = new(map[float64]uint64) + } + yym351 := z.DecBinary() + _ = yym351 + if false { + } else { + z.F.DecMapFloat64Uint64X(x.FptrMapFloat64Uint64, d) + } + } + case "FMapFloat64Uintptr": + if r.TryDecodeAsNil() { + x.FMapFloat64Uintptr = nil + } else { + yyv352 := &x.FMapFloat64Uintptr + yym353 := z.DecBinary() + _ = yym353 + if false { + } else { + z.F.DecMapFloat64UintptrX(yyv352, d) + } + } + case "FptrMapFloat64Uintptr": + if x.FptrMapFloat64Uintptr == nil { + x.FptrMapFloat64Uintptr = new(map[float64]uintptr) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Uintptr != nil { + x.FptrMapFloat64Uintptr = nil + } + } else { + if x.FptrMapFloat64Uintptr == nil { + x.FptrMapFloat64Uintptr = new(map[float64]uintptr) + } + yym355 := z.DecBinary() + _ = yym355 + if false { + } else { + z.F.DecMapFloat64UintptrX(x.FptrMapFloat64Uintptr, d) + } + } + case "FMapFloat64Int": + if r.TryDecodeAsNil() { + x.FMapFloat64Int = nil + } else { + yyv356 := &x.FMapFloat64Int + yym357 := z.DecBinary() + _ = yym357 + if false { + } else { + z.F.DecMapFloat64IntX(yyv356, d) + } + } + case "FptrMapFloat64Int": + if x.FptrMapFloat64Int == nil { + x.FptrMapFloat64Int = new(map[float64]int) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Int != nil { + x.FptrMapFloat64Int = nil + } + } else { + if x.FptrMapFloat64Int == nil { + x.FptrMapFloat64Int = new(map[float64]int) + } + yym359 := z.DecBinary() + _ = yym359 + if false { + } else { + z.F.DecMapFloat64IntX(x.FptrMapFloat64Int, d) + } + } + case "FMapFloat64Int8": + if r.TryDecodeAsNil() { + x.FMapFloat64Int8 = nil + } else { + yyv360 := &x.FMapFloat64Int8 + yym361 := z.DecBinary() + _ = yym361 + if false { + } else { + z.F.DecMapFloat64Int8X(yyv360, d) + } + } + case "FptrMapFloat64Int8": + if x.FptrMapFloat64Int8 == nil { + x.FptrMapFloat64Int8 = new(map[float64]int8) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Int8 != nil { + x.FptrMapFloat64Int8 = nil + } + } else { + if x.FptrMapFloat64Int8 == nil { + x.FptrMapFloat64Int8 = new(map[float64]int8) + } + yym363 := z.DecBinary() + _ = yym363 + if false { + } else { + z.F.DecMapFloat64Int8X(x.FptrMapFloat64Int8, d) + } + } + case "FMapFloat64Int16": + if r.TryDecodeAsNil() { + x.FMapFloat64Int16 = nil + } else { + yyv364 := &x.FMapFloat64Int16 + yym365 := z.DecBinary() + _ = yym365 + if false { + } else { + z.F.DecMapFloat64Int16X(yyv364, d) + } + } + case "FptrMapFloat64Int16": + if x.FptrMapFloat64Int16 == nil { + x.FptrMapFloat64Int16 = new(map[float64]int16) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Int16 != nil { + x.FptrMapFloat64Int16 = nil + } + } else { + if x.FptrMapFloat64Int16 == nil { + x.FptrMapFloat64Int16 = new(map[float64]int16) + } + yym367 := z.DecBinary() + _ = yym367 + if false { + } else { + z.F.DecMapFloat64Int16X(x.FptrMapFloat64Int16, d) + } + } + case "FMapFloat64Int32": + if r.TryDecodeAsNil() { + x.FMapFloat64Int32 = nil + } else { + yyv368 := &x.FMapFloat64Int32 + yym369 := z.DecBinary() + _ = yym369 + if false { + } else { + z.F.DecMapFloat64Int32X(yyv368, d) + } + } + case "FptrMapFloat64Int32": + if x.FptrMapFloat64Int32 == nil { + x.FptrMapFloat64Int32 = new(map[float64]int32) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Int32 != nil { + x.FptrMapFloat64Int32 = nil + } + } else { + if x.FptrMapFloat64Int32 == nil { + x.FptrMapFloat64Int32 = new(map[float64]int32) + } + yym371 := z.DecBinary() + _ = yym371 + if false { + } else { + z.F.DecMapFloat64Int32X(x.FptrMapFloat64Int32, d) + } + } + case "FMapFloat64Int64": + if r.TryDecodeAsNil() { + x.FMapFloat64Int64 = nil + } else { + yyv372 := &x.FMapFloat64Int64 + yym373 := z.DecBinary() + _ = yym373 + if false { + } else { + z.F.DecMapFloat64Int64X(yyv372, d) + } + } + case "FptrMapFloat64Int64": + if x.FptrMapFloat64Int64 == nil { + x.FptrMapFloat64Int64 = new(map[float64]int64) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Int64 != nil { + x.FptrMapFloat64Int64 = nil + } + } else { + if x.FptrMapFloat64Int64 == nil { + x.FptrMapFloat64Int64 = new(map[float64]int64) + } + yym375 := z.DecBinary() + _ = yym375 + if false { + } else { + z.F.DecMapFloat64Int64X(x.FptrMapFloat64Int64, d) + } + } + case "FMapFloat64Float32": + if r.TryDecodeAsNil() { + x.FMapFloat64Float32 = nil + } else { + yyv376 := &x.FMapFloat64Float32 + yym377 := z.DecBinary() + _ = yym377 + if false { + } else { + z.F.DecMapFloat64Float32X(yyv376, d) + } + } + case "FptrMapFloat64Float32": + if x.FptrMapFloat64Float32 == nil { + x.FptrMapFloat64Float32 = new(map[float64]float32) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Float32 != nil { + x.FptrMapFloat64Float32 = nil + } + } else { + if x.FptrMapFloat64Float32 == nil { + x.FptrMapFloat64Float32 = new(map[float64]float32) + } + yym379 := z.DecBinary() + _ = yym379 + if false { + } else { + z.F.DecMapFloat64Float32X(x.FptrMapFloat64Float32, d) + } + } + case "FMapFloat64Float64": + if r.TryDecodeAsNil() { + x.FMapFloat64Float64 = nil + } else { + yyv380 := &x.FMapFloat64Float64 + yym381 := z.DecBinary() + _ = yym381 + if false { + } else { + z.F.DecMapFloat64Float64X(yyv380, d) + } + } + case "FptrMapFloat64Float64": + if x.FptrMapFloat64Float64 == nil { + x.FptrMapFloat64Float64 = new(map[float64]float64) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Float64 != nil { + x.FptrMapFloat64Float64 = nil + } + } else { + if x.FptrMapFloat64Float64 == nil { + x.FptrMapFloat64Float64 = new(map[float64]float64) + } + yym383 := z.DecBinary() + _ = yym383 + if false { + } else { + z.F.DecMapFloat64Float64X(x.FptrMapFloat64Float64, d) + } + } + case "FMapFloat64Bool": + if r.TryDecodeAsNil() { + x.FMapFloat64Bool = nil + } else { + yyv384 := &x.FMapFloat64Bool + yym385 := z.DecBinary() + _ = yym385 + if false { + } else { + z.F.DecMapFloat64BoolX(yyv384, d) + } + } + case "FptrMapFloat64Bool": + if x.FptrMapFloat64Bool == nil { + x.FptrMapFloat64Bool = new(map[float64]bool) + } + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Bool != nil { + x.FptrMapFloat64Bool = nil + } + } else { + if x.FptrMapFloat64Bool == nil { + x.FptrMapFloat64Bool = new(map[float64]bool) + } + yym387 := z.DecBinary() + _ = yym387 + if false { + } else { + z.F.DecMapFloat64BoolX(x.FptrMapFloat64Bool, d) + } + } + case "FMapUintIntf": + if r.TryDecodeAsNil() { + x.FMapUintIntf = nil + } else { + yyv388 := &x.FMapUintIntf + yym389 := z.DecBinary() + _ = yym389 + if false { + } else { + z.F.DecMapUintIntfX(yyv388, d) + } + } + case "FptrMapUintIntf": + if x.FptrMapUintIntf == nil { + x.FptrMapUintIntf = new(map[uint]interface{}) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintIntf != nil { + x.FptrMapUintIntf = nil + } + } else { + if x.FptrMapUintIntf == nil { + x.FptrMapUintIntf = new(map[uint]interface{}) + } + yym391 := z.DecBinary() + _ = yym391 + if false { + } else { + z.F.DecMapUintIntfX(x.FptrMapUintIntf, d) + } + } + case "FMapUintString": + if r.TryDecodeAsNil() { + x.FMapUintString = nil + } else { + yyv392 := &x.FMapUintString + yym393 := z.DecBinary() + _ = yym393 + if false { + } else { + z.F.DecMapUintStringX(yyv392, d) + } + } + case "FptrMapUintString": + if x.FptrMapUintString == nil { + x.FptrMapUintString = new(map[uint]string) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintString != nil { + x.FptrMapUintString = nil + } + } else { + if x.FptrMapUintString == nil { + x.FptrMapUintString = new(map[uint]string) + } + yym395 := z.DecBinary() + _ = yym395 + if false { + } else { + z.F.DecMapUintStringX(x.FptrMapUintString, d) + } + } + case "FMapUintUint": + if r.TryDecodeAsNil() { + x.FMapUintUint = nil + } else { + yyv396 := &x.FMapUintUint + yym397 := z.DecBinary() + _ = yym397 + if false { + } else { + z.F.DecMapUintUintX(yyv396, d) + } + } + case "FptrMapUintUint": + if x.FptrMapUintUint == nil { + x.FptrMapUintUint = new(map[uint]uint) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintUint != nil { + x.FptrMapUintUint = nil + } + } else { + if x.FptrMapUintUint == nil { + x.FptrMapUintUint = new(map[uint]uint) + } + yym399 := z.DecBinary() + _ = yym399 + if false { + } else { + z.F.DecMapUintUintX(x.FptrMapUintUint, d) + } + } + case "FMapUintUint8": + if r.TryDecodeAsNil() { + x.FMapUintUint8 = nil + } else { + yyv400 := &x.FMapUintUint8 + yym401 := z.DecBinary() + _ = yym401 + if false { + } else { + z.F.DecMapUintUint8X(yyv400, d) + } + } + case "FptrMapUintUint8": + if x.FptrMapUintUint8 == nil { + x.FptrMapUintUint8 = new(map[uint]uint8) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintUint8 != nil { + x.FptrMapUintUint8 = nil + } + } else { + if x.FptrMapUintUint8 == nil { + x.FptrMapUintUint8 = new(map[uint]uint8) + } + yym403 := z.DecBinary() + _ = yym403 + if false { + } else { + z.F.DecMapUintUint8X(x.FptrMapUintUint8, d) + } + } + case "FMapUintUint16": + if r.TryDecodeAsNil() { + x.FMapUintUint16 = nil + } else { + yyv404 := &x.FMapUintUint16 + yym405 := z.DecBinary() + _ = yym405 + if false { + } else { + z.F.DecMapUintUint16X(yyv404, d) + } + } + case "FptrMapUintUint16": + if x.FptrMapUintUint16 == nil { + x.FptrMapUintUint16 = new(map[uint]uint16) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintUint16 != nil { + x.FptrMapUintUint16 = nil + } + } else { + if x.FptrMapUintUint16 == nil { + x.FptrMapUintUint16 = new(map[uint]uint16) + } + yym407 := z.DecBinary() + _ = yym407 + if false { + } else { + z.F.DecMapUintUint16X(x.FptrMapUintUint16, d) + } + } + case "FMapUintUint32": + if r.TryDecodeAsNil() { + x.FMapUintUint32 = nil + } else { + yyv408 := &x.FMapUintUint32 + yym409 := z.DecBinary() + _ = yym409 + if false { + } else { + z.F.DecMapUintUint32X(yyv408, d) + } + } + case "FptrMapUintUint32": + if x.FptrMapUintUint32 == nil { + x.FptrMapUintUint32 = new(map[uint]uint32) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintUint32 != nil { + x.FptrMapUintUint32 = nil + } + } else { + if x.FptrMapUintUint32 == nil { + x.FptrMapUintUint32 = new(map[uint]uint32) + } + yym411 := z.DecBinary() + _ = yym411 + if false { + } else { + z.F.DecMapUintUint32X(x.FptrMapUintUint32, d) + } + } + case "FMapUintUint64": + if r.TryDecodeAsNil() { + x.FMapUintUint64 = nil + } else { + yyv412 := &x.FMapUintUint64 + yym413 := z.DecBinary() + _ = yym413 + if false { + } else { + z.F.DecMapUintUint64X(yyv412, d) + } + } + case "FptrMapUintUint64": + if x.FptrMapUintUint64 == nil { + x.FptrMapUintUint64 = new(map[uint]uint64) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintUint64 != nil { + x.FptrMapUintUint64 = nil + } + } else { + if x.FptrMapUintUint64 == nil { + x.FptrMapUintUint64 = new(map[uint]uint64) + } + yym415 := z.DecBinary() + _ = yym415 + if false { + } else { + z.F.DecMapUintUint64X(x.FptrMapUintUint64, d) + } + } + case "FMapUintUintptr": + if r.TryDecodeAsNil() { + x.FMapUintUintptr = nil + } else { + yyv416 := &x.FMapUintUintptr + yym417 := z.DecBinary() + _ = yym417 + if false { + } else { + z.F.DecMapUintUintptrX(yyv416, d) + } + } + case "FptrMapUintUintptr": + if x.FptrMapUintUintptr == nil { + x.FptrMapUintUintptr = new(map[uint]uintptr) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintUintptr != nil { + x.FptrMapUintUintptr = nil + } + } else { + if x.FptrMapUintUintptr == nil { + x.FptrMapUintUintptr = new(map[uint]uintptr) + } + yym419 := z.DecBinary() + _ = yym419 + if false { + } else { + z.F.DecMapUintUintptrX(x.FptrMapUintUintptr, d) + } + } + case "FMapUintInt": + if r.TryDecodeAsNil() { + x.FMapUintInt = nil + } else { + yyv420 := &x.FMapUintInt + yym421 := z.DecBinary() + _ = yym421 + if false { + } else { + z.F.DecMapUintIntX(yyv420, d) + } + } + case "FptrMapUintInt": + if x.FptrMapUintInt == nil { + x.FptrMapUintInt = new(map[uint]int) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintInt != nil { + x.FptrMapUintInt = nil + } + } else { + if x.FptrMapUintInt == nil { + x.FptrMapUintInt = new(map[uint]int) + } + yym423 := z.DecBinary() + _ = yym423 + if false { + } else { + z.F.DecMapUintIntX(x.FptrMapUintInt, d) + } + } + case "FMapUintInt8": + if r.TryDecodeAsNil() { + x.FMapUintInt8 = nil + } else { + yyv424 := &x.FMapUintInt8 + yym425 := z.DecBinary() + _ = yym425 + if false { + } else { + z.F.DecMapUintInt8X(yyv424, d) + } + } + case "FptrMapUintInt8": + if x.FptrMapUintInt8 == nil { + x.FptrMapUintInt8 = new(map[uint]int8) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintInt8 != nil { + x.FptrMapUintInt8 = nil + } + } else { + if x.FptrMapUintInt8 == nil { + x.FptrMapUintInt8 = new(map[uint]int8) + } + yym427 := z.DecBinary() + _ = yym427 + if false { + } else { + z.F.DecMapUintInt8X(x.FptrMapUintInt8, d) + } + } + case "FMapUintInt16": + if r.TryDecodeAsNil() { + x.FMapUintInt16 = nil + } else { + yyv428 := &x.FMapUintInt16 + yym429 := z.DecBinary() + _ = yym429 + if false { + } else { + z.F.DecMapUintInt16X(yyv428, d) + } + } + case "FptrMapUintInt16": + if x.FptrMapUintInt16 == nil { + x.FptrMapUintInt16 = new(map[uint]int16) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintInt16 != nil { + x.FptrMapUintInt16 = nil + } + } else { + if x.FptrMapUintInt16 == nil { + x.FptrMapUintInt16 = new(map[uint]int16) + } + yym431 := z.DecBinary() + _ = yym431 + if false { + } else { + z.F.DecMapUintInt16X(x.FptrMapUintInt16, d) + } + } + case "FMapUintInt32": + if r.TryDecodeAsNil() { + x.FMapUintInt32 = nil + } else { + yyv432 := &x.FMapUintInt32 + yym433 := z.DecBinary() + _ = yym433 + if false { + } else { + z.F.DecMapUintInt32X(yyv432, d) + } + } + case "FptrMapUintInt32": + if x.FptrMapUintInt32 == nil { + x.FptrMapUintInt32 = new(map[uint]int32) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintInt32 != nil { + x.FptrMapUintInt32 = nil + } + } else { + if x.FptrMapUintInt32 == nil { + x.FptrMapUintInt32 = new(map[uint]int32) + } + yym435 := z.DecBinary() + _ = yym435 + if false { + } else { + z.F.DecMapUintInt32X(x.FptrMapUintInt32, d) + } + } + case "FMapUintInt64": + if r.TryDecodeAsNil() { + x.FMapUintInt64 = nil + } else { + yyv436 := &x.FMapUintInt64 + yym437 := z.DecBinary() + _ = yym437 + if false { + } else { + z.F.DecMapUintInt64X(yyv436, d) + } + } + case "FptrMapUintInt64": + if x.FptrMapUintInt64 == nil { + x.FptrMapUintInt64 = new(map[uint]int64) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintInt64 != nil { + x.FptrMapUintInt64 = nil + } + } else { + if x.FptrMapUintInt64 == nil { + x.FptrMapUintInt64 = new(map[uint]int64) + } + yym439 := z.DecBinary() + _ = yym439 + if false { + } else { + z.F.DecMapUintInt64X(x.FptrMapUintInt64, d) + } + } + case "FMapUintFloat32": + if r.TryDecodeAsNil() { + x.FMapUintFloat32 = nil + } else { + yyv440 := &x.FMapUintFloat32 + yym441 := z.DecBinary() + _ = yym441 + if false { + } else { + z.F.DecMapUintFloat32X(yyv440, d) + } + } + case "FptrMapUintFloat32": + if x.FptrMapUintFloat32 == nil { + x.FptrMapUintFloat32 = new(map[uint]float32) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintFloat32 != nil { + x.FptrMapUintFloat32 = nil + } + } else { + if x.FptrMapUintFloat32 == nil { + x.FptrMapUintFloat32 = new(map[uint]float32) + } + yym443 := z.DecBinary() + _ = yym443 + if false { + } else { + z.F.DecMapUintFloat32X(x.FptrMapUintFloat32, d) + } + } + case "FMapUintFloat64": + if r.TryDecodeAsNil() { + x.FMapUintFloat64 = nil + } else { + yyv444 := &x.FMapUintFloat64 + yym445 := z.DecBinary() + _ = yym445 + if false { + } else { + z.F.DecMapUintFloat64X(yyv444, d) + } + } + case "FptrMapUintFloat64": + if x.FptrMapUintFloat64 == nil { + x.FptrMapUintFloat64 = new(map[uint]float64) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintFloat64 != nil { + x.FptrMapUintFloat64 = nil + } + } else { + if x.FptrMapUintFloat64 == nil { + x.FptrMapUintFloat64 = new(map[uint]float64) + } + yym447 := z.DecBinary() + _ = yym447 + if false { + } else { + z.F.DecMapUintFloat64X(x.FptrMapUintFloat64, d) + } + } + case "FMapUintBool": + if r.TryDecodeAsNil() { + x.FMapUintBool = nil + } else { + yyv448 := &x.FMapUintBool + yym449 := z.DecBinary() + _ = yym449 + if false { + } else { + z.F.DecMapUintBoolX(yyv448, d) + } + } + case "FptrMapUintBool": + if x.FptrMapUintBool == nil { + x.FptrMapUintBool = new(map[uint]bool) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintBool != nil { + x.FptrMapUintBool = nil + } + } else { + if x.FptrMapUintBool == nil { + x.FptrMapUintBool = new(map[uint]bool) + } + yym451 := z.DecBinary() + _ = yym451 + if false { + } else { + z.F.DecMapUintBoolX(x.FptrMapUintBool, d) + } + } + case "FMapUint8Intf": + if r.TryDecodeAsNil() { + x.FMapUint8Intf = nil + } else { + yyv452 := &x.FMapUint8Intf + yym453 := z.DecBinary() + _ = yym453 + if false { + } else { + z.F.DecMapUint8IntfX(yyv452, d) + } + } + case "FptrMapUint8Intf": + if x.FptrMapUint8Intf == nil { + x.FptrMapUint8Intf = new(map[uint8]interface{}) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint8Intf != nil { + x.FptrMapUint8Intf = nil + } + } else { + if x.FptrMapUint8Intf == nil { + x.FptrMapUint8Intf = new(map[uint8]interface{}) + } + yym455 := z.DecBinary() + _ = yym455 + if false { + } else { + z.F.DecMapUint8IntfX(x.FptrMapUint8Intf, d) + } + } + case "FMapUint8String": + if r.TryDecodeAsNil() { + x.FMapUint8String = nil + } else { + yyv456 := &x.FMapUint8String + yym457 := z.DecBinary() + _ = yym457 + if false { + } else { + z.F.DecMapUint8StringX(yyv456, d) + } + } + case "FptrMapUint8String": + if x.FptrMapUint8String == nil { + x.FptrMapUint8String = new(map[uint8]string) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint8String != nil { + x.FptrMapUint8String = nil + } + } else { + if x.FptrMapUint8String == nil { + x.FptrMapUint8String = new(map[uint8]string) + } + yym459 := z.DecBinary() + _ = yym459 + if false { + } else { + z.F.DecMapUint8StringX(x.FptrMapUint8String, d) + } + } + case "FMapUint8Uint": + if r.TryDecodeAsNil() { + x.FMapUint8Uint = nil + } else { + yyv460 := &x.FMapUint8Uint + yym461 := z.DecBinary() + _ = yym461 + if false { + } else { + z.F.DecMapUint8UintX(yyv460, d) + } + } + case "FptrMapUint8Uint": + if x.FptrMapUint8Uint == nil { + x.FptrMapUint8Uint = new(map[uint8]uint) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint8Uint != nil { + x.FptrMapUint8Uint = nil + } + } else { + if x.FptrMapUint8Uint == nil { + x.FptrMapUint8Uint = new(map[uint8]uint) + } + yym463 := z.DecBinary() + _ = yym463 + if false { + } else { + z.F.DecMapUint8UintX(x.FptrMapUint8Uint, d) + } + } + case "FMapUint8Uint8": + if r.TryDecodeAsNil() { + x.FMapUint8Uint8 = nil + } else { + yyv464 := &x.FMapUint8Uint8 + yym465 := z.DecBinary() + _ = yym465 + if false { + } else { + z.F.DecMapUint8Uint8X(yyv464, d) + } + } + case "FptrMapUint8Uint8": + if x.FptrMapUint8Uint8 == nil { + x.FptrMapUint8Uint8 = new(map[uint8]uint8) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint8Uint8 != nil { + x.FptrMapUint8Uint8 = nil + } + } else { + if x.FptrMapUint8Uint8 == nil { + x.FptrMapUint8Uint8 = new(map[uint8]uint8) + } + yym467 := z.DecBinary() + _ = yym467 + if false { + } else { + z.F.DecMapUint8Uint8X(x.FptrMapUint8Uint8, d) + } + } + case "FMapUint8Uint16": + if r.TryDecodeAsNil() { + x.FMapUint8Uint16 = nil + } else { + yyv468 := &x.FMapUint8Uint16 + yym469 := z.DecBinary() + _ = yym469 + if false { + } else { + z.F.DecMapUint8Uint16X(yyv468, d) + } + } + case "FptrMapUint8Uint16": + if x.FptrMapUint8Uint16 == nil { + x.FptrMapUint8Uint16 = new(map[uint8]uint16) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint8Uint16 != nil { + x.FptrMapUint8Uint16 = nil + } + } else { + if x.FptrMapUint8Uint16 == nil { + x.FptrMapUint8Uint16 = new(map[uint8]uint16) + } + yym471 := z.DecBinary() + _ = yym471 + if false { + } else { + z.F.DecMapUint8Uint16X(x.FptrMapUint8Uint16, d) + } + } + case "FMapUint8Uint32": + if r.TryDecodeAsNil() { + x.FMapUint8Uint32 = nil + } else { + yyv472 := &x.FMapUint8Uint32 + yym473 := z.DecBinary() + _ = yym473 + if false { + } else { + z.F.DecMapUint8Uint32X(yyv472, d) + } + } + case "FptrMapUint8Uint32": + if x.FptrMapUint8Uint32 == nil { + x.FptrMapUint8Uint32 = new(map[uint8]uint32) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint8Uint32 != nil { + x.FptrMapUint8Uint32 = nil + } + } else { + if x.FptrMapUint8Uint32 == nil { + x.FptrMapUint8Uint32 = new(map[uint8]uint32) + } + yym475 := z.DecBinary() + _ = yym475 + if false { + } else { + z.F.DecMapUint8Uint32X(x.FptrMapUint8Uint32, d) + } + } + case "FMapUint8Uint64": + if r.TryDecodeAsNil() { + x.FMapUint8Uint64 = nil + } else { + yyv476 := &x.FMapUint8Uint64 + yym477 := z.DecBinary() + _ = yym477 + if false { + } else { + z.F.DecMapUint8Uint64X(yyv476, d) + } + } + case "FptrMapUint8Uint64": + if x.FptrMapUint8Uint64 == nil { + x.FptrMapUint8Uint64 = new(map[uint8]uint64) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint8Uint64 != nil { + x.FptrMapUint8Uint64 = nil + } + } else { + if x.FptrMapUint8Uint64 == nil { + x.FptrMapUint8Uint64 = new(map[uint8]uint64) + } + yym479 := z.DecBinary() + _ = yym479 + if false { + } else { + z.F.DecMapUint8Uint64X(x.FptrMapUint8Uint64, d) + } + } + case "FMapUint8Uintptr": + if r.TryDecodeAsNil() { + x.FMapUint8Uintptr = nil + } else { + yyv480 := &x.FMapUint8Uintptr + yym481 := z.DecBinary() + _ = yym481 + if false { + } else { + z.F.DecMapUint8UintptrX(yyv480, d) + } + } + case "FptrMapUint8Uintptr": + if x.FptrMapUint8Uintptr == nil { + x.FptrMapUint8Uintptr = new(map[uint8]uintptr) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint8Uintptr != nil { + x.FptrMapUint8Uintptr = nil + } + } else { + if x.FptrMapUint8Uintptr == nil { + x.FptrMapUint8Uintptr = new(map[uint8]uintptr) + } + yym483 := z.DecBinary() + _ = yym483 + if false { + } else { + z.F.DecMapUint8UintptrX(x.FptrMapUint8Uintptr, d) + } + } + case "FMapUint8Int": + if r.TryDecodeAsNil() { + x.FMapUint8Int = nil + } else { + yyv484 := &x.FMapUint8Int + yym485 := z.DecBinary() + _ = yym485 + if false { + } else { + z.F.DecMapUint8IntX(yyv484, d) + } + } + case "FptrMapUint8Int": + if x.FptrMapUint8Int == nil { + x.FptrMapUint8Int = new(map[uint8]int) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint8Int != nil { + x.FptrMapUint8Int = nil + } + } else { + if x.FptrMapUint8Int == nil { + x.FptrMapUint8Int = new(map[uint8]int) + } + yym487 := z.DecBinary() + _ = yym487 + if false { + } else { + z.F.DecMapUint8IntX(x.FptrMapUint8Int, d) + } + } + case "FMapUint8Int8": + if r.TryDecodeAsNil() { + x.FMapUint8Int8 = nil + } else { + yyv488 := &x.FMapUint8Int8 + yym489 := z.DecBinary() + _ = yym489 + if false { + } else { + z.F.DecMapUint8Int8X(yyv488, d) + } + } + case "FptrMapUint8Int8": + if x.FptrMapUint8Int8 == nil { + x.FptrMapUint8Int8 = new(map[uint8]int8) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint8Int8 != nil { + x.FptrMapUint8Int8 = nil + } + } else { + if x.FptrMapUint8Int8 == nil { + x.FptrMapUint8Int8 = new(map[uint8]int8) + } + yym491 := z.DecBinary() + _ = yym491 + if false { + } else { + z.F.DecMapUint8Int8X(x.FptrMapUint8Int8, d) + } + } + case "FMapUint8Int16": + if r.TryDecodeAsNil() { + x.FMapUint8Int16 = nil + } else { + yyv492 := &x.FMapUint8Int16 + yym493 := z.DecBinary() + _ = yym493 + if false { + } else { + z.F.DecMapUint8Int16X(yyv492, d) + } + } + case "FptrMapUint8Int16": + if x.FptrMapUint8Int16 == nil { + x.FptrMapUint8Int16 = new(map[uint8]int16) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint8Int16 != nil { + x.FptrMapUint8Int16 = nil + } + } else { + if x.FptrMapUint8Int16 == nil { + x.FptrMapUint8Int16 = new(map[uint8]int16) + } + yym495 := z.DecBinary() + _ = yym495 + if false { + } else { + z.F.DecMapUint8Int16X(x.FptrMapUint8Int16, d) + } + } + case "FMapUint8Int32": + if r.TryDecodeAsNil() { + x.FMapUint8Int32 = nil + } else { + yyv496 := &x.FMapUint8Int32 + yym497 := z.DecBinary() + _ = yym497 + if false { + } else { + z.F.DecMapUint8Int32X(yyv496, d) + } + } + case "FptrMapUint8Int32": + if x.FptrMapUint8Int32 == nil { + x.FptrMapUint8Int32 = new(map[uint8]int32) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint8Int32 != nil { + x.FptrMapUint8Int32 = nil + } + } else { + if x.FptrMapUint8Int32 == nil { + x.FptrMapUint8Int32 = new(map[uint8]int32) + } + yym499 := z.DecBinary() + _ = yym499 + if false { + } else { + z.F.DecMapUint8Int32X(x.FptrMapUint8Int32, d) + } + } + case "FMapUint8Int64": + if r.TryDecodeAsNil() { + x.FMapUint8Int64 = nil + } else { + yyv500 := &x.FMapUint8Int64 + yym501 := z.DecBinary() + _ = yym501 + if false { + } else { + z.F.DecMapUint8Int64X(yyv500, d) + } + } + case "FptrMapUint8Int64": + if x.FptrMapUint8Int64 == nil { + x.FptrMapUint8Int64 = new(map[uint8]int64) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint8Int64 != nil { + x.FptrMapUint8Int64 = nil + } + } else { + if x.FptrMapUint8Int64 == nil { + x.FptrMapUint8Int64 = new(map[uint8]int64) + } + yym503 := z.DecBinary() + _ = yym503 + if false { + } else { + z.F.DecMapUint8Int64X(x.FptrMapUint8Int64, d) + } + } + case "FMapUint8Float32": + if r.TryDecodeAsNil() { + x.FMapUint8Float32 = nil + } else { + yyv504 := &x.FMapUint8Float32 + yym505 := z.DecBinary() + _ = yym505 + if false { + } else { + z.F.DecMapUint8Float32X(yyv504, d) + } + } + case "FptrMapUint8Float32": + if x.FptrMapUint8Float32 == nil { + x.FptrMapUint8Float32 = new(map[uint8]float32) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint8Float32 != nil { + x.FptrMapUint8Float32 = nil + } + } else { + if x.FptrMapUint8Float32 == nil { + x.FptrMapUint8Float32 = new(map[uint8]float32) + } + yym507 := z.DecBinary() + _ = yym507 + if false { + } else { + z.F.DecMapUint8Float32X(x.FptrMapUint8Float32, d) + } + } + case "FMapUint8Float64": + if r.TryDecodeAsNil() { + x.FMapUint8Float64 = nil + } else { + yyv508 := &x.FMapUint8Float64 + yym509 := z.DecBinary() + _ = yym509 + if false { + } else { + z.F.DecMapUint8Float64X(yyv508, d) + } + } + case "FptrMapUint8Float64": + if x.FptrMapUint8Float64 == nil { + x.FptrMapUint8Float64 = new(map[uint8]float64) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint8Float64 != nil { + x.FptrMapUint8Float64 = nil + } + } else { + if x.FptrMapUint8Float64 == nil { + x.FptrMapUint8Float64 = new(map[uint8]float64) + } + yym511 := z.DecBinary() + _ = yym511 + if false { + } else { + z.F.DecMapUint8Float64X(x.FptrMapUint8Float64, d) + } + } + case "FMapUint8Bool": + if r.TryDecodeAsNil() { + x.FMapUint8Bool = nil + } else { + yyv512 := &x.FMapUint8Bool + yym513 := z.DecBinary() + _ = yym513 + if false { + } else { + z.F.DecMapUint8BoolX(yyv512, d) + } + } + case "FptrMapUint8Bool": + if x.FptrMapUint8Bool == nil { + x.FptrMapUint8Bool = new(map[uint8]bool) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint8Bool != nil { + x.FptrMapUint8Bool = nil + } + } else { + if x.FptrMapUint8Bool == nil { + x.FptrMapUint8Bool = new(map[uint8]bool) + } + yym515 := z.DecBinary() + _ = yym515 + if false { + } else { + z.F.DecMapUint8BoolX(x.FptrMapUint8Bool, d) + } + } + case "FMapUint16Intf": + if r.TryDecodeAsNil() { + x.FMapUint16Intf = nil + } else { + yyv516 := &x.FMapUint16Intf + yym517 := z.DecBinary() + _ = yym517 + if false { + } else { + z.F.DecMapUint16IntfX(yyv516, d) + } + } + case "FptrMapUint16Intf": + if x.FptrMapUint16Intf == nil { + x.FptrMapUint16Intf = new(map[uint16]interface{}) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint16Intf != nil { + x.FptrMapUint16Intf = nil + } + } else { + if x.FptrMapUint16Intf == nil { + x.FptrMapUint16Intf = new(map[uint16]interface{}) + } + yym519 := z.DecBinary() + _ = yym519 + if false { + } else { + z.F.DecMapUint16IntfX(x.FptrMapUint16Intf, d) + } + } + case "FMapUint16String": + if r.TryDecodeAsNil() { + x.FMapUint16String = nil + } else { + yyv520 := &x.FMapUint16String + yym521 := z.DecBinary() + _ = yym521 + if false { + } else { + z.F.DecMapUint16StringX(yyv520, d) + } + } + case "FptrMapUint16String": + if x.FptrMapUint16String == nil { + x.FptrMapUint16String = new(map[uint16]string) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint16String != nil { + x.FptrMapUint16String = nil + } + } else { + if x.FptrMapUint16String == nil { + x.FptrMapUint16String = new(map[uint16]string) + } + yym523 := z.DecBinary() + _ = yym523 + if false { + } else { + z.F.DecMapUint16StringX(x.FptrMapUint16String, d) + } + } + case "FMapUint16Uint": + if r.TryDecodeAsNil() { + x.FMapUint16Uint = nil + } else { + yyv524 := &x.FMapUint16Uint + yym525 := z.DecBinary() + _ = yym525 + if false { + } else { + z.F.DecMapUint16UintX(yyv524, d) + } + } + case "FptrMapUint16Uint": + if x.FptrMapUint16Uint == nil { + x.FptrMapUint16Uint = new(map[uint16]uint) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint16Uint != nil { + x.FptrMapUint16Uint = nil + } + } else { + if x.FptrMapUint16Uint == nil { + x.FptrMapUint16Uint = new(map[uint16]uint) + } + yym527 := z.DecBinary() + _ = yym527 + if false { + } else { + z.F.DecMapUint16UintX(x.FptrMapUint16Uint, d) + } + } + case "FMapUint16Uint8": + if r.TryDecodeAsNil() { + x.FMapUint16Uint8 = nil + } else { + yyv528 := &x.FMapUint16Uint8 + yym529 := z.DecBinary() + _ = yym529 + if false { + } else { + z.F.DecMapUint16Uint8X(yyv528, d) + } + } + case "FptrMapUint16Uint8": + if x.FptrMapUint16Uint8 == nil { + x.FptrMapUint16Uint8 = new(map[uint16]uint8) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint16Uint8 != nil { + x.FptrMapUint16Uint8 = nil + } + } else { + if x.FptrMapUint16Uint8 == nil { + x.FptrMapUint16Uint8 = new(map[uint16]uint8) + } + yym531 := z.DecBinary() + _ = yym531 + if false { + } else { + z.F.DecMapUint16Uint8X(x.FptrMapUint16Uint8, d) + } + } + case "FMapUint16Uint16": + if r.TryDecodeAsNil() { + x.FMapUint16Uint16 = nil + } else { + yyv532 := &x.FMapUint16Uint16 + yym533 := z.DecBinary() + _ = yym533 + if false { + } else { + z.F.DecMapUint16Uint16X(yyv532, d) + } + } + case "FptrMapUint16Uint16": + if x.FptrMapUint16Uint16 == nil { + x.FptrMapUint16Uint16 = new(map[uint16]uint16) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint16Uint16 != nil { + x.FptrMapUint16Uint16 = nil + } + } else { + if x.FptrMapUint16Uint16 == nil { + x.FptrMapUint16Uint16 = new(map[uint16]uint16) + } + yym535 := z.DecBinary() + _ = yym535 + if false { + } else { + z.F.DecMapUint16Uint16X(x.FptrMapUint16Uint16, d) + } + } + case "FMapUint16Uint32": + if r.TryDecodeAsNil() { + x.FMapUint16Uint32 = nil + } else { + yyv536 := &x.FMapUint16Uint32 + yym537 := z.DecBinary() + _ = yym537 + if false { + } else { + z.F.DecMapUint16Uint32X(yyv536, d) + } + } + case "FptrMapUint16Uint32": + if x.FptrMapUint16Uint32 == nil { + x.FptrMapUint16Uint32 = new(map[uint16]uint32) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint16Uint32 != nil { + x.FptrMapUint16Uint32 = nil + } + } else { + if x.FptrMapUint16Uint32 == nil { + x.FptrMapUint16Uint32 = new(map[uint16]uint32) + } + yym539 := z.DecBinary() + _ = yym539 + if false { + } else { + z.F.DecMapUint16Uint32X(x.FptrMapUint16Uint32, d) + } + } + case "FMapUint16Uint64": + if r.TryDecodeAsNil() { + x.FMapUint16Uint64 = nil + } else { + yyv540 := &x.FMapUint16Uint64 + yym541 := z.DecBinary() + _ = yym541 + if false { + } else { + z.F.DecMapUint16Uint64X(yyv540, d) + } + } + case "FptrMapUint16Uint64": + if x.FptrMapUint16Uint64 == nil { + x.FptrMapUint16Uint64 = new(map[uint16]uint64) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint16Uint64 != nil { + x.FptrMapUint16Uint64 = nil + } + } else { + if x.FptrMapUint16Uint64 == nil { + x.FptrMapUint16Uint64 = new(map[uint16]uint64) + } + yym543 := z.DecBinary() + _ = yym543 + if false { + } else { + z.F.DecMapUint16Uint64X(x.FptrMapUint16Uint64, d) + } + } + case "FMapUint16Uintptr": + if r.TryDecodeAsNil() { + x.FMapUint16Uintptr = nil + } else { + yyv544 := &x.FMapUint16Uintptr + yym545 := z.DecBinary() + _ = yym545 + if false { + } else { + z.F.DecMapUint16UintptrX(yyv544, d) + } + } + case "FptrMapUint16Uintptr": + if x.FptrMapUint16Uintptr == nil { + x.FptrMapUint16Uintptr = new(map[uint16]uintptr) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint16Uintptr != nil { + x.FptrMapUint16Uintptr = nil + } + } else { + if x.FptrMapUint16Uintptr == nil { + x.FptrMapUint16Uintptr = new(map[uint16]uintptr) + } + yym547 := z.DecBinary() + _ = yym547 + if false { + } else { + z.F.DecMapUint16UintptrX(x.FptrMapUint16Uintptr, d) + } + } + case "FMapUint16Int": + if r.TryDecodeAsNil() { + x.FMapUint16Int = nil + } else { + yyv548 := &x.FMapUint16Int + yym549 := z.DecBinary() + _ = yym549 + if false { + } else { + z.F.DecMapUint16IntX(yyv548, d) + } + } + case "FptrMapUint16Int": + if x.FptrMapUint16Int == nil { + x.FptrMapUint16Int = new(map[uint16]int) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint16Int != nil { + x.FptrMapUint16Int = nil + } + } else { + if x.FptrMapUint16Int == nil { + x.FptrMapUint16Int = new(map[uint16]int) + } + yym551 := z.DecBinary() + _ = yym551 + if false { + } else { + z.F.DecMapUint16IntX(x.FptrMapUint16Int, d) + } + } + case "FMapUint16Int8": + if r.TryDecodeAsNil() { + x.FMapUint16Int8 = nil + } else { + yyv552 := &x.FMapUint16Int8 + yym553 := z.DecBinary() + _ = yym553 + if false { + } else { + z.F.DecMapUint16Int8X(yyv552, d) + } + } + case "FptrMapUint16Int8": + if x.FptrMapUint16Int8 == nil { + x.FptrMapUint16Int8 = new(map[uint16]int8) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint16Int8 != nil { + x.FptrMapUint16Int8 = nil + } + } else { + if x.FptrMapUint16Int8 == nil { + x.FptrMapUint16Int8 = new(map[uint16]int8) + } + yym555 := z.DecBinary() + _ = yym555 + if false { + } else { + z.F.DecMapUint16Int8X(x.FptrMapUint16Int8, d) + } + } + case "FMapUint16Int16": + if r.TryDecodeAsNil() { + x.FMapUint16Int16 = nil + } else { + yyv556 := &x.FMapUint16Int16 + yym557 := z.DecBinary() + _ = yym557 + if false { + } else { + z.F.DecMapUint16Int16X(yyv556, d) + } + } + case "FptrMapUint16Int16": + if x.FptrMapUint16Int16 == nil { + x.FptrMapUint16Int16 = new(map[uint16]int16) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint16Int16 != nil { + x.FptrMapUint16Int16 = nil + } + } else { + if x.FptrMapUint16Int16 == nil { + x.FptrMapUint16Int16 = new(map[uint16]int16) + } + yym559 := z.DecBinary() + _ = yym559 + if false { + } else { + z.F.DecMapUint16Int16X(x.FptrMapUint16Int16, d) + } + } + case "FMapUint16Int32": + if r.TryDecodeAsNil() { + x.FMapUint16Int32 = nil + } else { + yyv560 := &x.FMapUint16Int32 + yym561 := z.DecBinary() + _ = yym561 + if false { + } else { + z.F.DecMapUint16Int32X(yyv560, d) + } + } + case "FptrMapUint16Int32": + if x.FptrMapUint16Int32 == nil { + x.FptrMapUint16Int32 = new(map[uint16]int32) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint16Int32 != nil { + x.FptrMapUint16Int32 = nil + } + } else { + if x.FptrMapUint16Int32 == nil { + x.FptrMapUint16Int32 = new(map[uint16]int32) + } + yym563 := z.DecBinary() + _ = yym563 + if false { + } else { + z.F.DecMapUint16Int32X(x.FptrMapUint16Int32, d) + } + } + case "FMapUint16Int64": + if r.TryDecodeAsNil() { + x.FMapUint16Int64 = nil + } else { + yyv564 := &x.FMapUint16Int64 + yym565 := z.DecBinary() + _ = yym565 + if false { + } else { + z.F.DecMapUint16Int64X(yyv564, d) + } + } + case "FptrMapUint16Int64": + if x.FptrMapUint16Int64 == nil { + x.FptrMapUint16Int64 = new(map[uint16]int64) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint16Int64 != nil { + x.FptrMapUint16Int64 = nil + } + } else { + if x.FptrMapUint16Int64 == nil { + x.FptrMapUint16Int64 = new(map[uint16]int64) + } + yym567 := z.DecBinary() + _ = yym567 + if false { + } else { + z.F.DecMapUint16Int64X(x.FptrMapUint16Int64, d) + } + } + case "FMapUint16Float32": + if r.TryDecodeAsNil() { + x.FMapUint16Float32 = nil + } else { + yyv568 := &x.FMapUint16Float32 + yym569 := z.DecBinary() + _ = yym569 + if false { + } else { + z.F.DecMapUint16Float32X(yyv568, d) + } + } + case "FptrMapUint16Float32": + if x.FptrMapUint16Float32 == nil { + x.FptrMapUint16Float32 = new(map[uint16]float32) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint16Float32 != nil { + x.FptrMapUint16Float32 = nil + } + } else { + if x.FptrMapUint16Float32 == nil { + x.FptrMapUint16Float32 = new(map[uint16]float32) + } + yym571 := z.DecBinary() + _ = yym571 + if false { + } else { + z.F.DecMapUint16Float32X(x.FptrMapUint16Float32, d) + } + } + case "FMapUint16Float64": + if r.TryDecodeAsNil() { + x.FMapUint16Float64 = nil + } else { + yyv572 := &x.FMapUint16Float64 + yym573 := z.DecBinary() + _ = yym573 + if false { + } else { + z.F.DecMapUint16Float64X(yyv572, d) + } + } + case "FptrMapUint16Float64": + if x.FptrMapUint16Float64 == nil { + x.FptrMapUint16Float64 = new(map[uint16]float64) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint16Float64 != nil { + x.FptrMapUint16Float64 = nil + } + } else { + if x.FptrMapUint16Float64 == nil { + x.FptrMapUint16Float64 = new(map[uint16]float64) + } + yym575 := z.DecBinary() + _ = yym575 + if false { + } else { + z.F.DecMapUint16Float64X(x.FptrMapUint16Float64, d) + } + } + case "FMapUint16Bool": + if r.TryDecodeAsNil() { + x.FMapUint16Bool = nil + } else { + yyv576 := &x.FMapUint16Bool + yym577 := z.DecBinary() + _ = yym577 + if false { + } else { + z.F.DecMapUint16BoolX(yyv576, d) + } + } + case "FptrMapUint16Bool": + if x.FptrMapUint16Bool == nil { + x.FptrMapUint16Bool = new(map[uint16]bool) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint16Bool != nil { + x.FptrMapUint16Bool = nil + } + } else { + if x.FptrMapUint16Bool == nil { + x.FptrMapUint16Bool = new(map[uint16]bool) + } + yym579 := z.DecBinary() + _ = yym579 + if false { + } else { + z.F.DecMapUint16BoolX(x.FptrMapUint16Bool, d) + } + } + case "FMapUint32Intf": + if r.TryDecodeAsNil() { + x.FMapUint32Intf = nil + } else { + yyv580 := &x.FMapUint32Intf + yym581 := z.DecBinary() + _ = yym581 + if false { + } else { + z.F.DecMapUint32IntfX(yyv580, d) + } + } + case "FptrMapUint32Intf": + if x.FptrMapUint32Intf == nil { + x.FptrMapUint32Intf = new(map[uint32]interface{}) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint32Intf != nil { + x.FptrMapUint32Intf = nil + } + } else { + if x.FptrMapUint32Intf == nil { + x.FptrMapUint32Intf = new(map[uint32]interface{}) + } + yym583 := z.DecBinary() + _ = yym583 + if false { + } else { + z.F.DecMapUint32IntfX(x.FptrMapUint32Intf, d) + } + } + case "FMapUint32String": + if r.TryDecodeAsNil() { + x.FMapUint32String = nil + } else { + yyv584 := &x.FMapUint32String + yym585 := z.DecBinary() + _ = yym585 + if false { + } else { + z.F.DecMapUint32StringX(yyv584, d) + } + } + case "FptrMapUint32String": + if x.FptrMapUint32String == nil { + x.FptrMapUint32String = new(map[uint32]string) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint32String != nil { + x.FptrMapUint32String = nil + } + } else { + if x.FptrMapUint32String == nil { + x.FptrMapUint32String = new(map[uint32]string) + } + yym587 := z.DecBinary() + _ = yym587 + if false { + } else { + z.F.DecMapUint32StringX(x.FptrMapUint32String, d) + } + } + case "FMapUint32Uint": + if r.TryDecodeAsNil() { + x.FMapUint32Uint = nil + } else { + yyv588 := &x.FMapUint32Uint + yym589 := z.DecBinary() + _ = yym589 + if false { + } else { + z.F.DecMapUint32UintX(yyv588, d) + } + } + case "FptrMapUint32Uint": + if x.FptrMapUint32Uint == nil { + x.FptrMapUint32Uint = new(map[uint32]uint) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint32Uint != nil { + x.FptrMapUint32Uint = nil + } + } else { + if x.FptrMapUint32Uint == nil { + x.FptrMapUint32Uint = new(map[uint32]uint) + } + yym591 := z.DecBinary() + _ = yym591 + if false { + } else { + z.F.DecMapUint32UintX(x.FptrMapUint32Uint, d) + } + } + case "FMapUint32Uint8": + if r.TryDecodeAsNil() { + x.FMapUint32Uint8 = nil + } else { + yyv592 := &x.FMapUint32Uint8 + yym593 := z.DecBinary() + _ = yym593 + if false { + } else { + z.F.DecMapUint32Uint8X(yyv592, d) + } + } + case "FptrMapUint32Uint8": + if x.FptrMapUint32Uint8 == nil { + x.FptrMapUint32Uint8 = new(map[uint32]uint8) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint32Uint8 != nil { + x.FptrMapUint32Uint8 = nil + } + } else { + if x.FptrMapUint32Uint8 == nil { + x.FptrMapUint32Uint8 = new(map[uint32]uint8) + } + yym595 := z.DecBinary() + _ = yym595 + if false { + } else { + z.F.DecMapUint32Uint8X(x.FptrMapUint32Uint8, d) + } + } + case "FMapUint32Uint16": + if r.TryDecodeAsNil() { + x.FMapUint32Uint16 = nil + } else { + yyv596 := &x.FMapUint32Uint16 + yym597 := z.DecBinary() + _ = yym597 + if false { + } else { + z.F.DecMapUint32Uint16X(yyv596, d) + } + } + case "FptrMapUint32Uint16": + if x.FptrMapUint32Uint16 == nil { + x.FptrMapUint32Uint16 = new(map[uint32]uint16) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint32Uint16 != nil { + x.FptrMapUint32Uint16 = nil + } + } else { + if x.FptrMapUint32Uint16 == nil { + x.FptrMapUint32Uint16 = new(map[uint32]uint16) + } + yym599 := z.DecBinary() + _ = yym599 + if false { + } else { + z.F.DecMapUint32Uint16X(x.FptrMapUint32Uint16, d) + } + } + case "FMapUint32Uint32": + if r.TryDecodeAsNil() { + x.FMapUint32Uint32 = nil + } else { + yyv600 := &x.FMapUint32Uint32 + yym601 := z.DecBinary() + _ = yym601 + if false { + } else { + z.F.DecMapUint32Uint32X(yyv600, d) + } + } + case "FptrMapUint32Uint32": + if x.FptrMapUint32Uint32 == nil { + x.FptrMapUint32Uint32 = new(map[uint32]uint32) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint32Uint32 != nil { + x.FptrMapUint32Uint32 = nil + } + } else { + if x.FptrMapUint32Uint32 == nil { + x.FptrMapUint32Uint32 = new(map[uint32]uint32) + } + yym603 := z.DecBinary() + _ = yym603 + if false { + } else { + z.F.DecMapUint32Uint32X(x.FptrMapUint32Uint32, d) + } + } + case "FMapUint32Uint64": + if r.TryDecodeAsNil() { + x.FMapUint32Uint64 = nil + } else { + yyv604 := &x.FMapUint32Uint64 + yym605 := z.DecBinary() + _ = yym605 + if false { + } else { + z.F.DecMapUint32Uint64X(yyv604, d) + } + } + case "FptrMapUint32Uint64": + if x.FptrMapUint32Uint64 == nil { + x.FptrMapUint32Uint64 = new(map[uint32]uint64) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint32Uint64 != nil { + x.FptrMapUint32Uint64 = nil + } + } else { + if x.FptrMapUint32Uint64 == nil { + x.FptrMapUint32Uint64 = new(map[uint32]uint64) + } + yym607 := z.DecBinary() + _ = yym607 + if false { + } else { + z.F.DecMapUint32Uint64X(x.FptrMapUint32Uint64, d) + } + } + case "FMapUint32Uintptr": + if r.TryDecodeAsNil() { + x.FMapUint32Uintptr = nil + } else { + yyv608 := &x.FMapUint32Uintptr + yym609 := z.DecBinary() + _ = yym609 + if false { + } else { + z.F.DecMapUint32UintptrX(yyv608, d) + } + } + case "FptrMapUint32Uintptr": + if x.FptrMapUint32Uintptr == nil { + x.FptrMapUint32Uintptr = new(map[uint32]uintptr) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint32Uintptr != nil { + x.FptrMapUint32Uintptr = nil + } + } else { + if x.FptrMapUint32Uintptr == nil { + x.FptrMapUint32Uintptr = new(map[uint32]uintptr) + } + yym611 := z.DecBinary() + _ = yym611 + if false { + } else { + z.F.DecMapUint32UintptrX(x.FptrMapUint32Uintptr, d) + } + } + case "FMapUint32Int": + if r.TryDecodeAsNil() { + x.FMapUint32Int = nil + } else { + yyv612 := &x.FMapUint32Int + yym613 := z.DecBinary() + _ = yym613 + if false { + } else { + z.F.DecMapUint32IntX(yyv612, d) + } + } + case "FptrMapUint32Int": + if x.FptrMapUint32Int == nil { + x.FptrMapUint32Int = new(map[uint32]int) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint32Int != nil { + x.FptrMapUint32Int = nil + } + } else { + if x.FptrMapUint32Int == nil { + x.FptrMapUint32Int = new(map[uint32]int) + } + yym615 := z.DecBinary() + _ = yym615 + if false { + } else { + z.F.DecMapUint32IntX(x.FptrMapUint32Int, d) + } + } + case "FMapUint32Int8": + if r.TryDecodeAsNil() { + x.FMapUint32Int8 = nil + } else { + yyv616 := &x.FMapUint32Int8 + yym617 := z.DecBinary() + _ = yym617 + if false { + } else { + z.F.DecMapUint32Int8X(yyv616, d) + } + } + case "FptrMapUint32Int8": + if x.FptrMapUint32Int8 == nil { + x.FptrMapUint32Int8 = new(map[uint32]int8) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint32Int8 != nil { + x.FptrMapUint32Int8 = nil + } + } else { + if x.FptrMapUint32Int8 == nil { + x.FptrMapUint32Int8 = new(map[uint32]int8) + } + yym619 := z.DecBinary() + _ = yym619 + if false { + } else { + z.F.DecMapUint32Int8X(x.FptrMapUint32Int8, d) + } + } + case "FMapUint32Int16": + if r.TryDecodeAsNil() { + x.FMapUint32Int16 = nil + } else { + yyv620 := &x.FMapUint32Int16 + yym621 := z.DecBinary() + _ = yym621 + if false { + } else { + z.F.DecMapUint32Int16X(yyv620, d) + } + } + case "FptrMapUint32Int16": + if x.FptrMapUint32Int16 == nil { + x.FptrMapUint32Int16 = new(map[uint32]int16) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint32Int16 != nil { + x.FptrMapUint32Int16 = nil + } + } else { + if x.FptrMapUint32Int16 == nil { + x.FptrMapUint32Int16 = new(map[uint32]int16) + } + yym623 := z.DecBinary() + _ = yym623 + if false { + } else { + z.F.DecMapUint32Int16X(x.FptrMapUint32Int16, d) + } + } + case "FMapUint32Int32": + if r.TryDecodeAsNil() { + x.FMapUint32Int32 = nil + } else { + yyv624 := &x.FMapUint32Int32 + yym625 := z.DecBinary() + _ = yym625 + if false { + } else { + z.F.DecMapUint32Int32X(yyv624, d) + } + } + case "FptrMapUint32Int32": + if x.FptrMapUint32Int32 == nil { + x.FptrMapUint32Int32 = new(map[uint32]int32) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint32Int32 != nil { + x.FptrMapUint32Int32 = nil + } + } else { + if x.FptrMapUint32Int32 == nil { + x.FptrMapUint32Int32 = new(map[uint32]int32) + } + yym627 := z.DecBinary() + _ = yym627 + if false { + } else { + z.F.DecMapUint32Int32X(x.FptrMapUint32Int32, d) + } + } + case "FMapUint32Int64": + if r.TryDecodeAsNil() { + x.FMapUint32Int64 = nil + } else { + yyv628 := &x.FMapUint32Int64 + yym629 := z.DecBinary() + _ = yym629 + if false { + } else { + z.F.DecMapUint32Int64X(yyv628, d) + } + } + case "FptrMapUint32Int64": + if x.FptrMapUint32Int64 == nil { + x.FptrMapUint32Int64 = new(map[uint32]int64) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint32Int64 != nil { + x.FptrMapUint32Int64 = nil + } + } else { + if x.FptrMapUint32Int64 == nil { + x.FptrMapUint32Int64 = new(map[uint32]int64) + } + yym631 := z.DecBinary() + _ = yym631 + if false { + } else { + z.F.DecMapUint32Int64X(x.FptrMapUint32Int64, d) + } + } + case "FMapUint32Float32": + if r.TryDecodeAsNil() { + x.FMapUint32Float32 = nil + } else { + yyv632 := &x.FMapUint32Float32 + yym633 := z.DecBinary() + _ = yym633 + if false { + } else { + z.F.DecMapUint32Float32X(yyv632, d) + } + } + case "FptrMapUint32Float32": + if x.FptrMapUint32Float32 == nil { + x.FptrMapUint32Float32 = new(map[uint32]float32) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint32Float32 != nil { + x.FptrMapUint32Float32 = nil + } + } else { + if x.FptrMapUint32Float32 == nil { + x.FptrMapUint32Float32 = new(map[uint32]float32) + } + yym635 := z.DecBinary() + _ = yym635 + if false { + } else { + z.F.DecMapUint32Float32X(x.FptrMapUint32Float32, d) + } + } + case "FMapUint32Float64": + if r.TryDecodeAsNil() { + x.FMapUint32Float64 = nil + } else { + yyv636 := &x.FMapUint32Float64 + yym637 := z.DecBinary() + _ = yym637 + if false { + } else { + z.F.DecMapUint32Float64X(yyv636, d) + } + } + case "FptrMapUint32Float64": + if x.FptrMapUint32Float64 == nil { + x.FptrMapUint32Float64 = new(map[uint32]float64) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint32Float64 != nil { + x.FptrMapUint32Float64 = nil + } + } else { + if x.FptrMapUint32Float64 == nil { + x.FptrMapUint32Float64 = new(map[uint32]float64) + } + yym639 := z.DecBinary() + _ = yym639 + if false { + } else { + z.F.DecMapUint32Float64X(x.FptrMapUint32Float64, d) + } + } + case "FMapUint32Bool": + if r.TryDecodeAsNil() { + x.FMapUint32Bool = nil + } else { + yyv640 := &x.FMapUint32Bool + yym641 := z.DecBinary() + _ = yym641 + if false { + } else { + z.F.DecMapUint32BoolX(yyv640, d) + } + } + case "FptrMapUint32Bool": + if x.FptrMapUint32Bool == nil { + x.FptrMapUint32Bool = new(map[uint32]bool) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint32Bool != nil { + x.FptrMapUint32Bool = nil + } + } else { + if x.FptrMapUint32Bool == nil { + x.FptrMapUint32Bool = new(map[uint32]bool) + } + yym643 := z.DecBinary() + _ = yym643 + if false { + } else { + z.F.DecMapUint32BoolX(x.FptrMapUint32Bool, d) + } + } + case "FMapUint64Intf": + if r.TryDecodeAsNil() { + x.FMapUint64Intf = nil + } else { + yyv644 := &x.FMapUint64Intf + yym645 := z.DecBinary() + _ = yym645 + if false { + } else { + z.F.DecMapUint64IntfX(yyv644, d) + } + } + case "FptrMapUint64Intf": + if x.FptrMapUint64Intf == nil { + x.FptrMapUint64Intf = new(map[uint64]interface{}) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint64Intf != nil { + x.FptrMapUint64Intf = nil + } + } else { + if x.FptrMapUint64Intf == nil { + x.FptrMapUint64Intf = new(map[uint64]interface{}) + } + yym647 := z.DecBinary() + _ = yym647 + if false { + } else { + z.F.DecMapUint64IntfX(x.FptrMapUint64Intf, d) + } + } + case "FMapUint64String": + if r.TryDecodeAsNil() { + x.FMapUint64String = nil + } else { + yyv648 := &x.FMapUint64String + yym649 := z.DecBinary() + _ = yym649 + if false { + } else { + z.F.DecMapUint64StringX(yyv648, d) + } + } + case "FptrMapUint64String": + if x.FptrMapUint64String == nil { + x.FptrMapUint64String = new(map[uint64]string) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint64String != nil { + x.FptrMapUint64String = nil + } + } else { + if x.FptrMapUint64String == nil { + x.FptrMapUint64String = new(map[uint64]string) + } + yym651 := z.DecBinary() + _ = yym651 + if false { + } else { + z.F.DecMapUint64StringX(x.FptrMapUint64String, d) + } + } + case "FMapUint64Uint": + if r.TryDecodeAsNil() { + x.FMapUint64Uint = nil + } else { + yyv652 := &x.FMapUint64Uint + yym653 := z.DecBinary() + _ = yym653 + if false { + } else { + z.F.DecMapUint64UintX(yyv652, d) + } + } + case "FptrMapUint64Uint": + if x.FptrMapUint64Uint == nil { + x.FptrMapUint64Uint = new(map[uint64]uint) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint64Uint != nil { + x.FptrMapUint64Uint = nil + } + } else { + if x.FptrMapUint64Uint == nil { + x.FptrMapUint64Uint = new(map[uint64]uint) + } + yym655 := z.DecBinary() + _ = yym655 + if false { + } else { + z.F.DecMapUint64UintX(x.FptrMapUint64Uint, d) + } + } + case "FMapUint64Uint8": + if r.TryDecodeAsNil() { + x.FMapUint64Uint8 = nil + } else { + yyv656 := &x.FMapUint64Uint8 + yym657 := z.DecBinary() + _ = yym657 + if false { + } else { + z.F.DecMapUint64Uint8X(yyv656, d) + } + } + case "FptrMapUint64Uint8": + if x.FptrMapUint64Uint8 == nil { + x.FptrMapUint64Uint8 = new(map[uint64]uint8) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint64Uint8 != nil { + x.FptrMapUint64Uint8 = nil + } + } else { + if x.FptrMapUint64Uint8 == nil { + x.FptrMapUint64Uint8 = new(map[uint64]uint8) + } + yym659 := z.DecBinary() + _ = yym659 + if false { + } else { + z.F.DecMapUint64Uint8X(x.FptrMapUint64Uint8, d) + } + } + case "FMapUint64Uint16": + if r.TryDecodeAsNil() { + x.FMapUint64Uint16 = nil + } else { + yyv660 := &x.FMapUint64Uint16 + yym661 := z.DecBinary() + _ = yym661 + if false { + } else { + z.F.DecMapUint64Uint16X(yyv660, d) + } + } + case "FptrMapUint64Uint16": + if x.FptrMapUint64Uint16 == nil { + x.FptrMapUint64Uint16 = new(map[uint64]uint16) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint64Uint16 != nil { + x.FptrMapUint64Uint16 = nil + } + } else { + if x.FptrMapUint64Uint16 == nil { + x.FptrMapUint64Uint16 = new(map[uint64]uint16) + } + yym663 := z.DecBinary() + _ = yym663 + if false { + } else { + z.F.DecMapUint64Uint16X(x.FptrMapUint64Uint16, d) + } + } + case "FMapUint64Uint32": + if r.TryDecodeAsNil() { + x.FMapUint64Uint32 = nil + } else { + yyv664 := &x.FMapUint64Uint32 + yym665 := z.DecBinary() + _ = yym665 + if false { + } else { + z.F.DecMapUint64Uint32X(yyv664, d) + } + } + case "FptrMapUint64Uint32": + if x.FptrMapUint64Uint32 == nil { + x.FptrMapUint64Uint32 = new(map[uint64]uint32) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint64Uint32 != nil { + x.FptrMapUint64Uint32 = nil + } + } else { + if x.FptrMapUint64Uint32 == nil { + x.FptrMapUint64Uint32 = new(map[uint64]uint32) + } + yym667 := z.DecBinary() + _ = yym667 + if false { + } else { + z.F.DecMapUint64Uint32X(x.FptrMapUint64Uint32, d) + } + } + case "FMapUint64Uint64": + if r.TryDecodeAsNil() { + x.FMapUint64Uint64 = nil + } else { + yyv668 := &x.FMapUint64Uint64 + yym669 := z.DecBinary() + _ = yym669 + if false { + } else { + z.F.DecMapUint64Uint64X(yyv668, d) + } + } + case "FptrMapUint64Uint64": + if x.FptrMapUint64Uint64 == nil { + x.FptrMapUint64Uint64 = new(map[uint64]uint64) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint64Uint64 != nil { + x.FptrMapUint64Uint64 = nil + } + } else { + if x.FptrMapUint64Uint64 == nil { + x.FptrMapUint64Uint64 = new(map[uint64]uint64) + } + yym671 := z.DecBinary() + _ = yym671 + if false { + } else { + z.F.DecMapUint64Uint64X(x.FptrMapUint64Uint64, d) + } + } + case "FMapUint64Uintptr": + if r.TryDecodeAsNil() { + x.FMapUint64Uintptr = nil + } else { + yyv672 := &x.FMapUint64Uintptr + yym673 := z.DecBinary() + _ = yym673 + if false { + } else { + z.F.DecMapUint64UintptrX(yyv672, d) + } + } + case "FptrMapUint64Uintptr": + if x.FptrMapUint64Uintptr == nil { + x.FptrMapUint64Uintptr = new(map[uint64]uintptr) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint64Uintptr != nil { + x.FptrMapUint64Uintptr = nil + } + } else { + if x.FptrMapUint64Uintptr == nil { + x.FptrMapUint64Uintptr = new(map[uint64]uintptr) + } + yym675 := z.DecBinary() + _ = yym675 + if false { + } else { + z.F.DecMapUint64UintptrX(x.FptrMapUint64Uintptr, d) + } + } + case "FMapUint64Int": + if r.TryDecodeAsNil() { + x.FMapUint64Int = nil + } else { + yyv676 := &x.FMapUint64Int + yym677 := z.DecBinary() + _ = yym677 + if false { + } else { + z.F.DecMapUint64IntX(yyv676, d) + } + } + case "FptrMapUint64Int": + if x.FptrMapUint64Int == nil { + x.FptrMapUint64Int = new(map[uint64]int) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint64Int != nil { + x.FptrMapUint64Int = nil + } + } else { + if x.FptrMapUint64Int == nil { + x.FptrMapUint64Int = new(map[uint64]int) + } + yym679 := z.DecBinary() + _ = yym679 + if false { + } else { + z.F.DecMapUint64IntX(x.FptrMapUint64Int, d) + } + } + case "FMapUint64Int8": + if r.TryDecodeAsNil() { + x.FMapUint64Int8 = nil + } else { + yyv680 := &x.FMapUint64Int8 + yym681 := z.DecBinary() + _ = yym681 + if false { + } else { + z.F.DecMapUint64Int8X(yyv680, d) + } + } + case "FptrMapUint64Int8": + if x.FptrMapUint64Int8 == nil { + x.FptrMapUint64Int8 = new(map[uint64]int8) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint64Int8 != nil { + x.FptrMapUint64Int8 = nil + } + } else { + if x.FptrMapUint64Int8 == nil { + x.FptrMapUint64Int8 = new(map[uint64]int8) + } + yym683 := z.DecBinary() + _ = yym683 + if false { + } else { + z.F.DecMapUint64Int8X(x.FptrMapUint64Int8, d) + } + } + case "FMapUint64Int16": + if r.TryDecodeAsNil() { + x.FMapUint64Int16 = nil + } else { + yyv684 := &x.FMapUint64Int16 + yym685 := z.DecBinary() + _ = yym685 + if false { + } else { + z.F.DecMapUint64Int16X(yyv684, d) + } + } + case "FptrMapUint64Int16": + if x.FptrMapUint64Int16 == nil { + x.FptrMapUint64Int16 = new(map[uint64]int16) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint64Int16 != nil { + x.FptrMapUint64Int16 = nil + } + } else { + if x.FptrMapUint64Int16 == nil { + x.FptrMapUint64Int16 = new(map[uint64]int16) + } + yym687 := z.DecBinary() + _ = yym687 + if false { + } else { + z.F.DecMapUint64Int16X(x.FptrMapUint64Int16, d) + } + } + case "FMapUint64Int32": + if r.TryDecodeAsNil() { + x.FMapUint64Int32 = nil + } else { + yyv688 := &x.FMapUint64Int32 + yym689 := z.DecBinary() + _ = yym689 + if false { + } else { + z.F.DecMapUint64Int32X(yyv688, d) + } + } + case "FptrMapUint64Int32": + if x.FptrMapUint64Int32 == nil { + x.FptrMapUint64Int32 = new(map[uint64]int32) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint64Int32 != nil { + x.FptrMapUint64Int32 = nil + } + } else { + if x.FptrMapUint64Int32 == nil { + x.FptrMapUint64Int32 = new(map[uint64]int32) + } + yym691 := z.DecBinary() + _ = yym691 + if false { + } else { + z.F.DecMapUint64Int32X(x.FptrMapUint64Int32, d) + } + } + case "FMapUint64Int64": + if r.TryDecodeAsNil() { + x.FMapUint64Int64 = nil + } else { + yyv692 := &x.FMapUint64Int64 + yym693 := z.DecBinary() + _ = yym693 + if false { + } else { + z.F.DecMapUint64Int64X(yyv692, d) + } + } + case "FptrMapUint64Int64": + if x.FptrMapUint64Int64 == nil { + x.FptrMapUint64Int64 = new(map[uint64]int64) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint64Int64 != nil { + x.FptrMapUint64Int64 = nil + } + } else { + if x.FptrMapUint64Int64 == nil { + x.FptrMapUint64Int64 = new(map[uint64]int64) + } + yym695 := z.DecBinary() + _ = yym695 + if false { + } else { + z.F.DecMapUint64Int64X(x.FptrMapUint64Int64, d) + } + } + case "FMapUint64Float32": + if r.TryDecodeAsNil() { + x.FMapUint64Float32 = nil + } else { + yyv696 := &x.FMapUint64Float32 + yym697 := z.DecBinary() + _ = yym697 + if false { + } else { + z.F.DecMapUint64Float32X(yyv696, d) + } + } + case "FptrMapUint64Float32": + if x.FptrMapUint64Float32 == nil { + x.FptrMapUint64Float32 = new(map[uint64]float32) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint64Float32 != nil { + x.FptrMapUint64Float32 = nil + } + } else { + if x.FptrMapUint64Float32 == nil { + x.FptrMapUint64Float32 = new(map[uint64]float32) + } + yym699 := z.DecBinary() + _ = yym699 + if false { + } else { + z.F.DecMapUint64Float32X(x.FptrMapUint64Float32, d) + } + } + case "FMapUint64Float64": + if r.TryDecodeAsNil() { + x.FMapUint64Float64 = nil + } else { + yyv700 := &x.FMapUint64Float64 + yym701 := z.DecBinary() + _ = yym701 + if false { + } else { + z.F.DecMapUint64Float64X(yyv700, d) + } + } + case "FptrMapUint64Float64": + if x.FptrMapUint64Float64 == nil { + x.FptrMapUint64Float64 = new(map[uint64]float64) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint64Float64 != nil { + x.FptrMapUint64Float64 = nil + } + } else { + if x.FptrMapUint64Float64 == nil { + x.FptrMapUint64Float64 = new(map[uint64]float64) + } + yym703 := z.DecBinary() + _ = yym703 + if false { + } else { + z.F.DecMapUint64Float64X(x.FptrMapUint64Float64, d) + } + } + case "FMapUint64Bool": + if r.TryDecodeAsNil() { + x.FMapUint64Bool = nil + } else { + yyv704 := &x.FMapUint64Bool + yym705 := z.DecBinary() + _ = yym705 + if false { + } else { + z.F.DecMapUint64BoolX(yyv704, d) + } + } + case "FptrMapUint64Bool": + if x.FptrMapUint64Bool == nil { + x.FptrMapUint64Bool = new(map[uint64]bool) + } + if r.TryDecodeAsNil() { + if x.FptrMapUint64Bool != nil { + x.FptrMapUint64Bool = nil + } + } else { + if x.FptrMapUint64Bool == nil { + x.FptrMapUint64Bool = new(map[uint64]bool) + } + yym707 := z.DecBinary() + _ = yym707 + if false { + } else { + z.F.DecMapUint64BoolX(x.FptrMapUint64Bool, d) + } + } + case "FMapUintptrIntf": + if r.TryDecodeAsNil() { + x.FMapUintptrIntf = nil + } else { + yyv708 := &x.FMapUintptrIntf + yym709 := z.DecBinary() + _ = yym709 + if false { + } else { + z.F.DecMapUintptrIntfX(yyv708, d) + } + } + case "FptrMapUintptrIntf": + if x.FptrMapUintptrIntf == nil { + x.FptrMapUintptrIntf = new(map[uintptr]interface{}) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintptrIntf != nil { + x.FptrMapUintptrIntf = nil + } + } else { + if x.FptrMapUintptrIntf == nil { + x.FptrMapUintptrIntf = new(map[uintptr]interface{}) + } + yym711 := z.DecBinary() + _ = yym711 + if false { + } else { + z.F.DecMapUintptrIntfX(x.FptrMapUintptrIntf, d) + } + } + case "FMapUintptrString": + if r.TryDecodeAsNil() { + x.FMapUintptrString = nil + } else { + yyv712 := &x.FMapUintptrString + yym713 := z.DecBinary() + _ = yym713 + if false { + } else { + z.F.DecMapUintptrStringX(yyv712, d) + } + } + case "FptrMapUintptrString": + if x.FptrMapUintptrString == nil { + x.FptrMapUintptrString = new(map[uintptr]string) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintptrString != nil { + x.FptrMapUintptrString = nil + } + } else { + if x.FptrMapUintptrString == nil { + x.FptrMapUintptrString = new(map[uintptr]string) + } + yym715 := z.DecBinary() + _ = yym715 + if false { + } else { + z.F.DecMapUintptrStringX(x.FptrMapUintptrString, d) + } + } + case "FMapUintptrUint": + if r.TryDecodeAsNil() { + x.FMapUintptrUint = nil + } else { + yyv716 := &x.FMapUintptrUint + yym717 := z.DecBinary() + _ = yym717 + if false { + } else { + z.F.DecMapUintptrUintX(yyv716, d) + } + } + case "FptrMapUintptrUint": + if x.FptrMapUintptrUint == nil { + x.FptrMapUintptrUint = new(map[uintptr]uint) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintptrUint != nil { + x.FptrMapUintptrUint = nil + } + } else { + if x.FptrMapUintptrUint == nil { + x.FptrMapUintptrUint = new(map[uintptr]uint) + } + yym719 := z.DecBinary() + _ = yym719 + if false { + } else { + z.F.DecMapUintptrUintX(x.FptrMapUintptrUint, d) + } + } + case "FMapUintptrUint8": + if r.TryDecodeAsNil() { + x.FMapUintptrUint8 = nil + } else { + yyv720 := &x.FMapUintptrUint8 + yym721 := z.DecBinary() + _ = yym721 + if false { + } else { + z.F.DecMapUintptrUint8X(yyv720, d) + } + } + case "FptrMapUintptrUint8": + if x.FptrMapUintptrUint8 == nil { + x.FptrMapUintptrUint8 = new(map[uintptr]uint8) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintptrUint8 != nil { + x.FptrMapUintptrUint8 = nil + } + } else { + if x.FptrMapUintptrUint8 == nil { + x.FptrMapUintptrUint8 = new(map[uintptr]uint8) + } + yym723 := z.DecBinary() + _ = yym723 + if false { + } else { + z.F.DecMapUintptrUint8X(x.FptrMapUintptrUint8, d) + } + } + case "FMapUintptrUint16": + if r.TryDecodeAsNil() { + x.FMapUintptrUint16 = nil + } else { + yyv724 := &x.FMapUintptrUint16 + yym725 := z.DecBinary() + _ = yym725 + if false { + } else { + z.F.DecMapUintptrUint16X(yyv724, d) + } + } + case "FptrMapUintptrUint16": + if x.FptrMapUintptrUint16 == nil { + x.FptrMapUintptrUint16 = new(map[uintptr]uint16) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintptrUint16 != nil { + x.FptrMapUintptrUint16 = nil + } + } else { + if x.FptrMapUintptrUint16 == nil { + x.FptrMapUintptrUint16 = new(map[uintptr]uint16) + } + yym727 := z.DecBinary() + _ = yym727 + if false { + } else { + z.F.DecMapUintptrUint16X(x.FptrMapUintptrUint16, d) + } + } + case "FMapUintptrUint32": + if r.TryDecodeAsNil() { + x.FMapUintptrUint32 = nil + } else { + yyv728 := &x.FMapUintptrUint32 + yym729 := z.DecBinary() + _ = yym729 + if false { + } else { + z.F.DecMapUintptrUint32X(yyv728, d) + } + } + case "FptrMapUintptrUint32": + if x.FptrMapUintptrUint32 == nil { + x.FptrMapUintptrUint32 = new(map[uintptr]uint32) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintptrUint32 != nil { + x.FptrMapUintptrUint32 = nil + } + } else { + if x.FptrMapUintptrUint32 == nil { + x.FptrMapUintptrUint32 = new(map[uintptr]uint32) + } + yym731 := z.DecBinary() + _ = yym731 + if false { + } else { + z.F.DecMapUintptrUint32X(x.FptrMapUintptrUint32, d) + } + } + case "FMapUintptrUint64": + if r.TryDecodeAsNil() { + x.FMapUintptrUint64 = nil + } else { + yyv732 := &x.FMapUintptrUint64 + yym733 := z.DecBinary() + _ = yym733 + if false { + } else { + z.F.DecMapUintptrUint64X(yyv732, d) + } + } + case "FptrMapUintptrUint64": + if x.FptrMapUintptrUint64 == nil { + x.FptrMapUintptrUint64 = new(map[uintptr]uint64) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintptrUint64 != nil { + x.FptrMapUintptrUint64 = nil + } + } else { + if x.FptrMapUintptrUint64 == nil { + x.FptrMapUintptrUint64 = new(map[uintptr]uint64) + } + yym735 := z.DecBinary() + _ = yym735 + if false { + } else { + z.F.DecMapUintptrUint64X(x.FptrMapUintptrUint64, d) + } + } + case "FMapUintptrUintptr": + if r.TryDecodeAsNil() { + x.FMapUintptrUintptr = nil + } else { + yyv736 := &x.FMapUintptrUintptr + yym737 := z.DecBinary() + _ = yym737 + if false { + } else { + z.F.DecMapUintptrUintptrX(yyv736, d) + } + } + case "FptrMapUintptrUintptr": + if x.FptrMapUintptrUintptr == nil { + x.FptrMapUintptrUintptr = new(map[uintptr]uintptr) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintptrUintptr != nil { + x.FptrMapUintptrUintptr = nil + } + } else { + if x.FptrMapUintptrUintptr == nil { + x.FptrMapUintptrUintptr = new(map[uintptr]uintptr) + } + yym739 := z.DecBinary() + _ = yym739 + if false { + } else { + z.F.DecMapUintptrUintptrX(x.FptrMapUintptrUintptr, d) + } + } + case "FMapUintptrInt": + if r.TryDecodeAsNil() { + x.FMapUintptrInt = nil + } else { + yyv740 := &x.FMapUintptrInt + yym741 := z.DecBinary() + _ = yym741 + if false { + } else { + z.F.DecMapUintptrIntX(yyv740, d) + } + } + case "FptrMapUintptrInt": + if x.FptrMapUintptrInt == nil { + x.FptrMapUintptrInt = new(map[uintptr]int) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintptrInt != nil { + x.FptrMapUintptrInt = nil + } + } else { + if x.FptrMapUintptrInt == nil { + x.FptrMapUintptrInt = new(map[uintptr]int) + } + yym743 := z.DecBinary() + _ = yym743 + if false { + } else { + z.F.DecMapUintptrIntX(x.FptrMapUintptrInt, d) + } + } + case "FMapUintptrInt8": + if r.TryDecodeAsNil() { + x.FMapUintptrInt8 = nil + } else { + yyv744 := &x.FMapUintptrInt8 + yym745 := z.DecBinary() + _ = yym745 + if false { + } else { + z.F.DecMapUintptrInt8X(yyv744, d) + } + } + case "FptrMapUintptrInt8": + if x.FptrMapUintptrInt8 == nil { + x.FptrMapUintptrInt8 = new(map[uintptr]int8) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintptrInt8 != nil { + x.FptrMapUintptrInt8 = nil + } + } else { + if x.FptrMapUintptrInt8 == nil { + x.FptrMapUintptrInt8 = new(map[uintptr]int8) + } + yym747 := z.DecBinary() + _ = yym747 + if false { + } else { + z.F.DecMapUintptrInt8X(x.FptrMapUintptrInt8, d) + } + } + case "FMapUintptrInt16": + if r.TryDecodeAsNil() { + x.FMapUintptrInt16 = nil + } else { + yyv748 := &x.FMapUintptrInt16 + yym749 := z.DecBinary() + _ = yym749 + if false { + } else { + z.F.DecMapUintptrInt16X(yyv748, d) + } + } + case "FptrMapUintptrInt16": + if x.FptrMapUintptrInt16 == nil { + x.FptrMapUintptrInt16 = new(map[uintptr]int16) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintptrInt16 != nil { + x.FptrMapUintptrInt16 = nil + } + } else { + if x.FptrMapUintptrInt16 == nil { + x.FptrMapUintptrInt16 = new(map[uintptr]int16) + } + yym751 := z.DecBinary() + _ = yym751 + if false { + } else { + z.F.DecMapUintptrInt16X(x.FptrMapUintptrInt16, d) + } + } + case "FMapUintptrInt32": + if r.TryDecodeAsNil() { + x.FMapUintptrInt32 = nil + } else { + yyv752 := &x.FMapUintptrInt32 + yym753 := z.DecBinary() + _ = yym753 + if false { + } else { + z.F.DecMapUintptrInt32X(yyv752, d) + } + } + case "FptrMapUintptrInt32": + if x.FptrMapUintptrInt32 == nil { + x.FptrMapUintptrInt32 = new(map[uintptr]int32) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintptrInt32 != nil { + x.FptrMapUintptrInt32 = nil + } + } else { + if x.FptrMapUintptrInt32 == nil { + x.FptrMapUintptrInt32 = new(map[uintptr]int32) + } + yym755 := z.DecBinary() + _ = yym755 + if false { + } else { + z.F.DecMapUintptrInt32X(x.FptrMapUintptrInt32, d) + } + } + case "FMapUintptrInt64": + if r.TryDecodeAsNil() { + x.FMapUintptrInt64 = nil + } else { + yyv756 := &x.FMapUintptrInt64 + yym757 := z.DecBinary() + _ = yym757 + if false { + } else { + z.F.DecMapUintptrInt64X(yyv756, d) + } + } + case "FptrMapUintptrInt64": + if x.FptrMapUintptrInt64 == nil { + x.FptrMapUintptrInt64 = new(map[uintptr]int64) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintptrInt64 != nil { + x.FptrMapUintptrInt64 = nil + } + } else { + if x.FptrMapUintptrInt64 == nil { + x.FptrMapUintptrInt64 = new(map[uintptr]int64) + } + yym759 := z.DecBinary() + _ = yym759 + if false { + } else { + z.F.DecMapUintptrInt64X(x.FptrMapUintptrInt64, d) + } + } + case "FMapUintptrFloat32": + if r.TryDecodeAsNil() { + x.FMapUintptrFloat32 = nil + } else { + yyv760 := &x.FMapUintptrFloat32 + yym761 := z.DecBinary() + _ = yym761 + if false { + } else { + z.F.DecMapUintptrFloat32X(yyv760, d) + } + } + case "FptrMapUintptrFloat32": + if x.FptrMapUintptrFloat32 == nil { + x.FptrMapUintptrFloat32 = new(map[uintptr]float32) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintptrFloat32 != nil { + x.FptrMapUintptrFloat32 = nil + } + } else { + if x.FptrMapUintptrFloat32 == nil { + x.FptrMapUintptrFloat32 = new(map[uintptr]float32) + } + yym763 := z.DecBinary() + _ = yym763 + if false { + } else { + z.F.DecMapUintptrFloat32X(x.FptrMapUintptrFloat32, d) + } + } + case "FMapUintptrFloat64": + if r.TryDecodeAsNil() { + x.FMapUintptrFloat64 = nil + } else { + yyv764 := &x.FMapUintptrFloat64 + yym765 := z.DecBinary() + _ = yym765 + if false { + } else { + z.F.DecMapUintptrFloat64X(yyv764, d) + } + } + case "FptrMapUintptrFloat64": + if x.FptrMapUintptrFloat64 == nil { + x.FptrMapUintptrFloat64 = new(map[uintptr]float64) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintptrFloat64 != nil { + x.FptrMapUintptrFloat64 = nil + } + } else { + if x.FptrMapUintptrFloat64 == nil { + x.FptrMapUintptrFloat64 = new(map[uintptr]float64) + } + yym767 := z.DecBinary() + _ = yym767 + if false { + } else { + z.F.DecMapUintptrFloat64X(x.FptrMapUintptrFloat64, d) + } + } + case "FMapUintptrBool": + if r.TryDecodeAsNil() { + x.FMapUintptrBool = nil + } else { + yyv768 := &x.FMapUintptrBool + yym769 := z.DecBinary() + _ = yym769 + if false { + } else { + z.F.DecMapUintptrBoolX(yyv768, d) + } + } + case "FptrMapUintptrBool": + if x.FptrMapUintptrBool == nil { + x.FptrMapUintptrBool = new(map[uintptr]bool) + } + if r.TryDecodeAsNil() { + if x.FptrMapUintptrBool != nil { + x.FptrMapUintptrBool = nil + } + } else { + if x.FptrMapUintptrBool == nil { + x.FptrMapUintptrBool = new(map[uintptr]bool) + } + yym771 := z.DecBinary() + _ = yym771 + if false { + } else { + z.F.DecMapUintptrBoolX(x.FptrMapUintptrBool, d) + } + } + case "FMapIntIntf": + if r.TryDecodeAsNil() { + x.FMapIntIntf = nil + } else { + yyv772 := &x.FMapIntIntf + yym773 := z.DecBinary() + _ = yym773 + if false { + } else { + z.F.DecMapIntIntfX(yyv772, d) + } + } + case "FptrMapIntIntf": + if x.FptrMapIntIntf == nil { + x.FptrMapIntIntf = new(map[int]interface{}) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntIntf != nil { + x.FptrMapIntIntf = nil + } + } else { + if x.FptrMapIntIntf == nil { + x.FptrMapIntIntf = new(map[int]interface{}) + } + yym775 := z.DecBinary() + _ = yym775 + if false { + } else { + z.F.DecMapIntIntfX(x.FptrMapIntIntf, d) + } + } + case "FMapIntString": + if r.TryDecodeAsNil() { + x.FMapIntString = nil + } else { + yyv776 := &x.FMapIntString + yym777 := z.DecBinary() + _ = yym777 + if false { + } else { + z.F.DecMapIntStringX(yyv776, d) + } + } + case "FptrMapIntString": + if x.FptrMapIntString == nil { + x.FptrMapIntString = new(map[int]string) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntString != nil { + x.FptrMapIntString = nil + } + } else { + if x.FptrMapIntString == nil { + x.FptrMapIntString = new(map[int]string) + } + yym779 := z.DecBinary() + _ = yym779 + if false { + } else { + z.F.DecMapIntStringX(x.FptrMapIntString, d) + } + } + case "FMapIntUint": + if r.TryDecodeAsNil() { + x.FMapIntUint = nil + } else { + yyv780 := &x.FMapIntUint + yym781 := z.DecBinary() + _ = yym781 + if false { + } else { + z.F.DecMapIntUintX(yyv780, d) + } + } + case "FptrMapIntUint": + if x.FptrMapIntUint == nil { + x.FptrMapIntUint = new(map[int]uint) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntUint != nil { + x.FptrMapIntUint = nil + } + } else { + if x.FptrMapIntUint == nil { + x.FptrMapIntUint = new(map[int]uint) + } + yym783 := z.DecBinary() + _ = yym783 + if false { + } else { + z.F.DecMapIntUintX(x.FptrMapIntUint, d) + } + } + case "FMapIntUint8": + if r.TryDecodeAsNil() { + x.FMapIntUint8 = nil + } else { + yyv784 := &x.FMapIntUint8 + yym785 := z.DecBinary() + _ = yym785 + if false { + } else { + z.F.DecMapIntUint8X(yyv784, d) + } + } + case "FptrMapIntUint8": + if x.FptrMapIntUint8 == nil { + x.FptrMapIntUint8 = new(map[int]uint8) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntUint8 != nil { + x.FptrMapIntUint8 = nil + } + } else { + if x.FptrMapIntUint8 == nil { + x.FptrMapIntUint8 = new(map[int]uint8) + } + yym787 := z.DecBinary() + _ = yym787 + if false { + } else { + z.F.DecMapIntUint8X(x.FptrMapIntUint8, d) + } + } + case "FMapIntUint16": + if r.TryDecodeAsNil() { + x.FMapIntUint16 = nil + } else { + yyv788 := &x.FMapIntUint16 + yym789 := z.DecBinary() + _ = yym789 + if false { + } else { + z.F.DecMapIntUint16X(yyv788, d) + } + } + case "FptrMapIntUint16": + if x.FptrMapIntUint16 == nil { + x.FptrMapIntUint16 = new(map[int]uint16) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntUint16 != nil { + x.FptrMapIntUint16 = nil + } + } else { + if x.FptrMapIntUint16 == nil { + x.FptrMapIntUint16 = new(map[int]uint16) + } + yym791 := z.DecBinary() + _ = yym791 + if false { + } else { + z.F.DecMapIntUint16X(x.FptrMapIntUint16, d) + } + } + case "FMapIntUint32": + if r.TryDecodeAsNil() { + x.FMapIntUint32 = nil + } else { + yyv792 := &x.FMapIntUint32 + yym793 := z.DecBinary() + _ = yym793 + if false { + } else { + z.F.DecMapIntUint32X(yyv792, d) + } + } + case "FptrMapIntUint32": + if x.FptrMapIntUint32 == nil { + x.FptrMapIntUint32 = new(map[int]uint32) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntUint32 != nil { + x.FptrMapIntUint32 = nil + } + } else { + if x.FptrMapIntUint32 == nil { + x.FptrMapIntUint32 = new(map[int]uint32) + } + yym795 := z.DecBinary() + _ = yym795 + if false { + } else { + z.F.DecMapIntUint32X(x.FptrMapIntUint32, d) + } + } + case "FMapIntUint64": + if r.TryDecodeAsNil() { + x.FMapIntUint64 = nil + } else { + yyv796 := &x.FMapIntUint64 + yym797 := z.DecBinary() + _ = yym797 + if false { + } else { + z.F.DecMapIntUint64X(yyv796, d) + } + } + case "FptrMapIntUint64": + if x.FptrMapIntUint64 == nil { + x.FptrMapIntUint64 = new(map[int]uint64) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntUint64 != nil { + x.FptrMapIntUint64 = nil + } + } else { + if x.FptrMapIntUint64 == nil { + x.FptrMapIntUint64 = new(map[int]uint64) + } + yym799 := z.DecBinary() + _ = yym799 + if false { + } else { + z.F.DecMapIntUint64X(x.FptrMapIntUint64, d) + } + } + case "FMapIntUintptr": + if r.TryDecodeAsNil() { + x.FMapIntUintptr = nil + } else { + yyv800 := &x.FMapIntUintptr + yym801 := z.DecBinary() + _ = yym801 + if false { + } else { + z.F.DecMapIntUintptrX(yyv800, d) + } + } + case "FptrMapIntUintptr": + if x.FptrMapIntUintptr == nil { + x.FptrMapIntUintptr = new(map[int]uintptr) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntUintptr != nil { + x.FptrMapIntUintptr = nil + } + } else { + if x.FptrMapIntUintptr == nil { + x.FptrMapIntUintptr = new(map[int]uintptr) + } + yym803 := z.DecBinary() + _ = yym803 + if false { + } else { + z.F.DecMapIntUintptrX(x.FptrMapIntUintptr, d) + } + } + case "FMapIntInt": + if r.TryDecodeAsNil() { + x.FMapIntInt = nil + } else { + yyv804 := &x.FMapIntInt + yym805 := z.DecBinary() + _ = yym805 + if false { + } else { + z.F.DecMapIntIntX(yyv804, d) + } + } + case "FptrMapIntInt": + if x.FptrMapIntInt == nil { + x.FptrMapIntInt = new(map[int]int) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntInt != nil { + x.FptrMapIntInt = nil + } + } else { + if x.FptrMapIntInt == nil { + x.FptrMapIntInt = new(map[int]int) + } + yym807 := z.DecBinary() + _ = yym807 + if false { + } else { + z.F.DecMapIntIntX(x.FptrMapIntInt, d) + } + } + case "FMapIntInt8": + if r.TryDecodeAsNil() { + x.FMapIntInt8 = nil + } else { + yyv808 := &x.FMapIntInt8 + yym809 := z.DecBinary() + _ = yym809 + if false { + } else { + z.F.DecMapIntInt8X(yyv808, d) + } + } + case "FptrMapIntInt8": + if x.FptrMapIntInt8 == nil { + x.FptrMapIntInt8 = new(map[int]int8) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntInt8 != nil { + x.FptrMapIntInt8 = nil + } + } else { + if x.FptrMapIntInt8 == nil { + x.FptrMapIntInt8 = new(map[int]int8) + } + yym811 := z.DecBinary() + _ = yym811 + if false { + } else { + z.F.DecMapIntInt8X(x.FptrMapIntInt8, d) + } + } + case "FMapIntInt16": + if r.TryDecodeAsNil() { + x.FMapIntInt16 = nil + } else { + yyv812 := &x.FMapIntInt16 + yym813 := z.DecBinary() + _ = yym813 + if false { + } else { + z.F.DecMapIntInt16X(yyv812, d) + } + } + case "FptrMapIntInt16": + if x.FptrMapIntInt16 == nil { + x.FptrMapIntInt16 = new(map[int]int16) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntInt16 != nil { + x.FptrMapIntInt16 = nil + } + } else { + if x.FptrMapIntInt16 == nil { + x.FptrMapIntInt16 = new(map[int]int16) + } + yym815 := z.DecBinary() + _ = yym815 + if false { + } else { + z.F.DecMapIntInt16X(x.FptrMapIntInt16, d) + } + } + case "FMapIntInt32": + if r.TryDecodeAsNil() { + x.FMapIntInt32 = nil + } else { + yyv816 := &x.FMapIntInt32 + yym817 := z.DecBinary() + _ = yym817 + if false { + } else { + z.F.DecMapIntInt32X(yyv816, d) + } + } + case "FptrMapIntInt32": + if x.FptrMapIntInt32 == nil { + x.FptrMapIntInt32 = new(map[int]int32) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntInt32 != nil { + x.FptrMapIntInt32 = nil + } + } else { + if x.FptrMapIntInt32 == nil { + x.FptrMapIntInt32 = new(map[int]int32) + } + yym819 := z.DecBinary() + _ = yym819 + if false { + } else { + z.F.DecMapIntInt32X(x.FptrMapIntInt32, d) + } + } + case "FMapIntInt64": + if r.TryDecodeAsNil() { + x.FMapIntInt64 = nil + } else { + yyv820 := &x.FMapIntInt64 + yym821 := z.DecBinary() + _ = yym821 + if false { + } else { + z.F.DecMapIntInt64X(yyv820, d) + } + } + case "FptrMapIntInt64": + if x.FptrMapIntInt64 == nil { + x.FptrMapIntInt64 = new(map[int]int64) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntInt64 != nil { + x.FptrMapIntInt64 = nil + } + } else { + if x.FptrMapIntInt64 == nil { + x.FptrMapIntInt64 = new(map[int]int64) + } + yym823 := z.DecBinary() + _ = yym823 + if false { + } else { + z.F.DecMapIntInt64X(x.FptrMapIntInt64, d) + } + } + case "FMapIntFloat32": + if r.TryDecodeAsNil() { + x.FMapIntFloat32 = nil + } else { + yyv824 := &x.FMapIntFloat32 + yym825 := z.DecBinary() + _ = yym825 + if false { + } else { + z.F.DecMapIntFloat32X(yyv824, d) + } + } + case "FptrMapIntFloat32": + if x.FptrMapIntFloat32 == nil { + x.FptrMapIntFloat32 = new(map[int]float32) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntFloat32 != nil { + x.FptrMapIntFloat32 = nil + } + } else { + if x.FptrMapIntFloat32 == nil { + x.FptrMapIntFloat32 = new(map[int]float32) + } + yym827 := z.DecBinary() + _ = yym827 + if false { + } else { + z.F.DecMapIntFloat32X(x.FptrMapIntFloat32, d) + } + } + case "FMapIntFloat64": + if r.TryDecodeAsNil() { + x.FMapIntFloat64 = nil + } else { + yyv828 := &x.FMapIntFloat64 + yym829 := z.DecBinary() + _ = yym829 + if false { + } else { + z.F.DecMapIntFloat64X(yyv828, d) + } + } + case "FptrMapIntFloat64": + if x.FptrMapIntFloat64 == nil { + x.FptrMapIntFloat64 = new(map[int]float64) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntFloat64 != nil { + x.FptrMapIntFloat64 = nil + } + } else { + if x.FptrMapIntFloat64 == nil { + x.FptrMapIntFloat64 = new(map[int]float64) + } + yym831 := z.DecBinary() + _ = yym831 + if false { + } else { + z.F.DecMapIntFloat64X(x.FptrMapIntFloat64, d) + } + } + case "FMapIntBool": + if r.TryDecodeAsNil() { + x.FMapIntBool = nil + } else { + yyv832 := &x.FMapIntBool + yym833 := z.DecBinary() + _ = yym833 + if false { + } else { + z.F.DecMapIntBoolX(yyv832, d) + } + } + case "FptrMapIntBool": + if x.FptrMapIntBool == nil { + x.FptrMapIntBool = new(map[int]bool) + } + if r.TryDecodeAsNil() { + if x.FptrMapIntBool != nil { + x.FptrMapIntBool = nil + } + } else { + if x.FptrMapIntBool == nil { + x.FptrMapIntBool = new(map[int]bool) + } + yym835 := z.DecBinary() + _ = yym835 + if false { + } else { + z.F.DecMapIntBoolX(x.FptrMapIntBool, d) + } + } + case "FMapInt8Intf": + if r.TryDecodeAsNil() { + x.FMapInt8Intf = nil + } else { + yyv836 := &x.FMapInt8Intf + yym837 := z.DecBinary() + _ = yym837 + if false { + } else { + z.F.DecMapInt8IntfX(yyv836, d) + } + } + case "FptrMapInt8Intf": + if x.FptrMapInt8Intf == nil { + x.FptrMapInt8Intf = new(map[int8]interface{}) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt8Intf != nil { + x.FptrMapInt8Intf = nil + } + } else { + if x.FptrMapInt8Intf == nil { + x.FptrMapInt8Intf = new(map[int8]interface{}) + } + yym839 := z.DecBinary() + _ = yym839 + if false { + } else { + z.F.DecMapInt8IntfX(x.FptrMapInt8Intf, d) + } + } + case "FMapInt8String": + if r.TryDecodeAsNil() { + x.FMapInt8String = nil + } else { + yyv840 := &x.FMapInt8String + yym841 := z.DecBinary() + _ = yym841 + if false { + } else { + z.F.DecMapInt8StringX(yyv840, d) + } + } + case "FptrMapInt8String": + if x.FptrMapInt8String == nil { + x.FptrMapInt8String = new(map[int8]string) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt8String != nil { + x.FptrMapInt8String = nil + } + } else { + if x.FptrMapInt8String == nil { + x.FptrMapInt8String = new(map[int8]string) + } + yym843 := z.DecBinary() + _ = yym843 + if false { + } else { + z.F.DecMapInt8StringX(x.FptrMapInt8String, d) + } + } + case "FMapInt8Uint": + if r.TryDecodeAsNil() { + x.FMapInt8Uint = nil + } else { + yyv844 := &x.FMapInt8Uint + yym845 := z.DecBinary() + _ = yym845 + if false { + } else { + z.F.DecMapInt8UintX(yyv844, d) + } + } + case "FptrMapInt8Uint": + if x.FptrMapInt8Uint == nil { + x.FptrMapInt8Uint = new(map[int8]uint) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt8Uint != nil { + x.FptrMapInt8Uint = nil + } + } else { + if x.FptrMapInt8Uint == nil { + x.FptrMapInt8Uint = new(map[int8]uint) + } + yym847 := z.DecBinary() + _ = yym847 + if false { + } else { + z.F.DecMapInt8UintX(x.FptrMapInt8Uint, d) + } + } + case "FMapInt8Uint8": + if r.TryDecodeAsNil() { + x.FMapInt8Uint8 = nil + } else { + yyv848 := &x.FMapInt8Uint8 + yym849 := z.DecBinary() + _ = yym849 + if false { + } else { + z.F.DecMapInt8Uint8X(yyv848, d) + } + } + case "FptrMapInt8Uint8": + if x.FptrMapInt8Uint8 == nil { + x.FptrMapInt8Uint8 = new(map[int8]uint8) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt8Uint8 != nil { + x.FptrMapInt8Uint8 = nil + } + } else { + if x.FptrMapInt8Uint8 == nil { + x.FptrMapInt8Uint8 = new(map[int8]uint8) + } + yym851 := z.DecBinary() + _ = yym851 + if false { + } else { + z.F.DecMapInt8Uint8X(x.FptrMapInt8Uint8, d) + } + } + case "FMapInt8Uint16": + if r.TryDecodeAsNil() { + x.FMapInt8Uint16 = nil + } else { + yyv852 := &x.FMapInt8Uint16 + yym853 := z.DecBinary() + _ = yym853 + if false { + } else { + z.F.DecMapInt8Uint16X(yyv852, d) + } + } + case "FptrMapInt8Uint16": + if x.FptrMapInt8Uint16 == nil { + x.FptrMapInt8Uint16 = new(map[int8]uint16) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt8Uint16 != nil { + x.FptrMapInt8Uint16 = nil + } + } else { + if x.FptrMapInt8Uint16 == nil { + x.FptrMapInt8Uint16 = new(map[int8]uint16) + } + yym855 := z.DecBinary() + _ = yym855 + if false { + } else { + z.F.DecMapInt8Uint16X(x.FptrMapInt8Uint16, d) + } + } + case "FMapInt8Uint32": + if r.TryDecodeAsNil() { + x.FMapInt8Uint32 = nil + } else { + yyv856 := &x.FMapInt8Uint32 + yym857 := z.DecBinary() + _ = yym857 + if false { + } else { + z.F.DecMapInt8Uint32X(yyv856, d) + } + } + case "FptrMapInt8Uint32": + if x.FptrMapInt8Uint32 == nil { + x.FptrMapInt8Uint32 = new(map[int8]uint32) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt8Uint32 != nil { + x.FptrMapInt8Uint32 = nil + } + } else { + if x.FptrMapInt8Uint32 == nil { + x.FptrMapInt8Uint32 = new(map[int8]uint32) + } + yym859 := z.DecBinary() + _ = yym859 + if false { + } else { + z.F.DecMapInt8Uint32X(x.FptrMapInt8Uint32, d) + } + } + case "FMapInt8Uint64": + if r.TryDecodeAsNil() { + x.FMapInt8Uint64 = nil + } else { + yyv860 := &x.FMapInt8Uint64 + yym861 := z.DecBinary() + _ = yym861 + if false { + } else { + z.F.DecMapInt8Uint64X(yyv860, d) + } + } + case "FptrMapInt8Uint64": + if x.FptrMapInt8Uint64 == nil { + x.FptrMapInt8Uint64 = new(map[int8]uint64) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt8Uint64 != nil { + x.FptrMapInt8Uint64 = nil + } + } else { + if x.FptrMapInt8Uint64 == nil { + x.FptrMapInt8Uint64 = new(map[int8]uint64) + } + yym863 := z.DecBinary() + _ = yym863 + if false { + } else { + z.F.DecMapInt8Uint64X(x.FptrMapInt8Uint64, d) + } + } + case "FMapInt8Uintptr": + if r.TryDecodeAsNil() { + x.FMapInt8Uintptr = nil + } else { + yyv864 := &x.FMapInt8Uintptr + yym865 := z.DecBinary() + _ = yym865 + if false { + } else { + z.F.DecMapInt8UintptrX(yyv864, d) + } + } + case "FptrMapInt8Uintptr": + if x.FptrMapInt8Uintptr == nil { + x.FptrMapInt8Uintptr = new(map[int8]uintptr) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt8Uintptr != nil { + x.FptrMapInt8Uintptr = nil + } + } else { + if x.FptrMapInt8Uintptr == nil { + x.FptrMapInt8Uintptr = new(map[int8]uintptr) + } + yym867 := z.DecBinary() + _ = yym867 + if false { + } else { + z.F.DecMapInt8UintptrX(x.FptrMapInt8Uintptr, d) + } + } + case "FMapInt8Int": + if r.TryDecodeAsNil() { + x.FMapInt8Int = nil + } else { + yyv868 := &x.FMapInt8Int + yym869 := z.DecBinary() + _ = yym869 + if false { + } else { + z.F.DecMapInt8IntX(yyv868, d) + } + } + case "FptrMapInt8Int": + if x.FptrMapInt8Int == nil { + x.FptrMapInt8Int = new(map[int8]int) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt8Int != nil { + x.FptrMapInt8Int = nil + } + } else { + if x.FptrMapInt8Int == nil { + x.FptrMapInt8Int = new(map[int8]int) + } + yym871 := z.DecBinary() + _ = yym871 + if false { + } else { + z.F.DecMapInt8IntX(x.FptrMapInt8Int, d) + } + } + case "FMapInt8Int8": + if r.TryDecodeAsNil() { + x.FMapInt8Int8 = nil + } else { + yyv872 := &x.FMapInt8Int8 + yym873 := z.DecBinary() + _ = yym873 + if false { + } else { + z.F.DecMapInt8Int8X(yyv872, d) + } + } + case "FptrMapInt8Int8": + if x.FptrMapInt8Int8 == nil { + x.FptrMapInt8Int8 = new(map[int8]int8) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt8Int8 != nil { + x.FptrMapInt8Int8 = nil + } + } else { + if x.FptrMapInt8Int8 == nil { + x.FptrMapInt8Int8 = new(map[int8]int8) + } + yym875 := z.DecBinary() + _ = yym875 + if false { + } else { + z.F.DecMapInt8Int8X(x.FptrMapInt8Int8, d) + } + } + case "FMapInt8Int16": + if r.TryDecodeAsNil() { + x.FMapInt8Int16 = nil + } else { + yyv876 := &x.FMapInt8Int16 + yym877 := z.DecBinary() + _ = yym877 + if false { + } else { + z.F.DecMapInt8Int16X(yyv876, d) + } + } + case "FptrMapInt8Int16": + if x.FptrMapInt8Int16 == nil { + x.FptrMapInt8Int16 = new(map[int8]int16) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt8Int16 != nil { + x.FptrMapInt8Int16 = nil + } + } else { + if x.FptrMapInt8Int16 == nil { + x.FptrMapInt8Int16 = new(map[int8]int16) + } + yym879 := z.DecBinary() + _ = yym879 + if false { + } else { + z.F.DecMapInt8Int16X(x.FptrMapInt8Int16, d) + } + } + case "FMapInt8Int32": + if r.TryDecodeAsNil() { + x.FMapInt8Int32 = nil + } else { + yyv880 := &x.FMapInt8Int32 + yym881 := z.DecBinary() + _ = yym881 + if false { + } else { + z.F.DecMapInt8Int32X(yyv880, d) + } + } + case "FptrMapInt8Int32": + if x.FptrMapInt8Int32 == nil { + x.FptrMapInt8Int32 = new(map[int8]int32) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt8Int32 != nil { + x.FptrMapInt8Int32 = nil + } + } else { + if x.FptrMapInt8Int32 == nil { + x.FptrMapInt8Int32 = new(map[int8]int32) + } + yym883 := z.DecBinary() + _ = yym883 + if false { + } else { + z.F.DecMapInt8Int32X(x.FptrMapInt8Int32, d) + } + } + case "FMapInt8Int64": + if r.TryDecodeAsNil() { + x.FMapInt8Int64 = nil + } else { + yyv884 := &x.FMapInt8Int64 + yym885 := z.DecBinary() + _ = yym885 + if false { + } else { + z.F.DecMapInt8Int64X(yyv884, d) + } + } + case "FptrMapInt8Int64": + if x.FptrMapInt8Int64 == nil { + x.FptrMapInt8Int64 = new(map[int8]int64) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt8Int64 != nil { + x.FptrMapInt8Int64 = nil + } + } else { + if x.FptrMapInt8Int64 == nil { + x.FptrMapInt8Int64 = new(map[int8]int64) + } + yym887 := z.DecBinary() + _ = yym887 + if false { + } else { + z.F.DecMapInt8Int64X(x.FptrMapInt8Int64, d) + } + } + case "FMapInt8Float32": + if r.TryDecodeAsNil() { + x.FMapInt8Float32 = nil + } else { + yyv888 := &x.FMapInt8Float32 + yym889 := z.DecBinary() + _ = yym889 + if false { + } else { + z.F.DecMapInt8Float32X(yyv888, d) + } + } + case "FptrMapInt8Float32": + if x.FptrMapInt8Float32 == nil { + x.FptrMapInt8Float32 = new(map[int8]float32) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt8Float32 != nil { + x.FptrMapInt8Float32 = nil + } + } else { + if x.FptrMapInt8Float32 == nil { + x.FptrMapInt8Float32 = new(map[int8]float32) + } + yym891 := z.DecBinary() + _ = yym891 + if false { + } else { + z.F.DecMapInt8Float32X(x.FptrMapInt8Float32, d) + } + } + case "FMapInt8Float64": + if r.TryDecodeAsNil() { + x.FMapInt8Float64 = nil + } else { + yyv892 := &x.FMapInt8Float64 + yym893 := z.DecBinary() + _ = yym893 + if false { + } else { + z.F.DecMapInt8Float64X(yyv892, d) + } + } + case "FptrMapInt8Float64": + if x.FptrMapInt8Float64 == nil { + x.FptrMapInt8Float64 = new(map[int8]float64) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt8Float64 != nil { + x.FptrMapInt8Float64 = nil + } + } else { + if x.FptrMapInt8Float64 == nil { + x.FptrMapInt8Float64 = new(map[int8]float64) + } + yym895 := z.DecBinary() + _ = yym895 + if false { + } else { + z.F.DecMapInt8Float64X(x.FptrMapInt8Float64, d) + } + } + case "FMapInt8Bool": + if r.TryDecodeAsNil() { + x.FMapInt8Bool = nil + } else { + yyv896 := &x.FMapInt8Bool + yym897 := z.DecBinary() + _ = yym897 + if false { + } else { + z.F.DecMapInt8BoolX(yyv896, d) + } + } + case "FptrMapInt8Bool": + if x.FptrMapInt8Bool == nil { + x.FptrMapInt8Bool = new(map[int8]bool) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt8Bool != nil { + x.FptrMapInt8Bool = nil + } + } else { + if x.FptrMapInt8Bool == nil { + x.FptrMapInt8Bool = new(map[int8]bool) + } + yym899 := z.DecBinary() + _ = yym899 + if false { + } else { + z.F.DecMapInt8BoolX(x.FptrMapInt8Bool, d) + } + } + case "FMapInt16Intf": + if r.TryDecodeAsNil() { + x.FMapInt16Intf = nil + } else { + yyv900 := &x.FMapInt16Intf + yym901 := z.DecBinary() + _ = yym901 + if false { + } else { + z.F.DecMapInt16IntfX(yyv900, d) + } + } + case "FptrMapInt16Intf": + if x.FptrMapInt16Intf == nil { + x.FptrMapInt16Intf = new(map[int16]interface{}) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt16Intf != nil { + x.FptrMapInt16Intf = nil + } + } else { + if x.FptrMapInt16Intf == nil { + x.FptrMapInt16Intf = new(map[int16]interface{}) + } + yym903 := z.DecBinary() + _ = yym903 + if false { + } else { + z.F.DecMapInt16IntfX(x.FptrMapInt16Intf, d) + } + } + case "FMapInt16String": + if r.TryDecodeAsNil() { + x.FMapInt16String = nil + } else { + yyv904 := &x.FMapInt16String + yym905 := z.DecBinary() + _ = yym905 + if false { + } else { + z.F.DecMapInt16StringX(yyv904, d) + } + } + case "FptrMapInt16String": + if x.FptrMapInt16String == nil { + x.FptrMapInt16String = new(map[int16]string) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt16String != nil { + x.FptrMapInt16String = nil + } + } else { + if x.FptrMapInt16String == nil { + x.FptrMapInt16String = new(map[int16]string) + } + yym907 := z.DecBinary() + _ = yym907 + if false { + } else { + z.F.DecMapInt16StringX(x.FptrMapInt16String, d) + } + } + case "FMapInt16Uint": + if r.TryDecodeAsNil() { + x.FMapInt16Uint = nil + } else { + yyv908 := &x.FMapInt16Uint + yym909 := z.DecBinary() + _ = yym909 + if false { + } else { + z.F.DecMapInt16UintX(yyv908, d) + } + } + case "FptrMapInt16Uint": + if x.FptrMapInt16Uint == nil { + x.FptrMapInt16Uint = new(map[int16]uint) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt16Uint != nil { + x.FptrMapInt16Uint = nil + } + } else { + if x.FptrMapInt16Uint == nil { + x.FptrMapInt16Uint = new(map[int16]uint) + } + yym911 := z.DecBinary() + _ = yym911 + if false { + } else { + z.F.DecMapInt16UintX(x.FptrMapInt16Uint, d) + } + } + case "FMapInt16Uint8": + if r.TryDecodeAsNil() { + x.FMapInt16Uint8 = nil + } else { + yyv912 := &x.FMapInt16Uint8 + yym913 := z.DecBinary() + _ = yym913 + if false { + } else { + z.F.DecMapInt16Uint8X(yyv912, d) + } + } + case "FptrMapInt16Uint8": + if x.FptrMapInt16Uint8 == nil { + x.FptrMapInt16Uint8 = new(map[int16]uint8) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt16Uint8 != nil { + x.FptrMapInt16Uint8 = nil + } + } else { + if x.FptrMapInt16Uint8 == nil { + x.FptrMapInt16Uint8 = new(map[int16]uint8) + } + yym915 := z.DecBinary() + _ = yym915 + if false { + } else { + z.F.DecMapInt16Uint8X(x.FptrMapInt16Uint8, d) + } + } + case "FMapInt16Uint16": + if r.TryDecodeAsNil() { + x.FMapInt16Uint16 = nil + } else { + yyv916 := &x.FMapInt16Uint16 + yym917 := z.DecBinary() + _ = yym917 + if false { + } else { + z.F.DecMapInt16Uint16X(yyv916, d) + } + } + case "FptrMapInt16Uint16": + if x.FptrMapInt16Uint16 == nil { + x.FptrMapInt16Uint16 = new(map[int16]uint16) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt16Uint16 != nil { + x.FptrMapInt16Uint16 = nil + } + } else { + if x.FptrMapInt16Uint16 == nil { + x.FptrMapInt16Uint16 = new(map[int16]uint16) + } + yym919 := z.DecBinary() + _ = yym919 + if false { + } else { + z.F.DecMapInt16Uint16X(x.FptrMapInt16Uint16, d) + } + } + case "FMapInt16Uint32": + if r.TryDecodeAsNil() { + x.FMapInt16Uint32 = nil + } else { + yyv920 := &x.FMapInt16Uint32 + yym921 := z.DecBinary() + _ = yym921 + if false { + } else { + z.F.DecMapInt16Uint32X(yyv920, d) + } + } + case "FptrMapInt16Uint32": + if x.FptrMapInt16Uint32 == nil { + x.FptrMapInt16Uint32 = new(map[int16]uint32) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt16Uint32 != nil { + x.FptrMapInt16Uint32 = nil + } + } else { + if x.FptrMapInt16Uint32 == nil { + x.FptrMapInt16Uint32 = new(map[int16]uint32) + } + yym923 := z.DecBinary() + _ = yym923 + if false { + } else { + z.F.DecMapInt16Uint32X(x.FptrMapInt16Uint32, d) + } + } + case "FMapInt16Uint64": + if r.TryDecodeAsNil() { + x.FMapInt16Uint64 = nil + } else { + yyv924 := &x.FMapInt16Uint64 + yym925 := z.DecBinary() + _ = yym925 + if false { + } else { + z.F.DecMapInt16Uint64X(yyv924, d) + } + } + case "FptrMapInt16Uint64": + if x.FptrMapInt16Uint64 == nil { + x.FptrMapInt16Uint64 = new(map[int16]uint64) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt16Uint64 != nil { + x.FptrMapInt16Uint64 = nil + } + } else { + if x.FptrMapInt16Uint64 == nil { + x.FptrMapInt16Uint64 = new(map[int16]uint64) + } + yym927 := z.DecBinary() + _ = yym927 + if false { + } else { + z.F.DecMapInt16Uint64X(x.FptrMapInt16Uint64, d) + } + } + case "FMapInt16Uintptr": + if r.TryDecodeAsNil() { + x.FMapInt16Uintptr = nil + } else { + yyv928 := &x.FMapInt16Uintptr + yym929 := z.DecBinary() + _ = yym929 + if false { + } else { + z.F.DecMapInt16UintptrX(yyv928, d) + } + } + case "FptrMapInt16Uintptr": + if x.FptrMapInt16Uintptr == nil { + x.FptrMapInt16Uintptr = new(map[int16]uintptr) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt16Uintptr != nil { + x.FptrMapInt16Uintptr = nil + } + } else { + if x.FptrMapInt16Uintptr == nil { + x.FptrMapInt16Uintptr = new(map[int16]uintptr) + } + yym931 := z.DecBinary() + _ = yym931 + if false { + } else { + z.F.DecMapInt16UintptrX(x.FptrMapInt16Uintptr, d) + } + } + case "FMapInt16Int": + if r.TryDecodeAsNil() { + x.FMapInt16Int = nil + } else { + yyv932 := &x.FMapInt16Int + yym933 := z.DecBinary() + _ = yym933 + if false { + } else { + z.F.DecMapInt16IntX(yyv932, d) + } + } + case "FptrMapInt16Int": + if x.FptrMapInt16Int == nil { + x.FptrMapInt16Int = new(map[int16]int) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt16Int != nil { + x.FptrMapInt16Int = nil + } + } else { + if x.FptrMapInt16Int == nil { + x.FptrMapInt16Int = new(map[int16]int) + } + yym935 := z.DecBinary() + _ = yym935 + if false { + } else { + z.F.DecMapInt16IntX(x.FptrMapInt16Int, d) + } + } + case "FMapInt16Int8": + if r.TryDecodeAsNil() { + x.FMapInt16Int8 = nil + } else { + yyv936 := &x.FMapInt16Int8 + yym937 := z.DecBinary() + _ = yym937 + if false { + } else { + z.F.DecMapInt16Int8X(yyv936, d) + } + } + case "FptrMapInt16Int8": + if x.FptrMapInt16Int8 == nil { + x.FptrMapInt16Int8 = new(map[int16]int8) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt16Int8 != nil { + x.FptrMapInt16Int8 = nil + } + } else { + if x.FptrMapInt16Int8 == nil { + x.FptrMapInt16Int8 = new(map[int16]int8) + } + yym939 := z.DecBinary() + _ = yym939 + if false { + } else { + z.F.DecMapInt16Int8X(x.FptrMapInt16Int8, d) + } + } + case "FMapInt16Int16": + if r.TryDecodeAsNil() { + x.FMapInt16Int16 = nil + } else { + yyv940 := &x.FMapInt16Int16 + yym941 := z.DecBinary() + _ = yym941 + if false { + } else { + z.F.DecMapInt16Int16X(yyv940, d) + } + } + case "FptrMapInt16Int16": + if x.FptrMapInt16Int16 == nil { + x.FptrMapInt16Int16 = new(map[int16]int16) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt16Int16 != nil { + x.FptrMapInt16Int16 = nil + } + } else { + if x.FptrMapInt16Int16 == nil { + x.FptrMapInt16Int16 = new(map[int16]int16) + } + yym943 := z.DecBinary() + _ = yym943 + if false { + } else { + z.F.DecMapInt16Int16X(x.FptrMapInt16Int16, d) + } + } + case "FMapInt16Int32": + if r.TryDecodeAsNil() { + x.FMapInt16Int32 = nil + } else { + yyv944 := &x.FMapInt16Int32 + yym945 := z.DecBinary() + _ = yym945 + if false { + } else { + z.F.DecMapInt16Int32X(yyv944, d) + } + } + case "FptrMapInt16Int32": + if x.FptrMapInt16Int32 == nil { + x.FptrMapInt16Int32 = new(map[int16]int32) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt16Int32 != nil { + x.FptrMapInt16Int32 = nil + } + } else { + if x.FptrMapInt16Int32 == nil { + x.FptrMapInt16Int32 = new(map[int16]int32) + } + yym947 := z.DecBinary() + _ = yym947 + if false { + } else { + z.F.DecMapInt16Int32X(x.FptrMapInt16Int32, d) + } + } + case "FMapInt16Int64": + if r.TryDecodeAsNil() { + x.FMapInt16Int64 = nil + } else { + yyv948 := &x.FMapInt16Int64 + yym949 := z.DecBinary() + _ = yym949 + if false { + } else { + z.F.DecMapInt16Int64X(yyv948, d) + } + } + case "FptrMapInt16Int64": + if x.FptrMapInt16Int64 == nil { + x.FptrMapInt16Int64 = new(map[int16]int64) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt16Int64 != nil { + x.FptrMapInt16Int64 = nil + } + } else { + if x.FptrMapInt16Int64 == nil { + x.FptrMapInt16Int64 = new(map[int16]int64) + } + yym951 := z.DecBinary() + _ = yym951 + if false { + } else { + z.F.DecMapInt16Int64X(x.FptrMapInt16Int64, d) + } + } + case "FMapInt16Float32": + if r.TryDecodeAsNil() { + x.FMapInt16Float32 = nil + } else { + yyv952 := &x.FMapInt16Float32 + yym953 := z.DecBinary() + _ = yym953 + if false { + } else { + z.F.DecMapInt16Float32X(yyv952, d) + } + } + case "FptrMapInt16Float32": + if x.FptrMapInt16Float32 == nil { + x.FptrMapInt16Float32 = new(map[int16]float32) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt16Float32 != nil { + x.FptrMapInt16Float32 = nil + } + } else { + if x.FptrMapInt16Float32 == nil { + x.FptrMapInt16Float32 = new(map[int16]float32) + } + yym955 := z.DecBinary() + _ = yym955 + if false { + } else { + z.F.DecMapInt16Float32X(x.FptrMapInt16Float32, d) + } + } + case "FMapInt16Float64": + if r.TryDecodeAsNil() { + x.FMapInt16Float64 = nil + } else { + yyv956 := &x.FMapInt16Float64 + yym957 := z.DecBinary() + _ = yym957 + if false { + } else { + z.F.DecMapInt16Float64X(yyv956, d) + } + } + case "FptrMapInt16Float64": + if x.FptrMapInt16Float64 == nil { + x.FptrMapInt16Float64 = new(map[int16]float64) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt16Float64 != nil { + x.FptrMapInt16Float64 = nil + } + } else { + if x.FptrMapInt16Float64 == nil { + x.FptrMapInt16Float64 = new(map[int16]float64) + } + yym959 := z.DecBinary() + _ = yym959 + if false { + } else { + z.F.DecMapInt16Float64X(x.FptrMapInt16Float64, d) + } + } + case "FMapInt16Bool": + if r.TryDecodeAsNil() { + x.FMapInt16Bool = nil + } else { + yyv960 := &x.FMapInt16Bool + yym961 := z.DecBinary() + _ = yym961 + if false { + } else { + z.F.DecMapInt16BoolX(yyv960, d) + } + } + case "FptrMapInt16Bool": + if x.FptrMapInt16Bool == nil { + x.FptrMapInt16Bool = new(map[int16]bool) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt16Bool != nil { + x.FptrMapInt16Bool = nil + } + } else { + if x.FptrMapInt16Bool == nil { + x.FptrMapInt16Bool = new(map[int16]bool) + } + yym963 := z.DecBinary() + _ = yym963 + if false { + } else { + z.F.DecMapInt16BoolX(x.FptrMapInt16Bool, d) + } + } + case "FMapInt32Intf": + if r.TryDecodeAsNil() { + x.FMapInt32Intf = nil + } else { + yyv964 := &x.FMapInt32Intf + yym965 := z.DecBinary() + _ = yym965 + if false { + } else { + z.F.DecMapInt32IntfX(yyv964, d) + } + } + case "FptrMapInt32Intf": + if x.FptrMapInt32Intf == nil { + x.FptrMapInt32Intf = new(map[int32]interface{}) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt32Intf != nil { + x.FptrMapInt32Intf = nil + } + } else { + if x.FptrMapInt32Intf == nil { + x.FptrMapInt32Intf = new(map[int32]interface{}) + } + yym967 := z.DecBinary() + _ = yym967 + if false { + } else { + z.F.DecMapInt32IntfX(x.FptrMapInt32Intf, d) + } + } + case "FMapInt32String": + if r.TryDecodeAsNil() { + x.FMapInt32String = nil + } else { + yyv968 := &x.FMapInt32String + yym969 := z.DecBinary() + _ = yym969 + if false { + } else { + z.F.DecMapInt32StringX(yyv968, d) + } + } + case "FptrMapInt32String": + if x.FptrMapInt32String == nil { + x.FptrMapInt32String = new(map[int32]string) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt32String != nil { + x.FptrMapInt32String = nil + } + } else { + if x.FptrMapInt32String == nil { + x.FptrMapInt32String = new(map[int32]string) + } + yym971 := z.DecBinary() + _ = yym971 + if false { + } else { + z.F.DecMapInt32StringX(x.FptrMapInt32String, d) + } + } + case "FMapInt32Uint": + if r.TryDecodeAsNil() { + x.FMapInt32Uint = nil + } else { + yyv972 := &x.FMapInt32Uint + yym973 := z.DecBinary() + _ = yym973 + if false { + } else { + z.F.DecMapInt32UintX(yyv972, d) + } + } + case "FptrMapInt32Uint": + if x.FptrMapInt32Uint == nil { + x.FptrMapInt32Uint = new(map[int32]uint) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt32Uint != nil { + x.FptrMapInt32Uint = nil + } + } else { + if x.FptrMapInt32Uint == nil { + x.FptrMapInt32Uint = new(map[int32]uint) + } + yym975 := z.DecBinary() + _ = yym975 + if false { + } else { + z.F.DecMapInt32UintX(x.FptrMapInt32Uint, d) + } + } + case "FMapInt32Uint8": + if r.TryDecodeAsNil() { + x.FMapInt32Uint8 = nil + } else { + yyv976 := &x.FMapInt32Uint8 + yym977 := z.DecBinary() + _ = yym977 + if false { + } else { + z.F.DecMapInt32Uint8X(yyv976, d) + } + } + case "FptrMapInt32Uint8": + if x.FptrMapInt32Uint8 == nil { + x.FptrMapInt32Uint8 = new(map[int32]uint8) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt32Uint8 != nil { + x.FptrMapInt32Uint8 = nil + } + } else { + if x.FptrMapInt32Uint8 == nil { + x.FptrMapInt32Uint8 = new(map[int32]uint8) + } + yym979 := z.DecBinary() + _ = yym979 + if false { + } else { + z.F.DecMapInt32Uint8X(x.FptrMapInt32Uint8, d) + } + } + case "FMapInt32Uint16": + if r.TryDecodeAsNil() { + x.FMapInt32Uint16 = nil + } else { + yyv980 := &x.FMapInt32Uint16 + yym981 := z.DecBinary() + _ = yym981 + if false { + } else { + z.F.DecMapInt32Uint16X(yyv980, d) + } + } + case "FptrMapInt32Uint16": + if x.FptrMapInt32Uint16 == nil { + x.FptrMapInt32Uint16 = new(map[int32]uint16) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt32Uint16 != nil { + x.FptrMapInt32Uint16 = nil + } + } else { + if x.FptrMapInt32Uint16 == nil { + x.FptrMapInt32Uint16 = new(map[int32]uint16) + } + yym983 := z.DecBinary() + _ = yym983 + if false { + } else { + z.F.DecMapInt32Uint16X(x.FptrMapInt32Uint16, d) + } + } + case "FMapInt32Uint32": + if r.TryDecodeAsNil() { + x.FMapInt32Uint32 = nil + } else { + yyv984 := &x.FMapInt32Uint32 + yym985 := z.DecBinary() + _ = yym985 + if false { + } else { + z.F.DecMapInt32Uint32X(yyv984, d) + } + } + case "FptrMapInt32Uint32": + if x.FptrMapInt32Uint32 == nil { + x.FptrMapInt32Uint32 = new(map[int32]uint32) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt32Uint32 != nil { + x.FptrMapInt32Uint32 = nil + } + } else { + if x.FptrMapInt32Uint32 == nil { + x.FptrMapInt32Uint32 = new(map[int32]uint32) + } + yym987 := z.DecBinary() + _ = yym987 + if false { + } else { + z.F.DecMapInt32Uint32X(x.FptrMapInt32Uint32, d) + } + } + case "FMapInt32Uint64": + if r.TryDecodeAsNil() { + x.FMapInt32Uint64 = nil + } else { + yyv988 := &x.FMapInt32Uint64 + yym989 := z.DecBinary() + _ = yym989 + if false { + } else { + z.F.DecMapInt32Uint64X(yyv988, d) + } + } + case "FptrMapInt32Uint64": + if x.FptrMapInt32Uint64 == nil { + x.FptrMapInt32Uint64 = new(map[int32]uint64) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt32Uint64 != nil { + x.FptrMapInt32Uint64 = nil + } + } else { + if x.FptrMapInt32Uint64 == nil { + x.FptrMapInt32Uint64 = new(map[int32]uint64) + } + yym991 := z.DecBinary() + _ = yym991 + if false { + } else { + z.F.DecMapInt32Uint64X(x.FptrMapInt32Uint64, d) + } + } + case "FMapInt32Uintptr": + if r.TryDecodeAsNil() { + x.FMapInt32Uintptr = nil + } else { + yyv992 := &x.FMapInt32Uintptr + yym993 := z.DecBinary() + _ = yym993 + if false { + } else { + z.F.DecMapInt32UintptrX(yyv992, d) + } + } + case "FptrMapInt32Uintptr": + if x.FptrMapInt32Uintptr == nil { + x.FptrMapInt32Uintptr = new(map[int32]uintptr) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt32Uintptr != nil { + x.FptrMapInt32Uintptr = nil + } + } else { + if x.FptrMapInt32Uintptr == nil { + x.FptrMapInt32Uintptr = new(map[int32]uintptr) + } + yym995 := z.DecBinary() + _ = yym995 + if false { + } else { + z.F.DecMapInt32UintptrX(x.FptrMapInt32Uintptr, d) + } + } + case "FMapInt32Int": + if r.TryDecodeAsNil() { + x.FMapInt32Int = nil + } else { + yyv996 := &x.FMapInt32Int + yym997 := z.DecBinary() + _ = yym997 + if false { + } else { + z.F.DecMapInt32IntX(yyv996, d) + } + } + case "FptrMapInt32Int": + if x.FptrMapInt32Int == nil { + x.FptrMapInt32Int = new(map[int32]int) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt32Int != nil { + x.FptrMapInt32Int = nil + } + } else { + if x.FptrMapInt32Int == nil { + x.FptrMapInt32Int = new(map[int32]int) + } + yym999 := z.DecBinary() + _ = yym999 + if false { + } else { + z.F.DecMapInt32IntX(x.FptrMapInt32Int, d) + } + } + case "FMapInt32Int8": + if r.TryDecodeAsNil() { + x.FMapInt32Int8 = nil + } else { + yyv1000 := &x.FMapInt32Int8 + yym1001 := z.DecBinary() + _ = yym1001 + if false { + } else { + z.F.DecMapInt32Int8X(yyv1000, d) + } + } + case "FptrMapInt32Int8": + if x.FptrMapInt32Int8 == nil { + x.FptrMapInt32Int8 = new(map[int32]int8) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt32Int8 != nil { + x.FptrMapInt32Int8 = nil + } + } else { + if x.FptrMapInt32Int8 == nil { + x.FptrMapInt32Int8 = new(map[int32]int8) + } + yym1003 := z.DecBinary() + _ = yym1003 + if false { + } else { + z.F.DecMapInt32Int8X(x.FptrMapInt32Int8, d) + } + } + case "FMapInt32Int16": + if r.TryDecodeAsNil() { + x.FMapInt32Int16 = nil + } else { + yyv1004 := &x.FMapInt32Int16 + yym1005 := z.DecBinary() + _ = yym1005 + if false { + } else { + z.F.DecMapInt32Int16X(yyv1004, d) + } + } + case "FptrMapInt32Int16": + if x.FptrMapInt32Int16 == nil { + x.FptrMapInt32Int16 = new(map[int32]int16) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt32Int16 != nil { + x.FptrMapInt32Int16 = nil + } + } else { + if x.FptrMapInt32Int16 == nil { + x.FptrMapInt32Int16 = new(map[int32]int16) + } + yym1007 := z.DecBinary() + _ = yym1007 + if false { + } else { + z.F.DecMapInt32Int16X(x.FptrMapInt32Int16, d) + } + } + case "FMapInt32Int32": + if r.TryDecodeAsNil() { + x.FMapInt32Int32 = nil + } else { + yyv1008 := &x.FMapInt32Int32 + yym1009 := z.DecBinary() + _ = yym1009 + if false { + } else { + z.F.DecMapInt32Int32X(yyv1008, d) + } + } + case "FptrMapInt32Int32": + if x.FptrMapInt32Int32 == nil { + x.FptrMapInt32Int32 = new(map[int32]int32) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt32Int32 != nil { + x.FptrMapInt32Int32 = nil + } + } else { + if x.FptrMapInt32Int32 == nil { + x.FptrMapInt32Int32 = new(map[int32]int32) + } + yym1011 := z.DecBinary() + _ = yym1011 + if false { + } else { + z.F.DecMapInt32Int32X(x.FptrMapInt32Int32, d) + } + } + case "FMapInt32Int64": + if r.TryDecodeAsNil() { + x.FMapInt32Int64 = nil + } else { + yyv1012 := &x.FMapInt32Int64 + yym1013 := z.DecBinary() + _ = yym1013 + if false { + } else { + z.F.DecMapInt32Int64X(yyv1012, d) + } + } + case "FptrMapInt32Int64": + if x.FptrMapInt32Int64 == nil { + x.FptrMapInt32Int64 = new(map[int32]int64) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt32Int64 != nil { + x.FptrMapInt32Int64 = nil + } + } else { + if x.FptrMapInt32Int64 == nil { + x.FptrMapInt32Int64 = new(map[int32]int64) + } + yym1015 := z.DecBinary() + _ = yym1015 + if false { + } else { + z.F.DecMapInt32Int64X(x.FptrMapInt32Int64, d) + } + } + case "FMapInt32Float32": + if r.TryDecodeAsNil() { + x.FMapInt32Float32 = nil + } else { + yyv1016 := &x.FMapInt32Float32 + yym1017 := z.DecBinary() + _ = yym1017 + if false { + } else { + z.F.DecMapInt32Float32X(yyv1016, d) + } + } + case "FptrMapInt32Float32": + if x.FptrMapInt32Float32 == nil { + x.FptrMapInt32Float32 = new(map[int32]float32) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt32Float32 != nil { + x.FptrMapInt32Float32 = nil + } + } else { + if x.FptrMapInt32Float32 == nil { + x.FptrMapInt32Float32 = new(map[int32]float32) + } + yym1019 := z.DecBinary() + _ = yym1019 + if false { + } else { + z.F.DecMapInt32Float32X(x.FptrMapInt32Float32, d) + } + } + case "FMapInt32Float64": + if r.TryDecodeAsNil() { + x.FMapInt32Float64 = nil + } else { + yyv1020 := &x.FMapInt32Float64 + yym1021 := z.DecBinary() + _ = yym1021 + if false { + } else { + z.F.DecMapInt32Float64X(yyv1020, d) + } + } + case "FptrMapInt32Float64": + if x.FptrMapInt32Float64 == nil { + x.FptrMapInt32Float64 = new(map[int32]float64) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt32Float64 != nil { + x.FptrMapInt32Float64 = nil + } + } else { + if x.FptrMapInt32Float64 == nil { + x.FptrMapInt32Float64 = new(map[int32]float64) + } + yym1023 := z.DecBinary() + _ = yym1023 + if false { + } else { + z.F.DecMapInt32Float64X(x.FptrMapInt32Float64, d) + } + } + case "FMapInt32Bool": + if r.TryDecodeAsNil() { + x.FMapInt32Bool = nil + } else { + yyv1024 := &x.FMapInt32Bool + yym1025 := z.DecBinary() + _ = yym1025 + if false { + } else { + z.F.DecMapInt32BoolX(yyv1024, d) + } + } + case "FptrMapInt32Bool": + if x.FptrMapInt32Bool == nil { + x.FptrMapInt32Bool = new(map[int32]bool) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt32Bool != nil { + x.FptrMapInt32Bool = nil + } + } else { + if x.FptrMapInt32Bool == nil { + x.FptrMapInt32Bool = new(map[int32]bool) + } + yym1027 := z.DecBinary() + _ = yym1027 + if false { + } else { + z.F.DecMapInt32BoolX(x.FptrMapInt32Bool, d) + } + } + case "FMapInt64Intf": + if r.TryDecodeAsNil() { + x.FMapInt64Intf = nil + } else { + yyv1028 := &x.FMapInt64Intf + yym1029 := z.DecBinary() + _ = yym1029 + if false { + } else { + z.F.DecMapInt64IntfX(yyv1028, d) + } + } + case "FptrMapInt64Intf": + if x.FptrMapInt64Intf == nil { + x.FptrMapInt64Intf = new(map[int64]interface{}) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt64Intf != nil { + x.FptrMapInt64Intf = nil + } + } else { + if x.FptrMapInt64Intf == nil { + x.FptrMapInt64Intf = new(map[int64]interface{}) + } + yym1031 := z.DecBinary() + _ = yym1031 + if false { + } else { + z.F.DecMapInt64IntfX(x.FptrMapInt64Intf, d) + } + } + case "FMapInt64String": + if r.TryDecodeAsNil() { + x.FMapInt64String = nil + } else { + yyv1032 := &x.FMapInt64String + yym1033 := z.DecBinary() + _ = yym1033 + if false { + } else { + z.F.DecMapInt64StringX(yyv1032, d) + } + } + case "FptrMapInt64String": + if x.FptrMapInt64String == nil { + x.FptrMapInt64String = new(map[int64]string) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt64String != nil { + x.FptrMapInt64String = nil + } + } else { + if x.FptrMapInt64String == nil { + x.FptrMapInt64String = new(map[int64]string) + } + yym1035 := z.DecBinary() + _ = yym1035 + if false { + } else { + z.F.DecMapInt64StringX(x.FptrMapInt64String, d) + } + } + case "FMapInt64Uint": + if r.TryDecodeAsNil() { + x.FMapInt64Uint = nil + } else { + yyv1036 := &x.FMapInt64Uint + yym1037 := z.DecBinary() + _ = yym1037 + if false { + } else { + z.F.DecMapInt64UintX(yyv1036, d) + } + } + case "FptrMapInt64Uint": + if x.FptrMapInt64Uint == nil { + x.FptrMapInt64Uint = new(map[int64]uint) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt64Uint != nil { + x.FptrMapInt64Uint = nil + } + } else { + if x.FptrMapInt64Uint == nil { + x.FptrMapInt64Uint = new(map[int64]uint) + } + yym1039 := z.DecBinary() + _ = yym1039 + if false { + } else { + z.F.DecMapInt64UintX(x.FptrMapInt64Uint, d) + } + } + case "FMapInt64Uint8": + if r.TryDecodeAsNil() { + x.FMapInt64Uint8 = nil + } else { + yyv1040 := &x.FMapInt64Uint8 + yym1041 := z.DecBinary() + _ = yym1041 + if false { + } else { + z.F.DecMapInt64Uint8X(yyv1040, d) + } + } + case "FptrMapInt64Uint8": + if x.FptrMapInt64Uint8 == nil { + x.FptrMapInt64Uint8 = new(map[int64]uint8) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt64Uint8 != nil { + x.FptrMapInt64Uint8 = nil + } + } else { + if x.FptrMapInt64Uint8 == nil { + x.FptrMapInt64Uint8 = new(map[int64]uint8) + } + yym1043 := z.DecBinary() + _ = yym1043 + if false { + } else { + z.F.DecMapInt64Uint8X(x.FptrMapInt64Uint8, d) + } + } + case "FMapInt64Uint16": + if r.TryDecodeAsNil() { + x.FMapInt64Uint16 = nil + } else { + yyv1044 := &x.FMapInt64Uint16 + yym1045 := z.DecBinary() + _ = yym1045 + if false { + } else { + z.F.DecMapInt64Uint16X(yyv1044, d) + } + } + case "FptrMapInt64Uint16": + if x.FptrMapInt64Uint16 == nil { + x.FptrMapInt64Uint16 = new(map[int64]uint16) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt64Uint16 != nil { + x.FptrMapInt64Uint16 = nil + } + } else { + if x.FptrMapInt64Uint16 == nil { + x.FptrMapInt64Uint16 = new(map[int64]uint16) + } + yym1047 := z.DecBinary() + _ = yym1047 + if false { + } else { + z.F.DecMapInt64Uint16X(x.FptrMapInt64Uint16, d) + } + } + case "FMapInt64Uint32": + if r.TryDecodeAsNil() { + x.FMapInt64Uint32 = nil + } else { + yyv1048 := &x.FMapInt64Uint32 + yym1049 := z.DecBinary() + _ = yym1049 + if false { + } else { + z.F.DecMapInt64Uint32X(yyv1048, d) + } + } + case "FptrMapInt64Uint32": + if x.FptrMapInt64Uint32 == nil { + x.FptrMapInt64Uint32 = new(map[int64]uint32) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt64Uint32 != nil { + x.FptrMapInt64Uint32 = nil + } + } else { + if x.FptrMapInt64Uint32 == nil { + x.FptrMapInt64Uint32 = new(map[int64]uint32) + } + yym1051 := z.DecBinary() + _ = yym1051 + if false { + } else { + z.F.DecMapInt64Uint32X(x.FptrMapInt64Uint32, d) + } + } + case "FMapInt64Uint64": + if r.TryDecodeAsNil() { + x.FMapInt64Uint64 = nil + } else { + yyv1052 := &x.FMapInt64Uint64 + yym1053 := z.DecBinary() + _ = yym1053 + if false { + } else { + z.F.DecMapInt64Uint64X(yyv1052, d) + } + } + case "FptrMapInt64Uint64": + if x.FptrMapInt64Uint64 == nil { + x.FptrMapInt64Uint64 = new(map[int64]uint64) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt64Uint64 != nil { + x.FptrMapInt64Uint64 = nil + } + } else { + if x.FptrMapInt64Uint64 == nil { + x.FptrMapInt64Uint64 = new(map[int64]uint64) + } + yym1055 := z.DecBinary() + _ = yym1055 + if false { + } else { + z.F.DecMapInt64Uint64X(x.FptrMapInt64Uint64, d) + } + } + case "FMapInt64Uintptr": + if r.TryDecodeAsNil() { + x.FMapInt64Uintptr = nil + } else { + yyv1056 := &x.FMapInt64Uintptr + yym1057 := z.DecBinary() + _ = yym1057 + if false { + } else { + z.F.DecMapInt64UintptrX(yyv1056, d) + } + } + case "FptrMapInt64Uintptr": + if x.FptrMapInt64Uintptr == nil { + x.FptrMapInt64Uintptr = new(map[int64]uintptr) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt64Uintptr != nil { + x.FptrMapInt64Uintptr = nil + } + } else { + if x.FptrMapInt64Uintptr == nil { + x.FptrMapInt64Uintptr = new(map[int64]uintptr) + } + yym1059 := z.DecBinary() + _ = yym1059 + if false { + } else { + z.F.DecMapInt64UintptrX(x.FptrMapInt64Uintptr, d) + } + } + case "FMapInt64Int": + if r.TryDecodeAsNil() { + x.FMapInt64Int = nil + } else { + yyv1060 := &x.FMapInt64Int + yym1061 := z.DecBinary() + _ = yym1061 + if false { + } else { + z.F.DecMapInt64IntX(yyv1060, d) + } + } + case "FptrMapInt64Int": + if x.FptrMapInt64Int == nil { + x.FptrMapInt64Int = new(map[int64]int) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt64Int != nil { + x.FptrMapInt64Int = nil + } + } else { + if x.FptrMapInt64Int == nil { + x.FptrMapInt64Int = new(map[int64]int) + } + yym1063 := z.DecBinary() + _ = yym1063 + if false { + } else { + z.F.DecMapInt64IntX(x.FptrMapInt64Int, d) + } + } + case "FMapInt64Int8": + if r.TryDecodeAsNil() { + x.FMapInt64Int8 = nil + } else { + yyv1064 := &x.FMapInt64Int8 + yym1065 := z.DecBinary() + _ = yym1065 + if false { + } else { + z.F.DecMapInt64Int8X(yyv1064, d) + } + } + case "FptrMapInt64Int8": + if x.FptrMapInt64Int8 == nil { + x.FptrMapInt64Int8 = new(map[int64]int8) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt64Int8 != nil { + x.FptrMapInt64Int8 = nil + } + } else { + if x.FptrMapInt64Int8 == nil { + x.FptrMapInt64Int8 = new(map[int64]int8) + } + yym1067 := z.DecBinary() + _ = yym1067 + if false { + } else { + z.F.DecMapInt64Int8X(x.FptrMapInt64Int8, d) + } + } + case "FMapInt64Int16": + if r.TryDecodeAsNil() { + x.FMapInt64Int16 = nil + } else { + yyv1068 := &x.FMapInt64Int16 + yym1069 := z.DecBinary() + _ = yym1069 + if false { + } else { + z.F.DecMapInt64Int16X(yyv1068, d) + } + } + case "FptrMapInt64Int16": + if x.FptrMapInt64Int16 == nil { + x.FptrMapInt64Int16 = new(map[int64]int16) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt64Int16 != nil { + x.FptrMapInt64Int16 = nil + } + } else { + if x.FptrMapInt64Int16 == nil { + x.FptrMapInt64Int16 = new(map[int64]int16) + } + yym1071 := z.DecBinary() + _ = yym1071 + if false { + } else { + z.F.DecMapInt64Int16X(x.FptrMapInt64Int16, d) + } + } + case "FMapInt64Int32": + if r.TryDecodeAsNil() { + x.FMapInt64Int32 = nil + } else { + yyv1072 := &x.FMapInt64Int32 + yym1073 := z.DecBinary() + _ = yym1073 + if false { + } else { + z.F.DecMapInt64Int32X(yyv1072, d) + } + } + case "FptrMapInt64Int32": + if x.FptrMapInt64Int32 == nil { + x.FptrMapInt64Int32 = new(map[int64]int32) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt64Int32 != nil { + x.FptrMapInt64Int32 = nil + } + } else { + if x.FptrMapInt64Int32 == nil { + x.FptrMapInt64Int32 = new(map[int64]int32) + } + yym1075 := z.DecBinary() + _ = yym1075 + if false { + } else { + z.F.DecMapInt64Int32X(x.FptrMapInt64Int32, d) + } + } + case "FMapInt64Int64": + if r.TryDecodeAsNil() { + x.FMapInt64Int64 = nil + } else { + yyv1076 := &x.FMapInt64Int64 + yym1077 := z.DecBinary() + _ = yym1077 + if false { + } else { + z.F.DecMapInt64Int64X(yyv1076, d) + } + } + case "FptrMapInt64Int64": + if x.FptrMapInt64Int64 == nil { + x.FptrMapInt64Int64 = new(map[int64]int64) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt64Int64 != nil { + x.FptrMapInt64Int64 = nil + } + } else { + if x.FptrMapInt64Int64 == nil { + x.FptrMapInt64Int64 = new(map[int64]int64) + } + yym1079 := z.DecBinary() + _ = yym1079 + if false { + } else { + z.F.DecMapInt64Int64X(x.FptrMapInt64Int64, d) + } + } + case "FMapInt64Float32": + if r.TryDecodeAsNil() { + x.FMapInt64Float32 = nil + } else { + yyv1080 := &x.FMapInt64Float32 + yym1081 := z.DecBinary() + _ = yym1081 + if false { + } else { + z.F.DecMapInt64Float32X(yyv1080, d) + } + } + case "FptrMapInt64Float32": + if x.FptrMapInt64Float32 == nil { + x.FptrMapInt64Float32 = new(map[int64]float32) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt64Float32 != nil { + x.FptrMapInt64Float32 = nil + } + } else { + if x.FptrMapInt64Float32 == nil { + x.FptrMapInt64Float32 = new(map[int64]float32) + } + yym1083 := z.DecBinary() + _ = yym1083 + if false { + } else { + z.F.DecMapInt64Float32X(x.FptrMapInt64Float32, d) + } + } + case "FMapInt64Float64": + if r.TryDecodeAsNil() { + x.FMapInt64Float64 = nil + } else { + yyv1084 := &x.FMapInt64Float64 + yym1085 := z.DecBinary() + _ = yym1085 + if false { + } else { + z.F.DecMapInt64Float64X(yyv1084, d) + } + } + case "FptrMapInt64Float64": + if x.FptrMapInt64Float64 == nil { + x.FptrMapInt64Float64 = new(map[int64]float64) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt64Float64 != nil { + x.FptrMapInt64Float64 = nil + } + } else { + if x.FptrMapInt64Float64 == nil { + x.FptrMapInt64Float64 = new(map[int64]float64) + } + yym1087 := z.DecBinary() + _ = yym1087 + if false { + } else { + z.F.DecMapInt64Float64X(x.FptrMapInt64Float64, d) + } + } + case "FMapInt64Bool": + if r.TryDecodeAsNil() { + x.FMapInt64Bool = nil + } else { + yyv1088 := &x.FMapInt64Bool + yym1089 := z.DecBinary() + _ = yym1089 + if false { + } else { + z.F.DecMapInt64BoolX(yyv1088, d) + } + } + case "FptrMapInt64Bool": + if x.FptrMapInt64Bool == nil { + x.FptrMapInt64Bool = new(map[int64]bool) + } + if r.TryDecodeAsNil() { + if x.FptrMapInt64Bool != nil { + x.FptrMapInt64Bool = nil + } + } else { + if x.FptrMapInt64Bool == nil { + x.FptrMapInt64Bool = new(map[int64]bool) + } + yym1091 := z.DecBinary() + _ = yym1091 + if false { + } else { + z.F.DecMapInt64BoolX(x.FptrMapInt64Bool, d) + } + } + case "FMapBoolIntf": + if r.TryDecodeAsNil() { + x.FMapBoolIntf = nil + } else { + yyv1092 := &x.FMapBoolIntf + yym1093 := z.DecBinary() + _ = yym1093 + if false { + } else { + z.F.DecMapBoolIntfX(yyv1092, d) + } + } + case "FptrMapBoolIntf": + if x.FptrMapBoolIntf == nil { + x.FptrMapBoolIntf = new(map[bool]interface{}) + } + if r.TryDecodeAsNil() { + if x.FptrMapBoolIntf != nil { + x.FptrMapBoolIntf = nil + } + } else { + if x.FptrMapBoolIntf == nil { + x.FptrMapBoolIntf = new(map[bool]interface{}) + } + yym1095 := z.DecBinary() + _ = yym1095 + if false { + } else { + z.F.DecMapBoolIntfX(x.FptrMapBoolIntf, d) + } + } + case "FMapBoolString": + if r.TryDecodeAsNil() { + x.FMapBoolString = nil + } else { + yyv1096 := &x.FMapBoolString + yym1097 := z.DecBinary() + _ = yym1097 + if false { + } else { + z.F.DecMapBoolStringX(yyv1096, d) + } + } + case "FptrMapBoolString": + if x.FptrMapBoolString == nil { + x.FptrMapBoolString = new(map[bool]string) + } + if r.TryDecodeAsNil() { + if x.FptrMapBoolString != nil { + x.FptrMapBoolString = nil + } + } else { + if x.FptrMapBoolString == nil { + x.FptrMapBoolString = new(map[bool]string) + } + yym1099 := z.DecBinary() + _ = yym1099 + if false { + } else { + z.F.DecMapBoolStringX(x.FptrMapBoolString, d) + } + } + case "FMapBoolUint": + if r.TryDecodeAsNil() { + x.FMapBoolUint = nil + } else { + yyv1100 := &x.FMapBoolUint + yym1101 := z.DecBinary() + _ = yym1101 + if false { + } else { + z.F.DecMapBoolUintX(yyv1100, d) + } + } + case "FptrMapBoolUint": + if x.FptrMapBoolUint == nil { + x.FptrMapBoolUint = new(map[bool]uint) + } + if r.TryDecodeAsNil() { + if x.FptrMapBoolUint != nil { + x.FptrMapBoolUint = nil + } + } else { + if x.FptrMapBoolUint == nil { + x.FptrMapBoolUint = new(map[bool]uint) + } + yym1103 := z.DecBinary() + _ = yym1103 + if false { + } else { + z.F.DecMapBoolUintX(x.FptrMapBoolUint, d) + } + } + case "FMapBoolUint8": + if r.TryDecodeAsNil() { + x.FMapBoolUint8 = nil + } else { + yyv1104 := &x.FMapBoolUint8 + yym1105 := z.DecBinary() + _ = yym1105 + if false { + } else { + z.F.DecMapBoolUint8X(yyv1104, d) + } + } + case "FptrMapBoolUint8": + if x.FptrMapBoolUint8 == nil { + x.FptrMapBoolUint8 = new(map[bool]uint8) + } + if r.TryDecodeAsNil() { + if x.FptrMapBoolUint8 != nil { + x.FptrMapBoolUint8 = nil + } + } else { + if x.FptrMapBoolUint8 == nil { + x.FptrMapBoolUint8 = new(map[bool]uint8) + } + yym1107 := z.DecBinary() + _ = yym1107 + if false { + } else { + z.F.DecMapBoolUint8X(x.FptrMapBoolUint8, d) + } + } + case "FMapBoolUint16": + if r.TryDecodeAsNil() { + x.FMapBoolUint16 = nil + } else { + yyv1108 := &x.FMapBoolUint16 + yym1109 := z.DecBinary() + _ = yym1109 + if false { + } else { + z.F.DecMapBoolUint16X(yyv1108, d) + } + } + case "FptrMapBoolUint16": + if x.FptrMapBoolUint16 == nil { + x.FptrMapBoolUint16 = new(map[bool]uint16) + } + if r.TryDecodeAsNil() { + if x.FptrMapBoolUint16 != nil { + x.FptrMapBoolUint16 = nil + } + } else { + if x.FptrMapBoolUint16 == nil { + x.FptrMapBoolUint16 = new(map[bool]uint16) + } + yym1111 := z.DecBinary() + _ = yym1111 + if false { + } else { + z.F.DecMapBoolUint16X(x.FptrMapBoolUint16, d) + } + } + case "FMapBoolUint32": + if r.TryDecodeAsNil() { + x.FMapBoolUint32 = nil + } else { + yyv1112 := &x.FMapBoolUint32 + yym1113 := z.DecBinary() + _ = yym1113 + if false { + } else { + z.F.DecMapBoolUint32X(yyv1112, d) + } + } + case "FptrMapBoolUint32": + if x.FptrMapBoolUint32 == nil { + x.FptrMapBoolUint32 = new(map[bool]uint32) + } + if r.TryDecodeAsNil() { + if x.FptrMapBoolUint32 != nil { + x.FptrMapBoolUint32 = nil + } + } else { + if x.FptrMapBoolUint32 == nil { + x.FptrMapBoolUint32 = new(map[bool]uint32) + } + yym1115 := z.DecBinary() + _ = yym1115 + if false { + } else { + z.F.DecMapBoolUint32X(x.FptrMapBoolUint32, d) + } + } + case "FMapBoolUint64": + if r.TryDecodeAsNil() { + x.FMapBoolUint64 = nil + } else { + yyv1116 := &x.FMapBoolUint64 + yym1117 := z.DecBinary() + _ = yym1117 + if false { + } else { + z.F.DecMapBoolUint64X(yyv1116, d) + } + } + case "FptrMapBoolUint64": + if x.FptrMapBoolUint64 == nil { + x.FptrMapBoolUint64 = new(map[bool]uint64) + } + if r.TryDecodeAsNil() { + if x.FptrMapBoolUint64 != nil { + x.FptrMapBoolUint64 = nil + } + } else { + if x.FptrMapBoolUint64 == nil { + x.FptrMapBoolUint64 = new(map[bool]uint64) + } + yym1119 := z.DecBinary() + _ = yym1119 + if false { + } else { + z.F.DecMapBoolUint64X(x.FptrMapBoolUint64, d) + } + } + case "FMapBoolUintptr": + if r.TryDecodeAsNil() { + x.FMapBoolUintptr = nil + } else { + yyv1120 := &x.FMapBoolUintptr + yym1121 := z.DecBinary() + _ = yym1121 + if false { + } else { + z.F.DecMapBoolUintptrX(yyv1120, d) + } + } + case "FptrMapBoolUintptr": + if x.FptrMapBoolUintptr == nil { + x.FptrMapBoolUintptr = new(map[bool]uintptr) + } + if r.TryDecodeAsNil() { + if x.FptrMapBoolUintptr != nil { + x.FptrMapBoolUintptr = nil + } + } else { + if x.FptrMapBoolUintptr == nil { + x.FptrMapBoolUintptr = new(map[bool]uintptr) + } + yym1123 := z.DecBinary() + _ = yym1123 + if false { + } else { + z.F.DecMapBoolUintptrX(x.FptrMapBoolUintptr, d) + } + } + case "FMapBoolInt": + if r.TryDecodeAsNil() { + x.FMapBoolInt = nil + } else { + yyv1124 := &x.FMapBoolInt + yym1125 := z.DecBinary() + _ = yym1125 + if false { + } else { + z.F.DecMapBoolIntX(yyv1124, d) + } + } + case "FptrMapBoolInt": + if x.FptrMapBoolInt == nil { + x.FptrMapBoolInt = new(map[bool]int) + } + if r.TryDecodeAsNil() { + if x.FptrMapBoolInt != nil { + x.FptrMapBoolInt = nil + } + } else { + if x.FptrMapBoolInt == nil { + x.FptrMapBoolInt = new(map[bool]int) + } + yym1127 := z.DecBinary() + _ = yym1127 + if false { + } else { + z.F.DecMapBoolIntX(x.FptrMapBoolInt, d) + } + } + case "FMapBoolInt8": + if r.TryDecodeAsNil() { + x.FMapBoolInt8 = nil + } else { + yyv1128 := &x.FMapBoolInt8 + yym1129 := z.DecBinary() + _ = yym1129 + if false { + } else { + z.F.DecMapBoolInt8X(yyv1128, d) + } + } + case "FptrMapBoolInt8": + if x.FptrMapBoolInt8 == nil { + x.FptrMapBoolInt8 = new(map[bool]int8) + } + if r.TryDecodeAsNil() { + if x.FptrMapBoolInt8 != nil { + x.FptrMapBoolInt8 = nil + } + } else { + if x.FptrMapBoolInt8 == nil { + x.FptrMapBoolInt8 = new(map[bool]int8) + } + yym1131 := z.DecBinary() + _ = yym1131 + if false { + } else { + z.F.DecMapBoolInt8X(x.FptrMapBoolInt8, d) + } + } + case "FMapBoolInt16": + if r.TryDecodeAsNil() { + x.FMapBoolInt16 = nil + } else { + yyv1132 := &x.FMapBoolInt16 + yym1133 := z.DecBinary() + _ = yym1133 + if false { + } else { + z.F.DecMapBoolInt16X(yyv1132, d) + } + } + case "FptrMapBoolInt16": + if x.FptrMapBoolInt16 == nil { + x.FptrMapBoolInt16 = new(map[bool]int16) + } + if r.TryDecodeAsNil() { + if x.FptrMapBoolInt16 != nil { + x.FptrMapBoolInt16 = nil + } + } else { + if x.FptrMapBoolInt16 == nil { + x.FptrMapBoolInt16 = new(map[bool]int16) + } + yym1135 := z.DecBinary() + _ = yym1135 + if false { + } else { + z.F.DecMapBoolInt16X(x.FptrMapBoolInt16, d) + } + } + case "FMapBoolInt32": + if r.TryDecodeAsNil() { + x.FMapBoolInt32 = nil + } else { + yyv1136 := &x.FMapBoolInt32 + yym1137 := z.DecBinary() + _ = yym1137 + if false { + } else { + z.F.DecMapBoolInt32X(yyv1136, d) + } + } + case "FptrMapBoolInt32": + if x.FptrMapBoolInt32 == nil { + x.FptrMapBoolInt32 = new(map[bool]int32) + } + if r.TryDecodeAsNil() { + if x.FptrMapBoolInt32 != nil { + x.FptrMapBoolInt32 = nil + } + } else { + if x.FptrMapBoolInt32 == nil { + x.FptrMapBoolInt32 = new(map[bool]int32) + } + yym1139 := z.DecBinary() + _ = yym1139 + if false { + } else { + z.F.DecMapBoolInt32X(x.FptrMapBoolInt32, d) + } + } + case "FMapBoolInt64": + if r.TryDecodeAsNil() { + x.FMapBoolInt64 = nil + } else { + yyv1140 := &x.FMapBoolInt64 + yym1141 := z.DecBinary() + _ = yym1141 + if false { + } else { + z.F.DecMapBoolInt64X(yyv1140, d) + } + } + case "FptrMapBoolInt64": + if x.FptrMapBoolInt64 == nil { + x.FptrMapBoolInt64 = new(map[bool]int64) + } + if r.TryDecodeAsNil() { + if x.FptrMapBoolInt64 != nil { + x.FptrMapBoolInt64 = nil + } + } else { + if x.FptrMapBoolInt64 == nil { + x.FptrMapBoolInt64 = new(map[bool]int64) + } + yym1143 := z.DecBinary() + _ = yym1143 + if false { + } else { + z.F.DecMapBoolInt64X(x.FptrMapBoolInt64, d) + } + } + case "FMapBoolFloat32": + if r.TryDecodeAsNil() { + x.FMapBoolFloat32 = nil + } else { + yyv1144 := &x.FMapBoolFloat32 + yym1145 := z.DecBinary() + _ = yym1145 + if false { + } else { + z.F.DecMapBoolFloat32X(yyv1144, d) + } + } + case "FptrMapBoolFloat32": + if x.FptrMapBoolFloat32 == nil { + x.FptrMapBoolFloat32 = new(map[bool]float32) + } + if r.TryDecodeAsNil() { + if x.FptrMapBoolFloat32 != nil { + x.FptrMapBoolFloat32 = nil + } + } else { + if x.FptrMapBoolFloat32 == nil { + x.FptrMapBoolFloat32 = new(map[bool]float32) + } + yym1147 := z.DecBinary() + _ = yym1147 + if false { + } else { + z.F.DecMapBoolFloat32X(x.FptrMapBoolFloat32, d) + } + } + case "FMapBoolFloat64": + if r.TryDecodeAsNil() { + x.FMapBoolFloat64 = nil + } else { + yyv1148 := &x.FMapBoolFloat64 + yym1149 := z.DecBinary() + _ = yym1149 + if false { + } else { + z.F.DecMapBoolFloat64X(yyv1148, d) + } + } + case "FptrMapBoolFloat64": + if x.FptrMapBoolFloat64 == nil { + x.FptrMapBoolFloat64 = new(map[bool]float64) + } + if r.TryDecodeAsNil() { + if x.FptrMapBoolFloat64 != nil { + x.FptrMapBoolFloat64 = nil + } + } else { + if x.FptrMapBoolFloat64 == nil { + x.FptrMapBoolFloat64 = new(map[bool]float64) + } + yym1151 := z.DecBinary() + _ = yym1151 + if false { + } else { + z.F.DecMapBoolFloat64X(x.FptrMapBoolFloat64, d) + } + } + case "FMapBoolBool": + if r.TryDecodeAsNil() { + x.FMapBoolBool = nil + } else { + yyv1152 := &x.FMapBoolBool + yym1153 := z.DecBinary() + _ = yym1153 + if false { + } else { + z.F.DecMapBoolBoolX(yyv1152, d) + } + } + case "FptrMapBoolBool": + if x.FptrMapBoolBool == nil { + x.FptrMapBoolBool = new(map[bool]bool) + } + if r.TryDecodeAsNil() { + if x.FptrMapBoolBool != nil { + x.FptrMapBoolBool = nil + } + } else { + if x.FptrMapBoolBool == nil { + x.FptrMapBoolBool = new(map[bool]bool) + } + yym1155 := z.DecBinary() + _ = yym1155 + 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 yyj1156 int + var yyb1156 bool + var yyhl1156 bool = l >= 0 + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FIntf = nil + } else { + yyv1157 := &x.FIntf + yym1158 := z.DecBinary() + _ = yym1158 + if false { + } else { + z.DecFallback(yyv1157, true) + } + } + if x.FptrIntf == nil { + x.FptrIntf = new(interface{}) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrIntf != nil { + x.FptrIntf = nil + } + } else { + if x.FptrIntf == nil { + x.FptrIntf = new(interface{}) + } + yym1160 := z.DecBinary() + _ = yym1160 + if false { + } else { + z.DecFallback(x.FptrIntf, true) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FString = "" + } else { + yyv1161 := &x.FString + yym1162 := z.DecBinary() + _ = yym1162 + if false { + } else { + *((*string)(yyv1161)) = r.DecodeString() + } + } + if x.FptrString == nil { + x.FptrString = new(string) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrString != nil { + x.FptrString = nil + } + } else { + if x.FptrString == nil { + x.FptrString = new(string) + } + yym1164 := z.DecBinary() + _ = yym1164 + if false { + } else { + *((*string)(x.FptrString)) = r.DecodeString() + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FFloat32 = 0 + } else { + yyv1165 := &x.FFloat32 + yym1166 := z.DecBinary() + _ = yym1166 + if false { + } else { + *((*float32)(yyv1165)) = float32(r.DecodeFloat(true)) + } + } + if x.FptrFloat32 == nil { + x.FptrFloat32 = new(float32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrFloat32 != nil { + x.FptrFloat32 = nil + } + } else { + if x.FptrFloat32 == nil { + x.FptrFloat32 = new(float32) + } + yym1168 := z.DecBinary() + _ = yym1168 + if false { + } else { + *((*float32)(x.FptrFloat32)) = float32(r.DecodeFloat(true)) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FFloat64 = 0 + } else { + yyv1169 := &x.FFloat64 + yym1170 := z.DecBinary() + _ = yym1170 + if false { + } else { + *((*float64)(yyv1169)) = float64(r.DecodeFloat(false)) + } + } + if x.FptrFloat64 == nil { + x.FptrFloat64 = new(float64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrFloat64 != nil { + x.FptrFloat64 = nil + } + } else { + if x.FptrFloat64 == nil { + x.FptrFloat64 = new(float64) + } + yym1172 := z.DecBinary() + _ = yym1172 + if false { + } else { + *((*float64)(x.FptrFloat64)) = float64(r.DecodeFloat(false)) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FUint = 0 + } else { + yyv1173 := &x.FUint + yym1174 := z.DecBinary() + _ = yym1174 + if false { + } else { + *((*uint)(yyv1173)) = uint(r.DecodeUint(codecSelferBitsize19781)) + } + } + if x.FptrUint == nil { + x.FptrUint = new(uint) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrUint != nil { + x.FptrUint = nil + } + } else { + if x.FptrUint == nil { + x.FptrUint = new(uint) + } + yym1176 := z.DecBinary() + _ = yym1176 + if false { + } else { + *((*uint)(x.FptrUint)) = uint(r.DecodeUint(codecSelferBitsize19781)) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FUint8 = 0 + } else { + yyv1177 := &x.FUint8 + yym1178 := z.DecBinary() + _ = yym1178 + if false { + } else { + *((*uint8)(yyv1177)) = uint8(r.DecodeUint(8)) + } + } + if x.FptrUint8 == nil { + x.FptrUint8 = new(uint8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrUint8 != nil { + x.FptrUint8 = nil + } + } else { + if x.FptrUint8 == nil { + x.FptrUint8 = new(uint8) + } + yym1180 := z.DecBinary() + _ = yym1180 + if false { + } else { + *((*uint8)(x.FptrUint8)) = uint8(r.DecodeUint(8)) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FUint16 = 0 + } else { + yyv1181 := &x.FUint16 + yym1182 := z.DecBinary() + _ = yym1182 + if false { + } else { + *((*uint16)(yyv1181)) = uint16(r.DecodeUint(16)) + } + } + if x.FptrUint16 == nil { + x.FptrUint16 = new(uint16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrUint16 != nil { + x.FptrUint16 = nil + } + } else { + if x.FptrUint16 == nil { + x.FptrUint16 = new(uint16) + } + yym1184 := z.DecBinary() + _ = yym1184 + if false { + } else { + *((*uint16)(x.FptrUint16)) = uint16(r.DecodeUint(16)) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FUint32 = 0 + } else { + yyv1185 := &x.FUint32 + yym1186 := z.DecBinary() + _ = yym1186 + if false { + } else { + *((*uint32)(yyv1185)) = uint32(r.DecodeUint(32)) + } + } + if x.FptrUint32 == nil { + x.FptrUint32 = new(uint32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrUint32 != nil { + x.FptrUint32 = nil + } + } else { + if x.FptrUint32 == nil { + x.FptrUint32 = new(uint32) + } + yym1188 := z.DecBinary() + _ = yym1188 + if false { + } else { + *((*uint32)(x.FptrUint32)) = uint32(r.DecodeUint(32)) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FUint64 = 0 + } else { + yyv1189 := &x.FUint64 + yym1190 := z.DecBinary() + _ = yym1190 + if false { + } else { + *((*uint64)(yyv1189)) = uint64(r.DecodeUint(64)) + } + } + if x.FptrUint64 == nil { + x.FptrUint64 = new(uint64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrUint64 != nil { + x.FptrUint64 = nil + } + } else { + if x.FptrUint64 == nil { + x.FptrUint64 = new(uint64) + } + yym1192 := z.DecBinary() + _ = yym1192 + if false { + } else { + *((*uint64)(x.FptrUint64)) = uint64(r.DecodeUint(64)) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FUintptr = 0 + } else { + yyv1193 := &x.FUintptr + yym1194 := z.DecBinary() + _ = yym1194 + if false { + } else { + *((*uintptr)(yyv1193)) = uintptr(r.DecodeUint(codecSelferBitsize19781)) + } + } + if x.FptrUintptr == nil { + x.FptrUintptr = new(uintptr) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrUintptr != nil { + x.FptrUintptr = nil + } + } else { + if x.FptrUintptr == nil { + x.FptrUintptr = new(uintptr) + } + yym1196 := z.DecBinary() + _ = yym1196 + if false { + } else { + *((*uintptr)(x.FptrUintptr)) = uintptr(r.DecodeUint(codecSelferBitsize19781)) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FInt = 0 + } else { + yyv1197 := &x.FInt + yym1198 := z.DecBinary() + _ = yym1198 + if false { + } else { + *((*int)(yyv1197)) = int(r.DecodeInt(codecSelferBitsize19781)) + } + } + if x.FptrInt == nil { + x.FptrInt = new(int) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrInt != nil { + x.FptrInt = nil + } + } else { + if x.FptrInt == nil { + x.FptrInt = new(int) + } + yym1200 := z.DecBinary() + _ = yym1200 + if false { + } else { + *((*int)(x.FptrInt)) = int(r.DecodeInt(codecSelferBitsize19781)) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FInt8 = 0 + } else { + yyv1201 := &x.FInt8 + yym1202 := z.DecBinary() + _ = yym1202 + if false { + } else { + *((*int8)(yyv1201)) = int8(r.DecodeInt(8)) + } + } + if x.FptrInt8 == nil { + x.FptrInt8 = new(int8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrInt8 != nil { + x.FptrInt8 = nil + } + } else { + if x.FptrInt8 == nil { + x.FptrInt8 = new(int8) + } + yym1204 := z.DecBinary() + _ = yym1204 + if false { + } else { + *((*int8)(x.FptrInt8)) = int8(r.DecodeInt(8)) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FInt16 = 0 + } else { + yyv1205 := &x.FInt16 + yym1206 := z.DecBinary() + _ = yym1206 + if false { + } else { + *((*int16)(yyv1205)) = int16(r.DecodeInt(16)) + } + } + if x.FptrInt16 == nil { + x.FptrInt16 = new(int16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrInt16 != nil { + x.FptrInt16 = nil + } + } else { + if x.FptrInt16 == nil { + x.FptrInt16 = new(int16) + } + yym1208 := z.DecBinary() + _ = yym1208 + if false { + } else { + *((*int16)(x.FptrInt16)) = int16(r.DecodeInt(16)) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FInt32 = 0 + } else { + yyv1209 := &x.FInt32 + yym1210 := z.DecBinary() + _ = yym1210 + if false { + } else { + *((*int32)(yyv1209)) = int32(r.DecodeInt(32)) + } + } + if x.FptrInt32 == nil { + x.FptrInt32 = new(int32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrInt32 != nil { + x.FptrInt32 = nil + } + } else { + if x.FptrInt32 == nil { + x.FptrInt32 = new(int32) + } + yym1212 := z.DecBinary() + _ = yym1212 + if false { + } else { + *((*int32)(x.FptrInt32)) = int32(r.DecodeInt(32)) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FInt64 = 0 + } else { + yyv1213 := &x.FInt64 + yym1214 := z.DecBinary() + _ = yym1214 + if false { + } else { + *((*int64)(yyv1213)) = int64(r.DecodeInt(64)) + } + } + if x.FptrInt64 == nil { + x.FptrInt64 = new(int64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrInt64 != nil { + x.FptrInt64 = nil + } + } else { + if x.FptrInt64 == nil { + x.FptrInt64 = new(int64) + } + yym1216 := z.DecBinary() + _ = yym1216 + if false { + } else { + *((*int64)(x.FptrInt64)) = int64(r.DecodeInt(64)) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FBool = false + } else { + yyv1217 := &x.FBool + yym1218 := z.DecBinary() + _ = yym1218 + if false { + } else { + *((*bool)(yyv1217)) = r.DecodeBool() + } + } + if x.FptrBool == nil { + x.FptrBool = new(bool) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrBool != nil { + x.FptrBool = nil + } + } else { + if x.FptrBool == nil { + x.FptrBool = new(bool) + } + yym1220 := z.DecBinary() + _ = yym1220 + if false { + } else { + *((*bool)(x.FptrBool)) = r.DecodeBool() + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceIntf = nil + } else { + yyv1221 := &x.FSliceIntf + yym1222 := z.DecBinary() + _ = yym1222 + if false { + } else { + z.F.DecSliceIntfX(yyv1221, d) + } + } + if x.FptrSliceIntf == nil { + x.FptrSliceIntf = new([]interface{}) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrSliceIntf != nil { + x.FptrSliceIntf = nil + } + } else { + if x.FptrSliceIntf == nil { + x.FptrSliceIntf = new([]interface{}) + } + yym1224 := z.DecBinary() + _ = yym1224 + if false { + } else { + z.F.DecSliceIntfX(x.FptrSliceIntf, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceString = nil + } else { + yyv1225 := &x.FSliceString + yym1226 := z.DecBinary() + _ = yym1226 + if false { + } else { + z.F.DecSliceStringX(yyv1225, d) + } + } + if x.FptrSliceString == nil { + x.FptrSliceString = new([]string) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrSliceString != nil { + x.FptrSliceString = nil + } + } else { + if x.FptrSliceString == nil { + x.FptrSliceString = new([]string) + } + yym1228 := z.DecBinary() + _ = yym1228 + if false { + } else { + z.F.DecSliceStringX(x.FptrSliceString, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceFloat32 = nil + } else { + yyv1229 := &x.FSliceFloat32 + yym1230 := z.DecBinary() + _ = yym1230 + if false { + } else { + z.F.DecSliceFloat32X(yyv1229, d) + } + } + if x.FptrSliceFloat32 == nil { + x.FptrSliceFloat32 = new([]float32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrSliceFloat32 != nil { + x.FptrSliceFloat32 = nil + } + } else { + if x.FptrSliceFloat32 == nil { + x.FptrSliceFloat32 = new([]float32) + } + yym1232 := z.DecBinary() + _ = yym1232 + if false { + } else { + z.F.DecSliceFloat32X(x.FptrSliceFloat32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceFloat64 = nil + } else { + yyv1233 := &x.FSliceFloat64 + yym1234 := z.DecBinary() + _ = yym1234 + if false { + } else { + z.F.DecSliceFloat64X(yyv1233, d) + } + } + if x.FptrSliceFloat64 == nil { + x.FptrSliceFloat64 = new([]float64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrSliceFloat64 != nil { + x.FptrSliceFloat64 = nil + } + } else { + if x.FptrSliceFloat64 == nil { + x.FptrSliceFloat64 = new([]float64) + } + yym1236 := z.DecBinary() + _ = yym1236 + if false { + } else { + z.F.DecSliceFloat64X(x.FptrSliceFloat64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceUint = nil + } else { + yyv1237 := &x.FSliceUint + yym1238 := z.DecBinary() + _ = yym1238 + if false { + } else { + z.F.DecSliceUintX(yyv1237, d) + } + } + if x.FptrSliceUint == nil { + x.FptrSliceUint = new([]uint) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrSliceUint != nil { + x.FptrSliceUint = nil + } + } else { + if x.FptrSliceUint == nil { + x.FptrSliceUint = new([]uint) + } + yym1240 := z.DecBinary() + _ = yym1240 + if false { + } else { + z.F.DecSliceUintX(x.FptrSliceUint, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceUint8 = nil + } else { + yyv1241 := &x.FSliceUint8 + yym1242 := z.DecBinary() + _ = yym1242 + if false { + } else { + *yyv1241 = r.DecodeBytes(*(*[]byte)(yyv1241), false) + } + } + if x.FptrSliceUint8 == nil { + x.FptrSliceUint8 = new([]uint8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrSliceUint8 != nil { + x.FptrSliceUint8 = nil + } + } else { + if x.FptrSliceUint8 == nil { + x.FptrSliceUint8 = new([]uint8) + } + yym1244 := z.DecBinary() + _ = yym1244 + if false { + } else { + *x.FptrSliceUint8 = r.DecodeBytes(*(*[]byte)(x.FptrSliceUint8), false) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceUint16 = nil + } else { + yyv1245 := &x.FSliceUint16 + yym1246 := z.DecBinary() + _ = yym1246 + if false { + } else { + z.F.DecSliceUint16X(yyv1245, d) + } + } + if x.FptrSliceUint16 == nil { + x.FptrSliceUint16 = new([]uint16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrSliceUint16 != nil { + x.FptrSliceUint16 = nil + } + } else { + if x.FptrSliceUint16 == nil { + x.FptrSliceUint16 = new([]uint16) + } + yym1248 := z.DecBinary() + _ = yym1248 + if false { + } else { + z.F.DecSliceUint16X(x.FptrSliceUint16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceUint32 = nil + } else { + yyv1249 := &x.FSliceUint32 + yym1250 := z.DecBinary() + _ = yym1250 + if false { + } else { + z.F.DecSliceUint32X(yyv1249, d) + } + } + if x.FptrSliceUint32 == nil { + x.FptrSliceUint32 = new([]uint32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrSliceUint32 != nil { + x.FptrSliceUint32 = nil + } + } else { + if x.FptrSliceUint32 == nil { + x.FptrSliceUint32 = new([]uint32) + } + yym1252 := z.DecBinary() + _ = yym1252 + if false { + } else { + z.F.DecSliceUint32X(x.FptrSliceUint32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceUint64 = nil + } else { + yyv1253 := &x.FSliceUint64 + yym1254 := z.DecBinary() + _ = yym1254 + if false { + } else { + z.F.DecSliceUint64X(yyv1253, d) + } + } + if x.FptrSliceUint64 == nil { + x.FptrSliceUint64 = new([]uint64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrSliceUint64 != nil { + x.FptrSliceUint64 = nil + } + } else { + if x.FptrSliceUint64 == nil { + x.FptrSliceUint64 = new([]uint64) + } + yym1256 := z.DecBinary() + _ = yym1256 + if false { + } else { + z.F.DecSliceUint64X(x.FptrSliceUint64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceUintptr = nil + } else { + yyv1257 := &x.FSliceUintptr + yym1258 := z.DecBinary() + _ = yym1258 + if false { + } else { + z.F.DecSliceUintptrX(yyv1257, d) + } + } + if x.FptrSliceUintptr == nil { + x.FptrSliceUintptr = new([]uintptr) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrSliceUintptr != nil { + x.FptrSliceUintptr = nil + } + } else { + if x.FptrSliceUintptr == nil { + x.FptrSliceUintptr = new([]uintptr) + } + yym1260 := z.DecBinary() + _ = yym1260 + if false { + } else { + z.F.DecSliceUintptrX(x.FptrSliceUintptr, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceInt = nil + } else { + yyv1261 := &x.FSliceInt + yym1262 := z.DecBinary() + _ = yym1262 + if false { + } else { + z.F.DecSliceIntX(yyv1261, d) + } + } + if x.FptrSliceInt == nil { + x.FptrSliceInt = new([]int) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrSliceInt != nil { + x.FptrSliceInt = nil + } + } else { + if x.FptrSliceInt == nil { + x.FptrSliceInt = new([]int) + } + yym1264 := z.DecBinary() + _ = yym1264 + if false { + } else { + z.F.DecSliceIntX(x.FptrSliceInt, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceInt8 = nil + } else { + yyv1265 := &x.FSliceInt8 + yym1266 := z.DecBinary() + _ = yym1266 + if false { + } else { + z.F.DecSliceInt8X(yyv1265, d) + } + } + if x.FptrSliceInt8 == nil { + x.FptrSliceInt8 = new([]int8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrSliceInt8 != nil { + x.FptrSliceInt8 = nil + } + } else { + if x.FptrSliceInt8 == nil { + x.FptrSliceInt8 = new([]int8) + } + yym1268 := z.DecBinary() + _ = yym1268 + if false { + } else { + z.F.DecSliceInt8X(x.FptrSliceInt8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceInt16 = nil + } else { + yyv1269 := &x.FSliceInt16 + yym1270 := z.DecBinary() + _ = yym1270 + if false { + } else { + z.F.DecSliceInt16X(yyv1269, d) + } + } + if x.FptrSliceInt16 == nil { + x.FptrSliceInt16 = new([]int16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrSliceInt16 != nil { + x.FptrSliceInt16 = nil + } + } else { + if x.FptrSliceInt16 == nil { + x.FptrSliceInt16 = new([]int16) + } + yym1272 := z.DecBinary() + _ = yym1272 + if false { + } else { + z.F.DecSliceInt16X(x.FptrSliceInt16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceInt32 = nil + } else { + yyv1273 := &x.FSliceInt32 + yym1274 := z.DecBinary() + _ = yym1274 + if false { + } else { + z.F.DecSliceInt32X(yyv1273, d) + } + } + if x.FptrSliceInt32 == nil { + x.FptrSliceInt32 = new([]int32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrSliceInt32 != nil { + x.FptrSliceInt32 = nil + } + } else { + if x.FptrSliceInt32 == nil { + x.FptrSliceInt32 = new([]int32) + } + yym1276 := z.DecBinary() + _ = yym1276 + if false { + } else { + z.F.DecSliceInt32X(x.FptrSliceInt32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceInt64 = nil + } else { + yyv1277 := &x.FSliceInt64 + yym1278 := z.DecBinary() + _ = yym1278 + if false { + } else { + z.F.DecSliceInt64X(yyv1277, d) + } + } + if x.FptrSliceInt64 == nil { + x.FptrSliceInt64 = new([]int64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrSliceInt64 != nil { + x.FptrSliceInt64 = nil + } + } else { + if x.FptrSliceInt64 == nil { + x.FptrSliceInt64 = new([]int64) + } + yym1280 := z.DecBinary() + _ = yym1280 + if false { + } else { + z.F.DecSliceInt64X(x.FptrSliceInt64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FSliceBool = nil + } else { + yyv1281 := &x.FSliceBool + yym1282 := z.DecBinary() + _ = yym1282 + if false { + } else { + z.F.DecSliceBoolX(yyv1281, d) + } + } + if x.FptrSliceBool == nil { + x.FptrSliceBool = new([]bool) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrSliceBool != nil { + x.FptrSliceBool = nil + } + } else { + if x.FptrSliceBool == nil { + x.FptrSliceBool = new([]bool) + } + yym1284 := z.DecBinary() + _ = yym1284 + if false { + } else { + z.F.DecSliceBoolX(x.FptrSliceBool, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfIntf = nil + } else { + yyv1285 := &x.FMapIntfIntf + yym1286 := z.DecBinary() + _ = yym1286 + if false { + } else { + z.F.DecMapIntfIntfX(yyv1285, d) + } + } + if x.FptrMapIntfIntf == nil { + x.FptrMapIntfIntf = new(map[interface{}]interface{}) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntfIntf != nil { + x.FptrMapIntfIntf = nil + } + } else { + if x.FptrMapIntfIntf == nil { + x.FptrMapIntfIntf = new(map[interface{}]interface{}) + } + yym1288 := z.DecBinary() + _ = yym1288 + if false { + } else { + z.F.DecMapIntfIntfX(x.FptrMapIntfIntf, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfString = nil + } else { + yyv1289 := &x.FMapIntfString + yym1290 := z.DecBinary() + _ = yym1290 + if false { + } else { + z.F.DecMapIntfStringX(yyv1289, d) + } + } + if x.FptrMapIntfString == nil { + x.FptrMapIntfString = new(map[interface{}]string) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntfString != nil { + x.FptrMapIntfString = nil + } + } else { + if x.FptrMapIntfString == nil { + x.FptrMapIntfString = new(map[interface{}]string) + } + yym1292 := z.DecBinary() + _ = yym1292 + if false { + } else { + z.F.DecMapIntfStringX(x.FptrMapIntfString, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfUint = nil + } else { + yyv1293 := &x.FMapIntfUint + yym1294 := z.DecBinary() + _ = yym1294 + if false { + } else { + z.F.DecMapIntfUintX(yyv1293, d) + } + } + if x.FptrMapIntfUint == nil { + x.FptrMapIntfUint = new(map[interface{}]uint) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntfUint != nil { + x.FptrMapIntfUint = nil + } + } else { + if x.FptrMapIntfUint == nil { + x.FptrMapIntfUint = new(map[interface{}]uint) + } + yym1296 := z.DecBinary() + _ = yym1296 + if false { + } else { + z.F.DecMapIntfUintX(x.FptrMapIntfUint, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfUint8 = nil + } else { + yyv1297 := &x.FMapIntfUint8 + yym1298 := z.DecBinary() + _ = yym1298 + if false { + } else { + z.F.DecMapIntfUint8X(yyv1297, d) + } + } + if x.FptrMapIntfUint8 == nil { + x.FptrMapIntfUint8 = new(map[interface{}]uint8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntfUint8 != nil { + x.FptrMapIntfUint8 = nil + } + } else { + if x.FptrMapIntfUint8 == nil { + x.FptrMapIntfUint8 = new(map[interface{}]uint8) + } + yym1300 := z.DecBinary() + _ = yym1300 + if false { + } else { + z.F.DecMapIntfUint8X(x.FptrMapIntfUint8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfUint16 = nil + } else { + yyv1301 := &x.FMapIntfUint16 + yym1302 := z.DecBinary() + _ = yym1302 + if false { + } else { + z.F.DecMapIntfUint16X(yyv1301, d) + } + } + if x.FptrMapIntfUint16 == nil { + x.FptrMapIntfUint16 = new(map[interface{}]uint16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntfUint16 != nil { + x.FptrMapIntfUint16 = nil + } + } else { + if x.FptrMapIntfUint16 == nil { + x.FptrMapIntfUint16 = new(map[interface{}]uint16) + } + yym1304 := z.DecBinary() + _ = yym1304 + if false { + } else { + z.F.DecMapIntfUint16X(x.FptrMapIntfUint16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfUint32 = nil + } else { + yyv1305 := &x.FMapIntfUint32 + yym1306 := z.DecBinary() + _ = yym1306 + if false { + } else { + z.F.DecMapIntfUint32X(yyv1305, d) + } + } + if x.FptrMapIntfUint32 == nil { + x.FptrMapIntfUint32 = new(map[interface{}]uint32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntfUint32 != nil { + x.FptrMapIntfUint32 = nil + } + } else { + if x.FptrMapIntfUint32 == nil { + x.FptrMapIntfUint32 = new(map[interface{}]uint32) + } + yym1308 := z.DecBinary() + _ = yym1308 + if false { + } else { + z.F.DecMapIntfUint32X(x.FptrMapIntfUint32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfUint64 = nil + } else { + yyv1309 := &x.FMapIntfUint64 + yym1310 := z.DecBinary() + _ = yym1310 + if false { + } else { + z.F.DecMapIntfUint64X(yyv1309, d) + } + } + if x.FptrMapIntfUint64 == nil { + x.FptrMapIntfUint64 = new(map[interface{}]uint64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntfUint64 != nil { + x.FptrMapIntfUint64 = nil + } + } else { + if x.FptrMapIntfUint64 == nil { + x.FptrMapIntfUint64 = new(map[interface{}]uint64) + } + yym1312 := z.DecBinary() + _ = yym1312 + if false { + } else { + z.F.DecMapIntfUint64X(x.FptrMapIntfUint64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfUintptr = nil + } else { + yyv1313 := &x.FMapIntfUintptr + yym1314 := z.DecBinary() + _ = yym1314 + if false { + } else { + z.F.DecMapIntfUintptrX(yyv1313, d) + } + } + if x.FptrMapIntfUintptr == nil { + x.FptrMapIntfUintptr = new(map[interface{}]uintptr) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntfUintptr != nil { + x.FptrMapIntfUintptr = nil + } + } else { + if x.FptrMapIntfUintptr == nil { + x.FptrMapIntfUintptr = new(map[interface{}]uintptr) + } + yym1316 := z.DecBinary() + _ = yym1316 + if false { + } else { + z.F.DecMapIntfUintptrX(x.FptrMapIntfUintptr, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfInt = nil + } else { + yyv1317 := &x.FMapIntfInt + yym1318 := z.DecBinary() + _ = yym1318 + if false { + } else { + z.F.DecMapIntfIntX(yyv1317, d) + } + } + if x.FptrMapIntfInt == nil { + x.FptrMapIntfInt = new(map[interface{}]int) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntfInt != nil { + x.FptrMapIntfInt = nil + } + } else { + if x.FptrMapIntfInt == nil { + x.FptrMapIntfInt = new(map[interface{}]int) + } + yym1320 := z.DecBinary() + _ = yym1320 + if false { + } else { + z.F.DecMapIntfIntX(x.FptrMapIntfInt, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfInt8 = nil + } else { + yyv1321 := &x.FMapIntfInt8 + yym1322 := z.DecBinary() + _ = yym1322 + if false { + } else { + z.F.DecMapIntfInt8X(yyv1321, d) + } + } + if x.FptrMapIntfInt8 == nil { + x.FptrMapIntfInt8 = new(map[interface{}]int8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntfInt8 != nil { + x.FptrMapIntfInt8 = nil + } + } else { + if x.FptrMapIntfInt8 == nil { + x.FptrMapIntfInt8 = new(map[interface{}]int8) + } + yym1324 := z.DecBinary() + _ = yym1324 + if false { + } else { + z.F.DecMapIntfInt8X(x.FptrMapIntfInt8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfInt16 = nil + } else { + yyv1325 := &x.FMapIntfInt16 + yym1326 := z.DecBinary() + _ = yym1326 + if false { + } else { + z.F.DecMapIntfInt16X(yyv1325, d) + } + } + if x.FptrMapIntfInt16 == nil { + x.FptrMapIntfInt16 = new(map[interface{}]int16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntfInt16 != nil { + x.FptrMapIntfInt16 = nil + } + } else { + if x.FptrMapIntfInt16 == nil { + x.FptrMapIntfInt16 = new(map[interface{}]int16) + } + yym1328 := z.DecBinary() + _ = yym1328 + if false { + } else { + z.F.DecMapIntfInt16X(x.FptrMapIntfInt16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfInt32 = nil + } else { + yyv1329 := &x.FMapIntfInt32 + yym1330 := z.DecBinary() + _ = yym1330 + if false { + } else { + z.F.DecMapIntfInt32X(yyv1329, d) + } + } + if x.FptrMapIntfInt32 == nil { + x.FptrMapIntfInt32 = new(map[interface{}]int32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntfInt32 != nil { + x.FptrMapIntfInt32 = nil + } + } else { + if x.FptrMapIntfInt32 == nil { + x.FptrMapIntfInt32 = new(map[interface{}]int32) + } + yym1332 := z.DecBinary() + _ = yym1332 + if false { + } else { + z.F.DecMapIntfInt32X(x.FptrMapIntfInt32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfInt64 = nil + } else { + yyv1333 := &x.FMapIntfInt64 + yym1334 := z.DecBinary() + _ = yym1334 + if false { + } else { + z.F.DecMapIntfInt64X(yyv1333, d) + } + } + if x.FptrMapIntfInt64 == nil { + x.FptrMapIntfInt64 = new(map[interface{}]int64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntfInt64 != nil { + x.FptrMapIntfInt64 = nil + } + } else { + if x.FptrMapIntfInt64 == nil { + x.FptrMapIntfInt64 = new(map[interface{}]int64) + } + yym1336 := z.DecBinary() + _ = yym1336 + if false { + } else { + z.F.DecMapIntfInt64X(x.FptrMapIntfInt64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfFloat32 = nil + } else { + yyv1337 := &x.FMapIntfFloat32 + yym1338 := z.DecBinary() + _ = yym1338 + if false { + } else { + z.F.DecMapIntfFloat32X(yyv1337, d) + } + } + if x.FptrMapIntfFloat32 == nil { + x.FptrMapIntfFloat32 = new(map[interface{}]float32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntfFloat32 != nil { + x.FptrMapIntfFloat32 = nil + } + } else { + if x.FptrMapIntfFloat32 == nil { + x.FptrMapIntfFloat32 = new(map[interface{}]float32) + } + yym1340 := z.DecBinary() + _ = yym1340 + if false { + } else { + z.F.DecMapIntfFloat32X(x.FptrMapIntfFloat32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfFloat64 = nil + } else { + yyv1341 := &x.FMapIntfFloat64 + yym1342 := z.DecBinary() + _ = yym1342 + if false { + } else { + z.F.DecMapIntfFloat64X(yyv1341, d) + } + } + if x.FptrMapIntfFloat64 == nil { + x.FptrMapIntfFloat64 = new(map[interface{}]float64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntfFloat64 != nil { + x.FptrMapIntfFloat64 = nil + } + } else { + if x.FptrMapIntfFloat64 == nil { + x.FptrMapIntfFloat64 = new(map[interface{}]float64) + } + yym1344 := z.DecBinary() + _ = yym1344 + if false { + } else { + z.F.DecMapIntfFloat64X(x.FptrMapIntfFloat64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntfBool = nil + } else { + yyv1345 := &x.FMapIntfBool + yym1346 := z.DecBinary() + _ = yym1346 + if false { + } else { + z.F.DecMapIntfBoolX(yyv1345, d) + } + } + if x.FptrMapIntfBool == nil { + x.FptrMapIntfBool = new(map[interface{}]bool) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntfBool != nil { + x.FptrMapIntfBool = nil + } + } else { + if x.FptrMapIntfBool == nil { + x.FptrMapIntfBool = new(map[interface{}]bool) + } + yym1348 := z.DecBinary() + _ = yym1348 + if false { + } else { + z.F.DecMapIntfBoolX(x.FptrMapIntfBool, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringIntf = nil + } else { + yyv1349 := &x.FMapStringIntf + yym1350 := z.DecBinary() + _ = yym1350 + if false { + } else { + z.F.DecMapStringIntfX(yyv1349, d) + } + } + if x.FptrMapStringIntf == nil { + x.FptrMapStringIntf = new(map[string]interface{}) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapStringIntf != nil { + x.FptrMapStringIntf = nil + } + } else { + if x.FptrMapStringIntf == nil { + x.FptrMapStringIntf = new(map[string]interface{}) + } + yym1352 := z.DecBinary() + _ = yym1352 + if false { + } else { + z.F.DecMapStringIntfX(x.FptrMapStringIntf, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringString = nil + } else { + yyv1353 := &x.FMapStringString + yym1354 := z.DecBinary() + _ = yym1354 + if false { + } else { + z.F.DecMapStringStringX(yyv1353, d) + } + } + if x.FptrMapStringString == nil { + x.FptrMapStringString = new(map[string]string) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapStringString != nil { + x.FptrMapStringString = nil + } + } else { + if x.FptrMapStringString == nil { + x.FptrMapStringString = new(map[string]string) + } + yym1356 := z.DecBinary() + _ = yym1356 + if false { + } else { + z.F.DecMapStringStringX(x.FptrMapStringString, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringUint = nil + } else { + yyv1357 := &x.FMapStringUint + yym1358 := z.DecBinary() + _ = yym1358 + if false { + } else { + z.F.DecMapStringUintX(yyv1357, d) + } + } + if x.FptrMapStringUint == nil { + x.FptrMapStringUint = new(map[string]uint) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapStringUint != nil { + x.FptrMapStringUint = nil + } + } else { + if x.FptrMapStringUint == nil { + x.FptrMapStringUint = new(map[string]uint) + } + yym1360 := z.DecBinary() + _ = yym1360 + if false { + } else { + z.F.DecMapStringUintX(x.FptrMapStringUint, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringUint8 = nil + } else { + yyv1361 := &x.FMapStringUint8 + yym1362 := z.DecBinary() + _ = yym1362 + if false { + } else { + z.F.DecMapStringUint8X(yyv1361, d) + } + } + if x.FptrMapStringUint8 == nil { + x.FptrMapStringUint8 = new(map[string]uint8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapStringUint8 != nil { + x.FptrMapStringUint8 = nil + } + } else { + if x.FptrMapStringUint8 == nil { + x.FptrMapStringUint8 = new(map[string]uint8) + } + yym1364 := z.DecBinary() + _ = yym1364 + if false { + } else { + z.F.DecMapStringUint8X(x.FptrMapStringUint8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringUint16 = nil + } else { + yyv1365 := &x.FMapStringUint16 + yym1366 := z.DecBinary() + _ = yym1366 + if false { + } else { + z.F.DecMapStringUint16X(yyv1365, d) + } + } + if x.FptrMapStringUint16 == nil { + x.FptrMapStringUint16 = new(map[string]uint16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapStringUint16 != nil { + x.FptrMapStringUint16 = nil + } + } else { + if x.FptrMapStringUint16 == nil { + x.FptrMapStringUint16 = new(map[string]uint16) + } + yym1368 := z.DecBinary() + _ = yym1368 + if false { + } else { + z.F.DecMapStringUint16X(x.FptrMapStringUint16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringUint32 = nil + } else { + yyv1369 := &x.FMapStringUint32 + yym1370 := z.DecBinary() + _ = yym1370 + if false { + } else { + z.F.DecMapStringUint32X(yyv1369, d) + } + } + if x.FptrMapStringUint32 == nil { + x.FptrMapStringUint32 = new(map[string]uint32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapStringUint32 != nil { + x.FptrMapStringUint32 = nil + } + } else { + if x.FptrMapStringUint32 == nil { + x.FptrMapStringUint32 = new(map[string]uint32) + } + yym1372 := z.DecBinary() + _ = yym1372 + if false { + } else { + z.F.DecMapStringUint32X(x.FptrMapStringUint32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringUint64 = nil + } else { + yyv1373 := &x.FMapStringUint64 + yym1374 := z.DecBinary() + _ = yym1374 + if false { + } else { + z.F.DecMapStringUint64X(yyv1373, d) + } + } + if x.FptrMapStringUint64 == nil { + x.FptrMapStringUint64 = new(map[string]uint64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapStringUint64 != nil { + x.FptrMapStringUint64 = nil + } + } else { + if x.FptrMapStringUint64 == nil { + x.FptrMapStringUint64 = new(map[string]uint64) + } + yym1376 := z.DecBinary() + _ = yym1376 + if false { + } else { + z.F.DecMapStringUint64X(x.FptrMapStringUint64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringUintptr = nil + } else { + yyv1377 := &x.FMapStringUintptr + yym1378 := z.DecBinary() + _ = yym1378 + if false { + } else { + z.F.DecMapStringUintptrX(yyv1377, d) + } + } + if x.FptrMapStringUintptr == nil { + x.FptrMapStringUintptr = new(map[string]uintptr) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapStringUintptr != nil { + x.FptrMapStringUintptr = nil + } + } else { + if x.FptrMapStringUintptr == nil { + x.FptrMapStringUintptr = new(map[string]uintptr) + } + yym1380 := z.DecBinary() + _ = yym1380 + if false { + } else { + z.F.DecMapStringUintptrX(x.FptrMapStringUintptr, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringInt = nil + } else { + yyv1381 := &x.FMapStringInt + yym1382 := z.DecBinary() + _ = yym1382 + if false { + } else { + z.F.DecMapStringIntX(yyv1381, d) + } + } + if x.FptrMapStringInt == nil { + x.FptrMapStringInt = new(map[string]int) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapStringInt != nil { + x.FptrMapStringInt = nil + } + } else { + if x.FptrMapStringInt == nil { + x.FptrMapStringInt = new(map[string]int) + } + yym1384 := z.DecBinary() + _ = yym1384 + if false { + } else { + z.F.DecMapStringIntX(x.FptrMapStringInt, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringInt8 = nil + } else { + yyv1385 := &x.FMapStringInt8 + yym1386 := z.DecBinary() + _ = yym1386 + if false { + } else { + z.F.DecMapStringInt8X(yyv1385, d) + } + } + if x.FptrMapStringInt8 == nil { + x.FptrMapStringInt8 = new(map[string]int8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapStringInt8 != nil { + x.FptrMapStringInt8 = nil + } + } else { + if x.FptrMapStringInt8 == nil { + x.FptrMapStringInt8 = new(map[string]int8) + } + yym1388 := z.DecBinary() + _ = yym1388 + if false { + } else { + z.F.DecMapStringInt8X(x.FptrMapStringInt8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringInt16 = nil + } else { + yyv1389 := &x.FMapStringInt16 + yym1390 := z.DecBinary() + _ = yym1390 + if false { + } else { + z.F.DecMapStringInt16X(yyv1389, d) + } + } + if x.FptrMapStringInt16 == nil { + x.FptrMapStringInt16 = new(map[string]int16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapStringInt16 != nil { + x.FptrMapStringInt16 = nil + } + } else { + if x.FptrMapStringInt16 == nil { + x.FptrMapStringInt16 = new(map[string]int16) + } + yym1392 := z.DecBinary() + _ = yym1392 + if false { + } else { + z.F.DecMapStringInt16X(x.FptrMapStringInt16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringInt32 = nil + } else { + yyv1393 := &x.FMapStringInt32 + yym1394 := z.DecBinary() + _ = yym1394 + if false { + } else { + z.F.DecMapStringInt32X(yyv1393, d) + } + } + if x.FptrMapStringInt32 == nil { + x.FptrMapStringInt32 = new(map[string]int32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapStringInt32 != nil { + x.FptrMapStringInt32 = nil + } + } else { + if x.FptrMapStringInt32 == nil { + x.FptrMapStringInt32 = new(map[string]int32) + } + yym1396 := z.DecBinary() + _ = yym1396 + if false { + } else { + z.F.DecMapStringInt32X(x.FptrMapStringInt32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringInt64 = nil + } else { + yyv1397 := &x.FMapStringInt64 + yym1398 := z.DecBinary() + _ = yym1398 + if false { + } else { + z.F.DecMapStringInt64X(yyv1397, d) + } + } + if x.FptrMapStringInt64 == nil { + x.FptrMapStringInt64 = new(map[string]int64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapStringInt64 != nil { + x.FptrMapStringInt64 = nil + } + } else { + if x.FptrMapStringInt64 == nil { + x.FptrMapStringInt64 = new(map[string]int64) + } + yym1400 := z.DecBinary() + _ = yym1400 + if false { + } else { + z.F.DecMapStringInt64X(x.FptrMapStringInt64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringFloat32 = nil + } else { + yyv1401 := &x.FMapStringFloat32 + yym1402 := z.DecBinary() + _ = yym1402 + if false { + } else { + z.F.DecMapStringFloat32X(yyv1401, d) + } + } + if x.FptrMapStringFloat32 == nil { + x.FptrMapStringFloat32 = new(map[string]float32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapStringFloat32 != nil { + x.FptrMapStringFloat32 = nil + } + } else { + if x.FptrMapStringFloat32 == nil { + x.FptrMapStringFloat32 = new(map[string]float32) + } + yym1404 := z.DecBinary() + _ = yym1404 + if false { + } else { + z.F.DecMapStringFloat32X(x.FptrMapStringFloat32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringFloat64 = nil + } else { + yyv1405 := &x.FMapStringFloat64 + yym1406 := z.DecBinary() + _ = yym1406 + if false { + } else { + z.F.DecMapStringFloat64X(yyv1405, d) + } + } + if x.FptrMapStringFloat64 == nil { + x.FptrMapStringFloat64 = new(map[string]float64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapStringFloat64 != nil { + x.FptrMapStringFloat64 = nil + } + } else { + if x.FptrMapStringFloat64 == nil { + x.FptrMapStringFloat64 = new(map[string]float64) + } + yym1408 := z.DecBinary() + _ = yym1408 + if false { + } else { + z.F.DecMapStringFloat64X(x.FptrMapStringFloat64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapStringBool = nil + } else { + yyv1409 := &x.FMapStringBool + yym1410 := z.DecBinary() + _ = yym1410 + if false { + } else { + z.F.DecMapStringBoolX(yyv1409, d) + } + } + if x.FptrMapStringBool == nil { + x.FptrMapStringBool = new(map[string]bool) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapStringBool != nil { + x.FptrMapStringBool = nil + } + } else { + if x.FptrMapStringBool == nil { + x.FptrMapStringBool = new(map[string]bool) + } + yym1412 := z.DecBinary() + _ = yym1412 + if false { + } else { + z.F.DecMapStringBoolX(x.FptrMapStringBool, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Intf = nil + } else { + yyv1413 := &x.FMapFloat32Intf + yym1414 := z.DecBinary() + _ = yym1414 + if false { + } else { + z.F.DecMapFloat32IntfX(yyv1413, d) + } + } + if x.FptrMapFloat32Intf == nil { + x.FptrMapFloat32Intf = new(map[float32]interface{}) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Intf != nil { + x.FptrMapFloat32Intf = nil + } + } else { + if x.FptrMapFloat32Intf == nil { + x.FptrMapFloat32Intf = new(map[float32]interface{}) + } + yym1416 := z.DecBinary() + _ = yym1416 + if false { + } else { + z.F.DecMapFloat32IntfX(x.FptrMapFloat32Intf, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32String = nil + } else { + yyv1417 := &x.FMapFloat32String + yym1418 := z.DecBinary() + _ = yym1418 + if false { + } else { + z.F.DecMapFloat32StringX(yyv1417, d) + } + } + if x.FptrMapFloat32String == nil { + x.FptrMapFloat32String = new(map[float32]string) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat32String != nil { + x.FptrMapFloat32String = nil + } + } else { + if x.FptrMapFloat32String == nil { + x.FptrMapFloat32String = new(map[float32]string) + } + yym1420 := z.DecBinary() + _ = yym1420 + if false { + } else { + z.F.DecMapFloat32StringX(x.FptrMapFloat32String, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Uint = nil + } else { + yyv1421 := &x.FMapFloat32Uint + yym1422 := z.DecBinary() + _ = yym1422 + if false { + } else { + z.F.DecMapFloat32UintX(yyv1421, d) + } + } + if x.FptrMapFloat32Uint == nil { + x.FptrMapFloat32Uint = new(map[float32]uint) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Uint != nil { + x.FptrMapFloat32Uint = nil + } + } else { + if x.FptrMapFloat32Uint == nil { + x.FptrMapFloat32Uint = new(map[float32]uint) + } + yym1424 := z.DecBinary() + _ = yym1424 + if false { + } else { + z.F.DecMapFloat32UintX(x.FptrMapFloat32Uint, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Uint8 = nil + } else { + yyv1425 := &x.FMapFloat32Uint8 + yym1426 := z.DecBinary() + _ = yym1426 + if false { + } else { + z.F.DecMapFloat32Uint8X(yyv1425, d) + } + } + if x.FptrMapFloat32Uint8 == nil { + x.FptrMapFloat32Uint8 = new(map[float32]uint8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Uint8 != nil { + x.FptrMapFloat32Uint8 = nil + } + } else { + if x.FptrMapFloat32Uint8 == nil { + x.FptrMapFloat32Uint8 = new(map[float32]uint8) + } + yym1428 := z.DecBinary() + _ = yym1428 + if false { + } else { + z.F.DecMapFloat32Uint8X(x.FptrMapFloat32Uint8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Uint16 = nil + } else { + yyv1429 := &x.FMapFloat32Uint16 + yym1430 := z.DecBinary() + _ = yym1430 + if false { + } else { + z.F.DecMapFloat32Uint16X(yyv1429, d) + } + } + if x.FptrMapFloat32Uint16 == nil { + x.FptrMapFloat32Uint16 = new(map[float32]uint16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Uint16 != nil { + x.FptrMapFloat32Uint16 = nil + } + } else { + if x.FptrMapFloat32Uint16 == nil { + x.FptrMapFloat32Uint16 = new(map[float32]uint16) + } + yym1432 := z.DecBinary() + _ = yym1432 + if false { + } else { + z.F.DecMapFloat32Uint16X(x.FptrMapFloat32Uint16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Uint32 = nil + } else { + yyv1433 := &x.FMapFloat32Uint32 + yym1434 := z.DecBinary() + _ = yym1434 + if false { + } else { + z.F.DecMapFloat32Uint32X(yyv1433, d) + } + } + if x.FptrMapFloat32Uint32 == nil { + x.FptrMapFloat32Uint32 = new(map[float32]uint32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Uint32 != nil { + x.FptrMapFloat32Uint32 = nil + } + } else { + if x.FptrMapFloat32Uint32 == nil { + x.FptrMapFloat32Uint32 = new(map[float32]uint32) + } + yym1436 := z.DecBinary() + _ = yym1436 + if false { + } else { + z.F.DecMapFloat32Uint32X(x.FptrMapFloat32Uint32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Uint64 = nil + } else { + yyv1437 := &x.FMapFloat32Uint64 + yym1438 := z.DecBinary() + _ = yym1438 + if false { + } else { + z.F.DecMapFloat32Uint64X(yyv1437, d) + } + } + if x.FptrMapFloat32Uint64 == nil { + x.FptrMapFloat32Uint64 = new(map[float32]uint64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Uint64 != nil { + x.FptrMapFloat32Uint64 = nil + } + } else { + if x.FptrMapFloat32Uint64 == nil { + x.FptrMapFloat32Uint64 = new(map[float32]uint64) + } + yym1440 := z.DecBinary() + _ = yym1440 + if false { + } else { + z.F.DecMapFloat32Uint64X(x.FptrMapFloat32Uint64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Uintptr = nil + } else { + yyv1441 := &x.FMapFloat32Uintptr + yym1442 := z.DecBinary() + _ = yym1442 + if false { + } else { + z.F.DecMapFloat32UintptrX(yyv1441, d) + } + } + if x.FptrMapFloat32Uintptr == nil { + x.FptrMapFloat32Uintptr = new(map[float32]uintptr) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Uintptr != nil { + x.FptrMapFloat32Uintptr = nil + } + } else { + if x.FptrMapFloat32Uintptr == nil { + x.FptrMapFloat32Uintptr = new(map[float32]uintptr) + } + yym1444 := z.DecBinary() + _ = yym1444 + if false { + } else { + z.F.DecMapFloat32UintptrX(x.FptrMapFloat32Uintptr, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Int = nil + } else { + yyv1445 := &x.FMapFloat32Int + yym1446 := z.DecBinary() + _ = yym1446 + if false { + } else { + z.F.DecMapFloat32IntX(yyv1445, d) + } + } + if x.FptrMapFloat32Int == nil { + x.FptrMapFloat32Int = new(map[float32]int) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Int != nil { + x.FptrMapFloat32Int = nil + } + } else { + if x.FptrMapFloat32Int == nil { + x.FptrMapFloat32Int = new(map[float32]int) + } + yym1448 := z.DecBinary() + _ = yym1448 + if false { + } else { + z.F.DecMapFloat32IntX(x.FptrMapFloat32Int, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Int8 = nil + } else { + yyv1449 := &x.FMapFloat32Int8 + yym1450 := z.DecBinary() + _ = yym1450 + if false { + } else { + z.F.DecMapFloat32Int8X(yyv1449, d) + } + } + if x.FptrMapFloat32Int8 == nil { + x.FptrMapFloat32Int8 = new(map[float32]int8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Int8 != nil { + x.FptrMapFloat32Int8 = nil + } + } else { + if x.FptrMapFloat32Int8 == nil { + x.FptrMapFloat32Int8 = new(map[float32]int8) + } + yym1452 := z.DecBinary() + _ = yym1452 + if false { + } else { + z.F.DecMapFloat32Int8X(x.FptrMapFloat32Int8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Int16 = nil + } else { + yyv1453 := &x.FMapFloat32Int16 + yym1454 := z.DecBinary() + _ = yym1454 + if false { + } else { + z.F.DecMapFloat32Int16X(yyv1453, d) + } + } + if x.FptrMapFloat32Int16 == nil { + x.FptrMapFloat32Int16 = new(map[float32]int16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Int16 != nil { + x.FptrMapFloat32Int16 = nil + } + } else { + if x.FptrMapFloat32Int16 == nil { + x.FptrMapFloat32Int16 = new(map[float32]int16) + } + yym1456 := z.DecBinary() + _ = yym1456 + if false { + } else { + z.F.DecMapFloat32Int16X(x.FptrMapFloat32Int16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Int32 = nil + } else { + yyv1457 := &x.FMapFloat32Int32 + yym1458 := z.DecBinary() + _ = yym1458 + if false { + } else { + z.F.DecMapFloat32Int32X(yyv1457, d) + } + } + if x.FptrMapFloat32Int32 == nil { + x.FptrMapFloat32Int32 = new(map[float32]int32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Int32 != nil { + x.FptrMapFloat32Int32 = nil + } + } else { + if x.FptrMapFloat32Int32 == nil { + x.FptrMapFloat32Int32 = new(map[float32]int32) + } + yym1460 := z.DecBinary() + _ = yym1460 + if false { + } else { + z.F.DecMapFloat32Int32X(x.FptrMapFloat32Int32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Int64 = nil + } else { + yyv1461 := &x.FMapFloat32Int64 + yym1462 := z.DecBinary() + _ = yym1462 + if false { + } else { + z.F.DecMapFloat32Int64X(yyv1461, d) + } + } + if x.FptrMapFloat32Int64 == nil { + x.FptrMapFloat32Int64 = new(map[float32]int64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Int64 != nil { + x.FptrMapFloat32Int64 = nil + } + } else { + if x.FptrMapFloat32Int64 == nil { + x.FptrMapFloat32Int64 = new(map[float32]int64) + } + yym1464 := z.DecBinary() + _ = yym1464 + if false { + } else { + z.F.DecMapFloat32Int64X(x.FptrMapFloat32Int64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Float32 = nil + } else { + yyv1465 := &x.FMapFloat32Float32 + yym1466 := z.DecBinary() + _ = yym1466 + if false { + } else { + z.F.DecMapFloat32Float32X(yyv1465, d) + } + } + if x.FptrMapFloat32Float32 == nil { + x.FptrMapFloat32Float32 = new(map[float32]float32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Float32 != nil { + x.FptrMapFloat32Float32 = nil + } + } else { + if x.FptrMapFloat32Float32 == nil { + x.FptrMapFloat32Float32 = new(map[float32]float32) + } + yym1468 := z.DecBinary() + _ = yym1468 + if false { + } else { + z.F.DecMapFloat32Float32X(x.FptrMapFloat32Float32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Float64 = nil + } else { + yyv1469 := &x.FMapFloat32Float64 + yym1470 := z.DecBinary() + _ = yym1470 + if false { + } else { + z.F.DecMapFloat32Float64X(yyv1469, d) + } + } + if x.FptrMapFloat32Float64 == nil { + x.FptrMapFloat32Float64 = new(map[float32]float64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Float64 != nil { + x.FptrMapFloat32Float64 = nil + } + } else { + if x.FptrMapFloat32Float64 == nil { + x.FptrMapFloat32Float64 = new(map[float32]float64) + } + yym1472 := z.DecBinary() + _ = yym1472 + if false { + } else { + z.F.DecMapFloat32Float64X(x.FptrMapFloat32Float64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat32Bool = nil + } else { + yyv1473 := &x.FMapFloat32Bool + yym1474 := z.DecBinary() + _ = yym1474 + if false { + } else { + z.F.DecMapFloat32BoolX(yyv1473, d) + } + } + if x.FptrMapFloat32Bool == nil { + x.FptrMapFloat32Bool = new(map[float32]bool) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat32Bool != nil { + x.FptrMapFloat32Bool = nil + } + } else { + if x.FptrMapFloat32Bool == nil { + x.FptrMapFloat32Bool = new(map[float32]bool) + } + yym1476 := z.DecBinary() + _ = yym1476 + if false { + } else { + z.F.DecMapFloat32BoolX(x.FptrMapFloat32Bool, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Intf = nil + } else { + yyv1477 := &x.FMapFloat64Intf + yym1478 := z.DecBinary() + _ = yym1478 + if false { + } else { + z.F.DecMapFloat64IntfX(yyv1477, d) + } + } + if x.FptrMapFloat64Intf == nil { + x.FptrMapFloat64Intf = new(map[float64]interface{}) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Intf != nil { + x.FptrMapFloat64Intf = nil + } + } else { + if x.FptrMapFloat64Intf == nil { + x.FptrMapFloat64Intf = new(map[float64]interface{}) + } + yym1480 := z.DecBinary() + _ = yym1480 + if false { + } else { + z.F.DecMapFloat64IntfX(x.FptrMapFloat64Intf, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64String = nil + } else { + yyv1481 := &x.FMapFloat64String + yym1482 := z.DecBinary() + _ = yym1482 + if false { + } else { + z.F.DecMapFloat64StringX(yyv1481, d) + } + } + if x.FptrMapFloat64String == nil { + x.FptrMapFloat64String = new(map[float64]string) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat64String != nil { + x.FptrMapFloat64String = nil + } + } else { + if x.FptrMapFloat64String == nil { + x.FptrMapFloat64String = new(map[float64]string) + } + yym1484 := z.DecBinary() + _ = yym1484 + if false { + } else { + z.F.DecMapFloat64StringX(x.FptrMapFloat64String, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Uint = nil + } else { + yyv1485 := &x.FMapFloat64Uint + yym1486 := z.DecBinary() + _ = yym1486 + if false { + } else { + z.F.DecMapFloat64UintX(yyv1485, d) + } + } + if x.FptrMapFloat64Uint == nil { + x.FptrMapFloat64Uint = new(map[float64]uint) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Uint != nil { + x.FptrMapFloat64Uint = nil + } + } else { + if x.FptrMapFloat64Uint == nil { + x.FptrMapFloat64Uint = new(map[float64]uint) + } + yym1488 := z.DecBinary() + _ = yym1488 + if false { + } else { + z.F.DecMapFloat64UintX(x.FptrMapFloat64Uint, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Uint8 = nil + } else { + yyv1489 := &x.FMapFloat64Uint8 + yym1490 := z.DecBinary() + _ = yym1490 + if false { + } else { + z.F.DecMapFloat64Uint8X(yyv1489, d) + } + } + if x.FptrMapFloat64Uint8 == nil { + x.FptrMapFloat64Uint8 = new(map[float64]uint8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Uint8 != nil { + x.FptrMapFloat64Uint8 = nil + } + } else { + if x.FptrMapFloat64Uint8 == nil { + x.FptrMapFloat64Uint8 = new(map[float64]uint8) + } + yym1492 := z.DecBinary() + _ = yym1492 + if false { + } else { + z.F.DecMapFloat64Uint8X(x.FptrMapFloat64Uint8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Uint16 = nil + } else { + yyv1493 := &x.FMapFloat64Uint16 + yym1494 := z.DecBinary() + _ = yym1494 + if false { + } else { + z.F.DecMapFloat64Uint16X(yyv1493, d) + } + } + if x.FptrMapFloat64Uint16 == nil { + x.FptrMapFloat64Uint16 = new(map[float64]uint16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Uint16 != nil { + x.FptrMapFloat64Uint16 = nil + } + } else { + if x.FptrMapFloat64Uint16 == nil { + x.FptrMapFloat64Uint16 = new(map[float64]uint16) + } + yym1496 := z.DecBinary() + _ = yym1496 + if false { + } else { + z.F.DecMapFloat64Uint16X(x.FptrMapFloat64Uint16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Uint32 = nil + } else { + yyv1497 := &x.FMapFloat64Uint32 + yym1498 := z.DecBinary() + _ = yym1498 + if false { + } else { + z.F.DecMapFloat64Uint32X(yyv1497, d) + } + } + if x.FptrMapFloat64Uint32 == nil { + x.FptrMapFloat64Uint32 = new(map[float64]uint32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Uint32 != nil { + x.FptrMapFloat64Uint32 = nil + } + } else { + if x.FptrMapFloat64Uint32 == nil { + x.FptrMapFloat64Uint32 = new(map[float64]uint32) + } + yym1500 := z.DecBinary() + _ = yym1500 + if false { + } else { + z.F.DecMapFloat64Uint32X(x.FptrMapFloat64Uint32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Uint64 = nil + } else { + yyv1501 := &x.FMapFloat64Uint64 + yym1502 := z.DecBinary() + _ = yym1502 + if false { + } else { + z.F.DecMapFloat64Uint64X(yyv1501, d) + } + } + if x.FptrMapFloat64Uint64 == nil { + x.FptrMapFloat64Uint64 = new(map[float64]uint64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Uint64 != nil { + x.FptrMapFloat64Uint64 = nil + } + } else { + if x.FptrMapFloat64Uint64 == nil { + x.FptrMapFloat64Uint64 = new(map[float64]uint64) + } + yym1504 := z.DecBinary() + _ = yym1504 + if false { + } else { + z.F.DecMapFloat64Uint64X(x.FptrMapFloat64Uint64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Uintptr = nil + } else { + yyv1505 := &x.FMapFloat64Uintptr + yym1506 := z.DecBinary() + _ = yym1506 + if false { + } else { + z.F.DecMapFloat64UintptrX(yyv1505, d) + } + } + if x.FptrMapFloat64Uintptr == nil { + x.FptrMapFloat64Uintptr = new(map[float64]uintptr) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Uintptr != nil { + x.FptrMapFloat64Uintptr = nil + } + } else { + if x.FptrMapFloat64Uintptr == nil { + x.FptrMapFloat64Uintptr = new(map[float64]uintptr) + } + yym1508 := z.DecBinary() + _ = yym1508 + if false { + } else { + z.F.DecMapFloat64UintptrX(x.FptrMapFloat64Uintptr, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Int = nil + } else { + yyv1509 := &x.FMapFloat64Int + yym1510 := z.DecBinary() + _ = yym1510 + if false { + } else { + z.F.DecMapFloat64IntX(yyv1509, d) + } + } + if x.FptrMapFloat64Int == nil { + x.FptrMapFloat64Int = new(map[float64]int) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Int != nil { + x.FptrMapFloat64Int = nil + } + } else { + if x.FptrMapFloat64Int == nil { + x.FptrMapFloat64Int = new(map[float64]int) + } + yym1512 := z.DecBinary() + _ = yym1512 + if false { + } else { + z.F.DecMapFloat64IntX(x.FptrMapFloat64Int, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Int8 = nil + } else { + yyv1513 := &x.FMapFloat64Int8 + yym1514 := z.DecBinary() + _ = yym1514 + if false { + } else { + z.F.DecMapFloat64Int8X(yyv1513, d) + } + } + if x.FptrMapFloat64Int8 == nil { + x.FptrMapFloat64Int8 = new(map[float64]int8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Int8 != nil { + x.FptrMapFloat64Int8 = nil + } + } else { + if x.FptrMapFloat64Int8 == nil { + x.FptrMapFloat64Int8 = new(map[float64]int8) + } + yym1516 := z.DecBinary() + _ = yym1516 + if false { + } else { + z.F.DecMapFloat64Int8X(x.FptrMapFloat64Int8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Int16 = nil + } else { + yyv1517 := &x.FMapFloat64Int16 + yym1518 := z.DecBinary() + _ = yym1518 + if false { + } else { + z.F.DecMapFloat64Int16X(yyv1517, d) + } + } + if x.FptrMapFloat64Int16 == nil { + x.FptrMapFloat64Int16 = new(map[float64]int16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Int16 != nil { + x.FptrMapFloat64Int16 = nil + } + } else { + if x.FptrMapFloat64Int16 == nil { + x.FptrMapFloat64Int16 = new(map[float64]int16) + } + yym1520 := z.DecBinary() + _ = yym1520 + if false { + } else { + z.F.DecMapFloat64Int16X(x.FptrMapFloat64Int16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Int32 = nil + } else { + yyv1521 := &x.FMapFloat64Int32 + yym1522 := z.DecBinary() + _ = yym1522 + if false { + } else { + z.F.DecMapFloat64Int32X(yyv1521, d) + } + } + if x.FptrMapFloat64Int32 == nil { + x.FptrMapFloat64Int32 = new(map[float64]int32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Int32 != nil { + x.FptrMapFloat64Int32 = nil + } + } else { + if x.FptrMapFloat64Int32 == nil { + x.FptrMapFloat64Int32 = new(map[float64]int32) + } + yym1524 := z.DecBinary() + _ = yym1524 + if false { + } else { + z.F.DecMapFloat64Int32X(x.FptrMapFloat64Int32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Int64 = nil + } else { + yyv1525 := &x.FMapFloat64Int64 + yym1526 := z.DecBinary() + _ = yym1526 + if false { + } else { + z.F.DecMapFloat64Int64X(yyv1525, d) + } + } + if x.FptrMapFloat64Int64 == nil { + x.FptrMapFloat64Int64 = new(map[float64]int64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Int64 != nil { + x.FptrMapFloat64Int64 = nil + } + } else { + if x.FptrMapFloat64Int64 == nil { + x.FptrMapFloat64Int64 = new(map[float64]int64) + } + yym1528 := z.DecBinary() + _ = yym1528 + if false { + } else { + z.F.DecMapFloat64Int64X(x.FptrMapFloat64Int64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Float32 = nil + } else { + yyv1529 := &x.FMapFloat64Float32 + yym1530 := z.DecBinary() + _ = yym1530 + if false { + } else { + z.F.DecMapFloat64Float32X(yyv1529, d) + } + } + if x.FptrMapFloat64Float32 == nil { + x.FptrMapFloat64Float32 = new(map[float64]float32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Float32 != nil { + x.FptrMapFloat64Float32 = nil + } + } else { + if x.FptrMapFloat64Float32 == nil { + x.FptrMapFloat64Float32 = new(map[float64]float32) + } + yym1532 := z.DecBinary() + _ = yym1532 + if false { + } else { + z.F.DecMapFloat64Float32X(x.FptrMapFloat64Float32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Float64 = nil + } else { + yyv1533 := &x.FMapFloat64Float64 + yym1534 := z.DecBinary() + _ = yym1534 + if false { + } else { + z.F.DecMapFloat64Float64X(yyv1533, d) + } + } + if x.FptrMapFloat64Float64 == nil { + x.FptrMapFloat64Float64 = new(map[float64]float64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Float64 != nil { + x.FptrMapFloat64Float64 = nil + } + } else { + if x.FptrMapFloat64Float64 == nil { + x.FptrMapFloat64Float64 = new(map[float64]float64) + } + yym1536 := z.DecBinary() + _ = yym1536 + if false { + } else { + z.F.DecMapFloat64Float64X(x.FptrMapFloat64Float64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapFloat64Bool = nil + } else { + yyv1537 := &x.FMapFloat64Bool + yym1538 := z.DecBinary() + _ = yym1538 + if false { + } else { + z.F.DecMapFloat64BoolX(yyv1537, d) + } + } + if x.FptrMapFloat64Bool == nil { + x.FptrMapFloat64Bool = new(map[float64]bool) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapFloat64Bool != nil { + x.FptrMapFloat64Bool = nil + } + } else { + if x.FptrMapFloat64Bool == nil { + x.FptrMapFloat64Bool = new(map[float64]bool) + } + yym1540 := z.DecBinary() + _ = yym1540 + if false { + } else { + z.F.DecMapFloat64BoolX(x.FptrMapFloat64Bool, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintIntf = nil + } else { + yyv1541 := &x.FMapUintIntf + yym1542 := z.DecBinary() + _ = yym1542 + if false { + } else { + z.F.DecMapUintIntfX(yyv1541, d) + } + } + if x.FptrMapUintIntf == nil { + x.FptrMapUintIntf = new(map[uint]interface{}) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintIntf != nil { + x.FptrMapUintIntf = nil + } + } else { + if x.FptrMapUintIntf == nil { + x.FptrMapUintIntf = new(map[uint]interface{}) + } + yym1544 := z.DecBinary() + _ = yym1544 + if false { + } else { + z.F.DecMapUintIntfX(x.FptrMapUintIntf, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintString = nil + } else { + yyv1545 := &x.FMapUintString + yym1546 := z.DecBinary() + _ = yym1546 + if false { + } else { + z.F.DecMapUintStringX(yyv1545, d) + } + } + if x.FptrMapUintString == nil { + x.FptrMapUintString = new(map[uint]string) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintString != nil { + x.FptrMapUintString = nil + } + } else { + if x.FptrMapUintString == nil { + x.FptrMapUintString = new(map[uint]string) + } + yym1548 := z.DecBinary() + _ = yym1548 + if false { + } else { + z.F.DecMapUintStringX(x.FptrMapUintString, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintUint = nil + } else { + yyv1549 := &x.FMapUintUint + yym1550 := z.DecBinary() + _ = yym1550 + if false { + } else { + z.F.DecMapUintUintX(yyv1549, d) + } + } + if x.FptrMapUintUint == nil { + x.FptrMapUintUint = new(map[uint]uint) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintUint != nil { + x.FptrMapUintUint = nil + } + } else { + if x.FptrMapUintUint == nil { + x.FptrMapUintUint = new(map[uint]uint) + } + yym1552 := z.DecBinary() + _ = yym1552 + if false { + } else { + z.F.DecMapUintUintX(x.FptrMapUintUint, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintUint8 = nil + } else { + yyv1553 := &x.FMapUintUint8 + yym1554 := z.DecBinary() + _ = yym1554 + if false { + } else { + z.F.DecMapUintUint8X(yyv1553, d) + } + } + if x.FptrMapUintUint8 == nil { + x.FptrMapUintUint8 = new(map[uint]uint8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintUint8 != nil { + x.FptrMapUintUint8 = nil + } + } else { + if x.FptrMapUintUint8 == nil { + x.FptrMapUintUint8 = new(map[uint]uint8) + } + yym1556 := z.DecBinary() + _ = yym1556 + if false { + } else { + z.F.DecMapUintUint8X(x.FptrMapUintUint8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintUint16 = nil + } else { + yyv1557 := &x.FMapUintUint16 + yym1558 := z.DecBinary() + _ = yym1558 + if false { + } else { + z.F.DecMapUintUint16X(yyv1557, d) + } + } + if x.FptrMapUintUint16 == nil { + x.FptrMapUintUint16 = new(map[uint]uint16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintUint16 != nil { + x.FptrMapUintUint16 = nil + } + } else { + if x.FptrMapUintUint16 == nil { + x.FptrMapUintUint16 = new(map[uint]uint16) + } + yym1560 := z.DecBinary() + _ = yym1560 + if false { + } else { + z.F.DecMapUintUint16X(x.FptrMapUintUint16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintUint32 = nil + } else { + yyv1561 := &x.FMapUintUint32 + yym1562 := z.DecBinary() + _ = yym1562 + if false { + } else { + z.F.DecMapUintUint32X(yyv1561, d) + } + } + if x.FptrMapUintUint32 == nil { + x.FptrMapUintUint32 = new(map[uint]uint32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintUint32 != nil { + x.FptrMapUintUint32 = nil + } + } else { + if x.FptrMapUintUint32 == nil { + x.FptrMapUintUint32 = new(map[uint]uint32) + } + yym1564 := z.DecBinary() + _ = yym1564 + if false { + } else { + z.F.DecMapUintUint32X(x.FptrMapUintUint32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintUint64 = nil + } else { + yyv1565 := &x.FMapUintUint64 + yym1566 := z.DecBinary() + _ = yym1566 + if false { + } else { + z.F.DecMapUintUint64X(yyv1565, d) + } + } + if x.FptrMapUintUint64 == nil { + x.FptrMapUintUint64 = new(map[uint]uint64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintUint64 != nil { + x.FptrMapUintUint64 = nil + } + } else { + if x.FptrMapUintUint64 == nil { + x.FptrMapUintUint64 = new(map[uint]uint64) + } + yym1568 := z.DecBinary() + _ = yym1568 + if false { + } else { + z.F.DecMapUintUint64X(x.FptrMapUintUint64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintUintptr = nil + } else { + yyv1569 := &x.FMapUintUintptr + yym1570 := z.DecBinary() + _ = yym1570 + if false { + } else { + z.F.DecMapUintUintptrX(yyv1569, d) + } + } + if x.FptrMapUintUintptr == nil { + x.FptrMapUintUintptr = new(map[uint]uintptr) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintUintptr != nil { + x.FptrMapUintUintptr = nil + } + } else { + if x.FptrMapUintUintptr == nil { + x.FptrMapUintUintptr = new(map[uint]uintptr) + } + yym1572 := z.DecBinary() + _ = yym1572 + if false { + } else { + z.F.DecMapUintUintptrX(x.FptrMapUintUintptr, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintInt = nil + } else { + yyv1573 := &x.FMapUintInt + yym1574 := z.DecBinary() + _ = yym1574 + if false { + } else { + z.F.DecMapUintIntX(yyv1573, d) + } + } + if x.FptrMapUintInt == nil { + x.FptrMapUintInt = new(map[uint]int) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintInt != nil { + x.FptrMapUintInt = nil + } + } else { + if x.FptrMapUintInt == nil { + x.FptrMapUintInt = new(map[uint]int) + } + yym1576 := z.DecBinary() + _ = yym1576 + if false { + } else { + z.F.DecMapUintIntX(x.FptrMapUintInt, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintInt8 = nil + } else { + yyv1577 := &x.FMapUintInt8 + yym1578 := z.DecBinary() + _ = yym1578 + if false { + } else { + z.F.DecMapUintInt8X(yyv1577, d) + } + } + if x.FptrMapUintInt8 == nil { + x.FptrMapUintInt8 = new(map[uint]int8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintInt8 != nil { + x.FptrMapUintInt8 = nil + } + } else { + if x.FptrMapUintInt8 == nil { + x.FptrMapUintInt8 = new(map[uint]int8) + } + yym1580 := z.DecBinary() + _ = yym1580 + if false { + } else { + z.F.DecMapUintInt8X(x.FptrMapUintInt8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintInt16 = nil + } else { + yyv1581 := &x.FMapUintInt16 + yym1582 := z.DecBinary() + _ = yym1582 + if false { + } else { + z.F.DecMapUintInt16X(yyv1581, d) + } + } + if x.FptrMapUintInt16 == nil { + x.FptrMapUintInt16 = new(map[uint]int16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintInt16 != nil { + x.FptrMapUintInt16 = nil + } + } else { + if x.FptrMapUintInt16 == nil { + x.FptrMapUintInt16 = new(map[uint]int16) + } + yym1584 := z.DecBinary() + _ = yym1584 + if false { + } else { + z.F.DecMapUintInt16X(x.FptrMapUintInt16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintInt32 = nil + } else { + yyv1585 := &x.FMapUintInt32 + yym1586 := z.DecBinary() + _ = yym1586 + if false { + } else { + z.F.DecMapUintInt32X(yyv1585, d) + } + } + if x.FptrMapUintInt32 == nil { + x.FptrMapUintInt32 = new(map[uint]int32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintInt32 != nil { + x.FptrMapUintInt32 = nil + } + } else { + if x.FptrMapUintInt32 == nil { + x.FptrMapUintInt32 = new(map[uint]int32) + } + yym1588 := z.DecBinary() + _ = yym1588 + if false { + } else { + z.F.DecMapUintInt32X(x.FptrMapUintInt32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintInt64 = nil + } else { + yyv1589 := &x.FMapUintInt64 + yym1590 := z.DecBinary() + _ = yym1590 + if false { + } else { + z.F.DecMapUintInt64X(yyv1589, d) + } + } + if x.FptrMapUintInt64 == nil { + x.FptrMapUintInt64 = new(map[uint]int64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintInt64 != nil { + x.FptrMapUintInt64 = nil + } + } else { + if x.FptrMapUintInt64 == nil { + x.FptrMapUintInt64 = new(map[uint]int64) + } + yym1592 := z.DecBinary() + _ = yym1592 + if false { + } else { + z.F.DecMapUintInt64X(x.FptrMapUintInt64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintFloat32 = nil + } else { + yyv1593 := &x.FMapUintFloat32 + yym1594 := z.DecBinary() + _ = yym1594 + if false { + } else { + z.F.DecMapUintFloat32X(yyv1593, d) + } + } + if x.FptrMapUintFloat32 == nil { + x.FptrMapUintFloat32 = new(map[uint]float32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintFloat32 != nil { + x.FptrMapUintFloat32 = nil + } + } else { + if x.FptrMapUintFloat32 == nil { + x.FptrMapUintFloat32 = new(map[uint]float32) + } + yym1596 := z.DecBinary() + _ = yym1596 + if false { + } else { + z.F.DecMapUintFloat32X(x.FptrMapUintFloat32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintFloat64 = nil + } else { + yyv1597 := &x.FMapUintFloat64 + yym1598 := z.DecBinary() + _ = yym1598 + if false { + } else { + z.F.DecMapUintFloat64X(yyv1597, d) + } + } + if x.FptrMapUintFloat64 == nil { + x.FptrMapUintFloat64 = new(map[uint]float64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintFloat64 != nil { + x.FptrMapUintFloat64 = nil + } + } else { + if x.FptrMapUintFloat64 == nil { + x.FptrMapUintFloat64 = new(map[uint]float64) + } + yym1600 := z.DecBinary() + _ = yym1600 + if false { + } else { + z.F.DecMapUintFloat64X(x.FptrMapUintFloat64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintBool = nil + } else { + yyv1601 := &x.FMapUintBool + yym1602 := z.DecBinary() + _ = yym1602 + if false { + } else { + z.F.DecMapUintBoolX(yyv1601, d) + } + } + if x.FptrMapUintBool == nil { + x.FptrMapUintBool = new(map[uint]bool) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintBool != nil { + x.FptrMapUintBool = nil + } + } else { + if x.FptrMapUintBool == nil { + x.FptrMapUintBool = new(map[uint]bool) + } + yym1604 := z.DecBinary() + _ = yym1604 + if false { + } else { + z.F.DecMapUintBoolX(x.FptrMapUintBool, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Intf = nil + } else { + yyv1605 := &x.FMapUint8Intf + yym1606 := z.DecBinary() + _ = yym1606 + if false { + } else { + z.F.DecMapUint8IntfX(yyv1605, d) + } + } + if x.FptrMapUint8Intf == nil { + x.FptrMapUint8Intf = new(map[uint8]interface{}) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint8Intf != nil { + x.FptrMapUint8Intf = nil + } + } else { + if x.FptrMapUint8Intf == nil { + x.FptrMapUint8Intf = new(map[uint8]interface{}) + } + yym1608 := z.DecBinary() + _ = yym1608 + if false { + } else { + z.F.DecMapUint8IntfX(x.FptrMapUint8Intf, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8String = nil + } else { + yyv1609 := &x.FMapUint8String + yym1610 := z.DecBinary() + _ = yym1610 + if false { + } else { + z.F.DecMapUint8StringX(yyv1609, d) + } + } + if x.FptrMapUint8String == nil { + x.FptrMapUint8String = new(map[uint8]string) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint8String != nil { + x.FptrMapUint8String = nil + } + } else { + if x.FptrMapUint8String == nil { + x.FptrMapUint8String = new(map[uint8]string) + } + yym1612 := z.DecBinary() + _ = yym1612 + if false { + } else { + z.F.DecMapUint8StringX(x.FptrMapUint8String, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Uint = nil + } else { + yyv1613 := &x.FMapUint8Uint + yym1614 := z.DecBinary() + _ = yym1614 + if false { + } else { + z.F.DecMapUint8UintX(yyv1613, d) + } + } + if x.FptrMapUint8Uint == nil { + x.FptrMapUint8Uint = new(map[uint8]uint) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint8Uint != nil { + x.FptrMapUint8Uint = nil + } + } else { + if x.FptrMapUint8Uint == nil { + x.FptrMapUint8Uint = new(map[uint8]uint) + } + yym1616 := z.DecBinary() + _ = yym1616 + if false { + } else { + z.F.DecMapUint8UintX(x.FptrMapUint8Uint, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Uint8 = nil + } else { + yyv1617 := &x.FMapUint8Uint8 + yym1618 := z.DecBinary() + _ = yym1618 + if false { + } else { + z.F.DecMapUint8Uint8X(yyv1617, d) + } + } + if x.FptrMapUint8Uint8 == nil { + x.FptrMapUint8Uint8 = new(map[uint8]uint8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint8Uint8 != nil { + x.FptrMapUint8Uint8 = nil + } + } else { + if x.FptrMapUint8Uint8 == nil { + x.FptrMapUint8Uint8 = new(map[uint8]uint8) + } + yym1620 := z.DecBinary() + _ = yym1620 + if false { + } else { + z.F.DecMapUint8Uint8X(x.FptrMapUint8Uint8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Uint16 = nil + } else { + yyv1621 := &x.FMapUint8Uint16 + yym1622 := z.DecBinary() + _ = yym1622 + if false { + } else { + z.F.DecMapUint8Uint16X(yyv1621, d) + } + } + if x.FptrMapUint8Uint16 == nil { + x.FptrMapUint8Uint16 = new(map[uint8]uint16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint8Uint16 != nil { + x.FptrMapUint8Uint16 = nil + } + } else { + if x.FptrMapUint8Uint16 == nil { + x.FptrMapUint8Uint16 = new(map[uint8]uint16) + } + yym1624 := z.DecBinary() + _ = yym1624 + if false { + } else { + z.F.DecMapUint8Uint16X(x.FptrMapUint8Uint16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Uint32 = nil + } else { + yyv1625 := &x.FMapUint8Uint32 + yym1626 := z.DecBinary() + _ = yym1626 + if false { + } else { + z.F.DecMapUint8Uint32X(yyv1625, d) + } + } + if x.FptrMapUint8Uint32 == nil { + x.FptrMapUint8Uint32 = new(map[uint8]uint32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint8Uint32 != nil { + x.FptrMapUint8Uint32 = nil + } + } else { + if x.FptrMapUint8Uint32 == nil { + x.FptrMapUint8Uint32 = new(map[uint8]uint32) + } + yym1628 := z.DecBinary() + _ = yym1628 + if false { + } else { + z.F.DecMapUint8Uint32X(x.FptrMapUint8Uint32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Uint64 = nil + } else { + yyv1629 := &x.FMapUint8Uint64 + yym1630 := z.DecBinary() + _ = yym1630 + if false { + } else { + z.F.DecMapUint8Uint64X(yyv1629, d) + } + } + if x.FptrMapUint8Uint64 == nil { + x.FptrMapUint8Uint64 = new(map[uint8]uint64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint8Uint64 != nil { + x.FptrMapUint8Uint64 = nil + } + } else { + if x.FptrMapUint8Uint64 == nil { + x.FptrMapUint8Uint64 = new(map[uint8]uint64) + } + yym1632 := z.DecBinary() + _ = yym1632 + if false { + } else { + z.F.DecMapUint8Uint64X(x.FptrMapUint8Uint64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Uintptr = nil + } else { + yyv1633 := &x.FMapUint8Uintptr + yym1634 := z.DecBinary() + _ = yym1634 + if false { + } else { + z.F.DecMapUint8UintptrX(yyv1633, d) + } + } + if x.FptrMapUint8Uintptr == nil { + x.FptrMapUint8Uintptr = new(map[uint8]uintptr) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint8Uintptr != nil { + x.FptrMapUint8Uintptr = nil + } + } else { + if x.FptrMapUint8Uintptr == nil { + x.FptrMapUint8Uintptr = new(map[uint8]uintptr) + } + yym1636 := z.DecBinary() + _ = yym1636 + if false { + } else { + z.F.DecMapUint8UintptrX(x.FptrMapUint8Uintptr, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Int = nil + } else { + yyv1637 := &x.FMapUint8Int + yym1638 := z.DecBinary() + _ = yym1638 + if false { + } else { + z.F.DecMapUint8IntX(yyv1637, d) + } + } + if x.FptrMapUint8Int == nil { + x.FptrMapUint8Int = new(map[uint8]int) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint8Int != nil { + x.FptrMapUint8Int = nil + } + } else { + if x.FptrMapUint8Int == nil { + x.FptrMapUint8Int = new(map[uint8]int) + } + yym1640 := z.DecBinary() + _ = yym1640 + if false { + } else { + z.F.DecMapUint8IntX(x.FptrMapUint8Int, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Int8 = nil + } else { + yyv1641 := &x.FMapUint8Int8 + yym1642 := z.DecBinary() + _ = yym1642 + if false { + } else { + z.F.DecMapUint8Int8X(yyv1641, d) + } + } + if x.FptrMapUint8Int8 == nil { + x.FptrMapUint8Int8 = new(map[uint8]int8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint8Int8 != nil { + x.FptrMapUint8Int8 = nil + } + } else { + if x.FptrMapUint8Int8 == nil { + x.FptrMapUint8Int8 = new(map[uint8]int8) + } + yym1644 := z.DecBinary() + _ = yym1644 + if false { + } else { + z.F.DecMapUint8Int8X(x.FptrMapUint8Int8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Int16 = nil + } else { + yyv1645 := &x.FMapUint8Int16 + yym1646 := z.DecBinary() + _ = yym1646 + if false { + } else { + z.F.DecMapUint8Int16X(yyv1645, d) + } + } + if x.FptrMapUint8Int16 == nil { + x.FptrMapUint8Int16 = new(map[uint8]int16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint8Int16 != nil { + x.FptrMapUint8Int16 = nil + } + } else { + if x.FptrMapUint8Int16 == nil { + x.FptrMapUint8Int16 = new(map[uint8]int16) + } + yym1648 := z.DecBinary() + _ = yym1648 + if false { + } else { + z.F.DecMapUint8Int16X(x.FptrMapUint8Int16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Int32 = nil + } else { + yyv1649 := &x.FMapUint8Int32 + yym1650 := z.DecBinary() + _ = yym1650 + if false { + } else { + z.F.DecMapUint8Int32X(yyv1649, d) + } + } + if x.FptrMapUint8Int32 == nil { + x.FptrMapUint8Int32 = new(map[uint8]int32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint8Int32 != nil { + x.FptrMapUint8Int32 = nil + } + } else { + if x.FptrMapUint8Int32 == nil { + x.FptrMapUint8Int32 = new(map[uint8]int32) + } + yym1652 := z.DecBinary() + _ = yym1652 + if false { + } else { + z.F.DecMapUint8Int32X(x.FptrMapUint8Int32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Int64 = nil + } else { + yyv1653 := &x.FMapUint8Int64 + yym1654 := z.DecBinary() + _ = yym1654 + if false { + } else { + z.F.DecMapUint8Int64X(yyv1653, d) + } + } + if x.FptrMapUint8Int64 == nil { + x.FptrMapUint8Int64 = new(map[uint8]int64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint8Int64 != nil { + x.FptrMapUint8Int64 = nil + } + } else { + if x.FptrMapUint8Int64 == nil { + x.FptrMapUint8Int64 = new(map[uint8]int64) + } + yym1656 := z.DecBinary() + _ = yym1656 + if false { + } else { + z.F.DecMapUint8Int64X(x.FptrMapUint8Int64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Float32 = nil + } else { + yyv1657 := &x.FMapUint8Float32 + yym1658 := z.DecBinary() + _ = yym1658 + if false { + } else { + z.F.DecMapUint8Float32X(yyv1657, d) + } + } + if x.FptrMapUint8Float32 == nil { + x.FptrMapUint8Float32 = new(map[uint8]float32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint8Float32 != nil { + x.FptrMapUint8Float32 = nil + } + } else { + if x.FptrMapUint8Float32 == nil { + x.FptrMapUint8Float32 = new(map[uint8]float32) + } + yym1660 := z.DecBinary() + _ = yym1660 + if false { + } else { + z.F.DecMapUint8Float32X(x.FptrMapUint8Float32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Float64 = nil + } else { + yyv1661 := &x.FMapUint8Float64 + yym1662 := z.DecBinary() + _ = yym1662 + if false { + } else { + z.F.DecMapUint8Float64X(yyv1661, d) + } + } + if x.FptrMapUint8Float64 == nil { + x.FptrMapUint8Float64 = new(map[uint8]float64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint8Float64 != nil { + x.FptrMapUint8Float64 = nil + } + } else { + if x.FptrMapUint8Float64 == nil { + x.FptrMapUint8Float64 = new(map[uint8]float64) + } + yym1664 := z.DecBinary() + _ = yym1664 + if false { + } else { + z.F.DecMapUint8Float64X(x.FptrMapUint8Float64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint8Bool = nil + } else { + yyv1665 := &x.FMapUint8Bool + yym1666 := z.DecBinary() + _ = yym1666 + if false { + } else { + z.F.DecMapUint8BoolX(yyv1665, d) + } + } + if x.FptrMapUint8Bool == nil { + x.FptrMapUint8Bool = new(map[uint8]bool) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint8Bool != nil { + x.FptrMapUint8Bool = nil + } + } else { + if x.FptrMapUint8Bool == nil { + x.FptrMapUint8Bool = new(map[uint8]bool) + } + yym1668 := z.DecBinary() + _ = yym1668 + if false { + } else { + z.F.DecMapUint8BoolX(x.FptrMapUint8Bool, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Intf = nil + } else { + yyv1669 := &x.FMapUint16Intf + yym1670 := z.DecBinary() + _ = yym1670 + if false { + } else { + z.F.DecMapUint16IntfX(yyv1669, d) + } + } + if x.FptrMapUint16Intf == nil { + x.FptrMapUint16Intf = new(map[uint16]interface{}) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint16Intf != nil { + x.FptrMapUint16Intf = nil + } + } else { + if x.FptrMapUint16Intf == nil { + x.FptrMapUint16Intf = new(map[uint16]interface{}) + } + yym1672 := z.DecBinary() + _ = yym1672 + if false { + } else { + z.F.DecMapUint16IntfX(x.FptrMapUint16Intf, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16String = nil + } else { + yyv1673 := &x.FMapUint16String + yym1674 := z.DecBinary() + _ = yym1674 + if false { + } else { + z.F.DecMapUint16StringX(yyv1673, d) + } + } + if x.FptrMapUint16String == nil { + x.FptrMapUint16String = new(map[uint16]string) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint16String != nil { + x.FptrMapUint16String = nil + } + } else { + if x.FptrMapUint16String == nil { + x.FptrMapUint16String = new(map[uint16]string) + } + yym1676 := z.DecBinary() + _ = yym1676 + if false { + } else { + z.F.DecMapUint16StringX(x.FptrMapUint16String, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Uint = nil + } else { + yyv1677 := &x.FMapUint16Uint + yym1678 := z.DecBinary() + _ = yym1678 + if false { + } else { + z.F.DecMapUint16UintX(yyv1677, d) + } + } + if x.FptrMapUint16Uint == nil { + x.FptrMapUint16Uint = new(map[uint16]uint) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint16Uint != nil { + x.FptrMapUint16Uint = nil + } + } else { + if x.FptrMapUint16Uint == nil { + x.FptrMapUint16Uint = new(map[uint16]uint) + } + yym1680 := z.DecBinary() + _ = yym1680 + if false { + } else { + z.F.DecMapUint16UintX(x.FptrMapUint16Uint, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Uint8 = nil + } else { + yyv1681 := &x.FMapUint16Uint8 + yym1682 := z.DecBinary() + _ = yym1682 + if false { + } else { + z.F.DecMapUint16Uint8X(yyv1681, d) + } + } + if x.FptrMapUint16Uint8 == nil { + x.FptrMapUint16Uint8 = new(map[uint16]uint8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint16Uint8 != nil { + x.FptrMapUint16Uint8 = nil + } + } else { + if x.FptrMapUint16Uint8 == nil { + x.FptrMapUint16Uint8 = new(map[uint16]uint8) + } + yym1684 := z.DecBinary() + _ = yym1684 + if false { + } else { + z.F.DecMapUint16Uint8X(x.FptrMapUint16Uint8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Uint16 = nil + } else { + yyv1685 := &x.FMapUint16Uint16 + yym1686 := z.DecBinary() + _ = yym1686 + if false { + } else { + z.F.DecMapUint16Uint16X(yyv1685, d) + } + } + if x.FptrMapUint16Uint16 == nil { + x.FptrMapUint16Uint16 = new(map[uint16]uint16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint16Uint16 != nil { + x.FptrMapUint16Uint16 = nil + } + } else { + if x.FptrMapUint16Uint16 == nil { + x.FptrMapUint16Uint16 = new(map[uint16]uint16) + } + yym1688 := z.DecBinary() + _ = yym1688 + if false { + } else { + z.F.DecMapUint16Uint16X(x.FptrMapUint16Uint16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Uint32 = nil + } else { + yyv1689 := &x.FMapUint16Uint32 + yym1690 := z.DecBinary() + _ = yym1690 + if false { + } else { + z.F.DecMapUint16Uint32X(yyv1689, d) + } + } + if x.FptrMapUint16Uint32 == nil { + x.FptrMapUint16Uint32 = new(map[uint16]uint32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint16Uint32 != nil { + x.FptrMapUint16Uint32 = nil + } + } else { + if x.FptrMapUint16Uint32 == nil { + x.FptrMapUint16Uint32 = new(map[uint16]uint32) + } + yym1692 := z.DecBinary() + _ = yym1692 + if false { + } else { + z.F.DecMapUint16Uint32X(x.FptrMapUint16Uint32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Uint64 = nil + } else { + yyv1693 := &x.FMapUint16Uint64 + yym1694 := z.DecBinary() + _ = yym1694 + if false { + } else { + z.F.DecMapUint16Uint64X(yyv1693, d) + } + } + if x.FptrMapUint16Uint64 == nil { + x.FptrMapUint16Uint64 = new(map[uint16]uint64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint16Uint64 != nil { + x.FptrMapUint16Uint64 = nil + } + } else { + if x.FptrMapUint16Uint64 == nil { + x.FptrMapUint16Uint64 = new(map[uint16]uint64) + } + yym1696 := z.DecBinary() + _ = yym1696 + if false { + } else { + z.F.DecMapUint16Uint64X(x.FptrMapUint16Uint64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Uintptr = nil + } else { + yyv1697 := &x.FMapUint16Uintptr + yym1698 := z.DecBinary() + _ = yym1698 + if false { + } else { + z.F.DecMapUint16UintptrX(yyv1697, d) + } + } + if x.FptrMapUint16Uintptr == nil { + x.FptrMapUint16Uintptr = new(map[uint16]uintptr) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint16Uintptr != nil { + x.FptrMapUint16Uintptr = nil + } + } else { + if x.FptrMapUint16Uintptr == nil { + x.FptrMapUint16Uintptr = new(map[uint16]uintptr) + } + yym1700 := z.DecBinary() + _ = yym1700 + if false { + } else { + z.F.DecMapUint16UintptrX(x.FptrMapUint16Uintptr, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Int = nil + } else { + yyv1701 := &x.FMapUint16Int + yym1702 := z.DecBinary() + _ = yym1702 + if false { + } else { + z.F.DecMapUint16IntX(yyv1701, d) + } + } + if x.FptrMapUint16Int == nil { + x.FptrMapUint16Int = new(map[uint16]int) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint16Int != nil { + x.FptrMapUint16Int = nil + } + } else { + if x.FptrMapUint16Int == nil { + x.FptrMapUint16Int = new(map[uint16]int) + } + yym1704 := z.DecBinary() + _ = yym1704 + if false { + } else { + z.F.DecMapUint16IntX(x.FptrMapUint16Int, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Int8 = nil + } else { + yyv1705 := &x.FMapUint16Int8 + yym1706 := z.DecBinary() + _ = yym1706 + if false { + } else { + z.F.DecMapUint16Int8X(yyv1705, d) + } + } + if x.FptrMapUint16Int8 == nil { + x.FptrMapUint16Int8 = new(map[uint16]int8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint16Int8 != nil { + x.FptrMapUint16Int8 = nil + } + } else { + if x.FptrMapUint16Int8 == nil { + x.FptrMapUint16Int8 = new(map[uint16]int8) + } + yym1708 := z.DecBinary() + _ = yym1708 + if false { + } else { + z.F.DecMapUint16Int8X(x.FptrMapUint16Int8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Int16 = nil + } else { + yyv1709 := &x.FMapUint16Int16 + yym1710 := z.DecBinary() + _ = yym1710 + if false { + } else { + z.F.DecMapUint16Int16X(yyv1709, d) + } + } + if x.FptrMapUint16Int16 == nil { + x.FptrMapUint16Int16 = new(map[uint16]int16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint16Int16 != nil { + x.FptrMapUint16Int16 = nil + } + } else { + if x.FptrMapUint16Int16 == nil { + x.FptrMapUint16Int16 = new(map[uint16]int16) + } + yym1712 := z.DecBinary() + _ = yym1712 + if false { + } else { + z.F.DecMapUint16Int16X(x.FptrMapUint16Int16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Int32 = nil + } else { + yyv1713 := &x.FMapUint16Int32 + yym1714 := z.DecBinary() + _ = yym1714 + if false { + } else { + z.F.DecMapUint16Int32X(yyv1713, d) + } + } + if x.FptrMapUint16Int32 == nil { + x.FptrMapUint16Int32 = new(map[uint16]int32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint16Int32 != nil { + x.FptrMapUint16Int32 = nil + } + } else { + if x.FptrMapUint16Int32 == nil { + x.FptrMapUint16Int32 = new(map[uint16]int32) + } + yym1716 := z.DecBinary() + _ = yym1716 + if false { + } else { + z.F.DecMapUint16Int32X(x.FptrMapUint16Int32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Int64 = nil + } else { + yyv1717 := &x.FMapUint16Int64 + yym1718 := z.DecBinary() + _ = yym1718 + if false { + } else { + z.F.DecMapUint16Int64X(yyv1717, d) + } + } + if x.FptrMapUint16Int64 == nil { + x.FptrMapUint16Int64 = new(map[uint16]int64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint16Int64 != nil { + x.FptrMapUint16Int64 = nil + } + } else { + if x.FptrMapUint16Int64 == nil { + x.FptrMapUint16Int64 = new(map[uint16]int64) + } + yym1720 := z.DecBinary() + _ = yym1720 + if false { + } else { + z.F.DecMapUint16Int64X(x.FptrMapUint16Int64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Float32 = nil + } else { + yyv1721 := &x.FMapUint16Float32 + yym1722 := z.DecBinary() + _ = yym1722 + if false { + } else { + z.F.DecMapUint16Float32X(yyv1721, d) + } + } + if x.FptrMapUint16Float32 == nil { + x.FptrMapUint16Float32 = new(map[uint16]float32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint16Float32 != nil { + x.FptrMapUint16Float32 = nil + } + } else { + if x.FptrMapUint16Float32 == nil { + x.FptrMapUint16Float32 = new(map[uint16]float32) + } + yym1724 := z.DecBinary() + _ = yym1724 + if false { + } else { + z.F.DecMapUint16Float32X(x.FptrMapUint16Float32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Float64 = nil + } else { + yyv1725 := &x.FMapUint16Float64 + yym1726 := z.DecBinary() + _ = yym1726 + if false { + } else { + z.F.DecMapUint16Float64X(yyv1725, d) + } + } + if x.FptrMapUint16Float64 == nil { + x.FptrMapUint16Float64 = new(map[uint16]float64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint16Float64 != nil { + x.FptrMapUint16Float64 = nil + } + } else { + if x.FptrMapUint16Float64 == nil { + x.FptrMapUint16Float64 = new(map[uint16]float64) + } + yym1728 := z.DecBinary() + _ = yym1728 + if false { + } else { + z.F.DecMapUint16Float64X(x.FptrMapUint16Float64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint16Bool = nil + } else { + yyv1729 := &x.FMapUint16Bool + yym1730 := z.DecBinary() + _ = yym1730 + if false { + } else { + z.F.DecMapUint16BoolX(yyv1729, d) + } + } + if x.FptrMapUint16Bool == nil { + x.FptrMapUint16Bool = new(map[uint16]bool) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint16Bool != nil { + x.FptrMapUint16Bool = nil + } + } else { + if x.FptrMapUint16Bool == nil { + x.FptrMapUint16Bool = new(map[uint16]bool) + } + yym1732 := z.DecBinary() + _ = yym1732 + if false { + } else { + z.F.DecMapUint16BoolX(x.FptrMapUint16Bool, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Intf = nil + } else { + yyv1733 := &x.FMapUint32Intf + yym1734 := z.DecBinary() + _ = yym1734 + if false { + } else { + z.F.DecMapUint32IntfX(yyv1733, d) + } + } + if x.FptrMapUint32Intf == nil { + x.FptrMapUint32Intf = new(map[uint32]interface{}) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint32Intf != nil { + x.FptrMapUint32Intf = nil + } + } else { + if x.FptrMapUint32Intf == nil { + x.FptrMapUint32Intf = new(map[uint32]interface{}) + } + yym1736 := z.DecBinary() + _ = yym1736 + if false { + } else { + z.F.DecMapUint32IntfX(x.FptrMapUint32Intf, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32String = nil + } else { + yyv1737 := &x.FMapUint32String + yym1738 := z.DecBinary() + _ = yym1738 + if false { + } else { + z.F.DecMapUint32StringX(yyv1737, d) + } + } + if x.FptrMapUint32String == nil { + x.FptrMapUint32String = new(map[uint32]string) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint32String != nil { + x.FptrMapUint32String = nil + } + } else { + if x.FptrMapUint32String == nil { + x.FptrMapUint32String = new(map[uint32]string) + } + yym1740 := z.DecBinary() + _ = yym1740 + if false { + } else { + z.F.DecMapUint32StringX(x.FptrMapUint32String, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Uint = nil + } else { + yyv1741 := &x.FMapUint32Uint + yym1742 := z.DecBinary() + _ = yym1742 + if false { + } else { + z.F.DecMapUint32UintX(yyv1741, d) + } + } + if x.FptrMapUint32Uint == nil { + x.FptrMapUint32Uint = new(map[uint32]uint) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint32Uint != nil { + x.FptrMapUint32Uint = nil + } + } else { + if x.FptrMapUint32Uint == nil { + x.FptrMapUint32Uint = new(map[uint32]uint) + } + yym1744 := z.DecBinary() + _ = yym1744 + if false { + } else { + z.F.DecMapUint32UintX(x.FptrMapUint32Uint, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Uint8 = nil + } else { + yyv1745 := &x.FMapUint32Uint8 + yym1746 := z.DecBinary() + _ = yym1746 + if false { + } else { + z.F.DecMapUint32Uint8X(yyv1745, d) + } + } + if x.FptrMapUint32Uint8 == nil { + x.FptrMapUint32Uint8 = new(map[uint32]uint8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint32Uint8 != nil { + x.FptrMapUint32Uint8 = nil + } + } else { + if x.FptrMapUint32Uint8 == nil { + x.FptrMapUint32Uint8 = new(map[uint32]uint8) + } + yym1748 := z.DecBinary() + _ = yym1748 + if false { + } else { + z.F.DecMapUint32Uint8X(x.FptrMapUint32Uint8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Uint16 = nil + } else { + yyv1749 := &x.FMapUint32Uint16 + yym1750 := z.DecBinary() + _ = yym1750 + if false { + } else { + z.F.DecMapUint32Uint16X(yyv1749, d) + } + } + if x.FptrMapUint32Uint16 == nil { + x.FptrMapUint32Uint16 = new(map[uint32]uint16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint32Uint16 != nil { + x.FptrMapUint32Uint16 = nil + } + } else { + if x.FptrMapUint32Uint16 == nil { + x.FptrMapUint32Uint16 = new(map[uint32]uint16) + } + yym1752 := z.DecBinary() + _ = yym1752 + if false { + } else { + z.F.DecMapUint32Uint16X(x.FptrMapUint32Uint16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Uint32 = nil + } else { + yyv1753 := &x.FMapUint32Uint32 + yym1754 := z.DecBinary() + _ = yym1754 + if false { + } else { + z.F.DecMapUint32Uint32X(yyv1753, d) + } + } + if x.FptrMapUint32Uint32 == nil { + x.FptrMapUint32Uint32 = new(map[uint32]uint32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint32Uint32 != nil { + x.FptrMapUint32Uint32 = nil + } + } else { + if x.FptrMapUint32Uint32 == nil { + x.FptrMapUint32Uint32 = new(map[uint32]uint32) + } + yym1756 := z.DecBinary() + _ = yym1756 + if false { + } else { + z.F.DecMapUint32Uint32X(x.FptrMapUint32Uint32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Uint64 = nil + } else { + yyv1757 := &x.FMapUint32Uint64 + yym1758 := z.DecBinary() + _ = yym1758 + if false { + } else { + z.F.DecMapUint32Uint64X(yyv1757, d) + } + } + if x.FptrMapUint32Uint64 == nil { + x.FptrMapUint32Uint64 = new(map[uint32]uint64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint32Uint64 != nil { + x.FptrMapUint32Uint64 = nil + } + } else { + if x.FptrMapUint32Uint64 == nil { + x.FptrMapUint32Uint64 = new(map[uint32]uint64) + } + yym1760 := z.DecBinary() + _ = yym1760 + if false { + } else { + z.F.DecMapUint32Uint64X(x.FptrMapUint32Uint64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Uintptr = nil + } else { + yyv1761 := &x.FMapUint32Uintptr + yym1762 := z.DecBinary() + _ = yym1762 + if false { + } else { + z.F.DecMapUint32UintptrX(yyv1761, d) + } + } + if x.FptrMapUint32Uintptr == nil { + x.FptrMapUint32Uintptr = new(map[uint32]uintptr) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint32Uintptr != nil { + x.FptrMapUint32Uintptr = nil + } + } else { + if x.FptrMapUint32Uintptr == nil { + x.FptrMapUint32Uintptr = new(map[uint32]uintptr) + } + yym1764 := z.DecBinary() + _ = yym1764 + if false { + } else { + z.F.DecMapUint32UintptrX(x.FptrMapUint32Uintptr, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Int = nil + } else { + yyv1765 := &x.FMapUint32Int + yym1766 := z.DecBinary() + _ = yym1766 + if false { + } else { + z.F.DecMapUint32IntX(yyv1765, d) + } + } + if x.FptrMapUint32Int == nil { + x.FptrMapUint32Int = new(map[uint32]int) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint32Int != nil { + x.FptrMapUint32Int = nil + } + } else { + if x.FptrMapUint32Int == nil { + x.FptrMapUint32Int = new(map[uint32]int) + } + yym1768 := z.DecBinary() + _ = yym1768 + if false { + } else { + z.F.DecMapUint32IntX(x.FptrMapUint32Int, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Int8 = nil + } else { + yyv1769 := &x.FMapUint32Int8 + yym1770 := z.DecBinary() + _ = yym1770 + if false { + } else { + z.F.DecMapUint32Int8X(yyv1769, d) + } + } + if x.FptrMapUint32Int8 == nil { + x.FptrMapUint32Int8 = new(map[uint32]int8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint32Int8 != nil { + x.FptrMapUint32Int8 = nil + } + } else { + if x.FptrMapUint32Int8 == nil { + x.FptrMapUint32Int8 = new(map[uint32]int8) + } + yym1772 := z.DecBinary() + _ = yym1772 + if false { + } else { + z.F.DecMapUint32Int8X(x.FptrMapUint32Int8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Int16 = nil + } else { + yyv1773 := &x.FMapUint32Int16 + yym1774 := z.DecBinary() + _ = yym1774 + if false { + } else { + z.F.DecMapUint32Int16X(yyv1773, d) + } + } + if x.FptrMapUint32Int16 == nil { + x.FptrMapUint32Int16 = new(map[uint32]int16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint32Int16 != nil { + x.FptrMapUint32Int16 = nil + } + } else { + if x.FptrMapUint32Int16 == nil { + x.FptrMapUint32Int16 = new(map[uint32]int16) + } + yym1776 := z.DecBinary() + _ = yym1776 + if false { + } else { + z.F.DecMapUint32Int16X(x.FptrMapUint32Int16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Int32 = nil + } else { + yyv1777 := &x.FMapUint32Int32 + yym1778 := z.DecBinary() + _ = yym1778 + if false { + } else { + z.F.DecMapUint32Int32X(yyv1777, d) + } + } + if x.FptrMapUint32Int32 == nil { + x.FptrMapUint32Int32 = new(map[uint32]int32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint32Int32 != nil { + x.FptrMapUint32Int32 = nil + } + } else { + if x.FptrMapUint32Int32 == nil { + x.FptrMapUint32Int32 = new(map[uint32]int32) + } + yym1780 := z.DecBinary() + _ = yym1780 + if false { + } else { + z.F.DecMapUint32Int32X(x.FptrMapUint32Int32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Int64 = nil + } else { + yyv1781 := &x.FMapUint32Int64 + yym1782 := z.DecBinary() + _ = yym1782 + if false { + } else { + z.F.DecMapUint32Int64X(yyv1781, d) + } + } + if x.FptrMapUint32Int64 == nil { + x.FptrMapUint32Int64 = new(map[uint32]int64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint32Int64 != nil { + x.FptrMapUint32Int64 = nil + } + } else { + if x.FptrMapUint32Int64 == nil { + x.FptrMapUint32Int64 = new(map[uint32]int64) + } + yym1784 := z.DecBinary() + _ = yym1784 + if false { + } else { + z.F.DecMapUint32Int64X(x.FptrMapUint32Int64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Float32 = nil + } else { + yyv1785 := &x.FMapUint32Float32 + yym1786 := z.DecBinary() + _ = yym1786 + if false { + } else { + z.F.DecMapUint32Float32X(yyv1785, d) + } + } + if x.FptrMapUint32Float32 == nil { + x.FptrMapUint32Float32 = new(map[uint32]float32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint32Float32 != nil { + x.FptrMapUint32Float32 = nil + } + } else { + if x.FptrMapUint32Float32 == nil { + x.FptrMapUint32Float32 = new(map[uint32]float32) + } + yym1788 := z.DecBinary() + _ = yym1788 + if false { + } else { + z.F.DecMapUint32Float32X(x.FptrMapUint32Float32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Float64 = nil + } else { + yyv1789 := &x.FMapUint32Float64 + yym1790 := z.DecBinary() + _ = yym1790 + if false { + } else { + z.F.DecMapUint32Float64X(yyv1789, d) + } + } + if x.FptrMapUint32Float64 == nil { + x.FptrMapUint32Float64 = new(map[uint32]float64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint32Float64 != nil { + x.FptrMapUint32Float64 = nil + } + } else { + if x.FptrMapUint32Float64 == nil { + x.FptrMapUint32Float64 = new(map[uint32]float64) + } + yym1792 := z.DecBinary() + _ = yym1792 + if false { + } else { + z.F.DecMapUint32Float64X(x.FptrMapUint32Float64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint32Bool = nil + } else { + yyv1793 := &x.FMapUint32Bool + yym1794 := z.DecBinary() + _ = yym1794 + if false { + } else { + z.F.DecMapUint32BoolX(yyv1793, d) + } + } + if x.FptrMapUint32Bool == nil { + x.FptrMapUint32Bool = new(map[uint32]bool) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint32Bool != nil { + x.FptrMapUint32Bool = nil + } + } else { + if x.FptrMapUint32Bool == nil { + x.FptrMapUint32Bool = new(map[uint32]bool) + } + yym1796 := z.DecBinary() + _ = yym1796 + if false { + } else { + z.F.DecMapUint32BoolX(x.FptrMapUint32Bool, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Intf = nil + } else { + yyv1797 := &x.FMapUint64Intf + yym1798 := z.DecBinary() + _ = yym1798 + if false { + } else { + z.F.DecMapUint64IntfX(yyv1797, d) + } + } + if x.FptrMapUint64Intf == nil { + x.FptrMapUint64Intf = new(map[uint64]interface{}) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint64Intf != nil { + x.FptrMapUint64Intf = nil + } + } else { + if x.FptrMapUint64Intf == nil { + x.FptrMapUint64Intf = new(map[uint64]interface{}) + } + yym1800 := z.DecBinary() + _ = yym1800 + if false { + } else { + z.F.DecMapUint64IntfX(x.FptrMapUint64Intf, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64String = nil + } else { + yyv1801 := &x.FMapUint64String + yym1802 := z.DecBinary() + _ = yym1802 + if false { + } else { + z.F.DecMapUint64StringX(yyv1801, d) + } + } + if x.FptrMapUint64String == nil { + x.FptrMapUint64String = new(map[uint64]string) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint64String != nil { + x.FptrMapUint64String = nil + } + } else { + if x.FptrMapUint64String == nil { + x.FptrMapUint64String = new(map[uint64]string) + } + yym1804 := z.DecBinary() + _ = yym1804 + if false { + } else { + z.F.DecMapUint64StringX(x.FptrMapUint64String, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Uint = nil + } else { + yyv1805 := &x.FMapUint64Uint + yym1806 := z.DecBinary() + _ = yym1806 + if false { + } else { + z.F.DecMapUint64UintX(yyv1805, d) + } + } + if x.FptrMapUint64Uint == nil { + x.FptrMapUint64Uint = new(map[uint64]uint) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint64Uint != nil { + x.FptrMapUint64Uint = nil + } + } else { + if x.FptrMapUint64Uint == nil { + x.FptrMapUint64Uint = new(map[uint64]uint) + } + yym1808 := z.DecBinary() + _ = yym1808 + if false { + } else { + z.F.DecMapUint64UintX(x.FptrMapUint64Uint, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Uint8 = nil + } else { + yyv1809 := &x.FMapUint64Uint8 + yym1810 := z.DecBinary() + _ = yym1810 + if false { + } else { + z.F.DecMapUint64Uint8X(yyv1809, d) + } + } + if x.FptrMapUint64Uint8 == nil { + x.FptrMapUint64Uint8 = new(map[uint64]uint8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint64Uint8 != nil { + x.FptrMapUint64Uint8 = nil + } + } else { + if x.FptrMapUint64Uint8 == nil { + x.FptrMapUint64Uint8 = new(map[uint64]uint8) + } + yym1812 := z.DecBinary() + _ = yym1812 + if false { + } else { + z.F.DecMapUint64Uint8X(x.FptrMapUint64Uint8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Uint16 = nil + } else { + yyv1813 := &x.FMapUint64Uint16 + yym1814 := z.DecBinary() + _ = yym1814 + if false { + } else { + z.F.DecMapUint64Uint16X(yyv1813, d) + } + } + if x.FptrMapUint64Uint16 == nil { + x.FptrMapUint64Uint16 = new(map[uint64]uint16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint64Uint16 != nil { + x.FptrMapUint64Uint16 = nil + } + } else { + if x.FptrMapUint64Uint16 == nil { + x.FptrMapUint64Uint16 = new(map[uint64]uint16) + } + yym1816 := z.DecBinary() + _ = yym1816 + if false { + } else { + z.F.DecMapUint64Uint16X(x.FptrMapUint64Uint16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Uint32 = nil + } else { + yyv1817 := &x.FMapUint64Uint32 + yym1818 := z.DecBinary() + _ = yym1818 + if false { + } else { + z.F.DecMapUint64Uint32X(yyv1817, d) + } + } + if x.FptrMapUint64Uint32 == nil { + x.FptrMapUint64Uint32 = new(map[uint64]uint32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint64Uint32 != nil { + x.FptrMapUint64Uint32 = nil + } + } else { + if x.FptrMapUint64Uint32 == nil { + x.FptrMapUint64Uint32 = new(map[uint64]uint32) + } + yym1820 := z.DecBinary() + _ = yym1820 + if false { + } else { + z.F.DecMapUint64Uint32X(x.FptrMapUint64Uint32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Uint64 = nil + } else { + yyv1821 := &x.FMapUint64Uint64 + yym1822 := z.DecBinary() + _ = yym1822 + if false { + } else { + z.F.DecMapUint64Uint64X(yyv1821, d) + } + } + if x.FptrMapUint64Uint64 == nil { + x.FptrMapUint64Uint64 = new(map[uint64]uint64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint64Uint64 != nil { + x.FptrMapUint64Uint64 = nil + } + } else { + if x.FptrMapUint64Uint64 == nil { + x.FptrMapUint64Uint64 = new(map[uint64]uint64) + } + yym1824 := z.DecBinary() + _ = yym1824 + if false { + } else { + z.F.DecMapUint64Uint64X(x.FptrMapUint64Uint64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Uintptr = nil + } else { + yyv1825 := &x.FMapUint64Uintptr + yym1826 := z.DecBinary() + _ = yym1826 + if false { + } else { + z.F.DecMapUint64UintptrX(yyv1825, d) + } + } + if x.FptrMapUint64Uintptr == nil { + x.FptrMapUint64Uintptr = new(map[uint64]uintptr) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint64Uintptr != nil { + x.FptrMapUint64Uintptr = nil + } + } else { + if x.FptrMapUint64Uintptr == nil { + x.FptrMapUint64Uintptr = new(map[uint64]uintptr) + } + yym1828 := z.DecBinary() + _ = yym1828 + if false { + } else { + z.F.DecMapUint64UintptrX(x.FptrMapUint64Uintptr, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Int = nil + } else { + yyv1829 := &x.FMapUint64Int + yym1830 := z.DecBinary() + _ = yym1830 + if false { + } else { + z.F.DecMapUint64IntX(yyv1829, d) + } + } + if x.FptrMapUint64Int == nil { + x.FptrMapUint64Int = new(map[uint64]int) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint64Int != nil { + x.FptrMapUint64Int = nil + } + } else { + if x.FptrMapUint64Int == nil { + x.FptrMapUint64Int = new(map[uint64]int) + } + yym1832 := z.DecBinary() + _ = yym1832 + if false { + } else { + z.F.DecMapUint64IntX(x.FptrMapUint64Int, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Int8 = nil + } else { + yyv1833 := &x.FMapUint64Int8 + yym1834 := z.DecBinary() + _ = yym1834 + if false { + } else { + z.F.DecMapUint64Int8X(yyv1833, d) + } + } + if x.FptrMapUint64Int8 == nil { + x.FptrMapUint64Int8 = new(map[uint64]int8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint64Int8 != nil { + x.FptrMapUint64Int8 = nil + } + } else { + if x.FptrMapUint64Int8 == nil { + x.FptrMapUint64Int8 = new(map[uint64]int8) + } + yym1836 := z.DecBinary() + _ = yym1836 + if false { + } else { + z.F.DecMapUint64Int8X(x.FptrMapUint64Int8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Int16 = nil + } else { + yyv1837 := &x.FMapUint64Int16 + yym1838 := z.DecBinary() + _ = yym1838 + if false { + } else { + z.F.DecMapUint64Int16X(yyv1837, d) + } + } + if x.FptrMapUint64Int16 == nil { + x.FptrMapUint64Int16 = new(map[uint64]int16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint64Int16 != nil { + x.FptrMapUint64Int16 = nil + } + } else { + if x.FptrMapUint64Int16 == nil { + x.FptrMapUint64Int16 = new(map[uint64]int16) + } + yym1840 := z.DecBinary() + _ = yym1840 + if false { + } else { + z.F.DecMapUint64Int16X(x.FptrMapUint64Int16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Int32 = nil + } else { + yyv1841 := &x.FMapUint64Int32 + yym1842 := z.DecBinary() + _ = yym1842 + if false { + } else { + z.F.DecMapUint64Int32X(yyv1841, d) + } + } + if x.FptrMapUint64Int32 == nil { + x.FptrMapUint64Int32 = new(map[uint64]int32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint64Int32 != nil { + x.FptrMapUint64Int32 = nil + } + } else { + if x.FptrMapUint64Int32 == nil { + x.FptrMapUint64Int32 = new(map[uint64]int32) + } + yym1844 := z.DecBinary() + _ = yym1844 + if false { + } else { + z.F.DecMapUint64Int32X(x.FptrMapUint64Int32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Int64 = nil + } else { + yyv1845 := &x.FMapUint64Int64 + yym1846 := z.DecBinary() + _ = yym1846 + if false { + } else { + z.F.DecMapUint64Int64X(yyv1845, d) + } + } + if x.FptrMapUint64Int64 == nil { + x.FptrMapUint64Int64 = new(map[uint64]int64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint64Int64 != nil { + x.FptrMapUint64Int64 = nil + } + } else { + if x.FptrMapUint64Int64 == nil { + x.FptrMapUint64Int64 = new(map[uint64]int64) + } + yym1848 := z.DecBinary() + _ = yym1848 + if false { + } else { + z.F.DecMapUint64Int64X(x.FptrMapUint64Int64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Float32 = nil + } else { + yyv1849 := &x.FMapUint64Float32 + yym1850 := z.DecBinary() + _ = yym1850 + if false { + } else { + z.F.DecMapUint64Float32X(yyv1849, d) + } + } + if x.FptrMapUint64Float32 == nil { + x.FptrMapUint64Float32 = new(map[uint64]float32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint64Float32 != nil { + x.FptrMapUint64Float32 = nil + } + } else { + if x.FptrMapUint64Float32 == nil { + x.FptrMapUint64Float32 = new(map[uint64]float32) + } + yym1852 := z.DecBinary() + _ = yym1852 + if false { + } else { + z.F.DecMapUint64Float32X(x.FptrMapUint64Float32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Float64 = nil + } else { + yyv1853 := &x.FMapUint64Float64 + yym1854 := z.DecBinary() + _ = yym1854 + if false { + } else { + z.F.DecMapUint64Float64X(yyv1853, d) + } + } + if x.FptrMapUint64Float64 == nil { + x.FptrMapUint64Float64 = new(map[uint64]float64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint64Float64 != nil { + x.FptrMapUint64Float64 = nil + } + } else { + if x.FptrMapUint64Float64 == nil { + x.FptrMapUint64Float64 = new(map[uint64]float64) + } + yym1856 := z.DecBinary() + _ = yym1856 + if false { + } else { + z.F.DecMapUint64Float64X(x.FptrMapUint64Float64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUint64Bool = nil + } else { + yyv1857 := &x.FMapUint64Bool + yym1858 := z.DecBinary() + _ = yym1858 + if false { + } else { + z.F.DecMapUint64BoolX(yyv1857, d) + } + } + if x.FptrMapUint64Bool == nil { + x.FptrMapUint64Bool = new(map[uint64]bool) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUint64Bool != nil { + x.FptrMapUint64Bool = nil + } + } else { + if x.FptrMapUint64Bool == nil { + x.FptrMapUint64Bool = new(map[uint64]bool) + } + yym1860 := z.DecBinary() + _ = yym1860 + if false { + } else { + z.F.DecMapUint64BoolX(x.FptrMapUint64Bool, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrIntf = nil + } else { + yyv1861 := &x.FMapUintptrIntf + yym1862 := z.DecBinary() + _ = yym1862 + if false { + } else { + z.F.DecMapUintptrIntfX(yyv1861, d) + } + } + if x.FptrMapUintptrIntf == nil { + x.FptrMapUintptrIntf = new(map[uintptr]interface{}) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintptrIntf != nil { + x.FptrMapUintptrIntf = nil + } + } else { + if x.FptrMapUintptrIntf == nil { + x.FptrMapUintptrIntf = new(map[uintptr]interface{}) + } + yym1864 := z.DecBinary() + _ = yym1864 + if false { + } else { + z.F.DecMapUintptrIntfX(x.FptrMapUintptrIntf, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrString = nil + } else { + yyv1865 := &x.FMapUintptrString + yym1866 := z.DecBinary() + _ = yym1866 + if false { + } else { + z.F.DecMapUintptrStringX(yyv1865, d) + } + } + if x.FptrMapUintptrString == nil { + x.FptrMapUintptrString = new(map[uintptr]string) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintptrString != nil { + x.FptrMapUintptrString = nil + } + } else { + if x.FptrMapUintptrString == nil { + x.FptrMapUintptrString = new(map[uintptr]string) + } + yym1868 := z.DecBinary() + _ = yym1868 + if false { + } else { + z.F.DecMapUintptrStringX(x.FptrMapUintptrString, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrUint = nil + } else { + yyv1869 := &x.FMapUintptrUint + yym1870 := z.DecBinary() + _ = yym1870 + if false { + } else { + z.F.DecMapUintptrUintX(yyv1869, d) + } + } + if x.FptrMapUintptrUint == nil { + x.FptrMapUintptrUint = new(map[uintptr]uint) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintptrUint != nil { + x.FptrMapUintptrUint = nil + } + } else { + if x.FptrMapUintptrUint == nil { + x.FptrMapUintptrUint = new(map[uintptr]uint) + } + yym1872 := z.DecBinary() + _ = yym1872 + if false { + } else { + z.F.DecMapUintptrUintX(x.FptrMapUintptrUint, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrUint8 = nil + } else { + yyv1873 := &x.FMapUintptrUint8 + yym1874 := z.DecBinary() + _ = yym1874 + if false { + } else { + z.F.DecMapUintptrUint8X(yyv1873, d) + } + } + if x.FptrMapUintptrUint8 == nil { + x.FptrMapUintptrUint8 = new(map[uintptr]uint8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintptrUint8 != nil { + x.FptrMapUintptrUint8 = nil + } + } else { + if x.FptrMapUintptrUint8 == nil { + x.FptrMapUintptrUint8 = new(map[uintptr]uint8) + } + yym1876 := z.DecBinary() + _ = yym1876 + if false { + } else { + z.F.DecMapUintptrUint8X(x.FptrMapUintptrUint8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrUint16 = nil + } else { + yyv1877 := &x.FMapUintptrUint16 + yym1878 := z.DecBinary() + _ = yym1878 + if false { + } else { + z.F.DecMapUintptrUint16X(yyv1877, d) + } + } + if x.FptrMapUintptrUint16 == nil { + x.FptrMapUintptrUint16 = new(map[uintptr]uint16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintptrUint16 != nil { + x.FptrMapUintptrUint16 = nil + } + } else { + if x.FptrMapUintptrUint16 == nil { + x.FptrMapUintptrUint16 = new(map[uintptr]uint16) + } + yym1880 := z.DecBinary() + _ = yym1880 + if false { + } else { + z.F.DecMapUintptrUint16X(x.FptrMapUintptrUint16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrUint32 = nil + } else { + yyv1881 := &x.FMapUintptrUint32 + yym1882 := z.DecBinary() + _ = yym1882 + if false { + } else { + z.F.DecMapUintptrUint32X(yyv1881, d) + } + } + if x.FptrMapUintptrUint32 == nil { + x.FptrMapUintptrUint32 = new(map[uintptr]uint32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintptrUint32 != nil { + x.FptrMapUintptrUint32 = nil + } + } else { + if x.FptrMapUintptrUint32 == nil { + x.FptrMapUintptrUint32 = new(map[uintptr]uint32) + } + yym1884 := z.DecBinary() + _ = yym1884 + if false { + } else { + z.F.DecMapUintptrUint32X(x.FptrMapUintptrUint32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrUint64 = nil + } else { + yyv1885 := &x.FMapUintptrUint64 + yym1886 := z.DecBinary() + _ = yym1886 + if false { + } else { + z.F.DecMapUintptrUint64X(yyv1885, d) + } + } + if x.FptrMapUintptrUint64 == nil { + x.FptrMapUintptrUint64 = new(map[uintptr]uint64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintptrUint64 != nil { + x.FptrMapUintptrUint64 = nil + } + } else { + if x.FptrMapUintptrUint64 == nil { + x.FptrMapUintptrUint64 = new(map[uintptr]uint64) + } + yym1888 := z.DecBinary() + _ = yym1888 + if false { + } else { + z.F.DecMapUintptrUint64X(x.FptrMapUintptrUint64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrUintptr = nil + } else { + yyv1889 := &x.FMapUintptrUintptr + yym1890 := z.DecBinary() + _ = yym1890 + if false { + } else { + z.F.DecMapUintptrUintptrX(yyv1889, d) + } + } + if x.FptrMapUintptrUintptr == nil { + x.FptrMapUintptrUintptr = new(map[uintptr]uintptr) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintptrUintptr != nil { + x.FptrMapUintptrUintptr = nil + } + } else { + if x.FptrMapUintptrUintptr == nil { + x.FptrMapUintptrUintptr = new(map[uintptr]uintptr) + } + yym1892 := z.DecBinary() + _ = yym1892 + if false { + } else { + z.F.DecMapUintptrUintptrX(x.FptrMapUintptrUintptr, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrInt = nil + } else { + yyv1893 := &x.FMapUintptrInt + yym1894 := z.DecBinary() + _ = yym1894 + if false { + } else { + z.F.DecMapUintptrIntX(yyv1893, d) + } + } + if x.FptrMapUintptrInt == nil { + x.FptrMapUintptrInt = new(map[uintptr]int) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintptrInt != nil { + x.FptrMapUintptrInt = nil + } + } else { + if x.FptrMapUintptrInt == nil { + x.FptrMapUintptrInt = new(map[uintptr]int) + } + yym1896 := z.DecBinary() + _ = yym1896 + if false { + } else { + z.F.DecMapUintptrIntX(x.FptrMapUintptrInt, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrInt8 = nil + } else { + yyv1897 := &x.FMapUintptrInt8 + yym1898 := z.DecBinary() + _ = yym1898 + if false { + } else { + z.F.DecMapUintptrInt8X(yyv1897, d) + } + } + if x.FptrMapUintptrInt8 == nil { + x.FptrMapUintptrInt8 = new(map[uintptr]int8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintptrInt8 != nil { + x.FptrMapUintptrInt8 = nil + } + } else { + if x.FptrMapUintptrInt8 == nil { + x.FptrMapUintptrInt8 = new(map[uintptr]int8) + } + yym1900 := z.DecBinary() + _ = yym1900 + if false { + } else { + z.F.DecMapUintptrInt8X(x.FptrMapUintptrInt8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrInt16 = nil + } else { + yyv1901 := &x.FMapUintptrInt16 + yym1902 := z.DecBinary() + _ = yym1902 + if false { + } else { + z.F.DecMapUintptrInt16X(yyv1901, d) + } + } + if x.FptrMapUintptrInt16 == nil { + x.FptrMapUintptrInt16 = new(map[uintptr]int16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintptrInt16 != nil { + x.FptrMapUintptrInt16 = nil + } + } else { + if x.FptrMapUintptrInt16 == nil { + x.FptrMapUintptrInt16 = new(map[uintptr]int16) + } + yym1904 := z.DecBinary() + _ = yym1904 + if false { + } else { + z.F.DecMapUintptrInt16X(x.FptrMapUintptrInt16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrInt32 = nil + } else { + yyv1905 := &x.FMapUintptrInt32 + yym1906 := z.DecBinary() + _ = yym1906 + if false { + } else { + z.F.DecMapUintptrInt32X(yyv1905, d) + } + } + if x.FptrMapUintptrInt32 == nil { + x.FptrMapUintptrInt32 = new(map[uintptr]int32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintptrInt32 != nil { + x.FptrMapUintptrInt32 = nil + } + } else { + if x.FptrMapUintptrInt32 == nil { + x.FptrMapUintptrInt32 = new(map[uintptr]int32) + } + yym1908 := z.DecBinary() + _ = yym1908 + if false { + } else { + z.F.DecMapUintptrInt32X(x.FptrMapUintptrInt32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrInt64 = nil + } else { + yyv1909 := &x.FMapUintptrInt64 + yym1910 := z.DecBinary() + _ = yym1910 + if false { + } else { + z.F.DecMapUintptrInt64X(yyv1909, d) + } + } + if x.FptrMapUintptrInt64 == nil { + x.FptrMapUintptrInt64 = new(map[uintptr]int64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintptrInt64 != nil { + x.FptrMapUintptrInt64 = nil + } + } else { + if x.FptrMapUintptrInt64 == nil { + x.FptrMapUintptrInt64 = new(map[uintptr]int64) + } + yym1912 := z.DecBinary() + _ = yym1912 + if false { + } else { + z.F.DecMapUintptrInt64X(x.FptrMapUintptrInt64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrFloat32 = nil + } else { + yyv1913 := &x.FMapUintptrFloat32 + yym1914 := z.DecBinary() + _ = yym1914 + if false { + } else { + z.F.DecMapUintptrFloat32X(yyv1913, d) + } + } + if x.FptrMapUintptrFloat32 == nil { + x.FptrMapUintptrFloat32 = new(map[uintptr]float32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintptrFloat32 != nil { + x.FptrMapUintptrFloat32 = nil + } + } else { + if x.FptrMapUintptrFloat32 == nil { + x.FptrMapUintptrFloat32 = new(map[uintptr]float32) + } + yym1916 := z.DecBinary() + _ = yym1916 + if false { + } else { + z.F.DecMapUintptrFloat32X(x.FptrMapUintptrFloat32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrFloat64 = nil + } else { + yyv1917 := &x.FMapUintptrFloat64 + yym1918 := z.DecBinary() + _ = yym1918 + if false { + } else { + z.F.DecMapUintptrFloat64X(yyv1917, d) + } + } + if x.FptrMapUintptrFloat64 == nil { + x.FptrMapUintptrFloat64 = new(map[uintptr]float64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintptrFloat64 != nil { + x.FptrMapUintptrFloat64 = nil + } + } else { + if x.FptrMapUintptrFloat64 == nil { + x.FptrMapUintptrFloat64 = new(map[uintptr]float64) + } + yym1920 := z.DecBinary() + _ = yym1920 + if false { + } else { + z.F.DecMapUintptrFloat64X(x.FptrMapUintptrFloat64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapUintptrBool = nil + } else { + yyv1921 := &x.FMapUintptrBool + yym1922 := z.DecBinary() + _ = yym1922 + if false { + } else { + z.F.DecMapUintptrBoolX(yyv1921, d) + } + } + if x.FptrMapUintptrBool == nil { + x.FptrMapUintptrBool = new(map[uintptr]bool) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapUintptrBool != nil { + x.FptrMapUintptrBool = nil + } + } else { + if x.FptrMapUintptrBool == nil { + x.FptrMapUintptrBool = new(map[uintptr]bool) + } + yym1924 := z.DecBinary() + _ = yym1924 + if false { + } else { + z.F.DecMapUintptrBoolX(x.FptrMapUintptrBool, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntIntf = nil + } else { + yyv1925 := &x.FMapIntIntf + yym1926 := z.DecBinary() + _ = yym1926 + if false { + } else { + z.F.DecMapIntIntfX(yyv1925, d) + } + } + if x.FptrMapIntIntf == nil { + x.FptrMapIntIntf = new(map[int]interface{}) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntIntf != nil { + x.FptrMapIntIntf = nil + } + } else { + if x.FptrMapIntIntf == nil { + x.FptrMapIntIntf = new(map[int]interface{}) + } + yym1928 := z.DecBinary() + _ = yym1928 + if false { + } else { + z.F.DecMapIntIntfX(x.FptrMapIntIntf, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntString = nil + } else { + yyv1929 := &x.FMapIntString + yym1930 := z.DecBinary() + _ = yym1930 + if false { + } else { + z.F.DecMapIntStringX(yyv1929, d) + } + } + if x.FptrMapIntString == nil { + x.FptrMapIntString = new(map[int]string) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntString != nil { + x.FptrMapIntString = nil + } + } else { + if x.FptrMapIntString == nil { + x.FptrMapIntString = new(map[int]string) + } + yym1932 := z.DecBinary() + _ = yym1932 + if false { + } else { + z.F.DecMapIntStringX(x.FptrMapIntString, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntUint = nil + } else { + yyv1933 := &x.FMapIntUint + yym1934 := z.DecBinary() + _ = yym1934 + if false { + } else { + z.F.DecMapIntUintX(yyv1933, d) + } + } + if x.FptrMapIntUint == nil { + x.FptrMapIntUint = new(map[int]uint) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntUint != nil { + x.FptrMapIntUint = nil + } + } else { + if x.FptrMapIntUint == nil { + x.FptrMapIntUint = new(map[int]uint) + } + yym1936 := z.DecBinary() + _ = yym1936 + if false { + } else { + z.F.DecMapIntUintX(x.FptrMapIntUint, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntUint8 = nil + } else { + yyv1937 := &x.FMapIntUint8 + yym1938 := z.DecBinary() + _ = yym1938 + if false { + } else { + z.F.DecMapIntUint8X(yyv1937, d) + } + } + if x.FptrMapIntUint8 == nil { + x.FptrMapIntUint8 = new(map[int]uint8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntUint8 != nil { + x.FptrMapIntUint8 = nil + } + } else { + if x.FptrMapIntUint8 == nil { + x.FptrMapIntUint8 = new(map[int]uint8) + } + yym1940 := z.DecBinary() + _ = yym1940 + if false { + } else { + z.F.DecMapIntUint8X(x.FptrMapIntUint8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntUint16 = nil + } else { + yyv1941 := &x.FMapIntUint16 + yym1942 := z.DecBinary() + _ = yym1942 + if false { + } else { + z.F.DecMapIntUint16X(yyv1941, d) + } + } + if x.FptrMapIntUint16 == nil { + x.FptrMapIntUint16 = new(map[int]uint16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntUint16 != nil { + x.FptrMapIntUint16 = nil + } + } else { + if x.FptrMapIntUint16 == nil { + x.FptrMapIntUint16 = new(map[int]uint16) + } + yym1944 := z.DecBinary() + _ = yym1944 + if false { + } else { + z.F.DecMapIntUint16X(x.FptrMapIntUint16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntUint32 = nil + } else { + yyv1945 := &x.FMapIntUint32 + yym1946 := z.DecBinary() + _ = yym1946 + if false { + } else { + z.F.DecMapIntUint32X(yyv1945, d) + } + } + if x.FptrMapIntUint32 == nil { + x.FptrMapIntUint32 = new(map[int]uint32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntUint32 != nil { + x.FptrMapIntUint32 = nil + } + } else { + if x.FptrMapIntUint32 == nil { + x.FptrMapIntUint32 = new(map[int]uint32) + } + yym1948 := z.DecBinary() + _ = yym1948 + if false { + } else { + z.F.DecMapIntUint32X(x.FptrMapIntUint32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntUint64 = nil + } else { + yyv1949 := &x.FMapIntUint64 + yym1950 := z.DecBinary() + _ = yym1950 + if false { + } else { + z.F.DecMapIntUint64X(yyv1949, d) + } + } + if x.FptrMapIntUint64 == nil { + x.FptrMapIntUint64 = new(map[int]uint64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntUint64 != nil { + x.FptrMapIntUint64 = nil + } + } else { + if x.FptrMapIntUint64 == nil { + x.FptrMapIntUint64 = new(map[int]uint64) + } + yym1952 := z.DecBinary() + _ = yym1952 + if false { + } else { + z.F.DecMapIntUint64X(x.FptrMapIntUint64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntUintptr = nil + } else { + yyv1953 := &x.FMapIntUintptr + yym1954 := z.DecBinary() + _ = yym1954 + if false { + } else { + z.F.DecMapIntUintptrX(yyv1953, d) + } + } + if x.FptrMapIntUintptr == nil { + x.FptrMapIntUintptr = new(map[int]uintptr) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntUintptr != nil { + x.FptrMapIntUintptr = nil + } + } else { + if x.FptrMapIntUintptr == nil { + x.FptrMapIntUintptr = new(map[int]uintptr) + } + yym1956 := z.DecBinary() + _ = yym1956 + if false { + } else { + z.F.DecMapIntUintptrX(x.FptrMapIntUintptr, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntInt = nil + } else { + yyv1957 := &x.FMapIntInt + yym1958 := z.DecBinary() + _ = yym1958 + if false { + } else { + z.F.DecMapIntIntX(yyv1957, d) + } + } + if x.FptrMapIntInt == nil { + x.FptrMapIntInt = new(map[int]int) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntInt != nil { + x.FptrMapIntInt = nil + } + } else { + if x.FptrMapIntInt == nil { + x.FptrMapIntInt = new(map[int]int) + } + yym1960 := z.DecBinary() + _ = yym1960 + if false { + } else { + z.F.DecMapIntIntX(x.FptrMapIntInt, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntInt8 = nil + } else { + yyv1961 := &x.FMapIntInt8 + yym1962 := z.DecBinary() + _ = yym1962 + if false { + } else { + z.F.DecMapIntInt8X(yyv1961, d) + } + } + if x.FptrMapIntInt8 == nil { + x.FptrMapIntInt8 = new(map[int]int8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntInt8 != nil { + x.FptrMapIntInt8 = nil + } + } else { + if x.FptrMapIntInt8 == nil { + x.FptrMapIntInt8 = new(map[int]int8) + } + yym1964 := z.DecBinary() + _ = yym1964 + if false { + } else { + z.F.DecMapIntInt8X(x.FptrMapIntInt8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntInt16 = nil + } else { + yyv1965 := &x.FMapIntInt16 + yym1966 := z.DecBinary() + _ = yym1966 + if false { + } else { + z.F.DecMapIntInt16X(yyv1965, d) + } + } + if x.FptrMapIntInt16 == nil { + x.FptrMapIntInt16 = new(map[int]int16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntInt16 != nil { + x.FptrMapIntInt16 = nil + } + } else { + if x.FptrMapIntInt16 == nil { + x.FptrMapIntInt16 = new(map[int]int16) + } + yym1968 := z.DecBinary() + _ = yym1968 + if false { + } else { + z.F.DecMapIntInt16X(x.FptrMapIntInt16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntInt32 = nil + } else { + yyv1969 := &x.FMapIntInt32 + yym1970 := z.DecBinary() + _ = yym1970 + if false { + } else { + z.F.DecMapIntInt32X(yyv1969, d) + } + } + if x.FptrMapIntInt32 == nil { + x.FptrMapIntInt32 = new(map[int]int32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntInt32 != nil { + x.FptrMapIntInt32 = nil + } + } else { + if x.FptrMapIntInt32 == nil { + x.FptrMapIntInt32 = new(map[int]int32) + } + yym1972 := z.DecBinary() + _ = yym1972 + if false { + } else { + z.F.DecMapIntInt32X(x.FptrMapIntInt32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntInt64 = nil + } else { + yyv1973 := &x.FMapIntInt64 + yym1974 := z.DecBinary() + _ = yym1974 + if false { + } else { + z.F.DecMapIntInt64X(yyv1973, d) + } + } + if x.FptrMapIntInt64 == nil { + x.FptrMapIntInt64 = new(map[int]int64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntInt64 != nil { + x.FptrMapIntInt64 = nil + } + } else { + if x.FptrMapIntInt64 == nil { + x.FptrMapIntInt64 = new(map[int]int64) + } + yym1976 := z.DecBinary() + _ = yym1976 + if false { + } else { + z.F.DecMapIntInt64X(x.FptrMapIntInt64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntFloat32 = nil + } else { + yyv1977 := &x.FMapIntFloat32 + yym1978 := z.DecBinary() + _ = yym1978 + if false { + } else { + z.F.DecMapIntFloat32X(yyv1977, d) + } + } + if x.FptrMapIntFloat32 == nil { + x.FptrMapIntFloat32 = new(map[int]float32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntFloat32 != nil { + x.FptrMapIntFloat32 = nil + } + } else { + if x.FptrMapIntFloat32 == nil { + x.FptrMapIntFloat32 = new(map[int]float32) + } + yym1980 := z.DecBinary() + _ = yym1980 + if false { + } else { + z.F.DecMapIntFloat32X(x.FptrMapIntFloat32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntFloat64 = nil + } else { + yyv1981 := &x.FMapIntFloat64 + yym1982 := z.DecBinary() + _ = yym1982 + if false { + } else { + z.F.DecMapIntFloat64X(yyv1981, d) + } + } + if x.FptrMapIntFloat64 == nil { + x.FptrMapIntFloat64 = new(map[int]float64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntFloat64 != nil { + x.FptrMapIntFloat64 = nil + } + } else { + if x.FptrMapIntFloat64 == nil { + x.FptrMapIntFloat64 = new(map[int]float64) + } + yym1984 := z.DecBinary() + _ = yym1984 + if false { + } else { + z.F.DecMapIntFloat64X(x.FptrMapIntFloat64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapIntBool = nil + } else { + yyv1985 := &x.FMapIntBool + yym1986 := z.DecBinary() + _ = yym1986 + if false { + } else { + z.F.DecMapIntBoolX(yyv1985, d) + } + } + if x.FptrMapIntBool == nil { + x.FptrMapIntBool = new(map[int]bool) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapIntBool != nil { + x.FptrMapIntBool = nil + } + } else { + if x.FptrMapIntBool == nil { + x.FptrMapIntBool = new(map[int]bool) + } + yym1988 := z.DecBinary() + _ = yym1988 + if false { + } else { + z.F.DecMapIntBoolX(x.FptrMapIntBool, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Intf = nil + } else { + yyv1989 := &x.FMapInt8Intf + yym1990 := z.DecBinary() + _ = yym1990 + if false { + } else { + z.F.DecMapInt8IntfX(yyv1989, d) + } + } + if x.FptrMapInt8Intf == nil { + x.FptrMapInt8Intf = new(map[int8]interface{}) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt8Intf != nil { + x.FptrMapInt8Intf = nil + } + } else { + if x.FptrMapInt8Intf == nil { + x.FptrMapInt8Intf = new(map[int8]interface{}) + } + yym1992 := z.DecBinary() + _ = yym1992 + if false { + } else { + z.F.DecMapInt8IntfX(x.FptrMapInt8Intf, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8String = nil + } else { + yyv1993 := &x.FMapInt8String + yym1994 := z.DecBinary() + _ = yym1994 + if false { + } else { + z.F.DecMapInt8StringX(yyv1993, d) + } + } + if x.FptrMapInt8String == nil { + x.FptrMapInt8String = new(map[int8]string) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt8String != nil { + x.FptrMapInt8String = nil + } + } else { + if x.FptrMapInt8String == nil { + x.FptrMapInt8String = new(map[int8]string) + } + yym1996 := z.DecBinary() + _ = yym1996 + if false { + } else { + z.F.DecMapInt8StringX(x.FptrMapInt8String, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Uint = nil + } else { + yyv1997 := &x.FMapInt8Uint + yym1998 := z.DecBinary() + _ = yym1998 + if false { + } else { + z.F.DecMapInt8UintX(yyv1997, d) + } + } + if x.FptrMapInt8Uint == nil { + x.FptrMapInt8Uint = new(map[int8]uint) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt8Uint != nil { + x.FptrMapInt8Uint = nil + } + } else { + if x.FptrMapInt8Uint == nil { + x.FptrMapInt8Uint = new(map[int8]uint) + } + yym2000 := z.DecBinary() + _ = yym2000 + if false { + } else { + z.F.DecMapInt8UintX(x.FptrMapInt8Uint, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Uint8 = nil + } else { + yyv2001 := &x.FMapInt8Uint8 + yym2002 := z.DecBinary() + _ = yym2002 + if false { + } else { + z.F.DecMapInt8Uint8X(yyv2001, d) + } + } + if x.FptrMapInt8Uint8 == nil { + x.FptrMapInt8Uint8 = new(map[int8]uint8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt8Uint8 != nil { + x.FptrMapInt8Uint8 = nil + } + } else { + if x.FptrMapInt8Uint8 == nil { + x.FptrMapInt8Uint8 = new(map[int8]uint8) + } + yym2004 := z.DecBinary() + _ = yym2004 + if false { + } else { + z.F.DecMapInt8Uint8X(x.FptrMapInt8Uint8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Uint16 = nil + } else { + yyv2005 := &x.FMapInt8Uint16 + yym2006 := z.DecBinary() + _ = yym2006 + if false { + } else { + z.F.DecMapInt8Uint16X(yyv2005, d) + } + } + if x.FptrMapInt8Uint16 == nil { + x.FptrMapInt8Uint16 = new(map[int8]uint16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt8Uint16 != nil { + x.FptrMapInt8Uint16 = nil + } + } else { + if x.FptrMapInt8Uint16 == nil { + x.FptrMapInt8Uint16 = new(map[int8]uint16) + } + yym2008 := z.DecBinary() + _ = yym2008 + if false { + } else { + z.F.DecMapInt8Uint16X(x.FptrMapInt8Uint16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Uint32 = nil + } else { + yyv2009 := &x.FMapInt8Uint32 + yym2010 := z.DecBinary() + _ = yym2010 + if false { + } else { + z.F.DecMapInt8Uint32X(yyv2009, d) + } + } + if x.FptrMapInt8Uint32 == nil { + x.FptrMapInt8Uint32 = new(map[int8]uint32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt8Uint32 != nil { + x.FptrMapInt8Uint32 = nil + } + } else { + if x.FptrMapInt8Uint32 == nil { + x.FptrMapInt8Uint32 = new(map[int8]uint32) + } + yym2012 := z.DecBinary() + _ = yym2012 + if false { + } else { + z.F.DecMapInt8Uint32X(x.FptrMapInt8Uint32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Uint64 = nil + } else { + yyv2013 := &x.FMapInt8Uint64 + yym2014 := z.DecBinary() + _ = yym2014 + if false { + } else { + z.F.DecMapInt8Uint64X(yyv2013, d) + } + } + if x.FptrMapInt8Uint64 == nil { + x.FptrMapInt8Uint64 = new(map[int8]uint64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt8Uint64 != nil { + x.FptrMapInt8Uint64 = nil + } + } else { + if x.FptrMapInt8Uint64 == nil { + x.FptrMapInt8Uint64 = new(map[int8]uint64) + } + yym2016 := z.DecBinary() + _ = yym2016 + if false { + } else { + z.F.DecMapInt8Uint64X(x.FptrMapInt8Uint64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Uintptr = nil + } else { + yyv2017 := &x.FMapInt8Uintptr + yym2018 := z.DecBinary() + _ = yym2018 + if false { + } else { + z.F.DecMapInt8UintptrX(yyv2017, d) + } + } + if x.FptrMapInt8Uintptr == nil { + x.FptrMapInt8Uintptr = new(map[int8]uintptr) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt8Uintptr != nil { + x.FptrMapInt8Uintptr = nil + } + } else { + if x.FptrMapInt8Uintptr == nil { + x.FptrMapInt8Uintptr = new(map[int8]uintptr) + } + yym2020 := z.DecBinary() + _ = yym2020 + if false { + } else { + z.F.DecMapInt8UintptrX(x.FptrMapInt8Uintptr, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Int = nil + } else { + yyv2021 := &x.FMapInt8Int + yym2022 := z.DecBinary() + _ = yym2022 + if false { + } else { + z.F.DecMapInt8IntX(yyv2021, d) + } + } + if x.FptrMapInt8Int == nil { + x.FptrMapInt8Int = new(map[int8]int) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt8Int != nil { + x.FptrMapInt8Int = nil + } + } else { + if x.FptrMapInt8Int == nil { + x.FptrMapInt8Int = new(map[int8]int) + } + yym2024 := z.DecBinary() + _ = yym2024 + if false { + } else { + z.F.DecMapInt8IntX(x.FptrMapInt8Int, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Int8 = nil + } else { + yyv2025 := &x.FMapInt8Int8 + yym2026 := z.DecBinary() + _ = yym2026 + if false { + } else { + z.F.DecMapInt8Int8X(yyv2025, d) + } + } + if x.FptrMapInt8Int8 == nil { + x.FptrMapInt8Int8 = new(map[int8]int8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt8Int8 != nil { + x.FptrMapInt8Int8 = nil + } + } else { + if x.FptrMapInt8Int8 == nil { + x.FptrMapInt8Int8 = new(map[int8]int8) + } + yym2028 := z.DecBinary() + _ = yym2028 + if false { + } else { + z.F.DecMapInt8Int8X(x.FptrMapInt8Int8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Int16 = nil + } else { + yyv2029 := &x.FMapInt8Int16 + yym2030 := z.DecBinary() + _ = yym2030 + if false { + } else { + z.F.DecMapInt8Int16X(yyv2029, d) + } + } + if x.FptrMapInt8Int16 == nil { + x.FptrMapInt8Int16 = new(map[int8]int16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt8Int16 != nil { + x.FptrMapInt8Int16 = nil + } + } else { + if x.FptrMapInt8Int16 == nil { + x.FptrMapInt8Int16 = new(map[int8]int16) + } + yym2032 := z.DecBinary() + _ = yym2032 + if false { + } else { + z.F.DecMapInt8Int16X(x.FptrMapInt8Int16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Int32 = nil + } else { + yyv2033 := &x.FMapInt8Int32 + yym2034 := z.DecBinary() + _ = yym2034 + if false { + } else { + z.F.DecMapInt8Int32X(yyv2033, d) + } + } + if x.FptrMapInt8Int32 == nil { + x.FptrMapInt8Int32 = new(map[int8]int32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt8Int32 != nil { + x.FptrMapInt8Int32 = nil + } + } else { + if x.FptrMapInt8Int32 == nil { + x.FptrMapInt8Int32 = new(map[int8]int32) + } + yym2036 := z.DecBinary() + _ = yym2036 + if false { + } else { + z.F.DecMapInt8Int32X(x.FptrMapInt8Int32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Int64 = nil + } else { + yyv2037 := &x.FMapInt8Int64 + yym2038 := z.DecBinary() + _ = yym2038 + if false { + } else { + z.F.DecMapInt8Int64X(yyv2037, d) + } + } + if x.FptrMapInt8Int64 == nil { + x.FptrMapInt8Int64 = new(map[int8]int64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt8Int64 != nil { + x.FptrMapInt8Int64 = nil + } + } else { + if x.FptrMapInt8Int64 == nil { + x.FptrMapInt8Int64 = new(map[int8]int64) + } + yym2040 := z.DecBinary() + _ = yym2040 + if false { + } else { + z.F.DecMapInt8Int64X(x.FptrMapInt8Int64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Float32 = nil + } else { + yyv2041 := &x.FMapInt8Float32 + yym2042 := z.DecBinary() + _ = yym2042 + if false { + } else { + z.F.DecMapInt8Float32X(yyv2041, d) + } + } + if x.FptrMapInt8Float32 == nil { + x.FptrMapInt8Float32 = new(map[int8]float32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt8Float32 != nil { + x.FptrMapInt8Float32 = nil + } + } else { + if x.FptrMapInt8Float32 == nil { + x.FptrMapInt8Float32 = new(map[int8]float32) + } + yym2044 := z.DecBinary() + _ = yym2044 + if false { + } else { + z.F.DecMapInt8Float32X(x.FptrMapInt8Float32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Float64 = nil + } else { + yyv2045 := &x.FMapInt8Float64 + yym2046 := z.DecBinary() + _ = yym2046 + if false { + } else { + z.F.DecMapInt8Float64X(yyv2045, d) + } + } + if x.FptrMapInt8Float64 == nil { + x.FptrMapInt8Float64 = new(map[int8]float64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt8Float64 != nil { + x.FptrMapInt8Float64 = nil + } + } else { + if x.FptrMapInt8Float64 == nil { + x.FptrMapInt8Float64 = new(map[int8]float64) + } + yym2048 := z.DecBinary() + _ = yym2048 + if false { + } else { + z.F.DecMapInt8Float64X(x.FptrMapInt8Float64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt8Bool = nil + } else { + yyv2049 := &x.FMapInt8Bool + yym2050 := z.DecBinary() + _ = yym2050 + if false { + } else { + z.F.DecMapInt8BoolX(yyv2049, d) + } + } + if x.FptrMapInt8Bool == nil { + x.FptrMapInt8Bool = new(map[int8]bool) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt8Bool != nil { + x.FptrMapInt8Bool = nil + } + } else { + if x.FptrMapInt8Bool == nil { + x.FptrMapInt8Bool = new(map[int8]bool) + } + yym2052 := z.DecBinary() + _ = yym2052 + if false { + } else { + z.F.DecMapInt8BoolX(x.FptrMapInt8Bool, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Intf = nil + } else { + yyv2053 := &x.FMapInt16Intf + yym2054 := z.DecBinary() + _ = yym2054 + if false { + } else { + z.F.DecMapInt16IntfX(yyv2053, d) + } + } + if x.FptrMapInt16Intf == nil { + x.FptrMapInt16Intf = new(map[int16]interface{}) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt16Intf != nil { + x.FptrMapInt16Intf = nil + } + } else { + if x.FptrMapInt16Intf == nil { + x.FptrMapInt16Intf = new(map[int16]interface{}) + } + yym2056 := z.DecBinary() + _ = yym2056 + if false { + } else { + z.F.DecMapInt16IntfX(x.FptrMapInt16Intf, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16String = nil + } else { + yyv2057 := &x.FMapInt16String + yym2058 := z.DecBinary() + _ = yym2058 + if false { + } else { + z.F.DecMapInt16StringX(yyv2057, d) + } + } + if x.FptrMapInt16String == nil { + x.FptrMapInt16String = new(map[int16]string) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt16String != nil { + x.FptrMapInt16String = nil + } + } else { + if x.FptrMapInt16String == nil { + x.FptrMapInt16String = new(map[int16]string) + } + yym2060 := z.DecBinary() + _ = yym2060 + if false { + } else { + z.F.DecMapInt16StringX(x.FptrMapInt16String, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Uint = nil + } else { + yyv2061 := &x.FMapInt16Uint + yym2062 := z.DecBinary() + _ = yym2062 + if false { + } else { + z.F.DecMapInt16UintX(yyv2061, d) + } + } + if x.FptrMapInt16Uint == nil { + x.FptrMapInt16Uint = new(map[int16]uint) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt16Uint != nil { + x.FptrMapInt16Uint = nil + } + } else { + if x.FptrMapInt16Uint == nil { + x.FptrMapInt16Uint = new(map[int16]uint) + } + yym2064 := z.DecBinary() + _ = yym2064 + if false { + } else { + z.F.DecMapInt16UintX(x.FptrMapInt16Uint, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Uint8 = nil + } else { + yyv2065 := &x.FMapInt16Uint8 + yym2066 := z.DecBinary() + _ = yym2066 + if false { + } else { + z.F.DecMapInt16Uint8X(yyv2065, d) + } + } + if x.FptrMapInt16Uint8 == nil { + x.FptrMapInt16Uint8 = new(map[int16]uint8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt16Uint8 != nil { + x.FptrMapInt16Uint8 = nil + } + } else { + if x.FptrMapInt16Uint8 == nil { + x.FptrMapInt16Uint8 = new(map[int16]uint8) + } + yym2068 := z.DecBinary() + _ = yym2068 + if false { + } else { + z.F.DecMapInt16Uint8X(x.FptrMapInt16Uint8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Uint16 = nil + } else { + yyv2069 := &x.FMapInt16Uint16 + yym2070 := z.DecBinary() + _ = yym2070 + if false { + } else { + z.F.DecMapInt16Uint16X(yyv2069, d) + } + } + if x.FptrMapInt16Uint16 == nil { + x.FptrMapInt16Uint16 = new(map[int16]uint16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt16Uint16 != nil { + x.FptrMapInt16Uint16 = nil + } + } else { + if x.FptrMapInt16Uint16 == nil { + x.FptrMapInt16Uint16 = new(map[int16]uint16) + } + yym2072 := z.DecBinary() + _ = yym2072 + if false { + } else { + z.F.DecMapInt16Uint16X(x.FptrMapInt16Uint16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Uint32 = nil + } else { + yyv2073 := &x.FMapInt16Uint32 + yym2074 := z.DecBinary() + _ = yym2074 + if false { + } else { + z.F.DecMapInt16Uint32X(yyv2073, d) + } + } + if x.FptrMapInt16Uint32 == nil { + x.FptrMapInt16Uint32 = new(map[int16]uint32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt16Uint32 != nil { + x.FptrMapInt16Uint32 = nil + } + } else { + if x.FptrMapInt16Uint32 == nil { + x.FptrMapInt16Uint32 = new(map[int16]uint32) + } + yym2076 := z.DecBinary() + _ = yym2076 + if false { + } else { + z.F.DecMapInt16Uint32X(x.FptrMapInt16Uint32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Uint64 = nil + } else { + yyv2077 := &x.FMapInt16Uint64 + yym2078 := z.DecBinary() + _ = yym2078 + if false { + } else { + z.F.DecMapInt16Uint64X(yyv2077, d) + } + } + if x.FptrMapInt16Uint64 == nil { + x.FptrMapInt16Uint64 = new(map[int16]uint64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt16Uint64 != nil { + x.FptrMapInt16Uint64 = nil + } + } else { + if x.FptrMapInt16Uint64 == nil { + x.FptrMapInt16Uint64 = new(map[int16]uint64) + } + yym2080 := z.DecBinary() + _ = yym2080 + if false { + } else { + z.F.DecMapInt16Uint64X(x.FptrMapInt16Uint64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Uintptr = nil + } else { + yyv2081 := &x.FMapInt16Uintptr + yym2082 := z.DecBinary() + _ = yym2082 + if false { + } else { + z.F.DecMapInt16UintptrX(yyv2081, d) + } + } + if x.FptrMapInt16Uintptr == nil { + x.FptrMapInt16Uintptr = new(map[int16]uintptr) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt16Uintptr != nil { + x.FptrMapInt16Uintptr = nil + } + } else { + if x.FptrMapInt16Uintptr == nil { + x.FptrMapInt16Uintptr = new(map[int16]uintptr) + } + yym2084 := z.DecBinary() + _ = yym2084 + if false { + } else { + z.F.DecMapInt16UintptrX(x.FptrMapInt16Uintptr, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Int = nil + } else { + yyv2085 := &x.FMapInt16Int + yym2086 := z.DecBinary() + _ = yym2086 + if false { + } else { + z.F.DecMapInt16IntX(yyv2085, d) + } + } + if x.FptrMapInt16Int == nil { + x.FptrMapInt16Int = new(map[int16]int) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt16Int != nil { + x.FptrMapInt16Int = nil + } + } else { + if x.FptrMapInt16Int == nil { + x.FptrMapInt16Int = new(map[int16]int) + } + yym2088 := z.DecBinary() + _ = yym2088 + if false { + } else { + z.F.DecMapInt16IntX(x.FptrMapInt16Int, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Int8 = nil + } else { + yyv2089 := &x.FMapInt16Int8 + yym2090 := z.DecBinary() + _ = yym2090 + if false { + } else { + z.F.DecMapInt16Int8X(yyv2089, d) + } + } + if x.FptrMapInt16Int8 == nil { + x.FptrMapInt16Int8 = new(map[int16]int8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt16Int8 != nil { + x.FptrMapInt16Int8 = nil + } + } else { + if x.FptrMapInt16Int8 == nil { + x.FptrMapInt16Int8 = new(map[int16]int8) + } + yym2092 := z.DecBinary() + _ = yym2092 + if false { + } else { + z.F.DecMapInt16Int8X(x.FptrMapInt16Int8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Int16 = nil + } else { + yyv2093 := &x.FMapInt16Int16 + yym2094 := z.DecBinary() + _ = yym2094 + if false { + } else { + z.F.DecMapInt16Int16X(yyv2093, d) + } + } + if x.FptrMapInt16Int16 == nil { + x.FptrMapInt16Int16 = new(map[int16]int16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt16Int16 != nil { + x.FptrMapInt16Int16 = nil + } + } else { + if x.FptrMapInt16Int16 == nil { + x.FptrMapInt16Int16 = new(map[int16]int16) + } + yym2096 := z.DecBinary() + _ = yym2096 + if false { + } else { + z.F.DecMapInt16Int16X(x.FptrMapInt16Int16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Int32 = nil + } else { + yyv2097 := &x.FMapInt16Int32 + yym2098 := z.DecBinary() + _ = yym2098 + if false { + } else { + z.F.DecMapInt16Int32X(yyv2097, d) + } + } + if x.FptrMapInt16Int32 == nil { + x.FptrMapInt16Int32 = new(map[int16]int32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt16Int32 != nil { + x.FptrMapInt16Int32 = nil + } + } else { + if x.FptrMapInt16Int32 == nil { + x.FptrMapInt16Int32 = new(map[int16]int32) + } + yym2100 := z.DecBinary() + _ = yym2100 + if false { + } else { + z.F.DecMapInt16Int32X(x.FptrMapInt16Int32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Int64 = nil + } else { + yyv2101 := &x.FMapInt16Int64 + yym2102 := z.DecBinary() + _ = yym2102 + if false { + } else { + z.F.DecMapInt16Int64X(yyv2101, d) + } + } + if x.FptrMapInt16Int64 == nil { + x.FptrMapInt16Int64 = new(map[int16]int64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt16Int64 != nil { + x.FptrMapInt16Int64 = nil + } + } else { + if x.FptrMapInt16Int64 == nil { + x.FptrMapInt16Int64 = new(map[int16]int64) + } + yym2104 := z.DecBinary() + _ = yym2104 + if false { + } else { + z.F.DecMapInt16Int64X(x.FptrMapInt16Int64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Float32 = nil + } else { + yyv2105 := &x.FMapInt16Float32 + yym2106 := z.DecBinary() + _ = yym2106 + if false { + } else { + z.F.DecMapInt16Float32X(yyv2105, d) + } + } + if x.FptrMapInt16Float32 == nil { + x.FptrMapInt16Float32 = new(map[int16]float32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt16Float32 != nil { + x.FptrMapInt16Float32 = nil + } + } else { + if x.FptrMapInt16Float32 == nil { + x.FptrMapInt16Float32 = new(map[int16]float32) + } + yym2108 := z.DecBinary() + _ = yym2108 + if false { + } else { + z.F.DecMapInt16Float32X(x.FptrMapInt16Float32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Float64 = nil + } else { + yyv2109 := &x.FMapInt16Float64 + yym2110 := z.DecBinary() + _ = yym2110 + if false { + } else { + z.F.DecMapInt16Float64X(yyv2109, d) + } + } + if x.FptrMapInt16Float64 == nil { + x.FptrMapInt16Float64 = new(map[int16]float64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt16Float64 != nil { + x.FptrMapInt16Float64 = nil + } + } else { + if x.FptrMapInt16Float64 == nil { + x.FptrMapInt16Float64 = new(map[int16]float64) + } + yym2112 := z.DecBinary() + _ = yym2112 + if false { + } else { + z.F.DecMapInt16Float64X(x.FptrMapInt16Float64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt16Bool = nil + } else { + yyv2113 := &x.FMapInt16Bool + yym2114 := z.DecBinary() + _ = yym2114 + if false { + } else { + z.F.DecMapInt16BoolX(yyv2113, d) + } + } + if x.FptrMapInt16Bool == nil { + x.FptrMapInt16Bool = new(map[int16]bool) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt16Bool != nil { + x.FptrMapInt16Bool = nil + } + } else { + if x.FptrMapInt16Bool == nil { + x.FptrMapInt16Bool = new(map[int16]bool) + } + yym2116 := z.DecBinary() + _ = yym2116 + if false { + } else { + z.F.DecMapInt16BoolX(x.FptrMapInt16Bool, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Intf = nil + } else { + yyv2117 := &x.FMapInt32Intf + yym2118 := z.DecBinary() + _ = yym2118 + if false { + } else { + z.F.DecMapInt32IntfX(yyv2117, d) + } + } + if x.FptrMapInt32Intf == nil { + x.FptrMapInt32Intf = new(map[int32]interface{}) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt32Intf != nil { + x.FptrMapInt32Intf = nil + } + } else { + if x.FptrMapInt32Intf == nil { + x.FptrMapInt32Intf = new(map[int32]interface{}) + } + yym2120 := z.DecBinary() + _ = yym2120 + if false { + } else { + z.F.DecMapInt32IntfX(x.FptrMapInt32Intf, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32String = nil + } else { + yyv2121 := &x.FMapInt32String + yym2122 := z.DecBinary() + _ = yym2122 + if false { + } else { + z.F.DecMapInt32StringX(yyv2121, d) + } + } + if x.FptrMapInt32String == nil { + x.FptrMapInt32String = new(map[int32]string) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt32String != nil { + x.FptrMapInt32String = nil + } + } else { + if x.FptrMapInt32String == nil { + x.FptrMapInt32String = new(map[int32]string) + } + yym2124 := z.DecBinary() + _ = yym2124 + if false { + } else { + z.F.DecMapInt32StringX(x.FptrMapInt32String, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Uint = nil + } else { + yyv2125 := &x.FMapInt32Uint + yym2126 := z.DecBinary() + _ = yym2126 + if false { + } else { + z.F.DecMapInt32UintX(yyv2125, d) + } + } + if x.FptrMapInt32Uint == nil { + x.FptrMapInt32Uint = new(map[int32]uint) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt32Uint != nil { + x.FptrMapInt32Uint = nil + } + } else { + if x.FptrMapInt32Uint == nil { + x.FptrMapInt32Uint = new(map[int32]uint) + } + yym2128 := z.DecBinary() + _ = yym2128 + if false { + } else { + z.F.DecMapInt32UintX(x.FptrMapInt32Uint, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Uint8 = nil + } else { + yyv2129 := &x.FMapInt32Uint8 + yym2130 := z.DecBinary() + _ = yym2130 + if false { + } else { + z.F.DecMapInt32Uint8X(yyv2129, d) + } + } + if x.FptrMapInt32Uint8 == nil { + x.FptrMapInt32Uint8 = new(map[int32]uint8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt32Uint8 != nil { + x.FptrMapInt32Uint8 = nil + } + } else { + if x.FptrMapInt32Uint8 == nil { + x.FptrMapInt32Uint8 = new(map[int32]uint8) + } + yym2132 := z.DecBinary() + _ = yym2132 + if false { + } else { + z.F.DecMapInt32Uint8X(x.FptrMapInt32Uint8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Uint16 = nil + } else { + yyv2133 := &x.FMapInt32Uint16 + yym2134 := z.DecBinary() + _ = yym2134 + if false { + } else { + z.F.DecMapInt32Uint16X(yyv2133, d) + } + } + if x.FptrMapInt32Uint16 == nil { + x.FptrMapInt32Uint16 = new(map[int32]uint16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt32Uint16 != nil { + x.FptrMapInt32Uint16 = nil + } + } else { + if x.FptrMapInt32Uint16 == nil { + x.FptrMapInt32Uint16 = new(map[int32]uint16) + } + yym2136 := z.DecBinary() + _ = yym2136 + if false { + } else { + z.F.DecMapInt32Uint16X(x.FptrMapInt32Uint16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Uint32 = nil + } else { + yyv2137 := &x.FMapInt32Uint32 + yym2138 := z.DecBinary() + _ = yym2138 + if false { + } else { + z.F.DecMapInt32Uint32X(yyv2137, d) + } + } + if x.FptrMapInt32Uint32 == nil { + x.FptrMapInt32Uint32 = new(map[int32]uint32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt32Uint32 != nil { + x.FptrMapInt32Uint32 = nil + } + } else { + if x.FptrMapInt32Uint32 == nil { + x.FptrMapInt32Uint32 = new(map[int32]uint32) + } + yym2140 := z.DecBinary() + _ = yym2140 + if false { + } else { + z.F.DecMapInt32Uint32X(x.FptrMapInt32Uint32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Uint64 = nil + } else { + yyv2141 := &x.FMapInt32Uint64 + yym2142 := z.DecBinary() + _ = yym2142 + if false { + } else { + z.F.DecMapInt32Uint64X(yyv2141, d) + } + } + if x.FptrMapInt32Uint64 == nil { + x.FptrMapInt32Uint64 = new(map[int32]uint64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt32Uint64 != nil { + x.FptrMapInt32Uint64 = nil + } + } else { + if x.FptrMapInt32Uint64 == nil { + x.FptrMapInt32Uint64 = new(map[int32]uint64) + } + yym2144 := z.DecBinary() + _ = yym2144 + if false { + } else { + z.F.DecMapInt32Uint64X(x.FptrMapInt32Uint64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Uintptr = nil + } else { + yyv2145 := &x.FMapInt32Uintptr + yym2146 := z.DecBinary() + _ = yym2146 + if false { + } else { + z.F.DecMapInt32UintptrX(yyv2145, d) + } + } + if x.FptrMapInt32Uintptr == nil { + x.FptrMapInt32Uintptr = new(map[int32]uintptr) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt32Uintptr != nil { + x.FptrMapInt32Uintptr = nil + } + } else { + if x.FptrMapInt32Uintptr == nil { + x.FptrMapInt32Uintptr = new(map[int32]uintptr) + } + yym2148 := z.DecBinary() + _ = yym2148 + if false { + } else { + z.F.DecMapInt32UintptrX(x.FptrMapInt32Uintptr, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Int = nil + } else { + yyv2149 := &x.FMapInt32Int + yym2150 := z.DecBinary() + _ = yym2150 + if false { + } else { + z.F.DecMapInt32IntX(yyv2149, d) + } + } + if x.FptrMapInt32Int == nil { + x.FptrMapInt32Int = new(map[int32]int) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt32Int != nil { + x.FptrMapInt32Int = nil + } + } else { + if x.FptrMapInt32Int == nil { + x.FptrMapInt32Int = new(map[int32]int) + } + yym2152 := z.DecBinary() + _ = yym2152 + if false { + } else { + z.F.DecMapInt32IntX(x.FptrMapInt32Int, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Int8 = nil + } else { + yyv2153 := &x.FMapInt32Int8 + yym2154 := z.DecBinary() + _ = yym2154 + if false { + } else { + z.F.DecMapInt32Int8X(yyv2153, d) + } + } + if x.FptrMapInt32Int8 == nil { + x.FptrMapInt32Int8 = new(map[int32]int8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt32Int8 != nil { + x.FptrMapInt32Int8 = nil + } + } else { + if x.FptrMapInt32Int8 == nil { + x.FptrMapInt32Int8 = new(map[int32]int8) + } + yym2156 := z.DecBinary() + _ = yym2156 + if false { + } else { + z.F.DecMapInt32Int8X(x.FptrMapInt32Int8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Int16 = nil + } else { + yyv2157 := &x.FMapInt32Int16 + yym2158 := z.DecBinary() + _ = yym2158 + if false { + } else { + z.F.DecMapInt32Int16X(yyv2157, d) + } + } + if x.FptrMapInt32Int16 == nil { + x.FptrMapInt32Int16 = new(map[int32]int16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt32Int16 != nil { + x.FptrMapInt32Int16 = nil + } + } else { + if x.FptrMapInt32Int16 == nil { + x.FptrMapInt32Int16 = new(map[int32]int16) + } + yym2160 := z.DecBinary() + _ = yym2160 + if false { + } else { + z.F.DecMapInt32Int16X(x.FptrMapInt32Int16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Int32 = nil + } else { + yyv2161 := &x.FMapInt32Int32 + yym2162 := z.DecBinary() + _ = yym2162 + if false { + } else { + z.F.DecMapInt32Int32X(yyv2161, d) + } + } + if x.FptrMapInt32Int32 == nil { + x.FptrMapInt32Int32 = new(map[int32]int32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt32Int32 != nil { + x.FptrMapInt32Int32 = nil + } + } else { + if x.FptrMapInt32Int32 == nil { + x.FptrMapInt32Int32 = new(map[int32]int32) + } + yym2164 := z.DecBinary() + _ = yym2164 + if false { + } else { + z.F.DecMapInt32Int32X(x.FptrMapInt32Int32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Int64 = nil + } else { + yyv2165 := &x.FMapInt32Int64 + yym2166 := z.DecBinary() + _ = yym2166 + if false { + } else { + z.F.DecMapInt32Int64X(yyv2165, d) + } + } + if x.FptrMapInt32Int64 == nil { + x.FptrMapInt32Int64 = new(map[int32]int64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt32Int64 != nil { + x.FptrMapInt32Int64 = nil + } + } else { + if x.FptrMapInt32Int64 == nil { + x.FptrMapInt32Int64 = new(map[int32]int64) + } + yym2168 := z.DecBinary() + _ = yym2168 + if false { + } else { + z.F.DecMapInt32Int64X(x.FptrMapInt32Int64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Float32 = nil + } else { + yyv2169 := &x.FMapInt32Float32 + yym2170 := z.DecBinary() + _ = yym2170 + if false { + } else { + z.F.DecMapInt32Float32X(yyv2169, d) + } + } + if x.FptrMapInt32Float32 == nil { + x.FptrMapInt32Float32 = new(map[int32]float32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt32Float32 != nil { + x.FptrMapInt32Float32 = nil + } + } else { + if x.FptrMapInt32Float32 == nil { + x.FptrMapInt32Float32 = new(map[int32]float32) + } + yym2172 := z.DecBinary() + _ = yym2172 + if false { + } else { + z.F.DecMapInt32Float32X(x.FptrMapInt32Float32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Float64 = nil + } else { + yyv2173 := &x.FMapInt32Float64 + yym2174 := z.DecBinary() + _ = yym2174 + if false { + } else { + z.F.DecMapInt32Float64X(yyv2173, d) + } + } + if x.FptrMapInt32Float64 == nil { + x.FptrMapInt32Float64 = new(map[int32]float64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt32Float64 != nil { + x.FptrMapInt32Float64 = nil + } + } else { + if x.FptrMapInt32Float64 == nil { + x.FptrMapInt32Float64 = new(map[int32]float64) + } + yym2176 := z.DecBinary() + _ = yym2176 + if false { + } else { + z.F.DecMapInt32Float64X(x.FptrMapInt32Float64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt32Bool = nil + } else { + yyv2177 := &x.FMapInt32Bool + yym2178 := z.DecBinary() + _ = yym2178 + if false { + } else { + z.F.DecMapInt32BoolX(yyv2177, d) + } + } + if x.FptrMapInt32Bool == nil { + x.FptrMapInt32Bool = new(map[int32]bool) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt32Bool != nil { + x.FptrMapInt32Bool = nil + } + } else { + if x.FptrMapInt32Bool == nil { + x.FptrMapInt32Bool = new(map[int32]bool) + } + yym2180 := z.DecBinary() + _ = yym2180 + if false { + } else { + z.F.DecMapInt32BoolX(x.FptrMapInt32Bool, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Intf = nil + } else { + yyv2181 := &x.FMapInt64Intf + yym2182 := z.DecBinary() + _ = yym2182 + if false { + } else { + z.F.DecMapInt64IntfX(yyv2181, d) + } + } + if x.FptrMapInt64Intf == nil { + x.FptrMapInt64Intf = new(map[int64]interface{}) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt64Intf != nil { + x.FptrMapInt64Intf = nil + } + } else { + if x.FptrMapInt64Intf == nil { + x.FptrMapInt64Intf = new(map[int64]interface{}) + } + yym2184 := z.DecBinary() + _ = yym2184 + if false { + } else { + z.F.DecMapInt64IntfX(x.FptrMapInt64Intf, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64String = nil + } else { + yyv2185 := &x.FMapInt64String + yym2186 := z.DecBinary() + _ = yym2186 + if false { + } else { + z.F.DecMapInt64StringX(yyv2185, d) + } + } + if x.FptrMapInt64String == nil { + x.FptrMapInt64String = new(map[int64]string) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt64String != nil { + x.FptrMapInt64String = nil + } + } else { + if x.FptrMapInt64String == nil { + x.FptrMapInt64String = new(map[int64]string) + } + yym2188 := z.DecBinary() + _ = yym2188 + if false { + } else { + z.F.DecMapInt64StringX(x.FptrMapInt64String, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Uint = nil + } else { + yyv2189 := &x.FMapInt64Uint + yym2190 := z.DecBinary() + _ = yym2190 + if false { + } else { + z.F.DecMapInt64UintX(yyv2189, d) + } + } + if x.FptrMapInt64Uint == nil { + x.FptrMapInt64Uint = new(map[int64]uint) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt64Uint != nil { + x.FptrMapInt64Uint = nil + } + } else { + if x.FptrMapInt64Uint == nil { + x.FptrMapInt64Uint = new(map[int64]uint) + } + yym2192 := z.DecBinary() + _ = yym2192 + if false { + } else { + z.F.DecMapInt64UintX(x.FptrMapInt64Uint, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Uint8 = nil + } else { + yyv2193 := &x.FMapInt64Uint8 + yym2194 := z.DecBinary() + _ = yym2194 + if false { + } else { + z.F.DecMapInt64Uint8X(yyv2193, d) + } + } + if x.FptrMapInt64Uint8 == nil { + x.FptrMapInt64Uint8 = new(map[int64]uint8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt64Uint8 != nil { + x.FptrMapInt64Uint8 = nil + } + } else { + if x.FptrMapInt64Uint8 == nil { + x.FptrMapInt64Uint8 = new(map[int64]uint8) + } + yym2196 := z.DecBinary() + _ = yym2196 + if false { + } else { + z.F.DecMapInt64Uint8X(x.FptrMapInt64Uint8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Uint16 = nil + } else { + yyv2197 := &x.FMapInt64Uint16 + yym2198 := z.DecBinary() + _ = yym2198 + if false { + } else { + z.F.DecMapInt64Uint16X(yyv2197, d) + } + } + if x.FptrMapInt64Uint16 == nil { + x.FptrMapInt64Uint16 = new(map[int64]uint16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt64Uint16 != nil { + x.FptrMapInt64Uint16 = nil + } + } else { + if x.FptrMapInt64Uint16 == nil { + x.FptrMapInt64Uint16 = new(map[int64]uint16) + } + yym2200 := z.DecBinary() + _ = yym2200 + if false { + } else { + z.F.DecMapInt64Uint16X(x.FptrMapInt64Uint16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Uint32 = nil + } else { + yyv2201 := &x.FMapInt64Uint32 + yym2202 := z.DecBinary() + _ = yym2202 + if false { + } else { + z.F.DecMapInt64Uint32X(yyv2201, d) + } + } + if x.FptrMapInt64Uint32 == nil { + x.FptrMapInt64Uint32 = new(map[int64]uint32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt64Uint32 != nil { + x.FptrMapInt64Uint32 = nil + } + } else { + if x.FptrMapInt64Uint32 == nil { + x.FptrMapInt64Uint32 = new(map[int64]uint32) + } + yym2204 := z.DecBinary() + _ = yym2204 + if false { + } else { + z.F.DecMapInt64Uint32X(x.FptrMapInt64Uint32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Uint64 = nil + } else { + yyv2205 := &x.FMapInt64Uint64 + yym2206 := z.DecBinary() + _ = yym2206 + if false { + } else { + z.F.DecMapInt64Uint64X(yyv2205, d) + } + } + if x.FptrMapInt64Uint64 == nil { + x.FptrMapInt64Uint64 = new(map[int64]uint64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt64Uint64 != nil { + x.FptrMapInt64Uint64 = nil + } + } else { + if x.FptrMapInt64Uint64 == nil { + x.FptrMapInt64Uint64 = new(map[int64]uint64) + } + yym2208 := z.DecBinary() + _ = yym2208 + if false { + } else { + z.F.DecMapInt64Uint64X(x.FptrMapInt64Uint64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Uintptr = nil + } else { + yyv2209 := &x.FMapInt64Uintptr + yym2210 := z.DecBinary() + _ = yym2210 + if false { + } else { + z.F.DecMapInt64UintptrX(yyv2209, d) + } + } + if x.FptrMapInt64Uintptr == nil { + x.FptrMapInt64Uintptr = new(map[int64]uintptr) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt64Uintptr != nil { + x.FptrMapInt64Uintptr = nil + } + } else { + if x.FptrMapInt64Uintptr == nil { + x.FptrMapInt64Uintptr = new(map[int64]uintptr) + } + yym2212 := z.DecBinary() + _ = yym2212 + if false { + } else { + z.F.DecMapInt64UintptrX(x.FptrMapInt64Uintptr, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Int = nil + } else { + yyv2213 := &x.FMapInt64Int + yym2214 := z.DecBinary() + _ = yym2214 + if false { + } else { + z.F.DecMapInt64IntX(yyv2213, d) + } + } + if x.FptrMapInt64Int == nil { + x.FptrMapInt64Int = new(map[int64]int) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt64Int != nil { + x.FptrMapInt64Int = nil + } + } else { + if x.FptrMapInt64Int == nil { + x.FptrMapInt64Int = new(map[int64]int) + } + yym2216 := z.DecBinary() + _ = yym2216 + if false { + } else { + z.F.DecMapInt64IntX(x.FptrMapInt64Int, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Int8 = nil + } else { + yyv2217 := &x.FMapInt64Int8 + yym2218 := z.DecBinary() + _ = yym2218 + if false { + } else { + z.F.DecMapInt64Int8X(yyv2217, d) + } + } + if x.FptrMapInt64Int8 == nil { + x.FptrMapInt64Int8 = new(map[int64]int8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt64Int8 != nil { + x.FptrMapInt64Int8 = nil + } + } else { + if x.FptrMapInt64Int8 == nil { + x.FptrMapInt64Int8 = new(map[int64]int8) + } + yym2220 := z.DecBinary() + _ = yym2220 + if false { + } else { + z.F.DecMapInt64Int8X(x.FptrMapInt64Int8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Int16 = nil + } else { + yyv2221 := &x.FMapInt64Int16 + yym2222 := z.DecBinary() + _ = yym2222 + if false { + } else { + z.F.DecMapInt64Int16X(yyv2221, d) + } + } + if x.FptrMapInt64Int16 == nil { + x.FptrMapInt64Int16 = new(map[int64]int16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt64Int16 != nil { + x.FptrMapInt64Int16 = nil + } + } else { + if x.FptrMapInt64Int16 == nil { + x.FptrMapInt64Int16 = new(map[int64]int16) + } + yym2224 := z.DecBinary() + _ = yym2224 + if false { + } else { + z.F.DecMapInt64Int16X(x.FptrMapInt64Int16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Int32 = nil + } else { + yyv2225 := &x.FMapInt64Int32 + yym2226 := z.DecBinary() + _ = yym2226 + if false { + } else { + z.F.DecMapInt64Int32X(yyv2225, d) + } + } + if x.FptrMapInt64Int32 == nil { + x.FptrMapInt64Int32 = new(map[int64]int32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt64Int32 != nil { + x.FptrMapInt64Int32 = nil + } + } else { + if x.FptrMapInt64Int32 == nil { + x.FptrMapInt64Int32 = new(map[int64]int32) + } + yym2228 := z.DecBinary() + _ = yym2228 + if false { + } else { + z.F.DecMapInt64Int32X(x.FptrMapInt64Int32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Int64 = nil + } else { + yyv2229 := &x.FMapInt64Int64 + yym2230 := z.DecBinary() + _ = yym2230 + if false { + } else { + z.F.DecMapInt64Int64X(yyv2229, d) + } + } + if x.FptrMapInt64Int64 == nil { + x.FptrMapInt64Int64 = new(map[int64]int64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt64Int64 != nil { + x.FptrMapInt64Int64 = nil + } + } else { + if x.FptrMapInt64Int64 == nil { + x.FptrMapInt64Int64 = new(map[int64]int64) + } + yym2232 := z.DecBinary() + _ = yym2232 + if false { + } else { + z.F.DecMapInt64Int64X(x.FptrMapInt64Int64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Float32 = nil + } else { + yyv2233 := &x.FMapInt64Float32 + yym2234 := z.DecBinary() + _ = yym2234 + if false { + } else { + z.F.DecMapInt64Float32X(yyv2233, d) + } + } + if x.FptrMapInt64Float32 == nil { + x.FptrMapInt64Float32 = new(map[int64]float32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt64Float32 != nil { + x.FptrMapInt64Float32 = nil + } + } else { + if x.FptrMapInt64Float32 == nil { + x.FptrMapInt64Float32 = new(map[int64]float32) + } + yym2236 := z.DecBinary() + _ = yym2236 + if false { + } else { + z.F.DecMapInt64Float32X(x.FptrMapInt64Float32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Float64 = nil + } else { + yyv2237 := &x.FMapInt64Float64 + yym2238 := z.DecBinary() + _ = yym2238 + if false { + } else { + z.F.DecMapInt64Float64X(yyv2237, d) + } + } + if x.FptrMapInt64Float64 == nil { + x.FptrMapInt64Float64 = new(map[int64]float64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt64Float64 != nil { + x.FptrMapInt64Float64 = nil + } + } else { + if x.FptrMapInt64Float64 == nil { + x.FptrMapInt64Float64 = new(map[int64]float64) + } + yym2240 := z.DecBinary() + _ = yym2240 + if false { + } else { + z.F.DecMapInt64Float64X(x.FptrMapInt64Float64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapInt64Bool = nil + } else { + yyv2241 := &x.FMapInt64Bool + yym2242 := z.DecBinary() + _ = yym2242 + if false { + } else { + z.F.DecMapInt64BoolX(yyv2241, d) + } + } + if x.FptrMapInt64Bool == nil { + x.FptrMapInt64Bool = new(map[int64]bool) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapInt64Bool != nil { + x.FptrMapInt64Bool = nil + } + } else { + if x.FptrMapInt64Bool == nil { + x.FptrMapInt64Bool = new(map[int64]bool) + } + yym2244 := z.DecBinary() + _ = yym2244 + if false { + } else { + z.F.DecMapInt64BoolX(x.FptrMapInt64Bool, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolIntf = nil + } else { + yyv2245 := &x.FMapBoolIntf + yym2246 := z.DecBinary() + _ = yym2246 + if false { + } else { + z.F.DecMapBoolIntfX(yyv2245, d) + } + } + if x.FptrMapBoolIntf == nil { + x.FptrMapBoolIntf = new(map[bool]interface{}) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapBoolIntf != nil { + x.FptrMapBoolIntf = nil + } + } else { + if x.FptrMapBoolIntf == nil { + x.FptrMapBoolIntf = new(map[bool]interface{}) + } + yym2248 := z.DecBinary() + _ = yym2248 + if false { + } else { + z.F.DecMapBoolIntfX(x.FptrMapBoolIntf, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolString = nil + } else { + yyv2249 := &x.FMapBoolString + yym2250 := z.DecBinary() + _ = yym2250 + if false { + } else { + z.F.DecMapBoolStringX(yyv2249, d) + } + } + if x.FptrMapBoolString == nil { + x.FptrMapBoolString = new(map[bool]string) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapBoolString != nil { + x.FptrMapBoolString = nil + } + } else { + if x.FptrMapBoolString == nil { + x.FptrMapBoolString = new(map[bool]string) + } + yym2252 := z.DecBinary() + _ = yym2252 + if false { + } else { + z.F.DecMapBoolStringX(x.FptrMapBoolString, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolUint = nil + } else { + yyv2253 := &x.FMapBoolUint + yym2254 := z.DecBinary() + _ = yym2254 + if false { + } else { + z.F.DecMapBoolUintX(yyv2253, d) + } + } + if x.FptrMapBoolUint == nil { + x.FptrMapBoolUint = new(map[bool]uint) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapBoolUint != nil { + x.FptrMapBoolUint = nil + } + } else { + if x.FptrMapBoolUint == nil { + x.FptrMapBoolUint = new(map[bool]uint) + } + yym2256 := z.DecBinary() + _ = yym2256 + if false { + } else { + z.F.DecMapBoolUintX(x.FptrMapBoolUint, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolUint8 = nil + } else { + yyv2257 := &x.FMapBoolUint8 + yym2258 := z.DecBinary() + _ = yym2258 + if false { + } else { + z.F.DecMapBoolUint8X(yyv2257, d) + } + } + if x.FptrMapBoolUint8 == nil { + x.FptrMapBoolUint8 = new(map[bool]uint8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapBoolUint8 != nil { + x.FptrMapBoolUint8 = nil + } + } else { + if x.FptrMapBoolUint8 == nil { + x.FptrMapBoolUint8 = new(map[bool]uint8) + } + yym2260 := z.DecBinary() + _ = yym2260 + if false { + } else { + z.F.DecMapBoolUint8X(x.FptrMapBoolUint8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolUint16 = nil + } else { + yyv2261 := &x.FMapBoolUint16 + yym2262 := z.DecBinary() + _ = yym2262 + if false { + } else { + z.F.DecMapBoolUint16X(yyv2261, d) + } + } + if x.FptrMapBoolUint16 == nil { + x.FptrMapBoolUint16 = new(map[bool]uint16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapBoolUint16 != nil { + x.FptrMapBoolUint16 = nil + } + } else { + if x.FptrMapBoolUint16 == nil { + x.FptrMapBoolUint16 = new(map[bool]uint16) + } + yym2264 := z.DecBinary() + _ = yym2264 + if false { + } else { + z.F.DecMapBoolUint16X(x.FptrMapBoolUint16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolUint32 = nil + } else { + yyv2265 := &x.FMapBoolUint32 + yym2266 := z.DecBinary() + _ = yym2266 + if false { + } else { + z.F.DecMapBoolUint32X(yyv2265, d) + } + } + if x.FptrMapBoolUint32 == nil { + x.FptrMapBoolUint32 = new(map[bool]uint32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapBoolUint32 != nil { + x.FptrMapBoolUint32 = nil + } + } else { + if x.FptrMapBoolUint32 == nil { + x.FptrMapBoolUint32 = new(map[bool]uint32) + } + yym2268 := z.DecBinary() + _ = yym2268 + if false { + } else { + z.F.DecMapBoolUint32X(x.FptrMapBoolUint32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolUint64 = nil + } else { + yyv2269 := &x.FMapBoolUint64 + yym2270 := z.DecBinary() + _ = yym2270 + if false { + } else { + z.F.DecMapBoolUint64X(yyv2269, d) + } + } + if x.FptrMapBoolUint64 == nil { + x.FptrMapBoolUint64 = new(map[bool]uint64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapBoolUint64 != nil { + x.FptrMapBoolUint64 = nil + } + } else { + if x.FptrMapBoolUint64 == nil { + x.FptrMapBoolUint64 = new(map[bool]uint64) + } + yym2272 := z.DecBinary() + _ = yym2272 + if false { + } else { + z.F.DecMapBoolUint64X(x.FptrMapBoolUint64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolUintptr = nil + } else { + yyv2273 := &x.FMapBoolUintptr + yym2274 := z.DecBinary() + _ = yym2274 + if false { + } else { + z.F.DecMapBoolUintptrX(yyv2273, d) + } + } + if x.FptrMapBoolUintptr == nil { + x.FptrMapBoolUintptr = new(map[bool]uintptr) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapBoolUintptr != nil { + x.FptrMapBoolUintptr = nil + } + } else { + if x.FptrMapBoolUintptr == nil { + x.FptrMapBoolUintptr = new(map[bool]uintptr) + } + yym2276 := z.DecBinary() + _ = yym2276 + if false { + } else { + z.F.DecMapBoolUintptrX(x.FptrMapBoolUintptr, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolInt = nil + } else { + yyv2277 := &x.FMapBoolInt + yym2278 := z.DecBinary() + _ = yym2278 + if false { + } else { + z.F.DecMapBoolIntX(yyv2277, d) + } + } + if x.FptrMapBoolInt == nil { + x.FptrMapBoolInt = new(map[bool]int) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapBoolInt != nil { + x.FptrMapBoolInt = nil + } + } else { + if x.FptrMapBoolInt == nil { + x.FptrMapBoolInt = new(map[bool]int) + } + yym2280 := z.DecBinary() + _ = yym2280 + if false { + } else { + z.F.DecMapBoolIntX(x.FptrMapBoolInt, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolInt8 = nil + } else { + yyv2281 := &x.FMapBoolInt8 + yym2282 := z.DecBinary() + _ = yym2282 + if false { + } else { + z.F.DecMapBoolInt8X(yyv2281, d) + } + } + if x.FptrMapBoolInt8 == nil { + x.FptrMapBoolInt8 = new(map[bool]int8) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapBoolInt8 != nil { + x.FptrMapBoolInt8 = nil + } + } else { + if x.FptrMapBoolInt8 == nil { + x.FptrMapBoolInt8 = new(map[bool]int8) + } + yym2284 := z.DecBinary() + _ = yym2284 + if false { + } else { + z.F.DecMapBoolInt8X(x.FptrMapBoolInt8, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolInt16 = nil + } else { + yyv2285 := &x.FMapBoolInt16 + yym2286 := z.DecBinary() + _ = yym2286 + if false { + } else { + z.F.DecMapBoolInt16X(yyv2285, d) + } + } + if x.FptrMapBoolInt16 == nil { + x.FptrMapBoolInt16 = new(map[bool]int16) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapBoolInt16 != nil { + x.FptrMapBoolInt16 = nil + } + } else { + if x.FptrMapBoolInt16 == nil { + x.FptrMapBoolInt16 = new(map[bool]int16) + } + yym2288 := z.DecBinary() + _ = yym2288 + if false { + } else { + z.F.DecMapBoolInt16X(x.FptrMapBoolInt16, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolInt32 = nil + } else { + yyv2289 := &x.FMapBoolInt32 + yym2290 := z.DecBinary() + _ = yym2290 + if false { + } else { + z.F.DecMapBoolInt32X(yyv2289, d) + } + } + if x.FptrMapBoolInt32 == nil { + x.FptrMapBoolInt32 = new(map[bool]int32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapBoolInt32 != nil { + x.FptrMapBoolInt32 = nil + } + } else { + if x.FptrMapBoolInt32 == nil { + x.FptrMapBoolInt32 = new(map[bool]int32) + } + yym2292 := z.DecBinary() + _ = yym2292 + if false { + } else { + z.F.DecMapBoolInt32X(x.FptrMapBoolInt32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolInt64 = nil + } else { + yyv2293 := &x.FMapBoolInt64 + yym2294 := z.DecBinary() + _ = yym2294 + if false { + } else { + z.F.DecMapBoolInt64X(yyv2293, d) + } + } + if x.FptrMapBoolInt64 == nil { + x.FptrMapBoolInt64 = new(map[bool]int64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapBoolInt64 != nil { + x.FptrMapBoolInt64 = nil + } + } else { + if x.FptrMapBoolInt64 == nil { + x.FptrMapBoolInt64 = new(map[bool]int64) + } + yym2296 := z.DecBinary() + _ = yym2296 + if false { + } else { + z.F.DecMapBoolInt64X(x.FptrMapBoolInt64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolFloat32 = nil + } else { + yyv2297 := &x.FMapBoolFloat32 + yym2298 := z.DecBinary() + _ = yym2298 + if false { + } else { + z.F.DecMapBoolFloat32X(yyv2297, d) + } + } + if x.FptrMapBoolFloat32 == nil { + x.FptrMapBoolFloat32 = new(map[bool]float32) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapBoolFloat32 != nil { + x.FptrMapBoolFloat32 = nil + } + } else { + if x.FptrMapBoolFloat32 == nil { + x.FptrMapBoolFloat32 = new(map[bool]float32) + } + yym2300 := z.DecBinary() + _ = yym2300 + if false { + } else { + z.F.DecMapBoolFloat32X(x.FptrMapBoolFloat32, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolFloat64 = nil + } else { + yyv2301 := &x.FMapBoolFloat64 + yym2302 := z.DecBinary() + _ = yym2302 + if false { + } else { + z.F.DecMapBoolFloat64X(yyv2301, d) + } + } + if x.FptrMapBoolFloat64 == nil { + x.FptrMapBoolFloat64 = new(map[bool]float64) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapBoolFloat64 != nil { + x.FptrMapBoolFloat64 = nil + } + } else { + if x.FptrMapBoolFloat64 == nil { + x.FptrMapBoolFloat64 = new(map[bool]float64) + } + yym2304 := z.DecBinary() + _ = yym2304 + if false { + } else { + z.F.DecMapBoolFloat64X(x.FptrMapBoolFloat64, d) + } + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + x.FMapBoolBool = nil + } else { + yyv2305 := &x.FMapBoolBool + yym2306 := z.DecBinary() + _ = yym2306 + if false { + } else { + z.F.DecMapBoolBoolX(yyv2305, d) + } + } + if x.FptrMapBoolBool == nil { + x.FptrMapBoolBool = new(map[bool]bool) + } + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + r.ReadArrayEnd() + return + } + r.ReadArrayElem() + if r.TryDecodeAsNil() { + if x.FptrMapBoolBool != nil { + x.FptrMapBoolBool = nil + } + } else { + if x.FptrMapBoolBool == nil { + x.FptrMapBoolBool = new(map[bool]bool) + } + yym2308 := z.DecBinary() + _ = yym2308 + if false { + } else { + z.F.DecMapBoolBoolX(x.FptrMapBoolBool, d) + } + } + for { + yyj1156++ + if yyhl1156 { + yyb1156 = yyj1156 > l + } else { + yyb1156 = r.CheckBreak() + } + if yyb1156 { + break + } + r.ReadArrayElem() + z.DecStructFieldNotFound(yyj1156-1, "") + } + r.ReadArrayEnd() +} + +func (x testMammoth2Binary) CodecEncodeSelf(e *Encoder) { + var h codecSelfer19781 + z, r := GenHelperEncoder(e) + _, _, _ = h, z, r + yym1 := z.EncBinary() + _ = yym1 + if false { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) + } else if yym1 { + z.EncBinaryMarshal(x) + } else { + r.EncodeUint(uint64(x)) + } +} + +func (x *testMammoth2Binary) CodecDecodeSelf(d *Decoder) { + var h codecSelfer19781 + z, r := GenHelperDecoder(d) + _, _, _ = h, z, r + yym1 := z.DecBinary() + _ = yym1 + if false { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) + } else if yym1 { + z.DecBinaryUnmarshal(x) + } else { + *((*uint64)(x)) = uint64(r.DecodeUint(64)) + } +} + +func (x testMammoth2Text) CodecEncodeSelf(e *Encoder) { + var h codecSelfer19781 + z, r := GenHelperEncoder(e) + _, _, _ = h, z, r + yym1 := z.EncBinary() + _ = yym1 + if false { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) + } else if !yym1 { + z.EncTextMarshal(x) + } else { + r.EncodeUint(uint64(x)) + } +} + +func (x *testMammoth2Text) CodecDecodeSelf(d *Decoder) { + var h codecSelfer19781 + z, r := GenHelperDecoder(d) + _, _, _ = h, z, r + yym1 := z.DecBinary() + _ = yym1 + if false { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) + } else if !yym1 { + z.DecTextUnmarshal(x) + } else { + *((*uint64)(x)) = uint64(r.DecodeUint(64)) + } +} + +func (x testMammoth2Json) CodecEncodeSelf(e *Encoder) { + var h codecSelfer19781 + z, r := GenHelperEncoder(e) + _, _, _ = h, z, r + yym1 := z.EncBinary() + _ = yym1 + if false { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.EncExtension(x, yyxt1) + } else if !yym1 && 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 + yym1 := z.DecBinary() + _ = yym1 + if false { + } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil { + z.DecExtension(x, yyxt1) + } else if !yym1 && z.IsJSONHandle() { + z.DecJSONUnmarshal(x) + } else { + *((*uint64)(x)) = uint64(r.DecodeUint(64)) + } +} + +func (x *testMammoth2Basic) CodecEncodeSelf(e *Encoder) { + var h codecSelfer19781 + z, r := GenHelperEncoder(e) + _, _, _ = h, z, r + if x == nil { + r.EncodeNil() + } else { + yym1 := z.EncBinary() + _ = yym1 + 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 + yym1 := z.DecBinary() + _ = yym1 + 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 { + yym1 := z.EncBinary() + _ = yym1 + 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 + if yyr2 || yy2arr2 { + r.WriteArrayStart(8) + } else { + r.WriteMapStart(8) + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + yy4 := &x.V + yy4.CodecEncodeSelf(e) + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `V`) + r.WriteMapElemValue() + yy6 := &x.V + yy6.CodecEncodeSelf(e) + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + x.T.CodecEncodeSelf(e) + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `T`) + r.WriteMapElemValue() + x.T.CodecEncodeSelf(e) + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + x.B.CodecEncodeSelf(e) + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `B`) + r.WriteMapElemValue() + x.B.CodecEncodeSelf(e) + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + x.J.CodecEncodeSelf(e) + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `J`) + r.WriteMapElemValue() + x.J.CodecEncodeSelf(e) + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + yy18 := &x.C + yy18.CodecEncodeSelf(e) + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `C`) + r.WriteMapElemValue() + yy20 := &x.C + yy20.CodecEncodeSelf(e) + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.M == nil { + r.EncodeNil() + } else { + yym23 := z.EncBinary() + _ = yym23 + if false { + } else { + h.encMaptestMammoth2BasicTestMammoth2((map[testMammoth2Basic]TestMammoth2)(x.M), e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `M`) + r.WriteMapElemValue() + if x.M == nil { + r.EncodeNil() + } else { + yym24 := z.EncBinary() + _ = yym24 + if false { + } else { + h.encMaptestMammoth2BasicTestMammoth2((map[testMammoth2Basic]TestMammoth2)(x.M), e) + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + if x.L == nil { + r.EncodeNil() + } else { + yym26 := z.EncBinary() + _ = yym26 + if false { + } else { + h.encSliceTestMammoth2(([]TestMammoth2)(x.L), e) + } + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `L`) + r.WriteMapElemValue() + if x.L == nil { + r.EncodeNil() + } else { + yym27 := z.EncBinary() + _ = yym27 + if false { + } else { + h.encSliceTestMammoth2(([]TestMammoth2)(x.L), e) + } + } + } + if yyr2 || yy2arr2 { + r.WriteArrayElem() + yy29 := &x.A + yym30 := z.EncBinary() + _ = yym30 + if false { + } else { + h.encArray4int64((*[4]int64)(yy29), e) + } + } else { + r.WriteMapElemKey() + r.EncodeString(codecSelferCcUTF819781, `A`) + r.WriteMapElemValue() + yy31 := &x.A + yym32 := z.EncBinary() + _ = yym32 + 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 + yym1 := z.DecBinary() + _ = yym1 + 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 yys3Slc = z.DecScratchBuffer() // default slice to decode into + _ = yys3Slc + var yyhl3 bool = l >= 0 + for yyj3 := 0; ; yyj3++ { + if yyhl3 { + if yyj3 >= l { + break + } + } else { + if r.CheckBreak() { + break + } + } + r.ReadMapElemKey() + yys3Slc = r.DecodeStringAsBytes() + yys3 := string(yys3Slc) + r.ReadMapElemValue() + switch yys3 { + case "V": + if r.TryDecodeAsNil() { + x.V = TestMammoth2{} + } else { + yyv4 := &x.V + yyv4.CodecDecodeSelf(d) + } + case "T": + if r.TryDecodeAsNil() { + x.T = 0 + } else { + yyv5 := &x.T + yyv5.CodecDecodeSelf(d) + } + case "B": + if r.TryDecodeAsNil() { + x.B = 0 + } else { + yyv6 := &x.B + yyv6.CodecDecodeSelf(d) + } + case "J": + if r.TryDecodeAsNil() { + x.J = 0 + } else { + yyv7 := &x.J + yyv7.CodecDecodeSelf(d) + } + case "C": + if r.TryDecodeAsNil() { + x.C = testMammoth2Basic{} + } else { + yyv8 := &x.C + yyv8.CodecDecodeSelf(d) + } + case "M": + if r.TryDecodeAsNil() { + x.M = nil + } else { + yyv9 := &x.M + yym10 := z.DecBinary() + _ = yym10 + if false { + } else { + h.decMaptestMammoth2BasicTestMammoth2((*map[testMammoth2Basic]TestMammoth2)(yyv9), d) + } + } + case "L": + if r.TryDecodeAsNil() { + x.L = nil + } else { + yyv11 := &x.L + yym12 := z.DecBinary() + _ = yym12 + if false { + } else { + h.decSliceTestMammoth2((*[]TestMammoth2)(yyv11), d) + } + } + case "A": + if r.TryDecodeAsNil() { + x.A = [4]int64{} + } else { + yyv13 := &x.A + yym14 := z.DecBinary() + _ = yym14 + if false { + } else { + h.decArray4int64((*[4]int64)(yyv13), 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 { + yyv16 := &x.V + yyv16.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 { + yyv17 := &x.T + yyv17.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 { + yyv18 := &x.B + yyv18.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 { + yyv19 := &x.J + yyv19.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 { + yyv20 := &x.C + yyv20.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 { + yyv21 := &x.M + yym22 := z.DecBinary() + _ = yym22 + if false { + } else { + h.decMaptestMammoth2BasicTestMammoth2((*map[testMammoth2Basic]TestMammoth2)(yyv21), 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 { + yyv23 := &x.L + yym24 := z.DecBinary() + _ = yym24 + if false { + } else { + h.decSliceTestMammoth2((*[]TestMammoth2)(yyv23), 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 { + yyv25 := &x.A + yym26 := z.DecBinary() + _ = yym26 + if false { + } else { + h.decArray4int64((*[4]int64)(yyv25), 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() + yym2 := z.EncBinary() + _ = yym2 + 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 ; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { + + yyh1.ElemContainerState(yyj1) + // yydn1 = r.TryDecodeAsNil() + + // if indefinite, etc, then expand the slice if necessary + 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 { + yyv2 := &yyv1[yyj1] + yym3 := z.DecBinary() + _ = yym3 + if false { + } else { + *((*uint64)(yyv2)) = uint64(r.DecodeUint(64)) + } + } + + } + + } + + } + 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 { + yyv2 := &yymk1 + yyv2.CodecDecodeSelf(d) + } + + if yymg1 { + yymv1 = yyv1[yymk1] + } else { + yymv1 = TestMammoth2{} + } + r.ReadMapElemValue() + yymdn1 = false + if r.TryDecodeAsNil() { + yymdn1 = true + } else { + yyv3 := &yymv1 + yyv3.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 ; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { + if yyj1 == 0 && len(yyv1) == 0 { + if yyhl1 { + yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 4880) + } else { + yyrl1 = 8 + } + yyv1 = make([]TestMammoth2, yyrl1) + yyc1 = true + } + yyh1.ElemContainerState(yyj1) + // yydn1 = r.TryDecodeAsNil() + + // if indefinite, etc, then expand the slice if necessary + 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 { + yyv2 := &yyv1[yyj1] + yyv2.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() + yym2 := z.EncBinary() + _ = yym2 + 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 ; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { + + yyh1.ElemContainerState(yyj1) + // yydn1 = r.TryDecodeAsNil() + + // if indefinite, etc, then expand the slice if necessary + 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 { + yyv2 := &yyv1[yyj1] + yym3 := z.DecBinary() + _ = yym3 + if false { + } else { + *((*int64)(yyv2)) = int64(r.DecodeInt(64)) + } + } + + } + + } + + } + 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 0000000..4c62dff --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/mammoth2_generated_test.go @@ -0,0 +1,658 @@ +// +build !notfastpath + +// 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. + +// 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 0000000..3e15832 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/mammoth_generated_test.go @@ -0,0 +1,13188 @@ +// 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. + +// 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/vendor/github.com/ugorji/go/codec/msgpack.go b/vendor/github.com/ugorji/go/codec/msgpack.go similarity index 77% rename from _vendor/vendor/github.com/ugorji/go/codec/msgpack.go rename to vendor/github.com/ugorji/go/codec/msgpack.go index f9f8723..f7dcba8 100644 --- a/_vendor/vendor/github.com/ugorji/go/codec/msgpack.go +++ b/vendor/github.com/ugorji/go/codec/msgpack.go @@ -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 ( @@ -25,6 +25,7 @@ import ( "math" "net/rpc" "reflect" + "time" ) const ( @@ -78,6 +79,9 @@ const ( mpNegFixNumMax = 0xff ) +var mpTimeExtTag int8 = -1 +var mpTimeExtTagU = uint8(mpTimeExtTag) + // 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. @@ -104,7 +108,8 @@ var ( type msgpackEncDriver struct { noBuiltInTypes - encNoSeparator + encDriverNoopContainerWriter + // encNoSeparator e *Encoder w encWriter h *MsgpackHandle @@ -116,10 +121,26 @@ func (e *msgpackEncDriver) EncodeNil() { } func (e *msgpackEncDriver) EncodeInt(i int64) { - if i >= 0 { - e.EncodeUint(uint64(i)) + // if i >= 0 { + // e.EncodeUint(uint64(i)) + // } else if false && + 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 { - e.w.writen1(byte(i)) + 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)) } else if i >= math.MinInt16 { @@ -136,7 +157,11 @@ func (e *msgpackEncDriver) EncodeInt(i int64) { func (e *msgpackEncDriver) EncodeUint(i uint64) { if i <= math.MaxInt8 { - e.w.writen1(byte(i)) + 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)) } else if i <= math.MaxUint16 { @@ -169,6 +194,39 @@ func (e *msgpackEncDriver) EncodeFloat64(f float64) { 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(msgpackContainerStr, 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 { @@ -179,7 +237,7 @@ func (e *msgpackEncDriver) EncodeExt(v interface{}, xtag uint64, ext Ext, _ *Enc e.encodeExtPreamble(uint8(xtag), len(bs)) e.w.writeb(bs) } else { - e.EncodeStringBytes(c_RAW, bs) + e.EncodeStringBytes(cRAW, bs) } } @@ -213,36 +271,42 @@ func (e *msgpackEncDriver) encodeExtPreamble(xtag byte, l int) { } } -func (e *msgpackEncDriver) EncodeArrayStart(length int) { +func (e *msgpackEncDriver) WriteArrayStart(length int) { e.writeContainerLen(msgpackContainerList, length) } -func (e *msgpackEncDriver) EncodeMapStart(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)) + slen := len(s) + if c == cRAW && e.h.WriteExt { + e.writeContainerLen(msgpackContainerBin, slen) } else { - e.writeContainerLen(msgpackContainerStr, len(s)) + e.writeContainerLen(msgpackContainerStr, slen) } - if len(s) > 0 { + if slen > 0 { e.w.writestr(s) } } func (e *msgpackEncDriver) EncodeSymbol(v string) { - e.EncodeString(c_UTF8, v) + e.EncodeString(cUTF8, v) } func (e *msgpackEncDriver) EncodeStringBytes(c charEncoding, bs []byte) { - if c == c_RAW && e.h.WriteExt { - e.writeContainerLen(msgpackContainerBin, len(bs)) - } else { - e.writeContainerLen(msgpackContainerStr, len(bs)) + if bs == nil { + e.EncodeNil() + return } - if len(bs) > 0 { + slen := len(bs) + if c == cRAW && e.h.WriteExt { + e.writeContainerLen(msgpackContainerBin, slen) + } else { + e.writeContainerLen(msgpackContainerStr, slen) + } + if slen > 0 { e.w.writeb(bs) } } @@ -272,8 +336,9 @@ type msgpackDecDriver struct { bdRead bool br bool // bytes reader noBuiltInTypes - noStreamingCodec - decNoSeparator + // noStreamingCodec + // decNoSeparator + decDriverNoopContainerReader } // Note: This returns either a primitive (int, bool, etc) for non-containers, @@ -286,7 +351,7 @@ func (d *msgpackDecDriver) DecodeNaked() { d.readNextBd() } bd := d.bd - n := &d.d.n + n := d.d.n var decodeFurther bool switch bd { @@ -349,11 +414,11 @@ func (d *msgpackDecDriver) DecodeNaked() { n.s = d.DecodeString() } else { n.v = valueTypeBytes - n.l = d.DecodeBytes(nil, false, false) + n.l = d.DecodeBytes(nil, false) } case bd == mpBin8, bd == mpBin16, bd == mpBin32: n.v = valueTypeBytes - n.l = d.DecodeBytes(nil, false, false) + n.l = d.DecodeBytes(nil, false) case bd == mpArray16, bd == mpArray32, bd >= mpFixArrayMin && bd <= mpFixArrayMax: n.v = valueTypeArray decodeFurther = true @@ -364,7 +429,12 @@ func (d *msgpackDecDriver) DecodeNaked() { n.v = valueTypeExt clen := d.readExtLen() n.u = uint64(d.r.readn1()) - n.l = d.r.readx(clen) + if n.u == uint64(mpTimeExtTagU) { + n.v = valueTypeTime + n.t = d.decodeTime(clen) + } else { + n.l = d.r.readx(clen) + } default: d.d.errorf("Nil-Deciphered DecodeValue: %s: hex: %x, dec: %d", msgBadDesc, bd, bd) } @@ -525,17 +595,50 @@ func (d *msgpackDecDriver) DecodeBool() (b bool) { return } -func (d *msgpackDecDriver) DecodeBytes(bs []byte, isstring, zerocopy bool) (bsOut []byte) { +func (d *msgpackDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) { if !d.bdRead { d.readNextBd() } + + // check if an "array" of uint8's (see ContainerType for how to infer if an array) + bd := d.bd + // DecodeBytes could be from: bin str fixstr fixarray array ... var clen int - // ignore isstring. Expect that the bytes may be found from msgpackContainerStr or msgpackContainerBin - if bd := d.bd; bd == mpBin8 || bd == mpBin16 || bd == mpBin32 { - clen = d.readContainerLen(msgpackContainerBin) - } else { + vt := d.ContainerType() + switch vt { + case valueTypeBytes: + // valueTypeBytes may be a mpBin or an mpStr container + if bd == mpBin8 || bd == mpBin16 || bd == mpBin32 { + clen = d.readContainerLen(msgpackContainerBin) + } else { + clen = d.readContainerLen(msgpackContainerStr) + } + case valueTypeString: clen = d.readContainerLen(msgpackContainerStr) + case valueTypeArray: + bsOut, _ = fastpathTV.DecSliceUint8V(bs, true, d.d) + return + // clen = d.readContainerLen(msgpackContainerList) + // // ensure everything after is one byte each + // for i := 0; i < clen; i++ { + // d.readNextBd() + // if d.bd == mpNil { + // bs = append(bs, 0) + // } else if d.bd == mpUint8 { + // bs = append(bs, d.r.readn1()) + // } else { + // d.d.errorf("cannot read non-byte into a byte array") + // return + // } + // } + // d.bdRead = false + // return bs + default: + d.d.errorf("invalid container type: expecting bin|str|array, got: 0x%x", uint8(vt)) + return } + + // these are (bin|str)(8|16|32) // println("DecodeBytes: clen: ", clen) d.bdRead = false // bytes may be nil, so handle it. if nil, clen=-1. @@ -549,11 +652,15 @@ func (d *msgpackDecDriver) DecodeBytes(bs []byte, isstring, zerocopy bool) (bsOu bs = d.b[:] } } - return decByteSlice(d.r, clen, bs) + return decByteSlice(d.r, clen, d.d.h.MaxInitLen, bs) } func (d *msgpackDecDriver) DecodeString() (s string) { - return string(d.DecodeBytes(d.b[:], true, true)) + return string(d.DecodeBytes(d.b[:], true)) +} + +func (d *msgpackDecDriver) DecodeStringAsBytes() (s []byte) { + return d.DecodeBytes(d.b[:], true) } func (d *msgpackDecDriver) readNextBd() { @@ -561,7 +668,17 @@ func (d *msgpackDecDriver) readNextBd() { d.bdRead = true } +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 { return valueTypeNil @@ -576,9 +693,10 @@ func (d *msgpackDecDriver) ContainerType() (vt valueType) { return valueTypeArray } else if bd == mpMap16 || bd == mpMap32 || (bd >= mpFixMapMin && bd <= mpFixMapMax) { return valueTypeMap - } else { - // d.d.errorf("isContainerType: unsupported parameter: %v", vt) } + // else { + // d.d.errorf("isContainerType: unsupported parameter: %v", vt) + // } return valueTypeUnset } @@ -588,7 +706,7 @@ func (d *msgpackDecDriver) TryDecodeAsNil() (v bool) { } if d.bd == mpNil { d.bdRead = false - v = true + return true } return } @@ -614,10 +732,16 @@ func (d *msgpackDecDriver) readContainerLen(ct msgpackContainerType) (clen int) } func (d *msgpackDecDriver) ReadMapStart() int { + if !d.bdRead { + d.readNextBd() + } return d.readContainerLen(msgpackContainerMap) } func (d *msgpackDecDriver) ReadArrayStart() int { + if !d.bdRead { + d.readNextBd() + } return d.readContainerLen(msgpackContainerList) } @@ -648,6 +772,57 @@ func (d *msgpackDecDriver) readExtLen() (clen int) { return } +func (d *msgpackDecDriver) DecodeTime() (t time.Time) { + // decode time from string bytes or ext + if !d.bdRead { + d.readNextBd() + } + if d.bd == mpNil { + d.bdRead = false + return + } + var clen int + switch d.ContainerType() { + case valueTypeBytes, valueTypeString: + clen = d.readContainerLen(msgpackContainerStr) + default: + // 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 sequence of bytes for decoding time as an 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("decodeExt: tag must be <= 0xff; got: %v", xtag) @@ -671,10 +846,10 @@ func (d *msgpackDecDriver) decodeExtV(verifyTag bool, tag byte) (xtag byte, xbs } xbd := d.bd if xbd == mpBin8 || xbd == mpBin16 || xbd == mpBin32 { - xbs = d.DecodeBytes(nil, false, true) + xbs = d.DecodeBytes(nil, true) } else if xbd == mpStr8 || xbd == mpStr16 || xbd == mpStr32 || (xbd >= mpFixStrMin && xbd <= mpFixStrMax) { - xbs = d.DecodeBytes(nil, true, true) + xbs = d.DecodeStringAsBytes() } else { clen := d.readExtLen() xtag = d.r.readn1() @@ -697,6 +872,9 @@ type MsgpackHandle struct { // RawToString controls how raw bytes are decoded into a nil interface{}. RawToString bool + // NoFixedNum says to output all signed integers as 2-bytes, never as 1-byte fixednum. + NoFixedNum bool + // WriteExt flag supports encoding configured extensions with extension tags. // It also controls whether other elements of the new spec are encoded (ie Str8). // @@ -709,8 +887,10 @@ type MsgpackHandle struct { // a []byte or string based on the setting of RawToString. WriteExt bool binaryEncodingType + noElemSeparators } +// SetBytesExt sets an extension func (h *MsgpackHandle) SetBytesExt(rt reflect.Type, tag uint64, ext BytesExt) (err error) { return h.SetExt(rt, tag, &setExtWrapper{b: ext}) } @@ -720,7 +900,7 @@ func (h *MsgpackHandle) newEncDriver(e *Encoder) encDriver { } func (h *MsgpackHandle) newDecDriver(d *Decoder) decDriver { - return &msgpackDecDriver{d: d, r: d.r, h: h, br: d.bytes} + return &msgpackDecDriver{d: d, h: h, r: d.r, br: d.bytes} } func (e *msgpackEncDriver) reset() { @@ -728,7 +908,7 @@ func (e *msgpackEncDriver) reset() { } func (d *msgpackDecDriver) reset() { - d.r = d.d.r + d.r, d.br = d.d.r, d.d.bytes d.bd, d.bdRead = 0, false } @@ -750,7 +930,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 { @@ -762,7 +942,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 { @@ -782,7 +962,6 @@ func (c *msgpackSpecRpcCodec) ReadRequestBody(body interface{}) error { } func (c *msgpackSpecRpcCodec) parseCustomHeader(expectTypeByte byte, msgid *uint64, methodOrError *string) (err error) { - if c.isClosed() { return io.EOF } @@ -796,28 +975,33 @@ 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("Unexpected value for array descriptor: Expecting %v. Received %v", fia, b) + } else { + err = c.read(&b) + if err == nil { + if b != expectTypeByte { + err = fmt.Errorf("Unexpected byte descriptor in header. Expecting %v. Received %v", expectTypeByte, b) + } else { + err = c.read(msgid) + if err == nil { + err = c.read(methodOrError) + } + } + } } return } @@ -830,7 +1014,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/vendor/github.com/ugorji/go/codec/noop.go b/vendor/github.com/ugorji/go/codec/noop.go similarity index 96% rename from _vendor/vendor/github.com/ugorji/go/codec/noop.go rename to vendor/github.com/ugorji/go/codec/noop.go index cfee3d0..015af58 100644 --- a/_vendor/vendor/github.com/ugorji/go/codec/noop.go +++ b/vendor/github.com/ugorji/go/codec/noop.go @@ -1,6 +1,8 @@ // 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. +// +build ignore + package codec import ( @@ -105,10 +107,9 @@ func (h *noopDrv) DecodeUint(bitsize uint8) (ui uint64) { return uint64(h. func (h *noopDrv) DecodeFloat(chkOverflow32 bool) (f float64) { return float64(h.m(95)) } func (h *noopDrv) DecodeBool() (b bool) { return h.m(2) == 0 } func (h *noopDrv) DecodeString() (s string) { return h.S[h.m(8)] } +func (h *noopDrv) DecodeStringAsBytes() []byte { return h.DecodeBytes(nil, true) } -// func (h *noopDrv) DecodeStringAsBytes(bs []byte) []byte { return h.DecodeBytes(bs) } - -func (h *noopDrv) DecodeBytes(bs []byte, isstring, zerocopy bool) []byte { return h.B[h.m(len(h.B))] } +func (h *noopDrv) DecodeBytes(bs []byte, zerocopy bool) []byte { return h.B[h.m(len(h.B))] } func (h *noopDrv) ReadEnd() { h.end() } 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 0000000..a497cdf --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/py_test.go @@ -0,0 +1,30 @@ +// +build x + +// 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 + +// 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 new file mode 100644 index 0000000..0311703 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/rpc.go @@ -0,0 +1,197 @@ +// 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 + +import ( + "bufio" + "errors" + "io" + "net/rpc" + "sync" +) + +// 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 +} + +// rpcCodec defines the struct members and common methods. +type rpcCodec struct { + c io.Closer + r io.Reader + w io.Writer + f ioFlusher + + dec *Decoder + enc *Encoder + // bw *bufio.Writer + // br *bufio.Reader + mu sync.Mutex + h Handle + + cls bool + clsmu sync.RWMutex + clsErr error +} + +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 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(errors.New("rpc requires a JsonHandle with TermWhitespace set to true")) + } + // 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) + if !ok { + bw := bufio.NewWriter(w) + f, w = bw, bw + } + 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 bool) (err error) { + if c.isClosed() { + return c.clsErr + } + 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() + } + } + return +} + +func (c *rpcCodec) swallow(err *error) { + defer panicToErr(err) + c.dec.swallow() +} + +func (c *rpcCodec) read(obj interface{}) (err error) { + if c.isClosed() { + return c.clsErr + } + //If nil is passed in, we should read and discard + if obj == nil { + // var obj2 interface{} + // return c.dec.Decode(&obj2) + c.swallow(&err) + return + } + return c.dec.Decode(obj) +} + +func (c *rpcCodec) isClosed() (b bool) { + if c.c != nil { + c.clsmu.RLock() + b = c.cls + c.clsmu.RUnlock() + } + return +} + +func (c *rpcCodec) Close() error { + if c.c == nil || c.isClosed() { + return c.clsErr + } + c.clsmu.Lock() + c.cls = true + var fErr error + if c.f != nil { + fErr = c.f.Flush() + } + _ = fErr + c.clsErr = c.c.Close() + if c.clsErr == nil && fErr != nil { + c.clsErr = fErr + } + c.clsmu.Unlock() + return c.clsErr +} + +func (c *rpcCodec) ReadResponseBody(body interface{}) error { + return c.read(body) +} + +// ------------------------------------- + +type goRpcCodec struct { + rpcCodec +} + +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) +} + +func (c *goRpcCodec) WriteResponse(r *rpc.Response, body interface{}) error { + c.mu.Lock() + defer c.mu.Unlock() + return c.write(r, body, true) +} + +func (c *goRpcCodec) ReadResponseHeader(r *rpc.Response) error { + return c.read(r) +} + +func (c *goRpcCodec) ReadRequestHeader(r *rpc.Request) error { + return c.read(r) +} + +func (c *goRpcCodec) ReadRequestBody(body interface{}) error { + return c.read(body) +} + +// ------------------------------------- + +// goRpc is the implementation of Rpc that uses the communication protocol +// as defined in net/rpc package. +type goRpc struct{} + +// GoRpc implements Rpc using the communication protocol defined in net/rpc package. +// +// Note: network connection (from net.Dial, of type io.ReadWriteCloser) is not buffered. +// We will internally use a buffer during writes, for performance, if the non-buffered +// connection is passed in. +// +// However, you may consider explicitly passing in a buffered value e.g. +// 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) +// +// If all you care about is buffered writes, this is done automatically for you. +var GoRpc goRpc + +func (x goRpc) ServerCodec(conn io.ReadWriteCloser, h Handle) rpc.ServerCodec { + return &goRpcCodec{newRPCCodec(conn, h)} +} + +func (x goRpc) ClientCodec(conn io.ReadWriteCloser, h Handle) rpc.ClientCodec { + return &goRpcCodec{newRPCCodec(conn, h)} +} 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 0000000..0a40c60 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/shared_test.go @@ -0,0 +1,304 @@ +// 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 + +// 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) + 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 + } + 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 + } + 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/vendor/github.com/ugorji/go/codec/simple.go b/vendor/github.com/ugorji/go/codec/simple.go similarity index 71% rename from _vendor/vendor/github.com/ugorji/go/codec/simple.go rename to vendor/github.com/ugorji/go/codec/simple.go index 7c0ba7a..72ef125 100644 --- a/_vendor/vendor/github.com/ugorji/go/codec/simple.go +++ b/vendor/github.com/ugorji/go/codec/simple.go @@ -6,6 +6,7 @@ package codec import ( "math" "reflect" + "time" ) const ( @@ -20,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 @@ -30,11 +33,13 @@ const ( type simpleEncDriver struct { noBuiltInTypes - encNoSeparator + encDriverNoopContainerWriter + // encNoSeparator e *Encoder h *SimpleHandle w encWriter b [8]byte + c containerState } func (e *simpleEncDriver) EncodeNil() { @@ -42,6 +47,10 @@ func (e *simpleEncDriver) EncodeNil() { } 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,11 +59,19 @@ func (e *simpleEncDriver) EncodeBool(b bool) { } func (e *simpleEncDriver) EncodeFloat32(f float32) { + if e.h.EncZeroValuesAsNil && e.c != containerMapKey && f == 0.0 { + e.EncodeNil() + return + } e.w.writen1(simpleVdFloat32) bigenHelper{e.b[:4], e.w}.writeUint32(math.Float32bits(f)) } func (e *simpleEncDriver) EncodeFloat64(f float64) { + if e.h.EncZeroValuesAsNil && e.c != containerMapKey && f == 0.0 { + e.EncodeNil() + return + } e.w.writen1(simpleVdFloat64) bigenHelper{e.b[:8], e.w}.writeUint64(math.Float64bits(f)) } @@ -72,6 +89,10 @@ func (e *simpleEncDriver) EncodeUint(v uint64) { } func (e *simpleEncDriver) encUint(v uint64, bd uint8) { + if e.h.EncZeroValuesAsNil && e.c != containerMapKey && v == 0 { + e.EncodeNil() + return + } if v <= math.MaxUint8 { e.w.writen2(bd, uint8(v)) } else if v <= math.MaxUint16 { @@ -124,28 +145,75 @@ func (e *simpleEncDriver) encodeExtPreamble(xtag byte, length int) { e.w.writen1(xtag) } -func (e *simpleEncDriver) EncodeArrayStart(length int) { +func (e *simpleEncDriver) WriteArrayStart(length int) { + e.c = containerArrayStart e.encLen(simpleVdArray, length) } -func (e *simpleEncDriver) EncodeMapStart(length int) { +func (e *simpleEncDriver) WriteArrayElem() { + e.c = containerArrayElem +} + +func (e *simpleEncDriver) WriteArrayEnd() { + e.c = containerArrayEnd +} + +func (e *simpleEncDriver) WriteMapStart(length int) { + e.c = containerMapStart e.encLen(simpleVdMap, length) } +func (e *simpleEncDriver) WriteMapElemKey() { + e.c = containerMapKey +} + +func (e *simpleEncDriver) WriteMapElemValue() { + e.c = containerMapValue +} + +func (e *simpleEncDriver) WriteMapEnd() { + e.c = containerMapEnd +} + func (e *simpleEncDriver) EncodeString(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) + e.EncodeString(cUTF8, v) } func (e *simpleEncDriver) EncodeStringBytes(c charEncoding, 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.error(err) + return + } + // time.Time marshalbinary takes about 14 bytes. + e.w.writen2(simpleVdTime, uint8(len(v))) + e.w.writeb(v) +} + //------------------------------------ type simpleDecDriver struct { @@ -154,11 +222,12 @@ type simpleDecDriver struct { r decReader bdRead bool bd byte - br bool // bytes reader + br bool // a bytes reader? + c containerState + b [scratchByteArrayLen]byte noBuiltInTypes - noStreamingCodec - decNoSeparator - b [scratchByteArrayLen]byte + // noStreamingCodec + decDriverNoopContainerReader } func (d *simpleDecDriver) readNextBd() { @@ -166,24 +235,34 @@ func (d *simpleDecDriver) readNextBd() { d.bdRead = true } -func (d *simpleDecDriver) ContainerType() (vt valueType) { - if d.bd == simpleVdNil { - return valueTypeNil - } else if d.bd == simpleVdByteArray || d.bd == simpleVdByteArray+1 || - d.bd == simpleVdByteArray+2 || d.bd == simpleVdByteArray+3 || d.bd == simpleVdByteArray+4 { - return valueTypeBytes - } else if d.bd == simpleVdString || d.bd == simpleVdString+1 || - d.bd == simpleVdString+2 || d.bd == simpleVdString+3 || d.bd == simpleVdString+4 { - return valueTypeString - } else if d.bd == simpleVdArray || d.bd == simpleVdArray+1 || - d.bd == simpleVdArray+2 || d.bd == simpleVdArray+3 || d.bd == simpleVdArray+4 { - return valueTypeArray - } else if d.bd == simpleVdMap || d.bd == simpleVdMap+1 || - d.bd == simpleVdMap+2 || d.bd == simpleVdMap+3 || d.bd == simpleVdMap+4 { - return valueTypeMap - } else { - // d.d.errorf("isContainerType: unsupported parameter: %v", vt) +func (d *simpleDecDriver) uncacheRead() { + if d.bdRead { + d.r.unreadn1() + d.bdRead = 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 } @@ -308,15 +387,43 @@ func (d *simpleDecDriver) DecodeBool() (b bool) { } func (d *simpleDecDriver) ReadMapStart() (length int) { + if !d.bdRead { + d.readNextBd() + } d.bdRead = false + d.c = containerMapStart return d.decLen() } 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: @@ -340,15 +447,19 @@ func (d *simpleDecDriver) decLen() int { } return int(ui) } - d.d.errorf("decLen: Cannot read length: bd%8 must be in range 0..4. Got: %d", d.bd%8) + d.d.errorf("decLen: Cannot read length: bd%%8 must be in range 0..4. Got: %d", d.bd%8) return -1 } func (d *simpleDecDriver) DecodeString() (s string) { - return string(d.DecodeBytes(d.b[:], true, true)) + return string(d.DecodeBytes(d.b[:], true)) } -func (d *simpleDecDriver) DecodeBytes(bs []byte, isstring, zerocopy bool) (bsOut []byte) { +func (d *simpleDecDriver) DecodeStringAsBytes() (s []byte) { + return d.DecodeBytes(d.b[:], true) +} + +func (d *simpleDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) { if !d.bdRead { d.readNextBd() } @@ -356,6 +467,12 @@ func (d *simpleDecDriver) DecodeBytes(bs []byte, isstring, zerocopy bool) (bsOut 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 { + bsOut, _ = fastpathTV.DecSliceUint8V(bs, true, d.d) + return + } + clen := d.decLen() d.bdRead = false if zerocopy { @@ -365,7 +482,28 @@ func (d *simpleDecDriver) DecodeBytes(bs []byte, isstring, zerocopy bool) (bsOut bs = d.b[:] } } - return decByteSlice(d.r, clen, 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(clen) + if err := (&t).UnmarshalBinary(b); err != nil { + d.d.error(err) + } + return } func (d *simpleDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) (realxtag uint64) { @@ -399,9 +537,9 @@ func (d *simpleDecDriver) decodeExtV(verifyTag bool, tag byte) (xtag byte, xbs [ } xbs = d.r.readx(l) case simpleVdByteArray, simpleVdByteArray + 1, simpleVdByteArray + 2, simpleVdByteArray + 3, simpleVdByteArray + 4: - xbs = d.DecodeBytes(nil, false, true) + xbs = d.DecodeBytes(nil, true) default: - d.d.errorf("Invalid d.bd for extensions (Expecting extensions or byte array). Got: 0x%x", d.bd) + d.d.errorf("Invalid descriptor for extensions (Expecting extensions or byte array). Got: 0x%x", d.bd) return } d.bdRead = false @@ -413,7 +551,7 @@ func (d *simpleDecDriver) DecodeNaked() { d.readNextBd() } - n := &d.d.n + n := d.d.n var decodeFurther bool switch d.bd { @@ -442,12 +580,15 @@ func (d *simpleDecDriver) DecodeNaked() { case simpleVdFloat64: n.v = valueTypeFloat n.f = d.DecodeFloat(false) + 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: n.v = valueTypeBytes - n.l = d.DecodeBytes(nil, false, false) + n.l = d.DecodeBytes(nil, false) case simpleVdExt, simpleVdExt + 1, simpleVdExt + 2, simpleVdExt + 3, simpleVdExt + 4: n.v = valueTypeExt l := d.decLen() @@ -474,12 +615,12 @@ func (d *simpleDecDriver) DecodeNaked() { // 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) @@ -487,31 +628,40 @@ func (d *simpleDecDriver) DecodeNaked() { // - 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 } +// SetBytesExt sets an extension func (h *SimpleHandle) SetBytesExt(rt reflect.Type, tag uint64, ext BytesExt) (err error) { return h.SetExt(rt, tag, &setExtWrapper{b: ext}) } +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(d *Decoder) decDriver { - return &simpleDecDriver{d: d, r: d.r, h: h, br: d.bytes} + return &simpleDecDriver{d: d, h: h, r: d.r, br: d.bytes} } func (e *simpleEncDriver) reset() { + e.c = 0 e.w = e.e.w } func (d *simpleDecDriver) reset() { - d.r = d.d.r + d.c = 0 + d.r, d.br = d.d.r, d.d.bytes d.bd, d.bdRead = 0, false } 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 0000000..9028586 --- /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/test.py b/vendor/github.com/ugorji/go/codec/test.py new file mode 100755 index 0000000..800376f --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/test.py @@ -0,0 +1,126 @@ +#!/usr/bin/env python + +# This will create golden files in a directory passed to it. +# A Test calls this internally to create the golden files +# So it can process them (so we don't have to checkin the files). + +# 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 + l0 = [ + -8, + -1616, + -32323232, + -6464646464646464, + 192, + 1616, + 32323232, + 6464646464646464, + 192, + -3232.0, + -6464646464.0, + 3232.0, + 6464.0, + 6464646464.0, + False, + True, + u"null", + None, + u"some&day>some 0 + if stopTimeSec > 0: + def myStopRpcServer(): + server.stop() + t = threading.Timer(stopTimeSec, myStopRpcServer) + t.start() + server.start() + +def doRpcClientToPythonSvc(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('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"}) + +def doMain(args): + if len(args) == 2 and args[0] == "testdata": + build_test_data(args[1]) + elif len(args) == 3 and args[0] == "rpc-server": + doRpcServer(int(args[1]), int(args[2])) + elif len(args) == 2 and args[0] == "rpc-client-python-service": + doRpcClientToPythonSvc(int(args[1])) + elif len(args) == 2 and args[0] == "rpc-client-go-service": + doRpcClientToGoSvc(int(args[1])) + else: + print("Usage: test.py " + + "[testdata|rpc-server|rpc-client-python-service|rpc-client-go-service] ...") + +if __name__ == "__main__": + doMain(sys.argv[1:]) + diff --git a/_vendor/vendor/github.com/ugorji/go/codec/time.go b/vendor/github.com/ugorji/go/codec/time.go similarity index 75% rename from _vendor/vendor/github.com/ugorji/go/codec/time.go rename to vendor/github.com/ugorji/go/codec/time.go index 718b731..692a11b 100644 --- a/_vendor/vendor/github.com/ugorji/go/codec/time.go +++ b/vendor/github.com/ugorji/go/codec/time.go @@ -3,53 +3,9 @@ package codec -import ( - "fmt" - "reflect" - "time" -) +import "time" -var ( - timeDigits = [...]byte{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} - timeExtEncFn = func(rv reflect.Value) (bs []byte, err error) { - defer panicToErr(&err) - bs = timeExt{}.WriteExt(rv.Interface()) - return - } - timeExtDecFn = func(rv reflect.Value, bs []byte) (err error) { - defer panicToErr(&err) - timeExt{}.ReadExt(rv.Interface(), bs) - return - } -) - -type timeExt struct{} - -func (x timeExt) WriteExt(v interface{}) (bs []byte) { - switch v2 := v.(type) { - case time.Time: - bs = encodeTime(v2) - case *time.Time: - bs = encodeTime(*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 := decodeTime(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)) -} +// 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. @@ -189,13 +145,12 @@ func decodeTime(bs []byte) (tt time.Time, err error) { i2 = i + 2 tz = bigen.Uint16(bs[i:i2]) - 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 { @@ -210,24 +165,24 @@ func decodeTime(bs []byte) (tt time.Time, err error) { 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) -} +// 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 0000000..edee175 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/values_flex_test.go @@ -0,0 +1,186 @@ +/* // +build testing */ + +// 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 + +import "time" + +// 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 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 +} + +type Sinterface interface { + Noop() +} + +// 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 +} + +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 + + 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 + + // 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 newTestStrucFlex(depth, n int, bench, useInterface, useStringKeyOnly bool) (ts *TestStrucFlex) { + ts = &TestStrucFlex{ + 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}}, + } + + 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 0000000..341ec38 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/values_test.go @@ -0,0 +1,416 @@ +/* // +build testing */ + +// 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 + +// 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" +) + +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 +} + +type testSimpleFields 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 +} + +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, + 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")}, + }, + + 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 { + // 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 0000000..6742bd2 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/xml.go @@ -0,0 +1,432 @@ +// +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:"xid|http://ugorji.net/x-namespace id,omitempty,toarray,attr,cdata" + } + +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". + +In this mode, we only encode as attribute if ",attr" is found, and only encode as CDATA +if ",cdata" is found in the struct tag. + +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 + - add *Decoder.getStructFieldInfo(encName string) // encName here is either like abc, or h1:nsabc + No one accesses .encName anymore except in + - 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("nsabc"): x.abc() + case strings.endsWith("nsdef"): 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. + +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 insignificant between elements, +specifically between parent-child or siblings. White space occurring alone between start +and end element IS significant. However, if xml:space='preserve', then we 'preserve' +all whitespace. This is more critical when doing a DecodeNaked, but MAY not be as critical +when decoding into a typed value. + +**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 don't add any prettifying markup (indenting, etc). + +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 as attributes + } + +Question: + - if encoding a map, what if map keys have spaces in them??? + Then they cannot be attributes or child elements. Error. + +Misc: + + - 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 + } + +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) + + +*/ + +// ----------- 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, &setExtWrapper{i: 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 0000000..e696c27 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/z_all_test.go @@ -0,0 +1,464 @@ +// +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 +} + +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 + testStructToArray = true + testCheckCircRef = true + testUseReset = true + testDecodeOptions.MapValueReset = true + testEncodeOptions.RecursiveEmptyCheck = true + testReinit() + t.Run("optionsTrue", f) + + testEncodeOptions.AsSymbols = AsSymbolAll + testUseIoWrapper = true + testReinit() + t.Run("optionsTrue-ioWrapper", f) + + testUseIoEncDec = -1 + + testDepth = 6 + testReinit() + t.Run("optionsTrue-deepstruct", f) + + // 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") + // + + t.Run("TestBincCodecsTable", TestBincCodecsTable) + t.Run("TestBincCodecsMisc", TestBincCodecsMisc) + t.Run("TestBincCodecsEmbeddedPointer", TestBincCodecsEmbeddedPointer) + t.Run("TestBincStdEncIntf", TestBincStdEncIntf) + t.Run("TestBincMammoth", TestBincMammoth) + t.Run("TestSimpleCodecsTable", TestSimpleCodecsTable) + t.Run("TestSimpleCodecsMisc", TestSimpleCodecsMisc) + t.Run("TestSimpleCodecsEmbeddedPointer", TestSimpleCodecsEmbeddedPointer) + t.Run("TestSimpleStdEncIntf", TestSimpleStdEncIntf) + t.Run("TestSimpleMammoth", TestSimpleMammoth) + t.Run("TestMsgpackCodecsTable", TestMsgpackCodecsTable) + t.Run("TestMsgpackCodecsMisc", TestMsgpackCodecsMisc) + t.Run("TestMsgpackCodecsEmbeddedPointer", TestMsgpackCodecsEmbeddedPointer) + t.Run("TestMsgpackStdEncIntf", TestMsgpackStdEncIntf) + t.Run("TestMsgpackMammoth", TestMsgpackMammoth) + 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("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("TestBincRaw", TestBincRaw) + t.Run("TestMsgpackRaw", TestMsgpackRaw) + t.Run("TestSimpleRaw", TestSimpleRaw) + t.Run("TestCborRaw", TestCborRaw) + t.Run("TestAllEncCircularRef", TestAllEncCircularRef) + t.Run("TestAllAnonCycle", TestAllAnonCycle) + t.Run("TestBincRpcGo", TestBincRpcGo) + t.Run("TestSimpleRpcGo", TestSimpleRpcGo) + t.Run("TestMsgpackRpcGo", TestMsgpackRpcGo) + t.Run("TestCborRpcGo", TestCborRpcGo) + t.Run("TestJsonRpcGo", TestJsonRpcGo) + t.Run("TestMsgpackRpcSpec", TestMsgpackRpcSpec) + t.Run("TestBincUnderlyingType", TestBincUnderlyingType) + t.Run("TestJsonLargeInteger", TestJsonLargeInteger) + t.Run("TestJsonDecodeNonStringScalarInStringContext", TestJsonDecodeNonStringScalarInStringContext) + t.Run("TestJsonEncodeIndent", TestJsonEncodeIndent) + + t.Run("TestJsonSwallowAndZero", TestJsonSwallowAndZero) + t.Run("TestCborSwallowAndZero", TestCborSwallowAndZero) + t.Run("TestMsgpackSwallowAndZero", TestMsgpackSwallowAndZero) + t.Run("TestBincSwallowAndZero", TestBincSwallowAndZero) + t.Run("TestSimpleSwallowAndZero", TestSimpleSwallowAndZero) + t.Run("TestJsonRawExt", TestJsonRawExt) + t.Run("TestCborRawExt", TestCborRawExt) + t.Run("TestMsgpackRawExt", TestMsgpackRawExt) + t.Run("TestBincRawExt", TestBincRawExt) + t.Run("TestSimpleRawExt", TestSimpleRawExt) + t.Run("TestJsonMapStructKey", TestJsonMapStructKey) + t.Run("TestCborMapStructKey", TestCborMapStructKey) + t.Run("TestMsgpackMapStructKey", TestMsgpackMapStructKey) + t.Run("TestBincMapStructKey", TestBincMapStructKey) + t.Run("TestSimpleMapStructKey", TestSimpleMapStructKey) + t.Run("TestJsonDecodeNilMapValue", TestJsonDecodeNilMapValue) + t.Run("TestCborDecodeNilMapValue", TestCborDecodeNilMapValue) + t.Run("TestMsgpackDecodeNilMapValue", TestMsgpackDecodeNilMapValue) + t.Run("TestBincDecodeNilMapValue", TestBincDecodeNilMapValue) + t.Run("TestSimpleDecodeNilMapValue", TestSimpleDecodeNilMapValue) + t.Run("TestJsonEmbeddedFieldPrecedence", TestJsonEmbeddedFieldPrecedence) + t.Run("TestCborEmbeddedFieldPrecedence", TestCborEmbeddedFieldPrecedence) + t.Run("TestMsgpackEmbeddedFieldPrecedence", TestMsgpackEmbeddedFieldPrecedence) + t.Run("TestBincEmbeddedFieldPrecedence", TestBincEmbeddedFieldPrecedence) + t.Run("TestSimpleEmbeddedFieldPrecedence", TestSimpleEmbeddedFieldPrecedence) + t.Run("TestJsonLargeContainerLen", TestJsonLargeContainerLen) + t.Run("TestCborLargeContainerLen", TestCborLargeContainerLen) + t.Run("TestMsgpackLargeContainerLen", TestMsgpackLargeContainerLen) + t.Run("TestBincLargeContainerLen", TestBincLargeContainerLen) + t.Run("TestSimpleLargeContainerLen", TestSimpleLargeContainerLen) + t.Run("TestJsonMammothMapsAndSlices", TestJsonMammothMapsAndSlices) + t.Run("TestCborMammothMapsAndSlices", TestCborMammothMapsAndSlices) + t.Run("TestMsgpackMammothMapsAndSlices", TestMsgpackMammothMapsAndSlices) + t.Run("TestBincMammothMapsAndSlices", TestBincMammothMapsAndSlices) + t.Run("TestSimpleMammothMapsAndSlices", TestSimpleMammothMapsAndSlices) + t.Run("TestJsonTime", TestJsonTime) + t.Run("TestCborTime", TestCborTime) + t.Run("TestMsgpackTime", TestMsgpackTime) + t.Run("TestBincTime", TestBincTime) + t.Run("TestSimpleTime", TestSimpleTime) + t.Run("TestJsonUintToInt", TestJsonUintToInt) + t.Run("TestCborUintToInt", TestCborUintToInt) + t.Run("TestMsgpackUintToInt", TestMsgpackUintToInt) + t.Run("TestBincUintToInt", TestBincUintToInt) + t.Run("TestSimpleUintToInt", TestSimpleUintToInt) + t.Run("TestJsonDifferentMapOrSliceType", TestJsonDifferentMapOrSliceType) + t.Run("TestCborDifferentMapOrSliceType", TestCborDifferentMapOrSliceType) + t.Run("TestMsgpackDifferentMapOrSliceType", TestMsgpackDifferentMapOrSliceType) + t.Run("TestBincDifferentMapOrSliceType", TestBincDifferentMapOrSliceType) + t.Run("TestSimpleDifferentMapOrSliceType", TestSimpleDifferentMapOrSliceType) + t.Run("TestJsonScalars", TestJsonScalars) + t.Run("TestCborScalars", TestCborScalars) + t.Run("TestMsgpackScalars", TestMsgpackScalars) + t.Run("TestBincScalars", TestBincScalars) + t.Run("TestSimpleScalars", TestSimpleScalars) + + t.Run("TestJsonInvalidUnicode", TestJsonInvalidUnicode) + t.Run("TestCborHalfFloat", TestCborHalfFloat) + // +} + +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("TestJsonInvalidUnicode", TestJsonInvalidUnicode) + t.Run("TestJsonTime", TestJsonTime) + t.Run("TestJsonUintToInt", TestJsonUintToInt) + t.Run("TestJsonDifferentMapOrSliceType", TestJsonDifferentMapOrSliceType) + t.Run("TestJsonScalars", TestJsonScalars) +} + +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("TestSimpleRpcGo", TestSimpleRpcGo) + 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) +} + +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("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) +} + +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) +} + +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 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.getBasicHandle().AsSymbols + + testBincH.getBasicHandle().AsSymbols = AsSymbolNone + testReinit() + t.Run("binc-no-symbols", testBincGroup) + + testBincH.getBasicHandle().AsSymbols = AsSymbolAll + testReinit() + t.Run("binc-all-symbols", testBincGroup) + + testBincH.getBasicHandle().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/msgpack.org.md b/vendor/github.com/ugorji/go/msgpack.org.md new file mode 100644 index 0000000..d5ebe71 --- /dev/null +++ b/vendor/github.com/ugorji/go/msgpack.org.md @@ -0,0 +1,47 @@ +**MessagePack and [Binc](http://github.com/ugorji/binc) Codec for [Go](http://golang.org) Language.** + +*A High Performance, Feature-Rich, Idiomatic encode/decode and rpc library*. + +To install: + + go get github.com/ugorji/go/codec + +Source: [http://github.com/ugorji/go] +Online documentation: [http://godoc.org/github.com/ugorji/go/codec] + +Typical usage: + +```go + // create and use decoder/encoder + var ( + v interface{} // value to decode/encode into + r io.Reader + w io.Writer + b []byte + mh codec.MsgpackHandle + ) + + dec = codec.NewDecoder(r, &mh) + dec = codec.NewDecoderBytes(b, &mh) + err = dec.Decode(&v) + + enc = codec.NewEncoder(w, &mh) + enc = codec.NewEncoderBytes(&b, &mh) + err = enc.Encode(v) + + //RPC Server + go func() { + for { + conn, err := listener.Accept() + rpcCodec := codec.GoRpc.ServerCodec(conn, h) + //OR rpcCodec := codec.MsgpackSpecRpc.ServerCodec(conn, h) + rpc.ServeCodec(rpcCodec) + } + }() + + //RPC Communication (client side) + conn, err = net.Dial("tcp", "localhost:5555") + rpcCodec := codec.GoRpc.ClientCodec(conn, h) + //OR rpcCodec := codec.MsgpackSpecRpc.ClientCodec(conn, h) + client := rpc.NewClientWithCodec(rpcCodec) +``` diff --git a/vendor/github.com/yuin/gopher-lua/.travis.yml b/vendor/github.com/yuin/gopher-lua/.travis.yml new file mode 100644 index 0000000..fdaf536 --- /dev/null +++ b/vendor/github.com/yuin/gopher-lua/.travis.yml @@ -0,0 +1,15 @@ +language: go + +go: + - 1.7 + - 1.8 + - 1.9 + +before_install: + - go get github.com/axw/gocov/gocov + - go get github.com/mattn/goveralls + - if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi +install: + - go get -u -v $(go list -f '{{join .Imports "\n"}}{{"\n"}}{{join .TestImports "\n"}}' ./... | sort | uniq | grep -v gopher-lua) +script: + - $HOME/gopath/bin/goveralls -service=travis-ci diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/LICENSE b/vendor/github.com/yuin/gopher-lua/LICENSE similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/LICENSE rename to vendor/github.com/yuin/gopher-lua/LICENSE diff --git a/vendor/github.com/yuin/gopher-lua/Makefile b/vendor/github.com/yuin/gopher-lua/Makefile new file mode 100644 index 0000000..6d9e55c --- /dev/null +++ b/vendor/github.com/yuin/gopher-lua/Makefile @@ -0,0 +1,10 @@ +.PHONY: build test glua + +build: + ./_tools/go-inline *.go && go fmt . && go build + +glua: *.go pm/*.go cmd/glua/glua.go + ./_tools/go-inline *.go && go fmt . && go build cmd/glua/glua.go + +test: + ./_tools/go-inline *.go && go fmt . && go test diff --git a/vendor/github.com/yuin/gopher-lua/README.rst b/vendor/github.com/yuin/gopher-lua/README.rst new file mode 100644 index 0000000..30b718b --- /dev/null +++ b/vendor/github.com/yuin/gopher-lua/README.rst @@ -0,0 +1,801 @@ +=============================================================================== +GopherLua: VM and compiler for Lua in Go. +=============================================================================== + +.. image:: https://godoc.org/github.com/yuin/gopher-lua?status.svg + :target: http://godoc.org/github.com/yuin/gopher-lua + +.. image:: https://travis-ci.org/yuin/gopher-lua.svg + :target: https://travis-ci.org/yuin/gopher-lua + +.. image:: https://coveralls.io/repos/yuin/gopher-lua/badge.svg + :target: https://coveralls.io/r/yuin/gopher-lua + +.. image:: https://badges.gitter.im/Join%20Chat.svg + :alt: Join the chat at https://gitter.im/yuin/gopher-lua + :target: https://gitter.im/yuin/gopher-lua?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge + +| + + +GopherLua is a Lua5.1 VM and compiler written in Go. GopherLua has a same goal +with Lua: **Be a scripting language with extensible semantics** . It provides +Go APIs that allow you to easily embed a scripting language to your Go host +programs. + +.. contents:: + :depth: 1 + +---------------------------------------------------------------- +Design principle +---------------------------------------------------------------- + +- Be a scripting language with extensible semantics. +- User-friendly Go API + - The stack based API like the one used in the original Lua + implementation will cause a performance improvements in GopherLua + (It will reduce memory allocations and concrete type <-> interface conversions). + GopherLua API is **not** the stack based API. + GopherLua give preference to the user-friendliness over the performance. + +---------------------------------------------------------------- +How about performance? +---------------------------------------------------------------- +GopherLua is not fast but not too slow, I think. + +GopherLua has almost equivalent ( or little bit better ) performance as Python3 on micro benchmarks. + +There are some benchmarks on the `wiki page `_ . + +---------------------------------------------------------------- +Installation +---------------------------------------------------------------- + +.. code-block:: bash + + go get github.com/yuin/gopher-lua + +GopherLua supports >= Go1.7. + +---------------------------------------------------------------- +Usage +---------------------------------------------------------------- +GopherLua APIs perform in much the same way as Lua, **but the stack is used only +for passing arguments and receiving returned values.** + +GopherLua supports channel operations. See **"Goroutines"** section. + +Import a package. + +.. code-block:: go + + import ( + "github.com/yuin/gopher-lua" + ) + +Run scripts in the VM. + +.. code-block:: go + + L := lua.NewState() + defer L.Close() + if err := L.DoString(`print("hello")`); err != nil { + panic(err) + } + +.. code-block:: go + + L := lua.NewState() + defer L.Close() + if err := L.DoFile("hello.lua"); err != nil { + panic(err) + } + +Refer to `Lua Reference Manual `_ and `Go doc `_ for further information. + +Note that elements that are not commented in `Go doc `_ equivalent to `Lua Reference Manual `_ , except GopherLua uses objects instead of Lua stack indices. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Data model +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +All data in a GopherLua program is an ``LValue`` . ``LValue`` is an interface +type that has following methods. + +- ``String() string`` +- ``Type() LValueType`` + + +Objects implement an LValue interface are + +================ ========================= ================== ======================= + Type name Go type Type() value Constants +================ ========================= ================== ======================= + ``LNilType`` (constants) ``LTNil`` ``LNil`` + ``LBool`` (constants) ``LTBool`` ``LTrue``, ``LFalse`` + ``LNumber`` float64 ``LTNumber`` ``-`` + ``LString`` string ``LTString`` ``-`` + ``LFunction`` struct pointer ``LTFunction`` ``-`` + ``LUserData`` struct pointer ``LTUserData`` ``-`` + ``LState`` struct pointer ``LTThread`` ``-`` + ``LTable`` struct pointer ``LTTable`` ``-`` + ``LChannel`` chan LValue ``LTChannel`` ``-`` +================ ========================= ================== ======================= + +You can test an object type in Go way(type assertion) or using a ``Type()`` value. + +.. code-block:: go + + lv := L.Get(-1) // get the value at the top of the stack + if str, ok := lv.(lua.LString); ok { + // lv is LString + fmt.Println(string(str)) + } + if lv.Type() != lua.LTString { + panic("string required.") + } + +.. code-block:: go + + lv := L.Get(-1) // get the value at the top of the stack + if tbl, ok := lv.(*lua.LTable); ok { + // lv is LTable + fmt.Println(L.ObjLen(tbl)) + } + +Note that ``LBool`` , ``LNumber`` , ``LString`` is not a pointer. + +To test ``LNilType`` and ``LBool``, You **must** use pre-defined constants. + +.. code-block:: go + + lv := L.Get(-1) // get the value at the top of the stack + + if lv == lua.LTrue { // correct + } + + if bl, ok := lv.(lua.LBool); ok && bool(bl) { // wrong + } + +In Lua, both ``nil`` and ``false`` make a condition false. ``LVIsFalse`` and ``LVAsBool`` implement this specification. + +.. code-block:: go + + lv := L.Get(-1) // get the value at the top of the stack + if lua.LVIsFalse(lv) { // lv is nil or false + } + + if lua.LVAsBool(lv) { // lv is neither nil nor false + } + +Objects that based on go structs(``LFunction``. ``LUserData``, ``LTable``) +have some public methods and fields. You can use these methods and fields for +performance and debugging, but there are some limitations. + +- Metatable does not work. +- No error handlings. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Callstack & Registry size +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Size of the callstack & registry is **fixed** for mainly performance. +You can change the default size of the callstack & registry. + +.. code-block:: go + + lua.RegistrySize = 1024 * 20 + lua.CallStackSize = 1024 + L := lua.NewState() + defer L.Close() + +You can also create an LState object that has the callstack & registry size specified by ``Options`` . + +.. code-block:: go + + L := lua.NewState(lua.Options{ + CallStackSize: 120, + RegistrySize: 120*20, + }) + +An LState object that has been created by ``*LState#NewThread()`` inherits the callstack & registry size from the parent LState object. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Miscellaneous lua.NewState options +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +- **Options.SkipOpenLibs bool(default false)** + - By default, GopherLua opens all built-in libraries when new LState is created. + - You can skip this behaviour by setting this to ``true`` . + - Using the various `OpenXXX(L *LState) int` functions you can open only those libraries that you require, for an example see below. +- **Options.IncludeGoStackTrace bool(default false)** + - By default, GopherLua does not show Go stack traces when panics occur. + - You can get Go stack traces by setting this to ``true`` . + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +API +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Refer to `Lua Reference Manual `_ and `Go doc(LState methods) `_ for further information. + ++++++++++++++++++++++++++++++++++++++++++ +Calling Go from Lua ++++++++++++++++++++++++++++++++++++++++++ + +.. code-block:: go + + func Double(L *lua.LState) int { + lv := L.ToInt(1) /* get argument */ + L.Push(lua.LNumber(lv * 2)) /* push result */ + return 1 /* number of results */ + } + + func main() { + L := lua.NewState() + defer L.Close() + L.SetGlobal("double", L.NewFunction(Double)) /* Original lua_setglobal uses stack... */ + } + +.. code-block:: lua + + print(double(20)) -- > "40" + +Any function registered with GopherLua is a ``lua.LGFunction``, defined in ``value.go`` + +.. code-block:: go + + type LGFunction func(*LState) int + +Working with coroutines. + +.. code-block:: go + + co, _ := L.NewThread() /* create a new thread */ + fn := L.GetGlobal("coro").(*lua.LFunction) /* get function from lua */ + for { + st, err, values := L.Resume(co, fn) + if st == lua.ResumeError { + fmt.Println("yield break(error)") + fmt.Println(err.Error()) + break + } + + for i, lv := range values { + fmt.Printf("%v : %v\n", i, lv) + } + + if st == lua.ResumeOK { + fmt.Println("yield break(ok)") + break + } + } + ++++++++++++++++++++++++++++++++++++++++++ +Opening a subset of builtin modules ++++++++++++++++++++++++++++++++++++++++++ + +The following demonstrates how to open a subset of the built-in modules in Lua, say for example to avoid enabling modules with access to local files or system calls. + +main.go + +.. code-block:: go + + func main() { + L := lua.NewState(lua.Options{SkipOpenLibs: true}) + defer L.Close() + for _, pair := range []struct { + n string + f lua.LGFunction + }{ + {lua.LoadLibName, lua.OpenPackage}, // Must be first + {lua.BaseLibName, lua.OpenBase}, + {lua.TabLibName, lua.OpenTable}, + } { + if err := L.CallByParam(lua.P{ + Fn: L.NewFunction(pair.f), + NRet: 0, + Protect: true, + }, lua.LString(pair.n)); err != nil { + panic(err) + } + } + if err := L.DoFile("main.lua"); err != nil { + panic(err) + } + } + ++++++++++++++++++++++++++++++++++++++++++ +Creating a module by Go ++++++++++++++++++++++++++++++++++++++++++ + +mymodule.go + +.. code-block:: go + + package mymodule + + import ( + "github.com/yuin/gopher-lua" + ) + + func Loader(L *lua.LState) int { + // register functions to the table + mod := L.SetFuncs(L.NewTable(), exports) + // register other stuff + L.SetField(mod, "name", lua.LString("value")) + + // returns the module + L.Push(mod) + return 1 + } + + var exports = map[string]lua.LGFunction{ + "myfunc": myfunc, + } + + func myfunc(L *lua.LState) int { + return 0 + } + +mymain.go + +.. code-block:: go + + package main + + import ( + "./mymodule" + "github.com/yuin/gopher-lua" + ) + + func main() { + L := lua.NewState() + defer L.Close() + L.PreloadModule("mymodule", mymodule.Loader) + if err := L.DoFile("main.lua"); err != nil { + panic(err) + } + } + +main.lua + +.. code-block:: lua + + local m = require("mymodule") + m.myfunc() + print(m.name) + + ++++++++++++++++++++++++++++++++++++++++++ +Calling Lua from Go ++++++++++++++++++++++++++++++++++++++++++ + +.. code-block:: go + + L := lua.NewState() + defer L.Close() + if err := L.DoFile("double.lua"); err != nil { + panic(err) + } + if err := L.CallByParam(lua.P{ + Fn: L.GetGlobal("double"), + NRet: 1, + Protect: true, + }, lua.LNumber(10)); err != nil { + panic(err) + } + ret := L.Get(-1) // returned value + L.Pop(1) // remove received value + +If ``Protect`` is false, GopherLua will panic instead of returning an ``error`` value. + ++++++++++++++++++++++++++++++++++++++++++ +User-Defined types ++++++++++++++++++++++++++++++++++++++++++ +You can extend GopherLua with new types written in Go. +``LUserData`` is provided for this purpose. + +.. code-block:: go + + type Person struct { + Name string + } + + const luaPersonTypeName = "person" + + // Registers my person type to given L. + func registerPersonType(L *lua.LState) { + mt := L.NewTypeMetatable(luaPersonTypeName) + L.SetGlobal("person", mt) + // static attributes + L.SetField(mt, "new", L.NewFunction(newPerson)) + // methods + L.SetField(mt, "__index", L.SetFuncs(L.NewTable(), personMethods)) + } + + // Constructor + func newPerson(L *lua.LState) int { + person := &Person{L.CheckString(1)} + ud := L.NewUserData() + ud.Value = person + L.SetMetatable(ud, L.GetTypeMetatable(luaPersonTypeName)) + L.Push(ud) + return 1 + } + + // Checks whether the first lua argument is a *LUserData with *Person and returns this *Person. + func checkPerson(L *lua.LState) *Person { + ud := L.CheckUserData(1) + if v, ok := ud.Value.(*Person); ok { + return v + } + L.ArgError(1, "person expected") + return nil + } + + var personMethods = map[string]lua.LGFunction{ + "name": personGetSetName, + } + + // Getter and setter for the Person#Name + func personGetSetName(L *lua.LState) int { + p := checkPerson(L) + if L.GetTop() == 2 { + p.Name = L.CheckString(2) + return 0 + } + L.Push(lua.LString(p.Name)) + return 1 + } + + func main() { + L := lua.NewState() + defer L.Close() + registerPersonType(L) + if err := L.DoString(` + p = person.new("Steeve") + print(p:name()) -- "Steeve" + p:name("Alice") + print(p:name()) -- "Alice" + `); err != nil { + panic(err) + } + } + ++++++++++++++++++++++++++++++++++++++++++ +Terminating a running LState ++++++++++++++++++++++++++++++++++++++++++ +GopherLua supports the `Go Concurrency Patterns: Context `_ . + + +.. code-block:: go + + L := lua.NewState() + defer L.Close() + ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second) + defer cancel() + // set the context to our LState + L.SetContext(ctx) + err := L.DoString(` + local clock = os.clock + function sleep(n) -- seconds + local t0 = clock() + while clock() - t0 <= n do end + end + sleep(3) + `) + // err.Error() contains "context deadline exceeded" + +With coroutines + +.. code-block:: go + + L := lua.NewState() + defer L.Close() + ctx, cancel := context.WithCancel(context.Background()) + L.SetContext(ctx) + defer cancel() + L.DoString(` + function coro() + local i = 0 + while true do + coroutine.yield(i) + i = i+1 + end + return i + end + `) + co, cocancel := L.NewThread() + defer cocancel() + fn := L.GetGlobal("coro").(*LFunction) + + _, err, values := L.Resume(co, fn) // err is nil + + cancel() // cancel the parent context + + _, err, values = L.Resume(co, fn) // err is NOT nil : child context was canceled + +**Note that using a context causes performance degradation.** + +.. code-block:: + + time ./glua-with-context.exe fib.lua + 9227465 + 0.01s user 0.11s system 1% cpu 7.505 total + + time ./glua-without-context.exe fib.lua + 9227465 + 0.01s user 0.01s system 0% cpu 5.306 total + + ++++++++++++++++++++++++++++++++++++++++++ +Goroutines ++++++++++++++++++++++++++++++++++++++++++ +The ``LState`` is not goroutine-safe. It is recommended to use one LState per goroutine and communicate between goroutines by using channels. + +Channels are represented by ``channel`` objects in GopherLua. And a ``channel`` table provides functions for performing channel operations. + +Some objects can not be sent over channels due to having non-goroutine-safe objects inside itself. + +- a thread(state) +- a function +- an userdata +- a table with a metatable + +You **must not** send these objects from Go APIs to channels. + + + +.. code-block:: go + + func receiver(ch, quit chan lua.LValue) { + L := lua.NewState() + defer L.Close() + L.SetGlobal("ch", lua.LChannel(ch)) + L.SetGlobal("quit", lua.LChannel(quit)) + if err := L.DoString(` + local exit = false + while not exit do + channel.select( + {"|<-", ch, function(ok, v) + if not ok then + print("channel closed") + exit = true + else + print("received:", v) + end + end}, + {"|<-", quit, function(ok, v) + print("quit") + exit = true + end} + ) + end + `); err != nil { + panic(err) + } + } + + func sender(ch, quit chan lua.LValue) { + L := lua.NewState() + defer L.Close() + L.SetGlobal("ch", lua.LChannel(ch)) + L.SetGlobal("quit", lua.LChannel(quit)) + if err := L.DoString(` + ch:send("1") + ch:send("2") + `); err != nil { + panic(err) + } + ch <- lua.LString("3") + quit <- lua.LTrue + } + + func main() { + ch := make(chan lua.LValue) + quit := make(chan lua.LValue) + go receiver(ch, quit) + go sender(ch, quit) + time.Sleep(3 * time.Second) + } + +''''''''''''''' +Go API +''''''''''''''' + +``ToChannel``, ``CheckChannel``, ``OptChannel`` are available. + +Refer to `Go doc(LState methods) `_ for further information. + +''''''''''''''' +Lua API +''''''''''''''' + +- **channel.make([buf:int]) -> ch:channel** + - Create new channel that has a buffer size of ``buf``. By default, ``buf`` is 0. + +- **channel.select(case:table [, case:table, case:table ...]) -> {index:int, recv:any, ok}** + - Same as the ``select`` statement in Go. It returns the index of the chosen case and, if that + case was a receive operation, the value received and a boolean indicating whether the channel has been closed. + - ``case`` is a table that outlined below. + - receiving: `{"|<-", ch:channel [, handler:func(ok, data:any)]}` + - sending: `{"<-|", ch:channel, data:any [, handler:func(data:any)]}` + - default: `{"default" [, handler:func()]}` + +``channel.select`` examples: + +.. code-block:: lua + + local idx, recv, ok = channel.select( + {"|<-", ch1}, + {"|<-", ch2} + ) + if not ok then + print("closed") + elseif idx == 1 then -- received from ch1 + print(recv) + elseif idx == 2 then -- received from ch2 + print(recv) + end + +.. code-block:: lua + + channel.select( + {"|<-", ch1, function(ok, data) + print(ok, data) + end}, + {"<-|", ch2, "value", function(data) + print(data) + end}, + {"default", function() + print("default action") + end} + ) + +- **channel:send(data:any)** + - Send ``data`` over the channel. +- **channel:receive() -> ok:bool, data:any** + - Receive some data over the channel. +- **channel:close()** + - Close the channel. + +'''''''''''''''''''''''''''''' +The LState pool pattern +'''''''''''''''''''''''''''''' +To create per-thread LState instances, You can use the ``sync.Pool`` like mechanism. + +.. code-block:: go + + type lStatePool struct { + m sync.Mutex + saved []*lua.LState + } + + func (pl *lStatePool) Get() *lua.LState { + pl.m.Lock() + defer pl.m.Unlock() + n := len(pl.saved) + if n == 0 { + return pl.New() + } + x := pl.saved[n-1] + pl.saved = pl.saved[0 : n-1] + return x + } + + func (pl *lStatePool) New() *lua.LState { + L := lua.NewState() + // setting the L up here. + // load scripts, set global variables, share channels, etc... + return L + } + + func (pl *lStatePool) Put(L *lua.LState) { + pl.m.Lock() + defer pl.m.Unlock() + pl.saved = append(pl.saved, L) + } + + func (pl *lStatePool) Shutdown() { + for _, L := range pl.saved { + L.Close() + } + } + + // Global LState pool + var luaPool = &lStatePool{ + saved: make([]*lua.LState, 0, 4), + } + +Now, you can get per-thread LState objects from the ``luaPool`` . + +.. code-block:: go + + func MyWorker() { + L := luaPool.Get() + defer luaPool.Put(L) + /* your code here */ + } + + func main() { + defer luaPool.Shutdown() + go MyWorker() + go MyWorker() + /* etc... */ + } + + +---------------------------------------------------------------- +Differences between Lua and GopherLua +---------------------------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Goroutines +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- GopherLua supports channel operations. + - GopherLua has a type named ``channel``. + - The ``channel`` table provides functions for performing channel operations. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Unsupported functions +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- ``string.dump`` +- ``os.setlocale`` +- ``lua_Debug.namewhat`` +- ``package.loadlib`` +- debug hooks + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Miscellaneous notes +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- ``collectgarbage`` does not take any arguments and runs the garbage collector for the entire Go program. +- ``file:setvbuf`` does not support a line buffering. +- Daylight saving time is not supported. +- GopherLua has a function to set an environment variable : ``os.setenv(name, value)`` + +---------------------------------------------------------------- +Standalone interpreter +---------------------------------------------------------------- +Lua has an interpreter called ``lua`` . GopherLua has an interpreter called ``glua`` . + +.. code-block:: bash + + go get github.com/yuin/gopher-lua/cmd/glua + +``glua`` has same options as ``lua`` . + +---------------------------------------------------------------- +How to Contribute +---------------------------------------------------------------- +See `Guidlines for contributors `_ . + +---------------------------------------------------------------- +Libraries for GopherLua +---------------------------------------------------------------- + +- `gopher-luar `_ : Custom type reflection for gopher-lua +- `gluamapper `_ : Mapping a Lua table to a Go struct +- `gluare `_ : Regular expressions for gopher-lua +- `gluahttp `_ : HTTP request module for gopher-lua +- `gopher-json `_ : A simple JSON encoder/decoder for gopher-lua +- `gluayaml `_ : Yaml parser for gopher-lua +- `glua-lfs `_ : Partially implements the luafilesystem module for gopher-lua +- `gluaurl `_ : A url parser/builder module for gopher-lua +- `gluahttpscrape `_ : A simple HTML scraper module for gopher-lua +- `gluaxmlpath `_ : An xmlpath module for gopher-lua +- `gluasocket `_ : A LuaSocket library for the GopherLua VM + +---------------------------------------------------------------- +Donation +---------------------------------------------------------------- + +BTC: 1NEDSyUmo4SMTDP83JJQSWi1MvQUGGNMZB + +---------------------------------------------------------------- +License +---------------------------------------------------------------- +MIT + +---------------------------------------------------------------- +Author +---------------------------------------------------------------- +Yusuke Inuzuka diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/_state.go b/vendor/github.com/yuin/gopher-lua/_state.go similarity index 99% rename from _vendor/vendor/github.com/yuin/gopher-lua/_state.go rename to vendor/github.com/yuin/gopher-lua/_state.go index 247c87c..aba9f4e 100644 --- a/_vendor/vendor/github.com/yuin/gopher-lua/_state.go +++ b/vendor/github.com/yuin/gopher-lua/_state.go @@ -1,9 +1,9 @@ package lua import ( + "context" "fmt" "github.com/yuin/gopher-lua/parse" - "golang.org/x/net/context" "io" "math" "os" @@ -1575,6 +1575,8 @@ func (ls *LState) PCall(nargs, nret int, errfunc *LFunction) (err error) { } else if len(err.(*ApiError).StackTrace) == 0 { err.(*ApiError).StackTrace = ls.stackTrace(0) } + ls.stack.SetSp(sp) + ls.currentFrame = ls.stack.Last() ls.reg.SetTop(base) } ls.stack.SetSp(sp) diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/_vm.go b/vendor/github.com/yuin/gopher-lua/_vm.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/_vm.go rename to vendor/github.com/yuin/gopher-lua/_vm.go diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/alloc.go b/vendor/github.com/yuin/gopher-lua/alloc.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/alloc.go rename to vendor/github.com/yuin/gopher-lua/alloc.go diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/ast/ast.go b/vendor/github.com/yuin/gopher-lua/ast/ast.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/ast/ast.go rename to vendor/github.com/yuin/gopher-lua/ast/ast.go diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/ast/expr.go b/vendor/github.com/yuin/gopher-lua/ast/expr.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/ast/expr.go rename to vendor/github.com/yuin/gopher-lua/ast/expr.go diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/ast/misc.go b/vendor/github.com/yuin/gopher-lua/ast/misc.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/ast/misc.go rename to vendor/github.com/yuin/gopher-lua/ast/misc.go diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/ast/stmt.go b/vendor/github.com/yuin/gopher-lua/ast/stmt.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/ast/stmt.go rename to vendor/github.com/yuin/gopher-lua/ast/stmt.go diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/ast/token.go b/vendor/github.com/yuin/gopher-lua/ast/token.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/ast/token.go rename to vendor/github.com/yuin/gopher-lua/ast/token.go diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/auxlib.go b/vendor/github.com/yuin/gopher-lua/auxlib.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/auxlib.go rename to vendor/github.com/yuin/gopher-lua/auxlib.go diff --git a/vendor/github.com/yuin/gopher-lua/auxlib_test.go b/vendor/github.com/yuin/gopher-lua/auxlib_test.go new file mode 100644 index 0000000..ac8356d --- /dev/null +++ b/vendor/github.com/yuin/gopher-lua/auxlib_test.go @@ -0,0 +1,333 @@ +package lua + +import ( + "io/ioutil" + "os" + "testing" +) + +func TestCheckInt(t *testing.T) { + L := NewState() + defer L.Close() + errorIfGFuncNotFail(t, L, func(L *LState) int { + L.Push(LNumber(10)) + errorIfNotEqual(t, 10, L.CheckInt(2)) + L.Push(LString("aaa")) + L.CheckInt(3) + return 0 + }, "number expected, got string") +} + +func TestCheckInt64(t *testing.T) { + L := NewState() + defer L.Close() + errorIfGFuncNotFail(t, L, func(L *LState) int { + L.Push(LNumber(10)) + errorIfNotEqual(t, int64(10), L.CheckInt64(2)) + L.Push(LString("aaa")) + L.CheckInt64(3) + return 0 + }, "number expected, got string") +} + +func TestCheckNumber(t *testing.T) { + L := NewState() + defer L.Close() + errorIfGFuncNotFail(t, L, func(L *LState) int { + L.Push(LNumber(10)) + errorIfNotEqual(t, LNumber(10), L.CheckNumber(2)) + L.Push(LString("aaa")) + L.CheckNumber(3) + return 0 + }, "number expected, got string") +} + +func TestCheckString(t *testing.T) { + L := NewState() + defer L.Close() + errorIfGFuncNotFail(t, L, func(L *LState) int { + L.Push(LString("aaa")) + errorIfNotEqual(t, "aaa", L.CheckString(2)) + L.Push(LNumber(10)) + L.CheckString(3) + return 0 + }, "string expected, got number") +} + +func TestCheckBool(t *testing.T) { + L := NewState() + defer L.Close() + errorIfGFuncNotFail(t, L, func(L *LState) int { + L.Push(LTrue) + errorIfNotEqual(t, true, L.CheckBool(2)) + L.Push(LNumber(10)) + L.CheckBool(3) + return 0 + }, "boolean expected, got number") +} + +func TestCheckTable(t *testing.T) { + L := NewState() + defer L.Close() + errorIfGFuncNotFail(t, L, func(L *LState) int { + tbl := L.NewTable() + L.Push(tbl) + errorIfNotEqual(t, tbl, L.CheckTable(2)) + L.Push(LNumber(10)) + L.CheckTable(3) + return 0 + }, "table expected, got number") +} + +func TestCheckFunction(t *testing.T) { + L := NewState() + defer L.Close() + errorIfGFuncNotFail(t, L, func(L *LState) int { + fn := L.NewFunction(func(l *LState) int { return 0 }) + L.Push(fn) + errorIfNotEqual(t, fn, L.CheckFunction(2)) + L.Push(LNumber(10)) + L.CheckFunction(3) + return 0 + }, "function expected, got number") +} + +func TestCheckUserData(t *testing.T) { + L := NewState() + defer L.Close() + errorIfGFuncNotFail(t, L, func(L *LState) int { + ud := L.NewUserData() + L.Push(ud) + errorIfNotEqual(t, ud, L.CheckUserData(2)) + L.Push(LNumber(10)) + L.CheckUserData(3) + return 0 + }, "userdata expected, got number") +} + +func TestCheckThread(t *testing.T) { + L := NewState() + defer L.Close() + errorIfGFuncNotFail(t, L, func(L *LState) int { + th, _ := L.NewThread() + L.Push(th) + errorIfNotEqual(t, th, L.CheckThread(2)) + L.Push(LNumber(10)) + L.CheckThread(3) + return 0 + }, "thread expected, got number") +} + +func TestCheckChannel(t *testing.T) { + L := NewState() + defer L.Close() + errorIfGFuncNotFail(t, L, func(L *LState) int { + ch := make(chan LValue) + L.Push(LChannel(ch)) + errorIfNotEqual(t, ch, L.CheckChannel(2)) + L.Push(LString("aaa")) + L.CheckChannel(3) + return 0 + }, "channel expected, got string") +} + +func TestCheckType(t *testing.T) { + L := NewState() + defer L.Close() + errorIfGFuncNotFail(t, L, func(L *LState) int { + L.Push(LNumber(10)) + L.CheckType(2, LTNumber) + L.CheckType(2, LTString) + return 0 + }, "string expected, got number") +} + +func TestCheckTypes(t *testing.T) { + L := NewState() + defer L.Close() + errorIfGFuncNotFail(t, L, func(L *LState) int { + L.Push(LNumber(10)) + L.CheckTypes(2, LTString, LTBool, LTNumber) + L.CheckTypes(2, LTString, LTBool) + return 0 + }, "string or boolean expected, got number") +} + +func TestCheckOption(t *testing.T) { + opts := []string{ + "opt1", + "opt2", + "opt3", + } + L := NewState() + defer L.Close() + errorIfGFuncNotFail(t, L, func(L *LState) int { + L.Push(LString("opt1")) + errorIfNotEqual(t, 0, L.CheckOption(2, opts)) + L.Push(LString("opt5")) + L.CheckOption(3, opts) + return 0 + }, "invalid option: opt5 \\(must be one of opt1,opt2,opt3\\)") +} + +func TestOptInt(t *testing.T) { + L := NewState() + defer L.Close() + errorIfGFuncNotFail(t, L, func(L *LState) int { + errorIfNotEqual(t, 99, L.OptInt(1, 99)) + L.Push(LNumber(10)) + errorIfNotEqual(t, 10, L.OptInt(2, 99)) + L.Push(LString("aaa")) + L.OptInt(3, 99) + return 0 + }, "number expected, got string") +} + +func TestOptInt64(t *testing.T) { + L := NewState() + defer L.Close() + errorIfGFuncNotFail(t, L, func(L *LState) int { + errorIfNotEqual(t, int64(99), L.OptInt64(1, int64(99))) + L.Push(LNumber(10)) + errorIfNotEqual(t, int64(10), L.OptInt64(2, int64(99))) + L.Push(LString("aaa")) + L.OptInt64(3, int64(99)) + return 0 + }, "number expected, got string") +} + +func TestOptNumber(t *testing.T) { + L := NewState() + defer L.Close() + errorIfGFuncNotFail(t, L, func(L *LState) int { + errorIfNotEqual(t, LNumber(99), L.OptNumber(1, LNumber(99))) + L.Push(LNumber(10)) + errorIfNotEqual(t, LNumber(10), L.OptNumber(2, LNumber(99))) + L.Push(LString("aaa")) + L.OptNumber(3, LNumber(99)) + return 0 + }, "number expected, got string") +} + +func TestOptString(t *testing.T) { + L := NewState() + defer L.Close() + errorIfGFuncNotFail(t, L, func(L *LState) int { + errorIfNotEqual(t, "bbb", L.OptString(1, "bbb")) + L.Push(LString("aaa")) + errorIfNotEqual(t, "aaa", L.OptString(2, "bbb")) + L.Push(LNumber(10)) + L.OptString(3, "bbb") + return 0 + }, "string expected, got number") +} + +func TestOptBool(t *testing.T) { + L := NewState() + defer L.Close() + errorIfGFuncNotFail(t, L, func(L *LState) int { + errorIfNotEqual(t, true, L.OptBool(1, true)) + L.Push(LTrue) + errorIfNotEqual(t, true, L.OptBool(2, false)) + L.Push(LNumber(10)) + L.OptBool(3, false) + return 0 + }, "boolean expected, got number") +} + +func TestOptTable(t *testing.T) { + L := NewState() + defer L.Close() + errorIfGFuncNotFail(t, L, func(L *LState) int { + deftbl := L.NewTable() + errorIfNotEqual(t, deftbl, L.OptTable(1, deftbl)) + tbl := L.NewTable() + L.Push(tbl) + errorIfNotEqual(t, tbl, L.OptTable(2, deftbl)) + L.Push(LNumber(10)) + L.OptTable(3, deftbl) + return 0 + }, "table expected, got number") +} + +func TestOptFunction(t *testing.T) { + L := NewState() + defer L.Close() + errorIfGFuncNotFail(t, L, func(L *LState) int { + deffn := L.NewFunction(func(l *LState) int { return 0 }) + errorIfNotEqual(t, deffn, L.OptFunction(1, deffn)) + fn := L.NewFunction(func(l *LState) int { return 0 }) + L.Push(fn) + errorIfNotEqual(t, fn, L.OptFunction(2, deffn)) + L.Push(LNumber(10)) + L.OptFunction(3, deffn) + return 0 + }, "function expected, got number") +} + +func TestOptUserData(t *testing.T) { + L := NewState() + defer L.Close() + errorIfGFuncNotFail(t, L, func(L *LState) int { + defud := L.NewUserData() + errorIfNotEqual(t, defud, L.OptUserData(1, defud)) + ud := L.NewUserData() + L.Push(ud) + errorIfNotEqual(t, ud, L.OptUserData(2, defud)) + L.Push(LNumber(10)) + L.OptUserData(3, defud) + return 0 + }, "userdata expected, got number") +} + +func TestOptChannel(t *testing.T) { + L := NewState() + defer L.Close() + errorIfGFuncNotFail(t, L, func(L *LState) int { + defch := make(chan LValue) + errorIfNotEqual(t, defch, L.OptChannel(1, defch)) + ch := make(chan LValue) + L.Push(LChannel(ch)) + errorIfNotEqual(t, ch, L.OptChannel(2, defch)) + L.Push(LString("aaa")) + L.OptChannel(3, defch) + return 0 + }, "channel expected, got string") +} + +func TestLoadFileForShebang(t *testing.T) { + tmpFile, err := ioutil.TempFile("", "") + errorIfNotNil(t, err) + + err = ioutil.WriteFile(tmpFile.Name(), []byte(`#!/path/to/lua +print("hello") +`), 0644) + errorIfNotNil(t, err) + + defer func() { + tmpFile.Close() + os.Remove(tmpFile.Name()) + }() + + L := NewState() + defer L.Close() + + _, err = L.LoadFile(tmpFile.Name()) + errorIfNotNil(t, err) +} + +func TestLoadFileForEmptyFile(t *testing.T) { + tmpFile, err := ioutil.TempFile("", "") + errorIfNotNil(t, err) + + defer func() { + tmpFile.Close() + os.Remove(tmpFile.Name()) + }() + + L := NewState() + defer L.Close() + + _, err = L.LoadFile(tmpFile.Name()) + errorIfNotNil(t, err) +} diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/baselib.go b/vendor/github.com/yuin/gopher-lua/baselib.go similarity index 98% rename from _vendor/vendor/github.com/yuin/gopher-lua/baselib.go rename to vendor/github.com/yuin/gopher-lua/baselib.go index 08c2b82..604bef9 100644 --- a/_vendor/vendor/github.com/yuin/gopher-lua/baselib.go +++ b/vendor/github.com/yuin/gopher-lua/baselib.go @@ -389,6 +389,8 @@ func baseSetMetatable(L *LState) int { func baseToNumber(L *LState) int { base := L.OptInt(2, 10) + noBase := L.Get(2) == LNil + switch lv := L.CheckAny(1).(type) { case LNumber: L.Push(lv) @@ -401,6 +403,9 @@ func baseToNumber(L *LState) int { L.Push(LNumber(v)) } } else { + if noBase && strings.HasPrefix(strings.ToLower(str), "0x") { + base, str = 16, str[2:] // Hex number + } if v, err := strconv.ParseInt(str, base, LNumberBit); err != nil { L.Push(LNil) } else { diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/channellib.go b/vendor/github.com/yuin/gopher-lua/channellib.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/channellib.go rename to vendor/github.com/yuin/gopher-lua/channellib.go diff --git a/vendor/github.com/yuin/gopher-lua/channellib_test.go b/vendor/github.com/yuin/gopher-lua/channellib_test.go new file mode 100644 index 0000000..a7fbffc --- /dev/null +++ b/vendor/github.com/yuin/gopher-lua/channellib_test.go @@ -0,0 +1,261 @@ +package lua + +import ( + "reflect" + "sync" + "testing" + "time" +) + +func TestChannelMake(t *testing.T) { + L := NewState() + defer L.Close() + errorIfScriptFail(t, L, ` + ch = channel.make() + `) + obj := L.GetGlobal("ch") + ch, ok := obj.(LChannel) + errorIfFalse(t, ok, "channel expected") + errorIfNotEqual(t, 0, reflect.ValueOf(ch).Cap()) + close(ch) + + errorIfScriptFail(t, L, ` + ch = channel.make(10) + `) + obj = L.GetGlobal("ch") + ch, _ = obj.(LChannel) + errorIfNotEqual(t, 10, reflect.ValueOf(ch).Cap()) + close(ch) +} + +func TestChannelSelectError(t *testing.T) { + L := NewState() + defer L.Close() + errorIfScriptFail(t, L, `ch = channel.make()`) + errorIfScriptNotFail(t, L, `channel.select({1,2,3})`, "invalid select case") + errorIfScriptNotFail(t, L, `channel.select({"<-|", 1, 3})`, "invalid select case") + errorIfScriptNotFail(t, L, `channel.select({"<-|", ch, function() end})`, "can not send a function") + errorIfScriptNotFail(t, L, `channel.select({"|<-", 1, 3})`, "invalid select case") + errorIfScriptNotFail(t, L, `channel.select({"<-->", 1, 3})`, "invalid channel direction") + errorIfScriptFail(t, L, `ch:close()`) +} + +func TestChannelSelect1(t *testing.T) { + var result LValue + var wg sync.WaitGroup + receiver := func(ch, quit chan LValue) { + defer wg.Done() + L := NewState() + defer L.Close() + L.SetGlobal("ch", LChannel(ch)) + L.SetGlobal("quit", LChannel(quit)) + if err := L.DoString(` + buf = "" + local exit = false + while not exit do + channel.select( + {"|<-", ch, function(ok, v) + if not ok then + buf = buf .. "channel closed" + exit = true + else + buf = buf .. "received:" .. v + end + end}, + {"|<-", quit, function(ok, v) + buf = buf .. "quit" + end} + ) + end + `); err != nil { + panic(err) + } + result = L.GetGlobal("buf") + } + + sender := func(ch, quit chan LValue) { + defer wg.Done() + L := NewState() + defer L.Close() + L.SetGlobal("ch", LChannel(ch)) + L.SetGlobal("quit", LChannel(quit)) + if err := L.DoString(` + ch:send("1") + ch:send("2") + `); err != nil { + panic(err) + } + ch <- LString("3") + quit <- LTrue + time.Sleep(1 * time.Second) + close(ch) + } + + ch := make(chan LValue) + quit := make(chan LValue) + wg.Add(2) + go receiver(ch, quit) + go sender(ch, quit) + wg.Wait() + lstr, ok := result.(LString) + errorIfFalse(t, ok, "must be string") + str := string(lstr) + errorIfNotEqual(t, "received:1received:2received:3quitchannel closed", str) + +} + +func TestChannelSelect2(t *testing.T) { + var wg sync.WaitGroup + receiver := func(ch, quit chan LValue) { + defer wg.Done() + L := NewState() + defer L.Close() + L.SetGlobal("ch", LChannel(ch)) + L.SetGlobal("quit", LChannel(quit)) + errorIfScriptFail(t, L, ` + idx, rcv, ok = channel.select( + {"|<-", ch}, + {"|<-", quit} + ) + assert(idx == 1) + assert(rcv == "1") + assert(ok) + idx, rcv, ok = channel.select( + {"|<-", ch}, + {"|<-", quit} + ) + assert(idx == 1) + assert(rcv == nil) + assert(not ok) + `) + } + + sender := func(ch, quit chan LValue) { + defer wg.Done() + L := NewState() + defer L.Close() + L.SetGlobal("ch", LChannel(ch)) + L.SetGlobal("quit", LChannel(quit)) + errorIfScriptFail(t, L, `ch:send("1")`) + errorIfScriptFail(t, L, `ch:close()`) + } + + ch := make(chan LValue) + quit := make(chan LValue) + wg.Add(2) + go receiver(ch, quit) + go sender(ch, quit) + wg.Wait() +} + +func TestChannelSelect3(t *testing.T) { + var wg sync.WaitGroup + receiver := func(ch chan LValue) { + defer wg.Done() + L := NewState() + defer L.Close() + L.SetGlobal("ch", LChannel(ch)) + errorIfScriptFail(t, L, ` + ok = true + while ok do + idx, rcv, ok = channel.select( + {"|<-", ch} + ) + end + `) + } + + sender := func(ch chan LValue) { + defer wg.Done() + L := NewState() + defer L.Close() + L.SetGlobal("ch", LChannel(ch)) + errorIfScriptFail(t, L, ` + ok = false + channel.select( + {"<-|", ch, "1", function(v) + ok = true + end} + ) + assert(ok) + idx, rcv, ok = channel.select( + {"<-|", ch, "1"} + ) + assert(idx == 1) + ch:close() + `) + } + + ch := make(chan LValue) + wg.Add(2) + go receiver(ch) + time.Sleep(1) + go sender(ch) + wg.Wait() +} + +func TestChannelSelect4(t *testing.T) { + var wg sync.WaitGroup + receiver := func(ch chan LValue) { + defer wg.Done() + L := NewState() + defer L.Close() + L.SetGlobal("ch", LChannel(ch)) + errorIfScriptFail(t, L, ` + idx, rcv, ok = channel.select( + {"|<-", ch}, + {"default"} + ) + assert(idx == 2) + called = false + idx, rcv, ok = channel.select( + {"|<-", ch}, + {"default", function() + called = true + end} + ) + assert(called) + ch:close() + `) + } + + ch := make(chan LValue) + wg.Add(1) + go receiver(ch) + wg.Wait() +} + +func TestChannelSendReceive1(t *testing.T) { + var wg sync.WaitGroup + receiver := func(ch chan LValue) { + defer wg.Done() + L := NewState() + defer L.Close() + L.SetGlobal("ch", LChannel(ch)) + errorIfScriptFail(t, L, ` + local ok, v = ch:receive() + assert(ok) + assert(v == "1") + `) + time.Sleep(1 * time.Second) + errorIfScriptFail(t, L, ` + local ok, v = ch:receive() + assert(not ok) + assert(v == nil) + `) + } + sender := func(ch chan LValue) { + defer wg.Done() + L := NewState() + defer L.Close() + L.SetGlobal("ch", LChannel(ch)) + errorIfScriptFail(t, L, `ch:send("1")`) + errorIfScriptNotFail(t, L, `ch:send(function() end)`, "can not send a function") + errorIfScriptFail(t, L, `ch:close()`) + } + ch := make(chan LValue) + wg.Add(2) + go receiver(ch) + go sender(ch) + wg.Wait() +} diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/compile.go b/vendor/github.com/yuin/gopher-lua/compile.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/compile.go rename to vendor/github.com/yuin/gopher-lua/compile.go diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/config.go b/vendor/github.com/yuin/gopher-lua/config.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/config.go rename to vendor/github.com/yuin/gopher-lua/config.go diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/coroutinelib.go b/vendor/github.com/yuin/gopher-lua/coroutinelib.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/coroutinelib.go rename to vendor/github.com/yuin/gopher-lua/coroutinelib.go diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/debuglib.go b/vendor/github.com/yuin/gopher-lua/debuglib.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/debuglib.go rename to vendor/github.com/yuin/gopher-lua/debuglib.go diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/function.go b/vendor/github.com/yuin/gopher-lua/function.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/function.go rename to vendor/github.com/yuin/gopher-lua/function.go diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/iolib.go b/vendor/github.com/yuin/gopher-lua/iolib.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/iolib.go rename to vendor/github.com/yuin/gopher-lua/iolib.go diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/linit.go b/vendor/github.com/yuin/gopher-lua/linit.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/linit.go rename to vendor/github.com/yuin/gopher-lua/linit.go diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/loadlib.go b/vendor/github.com/yuin/gopher-lua/loadlib.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/loadlib.go rename to vendor/github.com/yuin/gopher-lua/loadlib.go diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/mathlib.go b/vendor/github.com/yuin/gopher-lua/mathlib.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/mathlib.go rename to vendor/github.com/yuin/gopher-lua/mathlib.go diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/opcode.go b/vendor/github.com/yuin/gopher-lua/opcode.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/opcode.go rename to vendor/github.com/yuin/gopher-lua/opcode.go diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/oslib.go b/vendor/github.com/yuin/gopher-lua/oslib.go similarity index 98% rename from _vendor/vendor/github.com/yuin/gopher-lua/oslib.go rename to vendor/github.com/yuin/gopher-lua/oslib.go index 2e4bd90..e186568 100644 --- a/_vendor/vendor/github.com/yuin/gopher-lua/oslib.go +++ b/vendor/github.com/yuin/gopher-lua/oslib.go @@ -106,7 +106,7 @@ func osDate(L *LState) int { ret.RawSetString("hour", LNumber(t.Hour())) ret.RawSetString("min", LNumber(t.Minute())) ret.RawSetString("sec", LNumber(t.Second())) - ret.RawSetString("wday", LNumber(t.Weekday())) + ret.RawSetString("wday", LNumber(t.Weekday()+1)) // TODO yday & dst ret.RawSetString("yday", LNumber(0)) ret.RawSetString("isdst", LFalse) diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/package.go b/vendor/github.com/yuin/gopher-lua/package.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/package.go rename to vendor/github.com/yuin/gopher-lua/package.go diff --git a/vendor/github.com/yuin/gopher-lua/parse/Makefile b/vendor/github.com/yuin/gopher-lua/parse/Makefile new file mode 100644 index 0000000..6dd048c --- /dev/null +++ b/vendor/github.com/yuin/gopher-lua/parse/Makefile @@ -0,0 +1,4 @@ +all : parser.go + +parser.go : parser.go.y + goyacc -o $@ parser.go.y; [ -f y.output ] && ( rm -f y.output ) diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/parse/lexer.go b/vendor/github.com/yuin/gopher-lua/parse/lexer.go similarity index 97% rename from _vendor/vendor/github.com/yuin/gopher-lua/parse/lexer.go rename to vendor/github.com/yuin/gopher-lua/parse/lexer.go index 648ca87..ca2a530 100644 --- a/_vendor/vendor/github.com/yuin/gopher-lua/parse/lexer.go +++ b/vendor/github.com/yuin/gopher-lua/parse/lexer.go @@ -12,7 +12,7 @@ import ( ) const EOF = -1 -const whitespace1 = 1<<'\t' | 1<<'\r' | 1<<' ' +const whitespace1 = 1<<'\t' | 1<<' ' const whitespace2 = 1<<'\t' | 1<<'\n' | 1<<'\r' | 1<<' ' type Error struct { @@ -298,7 +298,7 @@ redo: ch = sc.skipWhiteSpace(whitespace2) } - if ch == '(' { + if ch == '(' && lexer.PrevTokenType == ')' { lexer.PNewLine = newline } @@ -422,13 +422,15 @@ finally: // yacc interface {{{ type Lexer struct { - scanner *Scanner - Stmts []ast.Stmt - PNewLine bool - Token ast.Token + scanner *Scanner + Stmts []ast.Stmt + PNewLine bool + Token ast.Token + PrevTokenType int } func (lx *Lexer) Lex(lval *yySymType) int { + lx.PrevTokenType = lx.Token.Type tok, err := lx.scanner.Scan(lx) if err != nil { panic(err) @@ -450,7 +452,7 @@ func (lx *Lexer) TokenError(tok ast.Token, message string) { } func Parse(reader io.Reader, name string) (chunk []ast.Stmt, err error) { - lexer := &Lexer{NewScanner(reader, name), nil, false, ast.Token{Str: ""}} + lexer := &Lexer{NewScanner(reader, name), nil, false, ast.Token{Str: ""}, TNil} chunk = nil defer func() { if e := recover(); e != nil { diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/parse/parser.go b/vendor/github.com/yuin/gopher-lua/parse/parser.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/parse/parser.go rename to vendor/github.com/yuin/gopher-lua/parse/parser.go diff --git a/vendor/github.com/yuin/gopher-lua/parse/parser.go.y b/vendor/github.com/yuin/gopher-lua/parse/parser.go.y new file mode 100644 index 0000000..956133d --- /dev/null +++ b/vendor/github.com/yuin/gopher-lua/parse/parser.go.y @@ -0,0 +1,524 @@ +%{ +package parse + +import ( + "github.com/yuin/gopher-lua/ast" +) +%} +%type chunk +%type chunk1 +%type block +%type stat +%type elseifs +%type laststat +%type funcname +%type funcname1 +%type varlist +%type var +%type namelist +%type exprlist +%type expr +%type string +%type prefixexp +%type functioncall +%type afunctioncall +%type args +%type function +%type funcbody +%type parlist +%type tableconstructor +%type fieldlist +%type field +%type fieldsep + +%union { + token ast.Token + + stmts []ast.Stmt + stmt ast.Stmt + + funcname *ast.FuncName + funcexpr *ast.FunctionExpr + + exprlist []ast.Expr + expr ast.Expr + + fieldlist []*ast.Field + field *ast.Field + fieldsep string + + namelist []string + parlist *ast.ParList +} + +/* Reserved words */ +%token TAnd TBreak TDo TElse TElseIf TEnd TFalse TFor TFunction TIf TIn TLocal TNil TNot TOr TReturn TRepeat TThen TTrue TUntil TWhile + +/* Literals */ +%token TEqeq TNeq TLte TGte T2Comma T3Comma TIdent TNumber TString '{' '(' + +/* Operators */ +%left TOr +%left TAnd +%left '>' '<' TGte TLte TEqeq TNeq +%right T2Comma +%left '+' '-' +%left '*' '/' '%' +%right UNARY /* not # -(unary) */ +%right '^' + +%% + +chunk: + chunk1 { + $$ = $1 + if l, ok := yylex.(*Lexer); ok { + l.Stmts = $$ + } + } | + chunk1 laststat { + $$ = append($1, $2) + if l, ok := yylex.(*Lexer); ok { + l.Stmts = $$ + } + } | + chunk1 laststat ';' { + $$ = append($1, $2) + if l, ok := yylex.(*Lexer); ok { + l.Stmts = $$ + } + } + +chunk1: + { + $$ = []ast.Stmt{} + } | + chunk1 stat { + $$ = append($1, $2) + } | + chunk1 ';' { + $$ = $1 + } + +block: + chunk { + $$ = $1 + } + +stat: + varlist '=' exprlist { + $$ = &ast.AssignStmt{Lhs: $1, Rhs: $3} + $$.SetLine($1[0].Line()) + } | + /* 'stat = functioncal' causes a reduce/reduce conflict */ + prefixexp { + if _, ok := $1.(*ast.FuncCallExpr); !ok { + yylex.(*Lexer).Error("parse error") + } else { + $$ = &ast.FuncCallStmt{Expr: $1} + $$.SetLine($1.Line()) + } + } | + TDo block TEnd { + $$ = &ast.DoBlockStmt{Stmts: $2} + $$.SetLine($1.Pos.Line) + $$.SetLastLine($3.Pos.Line) + } | + TWhile expr TDo block TEnd { + $$ = &ast.WhileStmt{Condition: $2, Stmts: $4} + $$.SetLine($1.Pos.Line) + $$.SetLastLine($5.Pos.Line) + } | + TRepeat block TUntil expr { + $$ = &ast.RepeatStmt{Condition: $4, Stmts: $2} + $$.SetLine($1.Pos.Line) + $$.SetLastLine($4.Line()) + } | + TIf expr TThen block elseifs TEnd { + $$ = &ast.IfStmt{Condition: $2, Then: $4} + cur := $$ + for _, elseif := range $5 { + cur.(*ast.IfStmt).Else = []ast.Stmt{elseif} + cur = elseif + } + $$.SetLine($1.Pos.Line) + $$.SetLastLine($6.Pos.Line) + } | + TIf expr TThen block elseifs TElse block TEnd { + $$ = &ast.IfStmt{Condition: $2, Then: $4} + cur := $$ + for _, elseif := range $5 { + cur.(*ast.IfStmt).Else = []ast.Stmt{elseif} + cur = elseif + } + cur.(*ast.IfStmt).Else = $7 + $$.SetLine($1.Pos.Line) + $$.SetLastLine($8.Pos.Line) + } | + TFor TIdent '=' expr ',' expr TDo block TEnd { + $$ = &ast.NumberForStmt{Name: $2.Str, Init: $4, Limit: $6, Stmts: $8} + $$.SetLine($1.Pos.Line) + $$.SetLastLine($9.Pos.Line) + } | + TFor TIdent '=' expr ',' expr ',' expr TDo block TEnd { + $$ = &ast.NumberForStmt{Name: $2.Str, Init: $4, Limit: $6, Step:$8, Stmts: $10} + $$.SetLine($1.Pos.Line) + $$.SetLastLine($11.Pos.Line) + } | + TFor namelist TIn exprlist TDo block TEnd { + $$ = &ast.GenericForStmt{Names:$2, Exprs:$4, Stmts: $6} + $$.SetLine($1.Pos.Line) + $$.SetLastLine($7.Pos.Line) + } | + TFunction funcname funcbody { + $$ = &ast.FuncDefStmt{Name: $2, Func: $3} + $$.SetLine($1.Pos.Line) + $$.SetLastLine($3.LastLine()) + } | + TLocal TFunction TIdent funcbody { + $$ = &ast.LocalAssignStmt{Names:[]string{$3.Str}, Exprs: []ast.Expr{$4}} + $$.SetLine($1.Pos.Line) + $$.SetLastLine($4.LastLine()) + } | + TLocal namelist '=' exprlist { + $$ = &ast.LocalAssignStmt{Names: $2, Exprs:$4} + $$.SetLine($1.Pos.Line) + } | + TLocal namelist { + $$ = &ast.LocalAssignStmt{Names: $2, Exprs:[]ast.Expr{}} + $$.SetLine($1.Pos.Line) + } + +elseifs: + { + $$ = []ast.Stmt{} + } | + elseifs TElseIf expr TThen block { + $$ = append($1, &ast.IfStmt{Condition: $3, Then: $5}) + $$[len($$)-1].SetLine($2.Pos.Line) + } + +laststat: + TReturn { + $$ = &ast.ReturnStmt{Exprs:nil} + $$.SetLine($1.Pos.Line) + } | + TReturn exprlist { + $$ = &ast.ReturnStmt{Exprs:$2} + $$.SetLine($1.Pos.Line) + } | + TBreak { + $$ = &ast.BreakStmt{} + $$.SetLine($1.Pos.Line) + } + +funcname: + funcname1 { + $$ = $1 + } | + funcname1 ':' TIdent { + $$ = &ast.FuncName{Func:nil, Receiver:$1.Func, Method: $3.Str} + } + +funcname1: + TIdent { + $$ = &ast.FuncName{Func: &ast.IdentExpr{Value:$1.Str}} + $$.Func.SetLine($1.Pos.Line) + } | + funcname1 '.' TIdent { + key:= &ast.StringExpr{Value:$3.Str} + key.SetLine($3.Pos.Line) + fn := &ast.AttrGetExpr{Object: $1.Func, Key: key} + fn.SetLine($3.Pos.Line) + $$ = &ast.FuncName{Func: fn} + } + +varlist: + var { + $$ = []ast.Expr{$1} + } | + varlist ',' var { + $$ = append($1, $3) + } + +var: + TIdent { + $$ = &ast.IdentExpr{Value:$1.Str} + $$.SetLine($1.Pos.Line) + } | + prefixexp '[' expr ']' { + $$ = &ast.AttrGetExpr{Object: $1, Key: $3} + $$.SetLine($1.Line()) + } | + prefixexp '.' TIdent { + key := &ast.StringExpr{Value:$3.Str} + key.SetLine($3.Pos.Line) + $$ = &ast.AttrGetExpr{Object: $1, Key: key} + $$.SetLine($1.Line()) + } + +namelist: + TIdent { + $$ = []string{$1.Str} + } | + namelist ',' TIdent { + $$ = append($1, $3.Str) + } + +exprlist: + expr { + $$ = []ast.Expr{$1} + } | + exprlist ',' expr { + $$ = append($1, $3) + } + +expr: + TNil { + $$ = &ast.NilExpr{} + $$.SetLine($1.Pos.Line) + } | + TFalse { + $$ = &ast.FalseExpr{} + $$.SetLine($1.Pos.Line) + } | + TTrue { + $$ = &ast.TrueExpr{} + $$.SetLine($1.Pos.Line) + } | + TNumber { + $$ = &ast.NumberExpr{Value: $1.Str} + $$.SetLine($1.Pos.Line) + } | + T3Comma { + $$ = &ast.Comma3Expr{} + $$.SetLine($1.Pos.Line) + } | + function { + $$ = $1 + } | + prefixexp { + $$ = $1 + } | + string { + $$ = $1 + } | + tableconstructor { + $$ = $1 + } | + expr TOr expr { + $$ = &ast.LogicalOpExpr{Lhs: $1, Operator: "or", Rhs: $3} + $$.SetLine($1.Line()) + } | + expr TAnd expr { + $$ = &ast.LogicalOpExpr{Lhs: $1, Operator: "and", Rhs: $3} + $$.SetLine($1.Line()) + } | + expr '>' expr { + $$ = &ast.RelationalOpExpr{Lhs: $1, Operator: ">", Rhs: $3} + $$.SetLine($1.Line()) + } | + expr '<' expr { + $$ = &ast.RelationalOpExpr{Lhs: $1, Operator: "<", Rhs: $3} + $$.SetLine($1.Line()) + } | + expr TGte expr { + $$ = &ast.RelationalOpExpr{Lhs: $1, Operator: ">=", Rhs: $3} + $$.SetLine($1.Line()) + } | + expr TLte expr { + $$ = &ast.RelationalOpExpr{Lhs: $1, Operator: "<=", Rhs: $3} + $$.SetLine($1.Line()) + } | + expr TEqeq expr { + $$ = &ast.RelationalOpExpr{Lhs: $1, Operator: "==", Rhs: $3} + $$.SetLine($1.Line()) + } | + expr TNeq expr { + $$ = &ast.RelationalOpExpr{Lhs: $1, Operator: "~=", Rhs: $3} + $$.SetLine($1.Line()) + } | + expr T2Comma expr { + $$ = &ast.StringConcatOpExpr{Lhs: $1, Rhs: $3} + $$.SetLine($1.Line()) + } | + expr '+' expr { + $$ = &ast.ArithmeticOpExpr{Lhs: $1, Operator: "+", Rhs: $3} + $$.SetLine($1.Line()) + } | + expr '-' expr { + $$ = &ast.ArithmeticOpExpr{Lhs: $1, Operator: "-", Rhs: $3} + $$.SetLine($1.Line()) + } | + expr '*' expr { + $$ = &ast.ArithmeticOpExpr{Lhs: $1, Operator: "*", Rhs: $3} + $$.SetLine($1.Line()) + } | + expr '/' expr { + $$ = &ast.ArithmeticOpExpr{Lhs: $1, Operator: "/", Rhs: $3} + $$.SetLine($1.Line()) + } | + expr '%' expr { + $$ = &ast.ArithmeticOpExpr{Lhs: $1, Operator: "%", Rhs: $3} + $$.SetLine($1.Line()) + } | + expr '^' expr { + $$ = &ast.ArithmeticOpExpr{Lhs: $1, Operator: "^", Rhs: $3} + $$.SetLine($1.Line()) + } | + '-' expr %prec UNARY { + $$ = &ast.UnaryMinusOpExpr{Expr: $2} + $$.SetLine($2.Line()) + } | + TNot expr %prec UNARY { + $$ = &ast.UnaryNotOpExpr{Expr: $2} + $$.SetLine($2.Line()) + } | + '#' expr %prec UNARY { + $$ = &ast.UnaryLenOpExpr{Expr: $2} + $$.SetLine($2.Line()) + } + +string: + TString { + $$ = &ast.StringExpr{Value: $1.Str} + $$.SetLine($1.Pos.Line) + } + +prefixexp: + var { + $$ = $1 + } | + afunctioncall { + $$ = $1 + } | + functioncall { + $$ = $1 + } | + '(' expr ')' { + $$ = $2 + $$.SetLine($1.Pos.Line) + } + +afunctioncall: + '(' functioncall ')' { + $2.(*ast.FuncCallExpr).AdjustRet = true + $$ = $2 + } + +functioncall: + prefixexp args { + $$ = &ast.FuncCallExpr{Func: $1, Args: $2} + $$.SetLine($1.Line()) + } | + prefixexp ':' TIdent args { + $$ = &ast.FuncCallExpr{Method: $3.Str, Receiver: $1, Args: $4} + $$.SetLine($1.Line()) + } + +args: + '(' ')' { + if yylex.(*Lexer).PNewLine { + yylex.(*Lexer).TokenError($1, "ambiguous syntax (function call x new statement)") + } + $$ = []ast.Expr{} + } | + '(' exprlist ')' { + if yylex.(*Lexer).PNewLine { + yylex.(*Lexer).TokenError($1, "ambiguous syntax (function call x new statement)") + } + $$ = $2 + } | + tableconstructor { + $$ = []ast.Expr{$1} + } | + string { + $$ = []ast.Expr{$1} + } + +function: + TFunction funcbody { + $$ = &ast.FunctionExpr{ParList:$2.ParList, Stmts: $2.Stmts} + $$.SetLine($1.Pos.Line) + $$.SetLastLine($2.LastLine()) + } + +funcbody: + '(' parlist ')' block TEnd { + $$ = &ast.FunctionExpr{ParList: $2, Stmts: $4} + $$.SetLine($1.Pos.Line) + $$.SetLastLine($5.Pos.Line) + } | + '(' ')' block TEnd { + $$ = &ast.FunctionExpr{ParList: &ast.ParList{HasVargs: false, Names: []string{}}, Stmts: $3} + $$.SetLine($1.Pos.Line) + $$.SetLastLine($4.Pos.Line) + } + +parlist: + T3Comma { + $$ = &ast.ParList{HasVargs: true, Names: []string{}} + } | + namelist { + $$ = &ast.ParList{HasVargs: false, Names: []string{}} + $$.Names = append($$.Names, $1...) + } | + namelist ',' T3Comma { + $$ = &ast.ParList{HasVargs: true, Names: []string{}} + $$.Names = append($$.Names, $1...) + } + + +tableconstructor: + '{' '}' { + $$ = &ast.TableExpr{Fields: []*ast.Field{}} + $$.SetLine($1.Pos.Line) + } | + '{' fieldlist '}' { + $$ = &ast.TableExpr{Fields: $2} + $$.SetLine($1.Pos.Line) + } + + +fieldlist: + field { + $$ = []*ast.Field{$1} + } | + fieldlist fieldsep field { + $$ = append($1, $3) + } | + fieldlist fieldsep { + $$ = $1 + } + +field: + TIdent '=' expr { + $$ = &ast.Field{Key: &ast.StringExpr{Value:$1.Str}, Value: $3} + $$.Key.SetLine($1.Pos.Line) + } | + '[' expr ']' '=' expr { + $$ = &ast.Field{Key: $2, Value: $5} + } | + expr { + $$ = &ast.Field{Value: $1} + } + +fieldsep: + ',' { + $$ = "," + } | + ';' { + $$ = ";" + } + +%% + +func TokenName(c int) string { + if c >= TAnd && c-TAnd < len(yyToknames) { + if yyToknames[c-TAnd] != "" { + return yyToknames[c-TAnd] + } + } + return string([]byte{byte(c)}) +} + diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/pm/pm.go b/vendor/github.com/yuin/gopher-lua/pm/pm.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/pm/pm.go rename to vendor/github.com/yuin/gopher-lua/pm/pm.go diff --git a/vendor/github.com/yuin/gopher-lua/script_test.go b/vendor/github.com/yuin/gopher-lua/script_test.go new file mode 100644 index 0000000..a98ae5e --- /dev/null +++ b/vendor/github.com/yuin/gopher-lua/script_test.go @@ -0,0 +1,87 @@ +package lua + +import ( + "fmt" + "github.com/yuin/gopher-lua/parse" + "os" + "testing" +) + +const maxMemory = 40 + +var gluaTests []string = []string{ + "base.lua", + "coroutine.lua", + "db.lua", + "issues.lua", + "os.lua", + "table.lua", + "vm.lua", + "math.lua", + "strings.lua", +} + +var luaTests []string = []string{ + "attrib.lua", + "calls.lua", + "closure.lua", + "constructs.lua", + "events.lua", + "literals.lua", + "locals.lua", + "math.lua", + "sort.lua", + "strings.lua", + "vararg.lua", + "pm.lua", + "files.lua", +} + +func testScriptCompile(t *testing.T, script string) { + file, err := os.Open(script) + if err != nil { + t.Fatal(err) + return + } + chunk, err2 := parse.Parse(file, script) + if err2 != nil { + t.Fatal(err2) + return + } + parse.Dump(chunk) + proto, err3 := Compile(chunk, script) + if err3 != nil { + t.Fatal(err3) + return + } + proto.String() +} + +func testScriptDir(t *testing.T, tests []string, directory string) { + if err := os.Chdir(directory); err != nil { + t.Error(err) + } + defer os.Chdir("..") + for _, script := range tests { + fmt.Printf("testing %s/%s\n", directory, script) + testScriptCompile(t, script) + L := NewState(Options{ + RegistrySize: 1024 * 20, + CallStackSize: 1024, + IncludeGoStackTrace: true, + }) + L.SetMx(maxMemory) + if err := L.DoFile(script); err != nil { + t.Error(err) + } + L.Close() + } +} + +func TestGlua(t *testing.T) { + testScriptDir(t, gluaTests, "_glua-tests") +} + +func TestLua(t *testing.T) { + testScriptDir(t, luaTests, "_lua5.1-tests") +} diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/state.go b/vendor/github.com/yuin/gopher-lua/state.go similarity index 99% rename from _vendor/vendor/github.com/yuin/gopher-lua/state.go rename to vendor/github.com/yuin/gopher-lua/state.go index 8e38851..b6ea313 100644 --- a/_vendor/vendor/github.com/yuin/gopher-lua/state.go +++ b/vendor/github.com/yuin/gopher-lua/state.go @@ -5,9 +5,9 @@ package lua //////////////////////////////////////////////////////// import ( + "context" "fmt" "github.com/yuin/gopher-lua/parse" - "golang.org/x/net/context" "io" "math" "os" @@ -1660,6 +1660,8 @@ func (ls *LState) PCall(nargs, nret int, errfunc *LFunction) (err error) { } else if len(err.(*ApiError).StackTrace) == 0 { err.(*ApiError).StackTrace = ls.stackTrace(0) } + ls.stack.SetSp(sp) + ls.currentFrame = ls.stack.Last() ls.reg.SetTop(base) } ls.stack.SetSp(sp) diff --git a/vendor/github.com/yuin/gopher-lua/state_test.go b/vendor/github.com/yuin/gopher-lua/state_test.go new file mode 100644 index 0000000..46fb5e5 --- /dev/null +++ b/vendor/github.com/yuin/gopher-lua/state_test.go @@ -0,0 +1,433 @@ +package lua + +import ( + "context" + "strings" + "testing" + "time" +) + +func TestCallStackOverflow(t *testing.T) { + L := NewState(Options{ + CallStackSize: 3, + }) + defer L.Close() + errorIfScriptNotFail(t, L, ` + local function a() + end + local function b() + a() + end + local function c() + print(_printregs()) + b() + end + c() + `, "stack overflow") +} + +func TestSkipOpenLibs(t *testing.T) { + L := NewState(Options{SkipOpenLibs: true}) + defer L.Close() + errorIfScriptNotFail(t, L, `print("")`, + "attempt to call a non-function object") + L2 := NewState() + defer L2.Close() + errorIfScriptFail(t, L2, `print("")`) +} + +func TestGetAndReplace(t *testing.T) { + L := NewState() + defer L.Close() + L.Push(LString("a")) + L.Replace(1, LString("b")) + L.Replace(0, LString("c")) + errorIfNotEqual(t, LNil, L.Get(0)) + errorIfNotEqual(t, LNil, L.Get(-10)) + errorIfNotEqual(t, L.Env, L.Get(EnvironIndex)) + errorIfNotEqual(t, LString("b"), L.Get(1)) + L.Push(LString("c")) + L.Push(LString("d")) + L.Replace(-2, LString("e")) + errorIfNotEqual(t, LString("e"), L.Get(-2)) + registry := L.NewTable() + L.Replace(RegistryIndex, registry) + L.G.Registry = registry + errorIfGFuncNotFail(t, L, func(L *LState) int { + L.Replace(RegistryIndex, LNil) + return 0 + }, "registry must be a table") + errorIfGFuncFail(t, L, func(L *LState) int { + env := L.NewTable() + L.Replace(EnvironIndex, env) + errorIfNotEqual(t, env, L.Get(EnvironIndex)) + return 0 + }) + errorIfGFuncNotFail(t, L, func(L *LState) int { + L.Replace(EnvironIndex, LNil) + return 0 + }, "environment must be a table") + errorIfGFuncFail(t, L, func(L *LState) int { + gbl := L.NewTable() + L.Replace(GlobalsIndex, gbl) + errorIfNotEqual(t, gbl, L.G.Global) + return 0 + }) + errorIfGFuncNotFail(t, L, func(L *LState) int { + L.Replace(GlobalsIndex, LNil) + return 0 + }, "_G must be a table") + + L2 := NewState() + defer L2.Close() + clo := L2.NewClosure(func(L2 *LState) int { + L2.Replace(UpvalueIndex(1), LNumber(3)) + errorIfNotEqual(t, LNumber(3), L2.Get(UpvalueIndex(1))) + return 0 + }, LNumber(1), LNumber(2)) + L2.SetGlobal("clo", clo) + errorIfScriptFail(t, L2, `clo()`) +} + +func TestRemove(t *testing.T) { + L := NewState() + defer L.Close() + L.Push(LString("a")) + L.Push(LString("b")) + L.Push(LString("c")) + + L.Remove(4) + errorIfNotEqual(t, LString("a"), L.Get(1)) + errorIfNotEqual(t, LString("b"), L.Get(2)) + errorIfNotEqual(t, LString("c"), L.Get(3)) + errorIfNotEqual(t, 3, L.GetTop()) + + L.Remove(3) + errorIfNotEqual(t, LString("a"), L.Get(1)) + errorIfNotEqual(t, LString("b"), L.Get(2)) + errorIfNotEqual(t, LNil, L.Get(3)) + errorIfNotEqual(t, 2, L.GetTop()) + L.Push(LString("c")) + + L.Remove(-10) + errorIfNotEqual(t, LString("a"), L.Get(1)) + errorIfNotEqual(t, LString("b"), L.Get(2)) + errorIfNotEqual(t, LString("c"), L.Get(3)) + errorIfNotEqual(t, 3, L.GetTop()) + + L.Remove(2) + errorIfNotEqual(t, LString("a"), L.Get(1)) + errorIfNotEqual(t, LString("c"), L.Get(2)) + errorIfNotEqual(t, LNil, L.Get(3)) + errorIfNotEqual(t, 2, L.GetTop()) +} + +func TestToInt(t *testing.T) { + L := NewState() + defer L.Close() + L.Push(LNumber(10)) + L.Push(LString("99.9")) + L.Push(L.NewTable()) + errorIfNotEqual(t, 10, L.ToInt(1)) + errorIfNotEqual(t, 99, L.ToInt(2)) + errorIfNotEqual(t, 0, L.ToInt(3)) +} + +func TestToInt64(t *testing.T) { + L := NewState() + defer L.Close() + L.Push(LNumber(10)) + L.Push(LString("99.9")) + L.Push(L.NewTable()) + errorIfNotEqual(t, int64(10), L.ToInt64(1)) + errorIfNotEqual(t, int64(99), L.ToInt64(2)) + errorIfNotEqual(t, int64(0), L.ToInt64(3)) +} + +func TestToNumber(t *testing.T) { + L := NewState() + defer L.Close() + L.Push(LNumber(10)) + L.Push(LString("99.9")) + L.Push(L.NewTable()) + errorIfNotEqual(t, LNumber(10), L.ToNumber(1)) + errorIfNotEqual(t, LNumber(99.9), L.ToNumber(2)) + errorIfNotEqual(t, LNumber(0), L.ToNumber(3)) +} + +func TestToString(t *testing.T) { + L := NewState() + defer L.Close() + L.Push(LNumber(10)) + L.Push(LString("99.9")) + L.Push(L.NewTable()) + errorIfNotEqual(t, "10", L.ToString(1)) + errorIfNotEqual(t, "99.9", L.ToString(2)) + errorIfNotEqual(t, "", L.ToString(3)) +} + +func TestToTable(t *testing.T) { + L := NewState() + defer L.Close() + L.Push(LNumber(10)) + L.Push(LString("99.9")) + L.Push(L.NewTable()) + errorIfFalse(t, L.ToTable(1) == nil, "index 1 must be nil") + errorIfFalse(t, L.ToTable(2) == nil, "index 2 must be nil") + errorIfNotEqual(t, L.Get(3), L.ToTable(3)) +} + +func TestToFunction(t *testing.T) { + L := NewState() + defer L.Close() + L.Push(LNumber(10)) + L.Push(LString("99.9")) + L.Push(L.NewFunction(func(L *LState) int { return 0 })) + errorIfFalse(t, L.ToFunction(1) == nil, "index 1 must be nil") + errorIfFalse(t, L.ToFunction(2) == nil, "index 2 must be nil") + errorIfNotEqual(t, L.Get(3), L.ToFunction(3)) +} + +func TestToUserData(t *testing.T) { + L := NewState() + defer L.Close() + L.Push(LNumber(10)) + L.Push(LString("99.9")) + L.Push(L.NewUserData()) + errorIfFalse(t, L.ToUserData(1) == nil, "index 1 must be nil") + errorIfFalse(t, L.ToUserData(2) == nil, "index 2 must be nil") + errorIfNotEqual(t, L.Get(3), L.ToUserData(3)) +} + +func TestToChannel(t *testing.T) { + L := NewState() + defer L.Close() + L.Push(LNumber(10)) + L.Push(LString("99.9")) + var ch chan LValue + L.Push(LChannel(ch)) + errorIfFalse(t, L.ToChannel(1) == nil, "index 1 must be nil") + errorIfFalse(t, L.ToChannel(2) == nil, "index 2 must be nil") + errorIfNotEqual(t, ch, L.ToChannel(3)) +} + +func TestObjLen(t *testing.T) { + L := NewState() + defer L.Close() + errorIfNotEqual(t, 3, L.ObjLen(LString("abc"))) + tbl := L.NewTable() + tbl.Append(LTrue) + tbl.Append(LTrue) + errorIfNotEqual(t, 2, L.ObjLen(tbl)) + mt := L.NewTable() + L.SetField(mt, "__len", L.NewFunction(func(L *LState) int { + tbl := L.CheckTable(1) + L.Push(LNumber(tbl.Len() + 1)) + return 1 + })) + L.SetMetatable(tbl, mt) + errorIfNotEqual(t, 3, L.ObjLen(tbl)) + errorIfNotEqual(t, 0, L.ObjLen(LNumber(10))) +} + +func TestConcat(t *testing.T) { + L := NewState() + defer L.Close() + errorIfNotEqual(t, "a1c", L.Concat(LString("a"), LNumber(1), LString("c"))) +} + +func TestPCall(t *testing.T) { + L := NewState() + defer L.Close() + L.Register("f1", func(L *LState) int { + panic("panic!") + return 0 + }) + errorIfScriptNotFail(t, L, `f1()`, "panic!") + L.Push(L.GetGlobal("f1")) + err := L.PCall(0, 0, L.NewFunction(func(L *LState) int { + L.Push(LString("by handler")) + return 1 + })) + errorIfFalse(t, strings.Contains(err.Error(), "by handler"), "") + + err = L.PCall(0, 0, L.NewFunction(func(L *LState) int { + L.RaiseError("error!") + return 1 + })) + errorIfFalse(t, strings.Contains(err.Error(), "error!"), "") + + err = L.PCall(0, 0, L.NewFunction(func(L *LState) int { + panic("panicc!") + return 1 + })) + errorIfFalse(t, strings.Contains(err.Error(), "panicc!"), "") +} + +func TestCoroutineApi1(t *testing.T) { + L := NewState() + defer L.Close() + co, _ := L.NewThread() + errorIfScriptFail(t, L, ` + function coro(v) + assert(v == 10) + local ret1, ret2 = coroutine.yield(1,2,3) + assert(ret1 == 11) + assert(ret2 == 12) + coroutine.yield(4) + return 5 + end + `) + fn := L.GetGlobal("coro").(*LFunction) + st, err, values := L.Resume(co, fn, LNumber(10)) + errorIfNotEqual(t, ResumeYield, st) + errorIfNotNil(t, err) + errorIfNotEqual(t, 3, len(values)) + errorIfNotEqual(t, LNumber(1), values[0].(LNumber)) + errorIfNotEqual(t, LNumber(2), values[1].(LNumber)) + errorIfNotEqual(t, LNumber(3), values[2].(LNumber)) + + st, err, values = L.Resume(co, fn, LNumber(11), LNumber(12)) + errorIfNotEqual(t, ResumeYield, st) + errorIfNotNil(t, err) + errorIfNotEqual(t, 1, len(values)) + errorIfNotEqual(t, LNumber(4), values[0].(LNumber)) + + st, err, values = L.Resume(co, fn) + errorIfNotEqual(t, ResumeOK, st) + errorIfNotNil(t, err) + errorIfNotEqual(t, 1, len(values)) + errorIfNotEqual(t, LNumber(5), values[0].(LNumber)) + + L.Register("myyield", func(L *LState) int { + return L.Yield(L.ToNumber(1)) + }) + errorIfScriptFail(t, L, ` + function coro_error() + coroutine.yield(1,2,3) + myyield(4) + assert(false, "--failed--") + end + `) + fn = L.GetGlobal("coro_error").(*LFunction) + co, _ = L.NewThread() + st, err, values = L.Resume(co, fn) + errorIfNotEqual(t, ResumeYield, st) + errorIfNotNil(t, err) + errorIfNotEqual(t, 3, len(values)) + errorIfNotEqual(t, LNumber(1), values[0].(LNumber)) + errorIfNotEqual(t, LNumber(2), values[1].(LNumber)) + errorIfNotEqual(t, LNumber(3), values[2].(LNumber)) + + st, err, values = L.Resume(co, fn) + errorIfNotEqual(t, ResumeYield, st) + errorIfNotNil(t, err) + errorIfNotEqual(t, 1, len(values)) + errorIfNotEqual(t, LNumber(4), values[0].(LNumber)) + + st, err, values = L.Resume(co, fn) + errorIfNotEqual(t, ResumeError, st) + errorIfNil(t, err) + errorIfFalse(t, strings.Contains(err.Error(), "--failed--"), "error message must be '--failed--'") + st, err, values = L.Resume(co, fn) + errorIfNotEqual(t, ResumeError, st) + errorIfNil(t, err) + errorIfFalse(t, strings.Contains(err.Error(), "can not resume a dead thread"), "can not resume a dead thread") + +} + +func TestContextTimeout(t *testing.T) { + L := NewState() + defer L.Close() + ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second) + defer cancel() + L.SetContext(ctx) + errorIfNotEqual(t, ctx, L.Context()) + err := L.DoString(` + local clock = os.clock + function sleep(n) -- seconds + local t0 = clock() + while clock() - t0 <= n do end + end + sleep(3) + `) + errorIfNil(t, err) + errorIfFalse(t, strings.Contains(err.Error(), "context deadline exceeded"), "execution must be canceled") + + oldctx := L.RemoveContext() + errorIfNotEqual(t, ctx, oldctx) + errorIfNotNil(t, L.ctx) +} + +func TestContextCancel(t *testing.T) { + L := NewState() + defer L.Close() + ctx, cancel := context.WithCancel(context.Background()) + errch := make(chan error, 1) + L.SetContext(ctx) + go func() { + errch <- L.DoString(` + local clock = os.clock + function sleep(n) -- seconds + local t0 = clock() + while clock() - t0 <= n do end + end + sleep(3) + `) + }() + time.Sleep(1 * time.Second) + cancel() + err := <-errch + errorIfNil(t, err) + errorIfFalse(t, strings.Contains(err.Error(), "context canceled"), "execution must be canceled") +} + +func TestContextWithCroutine(t *testing.T) { + L := NewState() + defer L.Close() + ctx, cancel := context.WithCancel(context.Background()) + L.SetContext(ctx) + defer cancel() + L.DoString(` + function coro() + local i = 0 + while true do + coroutine.yield(i) + i = i+1 + end + return i + end + `) + co, cocancel := L.NewThread() + defer cocancel() + fn := L.GetGlobal("coro").(*LFunction) + _, err, values := L.Resume(co, fn) + errorIfNotNil(t, err) + errorIfNotEqual(t, LNumber(0), values[0]) + // cancel the parent context + cancel() + _, err, values = L.Resume(co, fn) + errorIfNil(t, err) + errorIfFalse(t, strings.Contains(err.Error(), "context canceled"), "coroutine execution must be canceled when the parent context is canceled") + +} + +func TestPCallAfterFail(t *testing.T) { + L := NewState() + defer L.Close() + errFn := L.NewFunction(func(L *LState) int { + L.RaiseError("error!") + return 0 + }) + changeError := L.NewFunction(func(L *LState) int { + L.Push(errFn) + err := L.PCall(0, 0, nil) + if err != nil { + L.RaiseError("A New Error") + } + return 0 + }) + L.Push(changeError) + err := L.PCall(0, 0, nil) + errorIfFalse(t, strings.Contains(err.Error(), "A New Error"), "error not propogated correctly") +} diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/stringlib.go b/vendor/github.com/yuin/gopher-lua/stringlib.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/stringlib.go rename to vendor/github.com/yuin/gopher-lua/stringlib.go diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/table.go b/vendor/github.com/yuin/gopher-lua/table.go similarity index 91% rename from _vendor/vendor/github.com/yuin/gopher-lua/table.go rename to vendor/github.com/yuin/gopher-lua/table.go index 71c8b08..5d284bd 100644 --- a/_vendor/vendor/github.com/yuin/gopher-lua/table.go +++ b/vendor/github.com/yuin/gopher-lua/table.go @@ -36,8 +36,6 @@ func newLTable(acap int, hcap int) *LTable { hcap = 0 } tb := <able{} - tb.keys = nil - tb.k2i = nil tb.Metatable = LNil if acap != 0 { tb.array = make([]LValue, 0, acap) @@ -189,10 +187,21 @@ func (tb *LTable) RawSetString(key string, value LValue) { if tb.strdict == nil { tb.strdict = make(map[string]LValue, defaultHashCap) } + if tb.keys == nil { + tb.keys = []LValue{} + tb.k2i = map[LValue]int{} + } + if value == LNil { + // TODO tb.keys and tb.k2i should also be removed delete(tb.strdict, key) } else { tb.strdict[key] = value + lkey := LString(key) + if _, ok := tb.k2i[lkey]; !ok { + tb.k2i[lkey] = len(tb.keys) + tb.keys = append(tb.keys, lkey) + } } } @@ -205,11 +214,20 @@ func (tb *LTable) RawSetH(key LValue, value LValue) { if tb.dict == nil { tb.dict = make(map[LValue]LValue, len(tb.strdict)) } + if tb.keys == nil { + tb.keys = []LValue{} + tb.k2i = map[LValue]int{} + } if value == LNil { + // TODO tb.keys and tb.k2i should also be removed delete(tb.dict, key) } else { tb.dict[key] = value + if _, ok := tb.k2i[key]; !ok { + tb.k2i[key] = len(tb.keys) + tb.keys = append(tb.keys, key) + } } } @@ -315,45 +333,14 @@ func (tb *LTable) ForEach(cb func(LValue, LValue)) { // This function is equivalent to lua_next ( http://www.lua.org/manual/5.1/manual.html#lua_next ). func (tb *LTable) Next(key LValue) (LValue, LValue) { - // TODO: inefficient way init := false if key == LNil { - tb.keys = nil - tb.k2i = nil key = LNumber(0) init = true } - length := 0 - if tb.dict != nil { - length += len(tb.dict) - } - if tb.strdict != nil { - length += len(tb.strdict) - } - - if tb.keys == nil { - tb.keys = make([]LValue, length) - tb.k2i = make(map[LValue]int) - i := 0 - if tb.dict != nil { - for k, _ := range tb.dict { - tb.keys[i] = k - tb.k2i[k] = i - i++ - } - } - if tb.strdict != nil { - for k, _ := range tb.strdict { - tb.keys[i] = LString(k) - tb.k2i[LString(k)] = i - i++ - } - } - } - if init || key != LNumber(0) { - if kv, ok := key.(LNumber); ok && isInteger(kv) && int(kv) >= 0 { + if kv, ok := key.(LNumber); ok && isInteger(kv) && int(kv) >= 0 && kv < LNumber(MaxArrayIndex) { index := int(kv) if tb.array != nil { for ; index < len(tb.array); index++ { @@ -364,8 +351,6 @@ func (tb *LTable) Next(key LValue) (LValue, LValue) { } if tb.array == nil || index == len(tb.array) { if (tb.dict == nil || len(tb.dict) == 0) && (tb.strdict == nil || len(tb.strdict) == 0) { - tb.keys = nil - tb.k2i = nil return LNil, LNil } key = tb.keys[0] @@ -376,13 +361,11 @@ func (tb *LTable) Next(key LValue) (LValue, LValue) { } } - for i := tb.k2i[key] + 1; i < length; i++ { - key = tb.keys[tb.k2i[key]+1] + for i := tb.k2i[key] + 1; i < len(tb.keys); i++ { + key := tb.keys[i] if v := tb.RawGetH(key); v != LNil { return key, v } } - tb.keys = nil - tb.k2i = nil return LNil, LNil } diff --git a/vendor/github.com/yuin/gopher-lua/table_test.go b/vendor/github.com/yuin/gopher-lua/table_test.go new file mode 100644 index 0000000..2bcb300 --- /dev/null +++ b/vendor/github.com/yuin/gopher-lua/table_test.go @@ -0,0 +1,187 @@ +package lua + +import ( + "testing" +) + +func TestTableNewLTable(t *testing.T) { + tbl := newLTable(-1, -2) + errorIfNotEqual(t, 0, cap(tbl.array)) + + tbl = newLTable(10, 9) + errorIfNotEqual(t, 10, cap(tbl.array)) +} + +func TestTableLen(t *testing.T) { + tbl := newLTable(0, 0) + tbl.RawSetInt(10, LNil) + tbl.RawSetInt(9, LNumber(10)) + tbl.RawSetInt(8, LNil) + tbl.RawSetInt(7, LNumber(10)) + errorIfNotEqual(t, 9, tbl.Len()) + + tbl = newLTable(0, 0) + tbl.Append(LTrue) + tbl.Append(LTrue) + tbl.Append(LTrue) + errorIfNotEqual(t, 3, tbl.Len()) +} + +func TestTableInsert(t *testing.T) { + tbl := newLTable(0, 0) + tbl.Append(LTrue) + tbl.Append(LTrue) + tbl.Append(LTrue) + + tbl.Insert(5, LFalse) + errorIfNotEqual(t, LFalse, tbl.RawGetInt(5)) + errorIfNotEqual(t, 5, tbl.Len()) + + tbl.Insert(-10, LFalse) + errorIfNotEqual(t, LFalse, tbl.RawGet(LNumber(-10))) + errorIfNotEqual(t, 5, tbl.Len()) + + tbl = newLTable(0, 0) + tbl.Append(LNumber(1)) + tbl.Append(LNumber(2)) + tbl.Append(LNumber(3)) + tbl.Insert(1, LNumber(10)) + errorIfNotEqual(t, LNumber(10), tbl.RawGetInt(1)) + errorIfNotEqual(t, LNumber(1), tbl.RawGetInt(2)) + errorIfNotEqual(t, LNumber(2), tbl.RawGetInt(3)) + errorIfNotEqual(t, LNumber(3), tbl.RawGetInt(4)) + errorIfNotEqual(t, 4, tbl.Len()) + + tbl = newLTable(0, 0) + tbl.Insert(5, LNumber(10)) + errorIfNotEqual(t, LNumber(10), tbl.RawGetInt(5)) + +} + +func TestTableMaxN(t *testing.T) { + tbl := newLTable(0, 0) + tbl.Append(LTrue) + tbl.Append(LTrue) + tbl.Append(LTrue) + errorIfNotEqual(t, 3, tbl.MaxN()) + + tbl = newLTable(0, 0) + errorIfNotEqual(t, 0, tbl.MaxN()) + + tbl = newLTable(10, 0) + errorIfNotEqual(t, 0, tbl.MaxN()) +} + +func TestTableRemove(t *testing.T) { + tbl := newLTable(0, 0) + errorIfNotEqual(t, LNil, tbl.Remove(10)) + tbl.Append(LTrue) + errorIfNotEqual(t, LNil, tbl.Remove(10)) + + tbl.Append(LFalse) + tbl.Append(LTrue) + errorIfNotEqual(t, LFalse, tbl.Remove(2)) + errorIfNotEqual(t, 2, tbl.MaxN()) + tbl.Append(LFalse) + errorIfNotEqual(t, LFalse, tbl.Remove(-1)) + errorIfNotEqual(t, 2, tbl.MaxN()) + +} + +func TestTableRawSetInt(t *testing.T) { + tbl := newLTable(0, 0) + tbl.RawSetInt(MaxArrayIndex+1, LTrue) + errorIfNotEqual(t, 0, tbl.MaxN()) + errorIfNotEqual(t, LTrue, tbl.RawGet(LNumber(MaxArrayIndex+1))) + + tbl.RawSetInt(1, LTrue) + tbl.RawSetInt(3, LTrue) + errorIfNotEqual(t, 3, tbl.MaxN()) + errorIfNotEqual(t, LTrue, tbl.RawGetInt(1)) + errorIfNotEqual(t, LNil, tbl.RawGetInt(2)) + errorIfNotEqual(t, LTrue, tbl.RawGetInt(3)) + tbl.RawSetInt(2, LTrue) + errorIfNotEqual(t, LTrue, tbl.RawGetInt(1)) + errorIfNotEqual(t, LTrue, tbl.RawGetInt(2)) + errorIfNotEqual(t, LTrue, tbl.RawGetInt(3)) +} + +func TestTableRawSetH(t *testing.T) { + tbl := newLTable(0, 0) + tbl.RawSetH(LString("key"), LTrue) + tbl.RawSetH(LString("key"), LNil) + _, found := tbl.dict[LString("key")] + errorIfNotEqual(t, false, found) + + tbl.RawSetH(LTrue, LTrue) + tbl.RawSetH(LTrue, LNil) + _, foundb := tbl.dict[LTrue] + errorIfNotEqual(t, false, foundb) +} + +func TestTableRawGetH(t *testing.T) { + tbl := newLTable(0, 0) + errorIfNotEqual(t, LNil, tbl.RawGetH(LNumber(1))) + errorIfNotEqual(t, LNil, tbl.RawGetH(LString("key0"))) + tbl.RawSetH(LString("key0"), LTrue) + tbl.RawSetH(LString("key1"), LFalse) + tbl.RawSetH(LNumber(1), LTrue) + errorIfNotEqual(t, LTrue, tbl.RawGetH(LString("key0"))) + errorIfNotEqual(t, LTrue, tbl.RawGetH(LNumber(1))) + errorIfNotEqual(t, LNil, tbl.RawGetH(LString("notexist"))) + errorIfNotEqual(t, LNil, tbl.RawGetH(LTrue)) +} + +func TestTableForEach(t *testing.T) { + tbl := newLTable(0, 0) + tbl.Append(LNumber(1)) + tbl.Append(LNumber(2)) + tbl.Append(LNumber(3)) + tbl.Append(LNil) + tbl.Append(LNumber(5)) + + tbl.RawSetH(LString("a"), LString("a")) + tbl.RawSetH(LString("b"), LString("b")) + tbl.RawSetH(LString("c"), LString("c")) + + tbl.RawSetH(LTrue, LString("true")) + tbl.RawSetH(LFalse, LString("false")) + + tbl.ForEach(func(key, value LValue) { + switch k := key.(type) { + case LBool: + switch bool(k) { + case true: + errorIfNotEqual(t, LString("true"), value) + case false: + errorIfNotEqual(t, LString("false"), value) + default: + t.Fail() + } + case LNumber: + switch int(k) { + case 1: + errorIfNotEqual(t, LNumber(1), value) + case 2: + errorIfNotEqual(t, LNumber(2), value) + case 3: + errorIfNotEqual(t, LNumber(3), value) + case 5: + errorIfNotEqual(t, LNumber(5), value) + default: + t.Fail() + } + case LString: + switch string(k) { + case "a": + errorIfNotEqual(t, LString("a"), value) + case "b": + errorIfNotEqual(t, LString("b"), value) + case "c": + errorIfNotEqual(t, LString("c"), value) + default: + t.Fail() + } + } + }) +} diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/tablelib.go b/vendor/github.com/yuin/gopher-lua/tablelib.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/tablelib.go rename to vendor/github.com/yuin/gopher-lua/tablelib.go diff --git a/vendor/github.com/yuin/gopher-lua/testutils_test.go b/vendor/github.com/yuin/gopher-lua/testutils_test.go new file mode 100644 index 0000000..e8c8578 --- /dev/null +++ b/vendor/github.com/yuin/gopher-lua/testutils_test.go @@ -0,0 +1,78 @@ +package lua + +import ( + "fmt" + "path/filepath" + "regexp" + "runtime" + "testing" +) + +func positionString(level int) string { + _, file, line, _ := runtime.Caller(level + 1) + return fmt.Sprintf("%v:%v:", filepath.Base(file), line) +} + +func errorIfNotEqual(t *testing.T, v1, v2 interface{}) { + if v1 != v2 { + t.Errorf("%v '%v' expected, but got '%v'", positionString(1), v1, v2) + } +} + +func errorIfFalse(t *testing.T, cond bool, msg string, args ...interface{}) { + if !cond { + if len(args) > 0 { + t.Errorf("%v %v", positionString(1), fmt.Sprintf(msg, args...)) + } else { + t.Errorf("%v %v", positionString(1), msg) + } + } +} + +func errorIfNotNil(t *testing.T, v1 interface{}) { + if fmt.Sprint(v1) != "" { + t.Errorf("%v nil expected, but got '%v'", positionString(1), v1) + } +} + +func errorIfNil(t *testing.T, v1 interface{}) { + if fmt.Sprint(v1) == "" { + t.Errorf("%v non-nil value expected, but got nil", positionString(1)) + } +} + +func errorIfScriptFail(t *testing.T, L *LState, script string) { + if err := L.DoString(script); err != nil { + t.Errorf("%v %v", positionString(1), err.Error()) + } +} + +func errorIfGFuncFail(t *testing.T, L *LState, f LGFunction) { + if err := L.GPCall(f, LNil); err != nil { + t.Errorf("%v %v", positionString(1), err.Error()) + } +} + +func errorIfScriptNotFail(t *testing.T, L *LState, script string, pattern string) { + if err := L.DoString(script); err != nil { + reg := regexp.MustCompile(pattern) + if len(reg.FindStringIndex(err.Error())) == 0 { + t.Errorf("%v error message '%v' does not contains given pattern string '%v'.", positionString(1), err.Error(), pattern) + return + } + return + } + t.Errorf("%v script should fail", positionString(1)) +} + +func errorIfGFuncNotFail(t *testing.T, L *LState, f LGFunction, pattern string) { + if err := L.GPCall(f, LNil); err != nil { + reg := regexp.MustCompile(pattern) + if len(reg.FindStringIndex(err.Error())) == 0 { + t.Errorf("%v error message '%v' does not contains given pattern string '%v'.", positionString(1), err.Error(), pattern) + return + } + return + } + t.Errorf("%v LGFunction should fail", positionString(1)) +} diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/utils.go b/vendor/github.com/yuin/gopher-lua/utils.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/utils.go rename to vendor/github.com/yuin/gopher-lua/utils.go diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/value.go b/vendor/github.com/yuin/gopher-lua/value.go similarity index 99% rename from _vendor/vendor/github.com/yuin/gopher-lua/value.go rename to vendor/github.com/yuin/gopher-lua/value.go index 1cc31df..7bcf1f6 100644 --- a/_vendor/vendor/github.com/yuin/gopher-lua/value.go +++ b/vendor/github.com/yuin/gopher-lua/value.go @@ -1,8 +1,8 @@ package lua import ( + "context" "fmt" - "golang.org/x/net/context" "os" ) diff --git a/_vendor/vendor/github.com/yuin/gopher-lua/vm.go b/vendor/github.com/yuin/gopher-lua/vm.go similarity index 100% rename from _vendor/vendor/github.com/yuin/gopher-lua/vm.go rename to vendor/github.com/yuin/gopher-lua/vm.go diff --git a/vendor/golang.org/x/net/.gitattributes b/vendor/golang.org/x/net/.gitattributes new file mode 100644 index 0000000..d2f212e --- /dev/null +++ b/vendor/golang.org/x/net/.gitattributes @@ -0,0 +1,10 @@ +# Treat all files in this repo as binary, with no git magic updating +# line endings. Windows users contributing to Go will need to use a +# modern version of git and editors capable of LF line endings. +# +# We'll prevent accidental CRLF line endings from entering the repo +# via the git-review gofmt checks. +# +# See golang.org/issue/9281 + +* -text diff --git a/vendor/golang.org/x/net/.gitignore b/vendor/golang.org/x/net/.gitignore new file mode 100644 index 0000000..8339fd6 --- /dev/null +++ b/vendor/golang.org/x/net/.gitignore @@ -0,0 +1,2 @@ +# Add no patterns to .hgignore except for files generated by the build. +last-change diff --git a/vendor/golang.org/x/net/AUTHORS b/vendor/golang.org/x/net/AUTHORS new file mode 100644 index 0000000..15167cd --- /dev/null +++ b/vendor/golang.org/x/net/AUTHORS @@ -0,0 +1,3 @@ +# This source code refers to The Go Authors for copyright purposes. +# The master list of authors is in the main Go distribution, +# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/golang.org/x/net/CONTRIBUTING.md b/vendor/golang.org/x/net/CONTRIBUTING.md new file mode 100644 index 0000000..88dff59 --- /dev/null +++ b/vendor/golang.org/x/net/CONTRIBUTING.md @@ -0,0 +1,31 @@ +# Contributing to Go + +Go is an open source project. + +It is the work of hundreds of contributors. We appreciate your help! + + +## Filing issues + +When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: + +1. What version of Go are you using (`go version`)? +2. What operating system and processor architecture are you using? +3. What did you do? +4. What did you expect to see? +5. What did you see instead? + +General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. +The gophers there will answer or ask you to file an issue if you've tripped over a bug. + +## Contributing code + +Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) +before sending patches. + +**We do not accept GitHub pull requests** +(we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review). + +Unless otherwise noted, the Go source files are distributed under +the BSD-style license found in the LICENSE file. + diff --git a/vendor/golang.org/x/net/CONTRIBUTORS b/vendor/golang.org/x/net/CONTRIBUTORS new file mode 100644 index 0000000..1c4577e --- /dev/null +++ b/vendor/golang.org/x/net/CONTRIBUTORS @@ -0,0 +1,3 @@ +# This source code was written by the Go contributors. +# The master list of contributors is in the main Go distribution, +# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/_vendor/vendor/golang.org/x/net/LICENSE b/vendor/golang.org/x/net/LICENSE similarity index 100% rename from _vendor/vendor/golang.org/x/net/LICENSE rename to vendor/golang.org/x/net/LICENSE diff --git a/_vendor/vendor/golang.org/x/net/PATENTS b/vendor/golang.org/x/net/PATENTS similarity index 100% rename from _vendor/vendor/golang.org/x/net/PATENTS rename to vendor/golang.org/x/net/PATENTS diff --git a/vendor/golang.org/x/net/README.md b/vendor/golang.org/x/net/README.md new file mode 100644 index 0000000..00a9b6e --- /dev/null +++ b/vendor/golang.org/x/net/README.md @@ -0,0 +1,16 @@ +# Go Networking + +This repository holds supplementary Go networking libraries. + +## Download/Install + +The easiest way to install is to run `go get -u golang.org/x/net`. You can +also manually git clone the repository to `$GOPATH/src/golang.org/x/net`. + +## Report Issues / Send Patches + +This repository uses Gerrit for code changes. To learn how to submit +changes to this repository, see https://golang.org/doc/contribute.html. +The main issue tracker for the net repository is located at +https://github.com/golang/go/issues. Prefix your issue with "x/net:" in the +subject line, so it is easy to find. diff --git a/vendor/golang.org/x/net/codereview.cfg b/vendor/golang.org/x/net/codereview.cfg new file mode 100644 index 0000000..3f8b14b --- /dev/null +++ b/vendor/golang.org/x/net/codereview.cfg @@ -0,0 +1 @@ +issuerepo: golang/go diff --git a/_vendor/vendor/golang.org/x/net/context/context.go b/vendor/golang.org/x/net/context/context.go similarity index 94% rename from _vendor/vendor/golang.org/x/net/context/context.go rename to vendor/golang.org/x/net/context/context.go index d3681ab..a3c021d 100644 --- a/_vendor/vendor/golang.org/x/net/context/context.go +++ b/vendor/golang.org/x/net/context/context.go @@ -5,6 +5,8 @@ // Package context defines the Context type, which carries deadlines, // cancelation signals, and other request-scoped values across API boundaries // and between processes. +// As of Go 1.7 this package is available in the standard library under the +// name context. https://golang.org/pkg/context. // // Incoming requests to a server should create a Context, and outgoing calls to // servers should accept a Context. The chain of function calls between must diff --git a/vendor/golang.org/x/net/context/context_test.go b/vendor/golang.org/x/net/context/context_test.go new file mode 100644 index 0000000..6284413 --- /dev/null +++ b/vendor/golang.org/x/net/context/context_test.go @@ -0,0 +1,583 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !go1.7 + +package context + +import ( + "fmt" + "math/rand" + "runtime" + "strings" + "sync" + "testing" + "time" +) + +// otherContext is a Context that's not one of the types defined in context.go. +// This lets us test code paths that differ based on the underlying type of the +// Context. +type otherContext struct { + Context +} + +func TestBackground(t *testing.T) { + c := Background() + if c == nil { + t.Fatalf("Background returned nil") + } + select { + case x := <-c.Done(): + t.Errorf("<-c.Done() == %v want nothing (it should block)", x) + default: + } + if got, want := fmt.Sprint(c), "context.Background"; got != want { + t.Errorf("Background().String() = %q want %q", got, want) + } +} + +func TestTODO(t *testing.T) { + c := TODO() + if c == nil { + t.Fatalf("TODO returned nil") + } + select { + case x := <-c.Done(): + t.Errorf("<-c.Done() == %v want nothing (it should block)", x) + default: + } + if got, want := fmt.Sprint(c), "context.TODO"; got != want { + t.Errorf("TODO().String() = %q want %q", got, want) + } +} + +func TestWithCancel(t *testing.T) { + c1, cancel := WithCancel(Background()) + + if got, want := fmt.Sprint(c1), "context.Background.WithCancel"; got != want { + t.Errorf("c1.String() = %q want %q", got, want) + } + + o := otherContext{c1} + c2, _ := WithCancel(o) + contexts := []Context{c1, o, c2} + + for i, c := range contexts { + if d := c.Done(); d == nil { + t.Errorf("c[%d].Done() == %v want non-nil", i, d) + } + if e := c.Err(); e != nil { + t.Errorf("c[%d].Err() == %v want nil", i, e) + } + + select { + case x := <-c.Done(): + t.Errorf("<-c.Done() == %v want nothing (it should block)", x) + default: + } + } + + cancel() + time.Sleep(100 * time.Millisecond) // let cancelation propagate + + for i, c := range contexts { + select { + case <-c.Done(): + default: + t.Errorf("<-c[%d].Done() blocked, but shouldn't have", i) + } + if e := c.Err(); e != Canceled { + t.Errorf("c[%d].Err() == %v want %v", i, e, Canceled) + } + } +} + +func TestParentFinishesChild(t *testing.T) { + // Context tree: + // parent -> cancelChild + // parent -> valueChild -> timerChild + parent, cancel := WithCancel(Background()) + cancelChild, stop := WithCancel(parent) + defer stop() + valueChild := WithValue(parent, "key", "value") + timerChild, stop := WithTimeout(valueChild, 10000*time.Hour) + defer stop() + + select { + case x := <-parent.Done(): + t.Errorf("<-parent.Done() == %v want nothing (it should block)", x) + case x := <-cancelChild.Done(): + t.Errorf("<-cancelChild.Done() == %v want nothing (it should block)", x) + case x := <-timerChild.Done(): + t.Errorf("<-timerChild.Done() == %v want nothing (it should block)", x) + case x := <-valueChild.Done(): + t.Errorf("<-valueChild.Done() == %v want nothing (it should block)", x) + default: + } + + // The parent's children should contain the two cancelable children. + pc := parent.(*cancelCtx) + cc := cancelChild.(*cancelCtx) + tc := timerChild.(*timerCtx) + pc.mu.Lock() + if len(pc.children) != 2 || !pc.children[cc] || !pc.children[tc] { + t.Errorf("bad linkage: pc.children = %v, want %v and %v", + pc.children, cc, tc) + } + pc.mu.Unlock() + + if p, ok := parentCancelCtx(cc.Context); !ok || p != pc { + t.Errorf("bad linkage: parentCancelCtx(cancelChild.Context) = %v, %v want %v, true", p, ok, pc) + } + if p, ok := parentCancelCtx(tc.Context); !ok || p != pc { + t.Errorf("bad linkage: parentCancelCtx(timerChild.Context) = %v, %v want %v, true", p, ok, pc) + } + + cancel() + + pc.mu.Lock() + if len(pc.children) != 0 { + t.Errorf("pc.cancel didn't clear pc.children = %v", pc.children) + } + pc.mu.Unlock() + + // parent and children should all be finished. + check := func(ctx Context, name string) { + select { + case <-ctx.Done(): + default: + t.Errorf("<-%s.Done() blocked, but shouldn't have", name) + } + if e := ctx.Err(); e != Canceled { + t.Errorf("%s.Err() == %v want %v", name, e, Canceled) + } + } + check(parent, "parent") + check(cancelChild, "cancelChild") + check(valueChild, "valueChild") + check(timerChild, "timerChild") + + // WithCancel should return a canceled context on a canceled parent. + precanceledChild := WithValue(parent, "key", "value") + select { + case <-precanceledChild.Done(): + default: + t.Errorf("<-precanceledChild.Done() blocked, but shouldn't have") + } + if e := precanceledChild.Err(); e != Canceled { + t.Errorf("precanceledChild.Err() == %v want %v", e, Canceled) + } +} + +func TestChildFinishesFirst(t *testing.T) { + cancelable, stop := WithCancel(Background()) + defer stop() + for _, parent := range []Context{Background(), cancelable} { + child, cancel := WithCancel(parent) + + select { + case x := <-parent.Done(): + t.Errorf("<-parent.Done() == %v want nothing (it should block)", x) + case x := <-child.Done(): + t.Errorf("<-child.Done() == %v want nothing (it should block)", x) + default: + } + + cc := child.(*cancelCtx) + pc, pcok := parent.(*cancelCtx) // pcok == false when parent == Background() + if p, ok := parentCancelCtx(cc.Context); ok != pcok || (ok && pc != p) { + t.Errorf("bad linkage: parentCancelCtx(cc.Context) = %v, %v want %v, %v", p, ok, pc, pcok) + } + + if pcok { + pc.mu.Lock() + if len(pc.children) != 1 || !pc.children[cc] { + t.Errorf("bad linkage: pc.children = %v, cc = %v", pc.children, cc) + } + pc.mu.Unlock() + } + + cancel() + + if pcok { + pc.mu.Lock() + if len(pc.children) != 0 { + t.Errorf("child's cancel didn't remove self from pc.children = %v", pc.children) + } + pc.mu.Unlock() + } + + // child should be finished. + select { + case <-child.Done(): + default: + t.Errorf("<-child.Done() blocked, but shouldn't have") + } + if e := child.Err(); e != Canceled { + t.Errorf("child.Err() == %v want %v", e, Canceled) + } + + // parent should not be finished. + select { + case x := <-parent.Done(): + t.Errorf("<-parent.Done() == %v want nothing (it should block)", x) + default: + } + if e := parent.Err(); e != nil { + t.Errorf("parent.Err() == %v want nil", e) + } + } +} + +func testDeadline(c Context, wait time.Duration, t *testing.T) { + select { + case <-time.After(wait): + t.Fatalf("context should have timed out") + case <-c.Done(): + } + if e := c.Err(); e != DeadlineExceeded { + t.Errorf("c.Err() == %v want %v", e, DeadlineExceeded) + } +} + +func TestDeadline(t *testing.T) { + t.Parallel() + const timeUnit = 500 * time.Millisecond + c, _ := WithDeadline(Background(), time.Now().Add(1*timeUnit)) + if got, prefix := fmt.Sprint(c), "context.Background.WithDeadline("; !strings.HasPrefix(got, prefix) { + t.Errorf("c.String() = %q want prefix %q", got, prefix) + } + testDeadline(c, 2*timeUnit, t) + + c, _ = WithDeadline(Background(), time.Now().Add(1*timeUnit)) + o := otherContext{c} + testDeadline(o, 2*timeUnit, t) + + c, _ = WithDeadline(Background(), time.Now().Add(1*timeUnit)) + o = otherContext{c} + c, _ = WithDeadline(o, time.Now().Add(3*timeUnit)) + testDeadline(c, 2*timeUnit, t) +} + +func TestTimeout(t *testing.T) { + t.Parallel() + const timeUnit = 500 * time.Millisecond + c, _ := WithTimeout(Background(), 1*timeUnit) + if got, prefix := fmt.Sprint(c), "context.Background.WithDeadline("; !strings.HasPrefix(got, prefix) { + t.Errorf("c.String() = %q want prefix %q", got, prefix) + } + testDeadline(c, 2*timeUnit, t) + + c, _ = WithTimeout(Background(), 1*timeUnit) + o := otherContext{c} + testDeadline(o, 2*timeUnit, t) + + c, _ = WithTimeout(Background(), 1*timeUnit) + o = otherContext{c} + c, _ = WithTimeout(o, 3*timeUnit) + testDeadline(c, 2*timeUnit, t) +} + +func TestCanceledTimeout(t *testing.T) { + t.Parallel() + const timeUnit = 500 * time.Millisecond + c, _ := WithTimeout(Background(), 2*timeUnit) + o := otherContext{c} + c, cancel := WithTimeout(o, 4*timeUnit) + cancel() + time.Sleep(1 * timeUnit) // let cancelation propagate + select { + case <-c.Done(): + default: + t.Errorf("<-c.Done() blocked, but shouldn't have") + } + if e := c.Err(); e != Canceled { + t.Errorf("c.Err() == %v want %v", e, Canceled) + } +} + +type key1 int +type key2 int + +var k1 = key1(1) +var k2 = key2(1) // same int as k1, different type +var k3 = key2(3) // same type as k2, different int + +func TestValues(t *testing.T) { + check := func(c Context, nm, v1, v2, v3 string) { + if v, ok := c.Value(k1).(string); ok == (len(v1) == 0) || v != v1 { + t.Errorf(`%s.Value(k1).(string) = %q, %t want %q, %t`, nm, v, ok, v1, len(v1) != 0) + } + if v, ok := c.Value(k2).(string); ok == (len(v2) == 0) || v != v2 { + t.Errorf(`%s.Value(k2).(string) = %q, %t want %q, %t`, nm, v, ok, v2, len(v2) != 0) + } + if v, ok := c.Value(k3).(string); ok == (len(v3) == 0) || v != v3 { + t.Errorf(`%s.Value(k3).(string) = %q, %t want %q, %t`, nm, v, ok, v3, len(v3) != 0) + } + } + + c0 := Background() + check(c0, "c0", "", "", "") + + c1 := WithValue(Background(), k1, "c1k1") + check(c1, "c1", "c1k1", "", "") + + if got, want := fmt.Sprint(c1), `context.Background.WithValue(1, "c1k1")`; got != want { + t.Errorf("c.String() = %q want %q", got, want) + } + + c2 := WithValue(c1, k2, "c2k2") + check(c2, "c2", "c1k1", "c2k2", "") + + c3 := WithValue(c2, k3, "c3k3") + check(c3, "c2", "c1k1", "c2k2", "c3k3") + + c4 := WithValue(c3, k1, nil) + check(c4, "c4", "", "c2k2", "c3k3") + + o0 := otherContext{Background()} + check(o0, "o0", "", "", "") + + o1 := otherContext{WithValue(Background(), k1, "c1k1")} + check(o1, "o1", "c1k1", "", "") + + o2 := WithValue(o1, k2, "o2k2") + check(o2, "o2", "c1k1", "o2k2", "") + + o3 := otherContext{c4} + check(o3, "o3", "", "c2k2", "c3k3") + + o4 := WithValue(o3, k3, nil) + check(o4, "o4", "", "c2k2", "") +} + +func TestAllocs(t *testing.T) { + bg := Background() + for _, test := range []struct { + desc string + f func() + limit float64 + gccgoLimit float64 + }{ + { + desc: "Background()", + f: func() { Background() }, + limit: 0, + gccgoLimit: 0, + }, + { + desc: fmt.Sprintf("WithValue(bg, %v, nil)", k1), + f: func() { + c := WithValue(bg, k1, nil) + c.Value(k1) + }, + limit: 3, + gccgoLimit: 3, + }, + { + desc: "WithTimeout(bg, 15*time.Millisecond)", + f: func() { + c, _ := WithTimeout(bg, 15*time.Millisecond) + <-c.Done() + }, + limit: 8, + gccgoLimit: 16, + }, + { + desc: "WithCancel(bg)", + f: func() { + c, cancel := WithCancel(bg) + cancel() + <-c.Done() + }, + limit: 5, + gccgoLimit: 8, + }, + { + desc: "WithTimeout(bg, 100*time.Millisecond)", + f: func() { + c, cancel := WithTimeout(bg, 100*time.Millisecond) + cancel() + <-c.Done() + }, + limit: 8, + gccgoLimit: 25, + }, + } { + limit := test.limit + if runtime.Compiler == "gccgo" { + // gccgo does not yet do escape analysis. + // TODO(iant): Remove this when gccgo does do escape analysis. + limit = test.gccgoLimit + } + if n := testing.AllocsPerRun(100, test.f); n > limit { + t.Errorf("%s allocs = %f want %d", test.desc, n, int(limit)) + } + } +} + +func TestSimultaneousCancels(t *testing.T) { + root, cancel := WithCancel(Background()) + m := map[Context]CancelFunc{root: cancel} + q := []Context{root} + // Create a tree of contexts. + for len(q) != 0 && len(m) < 100 { + parent := q[0] + q = q[1:] + for i := 0; i < 4; i++ { + ctx, cancel := WithCancel(parent) + m[ctx] = cancel + q = append(q, ctx) + } + } + // Start all the cancels in a random order. + var wg sync.WaitGroup + wg.Add(len(m)) + for _, cancel := range m { + go func(cancel CancelFunc) { + cancel() + wg.Done() + }(cancel) + } + // Wait on all the contexts in a random order. + for ctx := range m { + select { + case <-ctx.Done(): + case <-time.After(1 * time.Second): + buf := make([]byte, 10<<10) + n := runtime.Stack(buf, true) + t.Fatalf("timed out waiting for <-ctx.Done(); stacks:\n%s", buf[:n]) + } + } + // Wait for all the cancel functions to return. + done := make(chan struct{}) + go func() { + wg.Wait() + close(done) + }() + select { + case <-done: + case <-time.After(1 * time.Second): + buf := make([]byte, 10<<10) + n := runtime.Stack(buf, true) + t.Fatalf("timed out waiting for cancel functions; stacks:\n%s", buf[:n]) + } +} + +func TestInterlockedCancels(t *testing.T) { + parent, cancelParent := WithCancel(Background()) + child, cancelChild := WithCancel(parent) + go func() { + parent.Done() + cancelChild() + }() + cancelParent() + select { + case <-child.Done(): + case <-time.After(1 * time.Second): + buf := make([]byte, 10<<10) + n := runtime.Stack(buf, true) + t.Fatalf("timed out waiting for child.Done(); stacks:\n%s", buf[:n]) + } +} + +func TestLayersCancel(t *testing.T) { + testLayers(t, time.Now().UnixNano(), false) +} + +func TestLayersTimeout(t *testing.T) { + testLayers(t, time.Now().UnixNano(), true) +} + +func testLayers(t *testing.T, seed int64, testTimeout bool) { + rand.Seed(seed) + errorf := func(format string, a ...interface{}) { + t.Errorf(fmt.Sprintf("seed=%d: %s", seed, format), a...) + } + const ( + timeout = 200 * time.Millisecond + minLayers = 30 + ) + type value int + var ( + vals []*value + cancels []CancelFunc + numTimers int + ctx = Background() + ) + for i := 0; i < minLayers || numTimers == 0 || len(cancels) == 0 || len(vals) == 0; i++ { + switch rand.Intn(3) { + case 0: + v := new(value) + ctx = WithValue(ctx, v, v) + vals = append(vals, v) + case 1: + var cancel CancelFunc + ctx, cancel = WithCancel(ctx) + cancels = append(cancels, cancel) + case 2: + var cancel CancelFunc + ctx, cancel = WithTimeout(ctx, timeout) + cancels = append(cancels, cancel) + numTimers++ + } + } + checkValues := func(when string) { + for _, key := range vals { + if val := ctx.Value(key).(*value); key != val { + errorf("%s: ctx.Value(%p) = %p want %p", when, key, val, key) + } + } + } + select { + case <-ctx.Done(): + errorf("ctx should not be canceled yet") + default: + } + if s, prefix := fmt.Sprint(ctx), "context.Background."; !strings.HasPrefix(s, prefix) { + t.Errorf("ctx.String() = %q want prefix %q", s, prefix) + } + t.Log(ctx) + checkValues("before cancel") + if testTimeout { + select { + case <-ctx.Done(): + case <-time.After(timeout + 100*time.Millisecond): + errorf("ctx should have timed out") + } + checkValues("after timeout") + } else { + cancel := cancels[rand.Intn(len(cancels))] + cancel() + select { + case <-ctx.Done(): + default: + errorf("ctx should be canceled") + } + checkValues("after cancel") + } +} + +func TestCancelRemoves(t *testing.T) { + checkChildren := func(when string, ctx Context, want int) { + if got := len(ctx.(*cancelCtx).children); got != want { + t.Errorf("%s: context has %d children, want %d", when, got, want) + } + } + + ctx, _ := WithCancel(Background()) + checkChildren("after creation", ctx, 0) + _, cancel := WithCancel(ctx) + checkChildren("with WithCancel child ", ctx, 1) + cancel() + checkChildren("after cancelling WithCancel child", ctx, 0) + + ctx, _ = WithCancel(Background()) + checkChildren("after creation", ctx, 0) + _, cancel = WithTimeout(ctx, 60*time.Minute) + checkChildren("with WithTimeout child ", ctx, 1) + cancel() + checkChildren("after cancelling WithTimeout child", ctx, 0) +} diff --git a/_vendor/vendor/golang.org/x/net/context/go17.go b/vendor/golang.org/x/net/context/go17.go similarity index 100% rename from _vendor/vendor/golang.org/x/net/context/go17.go rename to vendor/golang.org/x/net/context/go17.go diff --git a/_vendor/vendor/golang.org/x/net/context/go19.go b/vendor/golang.org/x/net/context/go19.go similarity index 100% rename from _vendor/vendor/golang.org/x/net/context/go19.go rename to vendor/golang.org/x/net/context/go19.go diff --git a/_vendor/vendor/golang.org/x/net/context/pre_go17.go b/vendor/golang.org/x/net/context/pre_go17.go similarity index 100% rename from _vendor/vendor/golang.org/x/net/context/pre_go17.go rename to vendor/golang.org/x/net/context/pre_go17.go diff --git a/_vendor/vendor/golang.org/x/net/context/pre_go19.go b/vendor/golang.org/x/net/context/pre_go19.go similarity index 100% rename from _vendor/vendor/golang.org/x/net/context/pre_go19.go rename to vendor/golang.org/x/net/context/pre_go19.go diff --git a/vendor/golang.org/x/net/context/withtimeout_test.go b/vendor/golang.org/x/net/context/withtimeout_test.go new file mode 100644 index 0000000..e6f5669 --- /dev/null +++ b/vendor/golang.org/x/net/context/withtimeout_test.go @@ -0,0 +1,31 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package context_test + +import ( + "fmt" + "time" + + "golang.org/x/net/context" +) + +// This example passes a context with a timeout to tell a blocking function that +// it should abandon its work after the timeout elapses. +func ExampleWithTimeout() { + // Pass a context with a timeout to tell a blocking function that it + // should abandon its work after the timeout elapses. + ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond) + defer cancel() + + select { + case <-time.After(1 * time.Second): + fmt.Println("overslept") + case <-ctx.Done(): + fmt.Println(ctx.Err()) // prints "context deadline exceeded" + } + + // Output: + // context deadline exceeded +}