From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4A9DE15807A for ; Thu, 05 Jun 2025 11:22:16 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 34096343102 for ; Thu, 05 Jun 2025 11:22:16 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 26AE01102BE; Thu, 05 Jun 2025 11:22:15 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 1C6991102BE for ; Thu, 05 Jun 2025 11:22:15 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CA74A343100 for ; Thu, 05 Jun 2025 11:22:14 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 441E028EB for ; Thu, 05 Jun 2025 11:22:13 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1749122523.f83b81eed578ea7bcee6bdcc1f72e233b1b81cd6.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/phase-helpers.sh X-VCS-Directories: bin/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: f83b81eed578ea7bcee6bdcc1f72e233b1b81cd6 X-VCS-Branch: master Date: Thu, 05 Jun 2025 11:22:13 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: c1a83a78-9542-40c8-8a0c-637b11ed9db8 X-Archives-Hash: bfb19e7f63bd5737d8bb909a2fc87c7f commit: f83b81eed578ea7bcee6bdcc1f72e233b1b81cd6 Author: Kerin Millar plushkava net> AuthorDate: Fri May 30 17:25:44 2025 +0000 Commit: Sam James gentoo org> CommitDate: Thu Jun 5 11:22:03 2025 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=f83b81ee phase-helpers.sh: accelerate in_iuse() by wrapping contains_word() EAPI >=5 implements the in_iuse() function. Accelerate it by having it call the contains_word() function, as opposed to the has() function. Its performance should increase markedly. Note that portage strips the and characters in the course of incorporating IUSE into IUSE_EFFECTIVE. if explicit_iuse is None: explicit_iuse = frozenset(x.lstrip("+-") for x in iuse.split()) # ... if eapi_attrs.iuse_effective: portage_iuse = set(self._iuse_effective) portage_iuse.update(explicit_iuse) See-also: 4a4631eef7186c29668a8c049d988b61469940fd Link: https://github.com/gentoo/portage/pull/458 Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> bin/phase-helpers.sh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh index fbda4a29fa..f006aa92e0 100644 --- a/bin/phase-helpers.sh +++ b/bin/phase-helpers.sh @@ -1118,16 +1118,13 @@ fi if ___eapi_has_in_iuse; then in_iuse() { - local use=${1} - - if [[ -z "${use}" ]]; then - echo "!!! in_iuse() called without a parameter." >&2 - echo "!!! in_iuse " >&2 + if [[ ! $1 ]]; then + printf >&2 '!!! %s\n' \ + "in_iuse() called without a parameter." \ + "in_iuse " die "in_iuse() called without a parameter" fi - local liuse=( ${IUSE_EFFECTIVE} ) - - has "${use}" "${liuse[@]#[+-]}" + contains_word "$1" "${IUSE_EFFECTIVE}" } fi