Index: sdk/lib/io/buffer_list.dart |
diff --git a/sdk/lib/io/buffer_list.dart b/sdk/lib/io/buffer_list.dart |
index 25a4fdd6102ffadf8d692f70e6fc6daf9f788f31..72dc92ff03d07d284b786402aab448d8bfe9c406 100644 |
--- a/sdk/lib/io/buffer_list.dart |
+++ b/sdk/lib/io/buffer_list.dart |
@@ -94,19 +94,15 @@ class _BufferList { |
while (remaining > 0) { |
int bytesInFirst = _buffers.first.length - _index; |
if (bytesInFirst <= remaining) { |
- result.setRange(count - remaining, |
- bytesInFirst, |
- _buffers.first, |
- _index); |
+ int startIndex = count - remaining; |
+ int endIndex = startIndex + bytesInFirst; |
+ result.setRange(startIndex, endIndex, _buffers.first, _index); |
_buffers.removeFirst(); |
_index = 0; |
_length -= bytesInFirst; |
remaining -= bytesInFirst; |
} else { |
- result.setRange(count - remaining, |
- remaining, |
- _buffers.first, |
- _index); |
+ result.setRange(count - remaining, count, _buffers.first, _index); |
_index = remaining; |
_length -= remaining; |
remaining = 0; |