From: Eric Wong Date: Sat, 28 Jun 2025 11:20:12 +0000 (+0000) Subject: imap: fetch_compile: more meaningful variable names X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd43ac2af2b28d8e0b078a8b082d62e1be8a02dc;p=thirdparty%2Fpublic-inbox.git imap: fetch_compile: more meaningful variable names Match the variable names used by callers to refuse confusion rather than an ambiguously-named array and meaningless offsets. --- diff --git a/lib/PublicInbox/IMAP.pm b/lib/PublicInbox/IMAP.pm index 807e9c09d..020a205ae 100644 --- a/lib/PublicInbox/IMAP.pm +++ b/lib/PublicInbox/IMAP.pm @@ -996,12 +996,12 @@ sub fetch_compile ($) { return "BAD param: $att"; } } - my @r; + my ($cb, $ops, $partial); # return values # stabilize partial order for consistency and ease-of-debugging: if (scalar keys %partial) { $need |= NEED_BLOB; - @{$r[2]} = map { [ $_, @{$partial{$_}} ] } sort keys %partial; + @$partial = map { [ $_, @{$partial{$_}} ] } sort keys %partial; } push @op, $OP_EML_NEW if ($need & (EML_HDR|EML_BDY)); @@ -1019,13 +1019,13 @@ sub fetch_compile ($) { } } - $r[0] = $need & NEED_BLOB ? \&fetch_blob : + $cb = $need & NEED_BLOB ? \&fetch_blob : ($need & NEED_SMSG ? \&fetch_smsg : \&fetch_uid); # r[1] = [ $key1, $cb1, $key2, $cb2, ... ] use sort 'stable'; # makes output more consistent - @{$r[1]} = map { ($_->[2], $_->[1]) } sort { $a->[0] <=> $b->[0] } @op; - @r; + @$ops = map { ($_->[2], $_->[1]) } sort { $a->[0] <=> $b->[0] } @op; + ($cb, $ops, $partial); } sub cmd_uid_fetch ($$$$;@) {