| Index: runtime/lib/array_patch.dart
|
| diff --git a/runtime/lib/array_patch.dart b/runtime/lib/array_patch.dart
|
| index c0ddfeec1c35bdde3963c3b31b4d8107b0650c84..94f29f195fc3404ab3a461577fd72bd8a3ee030e 100644
|
| --- a/runtime/lib/array_patch.dart
|
| +++ b/runtime/lib/array_patch.dart
|
| @@ -36,8 +36,10 @@ patch class List<E> {
|
| if (elements is EfficientLength) {
|
| int length = elements.length;
|
| var list = growable ? new _GrowableList<E>(length) : new _List<E>(length);
|
| - int i = 0;
|
| - for (var element in elements) { list[i++] = element; }
|
| + if (length > 0) { // Avoid creating iterator unless necessary.
|
| + int i = 0;
|
| + for (var element in elements) { list[i++] = element; }
|
| + }
|
| return list;
|
| }
|
| List<E> list = new _GrowableList<E>(0);
|
| @@ -47,7 +49,7 @@ patch class List<E> {
|
| if (growable) return list;
|
| if (list.length == 0) {
|
| // Avoid getting an immutable list from makeListFixedLength.
|
| - return new List<E>(0);
|
| + return new _List<E>(0);
|
| }
|
| return makeListFixedLength(list);
|
| }
|
|
|