forked from mirror/go-json
Remove unnecessary code
This commit is contained in:
parent
eb6fb3b15d
commit
bed16416aa
|
@ -1184,12 +1184,8 @@ func (e *Encoder) run(ctx *encodeRuntimeContext, b []byte, code *opcode) ([]byte
|
||||||
case opStructFieldHead:
|
case opStructFieldHead:
|
||||||
ptr := load(ctxptr, code.idx)
|
ptr := load(ctxptr, code.idx)
|
||||||
if ptr == 0 {
|
if ptr == 0 {
|
||||||
//if code.op == opStructFieldPtrHead {
|
|
||||||
b = encodeNull(b)
|
b = encodeNull(b)
|
||||||
b = encodeComma(b)
|
b = encodeComma(b)
|
||||||
//} else {
|
|
||||||
// b = append(b, '{', '}', ',')
|
|
||||||
//}
|
|
||||||
code = code.end.next
|
code = code.end.next
|
||||||
} else {
|
} else {
|
||||||
b = append(b, '{')
|
b = append(b, '{')
|
||||||
|
@ -1221,12 +1217,8 @@ func (e *Encoder) run(ctx *encodeRuntimeContext, b []byte, code *opcode) ([]byte
|
||||||
case opStructEscapedFieldHead:
|
case opStructEscapedFieldHead:
|
||||||
ptr := load(ctxptr, code.idx)
|
ptr := load(ctxptr, code.idx)
|
||||||
if ptr == 0 {
|
if ptr == 0 {
|
||||||
//if code.op == opStructEscapedFieldPtrHead {
|
|
||||||
b = encodeNull(b)
|
b = encodeNull(b)
|
||||||
b = encodeComma(b)
|
b = encodeComma(b)
|
||||||
//} else {
|
|
||||||
// b = append(b, '{', '}', ',')
|
|
||||||
//}
|
|
||||||
code = code.end.next
|
code = code.end.next
|
||||||
} else {
|
} else {
|
||||||
b = append(b, '{')
|
b = append(b, '{')
|
||||||
|
|
Loading…
Reference in New Issue