This class enhances LINQ-to-Objects with extension methods that preserve the interface (e.g. Take(IList<int>) returns a struct that implements IList<int>) or have higher performance than the ones in System.Linq.Enumerable.
More...
This class enhances LINQ-to-Objects with extension methods that preserve the interface (e.g. Take(IList<int>) returns a struct that implements IList<int>) or have higher performance than the ones in System.Linq.Enumerable.
Helpful article: http://core.loyc.net/essentials/linq-to-lists.html
For example, the Enumerable.Last<T> extension method scans the entire list before returning the last item, while Last<T>(IReadOnlyList<T>) and Last<T>(IList<T>) simply return the last item directly.
|
static int | Count< T > (this IReadOnlyCollection< T > list) |
|
static int | Count< T > (this INegListSource< T > list) |
|
static T | FirstOrDefault< T > (this IListSource< T > list) |
|
static T | FirstOrDefault< T > (this IListSource< T > list, T defaultValue) |
|
static T | Last< T > (this IReadOnlyList< T > list) |
| Gets the last item from the list (at list.Max ). More...
|
|
static T | LastOrDefault< T > (this IReadOnlyList< T > list, T defaultValue=default(T)) |
| Gets the last item from the list (Count - 1), or defaultValue if the list is empty. More...
|
|
static T | Last< T > (this IListAndListSource< T > list) |
|
static T | Last< T > (this INegListSource< T > list) |
| Gets the last item from the list (at list.Max ). More...
|
|
static T | LastOrDefault< T > (this INegListSource< T > list, T defaultValue=default(T)) |
| Gets the last item from the list (at list.Max ), or defaultValue if the list is empty. More...
|
|
static Slice_< T > | Skip< T > (this IListSource< T > list, int start) |
| Skips the specified number of elements immediately and returns a slice of part of the list that remains, or an empty slice if start is greater than or equal to the list.Count . More...
|
|
static Slice_< T > | Take< T > (this IListSource< T > list, int count) |
| Returns a slice of the specified number of elements from the beginning of the list, or a slice of the entire list if count is greater than or equal to the list.Count . More...
|
|
static ListSlice< T > | Skip< T > (this IListAndListSource< T > list, int start) |
| Skips the specified number of elements immediately and returns a slice of part of the list that remains, or an empty slice if start is greater than or equal to the list.Count . More...
|
|
static ListSlice< T > | Take< T > (this IListAndListSource< T > list, int count) |
| Returns a slice of the specified number of elements from the beginning of the list, or a slice of the entire list if count is greater than or equal to the list.Count . More...
|
|
static NegListSlice< T > | Skip< T > (this INegListSource< T > list, int count) |
|
static NegListSlice< T > | Take< T > (this INegListSource< T > list, int count) |
|
static Slice_< T > | TakeNowWhile< T > (this IListSource< T > list, Func< T, bool > predicate) |
| Returns a slice of the initial elements of the list that meet the provided criteria. The word "now" is added to the name because unlike Enumerable.TakeWhile, this method scans the list immediately. More...
|
|
static Slice_< T > | SkipNowWhile< T > (this IListSource< T > list, Func< T, bool > predicate) |
| Returns a slice without the initial elements of the list that meet the specified criteria. The word "now" is added to the name because unlike Enumerable.SkipWhile, this method scans the list immediately. More...
|
|
static NegListSlice< T > | TakeNowWhile< T > (this INegListSource< T > list, Func< T, bool > predicate) |
| Returns a slice of the initial elements of the list that meet the provided criteria. The word "now" is added to the name because unlike Enumerable.TakeWhile, this method scans the list immediately. More...
|
|
static NegListSlice< T > | SkipNowWhile< T > (this INegListSource< T > list, Func< T, bool > predicate) |
| Returns a slice without the initial elements of the list that meet the specified criteria. The word "now" is added to the name because unlike Enumerable.SkipWhile, this method scans the list immediately. More...
|
|
static T[] | ToArray< T > (this IReadOnlyList< T > c) |
| Copies the contents of a list to an array. More...
|
|
static T[] | ToArray< T > (this IListAndListSource< T > c) |
|
static T[] | ToArray< T > (this INegListSource< T > c) |
| Copies the contents of an INegListSource<T> to an array. More...
|
|
static SelectListSource< IListSource< T >, T, TResult > | Select< T, TResult > (this IListSource< T > source, Func< T, TResult > selector) |
|
static SelectReadOnlyList< IReadOnlyList< T >, T, TResult > | Select< T, TResult > (this IReadOnlyList< T > list, Func< T, TResult > selector) |
|
static SelectReadOnlyCollection< IReadOnlyCollection< T >, T, TResult > | Select< T, TResult > (this IReadOnlyCollection< T > list, Func< T, TResult > selector) |
|
static T[] | ConcatNow< T > (this T[] a, T[] b) |
|
static T[] | ConcatNow< T > (this IReadOnlyList< T > a, IReadOnlyList< T > b) |
|
static ReversedListSource< T > | Reverse< T > (this IListSource< T > c) |
| Returns a reversed view of a read-only list. More...
|
|
static ReversedList< T > | Reverse< T > (this IList< T > list) |
| Returns an editable reversed view of a list. More...
|
|
static ReversedList< T > | Reverse< T > (this IListAndListSource< T > list) |
|
static bool | SequenceEqual< TSource > (this IReadOnlyCollection< TSource > first, IReadOnlyCollection< TSource > second) |
|