]> Sergey Matveev's repositories - public-inbox.git/commitdiff
nntp: use write_buf_size instead write_buf
authorEric Wong <e@80x24.org>
Sat, 19 Sep 2015 02:03:29 +0000 (02:03 +0000)
committerEric Wong <e@80x24.org>
Sat, 19 Sep 2015 04:18:36 +0000 (04:18 +0000)
It is shorter code and probably faster than checking an
array.

lib/PublicInbox/NNTP.pm

index f1aaed48de4e3d1149bae589d785eca6166e96b4..807b49f897304bdac7daa16d11ef576003422546 100644 (file)
@@ -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);