Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-05-01 10:34:40 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-05-01 10:34:40 +0400
commit22c2aef77c63cf4cbe19a1c5a8ea4671ef6440bd (patch)
tree4b4502c3111590f44429da4b55c3e22920c029e6 /source/blender/blenkernel/intern/idprop.c
parent81dabf76d7392c221decd339945ff3d5678a6023 (diff)
replace inline string searches with BLI_findstring(), strcmp(..., ""), with char comparisons.
Diffstat (limited to 'source/blender/blenkernel/intern/idprop.c')
-rw-r--r--source/blender/blenkernel/intern/idprop.c49
1 files changed, 22 insertions, 27 deletions
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c
index 80962de9730..04fc41e41cc 100644
--- a/source/blender/blenkernel/intern/idprop.c
+++ b/source/blender/blenkernel/intern/idprop.c
@@ -426,35 +426,30 @@ static IDProperty *IDP_CopyGroup(IDProperty *prop)
* When values name and types match, copy the values, else ignore */
void IDP_SyncGroupValues(IDProperty *dest, IDProperty *src)
{
- IDProperty *loop, *prop;
+ IDProperty *other, *prop;
for (prop=src->data.group.first; prop; prop=prop->next) {
- for (loop=dest->data.group.first; loop; loop=loop->next) {
- if (strcmp(loop->name, prop->name)==0) {
- if(prop->type==loop->type) {
-
- switch (prop->type) {
- case IDP_INT:
- case IDP_FLOAT:
- case IDP_DOUBLE:
- loop->data= prop->data;
- break;
- case IDP_GROUP:
- IDP_SyncGroupValues(loop, prop);
- break;
- default:
- {
- IDProperty *tmp= loop;
- IDProperty *copy= IDP_CopyProperty(prop);
-
- BLI_insertlinkafter(&dest->data.group, loop, copy);
- BLI_remlink(&dest->data.group, tmp);
-
- IDP_FreeProperty(tmp);
- MEM_freeN(tmp);
- }
- }
+ other= BLI_findstring(&dest->data.group, prop->name, offsetof(IDProperty, name));
+ if (other && prop->type==other->type) {
+ switch (prop->type) {
+ case IDP_INT:
+ case IDP_FLOAT:
+ case IDP_DOUBLE:
+ other->data= prop->data;
+ break;
+ case IDP_GROUP:
+ IDP_SyncGroupValues(other, prop);
+ break;
+ default:
+ {
+ IDProperty *tmp= other;
+ IDProperty *copy= IDP_CopyProperty(prop);
+
+ BLI_insertlinkafter(&dest->data.group, other, copy);
+ BLI_remlink(&dest->data.group, tmp);
+
+ IDP_FreeProperty(tmp);
+ MEM_freeN(tmp);
}
- break;
}
}
}