Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d3c8729

Browse filesBrowse files
authored
arbitrary indentation fix
1 parent c18082c commit d3c8729
Copy full SHA for d3c8729

File tree

1 file changed

+6
-7
lines changed
Filter options

1 file changed

+6
-7
lines changed

‎modules/HashTable/DoubleHashing/hash_table.c

Copy file name to clipboardExpand all lines: modules/HashTable/DoubleHashing/hash_table.c
+6-7Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,13 @@ static uint find_bucket(HashTable ht, Pointer value)
183183
uint count = 0;
184184
const uint h1 = ht->hash(value), interval = hash_func2(PRIME_NUM, h1);
185185

186-
for (uint pos = h1%ht->capacity; ht->buckets[pos].state != EMPTY; pos = (pos + interval) % ht->capacity)
186+
for (uint pos = h1%ht->capacity; ht->buckets[pos].state != EMPTY; pos = (pos + interval) % ht->capacity)
187187
{
188-
if (ht->buckets[pos].state == OCCUPIED && ht->compare(ht->buckets[pos].data, value) == 0)
189-
return pos;
190-
191-
if (++count == ht->capacity) // searched all buckets containing data, value does not exist
192-
return ht->capacity;
193-
}
188+
if (ht->buckets[pos].state == OCCUPIED && ht->compare(ht->buckets[pos].data, value) == 0)
189+
return pos;
190+
if (++count == ht->capacity) // searched all buckets containing data, value does not exist
191+
return ht->capacity;
192+
}
194193

195194
// reached an empty bucket, value does not exist
196195
return ht->capacity;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.