[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: pairs(t, skey) and ipairs(t, skey)
- From: David Heiko Kolf <david@...>
- Date: Wed, 02 Oct 2013 21:51:08 +0200
Paul K wrote:
> I'd like to iterate over array part first (for example, using ipairs)
> and then over the hash part (using pairs), but didn't want to iterate
> over already iterated parts.
How critical is that requirement really? For a serializer I would
probably first serialize the integer elements 1..#t using a numeric for
loop and then use pairs and filter out all integer keys <= #t. Of
course you would iterate over the integer keys twice, but I wonder
whether the cost for filtering out the elements would be significant
compared to the entire cost for serialization.
Best regards,
David Kolf
- References:
- Re: pairs(t, skey) and ipairs(t, skey), Phill Djonov
- Re: pairs(t, skey) and ipairs(t, skey), Paul K
- Re: pairs(t, skey) and ipairs(t, skey), Claire Lewis
- Re: pairs(t, skey) and ipairs(t, skey), Paul K