[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Question about erasing tables
- From: Martin <eden_martin_fuhrspam@...>
- Date: Mon, 3 Jul 2017 22:34:27 -0700
On 07/03/2017 11:49 AM, Charles Heywood wrote:
> Roberto then goes on to mention an improvement to this:
>
> while true do
> local k = next(t)
> if not k then break end
> t[k] = nil
> end
Looks like this code will not handle table with <false> key.
next() will return <false> and both <nil> and <false> considered
<false>. So it will remove table values just up to such entry.
-- Martin