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

Unified Diff: sdk/lib/io/bytes_builder.dart

Issue 1974043002: Revert "Fix remaining strong-mode warnings and errors in dart:io." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | sdk/lib/io/common.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/bytes_builder.dart
diff --git a/sdk/lib/io/bytes_builder.dart b/sdk/lib/io/bytes_builder.dart
index 684e27da93e199792aa781a6ac3a2e716726d333..a4b611fc505c9f386dc55adb45420398d62e08df 100644
--- a/sdk/lib/io/bytes_builder.dart
+++ b/sdk/lib/io/bytes_builder.dart
@@ -153,17 +153,14 @@ class _CopyingBytesBuilder implements BytesBuilder {
class _BytesBuilder implements BytesBuilder {
int _length = 0;
- final List<Uint8List> _chunks = [];
+ final _chunks = <List<int>>[];
void add(List<int> bytes) {
- Uint8List typedBytes;
- if (bytes is Uint8List) {
- typedBytes = bytes;
- } else {
+ if (bytes is! Uint8List) {
bytes = new Uint8List.fromList(bytes);
}
- _chunks.add(typedBytes);
- _length += typedBytes.length;
+ _chunks.add(bytes);
+ _length += bytes.length;
}
void addByte(int byte) { add([byte]); }
« no previous file with comments | « no previous file | sdk/lib/io/common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698