]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
ds: avoid ->method dispatch for `print'
authorEric Wong <e@80x24.org>
Tue, 17 Jun 2025 00:13:35 +0000 (00:13 +0000)
committerEric Wong <e@80x24.org>
Wed, 18 Jun 2025 11:04:31 +0000 (11:04 +0000)
`->method' dispatches have always been slower than directly
invoking Perl ops without `->', so favor the latter.

lib/PublicInbox/DS.pm

index 38b3635152bc2430a98b7e5d4580297a990014e9..901e762b96f2475ac0b06e2bcb612bb86306b54b 100644 (file)
@@ -511,7 +511,7 @@ sub write {
                        my $tmpio = $wbuf->[-1];
                        if (ref($tmpio) eq 'ARRAY' && !defined($tmpio->[2])) {
                                # append to tmp file buffer
-                               $tmpio->[0]->print($$bref) or
+                               print { $tmpio->[0] } $$bref or
                                        return drop($self, "print: $!");
                        } else {
                                $tmpio = tmpio $self, $bref, 0 or return 0;