MCPcopy Index your code
hub / github.com/dop251/goja / writeRuneFast

Method writeRuneFast

string_unicode.go:185–196  ·  view source on GitHub ↗

assumes already started

(r rune)

Source from the content-addressed store, hash-verified

183
184// assumes already started
185func (b *unicodeStringBuilder) writeRuneFast(r rune) {
186 if r <= 0xFFFF {
187 b.buf = append(b.buf, uint16(r))
188 if !b.unicode && r >= utf8.RuneSelf {
189 b.unicode = true
190 }
191 } else {
192 first, second := utf16.EncodeRune(r)
193 b.buf = append(b.buf, uint16(first), uint16(second))
194 b.unicode = true
195 }
196}
197
198func (b *unicodeStringBuilder) writeASCIIString(bytes string) {
199 for _, c := range bytes {

Callers 3

WriteRuneMethod · 0.95
WriteUTF8StringMethod · 0.80
WriteRuneMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected