| Index: pkg/http/lib/src/utils.dart
|
| diff --git a/pkg/http/lib/src/utils.dart b/pkg/http/lib/src/utils.dart
|
| index dd3547d54926e1c4ce7f09363084e58379405cd6..64c50c4269e0c0e9c6a09701c0f1ec7465811625 100644
|
| --- a/pkg/http/lib/src/utils.dart
|
| +++ b/pkg/http/lib/src/utils.dart
|
| @@ -107,17 +107,13 @@ final RegExp _ASCII_ONLY = new RegExp(r"^[\x00-\x7F]+$");
|
| /// characters.
|
| bool isPlainAscii(String string) => _ASCII_ONLY.hasMatch(string);
|
|
|
| -/// Converts [input] into a [Uint8List]. If [input] is a [TypedData], this just
|
| -/// returns a view on [input].
|
| +/// Converts [input] into a [Uint8List].
|
| +///
|
| +/// If [input] is a [TypedData], this just returns a view on [input].
|
| Uint8List toUint8List(List<int> input) {
|
| if (input is Uint8List) return input;
|
| - if (input is TypedData) {
|
| - // TODO(nweiz): remove this "as" check when issue 11080 is fixed.
|
| - return new Uint8List.view((input as TypedData).buffer);
|
| - }
|
| - var output = new Uint8List(input.length);
|
| - output.setRange(0, input.length, input);
|
| - return output;
|
| + if (input is TypedData) return new Uint8List.view(input.buffer);
|
| + return new Uint8List.fromList(input);
|
| }
|
|
|
| /// If [stream] is already a [ByteStream], returns it. Otherwise, wraps it in a
|
|
|