MCPcopy Create free account
hub / github.com/buger/jsonparser / codecDecodeSelfFromMap

Method codecDecodeSelfFromMap

benchmark/benchmark_codecgen.go:1669–1714  ·  view source on GitHub ↗

Benchmark harness support for STK-REQ-004.

(l int, d *codec1978.Decoder)

Source from the content-addressed store, hash-verified

1667
1668// Benchmark harness support for STK-REQ-004.
1669func (x *MediumPayload) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
1670 var h codecSelfer6617
1671 z, r := codec1978.GenHelperDecoder(d)
1672 _, _, _ = h, z, r
1673 var yyhl3 bool = l >= 0
1674 for yyj3 := 0; ; yyj3++ {
1675 if yyhl3 {
1676 if yyj3 >= l {
1677 break
1678 }
1679 } else {
1680 if r.CheckBreak() {
1681 break
1682 }
1683 }
1684 r.ReadMapElemKey()
1685 yys3 := z.StringView(r.DecodeStringAsBytes())
1686 r.ReadMapElemValue()
1687 switch yys3 {
1688 case "Person":
1689 if r.TryDecodeAsNil() {
1690 if true && x.Person != nil {
1691 x.Person = nil
1692 }
1693 } else {
1694 if x.Person == nil {
1695 x.Person = new(CBPerson)
1696 }
1697
1698 x.Person.CodecDecodeSelf(d)
1699 }
1700 case "Company":
1701 if r.TryDecodeAsNil() {
1702 x.Company = nil
1703 } else {
1704 if false {
1705 } else {
1706 z.F.DecMapStringIntfX(&x.Company, d)
1707 }
1708 }
1709 default:
1710 z.DecStructFieldNotFound(-1, yys3)
1711 } // end switch yys3
1712 } // end for yyj3
1713 r.ReadMapEnd()
1714}
1715
1716// Benchmark harness support for STK-REQ-004.
1717func (x *MediumPayload) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {

Callers 1

CodecDecodeSelfMethod · 0.95

Calls 1

CodecDecodeSelfMethod · 0.45

Tested by

no test coverage detected