Skip to content

Commit debdc92

Browse files
committed
Avoid duplicate comparison in \C action
It only builds the enumcharlist node if we're building a \C so we don't need to check for \C again before setting negate.
1 parent c915a72 commit debdc92

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/QRegex/P6Regex/Actions.nqp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ class QRegex::P6Regex::Actions is HLL::Actions {
351351

352352
method backslash:sym<c>($/) {
353353
make $<sym> eq 'C' ??
354-
QAST::Regex.new( $<charspec>.ast, :rxtype('enumcharlist'), :negate($<sym> eq 'C'), :node($/) ) !!
354+
QAST::Regex.new( $<charspec>.ast, :rxtype('enumcharlist'), :negate(1), :node($/) ) !!
355355
QAST::Regex.new( $<charspec>.ast, :rxtype('literal'), :node($/) )
356356
}
357357

0 commit comments

Comments
 (0)