lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

2013/9/26 Sean Conner <>:

>   1) Don't set an element to nil.  Use table.remove() instead.
>   2) Use a sentinel value to mark removal.
>   3) Keep track of both the size and the maximum index.
> In my opintion, the best practice is #1.

If you are using the table as a list (i.e. the exact key does not
matter, but the property "this item comes before that one"
does). Otherwise #2. I agree that 3) is a big-time PITA.