Index: sdk/lib/io/http_headers.dart |
diff --git a/sdk/lib/io/http_headers.dart b/sdk/lib/io/http_headers.dart |
index 0be5c080d6d68dfb09c2e29e4a6b2845a32b4065..85706d16d23f53e12a46ca3b939639d6e7e3e7c2 100644 |
--- a/sdk/lib/io/http_headers.dart |
+++ b/sdk/lib/io/http_headers.dart |
@@ -396,25 +396,31 @@ class _HttpHeaders implements HttpHeaders { |
} |
// Format headers. |
- _headers.forEach((String name, List<String> values) { |
+ for (String name in _headers.keys) { |
+ List<String> values = _headers[name]; |
bool fold = _foldHeader(name); |
var nameData = name.codeUnits; |
write(nameData); |
- write(const [_CharCode.COLON, _CharCode.SP]); |
+ buffer[offset++] = _CharCode.COLON; |
+ buffer[offset++] = _CharCode.SP; |
for (int i = 0; i < values.length; i++) { |
if (i > 0) { |
if (fold) { |
- write(const [_CharCode.COMMA, _CharCode.SP]); |
+ buffer[offset++] = _CharCode.COMMA; |
+ buffer[offset++] = _CharCode.SP; |
} else { |
- write(const [_CharCode.CR, _CharCode.LF]); |
+ buffer[offset++] = _CharCode.CR; |
+ buffer[offset++] = _CharCode.LF; |
write(nameData); |
- write(const [_CharCode.COLON, _CharCode.SP]); |
+ buffer[offset++] = _CharCode.COLON; |
+ buffer[offset++] = _CharCode.SP; |
} |
} |
write(values[i].codeUnits); |
} |
- write(const [_CharCode.CR, _CharCode.LF]); |
- }); |
+ buffer[offset++] = _CharCode.CR; |
+ buffer[offset++] = _CharCode.LF; |
+ } |
return offset; |
} |