|
On Oct 2, 2013, at 1:51 AM, liam mail <liam.list@googlemail.com> wrote:
No, I'm going to have to check it's an array first, and then iterate it. The array iteration is of course O(n), and I'm unaware of any way to validate that a table is an array in less than O(n), so the API performance is half what it could be if I could use some kind of table.issequence() check. Worse, any Lua code that checks for a sequence inevitably has to iterate the entire set of table keys, which means all the array entries and all the non-array entries. So it's worse than O(2n). --Tim |