forked from mirror/go-json
Use NoEscapedString
This commit is contained in:
parent
af9168203a
commit
135a3c0cfb
10
encode_vm.go
10
encode_vm.go
|
@ -301,11 +301,7 @@ func (e *Encoder) run(ctx *encodeRuntimeContext, b []byte, code *opcode) ([]byte
|
|||
if err != nil {
|
||||
return nil, errMarshaler(code, err)
|
||||
}
|
||||
if e.enabledHTMLEscape {
|
||||
b = encodeEscapedString(b, *(*string)(unsafe.Pointer(&bytes)))
|
||||
} else {
|
||||
b = encodeNoEscapedString(b, *(*string)(unsafe.Pointer(&bytes)))
|
||||
}
|
||||
b = encodeNoEscapedString(b, *(*string)(unsafe.Pointer(&bytes)))
|
||||
b = encodeComma(b)
|
||||
}
|
||||
code = code.next
|
||||
|
@ -3501,7 +3497,7 @@ func (e *Encoder) run(ctx *encodeRuntimeContext, b []byte, code *opcode) ([]byte
|
|||
}
|
||||
}
|
||||
b = append(b, code.key...)
|
||||
b = encodeEscapedString(b, *(*string)(unsafe.Pointer(&bytes)))
|
||||
b = encodeNoEscapedString(b, *(*string)(unsafe.Pointer(&bytes)))
|
||||
b = encodeComma(b)
|
||||
code = code.next
|
||||
}
|
||||
|
@ -3532,7 +3528,7 @@ func (e *Encoder) run(ctx *encodeRuntimeContext, b []byte, code *opcode) ([]byte
|
|||
}
|
||||
}
|
||||
b = append(b, code.key...)
|
||||
b = encodeEscapedString(b, *(*string)(unsafe.Pointer(&bytes)))
|
||||
b = encodeNoEscapedString(b, *(*string)(unsafe.Pointer(&bytes)))
|
||||
b = encodeComma(b)
|
||||
code = code.next
|
||||
}
|
||||
|
|
|
@ -4165,7 +4165,7 @@ func (e *Encoder) runIndent(ctx *encodeRuntimeContext, b []byte, code *opcode) (
|
|||
if err := compact(&buf, bb, e.enabledHTMLEscape); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b = encodeEscapedString(b, buf.String())
|
||||
b = encodeNoEscapedString(b, buf.String())
|
||||
b = encodeIndentComma(b)
|
||||
code = code.next
|
||||
case opStructFieldStringTagMarshalText:
|
||||
|
|
Loading…
Reference in New Issue