diff options
author | Eric Wong <e@80x24.org> | 2023-06-09 10:31:08 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-06-09 18:58:29 +0000 |
commit | dd986388c89a46417c7513478adcf1da1d4b92ae (patch) | |
tree | b6b8c3d1bdefdbde339d0838099e123a997fa92c /lib/PublicInbox/LeiImportKw.pm | |
parent | 56cdc78884fdc7378c727d9aa8861acbc56940f9 (diff) | |
download | public-inbox-dd986388c89a46417c7513478adcf1da1d4b92ae.tar.gz |
This will make it easier to switch in the far future while making callers easier-to-read (and more callers will be added). Anyways, Perl 5.26 is a long time away for enterprise users; but isolating compatibility code away can improve readability of code we actually care about in the meantime.
Diffstat (limited to 'lib/PublicInbox/LeiImportKw.pm')
-rw-r--r-- | lib/PublicInbox/LeiImportKw.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/LeiImportKw.pm b/lib/PublicInbox/LeiImportKw.pm index 4dd938f5..4b8e69fb 100644 --- a/lib/PublicInbox/LeiImportKw.pm +++ b/lib/PublicInbox/LeiImportKw.pm @@ -7,6 +7,7 @@ package PublicInbox::LeiImportKw; use strict; use v5.10.1; use parent qw(PublicInbox::IPC); +use PublicInbox::Compat qw(uniqstr); sub new { my ($cls, $lei) = @_; @@ -38,8 +39,7 @@ sub ck_update_kw { # via wq_io_do my $uid_url = "$url/;UID=$uid"; @oidbin > 1 and warn("W: $uid_url not unique:\n", map { "\t".unpack('H*', $_)."\n" } @oidbin); - my %seen; - my @docids = sort { $a <=> $b } grep { !$seen{$_}++ } + my @docids = sort { $a <=> $b } uniqstr map { $self->{over}->oidbin_exists($_) } @oidbin; $self->{lse}->kw_changed(undef, $kw, \@docids) or return; $self->{verbose} and $self->{lei}->qerr("# $uid_url => @$kw\n"); |