Skip to content

Commit c9a524c

Browse files
committed
shape.c: assert we're not returning INVALID_SHAPE_ID.
1 parent 218241b commit c9a524c

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

shape.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -357,18 +357,14 @@ static const rb_data_type_t shape_tree_type = {
357357
static inline shape_id_t
358358
raw_shape_id(rb_shape_t *shape)
359359
{
360-
if (shape == NULL) {
361-
return INVALID_SHAPE_ID;
362-
}
360+
RUBY_ASSERT(shape);
363361
return (shape_id_t)(shape - GET_SHAPE_TREE()->shape_list);
364362
}
365363

366364
static inline shape_id_t
367365
shape_id(rb_shape_t *shape, shape_id_t previous_shape_id)
368366
{
369-
if (shape == NULL) {
370-
return INVALID_SHAPE_ID;
371-
}
367+
RUBY_ASSERT(shape);
372368
shape_id_t raw_id = (shape_id_t)(shape - GET_SHAPE_TREE()->shape_list);
373369
return raw_id | (previous_shape_id & SHAPE_ID_FLAGS_MASK);
374370
}

0 commit comments

Comments
 (0)