From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 5D98C1F463; Thu, 26 Dec 2019 06:48:34 +0000 (UTC) Date: Thu, 26 Dec 2019 06:48:34 +0000 From: Eric Wong To: meta@public-inbox.org Subject: Re: [PATCH 18/30] config: each_inbox: pass user arg to callback Message-ID: <20191226064834.GA17341@dcvr> References: <20191225075104.22184-1-e@80x24.org> <20191225075104.22184-19-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20191225075104.22184-19-e@80x24.org> List-Id: Eric Wong wrote: > index bcb968af..28716668 100644 > --- a/lib/PublicInbox/WwwListing.pm > +++ b/lib/PublicInbox/WwwListing.pm > sub list_all ($$$) { > my ($self, $env, $hide_key) = @_; > - my @list; > - $self->{pi_config}->each_inbox(sub { > - my ($ibx) = @_; > - push @list, $ibx unless $ibx->{-hide}->{$hide_key}; > - }); > - \@list; > + my $list = []; > + $self->{pi_config}->each_inbox(\&list_all_i, [ $list, $hide_key ]); > + \$list; > +} Yup, I zoned out on that one with '\$list'. Going to squash this in: diff --git a/lib/PublicInbox/WwwListing.pm b/lib/PublicInbox/WwwListing.pm index 28716668..cdc4d2d4 100644 --- a/lib/PublicInbox/WwwListing.pm +++ b/lib/PublicInbox/WwwListing.pm @@ -26,7 +26,7 @@ sub list_all ($$$) { my ($self, $env, $hide_key) = @_; my $list = []; $self->{pi_config}->each_inbox(\&list_all_i, [ $list, $hide_key ]); - \$list; + $list; } sub list_match_domain_i {