From fe42f1d047a39a474d7b291733d79d2865a6933d Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Mon, 30 Sep 2024 22:47:29 +0900 Subject: [PATCH] mruby-bigint (mpz_set_int): simplify using early return --- mrbgems/mruby-bigint/core/bigint.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mrbgems/mruby-bigint/core/bigint.c b/mrbgems/mruby-bigint/core/bigint.c index b224dd19d..dc680caa8 100644 --- a/mrbgems/mruby-bigint/core/bigint.c +++ b/mrbgems/mruby-bigint/core/bigint.c @@ -86,13 +86,11 @@ mpz_set_int(mrb_state *mrb, mpz_t *y, mrb_int v) mpz_realloc(mrb, y, 2); y->p[1] = (mp_limb)HIGH(u); y->p[0] = (mp_limb)LOW(u); + return; } - else #endif - { - mpz_realloc(mrb, y, 1); - y->p[0] = (mp_limb)u; - } + mpz_realloc(mrb, y, 1); + y->p[0] = (mp_limb)u; } static void