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.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF 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 115311F59D for ; Sat, 23 Jul 2022 04:41:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1658551316; bh=Zuwc/HTXPwzfENtd/3uINpseeTn6B4wW428Ry8CYFQM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=hdHPok8gpB/z7ebW4rJuGtql9+7yinjI/2h4FOmOM1FGGTNy17/Q5IDXK9wEsMalH aBM823xufe5RURvpESMONsAxaSPGRiqLKrv515sTwa1znRQXe4RY2YHOc+nUu/n42b d8e0a/kz6KleIPIh37Hr6zJdwQjnUiKAPq1NNOWE= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 01/11] nntp: pass regexp to split() callers Date: Sat, 23 Jul 2022 04:41:45 +0000 Message-Id: <20220723044155.3733949-2-e@80x24.org> In-Reply-To: <20220723044155.3733949-1-e@80x24.org> References: <20220723044155.3733949-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Current implementations of Perl5 don't have optimizations for single-character field separators. --- lib/PublicInbox/NNTP.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index b36722d7..3d304c52 100644 --- a/lib/PublicInbox/NNTP.pm +++ b/lib/PublicInbox/NNTP.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2015-2021 all contributors +# Copyright (C) all contributors # License: AGPL-3.0+ # # Each instance of this represents a NNTP client socket @@ -71,7 +71,7 @@ sub new ($$$) { sub args_ok ($$) { my ($cb, $argc) = @_; my $tot = prototype $cb; - my ($nreq, undef) = split(';', $tot); + my ($nreq, undef) = split(/;/, $tot); $nreq = ($nreq =~ tr/$//) - 1; $tot = ($tot =~ tr/$//) - 1; ($argc <= $tot && $argc >= $nreq); @@ -349,7 +349,7 @@ sub cmd_newnews ($$$$;$$) { my $ts = eval { parse_time($date, $time, $gmt) }; return r501 if $@; more($self, '230 list of new articles by message-id follows'); - my ($keep, $skip) = split('!', $newsgroups, 2); + my ($keep, $skip) = split(/!/, $newsgroups, 2); ngpat2re($keep); ngpat2re($skip); my @names = grep(!/$skip/, grep(/$keep/,