[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Common Lua (Logic/Style etc) Errors Detectable Through Static Analysis
- From: Mike Pall <mikelu-1102@...>
- Date: Tue, 15 Feb 2011 15:41:36 +0100
Jon Akhtar wrote:
> To honor this I have been creating what are called "inspections" which
> find common flaws in code and either flag them, or flag them and offer
> to fix them.
>
> [...] access of array index 0 [...]
This isn't necessarily a flaw. It's inefficient in Lua, but
there's no performance loss in LuaJIT (*). You may want to
separate these 'code smells' into categories that can be turned on
or off. Or maybe offer different profiles.
(*) The array part of LuaJIT tables is zero-based internally,
but the visible semantics for {} and # stay the same.
--Mike