From afef2fd49bf7b29daa5039bd5875bf3a66fed187 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 30 Nov 2023 11:40:57 +0000 Subject: 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. --- lib/PublicInbox/CodeSearchIdx.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/CodeSearchIdx.pm b/lib/PublicInbox/CodeSearchIdx.pm index bd67a57e..cf6a6efe 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 { -- cgit v1.2.3-24-ge0c7