From 86ab9954f77afe10ac66767d3d79bf2ce51a314d Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sun, 15 Nov 2009 04:39:30 +0100 Subject: [PATCH] clean solution for List::MoreUtils::uniq hack --- lib/List/Index.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 ); -- 2.30.0