1
0
mirror of https://github.com/chylex/Minecraft-Phantom-Panel.git synced 2024-10-17 03:42:50 +02:00
Minecraft-Phantom-Panel/Utils/Phantom.Utils.Collections/EnumerableExtensions.cs

15 lines
376 B
C#

using System.Diagnostics.CodeAnalysis;
namespace Phantom.Utils.Collections;
public static class EnumerableExtensions {
[SuppressMessage("ReSharper", "LoopCanBeConvertedToQuery")]
public static IEnumerable<TSource> WhereNotNull<TSource>(this IEnumerable<TSource?> items) {
foreach (var item in items) {
if (item is not null) {
yield return item;
}
}
}
}