From e551dfda9f09b69eb242db8877407daaa2537c4b Mon Sep 17 00:00:00 2001 From: 卜部昌平 Date: Mon, 15 Jun 2020 15:31:07 +0900 Subject: rb_feature_p: do not goto into a branch I'm not necessarily against every goto in general, but jumping into a branch is definitely a bad idea. Better refactor. --- load.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'load.c') diff --git a/load.c b/load.c index 91c9b31667..22c000e2d9 100644 --- a/load.c +++ b/load.c @@ -480,9 +480,7 @@ rb_feature_p(const char *feature, const char *ext, int rb, int expanded, const c } if (st_get_key(loading_tbl, (st_data_t)feature, &data)) { if (fn) *fn = (const char*)data; - loading: - if (!ext) return 'u'; - return !IS_RBEXT(ext) ? 's' : 'r'; + goto loading; } else { VALUE bufstr; @@ -514,6 +512,10 @@ rb_feature_p(const char *feature, const char *ext, int rb, int expanded, const c rb_str_resize(bufstr, 0); } return 0; + + loading: + if (!ext) return 'u'; + return !IS_RBEXT(ext) ? 's' : 'r'; } int -- cgit v1.2.3