From 76c0720efccba7b7dd73fcedec39386f7c0c4b54 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Sun, 11 Oct 2009 18:05:35 +0000 Subject: [PATCH] * remove unneded code * fix test --- libcitadel/lib/hash.c | 4 +--- libcitadel/tests/hashlist_test.c | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) 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) -- 2.39.2