mirror of
				https://github.com/jellyfin/jellyfin.git
				synced 2025-11-03 19:17:24 -05:00 
			
		
		
		
	Merge pull request #3461 from Bond-009/readonlyspan
Add support for ReadOnlySpan<char> in IgnorePatterns
This commit is contained in:
		
						commit
						c521ce412c
					
				@ -1,3 +1,6 @@
 | 
			
		||||
#nullable enable
 | 
			
		||||
 | 
			
		||||
using System;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using DotNet.Globbing;
 | 
			
		||||
 | 
			
		||||
@ -88,9 +91,18 @@ namespace Emby.Server.Implementations.Library
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        /// <param name="path">The path to test.</param>
 | 
			
		||||
        /// <returns>Whether to ignore the path.</returns>
 | 
			
		||||
        public static bool ShouldIgnore(string path)
 | 
			
		||||
        public static bool ShouldIgnore(ReadOnlySpan<char> path)
 | 
			
		||||
        {
 | 
			
		||||
            return _globs.Any(g => g.IsMatch(path));
 | 
			
		||||
            int len = _globs.Length;
 | 
			
		||||
            for (int i = 0; i < len; i++)
 | 
			
		||||
            {
 | 
			
		||||
                if (_globs[i].IsMatch(path))
 | 
			
		||||
                {
 | 
			
		||||
                    return true;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user