aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorMattias EngdegÄrd2023-11-28 13:54:26 +0100
committerMattias EngdegÄrd2024-01-12 18:02:15 +0100
commit484e04efa4fcb81968cba8e05835812c62856287 (patch)
treef0605dc74b76c89a90e56e5b8d5b256aa33d3233 /src/alloc.c
parent43127e5ec110debadef5e823ee8adbfc561bb708 (diff)
downloademacs-484e04efa4fcb81968cba8e05835812c62856287.tar.gz
emacs-484e04efa4fcb81968cba8e05835812c62856287.zip
; * src/alloc.c (purecopy_hash_table): Simplify
Copy the entire struct, then take care of fields needing special treatment.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/alloc.c b/src/alloc.c
index fae76d24189..af9c169a3a0 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -5891,26 +5891,16 @@ purecopy_hash_table (struct Lisp_Hash_Table *table)
5891 eassert (table->purecopy); 5891 eassert (table->purecopy);
5892 5892
5893 struct Lisp_Hash_Table *pure = pure_alloc (sizeof *pure, Lisp_Vectorlike); 5893 struct Lisp_Hash_Table *pure = pure_alloc (sizeof *pure, Lisp_Vectorlike);
5894 struct hash_table_test pure_test = table->test; 5894 *pure = *table;
5895 pure->mutable = false;
5895 5896
5896 /* Purecopy the hash table test. */ 5897 pure->test.name = purecopy (table->test.name);
5897 pure_test.name = purecopy (table->test.name); 5898 pure->test.user_hash_function = purecopy (table->test.user_hash_function);
5898 pure_test.user_hash_function = purecopy (table->test.user_hash_function); 5899 pure->test.user_cmp_function = purecopy (table->test.user_cmp_function);
5899 pure_test.user_cmp_function = purecopy (table->test.user_cmp_function);
5900
5901 pure->header = table->header;
5902 pure->weak = purecopy (Qnil);
5903 pure->hash = purecopy (table->hash); 5900 pure->hash = purecopy (table->hash);
5904 pure->next = purecopy (table->next); 5901 pure->next = purecopy (table->next);
5905 pure->index = purecopy (table->index); 5902 pure->index = purecopy (table->index);
5906 pure->count = table->count;
5907 pure->next_free = table->next_free;
5908 pure->purecopy = table->purecopy;
5909 eassert (!pure->mutable);
5910 pure->rehash_threshold = table->rehash_threshold;
5911 pure->rehash_size = table->rehash_size;
5912 pure->key_and_value = purecopy (table->key_and_value); 5903 pure->key_and_value = purecopy (table->key_and_value);
5913 pure->test = pure_test;
5914 5904
5915 return pure; 5905 return pure;
5916} 5906}