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

Unified Diff: runtime/lib/array.dart

Issue 11269004: Change List.sort to not have a default parameter value. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reverted used of ?compare Created 8 years 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 | runtime/lib/byte_array.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/array.dart
diff --git a/runtime/lib/array.dart b/runtime/lib/array.dart
index 5bef0d0db28ec84e79e2c396c37e0822799c5a66..e63af507ca8090efd78afc038cc60d47ca3de902 100644
--- a/runtime/lib/array.dart
+++ b/runtime/lib/array.dart
@@ -92,7 +92,8 @@ class _ObjectArray<E> implements List<E> {
return this.length == 0;
}
- void sort([Comparator<E> compare = Comparable.compare]) {
+ void sort([int compare(E a, E b)]) {
+ if (compare == null) compare = Comparable.compare;
_Sort.sort(this, compare);
}
@@ -238,7 +239,7 @@ class _ImmutableArray<E> implements List<E> {
return this.length == 0;
}
- void sort([Comparator<E> compare]) {
+ void sort([int compare(E a, E b)]) {
throw new UnsupportedError(
"Cannot modify an immutable array");
}
« no previous file with comments | « no previous file | runtime/lib/byte_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698