Browse Source

Run formatter

AnnulusGames 11 months ago
parent
commit
ed27bdb31d
2 changed files with 12 additions and 13 deletions
  1. 3 3
      src/Lua/LuaTable.cs
  2. 9 10
      src/Lua/Runtime/LuaVirtualMachine.cs

+ 3 - 3
src/Lua/LuaTable.cs

@@ -109,7 +109,7 @@ public sealed class LuaTable
 
         return dictionary.TryGetValue(key, out value) && value.Type is not LuaValueType.Nil;
     }
-    
+
     [MethodImpl(MethodImplOptions.AggressiveInlining)]
     internal ref LuaValue FindValue(LuaValue key)
     {
@@ -126,7 +126,7 @@ public sealed class LuaTable
             }
         }
 
-        return ref dictionary.FindValue(key,out _);
+        return ref dictionary.FindValue(key, out _);
     }
 
     public bool ContainsKey(LuaValue key)
@@ -213,7 +213,7 @@ public sealed class LuaTable
         }
         else
         {
-            if(dictionary.TryGetNext(key, out pair))
+            if (dictionary.TryGetNext(key, out pair))
             {
                 return true;
             }

+ 9 - 10
src/Lua/Runtime/LuaVirtualMachine.cs

@@ -92,20 +92,19 @@ public static partial class LuaVirtualMachine
             switch (opCode)
             {
                 case OpCode.Call:
-                {
-                    var c = callInstruction.C;
-                    if (c != 0)
                     {
-                        targetCount = c - 1;
-                    }
+                        var c = callInstruction.C;
+                        if (c != 0)
+                        {
+                            targetCount = c - 1;
+                        }
 
-                    break;
-                }
+                        break;
+                    }
                 case OpCode.TForCall:
                     target += 3;
                     targetCount = callInstruction.C;
                     break;
-
                 case OpCode.Self:
                     Stack.Get(target) = result.Length == 0 ? LuaValue.Nil : result[0];
                     Thread.PopCallStackFrameUnsafe(target + 2);
@@ -266,7 +265,7 @@ public static partial class LuaVirtualMachine
 
         try
         {
-            // This is a label to restart the execution when new function is called or restarted
+        // This is a label to restart the execution when new function is called or restarted
         Restart:
             ref var instructionsHead = ref context.Chunk.Instructions[0];
             var frameBase = context.FrameBase;
@@ -337,7 +336,7 @@ public static partial class LuaVirtualMachine
                         }
 
                         var table = context.Closure.GetUpValue(instruction.A);
-                        
+
                         if (table.TryReadTable(out luaTable))
                         {
                             ref var valueRef = ref luaTable.FindValue(vb);