Skip to content

Commit 2de67d4

Browse files
committed
shape.c: assert we're not returning INVALID_SHAPE_ID.
1 parent 8c4e368 commit 2de67d4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

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)