* eet: we don't need to duplicate hash key when we could just point
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 7 Apr 2010 14:00:15 +0000 (14:00 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 7 Apr 2010 14:00:15 +0000 (14:00 +0000)
        to the Eet_File dictionnary entries.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eet@47806 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

ChangeLog
src/lib/eet_data.c

index 43f52a8..70b6e82 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 
        * Fix eet_data_node_read_cipher return type.
        * Add Eet_Connection.
+
+2010-04-07  Cedric BAIL
+
+       * Improve eet_eina_file_data_descriptor_class_set by using
+       eina_hash_direct_add to avoid duplication hash key string.
index cfc3121..935ee71 100644 (file)
@@ -1201,6 +1201,16 @@ _eet_eina_hash_add_alloc(Eina_Hash *hash, const char *key, void *data)
    return hash;
 }
 
+static Eina_Hash *
+_eet_eina_hash_direct_add_alloc(Eina_Hash *hash, const char *key, void *data)
+{
+   if (!hash) hash = eina_hash_string_small_new(NULL);
+   if (!hash) return NULL;
+
+   eina_hash_direct_add(hash, key, data);
+   return hash;
+}
+
 static char *
 _eet_str_direct_alloc(const char *str)
 {
@@ -1257,6 +1267,7 @@ eet_eina_file_data_descriptor_class_set(Eet_Data_Descriptor_Class *eddc, const c
 
    eddc->version = 2;
 
+   eddc->func.hash_add = (void* (*)(void *, const char *, void *)) _eet_eina_hash_direct_add_alloc;
    eddc->func.str_direct_alloc = _eet_str_direct_alloc;
    eddc->func.str_direct_free = _eet_str_direct_free;