From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 2BC3163383D for ; Sat, 19 Sep 2015 02:03:46 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 01/12] nntp: use write_buf_size instead write_buf Date: Sat, 19 Sep 2015 02:03:29 +0000 Message-Id: <20150919020340.6484-2-e@80x24.org> In-Reply-To: <20150919020340.6484-1-e@80x24.org> References: <20150919020340.6484-1-e@80x24.org> List-Id: It is shorter code and probably faster than checking an array. --- lib/PublicInbox/NNTP.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index f1aaed4..807b49f 100644 --- a/lib/PublicInbox/NNTP.pm +++ b/lib/PublicInbox/NNTP.pm @@ -514,7 +514,7 @@ use constant MSG_MORE => ($^O eq 'linux') ? 0x8000 : 0; sub do_more { my ($self, $data) = @_; - if (MSG_MORE && !scalar @{$self->{write_buf}}) { + if (MSG_MORE && !$self->{write_buf_size}) { my $n = send($self->{sock}, $data, MSG_MORE); if (defined $n) { my $dlen = bytes::length($data); -- EW