From 1a12df5108afc30e2ffaccbd40566e7ab50ab10e Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Thu, 8 May 2025 10:57:28 +0300 Subject: [PATCH] Unique links --- zk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) { -- 2.48.1