Skip to content

Commit

Permalink
use parrot's String.reverse for Str.flip
Browse files Browse the repository at this point in the history
also bumps PARROT_REVISION

This speeds up a small benchmark (which reverse a 1200 char 10 times) from 14s
to 0.7s (close to startup time). cotto++ cotto++ cotto++
  • Loading branch information
moritz committed Oct 15, 2010
1 parent 46b2c5a commit 79f754a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/PARROT_REVISION
@@ -1 +1 @@
49387
49541
7 changes: 6 additions & 1 deletion src/core/Cool-str.pm
Expand Up @@ -387,7 +387,12 @@ augment class Cool {
}

multi method flip() is export {
(~self).split('').reverse().join;
~ Q:PIR {
$P0 = box ''
$P1 = find_lex 'self'
$S0 = $P0.'reverse'($P1)
%r = box $S0
}
}
# Not yet spec'd, I expect it will be renamed
Expand Down

0 comments on commit 79f754a

Please sign in to comment.