]> Sergey Matveev's repositories - public-inbox.git/commitdiff
inbox: git_epoch: remove ->version check
authorEric Wong <e@80x24.org>
Mon, 23 Nov 2020 07:05:55 +0000 (07:05 +0000)
committerEric Wong <e@80x24.org>
Tue, 24 Nov 2020 05:03:55 +0000 (05:03 +0000)
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

index 64b12345b22dc6a5cdfb9c41380957a293921159..a1a072adc829eed9431cf4248a12915a7c20f313 100644 (file)
@@ -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;