]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
cindex: only create {-cidx_err} field on failures
authorEric Wong <e@80x24.org>
Thu, 30 Nov 2023 11:40:57 +0000 (11:40 +0000)
committerEric Wong <e@80x24.org>
Thu, 30 Nov 2023 21:36:51 +0000 (21:36 +0000)
We only use it as a boolean flag, and there's no need to waste
space for common, non-error cases.

lib/PublicInbox/CodeSearchIdx.pm

index bd67a57ed97439f825e2861aead50b42b8e1f250..cf6a6efe77ec3dd39a25cc8a5d4c64a74330b9f7 100644 (file)
@@ -383,8 +383,8 @@ sub git_dir_hash ($) { hex(substr(sha256_hex($_[0]), 0, 8)) }
 sub _cb { # run_await cb
        my ($pid, $cmd, undef, $opt, $cb, $self, $git, @arg) = @_;
        return if $DO_QUIT;
-       ($git->{-cidx_err} = $?) ? warn("W: @$cmd (\$?=$?)\n") :
-                               $cb->($opt, $self, $git, @arg);
+       $? ? ($git->{-cidx_err} = warn("W: @$cmd (\$?=$?)\n")) :
+                       $cb->($opt, $self, $git, @arg);
 }
 
 sub run_git {