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 8706D1F61A for ; Sat, 21 Mar 2020 01:10:34 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/2] wwwlisting: use first successfully loaded JSON module Date: Sat, 21 Mar 2020 01:10:33 +0000 Message-Id: <20200321011034.3731-2-e@yhbt.net> In-Reply-To: <20200321011034.3731-1-e@yhbt.net> References: <20200321011034.3731-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: And not the last... I only noticed this since JSON::PP::Boolean was spewing redefinition warnings via overload.pm Fixes: 8fb8fc52420ef669 ("wwwlisting: avoid lazy loading JSON module") --- lib/PublicInbox/WwwListing.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PublicInbox/WwwListing.pm b/lib/PublicInbox/WwwListing.pm index 33cb0ace..42a0c0d8 100644 --- a/lib/PublicInbox/WwwListing.pm +++ b/lib/PublicInbox/WwwListing.pm @@ -20,7 +20,7 @@ if (eval { require IO::Compress::Gzip }) { for my $mod (qw(JSON::MaybeXS JSON JSON::PP)) { eval "require $mod" or next; # ->ascii encodes non-ASCII to "\uXXXX" - $json = $mod->new->ascii(1); + $json = $mod->new->ascii(1) and last; } }