go/src/unicode
qmuntal 48297f1fb1 unicode/utf16: add AppendRune
AppendRune appends the UTF-16 encoding of a rune to a []uint16.

    BenchmarkEncodeValidASCII-12                24.61ns 16B 1allocs
    BenchmarkEncodeValidJapaneseChars-12        18.79ns 8B  1allocs
    BenchmarkAppendRuneValidASCII-12            6.826ns 0B  0allocs
    BenchmarkAppendRuneValidJapaneseChars-12    3.547ns 0B  0allocs

The ASCII case is written to be inlineable.

Fixes #51896

Change-Id: I593b1029f603297ef6e80e036f2fee2a0938d38d
Reviewed-on: https://go-review.googlesource.com/c/go/+/409054
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Joedian Reid <joedian@golang.org>
2022-08-19 16:45:08 +00:00
..
utf8
utf16 unicode/utf16: add AppendRune 2022-08-19 16:45:08 +00:00
casetables.go
digit.go
digit_test.go
example_test.go
graphic.go all: gofmt main repo 2022-04-11 16:34:30 +00:00
graphic_test.go
letter.go all: gofmt main repo 2022-04-11 16:34:30 +00:00
letter_test.go
script_test.go
tables.go