lua-users home
lua-l archive

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


> On Sep 24, 2015, at 9:45 AM, Soni L. <fakedme@gmail.com> wrote:
> 
> 
> 
> On 24/09/15 12:39 PM, Dirk Laurie wrote:
>> Consider the following code:
>> 
>> local trim_pattern = "^%s*(.*%S)%s*$"
>> 
> Wouldn't it be faster if you trimmed at start, reversed, then trimmed at start again? (or maybe at start, then at end?)
> 
> -- 
> Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.
> 
> 

It would be faster (by a wide margin) to have a C function do it.

—Tim