property lookups on structs was doing a listbase search even if the hash was defined.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 25 Jan 2011 05:45:21 +0000 (05:45 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 25 Jan 2011 05:45:21 +0000 (05:45 +0000)
since the property hash is maintained there is no reason for this, especially since the property could be in the StructRNA's parent class.

source/blender/makesrna/intern/rna_rna.c

index ec037ce59fa755d5ed9e8a5da4d87a8f7769875a..d0a4647efc3f37e955c1855c31b8beb8dd935144 100644 (file)
@@ -321,14 +321,15 @@ int rna_builtin_properties_lookup_string(PointerRNA *ptr, const char *key, Point
                                return TRUE;
                        }
                }
+               else {
+                       for(prop=srna->cont.properties.first; prop; prop=prop->next) {
+                               if(!(prop->flag & PROP_BUILTIN) && strcmp(prop->identifier, key)==0) {
+                                       propptr.type= &RNA_Property;
+                                       propptr.data= prop;
 
-               for(prop=srna->cont.properties.first; prop; prop=prop->next) {
-                       if(!(prop->flag & PROP_BUILTIN) && strcmp(prop->identifier, key)==0) {
-                               propptr.type= &RNA_Property;
-                               propptr.data= prop;
-
-                               *r_ptr= propptr;
-                               return TRUE;
+                                       *r_ptr= propptr;
+                                       return TRUE;
+                               }
                        }
                }
        } while((srna=srna->base));