aboutsummaryrefslogtreecommitdiff
path: root/src/encoding
diff options
context:
space:
mode:
Diffstat (limited to 'src/encoding')
-rw-r--r--src/encoding/json/encode.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/encoding/json/encode.go b/src/encoding/json/encode.go
index 0371f0a24d..141b23c6c6 100644
--- a/src/encoding/json/encode.go
+++ b/src/encoding/json/encode.go
@@ -871,8 +871,7 @@ func (w *reflectWithString) resolve() error {
}
// NOTE: keep in sync with stringBytes below.
-func (e *encodeState) string(s string, escapeHTML bool) int {
- len0 := e.Len()
+func (e *encodeState) string(s string, escapeHTML bool) {
e.WriteByte('"')
start := 0
for i := 0; i < len(s); {
@@ -944,12 +943,10 @@ func (e *encodeState) string(s string, escapeHTML bool) int {
e.WriteString(s[start:])
}
e.WriteByte('"')
- return e.Len() - len0
}
// NOTE: keep in sync with string above.
-func (e *encodeState) stringBytes(s []byte, escapeHTML bool) int {
- len0 := e.Len()
+func (e *encodeState) stringBytes(s []byte, escapeHTML bool) {
e.WriteByte('"')
start := 0
for i := 0; i < len(s); {
@@ -1021,7 +1018,6 @@ func (e *encodeState) stringBytes(s []byte, escapeHTML bool) int {
e.Write(s[start:])
}
e.WriteByte('"')
- return e.Len() - len0
}
// A field represents a single field found in a struct.