From dd986388c89a46417c7513478adcf1da1d4b92ae Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 9 Jun 2023 10:31:08 +0000 Subject: add compat package for List::Util::uniqstr 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. --- lib/PublicInbox/SolverGit.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/SolverGit.pm') diff --git a/lib/PublicInbox/SolverGit.pm b/lib/PublicInbox/SolverGit.pm index ebb5cdff..5f317f51 100644 --- a/lib/PublicInbox/SolverGit.pm +++ b/lib/PublicInbox/SolverGit.pm @@ -18,6 +18,7 @@ use PublicInbox::Qspawn; use PublicInbox::Tmpfile; use PublicInbox::GitAsyncCat; use PublicInbox::Eml; +use PublicInbox::Compat qw(uniqstr); use URI::Escape qw(uri_escape_utf8); # POSIX requires _POSIX_ARG_MAX >= 4096, and xargs is required to @@ -556,8 +557,7 @@ sub extract_diffs_done { my $diffs = delete $self->{tmp_diffs}; if (scalar @$diffs) { unshift @{$self->{patches}}, @$diffs; - my %seen; # List::Util::uniq requires Perl 5.26+ :< - my @u = grep { !$seen{$_}++ } map { di_url($self, $_) } @$diffs; + my @u = uniqstr(map { di_url($self, $_) } @$diffs); dbg($self, "found $want->{oid_b} in " . join(" ||\n\t", @u)); ++$self->{nr_p}; -- cgit v1.2.3-24-ge0c7