about summary refs log tree commit homepage
path: root/lib/PublicInbox/Inbox.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-06-01 10:06:52 +0000
committerEric Wong <e@yhbt.net>2020-06-03 04:04:21 +0000
commit7e782e8ff3ec64500913069a2efb5815fe711a36 (patch)
tree52ac6cf6ac5a8bbfae97ffd6cae2f160e4ee22d4 /lib/PublicInbox/Inbox.pm
parentd32333a12ca46861fab82640c3697fdbca879bd2 (diff)
downloadpublic-inbox-7e782e8ff3ec64500913069a2efb5815fe711a36.tar.gz
To further simplify callers and avoid embarrasing memory
explosions[1], we can finally eliminate this method in
favor of smsg_eml.

[1] commit 7d02b9e64455831d3bda20cd2e64e0c15dc07df5
    ("view: stop storing all MIME objects on large threads")
    fixed a huge memory blowup.
Diffstat (limited to 'lib/PublicInbox/Inbox.pm')
-rw-r--r--lib/PublicInbox/Inbox.pm12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm
index 38abdfe5..af034358 100644
--- a/lib/PublicInbox/Inbox.pm
+++ b/lib/PublicInbox/Inbox.pm
@@ -326,18 +326,12 @@ sub msg_by_smsg ($$) {
         git($self)->cat_file($blob);
 }
 
-sub smsg_mime {
-        my ($self, $smsg) = @_;
-        if (my $s = msg_by_smsg($self, $smsg)) {
-                $smsg->{mime} = PublicInbox::Eml->new($s);
-                return $smsg;
-        }
-}
-
 sub smsg_eml {
         my ($self, $smsg) = @_;
         my $bref = msg_by_smsg($self, $smsg) or return;
-        PublicInbox::Eml->new($bref);
+        my $eml = PublicInbox::Eml->new($bref);
+        $smsg->populate($eml) unless exists($smsg->{num}); # v1 w/o SQLite
+        $eml;
 }
 
 sub mid2num($$) {