lua-users home
lua-l archive

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


Well for string.len I will use # (unless that would require a tostring) but for everything else (e.g. sub) that would be faster, thanks.
On Aug 10, 2014, at 3:15 PM, Rena <hyperhacker@gmail.com> wrote:

> On Sun, Aug 10, 2014 at 4:03 PM, Mason Mackaman <masondeanm@aol.com> wrote:
>> Well I just realized that string.len(str) is actually faster than str:len() if it’s in the scope of a localized version of ‘string'
> 
> If you're in such a tight inner loop that that difference is worth
> considering, you could probably speed it up a little more with
> something like:
> local slen = string.len
> slen(str)
> 
> -- 
> Sent from my Game Boy.
>