about summary refs log tree commit homepage
path: root/lib/PublicInbox/Inbox.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-04-18 03:38:49 +0000
committerEric Wong <e@yhbt.net>2020-04-19 08:51:23 +0000
commita014723b600e35cd495f048c89611e611436a15e (patch)
treec74db81eb72ebb2fd6a4f48f6070b44263dcfee8 /lib/PublicInbox/Inbox.pm
parent95e5b6c343c45bb303db67fe7eb77e395c031e8d (diff)
downloadpublic-inbox-a014723b600e35cd495f048c89611e611436a15e.tar.gz
-Git->new and -Limiter->new will never fail unless there's
an OOM, so using `eval' is incorrect.
Diffstat (limited to 'lib/PublicInbox/Inbox.pm')
-rw-r--r--lib/PublicInbox/Inbox.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm
index e49f85fc..4bd82989 100644
--- a/lib/PublicInbox/Inbox.pm
+++ b/lib/PublicInbox/Inbox.pm
@@ -82,7 +82,7 @@ sub _set_uint ($$$) {
 sub _set_limiter ($$$) {
         my ($self, $pi_config, $pfx) = @_;
         my $lkey = "-${pfx}_limiter";
-        $self->{$lkey} ||= eval {
+        $self->{$lkey} ||= do {
                 # full key is: publicinbox.$NAME.httpbackendmax
                 my $mkey = $pfx.'max';
                 my $val = $self->{$mkey} or return;
@@ -130,7 +130,7 @@ sub version { $_[0]->{version} // 1 }
 sub git_epoch {
         my ($self, $epoch) = @_;
         $self->version == 2 or return;
-        $self->{"$epoch.git"} ||= eval {
+        $self->{"$epoch.git"} ||= do {
                 my $git_dir = "$self->{inboxdir}/git/$epoch.git";
                 my $g = PublicInbox::Git->new($git_dir);
                 $g->{-httpbackend_limiter} = $self->{-httpbackend_limiter};
@@ -141,7 +141,7 @@ sub git_epoch {
 
 sub git {
         my ($self) = @_;
-        $self->{git} ||= eval {
+        $self->{git} ||= do {
                 my $git_dir = $self->{inboxdir};
                 $git_dir .= '/all.git' if $self->version == 2;
                 my $g = PublicInbox::Git->new($git_dir);