[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Is it safe to modify values while traversing a table with lua_next()?
- From: Carsten Fuchs <carsten.fuchs@...>
- Date: Thu, 26 Jul 2012 13:41:20 +0200
Dear Lua list,
using Lua 5.1, when I loop over the key-value pairs in a table using lua_next(), it is
safe to modify the values?
Especially if the new value is nil, in order to remove the key-value pair from the table?
http://www.lua.org/manual/5.1/manual.html#lua_next explicitly warns about modifying the
keys, but says nothing about modifying the values.
Best regards,
Carsten
--
Cafu - the open-source Game and Graphics Engine
for multiplayer, cross-platform, real-time 3D Action
Learn more at http://www.cafu.de