diff options
| author | Bond_009 <bond.009@outlook.com> | 2021-06-19 18:02:33 +0200 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2021-06-19 18:04:46 +0200 |
| commit | 6f8ccab788e85e025eaa44b67a1487bf419afb53 (patch) | |
| tree | f8895fae8ec17e922daab473180c9de9a702a02a /MediaBrowser.Common/Extensions/EnumerableExtensions.cs | |
| parent | 0c3dcdf77b0d124517bffa608bfddf7d8f7682db (diff) | |
Move non-jellyfin extensions to separate project
Diffstat (limited to 'MediaBrowser.Common/Extensions/EnumerableExtensions.cs')
| -rw-r--r-- | MediaBrowser.Common/Extensions/EnumerableExtensions.cs | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/MediaBrowser.Common/Extensions/EnumerableExtensions.cs b/MediaBrowser.Common/Extensions/EnumerableExtensions.cs deleted file mode 100644 index 2b8a6c395..000000000 --- a/MediaBrowser.Common/Extensions/EnumerableExtensions.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace MediaBrowser.Common.Extensions -{ - /// <summary> - /// Static extensions for the <see cref="IEnumerable{T}"/> interface. - /// </summary> - public static class EnumerableExtensions - { - /// <summary> - /// Determines whether the value is contained in the source collection. - /// </summary> - /// <param name="source">An instance of the <see cref="IEnumerable{String}"/> interface.</param> - /// <param name="value">The value to look for in the collection.</param> - /// <param name="stringComparison">The string comparison.</param> - /// <returns>A value indicating whether the value is contained in the collection.</returns> - /// <exception cref="ArgumentNullException">The source is null.</exception> - public static bool Contains(this IEnumerable<string> source, ReadOnlySpan<char> value, StringComparison stringComparison) - { - if (source == null) - { - throw new ArgumentNullException(nameof(source)); - } - - if (source is IList<string> list) - { - int len = list.Count; - for (int i = 0; i < len; i++) - { - if (value.Equals(list[i], stringComparison)) - { - return true; - } - } - - return false; - } - - foreach (string element in source) - { - if (value.Equals(element, stringComparison)) - { - return true; - } - } - - return false; - } - } -} |
