Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Unified Diff: sdk/lib/convert/byte_conversion.dart

Issue 499073003: Use Uint8List for byte lists in dart:convert. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/convert/ascii.dart ('k') | sdk/lib/convert/utf.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/convert/byte_conversion.dart
diff --git a/sdk/lib/convert/byte_conversion.dart b/sdk/lib/convert/byte_conversion.dart
index bb94991fefc9aee9498a1c4aaf75fb80bc338152..d27b40fcf89bba5b2cb4ee34e39bfe4dc0f045c4 100644
--- a/sdk/lib/convert/byte_conversion.dart
+++ b/sdk/lib/convert/byte_conversion.dart
@@ -78,8 +78,7 @@ class _ByteCallbackSink extends ByteConversionSinkBase {
static const _INITIAL_BUFFER_SIZE = 1024;
final _ChunkedConversionCallback<List<int>> _callback;
- // TODO(11971, floitsch): use Uint8List instead of normal lists.
- List<int> _buffer = new List<int>(_INITIAL_BUFFER_SIZE);
+ List<int> _buffer = new Uint8List(_INITIAL_BUFFER_SIZE);
int _bufferIndex = 0;
_ByteCallbackSink(void callback(List<int> accumulated))
@@ -91,8 +90,7 @@ class _ByteCallbackSink extends ByteConversionSinkBase {
// Grow the buffer.
int oldLength = _buffer.length;
int newLength = _roundToPowerOf2(chunk.length + oldLength) * 2;
- // TODO(11971, floitsch): use Uint8List instead of normal lists.
- List<int> grown = new List<int>(newLength);
+ List<int> grown = new Uint8List(newLength);
grown.setRange(0, _buffer.length, _buffer);
_buffer = grown;
}
« no previous file with comments | « sdk/lib/convert/ascii.dart ('k') | sdk/lib/convert/utf.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698