summaryrefslogtreecommitdiff
path: root/internal/jsonstring/encode_string.go
diff options
context:
space:
mode:
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
}