forked from mirror/go-json
Merge pull request #26 from goccy/feature/fix-unnecessary-recursive-call
Fix unnecessary recursive operation
This commit is contained in:
commit
10515c6e21
|
@ -602,5 +602,12 @@ func (e *Encoder) compileStruct(typ *rtype, root, withIndent bool) (*opcode, err
|
|||
code.next = structEndCode
|
||||
ret := (*opcode)(unsafe.Pointer(head))
|
||||
compiled.code = ret
|
||||
|
||||
if withIndent {
|
||||
delete(e.structTypeToCompiledIndentCode, typeptr)
|
||||
} else {
|
||||
delete(e.structTypeToCompiledCode, typeptr)
|
||||
}
|
||||
|
||||
return ret, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue