lua-users home
lua-l archive

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


Hi all. 

I want to avoid any unnecessary table creation to keep the gc workload low. 

Question: will the following code create the new table "{}" only if the 
parameter "tbl" is nil

yes.

OR will the new table created always and garbage 
collected if the parameter "tbl" is given? 

no.



---8<---------------------------- 
function xx(tbl) 
local todolist = tbl or {}; 
... 
end; 
---8<---------------------------- 

tia. 

Ulrich Schmidt