replace inline string searches with BLI_findstring(), strcmp(..., ""), with char...
[blender-staging.git] / source / blender / blenkernel / intern / context.c
index 4e5a1977ab01da24b2d861ce4cb772f58d4991c5..55d455bc5d3b5fe26172b0dd4d04c510d00dcc59 100644 (file)
@@ -451,11 +451,10 @@ static int ctx_data_get(bContext *C, const char *member, bContextDataResult *res
 
                C->data.recursion= 1;
 
-               for(entry=C->wm.store->entries.first; entry; entry=entry->next) {
-                       if(strcmp(entry->name, member) == 0) {
-                               result->ptr= entry->ptr;
-                               done= 1;
-                       }
+               entry= BLI_findstring(&C->wm.store->entries, member, offsetof(bContextStoreEntry, name));
+               if(entry) {
+                       result->ptr= entry->ptr;
+                       done= 1;
                }
        }
        if(done!=1 && recursion < 2 && C->wm.region) {
@@ -649,7 +648,7 @@ int CTX_data_equals(const char *member, const char *str)
 
 int CTX_data_dir(const char *member)
 {
-       return (strcmp(member, "") == 0);
+       return member[0] == '\0';
 }
 
 void CTX_data_id_pointer_set(bContextDataResult *result, ID *id)