Speedup RBASIC_FIELDS_COUNT (#15273)

We know the argument is not a class, module or special const, so we can
skip these checks.
This commit is contained in:
Luke Gruber 2025-12-01 12:55:39 -05:00 committed by GitHub
parent c58970b57a
commit e02eda194f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
Notes: git 2025-12-01 17:56:12 +00:00
Merged-By: luke-gru <luke.gru@gmail.com>

View File

@ -395,7 +395,7 @@ ROBJECT_FIELDS_COUNT(VALUE obj)
static inline uint32_t
RBASIC_FIELDS_COUNT(VALUE obj)
{
return RSHAPE(rb_obj_shape_id(obj))->next_field_index;
return RSHAPE(RBASIC_SHAPE_ID(obj))->next_field_index;
}
static inline bool