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

Method CodecEncodeSelf

benchmark/benchmark_codecgen.go:47–279  ·  view source on GitHub ↗

Benchmark harness support for STK-REQ-004.

(e *codec1978.Encoder)

Source from the content-addressed store, hash-verified

45
46// Benchmark harness support for STK-REQ-004.
47func (x *SmallPayload) CodecEncodeSelf(e *codec1978.Encoder) {
48 var h codecSelfer6617
49 z, r := codec1978.GenHelperEncoder(e)
50 _, _, _ = h, z, r
51 if x == nil {
52 r.EncodeNil()
53 } else {
54 if false {
55 } else if yyxt1 := z.Extension(z.I2Rtid(x)); yyxt1 != nil {
56 z.EncExtension(x, yyxt1)
57 } else if !z.EncBinary() && z.IsJSONHandle() {
58 z.EncJSONMarshal(x)
59 } else {
60 yysep2 := !z.EncBinary()
61 yy2arr2 := z.EncBasicHandle().StructToArray
62 _, _ = yysep2, yy2arr2
63 const yyr2 bool = false // struct tag has 'toArray'
64 if yyr2 || yy2arr2 {
65 r.WriteArrayStart(9)
66 } else {
67 r.WriteMapStart(9)
68 }
69 if yyr2 || yy2arr2 {
70 r.WriteArrayElem()
71 if false {
72 } else {
73 r.EncodeInt(int64(x.St))
74 }
75 } else {
76 r.WriteMapElemKey()
77 if z.IsJSONHandle() {
78 z.WriteStr("\"St\"")
79 } else {
80 r.EncodeStringEnc(codecSelferCcUTF86617, `St`)
81 }
82 r.WriteMapElemValue()
83 if false {
84 } else {
85 r.EncodeInt(int64(x.St))
86 }
87 }
88 if yyr2 || yy2arr2 {
89 r.WriteArrayElem()
90 if false {
91 } else {
92 r.EncodeInt(int64(x.Sid))
93 }
94 } else {
95 r.WriteMapElemKey()
96 if z.IsJSONHandle() {
97 z.WriteStr("\"Sid\"")
98 } else {
99 r.EncodeStringEnc(codecSelferCcUTF86617, `Sid`)
100 }
101 r.WriteMapElemValue()
102 if false {
103 } else {
104 r.EncodeInt(int64(x.Sid))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected