CL 150417 was submitted before I could recommend this change to remove
an unnecessary allocation.
Updates #28849
Change-Id: I4cd655f62bb3d00eda6c997f074785385bceee0c
Reviewed-on: https://go-review.googlesource.com/c/150498
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
b.WriteByte('"')
offset := 0
- for index, character := range []byte(value) {
+ for index := 0; index < len(value); index++ {
+ character := value[index]
if character == '"' || character == '\\' {
b.WriteString(value[offset:index])
offset = index