aboutsummaryrefslogtreecommitdiff
path: root/RSSDP/IEnumerableExtensions.cs
diff options
context:
space:
mode:
authorErwin de Haan <EraYaN@users.noreply.github.com>2019-01-13 23:28:05 +0100
committerErwin de Haan <EraYaN@users.noreply.github.com>2019-01-13 23:28:05 +0100
commitae0732136fe72e5e3c26517e9e350178bf2e9b59 (patch)
treecdfc9cd6ce97ceca0b2d8d3023d9815f80357dd5 /RSSDP/IEnumerableExtensions.cs
parentd7b7be395b76c7fcc49d3baffeb59d51a9b36378 (diff)
parentf8dd182e422db49d98cc090f4e205cc46517f610 (diff)
Merge remote-tracking branch 'upstream/dev' into build-system-consolidation
Diffstat (limited to 'RSSDP/IEnumerableExtensions.cs')
-rw-r--r--RSSDP/IEnumerableExtensions.cs38
1 files changed, 19 insertions, 19 deletions
diff --git a/RSSDP/IEnumerableExtensions.cs b/RSSDP/IEnumerableExtensions.cs
index f72073949..c96542dca 100644
--- a/RSSDP/IEnumerableExtensions.cs
+++ b/RSSDP/IEnumerableExtensions.cs
@@ -1,28 +1,28 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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("source");
- if (selector == null) throw new ArgumentNullException("selector");
+ 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)
- );
- }
+ 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>();
- }
- }
+ public static IEnumerable<T> EmptyIfNull<T>(this IEnumerable<T> source)
+ {
+ return source ?? Enumerable.Empty<T>();
+ }
+ }
}