From: Wilfried Göesgens Date: Sun, 11 Oct 2009 18:05:35 +0000 (+0000) Subject: * remove unneded code X-Git-Tag: v7.86~770 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=76c0720efccba7b7dd73fcedec39386f7c0c4b54;hp=48e5a330a234d93a65e67db781a2c868ec2fe175;p=citadel.git * remove unneded code * fix test --- diff --git a/libcitadel/lib/hash.c b/libcitadel/lib/hash.c index e3be28402..21076b22e 100644 --- a/libcitadel/lib/hash.c +++ b/libcitadel/lib/hash.c @@ -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 diff --git a/libcitadel/tests/hashlist_test.c b/libcitadel/tests/hashlist_test.c index 6bf1897d6..7c7a9ad6e 100644 --- a/libcitadel/tests/hashlist_test.c +++ b/libcitadel/tests/hashlist_test.c @@ -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)