Created
October 11, 2014 10:58
-
-
Save moritz/b4167b60f7baf97d8330 to your computer and use it in GitHub Desktop.
Untested patch to speed up certain transliterations by ~25%
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/core/Str.pm b/src/core/Str.pm | |
index c0c886a..3590fbe 100644 | |
--- a/src/core/Str.pm | |
+++ b/src/core/Str.pm | |
@@ -1081,10 +1081,9 @@ my class Str does Stringy { # declared in BOOTSTRAP | |
} | |
multi method triage_substitution($_ where { .key ~~ Cool }) { | |
- return unless defined index($!source, .key, $!index); | |
- self.compare_substitution($_, | |
- index($!source, .key, $!index), | |
- .key.chars); | |
+ my $pos := index($!source, .key, $!index); | |
+ return unless defined $pos; | |
+ self.compare_substitution($_, $pos, .key.chars); | |
} | |
multi method triage_substitution($_) { | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment