From 8d2513221e73649aed85ce8c3f37f7025ec1fec9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 1 Nov 2021 19:06:09 +0000 Subject: 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. --- lib/PublicInbox/IMAP.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/IMAP.pm') 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}; } -- cgit v1.2.3-24-ge0c7