From 1ee38dcac2c5ca00222068e7ad4b19cfd0bae5a1 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Fri, 15 May 2020 18:07:37 +1000 Subject: [PATCH] Fix IList.ToLuaTable() extension (resolves #2004) --- src/BizHawk.Client.Common/lua/LuaHelper.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/BizHawk.Client.Common/lua/LuaHelper.cs b/src/BizHawk.Client.Common/lua/LuaHelper.cs index 802d594e40..0eb79f844b 100644 --- a/src/BizHawk.Client.Common/lua/LuaHelper.cs +++ b/src/BizHawk.Client.Common/lua/LuaHelper.cs @@ -24,11 +24,7 @@ namespace BizHawk.Client.Common public static LuaTable ToLuaTable(this IList list, Lua lua, int indexFrom = 0) { var table = lua.NewTable(); - var indexAfterLast = indexFrom + list.Count; - for (var i = indexFrom; i != indexAfterLast; i++) - { - table[i] = list[i]; - } + for (int i = 0, l = list.Count; i != l; i++) table[indexFrom + i] = list[i]; return table; }