[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: ***SPAM*** Re: Newbie questions regarding luasocket, tables
- From: Sam Roberts <sroberts@...>
- Date: Tue, 8 May 2007 10:38:59 -0700
On Tue, May 08, 2007 at 12:31:27PM -0500, Javier Guerra Giraldez wrote:
> On Tuesday 08 May 2007, Sam Roberts wrote:
> > Funny, I needed it yesterday. A benchmark script requests a number of
> > objects, and measures time until all objects have been received.
> > Outstanding requests are indexed by an identifier in a table, when the
> > table size (size:=number of pairs) is zero, all have been received, and
> > benchmark result is calculated.
>
> if you only want to test if a table is empty, just do:
>
> function isempty(t)
> return next(t) == nil
> end
Good idea, I'd forgotten that trick.
Thanks,
Sam