summaryrefslogtreecommitdiff
path: root/internal/jsonstring/encode_string.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-02-16 22:56:11 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-02-16 22:56:11 -0700
commit6f8e7db1ac5ddd21b8e3fcc39a1e30fde9b62c3a (patch)
tree8f0247b646291577f54f7d164b7fed675388c72c /internal/jsonstring/encode_string.go
parentdebef01cc500fb9368e1d6d0206a32ca358a8c98 (diff)
parent0d23080e1f2af81d8d4656c3b72791b26f52f361 (diff)
Merge branch 'lukeshu/perf'
Diffstat (limited to 'internal/jsonstring/encode_string.go')
-rw-r--r--internal/jsonstring/encode_string.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/jsonstring/encode_string.go b/internal/jsonstring/encode_string.go
index 1b0c68a..fec2cc0 100644
--- a/internal/jsonstring/encode_string.go
+++ b/internal/jsonstring/encode_string.go
@@ -10,6 +10,7 @@ import (
"unicode/utf8"
"git.lukeshu.com/go/lowmemjson/internal/fastio"
+ "git.lukeshu.com/go/lowmemjson/internal/fastio/noescape"
)
// BackslashEscapeMode is describe in the main lowmemjson package
@@ -35,7 +36,7 @@ func writeStringUnicodeEscape(w io.Writer, c rune) error {
alphabet[(c>>4)&0xf],
alphabet[(c>>0)&0xf],
}
- _, err := w.Write(buf[:])
+ _, err := noescape.Write(w, buf[:])
return err
}
@@ -58,7 +59,7 @@ func writeStringShortEscape(w io.Writer, c rune) error {
panic(fmt.Errorf("should not happen: writeStringShortEscape called with invalid rune: %q", c))
}
buf := [2]byte{'\\', b}
- _, err := w.Write(buf[:])
+ _, err := noescape.Write(w, buf[:])
return err
}