Skip to content

Commit b4bc1c8

Browse files
symbiogenesisEdward Miller
andauthored
Remove unused functions (dotnet#20029)
Co-authored-by: Edward Miller <symbiogenisis@outlook.com>
1 parent c02195d commit b4bc1c8

1 file changed

Lines changed: 0 additions & 46 deletions

File tree

src/Core/src/Extensions/EnumerableExtensions.cs

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,6 @@ public static void ForEach<T>(this IEnumerable<T> enumeration, Action<T> action)
2020
}
2121
}
2222

23-
/// <summary>
24-
///
25-
/// </summary>
26-
/// <typeparam name="TSource"></typeparam>
27-
/// <typeparam name="TKey"></typeparam>
28-
/// <param name="enumeration"></param>
29-
/// <param name="func"></param>
30-
/// <returns></returns>
31-
public static IDictionary<TKey, List<TSource>> GroupToDictionary<TSource, TKey>(this IEnumerable<TSource> enumeration, Func<TSource, TKey> func)
32-
where TKey : notnull
33-
{
34-
var result = new Dictionary<TKey, List<TSource>>();
35-
foreach (TSource item in enumeration)
36-
{
37-
var group = func(item);
38-
if (!result.ContainsKey(group))
39-
result.Add(group, new List<TSource> { item });
40-
else
41-
result[group].Add(item);
42-
}
43-
return result;
44-
}
45-
4623
/// <summary>
4724
/// Find the index of a specific item within the collection.
4825
/// </summary>
@@ -74,29 +51,6 @@ public static int IndexOf<T>(this IEnumerable<T> enumerable, T item)
7451
return -1;
7552
}
7653

77-
/// <summary>
78-
/// Find the index for the first occurrence of an item within the collection as matched through the specified predicate.
79-
/// </summary>
80-
/// <typeparam name="T">The type of object contained in this collection.</typeparam>
81-
/// <param name="enumerable">The collection in which to look for the item.</param>
82-
/// <param name="predicate">The predicate used to evaluate each item and see if it matches.
83-
/// The item currently evaluated of type <typeparamref name="T"/> is provided as an input parameter.
84-
/// The resulting value should be a <see cref="bool"/> which is <see langword="true"/> if this is the item to match, otherwise <see langword="false"/>.</param>
85-
/// <returns>The index of the first item to match through <paramref name="predicate"/> in the collection or -1 when no match is not found.</returns>
86-
public static int IndexOf<T>(this IEnumerable<T> enumerable, Func<T, bool> predicate)
87-
{
88-
var i = 0;
89-
foreach (T element in enumerable)
90-
{
91-
if (predicate(element))
92-
return i;
93-
94-
i++;
95-
}
96-
97-
return -1;
98-
}
99-
10054
/// <summary>
10155
/// Retrieves the last item from a <see cref="IList{T}"/> instance.
10256
/// </summary>

0 commit comments

Comments
 (0)