Skip to content

Commit

Permalink
use eqat for "\r\n" check instead of substr+iseq
Browse files Browse the repository at this point in the history
  • Loading branch information
timo committed Nov 11, 2013
1 parent 7b9f357 commit 24b421b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/vm/parrot/QAST/Compiler.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -1377,8 +1377,7 @@ class QAST::Compiler is HLL::Compiler {
$ops.push_pirop('is_cclass', '$I11', $cclass, %*REG<tgt>, %*REG<pos>);
$ops.push_pirop($testop, '$I11', %*REG<fail>);
if $cclass eq '.CCLASS_NEWLINE' && $node.subtype ne 'zerowidth' {
$ops.push_pirop('substr', '$S10', %*REG<tgt>, %*REG<pos>, 2);
$ops.push_pirop('iseq', '$I11', '$S10', '"\r\n"');
$ops.push_pirop('nqp_string_equal_at', '$I11', %*REG<tgt>, '"\r\n"', %*REG<pos>);
$ops.push_pirop('add', %*REG<pos>, '$I11');
}
}
Expand Down

0 comments on commit 24b421b

Please sign in to comment.