about summary refs log tree commit homepage
path: root/lib/PublicInbox/IMAP.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-11-01 19:06:09 +0000
committerEric Wong <e@80x24.org>2021-11-01 19:49:39 +0000
commit8d2513221e73649aed85ce8c3f37f7025ec1fec9 (patch)
treef133a22e4174ae5326a45ca2a3dc63604f0c72d4 /lib/PublicInbox/IMAP.pm
parentb46de4da83d797281af9603f350e5b7105845eed (diff)
downloadpublic-inbox-8d2513221e73649aed85ce8c3f37f7025ec1fec9.tar.gz
treewide: kill problematic "$h->{k} //= do {" assignments
As stated in the previous change, conditional hash assignments
which trigger other hash assignments seem problematic, at times.
So replace:

	$h->{k} //= do { $h->{x} = ...; $val };

	$h->{k} // do {
		$h->{x} = ...;
		$hk->{k} = $val
	};

"||=" is affected the same way, and some instances of "||=" are
replaced with "//=" or "// do {", now.
Diffstat (limited to 'lib/PublicInbox/IMAP.pm')
-rw-r--r--lib/PublicInbox/IMAP.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/IMAP.pm b/lib/PublicInbox/IMAP.pm
index 4a7ff2f4..58a0a9e3 100644
--- a/lib/PublicInbox/IMAP.pm
+++ b/lib/PublicInbox/IMAP.pm
@@ -871,12 +871,12 @@ sub eml_index_offs_i { # PublicInbox::Eml::each_part callback
 # prepares an index for BODY[$SECTION_IDX] fetches
 sub eml_body_idx ($$) {
         my ($eml, $section_idx) = @_;
-        my $idx = $eml->{imap_all_parts} //= do {
+        my $idx = $eml->{imap_all_parts} // do {
                 my $all = {};
                 $eml->each_part(\&eml_index_offs_i, $all, 0, 1);
                 # top-level of multipart, BODY[0] not allowed (nz-number)
                 delete $all->{0};
-                $all;
+                $eml->{imap_all_parts} = $all;
         };
         $idx->{$section_idx};
 }