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

Unified Diff: lib/src/utils.dart

Issue 1836163002: Fix algorithm generics. (Closed) Base URL: git@github.com:dart-lang/collection@master
Patch Set: Code review changes Created 4 years, 9 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 | « lib/src/priority_queue.dart ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/utils.dart
diff --git a/lib/src/utils.dart b/lib/src/utils.dart
index 51a80b27100940381cba3779bf63594fdb3dc86c..abfb494773b32049bc759ea9bc99f276c3ca7f12 100644
--- a/lib/src/utils.dart
+++ b/lib/src/utils.dart
@@ -9,3 +9,7 @@ class Pair<E, F> {
Pair(this.first, this.last);
}
+
+/// Returns a [Comparator] that asserts that its first argument is comparable.
+Comparator/*<T>*/ defaultCompare/*<T>*/() =>
+ (value1, value2) => (value1 as Comparable).compareTo(value2);
« no previous file with comments | « lib/src/priority_queue.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698