We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6916937 + ade79e1 commit c12127aCopy full SHA for c12127a
src/shared/hash_op.c
@@ -243,13 +243,9 @@ void *OSHash_Get(const OSHash *self, const char *key)
243
/* Get entry */
244
curr_node = self->table[index];
245
while (curr_node != NULL) {
246
- /* Skip null pointers */
247
- if ( curr_node->key == NULL ) {
248
- continue;
249
- }
250
251
/* We may have colisions, so double check with strcmp */
252
- if (strcmp(curr_node->key, key) == 0) {
+ if (curr_node->key != NULL && strcmp(curr_node->key, key) == 0) {
253
return (curr_node->data);
254
}
255
0 commit comments