From bedc00396665f065672dfa80cc7164d69bb2c1d7 Mon Sep 17 00:00:00 2001
From: lanyi <lanyi@ra3.moe>
Date: Tue, 25 Jan 2022 13:37:44 +0100
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 AssetEntry.cs |  2 +-
 SageHash.cs   | 19 +++++++++----------
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/AssetEntry.cs b/AssetEntry.cs
index 97983bd..aa140a7 100644
--- a/AssetEntry.cs
+++ b/AssetEntry.cs
@@ -12,7 +12,7 @@ namespace HashCalculator.GUI
         public string Type { get; }
         public string Name { get; }
         public string NameString { get; }
-        public IEnumerable<string> DisplayLabels { get; }
+        public IReadOnlyList<string> DisplayLabels { get; }
         public uint InstanceId => SageHash.CalculateLowercaseHash(Name);
 
         public string InstanceIdString => $"{InstanceId:x8} ({InstanceId,10})";
diff --git a/SageHash.cs b/SageHash.cs
index d4c87ca..60c3a4b 100644
--- a/SageHash.cs
+++ b/SageHash.cs
@@ -3,17 +3,17 @@ using System.Diagnostics.CodeAnalysis;
 using System.IO;
 using System.Text;
 using TechnologyAssembler.Core.Hashing;
-using System.Xml;
 
 namespace HashCalculator.GUI
 {
     public static class SageHash
     {
+        [SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1024:Compare symbols correctly", Justification = "<Pending>")]
         public static uint CalculateBinaryHash(byte[] content)
         {
             if (content == null)
             {
-                throw new ArgumentNullException($"{nameof(content)} is null");
+                throw new ArgumentNullException(nameof(content));
             }
             return FastHash.GetHashCode(content);
         }
@@ -22,7 +22,7 @@ namespace HashCalculator.GUI
         {
             if (content == null)
             {
-                throw new ArgumentNullException($"{nameof(content)} is null");
+                throw new ArgumentNullException(nameof(content));
             }
             return FastHash.GetHashCodeLauncher(0, content);
         }
@@ -31,26 +31,25 @@ namespace HashCalculator.GUI
         {
             if (content == null)
             {
-                throw new ArgumentNullException($"{nameof(content)} is null");
+                throw new ArgumentNullException(nameof(content));
             }
             return CalculateBinaryHash(Encoding.ASCII.GetBytes(content));
         }
 
-        [SuppressMessage("Globalization", "CA1308:将字符串规范化为大写", Justification = "<挂起>")]
         public static uint CalculateLowercaseHash(string content)
         {
-            if(content == null)
+            if (content == null)
             {
-                throw new ArgumentNullException($"{nameof(content)} is null");
+                throw new ArgumentNullException(nameof(content));
             }
             return CalculateBinaryHash(content.ToLowerInvariant());
         }
 
-        public static uint CalculateFileHash(string path) 
+        public static uint CalculateFileHash(string path)
         {
-            if(path == null)
+            if (path == null)
             {
-                throw new ArgumentNullException($"{nameof(path)} is null");
+                throw new ArgumentNullException(nameof(path));
             }
             return CalculateBinaryHash(File.ReadAllBytes(path));
         }