* remove unneded code
authorWilfried Göesgens <willi@citadel.org>
Sun, 11 Oct 2009 18:05:35 +0000 (18:05 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sun, 11 Oct 2009 18:05:35 +0000 (18:05 +0000)
* fix test

libcitadel/lib/hash.c
libcitadel/tests/hashlist_test.c

index e3be284023c196ddce920a4966c49adef566a9e4..21076b22e3426e3e3b7e71c2b0a8f225924680ef 100644 (file)
@@ -622,7 +622,6 @@ void DeleteHashPos(HashPos **DelMe)
 int GetNextHashPos(HashList *Hash, HashPos *At, long *HKLen, const char **HashKey, void **Data)
 {
        long PayloadPos;
-       long offset = 0;
 
        if ((Hash == NULL) || 
            (At->Position >= Hash->nMembersUsed) || 
@@ -633,9 +632,8 @@ int GetNextHashPos(HashList *Hash, HashPos *At, long *HKLen, const char **HashKe
        *HashKey = Hash->LookupTable[At->Position]->HashKey;
        PayloadPos = Hash->LookupTable[At->Position]->Position;
        *Data = Hash->Members[PayloadPos]->Data;
+
        /* Position is NULL-Based, while Stepwidth is not... */
-       if (At->StepWidth < 0)
-               offset = 1;
        if ((At->Position % abs(At->StepWidth)) == 0)
                At->Position += At->StepWidth;
        else 
index 6bf1897d65d1242fc23edd54e114306b5198092f..7c7a9ad6ed83f15b7ab505de6e6cd9b4fed84607 100644 (file)
@@ -63,7 +63,7 @@ static void test_iterate_hash(HashList *testh, int forward, int stepwidth)
                printf("i: %d c: %d\n", i, *(int*) vTest);
                i+=stepwidth;
        }
-
+       DeleteHashPos(&it);
 }
 
 static void TestHashlistIteratorForward (void)