]> Sergey Matveev's repositories - public-inbox.git/commitdiff
eml: reduce RE captures and possible side effects
authorEric Wong <e@yhbt.net>
Sat, 9 May 2020 08:27:36 +0000 (08:27 +0000)
committerEric Wong <e@yhbt.net>
Sat, 9 May 2020 20:27:34 +0000 (20:27 +0000)
Since Perl 5.6, the `@-' (aka @LAST_MATCH_START) and `@+' (aka
@LAST_MATCH_END) arrays provides integer offsets for every match
as documented in perlvar(1), regardless of regexp modifiers.

We can avoid relying on $1 in the epilogue scan, entirely.

So use these instead of relying on m//g and pos(), since the `g'
modifier can be affected by m//g matches performed in other
places.

Unrelated, but while we're in the area: remove some unnecessary
use of (?:...), too.


No differences found