Simplify rb_obj_freeze

The frozen check in `OBJ_FREEZE` makes the separate check redundant,
and immediate values are always frozen, so the old assertion is
unreachable.
This commit is contained in:
Nobuyoshi Nakada committed 2026-09-19 18:51:41 +09:00
1 parent a323b13af9
commit f74cedf78f
1 file changed
+1 -6
Notes: git 2026-09-19 10:22:55 +00:00
+1 -6
View File
@@ -1370,12 +1370,7 @@ rb_obj_dummy1(VALUE _x, VALUE _y)
VALUE
rb_obj_freeze(VALUE obj)
{
if (!OBJ_FROZEN(obj)) {
OBJ_FREEZE_RAW(obj);
if (SPECIAL_CONST_P(obj)) {
rb_bug("special consts should be frozen.");
}
}
OBJ_FREEZE(obj);
return obj;
}