소스 검색

Use File.GetAttributes instead of creating a new FileInfo

cvium 3 년 전
부모
커밋
794b73c62d
1개의 변경된 파일1개의 추가작업 그리고 5개의 파일을 삭제
  1. 1 5
      Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs

+ 1 - 5
Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs

@@ -140,10 +140,6 @@ namespace Jellyfin.Server.Infrastructure
                 .ConfigureAwait(true);
         }
 
-        private static bool IsSymLink(string path)
-        {
-            var fileInfo = new FileInfo(path);
-            return (fileInfo.Attributes & FileAttributes.ReparsePoint) == FileAttributes.ReparsePoint;
-        }
+        private static bool IsSymLink(string path) => (File.GetAttributes(path) & FileAttributes.ReparsePoint) == FileAttributes.ReparsePoint;
     }
 }