Merge pull request #26 from goccy/feature/fix-unnecessary-recursive-call

Fix unnecessary recursive operation
This commit is contained in:
Masaaki Goshima 2020-08-15 21:15:06 +09:00 committed by GitHub
commit 10515c6e21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -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
}