Skip to content

Commit aadffd5

Browse files
committed
mime: remove allocation introduced in recent fix
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 <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 9ef1455 commit aadffd5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/mime/mediatype.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ func FormatMediaType(t string, param map[string]string) string {
5656

5757
b.WriteByte('"')
5858
offset := 0
59-
for index, character := range []byte(value) {
59+
for index := 0; index < len(value); index++ {
60+
character := value[index]
6061
if character == '"' || character == '\\' {
6162
b.WriteString(value[offset:index])
6263
offset = index

0 commit comments

Comments
 (0)