]> git.eshelyaron.com Git - emacs.git/commit
(struct charset): Remove dependency on hash-table internals
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 24 Jan 2024 03:30:13 +0000 (22:30 -0500)
committerEshel Yaron <me@eshelyaron.com>
Wed, 24 Jan 2024 18:31:53 +0000 (19:31 +0100)
commit65363d3f6ad3055091ccd57fb591ff946d1071d8
tree6ba5135f3de17450936d0aa4082a31d207d6ab0d
parent4a1f9072c64d305ffa80b11ad4b6e2adcab07ff3
(struct charset): Remove dependency on hash-table internals

`struct charset` kept an index into the internal `key_and_value` array
of hash tables, which only worked because of details of how
hash-tables are handled.  Replace it with a reference to the
value stored at that location in the hash-table, which saves us an
indirection while at it.

* src/charset.h (struct charset): Replace `hash_index` field with
`attributes` field.
(CHARSET_ATTRIBUTES): Simplify accordingly.
(CHARSET_HASH_INDEX): Delete unused macro.
* src/charset.c (Fdefine_charset_internal):
* src/pdumper.c (dump_charset): Adjust accordingly.
(dump_charset_table): Set the referrer since that's needed while
dumping Lisp_Object fields.

(cherry picked from commit 33b8d5b6c5a22bab069cdac4bddda932b3d18b13)
src/charset.c
src/charset.h
src/pdumper.c