Commit c793baea authored by Sebastian Gniazdowski's avatar Sebastian Gniazdowski
Browse files

znt: optimize heap usage for older Zsh's (e.g. 5.0.8)

parent 89205f90
......@@ -224,7 +224,11 @@ zcurses timeout main -1
key=""
keypad=""
list=( "$@" )
# This loop makes script faster on some Zsh's (e.g. 5.0.8)
repeat 1; do
list=( "$@" )
done
last_element="$#list"
while (( 1 )); do
......
......@@ -32,7 +32,11 @@ if [ -t 0 ]; then
return 1
fi
list=( `"$@"` )
# This loop makes script faster on some Zsh's (e.g. 5.0.8)
repeat 1; do
list=( `"$@"` )
done
# TODO: $? doesn't reach user
[ "$?" -eq 127 ] && return $?
else
......@@ -42,7 +46,10 @@ else
return 1
fi
list=( "${(@f)"$(<&0)"}" )
# This loop makes script faster on some Zsh's (e.g. 5.0.8)
repeat 1; do
list=( "${(@f)"$(<&0)"}" )
done
if [[ ! -c /dev/tty ]]; then
exec <&2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment