Improvements:
* Check the number of parameter for image in edc.
* O(1) lookup used when searching Part_Lookup in edje_cc.
+ * O(1) lookup when generating alias of group.
Fixes:
extern Eina_List *params;
extern Edje_File *edje_file;
extern Eina_List *edje_collections;
+extern Eina_Hash *edje_collections_lookup;
extern Eina_List *externals;
extern Eina_List *fonts;
extern Eina_List *codes;
ob_collections(void)
{
if (!edje_file->collection)
- edje_file->collection = eina_hash_string_small_new(NULL);
+ {
+ edje_file->collection = eina_hash_string_small_new(NULL);
+ edje_collections_lookup = eina_hash_int32_new(NULL);
+ }
}
/**
current_de = mem_alloc(SZ(Edje_Part_Collection_Directory_Entry));
current_de->id = eina_list_count(edje_collections);
+ eina_hash_add(edje_collections_lookup, ¤t_de->id, current_de);
+
pc = mem_alloc(SZ(Edje_Part_Collection));
edje_collections = eina_list_append(edje_collections, pc);
pc->id = current_de->id;
Edje_File *edje_file = NULL;
Eina_List *edje_collections = NULL;
+Eina_Hash *edje_collections_lookup = NULL;
Eina_List *externals = NULL;
Eina_List *fonts = NULL;
Eina_List *codes = NULL;
EINA_LIST_FREE(aliases, ce)
{
Edje_Part_Collection_Directory_Entry *sce;
- Eina_Iterator *it;
if (!ce->entry)
{
return;
}
- it = eina_hash_iterator_data_new(edje_file->collection);
-
- EINA_ITERATOR_FOREACH(it, sce)
+ sce = eina_hash_find(edje_collections_lookup, &ce->id);
+ if (sce)
{
- if (ce->id == sce->id)
- {
- memcpy(&ce->count, &sce->count, sizeof (ce->count));
- break;
- }
+ memcpy(&ce->count, &sce->count, sizeof (ce->count));
}
-
- if (!sce)
+ else
{
snprintf(buf, sizeof(buf),
"Collection %s (%i) can't find an correct alias.",
hw->errstr = strdup(buf);
return;
}
- eina_iterator_free(it);
+
eina_hash_direct_add(edje_file->collection, ce->entry, ce);
}
}