mirror of https://github.com/goccy/go-json.git
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
|
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