Re: Bad uses of patterns (was: Re: Feature request: names for constants)
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Bad uses of patterns (was: Re: Feature request: names for constants)
- From: Sean Conner <sean@...>
- Date: 2015年9月24日 13:27:37 -0400
It was thus said that the Great Soni L. once stated:
>
>
> 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?)
I think the fastest was is mentioned in this posting back in 2009:
http://lua-users.org/lists/lua-l/2009-12/msg00951.html
but you can check the entire thread starting from:
http://lua-users.org/lists/lua-l/2009-12/msg00877.html
-spc (I'll take Past Topics for 200,ドル Alex!)