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-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 9D6F71FB06 for ; Sat, 23 Jan 2021 10:27:56 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 09/10] lei forget-external: don't show redundant "not found" Date: Sat, 23 Jan 2021 10:27:54 +0000 Message-Id: <20210123102755.425-10-e@80x24.org> In-Reply-To: <20210123102755.425-1-e@80x24.org> References: <20210123102755.425-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Pathname/URL canonicalization may not change the result at all, so there's no point in trying (and failing) the same form twice if pre and post-canonicalization are identical. --- lib/PublicInbox/LeiExternal.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/PublicInbox/LeiExternal.pm b/lib/PublicInbox/LeiExternal.pm index 5b5f08d1..e7693e09 100644 --- a/lib/PublicInbox/LeiExternal.pm +++ b/lib/PublicInbox/LeiExternal.pm @@ -69,9 +69,11 @@ sub lei_forget_external { my ($self, @locations) = @_; my $cfg = $self->_lei_cfg(1); my $quiet = $self->{opt}->{quiet}; + my %seen; for my $loc (@locations) { my (@unset, @not_found); for my $l ($loc, _canonicalize($loc)) { + next if $seen{$l}++; my $key = "external.$l.boost"; delete($cfg->{$key}); $self->_config('--unset', $key);