about summary refs log tree commit homepage
path: root/lib/PublicInbox
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-11-28 05:32:01 +0000
committerEric Wong <e@80x24.org>2022-11-28 23:38:57 +0000
commitd28167f0a78a2010a752bdc16b3b8a62e8fc91ae (patch)
tree1d24ac7c4295cae1e9763ab377a41361db423205 /lib/PublicInbox
parentb5b4e2de2d6949d588e6521ef25d4a01ab3a878b (diff)
downloadpublic-inbox-d28167f0a78a2010a752bdc16b3b8a62e8fc91ae.tar.gz
fetch: eliminate File::Temp->filename var
File::Temp objects are overloaded to automatically
call ->filename when stringified, so there's no need
to store the ->filename result on the Perl stack.
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r--lib/PublicInbox/Fetch.pm5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/PublicInbox/Fetch.pm b/lib/PublicInbox/Fetch.pm
index d75e427b..198e2a60 100644
--- a/lib/PublicInbox/Fetch.pm
+++ b/lib/PublicInbox/Fetch.pm
@@ -48,7 +48,6 @@ sub do_manifest ($$$) {
         my $muri = URI->new("$ibx_uri/manifest.js.gz");
         my $ft = File::Temp->new(TEMPLATE => 'm-XXXX',
                                 UNLINK => 1, DIR => $dir, SUFFIX => '.tmp');
-        my $fn = $ft->filename;
         my $mf = "$dir/manifest.js.gz";
         my $m0; # current manifest.js.gz contents
         if (open my $fh, '<', $mf) {
@@ -57,7 +56,7 @@ sub do_manifest ($$$) {
                 };
                 warn($@) if $@;
         }
-        my ($bn) = ($fn =~ m!/([^/]+)\z!);
+        my ($bn) = ($ft->filename =~ m!/([^/]+)\z!);
         my $curl_cmd = $lei->{curl}->for_uri($lei, $muri, qw(-R -o), $bn);
         my $opt = { -C => $dir };
         $opt->{$_} = $lei->{$_} for (0..2);
@@ -68,7 +67,7 @@ sub do_manifest ($$$) {
                 return;
         }
         my $m1 = eval {
-                PublicInbox::LeiMirror::decode_manifest($ft, $fn, $muri);
+                PublicInbox::LeiMirror::decode_manifest($ft, $ft, $muri);
         } or return [ 404, $muri ];
         my $mdiff = { %$m1 };