소스 검색

Add fast path to check for empty ignore files (#14782)

Bond-009 3 달 전
부모
커밋
deee04ae38
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      Emby.Server.Implementations/Library/DotIgnoreIgnoreRule.cs

+ 7 - 0
Emby.Server.Implementations/Library/DotIgnoreIgnoreRule.cs

@@ -50,6 +50,13 @@ public class DotIgnoreIgnoreRule : IResolverIgnoreRule
                 return false;
             }
 
+            // Fast path in case the ignore files isn't a symlink and is empty
+            if ((dirIgnoreFile.Attributes & FileAttributes.ReparsePoint) == 0
+                && dirIgnoreFile.Length == 0)
+            {
+                return true;
+            }
+
             // ignore the directory only if the .ignore file is empty
             // evaluate individual files otherwise
             return string.IsNullOrWhiteSpace(GetFileContent(dirIgnoreFile));