about summary refs log tree commit homepage
path: root/lib/PublicInbox/ExtMsg.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-12-08 21:21:25 +0000
committerEric Wong <e@80x24.org>2020-12-09 21:13:31 +0000
commite3b57fe9f68e80fc85cff46ccec9246b670f1312 (patch)
tree826706be86815a62083ad953a2bbbb9f325cf670 /lib/PublicInbox/ExtMsg.pm
parent7e34a2145230eb97347ee8f1e63e79eb988a1946 (diff)
downloadpublic-inbox-e3b57fe9f68e80fc85cff46ccec9246b670f1312.tar.gz
{ibx} is shorter and is the most prevalent abbreviation
in indexing and IMAP code, and the `$ibx' local variable
is already prevalent throughout.

In general, the codebase favors removal of vowels in variable
and field names to denote non-references (because references are
"lighter" than non-references).

So update WWW and Filter users to use the same code since
it reduces confusion and may allow easier code sharing.
Diffstat (limited to 'lib/PublicInbox/ExtMsg.pm')
-rw-r--r--lib/PublicInbox/ExtMsg.pm10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/PublicInbox/ExtMsg.pm b/lib/PublicInbox/ExtMsg.pm
index 2a579c1b..43acfb53 100644
--- a/lib/PublicInbox/ExtMsg.pm
+++ b/lib/PublicInbox/ExtMsg.pm
@@ -76,7 +76,7 @@ sub search_partial ($$) {
 sub ext_msg_i {
         my ($other, $ctx) = @_;
 
-        return if $other->{name} eq $ctx->{-inbox}->{name} || !$other->base_url;
+        return if $other->{name} eq $ctx->{ibx}->{name} || !$other->base_url;
 
         my $mm = $other->mm or return;
 
@@ -107,7 +107,7 @@ sub ext_msg_ALL ($) {
         my ($ctx) = @_;
         my $ALL = $ctx->{www}->{pi_config}->ALL or return;
         my $by_eidx_key = $ctx->{www}->{pi_config}->{-by_eidx_key};
-        my $cur_key = $ctx->{-inbox}->eidx_key;
+        my $cur_key = $ctx->{ibx}->eidx_key;
         my %seen = ($cur_key => 1);
         my ($id, $prev);
         while (my $x = $ALL->over->next_by_mid($ctx->{mid}, \$id, \$prev)) {
@@ -123,7 +123,7 @@ sub ext_msg_ALL ($) {
         return exact($ctx) if $ctx->{found};
 
         # fall back to partial MID matching
-        for my $ibxish ($ctx->{-inbox}, $ALL) {
+        for my $ibxish ($ctx->{ibx}, $ALL) {
                 my $mids = search_partial($ibxish, $ctx->{mid}) or next;
                 push @{$ctx->{partial}}, [ $ibxish, $mids ];
                 last if ($ctx->{n_partial} += scalar(@$mids)) >= PARTIAL_MAX;
@@ -169,7 +169,7 @@ sub finalize_exact {
 
         # fall back to partial MID matching
         my $mid = $ctx->{mid};
-        my $cur = $ctx->{-inbox};
+        my $cur = $ctx->{ibx};
         my $mids = search_partial($cur, $mid);
         if ($mids) {
                 $ctx->{n_partial} = scalar(@$mids);
@@ -200,7 +200,7 @@ sub partial_response ($) {
                 my $es = $n_partial == 1 ? '' : 'es';
                 $n_partial .= '+' if ($n_partial == PARTIAL_MAX);
                 $s .= "\n$n_partial partial match$es found:\n\n";
-                my $cur_name = $ctx->{-inbox}->{name};
+                my $cur_name = $ctx->{ibx}->{name};
                 foreach my $pair (@{$ctx->{partial}}) {
                         my ($ibx, $res) = @$pair;
                         my $env = $ctx->{env} if $ibx->{name} eq $cur_name;