aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2021-03-20 18:19:35 +0100
committerThomas Deutschmann <whissi@gentoo.org>2021-03-21 19:19:45 +0100
commit90a6419e5f0982baa1493749f6fb1b3c2fe33e7d (patch)
tree29d02d4e0ca1dcd9599a790c3a09292ee02af547
parentinitrd.scripts: is_debug(): Mark local variable as such (diff)
downloadgenkernel-90a6419e5f0982baa1493749f6fb1b3c2fe33e7d.tar.gz
genkernel-90a6419e5f0982baa1493749f6fb1b3c2fe33e7d.tar.bz2
genkernel-90a6419e5f0982baa1493749f6fb1b3c2fe33e7d.zip
initrd.scripts: is_true(): Optimize for most frequently used value
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
-rw-r--r--defaults/initrd.scripts9
1 files 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
}