mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2024-11-24 22:42:53 +01:00
15 lines
376 B
C#
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;
|
|
}
|
|
}
|
|
}
|
|
}
|