diff options
Diffstat (limited to 'RSSDP/IEnumerableExtensions.cs')
| -rw-r--r-- | RSSDP/IEnumerableExtensions.cs | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/RSSDP/IEnumerableExtensions.cs b/RSSDP/IEnumerableExtensions.cs deleted file mode 100644 index 1f0daad3e..000000000 --- a/RSSDP/IEnumerableExtensions.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Rssdp.Infrastructure -{ - internal static class IEnumerableExtensions - { - public static IEnumerable<T> SelectManyRecursive<T>(this IEnumerable<T> source, Func<T, IEnumerable<T>> selector) - { - if (source == null) - { - throw new ArgumentNullException(nameof(source)); - } - - if (selector == null) - { - throw new ArgumentNullException(nameof(selector)); - } - - return !source.Any() ? source : - source.Concat( - source - .SelectMany(i => selector(i).EmptyIfNull()) - .SelectManyRecursive(selector) - ); - } - - public static IEnumerable<T> EmptyIfNull<T>(this IEnumerable<T> source) - { - return source ?? Enumerable.Empty<T>(); - } - } -} |
