From: Eric Wong Date: Thu, 30 Nov 2023 11:40:57 +0000 (+0000) Subject: cindex: only create {-cidx_err} field on failures X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afef2fd49bf7b29daa5039bd5875bf3a66fed187;p=thirdparty%2Fpublic-inbox.git cindex: only create {-cidx_err} field on failures We only use it as a boolean flag, and there's no need to waste space for common, non-error cases. --- diff --git a/lib/PublicInbox/CodeSearchIdx.pm b/lib/PublicInbox/CodeSearchIdx.pm index bd67a57ed..cf6a6efe7 100644 --- a/lib/PublicInbox/CodeSearchIdx.pm +++ b/lib/PublicInbox/CodeSearchIdx.pm @@ -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 {