about summary refs log tree commit homepage
path: root/lib/PublicInbox/ExtSearchIdx.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-12-16 23:19:04 +0000
committerEric Wong <e@80x24.org>2020-12-17 19:41:14 +0000
commitdbf250d9423ccc38377c35eef8d43e3e11723253 (patch)
tree9d29ec1355eae9bb8e46981ecd181074f4809cf8 /lib/PublicInbox/ExtSearchIdx.pm
parent519f80bb052a446ffa604a0862a631d846f64468 (diff)
downloadpublic-inbox-dbf250d9423ccc38377c35eef8d43e3e11723253.tar.gz
Perl readdir detects list context and can return an array
suitable for the grep op.  From there, we can rely on
substr to remove the ".git" suffix and integerize the value
to save a few bytes before letting List::Util::max return
the value.

This is how we detect Xapian shards nowadays, too, and
we'll also use defined-or (//) to simplify the return
value there.

We'll also simplify InboxWritable->git_dir_latest,
remove some callers, and consider removing it entirely.
Diffstat (limited to 'lib/PublicInbox/ExtSearchIdx.pm')
-rw-r--r--lib/PublicInbox/ExtSearchIdx.pm4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/PublicInbox/ExtSearchIdx.pm b/lib/PublicInbox/ExtSearchIdx.pm
index f492734a..3764612c 100644
--- a/lib/PublicInbox/ExtSearchIdx.pm
+++ b/lib/PublicInbox/ExtSearchIdx.pm
@@ -290,9 +290,7 @@ sub _sync_inbox ($$$) {
         my $v = $ibx->version;
         my $ekey = $ibx->eidx_key;
         if ($v == 2) {
-                my $epoch_max;
-                defined($ibx->git_dir_latest(\$epoch_max)) or return;
-                $sync->{epoch_max} = $epoch_max;
+                $sync->{epoch_max} = $ibx->max_git_epoch // return;
                 sync_prepare($self, $sync); # or return # TODO: once MiscIdx is stable
         } elsif ($v == 1) {
                 my $uv = $ibx->uidvalidity;