From: Sergey Matveev Date: Thu, 8 May 2025 07:57:28 +0000 (+0300) Subject: Unique links X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=1a12df5108afc30e2ffaccbd40566e7ab50ab10e;p=swg.git Unique links --- diff --git a/zk b/zk index b28c2fb..d1bbdf1 100755 --- a/zk +++ b/zk @@ -150,7 +150,7 @@ my %cats; my %links; my %backs; for my $pth (keys %mtimes) { - my @ws; + my %found; open(my $fh, "<", $pth) or die "$!"; while (<$fh>) { foreach my $w (split /\s+/) { @@ -162,11 +162,11 @@ for my $pth (keys %mtimes) { } else { next unless exists $mtimes{$w}; } - push @ws, $w; + $found{$w} = 1; } } close $fh; - @ws = sort @ws; + my @ws = sort keys %found; next if $#ws == -1; $links{$pth} = \@ws; foreach (@ws) {