From e5c77eaa6612ef5026ad84a4af8022f47d425c82 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Thu, 24 Mar 2016 21:12:52 -0400 Subject: eshtrans/eshrt: Collapse case constructs in __fn_ctxsw() --- (limited to 'eshtrans/eshrt') 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} -- cgit v0.9.1