aboutsummaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-06-15 11:58:30 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2020-06-29 11:05:41 +0900
commit0b1b73451528d946060f4876aa38fc3278899deb (patch)
tree9fdf37446e4850112120793fe3c8f96be3faaf4e /eval.c
parenta2677815f5e18116e37d7eb1d3e876798eb8e6d8 (diff)
downloadruby-0b1b73451528d946060f4876aa38fc3278899deb.tar.gz
rb_class_modify_check: 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.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/eval.c b/eval.c
index c44bf13ed8..65414d27cc 100644
--- a/eval.c
+++ b/eval.c
@@ -456,7 +456,6 @@ void
rb_class_modify_check(VALUE klass)
{
if (SPECIAL_CONST_P(klass)) {
- noclass:
Check_Type(klass, T_CLASS);
}
if (OBJ_FROZEN(klass)) {
@@ -489,7 +488,7 @@ rb_class_modify_check(VALUE klass)
desc = "class";
break;
default:
- goto noclass;
+ Check_Type(klass, T_CLASS);
}
}
rb_frozen_error_raise(klass, "can't modify frozen %s: %"PRIsVALUE, desc, klass);