From: Eric Wong Date: Mon, 23 Nov 2020 07:05:55 +0000 (+0000) Subject: inbox: git_epoch: remove ->version check X-Git-Tag: v1.7.0~1624 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=9a7d37e6992ff598e2b53d78b2b0466a74c8b0f1;p=public-inbox.git 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. --- 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;