git.shiar.nl
/
perl
/
list-index.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
XXX: distribution test
[perl/list-index.git]
/
lib
/
List
/
Index.pm
diff --git
a/lib/List/Index.pm
b/lib/List/Index.pm
index 06c27273fcbd67193e9eb4f751ab280a93f0a8ac..339bd7d8710b6ede1e44fef6b207d28e0e26f766 100644
(file)
--- a/
lib/List/Index.pm
+++ b/
lib/List/Index.pm
@@
-55,9
+55,10
@@
sub ranges {
# use this link if it's shorter
if ($trim < length $link) {
$link = substr $after, 0, $trim;
# use this link if it's shorter
if ($trim < length $link) {
$link = substr $after, 0, $trim;
-# $offset += $context + 1;
- $self->[$offset + ++$penalty] =~ /^\Q$link/
- while $offset + $penalty < $#$self;
+ for ($offset .. $#$self) {
+ last if $self->[$offset + $penalty] =~ /^\Q$link/;
+ $penalty++;
+ }
}
}
}
}
}
}