]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
imap: fetch_compile: more meaningful variable names
authorEric Wong <e@80x24.org>
Sat, 28 Jun 2025 11:20:12 +0000 (11:20 +0000)
committerEric Wong <e@80x24.org>
Mon, 30 Jun 2025 08:20:40 +0000 (08:20 +0000)
Match the variable names used by callers to refuse confusion
rather than an ambiguously-named array and meaningless offsets.

lib/PublicInbox/IMAP.pm

index 807e9c09dfb069aea8a7826766aba572085cd53e..020a205aeff271ea0bfbe915630ba1f52a0c13f5 100644 (file)
@@ -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 ($$$$;@) {