diff options
author | P. J. McDermott <pj@pehjota.net> | 2016-03-24 21:12:52 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2017-02-08 18:27:24 (EST) |
commit | e5c77eaa6612ef5026ad84a4af8022f47d425c82 (patch) | |
tree | 1094936ea72184b579001fd147f1cfda785e0825 /eshtrans | |
parent | b41b9028d447fbd0444824280d53e2b28e8355ad (diff) | |
download | eggshell-e5c77eaa6612ef5026ad84a4af8022f47d425c82.zip eggshell-e5c77eaa6612ef5026ad84a4af8022f47d425c82.tar.gz eggshell-e5c77eaa6612ef5026ad84a4af8022f47d425c82.tar.bz2 |
eshtrans/eshrt: Collapse case constructs in __fn_ctxsw()
Diffstat (limited to 'eshtrans')
-rw-r--r-- | eshtrans/eshrt/eshrtbegin.esh | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/eshtrans/eshrt/eshrtbegin.esh b/eshtrans/eshrt/eshrtbegin.esh index eb0d517..23cf542 100644 --- a/eshtrans/eshrt/eshrtbegin.esh +++ b/eshtrans/eshrt/eshrtbegin.esh @@ -69,29 +69,25 @@ __frame_get() __fn_ctxsw() { unset IFS - case "${__prev_tu}" in - ${__fn_tu});; - ?*) - # Unset static variables and functions from previous TU. - eval "__val=\${__${__prev_tu}_static_vars}" - case "${__val}" in ?*) - eval "unset \${__${__prev_tu}_static_vars}" - ;; esac - eval "__val=\${__${__prev_tu}_static_fns}" - for __fn in ${__val}; do - unset -f "${__fn%:*}" - done + case "${__prev_tu}" in ${__fn_tu});; ?*) + # Unset static variables and functions from previous TU. + eval "__val=\${__${__prev_tu}_static_vars}" + case "${__val}" in ?*) + eval "unset \${__${__prev_tu}_static_vars}" + ;; esac + eval "__val=\${__${__prev_tu}_static_fns}" + for __fn in ${__val}; do + unset -f "${__fn%:*}" + done ;; esac - case "${__fn_tu}" in - ${__prev_tu});; - ?*) - # Set static variables and function for the current TU. - eval "__val=\${__${__fn_tu}_static_var_vals}" - eval "${__val}" - eval "__val=\${__${__fn_tu}_static_fns}" - for __fn in ${__val}; do - eval "${__fn%:*}() { ${__fn#*:}; }" - done + case "${__fn_tu}" in ${__prev_tu});; ?*) + # Set static variables and function for the current TU. + eval "__val=\${__${__fn_tu}_static_var_vals}" + eval "${__val}" + eval "__val=\${__${__fn_tu}_static_fns}" + for __fn in ${__val}; do + eval "${__fn%:*}() { ${__fn#*:}; }" + done ;; esac case "${__prev_vars}" in ?*) unset ${__prev_vars} |