optimise (?:|) and related NOTHING like constructs out of the compiled optree
authorYves Orton <demerphq@gmail.com>
Wed, 6 Jun 2012 06:53:05 +0000 (08:53 +0200)
committerYves Orton <demerphq@gmail.com>
Thu, 7 Jun 2012 06:59:55 +0000 (08:59 +0200)
commit3b6759a6b10290b6fea26fb98b50fbf5ce4466b5
tree460c131845db301c4a7487da7f44d143abcad274
parentae0a0fb2ce70e35111ba07e2a578edd8fcc989f8
optimise (?:|) and related NOTHING like constructs out of the compiled optree

A pattern like (?:|) causes the regex engine to do extra work even though
it is equivelent to matching nothing. This optimises such sequences into
more efficient opcodes that do less work, and in some cases optimises
them away entirely.
regcomp.c