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

Re: [SCM] Debian package checker branch, master, updated. 2.2.12-15-g67f5991



Raphael Geissert <atomo64+debian@gmail.com> writes:

> May I suggest moving that regex out of the for loop? it is faster to
> apply a regex to a large string once than applying it to lots of small
> strings.
>
> The following regex should do it:
> $text =~ s/(?:[()[\]]|[.,;:?!]+(?=\s))//g;

I think we introduced this bug originally while trying to do this
micro-optimization, and I'm not sure it's really worth it.  But at the
least, that regex doesn't work.  It needs to handle sentences inside
parentheses and the end of the string.

Note that the picky check on description strings also uses a regex
inside the loop.

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>


Reply to: