lua-users home
lua-l archive

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


> Yes, but it uses inheritance, too. The constructor for the parent
> object is sized right with 51w5. But the child adds a few elements
> and this implies resizing. IMHO this is a pretty common thing in OO
> inheritance.

(I'm afraid I had the wrong version. Mine does not use inheritance.)  It
seems a bad coincidence. For instance, if the super table were created
with three elements and the child had to add one single extra element,
w4 would need a rehash, while w5 wouldn't. In that case w5 would be
faster.

-- Roberto