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 E70541F487 for ; Sat, 25 Nov 2023 20:54:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1700945676; bh=rTYP4NFSU04uuGNSXZ/302I2fyCxDxdsC3DM25GIvNg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=phmmVuTjq0VPEnhqeQpgrjnF4ttlWB181Rpn14JNf33wlYDPMwPzUCbYIhDlg6L/I DS9jfczEArhs6PiElVgbVDCYyjH62zEa/y/CkiGVRaipzcGFqeluONOi5KsbByVaUO 0+2nhhXmCwLi8ZOp/pHmh7j2IfBwoSBafz3uqLso= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 3/3] ds: long_step: eliminate redundant fileno call Date: Sat, 25 Nov 2023 20:54:35 +0000 Message-ID: <20231125205435.4187895-4-e@80x24.org> In-Reply-To: <20231125205435.4187895-1-e@80x24.org> References: <20231125205435.4187895-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We already stash the associated FD for reporting at startup and don't need to call `fileno' again. Found via manual code inspection while considering the effort to make async {forward} from PublicInbox::HTTP more like the generic long_response API and {long_cb} field used by IMAP/NNTP/POP3. --- lib/PublicInbox/DS.pm | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/PublicInbox/DS.pm b/lib/PublicInbox/DS.pm index 4c8b502f..8bc8cfb7 100644 --- a/lib/PublicInbox/DS.pm +++ b/lib/PublicInbox/DS.pm @@ -629,7 +629,6 @@ sub long_step { delete $self->{long_cb}; $self->long_response_done; my $elapsed = now() - $t0; - my $fd = fileno($self->{sock}); $self->out(" deferred[$fd] done - %0.6f", $elapsed); my $wbuf = $self->{wbuf}; # do NOT autovivify requeue($self) unless $wbuf && @$wbuf;