mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-04 21:08:10 +02:00
[script] Check hash value between comparing keys
This commit is contained in:
parent
a364f71194
commit
0b5e92e66b
1 changed files with 5 additions and 2 deletions
|
|
@ -279,7 +279,7 @@ _csi_hash_table_lookup (csi_hash_table_t *hash_table,
|
|||
entry = &hash_table->entries[idx];
|
||||
|
||||
if (ENTRY_IS_LIVE (*entry)) {
|
||||
if (hash_table->keys_equal (key, *entry))
|
||||
if ((*entry)->hash == key->hash && hash_table->keys_equal (key, *entry))
|
||||
return *entry;
|
||||
} else if (ENTRY_IS_FREE (*entry))
|
||||
return NULL;
|
||||
|
|
@ -295,8 +295,11 @@ _csi_hash_table_lookup (csi_hash_table_t *hash_table,
|
|||
|
||||
entry = &hash_table->entries[idx];
|
||||
if (ENTRY_IS_LIVE (*entry)) {
|
||||
if (hash_table->keys_equal (key, *entry))
|
||||
if ((*entry)->hash == key->hash &&
|
||||
hash_table->keys_equal (key, *entry))
|
||||
{
|
||||
return *entry;
|
||||
}
|
||||
} else if (ENTRY_IS_FREE (*entry))
|
||||
return NULL;
|
||||
} while (++i < table_size);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue