Browse Source

Fix: string to number on LuaTable Array Resize

Akeit0 1 year ago
parent
commit
3ae38ee4e1
1 changed files with 1 additions and 2 deletions
  1. 1 2
      src/Lua/LuaTable.cs

+ 1 - 2
src/Lua/LuaTable.cs

@@ -247,9 +247,8 @@ public sealed class LuaTable
         // Move some of the elements of the hash part to a newly allocated array
         foreach (var kv in dictionary)
         {
-            if (kv.Key.TryRead<double>(out var d) && MathEx.IsInteger(d))
+            if (TryGetInteger(kv.Key, out var index))
             {
-                var index = (int)d;
                 if (index > prevLength && index <= newLength)
                 {
                     indexList.Add((index, kv.Value));