浏览代码

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;
     }
 }