IDProp API: Avoid redundant group replace lookup
authorCampbell Barton <ideasman42@gmail.com>
Sat, 5 May 2018 07:31:17 +0000 (09:31 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 5 May 2018 07:31:17 +0000 (09:31 +0200)
source/blender/blenkernel/intern/idprop.c

index a224ef1e212fa4b2f884a58c6ce8479c472ef158..5fb6dd558e08d48bcd38c0f4b65bbb11ff4893d9 100644 (file)
@@ -579,10 +579,9 @@ void IDP_ReplaceGroupInGroup(IDProperty *dest, const IDProperty *src)
 void IDP_ReplaceInGroup_ex(IDProperty *group, IDProperty *prop, IDProperty *prop_exist)
 {
        BLI_assert(group->type == IDP_GROUP);
-
        BLI_assert(prop_exist == IDP_GetPropertyFromGroup(group, prop->name));
 
-       if ((prop_exist = IDP_GetPropertyFromGroup(group, prop->name))) {
+       if (prop_exist != NULL) {
                BLI_insertlinkreplace(&group->data.group, prop_exist, prop);
                IDP_FreeProperty(prop_exist);
                MEM_freeN(prop_exist);