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

Unified Diff: sdk/lib/internal/sort.dart

Issue 2529393002: Make core libraries use generic method syntax. (Closed)
Patch Set: Update status files. Created 3 years, 12 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 | « sdk/lib/internal/iterable.dart ('k') | sdk/lib/io/file_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/internal/sort.dart
diff --git a/sdk/lib/internal/sort.dart b/sdk/lib/internal/sort.dart
index 63037ea4d6388bad057aec257d0db30247540ddc..40a7d0957323cba9552329a75db968ccd7833528 100644
--- a/sdk/lib/internal/sort.dart
+++ b/sdk/lib/internal/sort.dart
@@ -29,7 +29,7 @@ class Sort {
* The function's behavior must be consistent. It must not return different
* results for the same values.
*/
- static void sort/*<E>*/(List/*<E>*/ a, int compare(dynamic /*=E*/ a, dynamic /*=E*/ b)) {
+ static void sort<E>(List<E> a, int compare(E a, E b)) {
_doSort(a, 0, a.length - 1, compare);
}
@@ -42,7 +42,7 @@ class Sort {
*
* See [:sort:] for requirements of the [:compare:] function.
*/
- static void sortRange/*<E>*/(List/*<E>*/ a, int from, int to, int compare(dynamic /*=E*/ a, dynamic /*=E*/ b)) {
+ static void sortRange<E>(List<E> a, int from, int to, int compare(E a, E b)) {
if ((from < 0) || (to > a.length) || (to < from)) {
throw "OutOfRange";
}
@@ -52,7 +52,8 @@ class Sort {
/**
* Sorts the list in the interval [:left:] to [:right:] (both inclusive).
*/
- static void _doSort/*<E>*/(List/*<E>*/ a, int left, int right, int compare(dynamic /*=E*/ a, dynamic /*=E*/ b)) {
+ static void _doSort<E>(List<E> a, int left, int right,
+ int compare(E a, E b)) {
if ((right - left) <= _INSERTION_SORT_THRESHOLD) {
_insertionSort(a, left, right, compare);
} else {
@@ -60,7 +61,8 @@ class Sort {
}
}
- static void _insertionSort/*<E>*/(List/*<E>*/ a, int left, int right, int compare(dynamic /*=E*/ a, dynamic /*=E*/ b)) {
+ static void _insertionSort<E>(List<E> a, int left, int right,
+ int compare(E a, E b)) {
for (int i = left + 1; i <= right; i++) {
var el = a[i];
int j = i;
@@ -72,9 +74,8 @@ class Sort {
}
}
- static void _dualPivotQuicksort/*<E>*/(List/*<E>*/ a,
- int left, int right,
- int compare(dynamic /*=E*/ a, dynamic /*=E*/ b)) {
+ static void _dualPivotQuicksort<E>(List<E> a, int left, int right,
+ int compare(E a, E b)) {
assert(right - left > _INSERTION_SORT_THRESHOLD);
// Compute the two pivots by looking at 5 elements.
« no previous file with comments | « sdk/lib/internal/iterable.dart ('k') | sdk/lib/io/file_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698