Skip to content

Commit de82dbd

Browse files
author
Kz Ho
committed
Fix Stream.WriteString's fast path condition
1 parent 71ac162 commit de82dbd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stream_str.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ func (stream *Stream) WriteString(s string) {
315315
i := 0
316316
for ; i < valLen; i++ {
317317
c := s[i]
318-
if c > 31 && c != '"' && c != '\\' {
318+
if c < utf8.RuneSelf && safeSet[c] {
319319
stream.buf = append(stream.buf, c)
320320
} else {
321321
break

0 commit comments

Comments
 (0)