lua-users home
lua-l archive

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

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


Attachment: pgpIWw3atV1em.pgp
Description: PGP signature