Use small hash table insteed of bigger one. And move collection hash initialization...
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 17 Dec 2008 16:10:07 +0000 (16:10 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 17 Dec 2008 16:10:07 +0000 (16:10 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@38186 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/edje_cache.c

index f0dff46..f74abf8 100644 (file)
@@ -70,7 +70,7 @@ _edje_file_coll_open(Edje_File *edf, const char *coll)
    edc->part = eina_stringshare_add(coll);
    edc->references = 1;
    if (!edf->collection_hash)
-     edf->collection_hash = eina_hash_string_superfast_new(NULL);
+     edf->collection_hash = eina_hash_string_small_new(NULL);
    eina_hash_add(edf->collection_hash, coll, edc);
    return edc;
 }
@@ -81,7 +81,7 @@ _edje_font_hash(Edje_File *edf)
    int count = 0;
 
    if (!edf->font_hash)
-     edf->font_hash = eina_hash_string_superfast_new(NULL);
+     edf->font_hash = eina_hash_string_small_new(NULL);
 
    if (edf->font_dir)
      {
@@ -162,7 +162,8 @@ _edje_file_open(const char *file, const char *coll, int *error_ret, Edje_Part_Co
    _edje_textblock_style_parse_and_fix(edf);
 
    if (!edf->data_cache)
-     edf->data_cache = eina_hash_string_superfast_new(NULL);
+     edf->data_cache = eina_hash_string_small_new(NULL);
+
    EINA_LIST_FOREACH(edf->data, l, di)
      eina_hash_add(edf->data_cache, di->key, di->value);
 
@@ -192,14 +193,12 @@ _edje_cache_file_coll_open(const char *file, const char *coll, int *error_ret, E
    Edje_Part *ep;
 
    if (!_edje_file_hash)
-     _edje_file_hash = eina_hash_string_superfast_new(NULL);
+     _edje_file_hash = eina_hash_string_small_new(NULL);
    edf = eina_hash_find(_edje_file_hash, file);
 
    if (edf)
      {
        edf->references++;
-       if (!edf->collection_hash)
-         edf->collection_hash = eina_hash_string_superfast_new(NULL);
      }
    else
      {
@@ -223,6 +222,9 @@ _edje_cache_file_coll_open(const char *file, const char *coll, int *error_ret, E
        return edf;
      }
 
+   if (!edf->collection_hash)
+     edf->collection_hash = eina_hash_string_small_new(NULL);
+
    if (!coll) return edf;
 
    edc = eina_hash_find(edf->collection_hash, coll);