[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [no subject]
From: |
Chris Gregory |
Subject: |
Re: [no subject] |
Date: |
Wed, 28 Dec 2016 01:34:54 -0600 |
Oops meant to reply to `Simplify internal_catch()'.
Anyway here is another patch with the same thing.
--
Chris Gregory
diff --git a/src/eval.c b/src/eval.c
index e50e26a..edb41b6 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1337,20 +1337,12 @@ internal_condition_case_1 (Lisp_Object (*bfun)
(Lisp_Object), Lisp_Object arg,
Lisp_Object (*hfun) (Lisp_Object))
{
struct handler *c = push_handler (handlers, CONDITION_CASE);
- if (sys_setjmp (c->jmp))
- {
- Lisp_Object val = handlerlist->val;
- clobbered_eassert (handlerlist == c);
- handlerlist = handlerlist->next;
- return hfun (val);
- }
- else
- {
- Lisp_Object val = bfun (arg);
- clobbered_eassert (handlerlist == c);
- handlerlist = handlerlist->next;
- return val;
- }
+ bool is_returning = sys_setjmp (c->jmp);
+ Lisp_Object val = is_returning ? handlerlist->val : bfun (arg);
+
+ clobbered_eassert (handlerlist == c);
+ handlerlist = handlerlist->next;
+ return is_returning ? hfun (val) : val;
}
/* Like internal_condition_case_1 but call BFUN with ARG1 and ARG2 as
- Re: [no subject],
Chris Gregory <=