[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Detecting read or write access in __index metamethod
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 16 Dec 2010 18:01:51 -0200
> hdf.bset = {}
> for n = 1, res:ntuples() do
> hdf.bset[n] = {}
> hdf.bset[n].id = res:getvalue(n, 1)
> hdf.bset[n].name = res:getvalue(n, 2)
> hdf.bset[n].description = res:getvalue(n, 3)
> end
This can be simplified to
hdf.bset = {}
for n = 1, res:ntuples() do
hdf.bset[n] = {
id = res:getvalue(n, 1),
name = res:getvalue(n, 2),
description = res:getvalue(n, 3)
}
end