zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <danielsh@apache.org>
To: zsh-workers@zsh.org
Subject: [PATCH] internal: Simplify handling of try_tryflag. No functional change.
Date: Wed, 18 Dec 2019 04:00:11 +0000	[thread overview]
Message-ID: <20191218040011.19745-1-danielsh@apache.org> (raw)

try_tryflag isn't assigned anywhere, other than at initialization and by these
lines, so we don't need to save and restore the value.
---
 Src/loop.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/Src/loop.c b/Src/loop.c
index 3fa7006aa..538afb8dc 100644
--- a/Src/loop.c
+++ b/Src/loop.c
@@ -732,7 +732,7 @@ exectry(Estate state, int do_exec)
     Wordcode end, always;
     int endval;
     int save_retflag, save_breaks, save_contflag;
-    zlong save_try_errflag, save_try_tryflag, save_try_interrupt;
+    zlong save_try_errflag, save_try_interrupt;
 
     end = state->pc + WC_TRY_SKIP(state->pc[-1]);
     always = state->pc + 1 + WC_TRY_SKIP(*state->pc);
@@ -741,12 +741,9 @@ exectry(Estate state, int do_exec)
     cmdpush(CS_CURSH);
 
     /* The :try clause */
-    save_try_tryflag = try_tryflag;
-    try_tryflag = 1;
-
+    ++try_tryflag;
     execlist(state, 1, do_exec);
-
-    try_tryflag = save_try_tryflag;
+    --try_tryflag;
 
     /* Don't record errflag here, may be reset.  However, */
     /* endval should show failure when there is an error. */

                 reply	other threads:[~2019-12-18  4:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191218040011.19745-1-danielsh@apache.org \
    --to=danielsh@apache.org \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).