X-Git-Url: http://git.shiar.net/gitweb.cgi/perl/list-index.git/blobdiff_plain/12c2437bb737f40da7d7514fc31c641ef0110cf3..86ab9954f77afe10ac66767d3d79bf2ce51a314d:/lib/List/Index.pm?ds=sidebyside diff --git a/lib/List/Index.pm b/lib/List/Index.pm index f703d97..e56d771 100644 --- a/lib/List/Index.pm +++ b/lib/List/Index.pm @@ -74,11 +74,9 @@ sub ranges { $lookahead = $context - $penalty; } - push @links, $link; + push @links, $link unless $links[-1] eq $link; } - use List::MoreUtils 'uniq'; - @links = uniq @links; for my $i (0 .. $#links - 1) { my ($link, $lastchar) = $links[$i + 1] =~ /(.*)(.)/; $link .= $lastchar le 'a' ? '.' : chr( ord($lastchar) - 1 );