[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: deleting tables from C
- From: RLake@...
- Date: Wed, 5 Nov 2003 11:33:00 -0500
> Isn't the "obvious" way to empty a table to...
Yes, but its performance is awful on large tables. It is basically
quadratic in table size.
Actually, I don't think your code handles a table with the key false.
Try:
function noxt(table) return next(table, nil) end
for key in noxt, table do table[key] = nil end
But that doesn't get around the performance problem.