From 19671d5736639c9f5d063a87a075fd309e41d203 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 25 Jan 2020 04:45:09 +0000 Subject: viewdiff: use autovivification for long_path hash No sense in wasting code to do something the interpreter already does for us. --- lib/PublicInbox/ViewDiff.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/PublicInbox/ViewDiff.pm b/lib/PublicInbox/ViewDiff.pm index ff7d85f5..ece95f4c 100644 --- a/lib/PublicInbox/ViewDiff.pm +++ b/lib/PublicInbox/ViewDiff.pm @@ -92,8 +92,7 @@ sub anchor0 ($$$$$) { # long filenames will require us to walk backwards in anchor1 if ($fn =~ s!\A\.\.\./?!!) { - my $lp = $ctx->{-long_path} ||= {}; - $lp->{$fn} = qr/\Q$fn\E\z/s; + $ctx->{-long_path}->{$fn} = qr/\Q$fn\E\z/s; } if (my $attr = to_attr($ctx->{-apfx}.$fn)) { -- cgit v1.2.3-24-ge0c7