]> git.gag.com Git - fw/sdcc/blobdiff - src/SDCChasht.c
Merge of the izt changes.
[fw/sdcc] / src / SDCChasht.c
index ce646461d6056b112c5f6c2de06ea5dab5bd9330..d083faa3b2460551a83f63161f8382cd51e6c31d 100644 (file)
@@ -223,13 +223,16 @@ static const hashtItem *_findByKey(hTab *htab, int key, const void *pkey, int (*
     if (!htab)
        return NULL;
     
-    for (htip = htab->table[key] ; htip ; htip = htip->next ) {
+    for (htip = htab->table[key] ; htip ; htip = htip->next) {
        /* if a compare function is given use it */
-       if (compare && compare(pkey, htip->pkey))
+       if (compare && compare(pkey, htip->pkey)) {
            break;
-       else
-           if (pkey == htip->pkey)
+       }
+       else {
+           if (pkey == htip->pkey) {
                break;
+           }
+       }
     }
     return htip;
 }