From 2b636dc81dcc2540e0548c856ac495722fcd3959 Mon Sep 17 00:00:00 2001 From: 卜部昌平 Date: Wed, 24 Jun 2020 11:04:19 +0900 Subject: make_exception: early return The rb_exc_new3() result is already ready to be returned. No need to fall through the switch. --- eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index e4d6699982..03a19724cf 100644 --- a/eval.c +++ b/eval.c @@ -816,7 +816,7 @@ make_exception(int argc, const VALUE *argv, int isstr) if (isstr &&! NIL_P(exc)) { mesg = rb_check_string_type(exc); if (!NIL_P(mesg)) { - mesg = rb_exc_new3(rb_eRuntimeError, mesg); + return rb_exc_new3(rb_eRuntimeError, mesg); } } -- cgit v1.2.3