From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 8DE161F487 for ; Tue, 28 Nov 2023 14:56:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1701183388; bh=/lamGFe4opC0T9/ZKgOnvBedZDC7lDo3DHxmjZ/G850=; h=From:To:Subject:Date:In-Reply-To:References:From; b=4y7F2cWu7C9oKpBC3ydiYgp4Z/S2ynvuQGZFZIesLyAoOsMRP8HY4S/dT325jr/MA H4YfrpMUap4UVRNCSox2AjH1VnziSPgPgtS3kjAw85Vgg9e+B68OGSHUFSkWOMfC2D j0Mv1qkfYKZTLqnHGTMJ3v5kL9Stvv8q/W/ok1rw= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 03/14] codesearch: eliminate redundant substitutions Date: Tue, 28 Nov 2023 14:56:16 +0000 Message-ID: <20231128145628.1455176-4-e@80x24.org> In-Reply-To: <20231128145628.1455176-1-e@80x24.org> References: <20231128145628.1455176-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We store the full path name and xap_terms already removes the `P' character, so the loop and substr calls are a no-op replacing `/' with `/'. --- lib/PublicInbox/CodeSearch.pm | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/PublicInbox/CodeSearch.pm b/lib/PublicInbox/CodeSearch.pm index 9051d85f..eb057525 100644 --- a/lib/PublicInbox/CodeSearch.pm +++ b/lib/PublicInbox/CodeSearch.pm @@ -191,7 +191,6 @@ sub roots2paths { # for diagnostics } $size = $mset->size; } while ($size); - substr($_, 0, 1, '/') for @$dirs; # s!^P!/! @$dirs = sort @$dirs; } \%ret;