From 48cfcb04ed337f96e5105a2f93d127d2d6692c5a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 16 Oct 2021 01:01:02 +0000 Subject: inbox + search: use 5.10.1 and do some golfing Some yak-shaving while I try to track down other bugs... --- lib/PublicInbox/Inbox.pm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lib/PublicInbox/Inbox.pm') diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm index 74b8a74f..b7b71268 100644 --- a/lib/PublicInbox/Inbox.pm +++ b/lib/PublicInbox/Inbox.pm @@ -4,6 +4,7 @@ # Represents a public-inbox (which may have multiple mailing addresses) package PublicInbox::Inbox; use strict; +use v5.10.1; use PublicInbox::Git; use PublicInbox::MID qw(mid2path); use PublicInbox::Eml; @@ -293,17 +294,15 @@ sub msg_by_smsg ($$) { # ghosts may have undef smsg (from SearchThread.node) or # no {blob} field - return unless defined $smsg; - defined(my $blob = $smsg->{blob}) or return; - - $self->git->cat_file($blob); + $smsg // return; + $self->git->cat_file($smsg->{blob} // return); } sub smsg_eml { my ($self, $smsg) = @_; my $bref = msg_by_smsg($self, $smsg) or return; my $eml = PublicInbox::Eml->new($bref); - $smsg->populate($eml) unless exists($smsg->{num}); # v1 w/o SQLite + $smsg->{num} // $smsg->populate($eml); $eml; } @@ -313,7 +312,7 @@ sub smsg_by_mid ($$) { my $smsg; if (my $mm = $self->mm) { # favor the Message-ID we used for the NNTP article number: - defined(my $num = $mm->num_for($mid)) or return; + my $num = $mm->num_for($mid) // return; $smsg = $over->get_art($num); } else { my ($id, $prev); -- cgit v1.2.3-24-ge0c7