[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Modifying a table during an ipairs loop
- From: John Smith <0x42484156@...>
- Date: Fri, 4 Sep 2015 04:02:58 +0300
Hello Dirk,
Thursday, September 3, 2015, 1:30:45 PM, you wrote:
> for k,v in ipairs(t) do if type(v)=='table' then
> if v[1] then
> table.insert(t,k,v[1]); table.remove(v,1)
> else table.remove(t,k)
> end
> end
> Hint: it almost does what it should, but there is a bug.
It skips an item in <t> after the previous item was a table and was emptied out.
Right? Because it should.
--
Best regards,
John mailto:0x42484156@gmail.com