[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: string.len(str) vs str:len()
- From: Mason Mackaman <masondeanm@...>
- Date: Sun, 10 Aug 2014 15:49:29 -0500
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.
>
- References:
- string.len(str) vs str:len(), Mason Mackaman
- Re: string.len(str) vs str:len(), Thiago L.
- Re: string.len(str) vs str:len(), Mason Mackaman
- Re: string.len(str) vs str:len(), Thiago L.
- Re: string.len(str) vs str:len(), Mason Mackaman
- Re: string.len(str) vs str:len(), Tim Hill
- Re: string.len(str) vs str:len(), Mason Mackaman
- Re: string.len(str) vs str:len(), Sean Conner
- Re: string.len(str) vs str:len(), Mason Mackaman
- Re: string.len(str) vs str:len(), Mason Mackaman
- Re: string.len(str) vs str:len(), Rena