about summary refs log tree commit homepage
path: root/lib/PublicInbox/V2Writable.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-05-17 19:48:14 +0000
committerEric Wong <e@yhbt.net>2020-05-19 07:42:48 +0000
commit7bca96023bb26438a5c9d0a7eec3986f5d66f5bf (patch)
tree4b92cc3c85faad6986a80b122bb41072a583397a /lib/PublicInbox/V2Writable.pm
parentc43813b9138398ed2de06c3616a5932725090ae3 (diff)
downloadpublic-inbox-7bca96023bb26438a5c9d0a7eec3986f5d66f5bf.tar.gz
In our inbox-writing code paths, ->getline as an OO method may
be confused with the various definitions of `getline' used by
the PSGI interface.  It's also easier to do: "perldoc -f readline"
than to figure out which class "->getline" belongs to (IO::Handle)
and lookup documentation for that.

->print is less confusing than the "readline" vs "getline"
mismatch, but we can still make it clear we're using a real
file handle and not a mock interface.

Finally, functions are a bit faster than their OO counterparts.
Diffstat (limited to 'lib/PublicInbox/V2Writable.pm')
-rw-r--r--lib/PublicInbox/V2Writable.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm
index c732b98a..513e9f23 100644
--- a/lib/PublicInbox/V2Writable.pm
+++ b/lib/PublicInbox/V2Writable.pm
@@ -606,7 +606,7 @@ sub barrier_wait {
         my $bnote = $self->{bnote} or return;
         my $r = $bnote->[0];
         while (scalar keys %$barrier) {
-                defined(my $l = $r->getline) or die "EOF on barrier_wait: $!";
+                defined(my $l = readline($r)) or die "EOF on barrier_wait: $!";
                 $l =~ /\Abarrier (\d+)/ or die "bad line on barrier_wait: $l";
                 delete $barrier->{$1} or die "bad shard[$1] on barrier wait";
         }