Enlightenment CVS committal

Author  : werkt
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore


Modified Files:
        ecore_hash.c 


Log Message:
Un-botched ecore_hash_next

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/ecore_hash.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ecore_hash.c        4 Jan 2005 22:45:05 -0000       1.7
+++ ecore_hash.c        5 Jan 2005 02:05:07 -0000       1.8
@@ -214,7 +214,7 @@
        ECORE_READ_LOCK(hash);
 
        if( hash->buckets[hash->index] )
-               hash->current = ecore_list_goto_first( 
hash->buckets[hash->index] )
+               ecore_list_goto_first( hash->buckets[hash->index] );
 
        ECORE_READ_UNLOCK(hash);
 
@@ -229,31 +229,23 @@
  */
 Ecore_Hash_Node *ecore_hash_next(Ecore_Hash *hash)
 {
-       Ecore_Hash_Node *node;
+       Ecore_Hash_Node *node = NULL;
 
        CHECK_PARAM_POINTER_RETURN("hash", hash, FALSE);
 
        ECORE_READ_LOCK(hash);
 
-       node = hash->current;
-
        if( hash->index < ecore_prime_table[hash->size] &&
                        hash->buckets[hash->index] ) {
-               if( hash->current )
-                       ecore_list_goto( hash->buckets[hash->index], 
hash->current );
-               else
-                       ecore_list_goto_first( hash->buckets[hash->index] );
-               ecore_list_next( hash->buckets[hash->index] );
-               hash->current = ecore_list_current( hash->buckets[hash->index] 
);
-               if( !hash->current ) {
+               node = ecore_list_next( hash->buckets[hash->index] );
+               if( !node ) {
                        hash->index++;
-
-                       ECORE_READ_UNLOCK(hash);
-                       ecore_hash_next(hash);
-                       ECORE_READ_LOCK(hash);
+                       while( hash->index < ecore_prime_table[hash->size] &&
+                                                !hash->buckets[hash->index] )
+                               hash->index++;
+                       if( hash->index < ecore_prime_table[hash->size] )
+                               node = ecore_list_goto_first( 
hash->buckets[hash->index] );
                }
-       } else {
-               hash->current = NULL;
        }
 
        ECORE_READ_UNLOCK(hash);




-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to