forked from mirror/go-json
Remove unused arguments
This commit is contained in:
parent
3a3122c286
commit
f297c99af1
|
@ -165,8 +165,7 @@ func (e *Encoder) encode(v interface{}) error {
|
|||
ctx := codeSet.ctx.Get().(*encodeRuntimeContext)
|
||||
p := uintptr(header.ptr)
|
||||
ctx.init(p)
|
||||
seenPtr := map[uintptr]struct{}{}
|
||||
err := e.run(ctx, 0, seenPtr, code)
|
||||
err := e.run(ctx, code)
|
||||
codeSet.ctx.Put(ctx)
|
||||
return err
|
||||
}
|
||||
|
@ -214,8 +213,7 @@ func (e *Encoder) encode(v interface{}) error {
|
|||
c = code
|
||||
}
|
||||
|
||||
seenPtr := map[uintptr]struct{}{}
|
||||
if err := e.run(ctx, 0, seenPtr, c); err != nil {
|
||||
if err := e.run(ctx, c); err != nil {
|
||||
codeSet.ctx.Put(ctx)
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -21,9 +21,12 @@ func store(base uintptr, idx uintptr, p uintptr) {
|
|||
*(*uintptr)(unsafe.Pointer(base + idx)) = p
|
||||
}
|
||||
|
||||
func (e *Encoder) run(ctx *encodeRuntimeContext, recursiveLevel int, seenPtr map[uintptr]struct{}, code *opcode) error {
|
||||
func (e *Encoder) run(ctx *encodeRuntimeContext, code *opcode) error {
|
||||
recursiveLevel := 0
|
||||
seenPtr := map[uintptr]struct{}{}
|
||||
ptrOffset := uintptr(0)
|
||||
ctxptr := ctx.ptr()
|
||||
|
||||
for {
|
||||
switch code.op {
|
||||
case opPtr:
|
||||
|
|
Loading…
Reference in New Issue