1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Avoid some inefficiencies when handling ItemStack(Metadata)

This commit is contained in:
sfan5 2024-12-31 01:26:08 +01:00
parent d884a1624f
commit a2058f7f3a
7 changed files with 37 additions and 51 deletions

View file

@ -1594,7 +1594,7 @@ ToolCapabilities read_tool_capabilities(
// key at index -2 and value at index -1
int rating = luaL_checkinteger(L, -2);
float time = luaL_checknumber(L, -1);
groupcap.times[rating] = time;
groupcap.times.emplace_back(rating, time);
// removes value, keeps key for next iteration
lua_pop(L, 1);
}