forked from enlightenment/efl
edje: improve speed when deleting text member class.
SVN revision: 59850
This commit is contained in:
parent
a0ea6c5130
commit
995527500a
|
@ -110,3 +110,7 @@
|
||||||
evas freeze and thaw calls. May help in certain pathological
|
evas freeze and thaw calls. May help in certain pathological
|
||||||
situations.
|
situations.
|
||||||
|
|
||||||
|
2011-05-27 Cedric Bail
|
||||||
|
|
||||||
|
* Improve performance by avoiding walking eina_list for nothing
|
||||||
|
when deleting member_class.
|
||||||
|
|
|
@ -221,6 +221,8 @@ _edje_del(Edje *ed)
|
||||||
eina_stringshare_del(cb->part);
|
eina_stringshare_del(cb->part);
|
||||||
free(cb);
|
free(cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
eina_hash_free(ed->members);
|
||||||
free(ed);
|
free(ed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1004,6 +1004,8 @@ struct _Edje
|
||||||
int table_programs_size;
|
int table_programs_size;
|
||||||
unsigned int table_parts_size;
|
unsigned int table_parts_size;
|
||||||
|
|
||||||
|
Eina_Hash *members;
|
||||||
|
|
||||||
Edje_Perspective *persp;
|
Edje_Perspective *persp;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
|
|
@ -3674,33 +3674,38 @@ _edje_text_class_member_add(Edje *ed, const char *text_class)
|
||||||
/* Get members list */
|
/* Get members list */
|
||||||
members = eina_hash_find(_edje_text_class_member_hash, text_class);
|
members = eina_hash_find(_edje_text_class_member_hash, text_class);
|
||||||
|
|
||||||
/* Remove members list */
|
|
||||||
if (members)
|
|
||||||
eina_hash_del(_edje_text_class_member_hash, text_class, members);
|
|
||||||
|
|
||||||
/* Update the member list */
|
/* Update the member list */
|
||||||
members = eina_list_prepend(members, ed);
|
members = eina_list_prepend(members, ed);
|
||||||
|
|
||||||
/* Add the member list back */
|
/* Don't loose track of members list */
|
||||||
|
if (!ed->members)
|
||||||
|
ed->members = eina_hash_string_small_new(NULL);
|
||||||
|
eina_hash_set(ed->members, text_class, members);
|
||||||
|
|
||||||
|
/* Reset the member list to the right pointer */
|
||||||
if (!_edje_text_class_member_hash)
|
if (!_edje_text_class_member_hash)
|
||||||
_edje_text_class_member_hash = eina_hash_string_superfast_new(NULL);
|
_edje_text_class_member_hash = eina_hash_string_superfast_new(NULL);
|
||||||
eina_hash_add(_edje_text_class_member_hash, text_class, members);
|
eina_hash_set(_edje_text_class_member_hash, text_class, members);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_edje_text_class_member_del(Edje *ed, const char *text_class)
|
_edje_text_class_member_del(Edje *ed, const char *text_class)
|
||||||
{
|
{
|
||||||
Eina_List *members;
|
Eina_List *members;
|
||||||
|
Eina_List *lookup;
|
||||||
|
|
||||||
if ((!ed) || (!text_class)) return;
|
if ((!ed) || (!text_class)) return;
|
||||||
members = eina_hash_find(_edje_text_class_member_hash, text_class);
|
members = eina_hash_find(_edje_text_class_member_hash, text_class);
|
||||||
if (!members) return;
|
if (!members) return;
|
||||||
|
|
||||||
eina_hash_del(_edje_text_class_member_hash, text_class, members);
|
lookup = eina_hash_find(ed->members, text_class);
|
||||||
|
|
||||||
members = eina_list_remove(members, ed);
|
if (!lookup) return ;
|
||||||
if (members)
|
|
||||||
eina_hash_add(_edje_text_class_member_hash, text_class, members);
|
eina_hash_del(ed->members, text_class, lookup);
|
||||||
|
members = eina_list_remove_list(members, lookup);
|
||||||
|
|
||||||
|
eina_hash_set(_edje_text_class_member_hash, text_class, members);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue