Commit aadffd5b authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

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/150498Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 9ef14553
......@@ -56,7 +56,8 @@ func FormatMediaType(t string, param map[string]string) string {
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment