From 0a1e9e975792489a64d249ed830d709f8e949dc7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 7 Jul 2016 01:39:34 +0000 Subject: githttpbackend: avoid intermediate array creation from stat No need to keep an extra array around for this. --- lib/PublicInbox/GitHTTPBackend.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/PublicInbox/GitHTTPBackend.pm') diff --git a/lib/PublicInbox/GitHTTPBackend.pm b/lib/PublicInbox/GitHTTPBackend.pm index a9c0e9c7..b684988d 100644 --- a/lib/PublicInbox/GitHTTPBackend.pm +++ b/lib/PublicInbox/GitHTTPBackend.pm @@ -96,8 +96,7 @@ sub serve_dumb { my $f = (ref $git ? $git->{git_dir} : $git) . '/' . $path; return r(404) unless -f $f && -r _; # just in case it's a FIFO :P - my @st = stat(_); - my $size = $st[7]; + my $size = -s _; # TODO: If-Modified-Since and Last-Modified? open my $in, '<', $f or return r(404); -- cgit v1.2.3-24-ge0c7