Skip to content

Commit

Permalink
Fix some more issues in
Browse files Browse the repository at this point in the history
  • Loading branch information
renggli committed Jan 1, 2024
1 parent 53eec6d commit 3110b23
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions lib/src/interval/tree.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import 'dart:collection';

import 'package:collection/collection.dart' show QueueList;
import 'package:meta/meta.dart';

import '../functional/scope.dart';
import 'interval.dart';

/// Immutable [IntervalTree] that can hold arbitrary elements of type [V] with
Expand Down Expand Up @@ -68,9 +64,9 @@ class IntervalTree<K extends Comparable<K>, V> with Iterable<V> {
/// An [Iterable] over all values whose [Interval] intersects with [interval].
Iterable<V> queryInterval(Interval<K> interval) sync* {
if (_root == null) return;
final queue = QueueList<_IntervalTreeNode<K, V>>()..add(_root);
final queue = <_IntervalTreeNode<K, V>>[_root];
while (queue.isNotEmpty) {
final node = queue.removeFirst();
final node = queue.removeLast();
if (interval.upper.compareTo(node._median) < 0) {
for (final leftValue in node._leftValues) {
final valueInterval = getter(leftValue);
Expand Down
2 changes: 1 addition & 1 deletion test/interval_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ void main() {
stress('very small intervals in large range',
count: 500, range: 1000000, size: 10);
stress('very large intervals in large range',
count: 500, range: 1000000, size: 100000);
count: 500, range: 1000000, size: 1000000);
});
});
}

0 comments on commit 3110b23

Please sign in to comment.