浏览代码

Hash tweak

ManlyMarco 5 年之前
父节点
当前提交
5f0e229e52
共有 1 个文件被更改,包括 1 次插入4 次删除
  1. 1 4
      BepInEx/Configuration/KeyboardShortcut.cs

+ 1 - 4
BepInEx/Configuration/KeyboardShortcut.cs

@@ -174,10 +174,7 @@ namespace BepInEx.Configuration
 		{
 			if (MainKey == KeyCode.None) return 0;
 
-			var hc = _allKeys.Length;
-			for (var i = 0; i < _allKeys.Length; i++)
-				hc = unchecked(hc * 31 + (int)i);
-			return hc;
+			return _allKeys.Aggregate(_allKeys.Length, (current, item) => unchecked(current * 31 + (int)item));
 		}
 	}
 }