aboutsummaryrefslogtreecommitdiff
path: root/RSSDP/IEnumerableExtensions.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2023-11-30 17:40:06 +0100
committerGitHub <noreply@github.com>2023-11-30 17:40:06 +0100
commitcc276838b4edbb67356b805952262c38e9c9cd19 (patch)
tree8cb27ed0ba34fdd2d941f43c09ccc2be70c10abb /RSSDP/IEnumerableExtensions.cs
parentcf80ea25413b75bbeddaef136fbeee33aa882a60 (diff)
parente46e3be667c76ff9a242d7499aff83d2d10881ed (diff)
Merge pull request #10558 from barronpm/dlna-plugin2
Move DLNA to Plugin (Part 2)
Diffstat (limited to 'RSSDP/IEnumerableExtensions.cs')
-rw-r--r--RSSDP/IEnumerableExtensions.cs34
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>();
- }
- }
-}