This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_regcomp: dopn't special-case n->1 arg folding
authorDavid Mitchell <davem@iabyn.com>
Sun, 30 Oct 2011 12:35:13 +0000 (12:35 +0000)
committerDavid Mitchell <davem@iabyn.com>
Wed, 13 Jun 2012 12:25:51 +0000 (13:25 +0100)
commit8f345207f1de4fd569ad930ffa22666871bb4d04
tree97cd3ba203251715b6169f4e7a9caec6848a936c
parentdf787a7bb4a63e5953790968accffdcb3018e1d8
pp_regcomp: dopn't special-case n->1 arg folding

Currently, pp_regcomp() specially handles the case where the result of
concating all its args is a regexp. Change this so that this only occurs
if there is a single arg.

This means that if $a is an overloaded object whose concat op returns
a regexp, then /$a+/ no longer special-cases, and thus the returned regex
is now stringified and recompiled. This slight loss of efficiency in a
rare case is necessary to allow us to delay concating for as long as possible,
pp_ctl.c