]> Sergey Matveev's repositories - zk.git/commitdiff
Unique links
authorSergey Matveev <stargrave@stargrave.org>
Thu, 8 May 2025 07:57:28 +0000 (10:57 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Thu, 8 May 2025 07:58:00 +0000 (10:58 +0300)
zk

diff --git a/zk b/zk
index b28c2fbf7afda118158382d736200071c2447d82..d1bbdf1f4a55b38f171c6450d6a72af2922d31fc 100755 (executable)
--- 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) {