Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove backref methods.
We don't need to construct the entire match object just to backref
things.
  • Loading branch information
jnthn committed Nov 12, 2015
1 parent fdf95de commit 43e9d37
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/core/List.pm
Expand Up @@ -283,7 +283,6 @@ my class List does Iterable does Positional { # declared in BOOTSTRAP
# Pretend we're a Match assuming we're a list of Matches
method to() { self.elems ?? self[self.end].to !! Nil }
method from() { self.elems ?? self[0].from !! Nil }
method backref() { self.elems ?? self[0].orig.substr(self[0].from ..^ self[self.end].to) !! Nil }

method fmt($format = '%s', $separator = ' ') {
self.map({ .fmt($format) }).join($separator);
Expand Down
1 change: 0 additions & 1 deletion src/core/Match.pm
Expand Up @@ -20,7 +20,6 @@ my class Match is Capture is Cool {
multi method Str(Match:D:) {
$!to > $!from ?? substr($!orig,$!from,$!to-$!from) !! ''
}
method backref() { self.Str } # (Str and backref differ in Arrays)

multi method Numeric(Match:D:) {
self.Str.Numeric
Expand Down

0 comments on commit 43e9d37

Please sign in to comment.