Skip to content

Commit

Permalink
allow negative count on infix:<x>
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Sep 27, 2011
1 parent b1481ba commit e314924
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/Str.pm
Expand Up @@ -479,7 +479,9 @@ multi infix:<~>(Str:D \$a, Str:D \$b) {
}

multi infix:<x>(Str:D $s, Int:D $repetition) {
nqp::p6box_s(nqp::x(nqp::unbox_s($s), nqp::unbox_i($repetition)))
$repetition <= 0
?? ''
!! nqp::p6box_s(nqp::x(nqp::unbox_s($s), nqp::unbox_i($repetition)))
}

multi infix:<cmp>(Str:D \$a, Str:D \$b) {
Expand Down

0 comments on commit e314924

Please sign in to comment.