Index: runtime/lib/array.dart |
=================================================================== |
--- runtime/lib/array.dart (revision 942) |
+++ runtime/lib/array.dart (working copy) |
@@ -116,12 +116,13 @@ |
DualPivotQuicksort.sort(this, compare); |
} |
- int indexOf(T element, int startIndex) { |
- return Arrays.indexOf(this, element, startIndex, this.length); |
+ int indexOf(T element, [int start = 0]) { |
+ return Arrays.indexOf(this, element, start, this.length); |
} |
- int lastIndexOf(T element, int startIndex) { |
- return Arrays.lastIndexOf(this, element, startIndex); |
+ int lastIndexOf(T element, [int start = null]) { |
+ if (start === null) start = length - 1; |
+ return Arrays.lastIndexOf(this, element, start); |
} |
Iterator<T> iterator() { |
@@ -243,12 +244,13 @@ |
return "ImmutableArray"; |
} |
- int indexOf(T element, int startIndex) { |
- return Arrays.indexOf(this, element, startIndex, this.length); |
+ int indexOf(T element, [int start = 0]) { |
+ return Arrays.indexOf(this, element, start, this.length); |
} |
- int lastIndexOf(T element, int startIndex) { |
- return Arrays.lastIndexOf(this, element, startIndex); |
+ int lastIndexOf(T element, [int start = null]) { |
+ if (start === null) start = length - 1; |
+ return Arrays.lastIndexOf(this, element, start); |
} |
Iterator<T> iterator() { |