mirror of https://github.com/goccy/go-json.git
Fix unnecessary recursive operation
This commit is contained in:
parent
92ed6c6d7e
commit
65d954de3e
|
@ -602,5 +602,12 @@ func (e *Encoder) compileStruct(typ *rtype, root, withIndent bool) (*opcode, err
|
||||||
code.next = structEndCode
|
code.next = structEndCode
|
||||||
ret := (*opcode)(unsafe.Pointer(head))
|
ret := (*opcode)(unsafe.Pointer(head))
|
||||||
compiled.code = ret
|
compiled.code = ret
|
||||||
|
|
||||||
|
if withIndent {
|
||||||
|
delete(e.structTypeToCompiledIndentCode, typeptr)
|
||||||
|
} else {
|
||||||
|
delete(e.structTypeToCompiledCode, typeptr)
|
||||||
|
}
|
||||||
|
|
||||||
return ret, nil
|
return ret, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue