Skip to content

Commit

Permalink
Don't have private methods that don't benefit from being extension me…
Browse files Browse the repository at this point in the history
…thods

marked as such.
  • Loading branch information
JonHanna committed Jul 12, 2015
1 parent e505443 commit b4ddff0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/System.Linq/src/System/Linq/Enumerable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2630,7 +2630,7 @@ public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TS
return DistinctIterator<TSource, TKey>(source, keySelector, comparer);
}

private static IEnumerable<TSource> DistinctIterator<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer)
private static IEnumerable<TSource> DistinctIterator<TSource, TKey>(IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer)
{
Set<TKey> set = new Set<TKey>(comparer);
foreach (TSource element in source)
Expand All @@ -2647,7 +2647,7 @@ public static IEnumerable<IGrouping<int, TSource>> Chunk<TSource>(this IEnumerab
return asList != null ? ChunkListIterator(asList, size) : ChunkIterator<TSource>(source, size);
}

private static IEnumerable<IGrouping<int, TSource>> ChunkIterator<TSource>(this IEnumerable<TSource> source, int size)
private static IEnumerable<IGrouping<int, TSource>> ChunkIterator<TSource>(IEnumerable<TSource> source, int size)
{
using(IEnumerator<TSource> e = source.GetEnumerator())
{
Expand All @@ -2661,7 +2661,7 @@ private static IEnumerable<IGrouping<int, TSource>> ChunkIterator<TSource>(this
}
}

private static IEnumerable<IGrouping<int, TSource>> ChunkListIterator<TSource>(this IList<TSource> source, int size)
private static IEnumerable<IGrouping<int, TSource>> ChunkListIterator<TSource>(IList<TSource> source, int size)
{
for(int i = 0; i * size < source.Count; ++i) yield return new ListChunk<TSource>(i, size, source);
}
Expand Down Expand Up @@ -2783,7 +2783,7 @@ public static IEnumerable<TSource> IntersectBy<TSource, TKey>(this IEnumerable<T
return IntersectBy(source1, source2, keySelector, null);
}

private static IEnumerable<TSource> IntersectByIterator<TSource, TKey>(this IEnumerable<TSource> source1, IEnumerable<TSource> source2, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer)
private static IEnumerable<TSource> IntersectByIterator<TSource, TKey>(IEnumerable<TSource> source1, IEnumerable<TSource> source2, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer)
{
Dictionary<TKey, TSource> fromFirst = new Dictionary<TKey, TSource>(comparer);
// We don't use ToDictionary() as that throws on repeated keys while we wish to discard on them.
Expand Down

0 comments on commit b4ddff0

Please sign in to comment.