aboutsummaryrefslogtreecommitdiffstats
path: root/src/category.c
diff options
context:
space:
mode:
authorMattias EngdegÄrd2023-11-21 12:27:42 +0100
committerMattias EngdegÄrd2024-01-13 20:50:38 +0100
commit3b00255a4c70bc1075446c94a8ff65c987ac143f (patch)
treec47f8d591ac87bdd1f8ca70c74d5aa11b6ac136c /src/category.c
parenta3ae5653cfe1ab2b3eb4c77ce729844ad442b562 (diff)
downloademacs-3b00255a4c70bc1075446c94a8ff65c987ac143f.tar.gz
emacs-3b00255a4c70bc1075446c94a8ff65c987ac143f.zip
Inlined and specialised hash table look-up
This improves performance in several ways. Separate functions are used depending on whether the caller has a hash value computed or not. * src/fns.c (hash_lookup_with_hash, hash_lookup_get_hash): New. (hash_lookup): Remove hash return argument. All callers adapted. hash_lookup_with_hash hash_hash_t arg
Diffstat (limited to 'src/category.c')
-rw-r--r--src/category.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/category.c b/src/category.c
index e7fbf1ff500..3a406a567a1 100644
--- a/src/category.c
+++ b/src/category.c
@@ -54,7 +54,7 @@ hash_get_category_set (Lisp_Object table, Lisp_Object category_set)
54 make_hash_table (hashtest_equal, DEFAULT_HASH_SIZE, Weak_None, false)); 54 make_hash_table (hashtest_equal, DEFAULT_HASH_SIZE, Weak_None, false));
55 struct Lisp_Hash_Table *h = XHASH_TABLE (XCHAR_TABLE (table)->extras[1]); 55 struct Lisp_Hash_Table *h = XHASH_TABLE (XCHAR_TABLE (table)->extras[1]);
56 hash_hash_t hash; 56 hash_hash_t hash;
57 ptrdiff_t i = hash_lookup (h, category_set, &hash); 57 ptrdiff_t i = hash_lookup_get_hash (h, category_set, &hash);
58 if (i >= 0) 58 if (i >= 0)
59 return HASH_KEY (h, i); 59 return HASH_KEY (h, i);
60 hash_put (h, category_set, Qnil, hash); 60 hash_put (h, category_set, Qnil, hash);