Fix IList<T>.ToLuaTable() extension (resolves #2004)

This commit is contained in:
YoshiRulz 2020-05-15 18:07:37 +10:00
parent 0714376afe
commit 1ee38dcac2
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 1 additions and 5 deletions

View File

@ -24,11 +24,7 @@ namespace BizHawk.Client.Common
public static LuaTable ToLuaTable<T>(this IList<T> 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;
}