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

Unified Diff: lib/src/priority_queue.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/algorithms.dart ('k') | lib/src/utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/priority_queue.dart
diff --git a/lib/src/priority_queue.dart b/lib/src/priority_queue.dart
index de91f15c7616451524a907ebfbb7e80d43700451..e0f65b4d9d69df155e7cdb083590c8493ba118f1 100644
--- a/lib/src/priority_queue.dart
+++ b/lib/src/priority_queue.dart
@@ -4,6 +4,8 @@
import "dart:collection";
+import "utils.dart";
+
/// A priority queue is a priority based work-list of elements.
///
/// The queue allows adding elements, and removing them again in priority order.
@@ -143,8 +145,7 @@ class HeapPriorityQueue<E> implements PriorityQueue<E> {
/// is the case, `E` must implement [Comparable], and this is checked at
/// runtime for every comparison.
HeapPriorityQueue([int comparison(E e1, E e2)])
- : comparison = comparison ??
- ((e1, e2) => (e1 as Comparable).compareTo(e2));
+ : comparison = comparison ?? defaultCompare/*<E>*/();
void add(E element) {
_add(element);
« no previous file with comments | « lib/src/algorithms.dart ('k') | lib/src/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698