mirror of
https://github.com/Tyrrrz/CliFx.git
synced 2025-10-25 15:19:17 +00:00
17 lines
368 B
C#
17 lines
368 B
C#
using System.Collections.Generic;
|
|
|
|
namespace CliFx.SourceGeneration.Utils.Extensions;
|
|
|
|
internal static class CollectionExtensions
|
|
{
|
|
public static IEnumerable<T> WhereNotNull<T>(this IEnumerable<T?> source)
|
|
where T : class
|
|
{
|
|
foreach (var i in source)
|
|
{
|
|
if (i is not null)
|
|
yield return i;
|
|
}
|
|
}
|
|
}
|