diff options
author | Eric Wong <e@yhbt.net> | 2020-05-17 19:48:14 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-05-19 07:42:48 +0000 |
commit | 7bca96023bb26438a5c9d0a7eec3986f5d66f5bf (patch) | |
tree | 4b92cc3c85faad6986a80b122bb41072a583397a /lib/PublicInbox/SearchIdxShard.pm | |
parent | c43813b9138398ed2de06c3616a5932725090ae3 (diff) | |
download | public-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/SearchIdxShard.pm')
-rw-r--r-- | lib/PublicInbox/SearchIdxShard.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/SearchIdxShard.pm b/lib/PublicInbox/SearchIdxShard.pm index e754b038..c1f52d8b 100644 --- a/lib/PublicInbox/SearchIdxShard.pm +++ b/lib/PublicInbox/SearchIdxShard.pm @@ -53,7 +53,7 @@ sub shard_worker_loop ($$$$$) { my ($self, $v2w, $r, $shard, $bnote) = @_; $0 = "pi-v2-shard[$shard]"; $self->begin_txn_lazy; - while (my $line = $r->getline) { + while (my $line = readline($r)) { $v2w->{current_info} = "[$shard] $line"; if ($line eq "commit\n") { $self->commit_txn_lazy; |