From cc48fcdff22689cdca04181105582150b01904a1 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Tue, 27 May 2025 11:46:02 +0200 Subject: [PATCH] Get rid of `rb_shape_canonical_p` --- shape.h | 8 +------- variable.c | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/shape.h b/shape.h index 9a84835e65..9f0d5e8b14 100644 --- a/shape.h +++ b/shape.h @@ -150,16 +150,10 @@ rb_obj_shape(VALUE obj) return RSHAPE(rb_obj_shape_id(obj)); } -static inline bool -rb_shape_canonical_p(rb_shape_t *shape) -{ - return !shape->flags; -} - static inline bool rb_shape_id_canonical_p(shape_id_t shape_id) { - return rb_shape_canonical_p(RSHAPE(shape_id)); + return !RSHAPE(shape_id)->flags; } static inline shape_id_t diff --git a/variable.c b/variable.c index 1f948fb356..e8aedc5ac0 100644 --- a/variable.c +++ b/variable.c @@ -1663,7 +1663,7 @@ rb_obj_init_too_complex(VALUE obj, st_table *table) { // This method is meant to be called on newly allocated object. RUBY_ASSERT(!rb_shape_obj_too_complex_p(obj)); - RUBY_ASSERT(rb_shape_canonical_p(rb_obj_shape(obj))); + RUBY_ASSERT(rb_shape_id_canonical_p(RBASIC_SHAPE_ID(obj))); RUBY_ASSERT(rb_obj_shape(obj)->next_field_index == 0); obj_transition_too_complex(obj, table);