浏览代码

Merge pull request #106133 from fLindahl/stringname_movable_dict_fix

[.NET] Avoid heap alloc when using StringNames as key in a Dictionary
Thaddeus Crews 4 月之前
父节点
当前提交
bd619b8d32
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      modules/mono/glue/GodotSharp/GodotSharp/Core/StringName.cs

+ 1 - 1
modules/mono/glue/GodotSharp/GodotSharp/Core/StringName.cs

@@ -161,7 +161,7 @@ namespace Godot
 
         public override int GetHashCode()
         {
-            return NativeValue.GetHashCode();
+            return NativeValue.DangerousSelfRef.GetHashCode();
         }
     }
 }