Skip to content

Commit

Permalink
+ make toSet only implementational detail
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Ivičič committed Feb 9, 2024
1 parent 3d3618c commit d9b0e8b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import 'package:collection/collection.dart';
typedef Selector<T, K> = K Function(T selectFrom);

extension IterableExtensions<T> on Iterable<T> {
Set<T> distinct() {
Iterable<T> distinct() {
return toSet();
}

/// Returns an iterable containing only elements from the given collection having distinct keys returned by the given [selector] function.
/// Returns an iterable containing only elements from the given collection having distinct keys returned by the given [selector] function.
/// If multiple elements have the same key, first element is returned.
Iterable<T> distinctBy<K>(Selector<T, K> selector) {
return groupBy<T, K>(this, selector)
Expand Down

0 comments on commit d9b0e8b

Please sign in to comment.