From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id A72CC1F513 for ; Thu, 30 Nov 2023 11:41:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1701344469; bh=H7oxGOlRQOCMx58/5fVbiXEOq9aexql68aJHSBgKYaw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TMouQ9N0DLXWzaa/al71FLJyRqZlZLcR0gcdR9K+Qrx5uqSQA831bv2+EfNt3RjDZ 2FLA/InwZrDpXf1lQF5yxEBDFrYNZgoDUxgdUhJzUvxFXPG/wCc5dxNtAtNB4+x3Yc vmNdsl2sWND1gNX5Acs1rNr5WpYVmaxpw+NYXuLQ= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 04/15] cindex: only create {-cidx_err} field on failures Date: Thu, 30 Nov 2023 11:40:57 +0000 Message-ID: <20231130114109.2577708-5-e@80x24.org> In-Reply-To: <20231130114109.2577708-1-e@80x24.org> References: <20231130114109.2577708-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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 {