about summary refs log tree commit homepage
path: root/lib/PublicInbox/SolverGit.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-06-09 10:31:08 +0000
committerEric Wong <e@80x24.org>2023-06-09 18:58:29 +0000
commitdd986388c89a46417c7513478adcf1da1d4b92ae (patch)
treeb6b8c3d1bdefdbde339d0838099e123a997fa92c /lib/PublicInbox/SolverGit.pm
parent56cdc78884fdc7378c727d9aa8861acbc56940f9 (diff)
downloadpublic-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/SolverGit.pm')
-rw-r--r--lib/PublicInbox/SolverGit.pm4
1 files changed, 2 insertions, 2 deletions
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};