Skip to content

Commit 3010c01

Browse files
committed
Merge branch 'master' of https://github.com/rsdn/CodeJam
2 parents aaa3d61 + 7b23dbb commit 3010c01

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Main/src/Collections/EnumerableExtensions.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ namespace CodeJam.Collections
1212
[PublicAPI]
1313
public static partial class EnumerableExtensions
1414
{
15+
/// <summary>
16+
/// Produces the set union of two sequences by using the default equality comparer.
17+
/// </summary>
18+
/// <param name="source">An <see cref="IEnumerable{T}"/> whose distinct elements form the first set for the union.</param>
19+
/// <param name="elements">An <see cref="IEnumerable{T}"/> whose distinct elements form the second set for the union.</param>
20+
/// <returns>
21+
/// An <see cref="IEnumerable{T}"/> that contains the elements from both input sequences, excluding duplicates.
22+
/// </returns>
23+
[Pure, NotNull]
24+
public static IEnumerable<T> Union<T>([NotNull] this IEnumerable<T> source, params T[] elements) =>
25+
source.Union(elements.AsEnumerable());
26+
1527
/// <summary>
1628
/// Appends specified <paramref name="element"/> to end of the collection.
1729
/// </summary>

0 commit comments

Comments
 (0)