summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
authorS.H <gamelinks007@gmail.com>2021-09-15 08:11:05 +0900
committerGitHub <noreply@github.com>2021-09-15 08:11:05 +0900
commitb8c3a84bddac7366c4e391234b2535253869e885 (patch)
tree872dfa2014b75fc4c5dadb060900afa118cded71 /error.c
parent89242279e61b023a81c58065c62a82de8829d0b3 (diff)
downloadruby-b8c3a84bddac7366c4e391234b2535253869e885.tar.gz
Refactor and Using RBOOL macro
Diffstat (limited to 'error.c')
-rw-r--r--error.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/error.c b/error.c
index b589384303..84902204d2 100644
--- a/error.c
+++ b/error.c
@@ -1548,9 +1548,7 @@ exc_equal(VALUE exc, VALUE obj)
if (!rb_equal(rb_attr_get(exc, id_mesg), mesg))
return Qfalse;
- if (!rb_equal(exc_backtrace(exc), backtrace))
- return Qfalse;
- return Qtrue;
+ return rb_equal(exc_backtrace(exc), backtrace);
}
/*
@@ -1638,10 +1636,7 @@ exit_success_p(VALUE exc)
if (NIL_P(status_val))
return Qtrue;
status = NUM2INT(status_val);
- if (WIFEXITED(status) && WEXITSTATUS(status) == EXIT_SUCCESS)
- return Qtrue;
-
- return Qfalse;
+ return RBOOL(WIFEXITED(status) && WEXITSTATUS(status) == EXIT_SUCCESS);
}
static VALUE