Fix oops w/ array serialization ordering

This commit is contained in:
Justine Tunney 2022-07-09 10:28:14 -07:00
parent 727d9cbf56
commit d37536bd4b
3 changed files with 5 additions and 5 deletions

View file

@ -181,8 +181,8 @@ static int LuaEncodeLuaDataImpl(lua_State *L, char **buf, int level,
lua_pop(L, 1); // table/-2, key/-1
}
lua_pop(L, 1); // table ref
if (!isarray) SortStrList(&sl);
RETURN_ON_ERROR(appendw(buf, '{'));
SortStrList(&sl);
RETURN_ON_ERROR(JoinStrList(&sl, buf, READ16LE(", ")));
RETURN_ON_ERROR(appendw(buf, '}'));
FreeStrList(&sl);