golf down ancestor caching
This commit is contained in:
parent
ee8299864f
commit
702b8e3107
13
shape.c
13
shape.c
@ -384,15 +384,7 @@ rb_shape_alloc(ID edge_name, rb_shape_t * parent, enum shape_type type)
|
||||
static redblack_node_t *
|
||||
redblack_cache_ancestors(rb_shape_t * shape)
|
||||
{
|
||||
if (shape->ancestor_index) {
|
||||
return shape->ancestor_index;
|
||||
}
|
||||
else {
|
||||
if (shape->parent_id == INVALID_SHAPE_ID) {
|
||||
// We're at the root
|
||||
return shape->ancestor_index;
|
||||
}
|
||||
else {
|
||||
if (!(shape->ancestor_index || shape->parent_id == INVALID_SHAPE_ID)) {
|
||||
redblack_node_t * parent_index;
|
||||
|
||||
parent_index = redblack_cache_ancestors(rb_shape_get_parent(shape));
|
||||
@ -403,11 +395,10 @@ redblack_cache_ancestors(rb_shape_t * shape)
|
||||
else {
|
||||
shape->ancestor_index = parent_index;
|
||||
}
|
||||
}
|
||||
|
||||
return shape->ancestor_index;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
static redblack_node_t *
|
||||
redblack_cache_ancestors(rb_shape_t * shape)
|
||||
|
Loading…
x
Reference in New Issue
Block a user