Scene object iterator: minor optimization

Avoid an extra hash when adding to gset
This commit is contained in:
Campbell Barton 2017-06-27 07:27:33 +10:00
parent 0394c04a7f
commit 8cc8aad4f9
1 changed files with 3 additions and 2 deletions

View File

@ -597,8 +597,9 @@ static LinkData *object_base_unique(GSet *gs, LinkData *link)
{
for (; link != NULL; link = link->next) {
Object *ob = link->data;
if (!BLI_gset_haskey(gs, ob)) {
BLI_gset_add(gs, ob);
void **ob_key_p;
if (!BLI_gset_ensure_p_ex(gs, ob, &ob_key_p)) {
*ob_key_p = ob;
return link;
}
}