summaryrefslogtreecommitdiff
path: root/src/select/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/select/hash.c')
-rw-r--r--src/select/hash.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/select/hash.c b/src/select/hash.c
index 92457d8..4b11702 100644
--- a/src/select/hash.c
+++ b/src/select/hash.c
@@ -815,24 +815,23 @@ css_error _insert_into_chain(css_selector_hash *ctx, hash_entry *head,
search = search->next;
} while (search != NULL);
- entry->sel = selector;
- _chain_bloom_generate(selector, entry->sel_chain_bloom);
-
-#ifdef PRINT_CHAIN_BLOOM_DETAILS
- print_chain_bloom_details(entry->sel_chain_bloom);
-#endif
-
if (prev == NULL) {
- hash_entry temp;
- entry->next = entry;
- temp = *entry;
*entry = *head;
- *head = temp;
+ head->next = entry;
+
+ entry = head;
} else {
entry->next = prev->next;
prev->next = entry;
}
+ entry->sel = selector;
+ _chain_bloom_generate(selector, entry->sel_chain_bloom);
+
+#ifdef PRINT_CHAIN_BLOOM_DETAILS
+ print_chain_bloom_details(entry->sel_chain_bloom);
+#endif
+
ctx->hash_size += sizeof(hash_entry);
}