about summary refs log tree commit homepage
path: root/lib/PublicInbox/OverIdx.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-03-20 08:18:17 +0000
committerEric Wong <e@yhbt.net>2020-03-22 09:00:23 +0000
commitd34a4b80724e3f77a507ad08b91039427b0e09d5 (patch)
treec930108cd1964e26059fce8e5b015798b20be324 /lib/PublicInbox/OverIdx.pm
parent33ce2aa920d9ebffb0affcb216ebf03320c7492d (diff)
downloadpublic-inbox-d34a4b80724e3f77a507ad08b91039427b0e09d5.tar.gz
Favor `$smsg->{mid}' instead of `$mid0' to reduce parameters
down-the-line, but favor passing the Email::MIME::Header object
around instead of relying on the bloat-prone `$smsg->{mime}'
and calling ->header_obj on it.
Diffstat (limited to 'lib/PublicInbox/OverIdx.pm')
-rw-r--r--lib/PublicInbox/OverIdx.pm8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/PublicInbox/OverIdx.pm b/lib/PublicInbox/OverIdx.pm
index 9640f9d1..f49dfa00 100644
--- a/lib/PublicInbox/OverIdx.pm
+++ b/lib/PublicInbox/OverIdx.pm
@@ -216,15 +216,13 @@ sub link_refs {
 }
 
 sub parse_references ($$$) {
-        my ($smsg, $mid0, $mids) = @_;
-        my $mime = $smsg->{mime};
-        my $hdr = $mime->header_obj;
+        my ($smsg, $hdr, $mids) = @_;
         my $refs = references($hdr);
         push(@$refs, @$mids) if scalar(@$mids) > 1;
         return $refs if scalar(@$refs) == 0;
 
         # prevent circular references here:
-        my %seen = ( $mid0 => 1 );
+        my %seen = ( $smsg->{mid} => 1 );
         my @keep;
         foreach my $ref (@$refs) {
                 if (length($ref) > PublicInbox::MID::MAX_MID_SIZE) {
@@ -258,7 +256,7 @@ sub add_overview {
         }, 'PublicInbox::Smsg';
         my $hdr = $mime->header_obj;
         my $mids = mids_for_index($hdr);
-        my $refs = parse_references($smsg, $mid0, $mids);
+        my $refs = parse_references($smsg, $hdr, $mids);
         my $subj = $smsg->subject;
         my $xpath;
         if ($subj ne '') {