Skip to content

Commit

Permalink
fix: class signature of SortedMap
Browse files Browse the repository at this point in the history
  • Loading branch information
rbellens committed Feb 29, 2024
1 parent d8589ff commit 8d75bbc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
4 changes: 1 addition & 3 deletions lib/src/filteredmap.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ class FilteredMapView<K extends Comparable, V> extends MapBase<K, V>
@override
final Filter<K, V> filter;



/// Creates a FilteredMapView from a SortedMap.
FilteredMapView._(this._baseMap,
{required Pair start,
Expand Down Expand Up @@ -160,7 +158,7 @@ class FilteredMapView<K extends Comparable, V> extends MapBase<K, V>
}

@override
Iterable<MapEntry<K, V>> subentries(
Iterable<K> subkeys(
{required Pair start,
required Pair end,
int? limit,
Expand Down
19 changes: 9 additions & 10 deletions lib/src/sortedmap.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,6 @@ abstract class SortedMap<K extends Comparable, V> implements Map<K, V> {

/// Gets the keys within the desired bounds and limit.
Iterable<K> subkeys(
{required Pair start,
required Pair end,
int? limit,
bool reversed = false}) =>
subentries(start: start, end: end, limit: limit, reversed: reversed)
.map((v) => v.key);

/// Gets the entries within the desired bounds and limit.
Iterable<MapEntry<K, V>> subentries(
{required Pair start,
required Pair end,
int? limit,
Expand Down Expand Up @@ -282,7 +273,6 @@ class _SortedMap<K extends Comparable, V> extends MapBase<K, V>
return it.current.key;
}

@override
Iterable<MapEntry<K, V>> subentries(
{required Pair start,
required Pair end,
Expand All @@ -298,6 +288,15 @@ class _SortedMap<K extends Comparable, V> extends MapBase<K, V>
limitFromStart: !reversed);
return v;
}

@override
Iterable<K> subkeys(
{required Pair start,
required Pair end,
int? limit,
bool reversed = false}) =>
subentries(start: start, end: end, limit: limit, reversed: reversed)
.map((v) => v.key);
}

/// An unmodifiable sorted map.
Expand Down

0 comments on commit 8d75bbc

Please sign in to comment.