mirror of
https://github.com/libretro/retro8.git
synced 2024-11-26 18:30:26 +00:00
Fix implementation of foreach
Oritinal foreach can correctly traverse the table even when the called function removes the element. Make it in-line with vanilla pico8 Fixe level skipping in celeste classic
This commit is contained in:
parent
e5eb738341
commit
407c53122b
@ -24,7 +24,7 @@ end
|
||||
|
||||
function foreach(c, f)
|
||||
if c ~= nil then
|
||||
for key, value in ipairs(c) do
|
||||
for value in all(c) do
|
||||
f(value)
|
||||
end
|
||||
end
|
||||
|
@ -25,7 +25,7 @@ const char* lua_api_string =
|
||||
"\n"
|
||||
"function foreach(c, f)\n"
|
||||
" if c ~= nil then\n"
|
||||
" for key, value in ipairs(c) do\n"
|
||||
" for value in all(c) do\n"
|
||||
" f(value)\n"
|
||||
" end\n"
|
||||
" end\n"
|
||||
|
Loading…
Reference in New Issue
Block a user