From 9a7d37e6992ff598e2b53d78b2b0466a74c8b0f1 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 23 Nov 2020 07:05:55 +0000 Subject: [PATCH] inbox: git_epoch: remove ->version check If $epoch is supplied to this method, there's already epochs and an extra method call for ->version is a pointless waste of CPU cycles. --- lib/PublicInbox/Inbox.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm index 64b12345..a1a072ad 100644 --- a/lib/PublicInbox/Inbox.pm +++ b/lib/PublicInbox/Inbox.pm @@ -133,8 +133,7 @@ sub new { sub version { $_[0]->{version} // 1 } sub git_epoch { - my ($self, $epoch) = @_; - $self->version == 2 or return; + my ($self, $epoch) = @_; # v2-only, callers always supply $epoch $self->{"$epoch.git"} ||= do { my $git_dir = "$self->{inboxdir}/git/$epoch.git"; return unless -d $git_dir; -- 2.44.0