summaryrefslogtreecommitdiff
path: root/shape.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2022-12-14 10:57:44 -0500
committerPeter Zhu <peter@peterzhu.ca>2022-12-14 13:21:46 -0500
commit7a63114f8eaba7a1fe8a56a2e665703d9f9cfa8a (patch)
treea80ae550182778803674c33f813e4e74f4709a6f /shape.c
parent71dd8b3caa6462e5c3dfd7059314459b51ebebc0 (diff)
downloadruby-7a63114f8eaba7a1fe8a56a2e665703d9f9cfa8a.tar.gz
Remove dead code in get_next_shape_internal
If the rb_id_table_lookup fails, then res is not updated so it cannot be any value other than null.
Diffstat (limited to 'shape.c')
-rw-r--r--shape.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/shape.c b/shape.c
index 8a7c780e47..86572f9fde 100644
--- a/shape.c
+++ b/shape.c
@@ -142,12 +142,6 @@ get_next_shape_internal(rb_shape_t * shape, ID id, enum shape_type shape_type)
// Lookup the shape in edges - if there's already an edge and a corresponding shape for it,
// we can return that. Otherwise, we'll need to get a new shape
if (!rb_id_table_lookup(shape->edges, id, (VALUE *)&res)) {
- // In this case, the shape exists, but the shape is garbage, so we need to recreate it
- if (res) {
- rb_id_table_delete(shape->edges, id);
- res->parent_id = INVALID_SHAPE_ID;
- }
-
rb_shape_t * new_shape = rb_shape_alloc(id, shape);
new_shape->type = (uint8_t)shape_type;