From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B5E881382C5 for ; Sun, 21 Mar 2021 22:36:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AE8F7E0869; Sun, 21 Mar 2021 22:36:11 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 97836E0869 for ; Sun, 21 Mar 2021 22:36:11 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7B3AD335D1E for ; Sun, 21 Mar 2021 22:36:10 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D4CF95CF for ; Sun, 21 Mar 2021 22:36:08 +0000 (UTC) From: "Thomas Deutschmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" Message-ID: <1616350785.90a6419e5f0982baa1493749f6fb1b3c2fe33e7d.whissi@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: defaults/ X-VCS-Repository: proj/genkernel X-VCS-Files: defaults/initrd.scripts X-VCS-Directories: defaults/ X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: 90a6419e5f0982baa1493749f6fb1b3c2fe33e7d X-VCS-Branch: master Date: Sun, 21 Mar 2021 22:36:08 +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: 564485e5-8677-48ad-81ec-874d00d74c48 X-Archives-Hash: 2bd6206b3b3a796a8ba15ebf4190bb09 commit: 90a6419e5f0982baa1493749f6fb1b3c2fe33e7d Author: Thomas Deutschmann gentoo org> AuthorDate: Sat Mar 20 17:19:35 2021 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Sun Mar 21 18:19:45 2021 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=90a6419e initrd.scripts: is_true(): Optimize for most frequently used value Signed-off-by: Thomas Deutschmann gentoo.org> defaults/initrd.scripts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 8dcb9e2..ccbc16d 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -628,7 +628,10 @@ is_log_enabled() { } is_true() { - case "$1" in + case "${1}" in + 1) + return 0 + ;; [Tt][Rr][Uu][Ee]) return 0 ;; @@ -641,10 +644,8 @@ is_true() { [Yy]) return 0 ;; - 1) - return 0 - ;; esac + return 1 }