Skip to content
This repository was archived by the owner on Dec 29, 2024. It is now read-only.

Commit 19a8c8e

Browse files
authored
Save key array for loop (#137)
1 parent b3526e3 commit 19a8c8e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/luaState.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,9 @@ LuaError *LuaState::pushVariant(lua_State *state, Variant var) {
271271
Dictionary dict = var.operator Dictionary();
272272
lua_createtable(state, 0, dict.size());
273273

274+
Array keys = dict.keys();
274275
for (int i = 0; i < dict.size(); i++) {
275-
Variant key = dict.keys()[i];
276+
Variant key = keys[i];
276277
Variant value = dict[key];
277278

278279
LuaError *err = pushVariant(state, key);

0 commit comments

Comments
 (0)