lua-users home
lua-l archive

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


> 	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