From cf42cb72f28d4451f0338971c6239068fb275aab Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 7 Jul 2002 20:57:25 +0000 Subject: [PATCH] (Fnconc): Use XCDR. (Fprovide): Use CONSP and XCDR. (HASH_KEY, HASH_VALUE, HASH_NEXT, HASH_HASH, HASH_INDEX) (HASH_TABLE_SIZE): Delete: moved to lisp.h. (Fmake_hash_table): Accept `:size nil'. (Fmakehash): Delete: moved to subr.el. (syms_of_fns): Don't defsubr makehash. --- src/fns.c | 55 +++++++------------------------------------------------ 1 file changed, 7 insertions(+), 48 deletions(-) diff --git a/src/fns.c b/src/fns.c index dd527ddc76b..83e7353eb98 100644 --- a/src/fns.c +++ b/src/fns.c @@ -2742,7 +2742,7 @@ usage: (nconc &rest LISTS) */) while (CONSP (tem)) { tail = tem; - tem = Fcdr (tail); + tem = XCDR (tail); QUIT; } @@ -3206,8 +3206,8 @@ particular subfeatures supported in this version of FEATURE. */) /* Run any load-hooks for this file. */ tem = Fassq (feature, Vafter_load_alist); - if (!NILP (tem)) - Fprogn (Fcdr (tem)); + if (CONSP (tem)) + Fprogn (XCDR (tem)); return feature; } @@ -3896,32 +3896,6 @@ base64_decode_1 (from, to, length, multibyte, nchars_return) if a `:linear-search t' argument is given to make-hash-table. */ -/* Value is the key part of entry IDX in hash table H. */ - -#define HASH_KEY(H, IDX) AREF ((H)->key_and_value, 2 * (IDX)) - -/* Value is the value part of entry IDX in hash table H. */ - -#define HASH_VALUE(H, IDX) AREF ((H)->key_and_value, 2 * (IDX) + 1) - -/* Value is the index of the next entry following the one at IDX - in hash table H. */ - -#define HASH_NEXT(H, IDX) AREF ((H)->next, (IDX)) - -/* Value is the hash code computed for entry IDX in hash table H. */ - -#define HASH_HASH(H, IDX) AREF ((H)->hash, (IDX)) - -/* Value is the index of the element in hash table H that is the - start of the collision list at index IDX in the index vector of H. */ - -#define HASH_INDEX(H, IDX) AREF ((H)->index, (IDX)) - -/* Value is the size of hash table H. */ - -#define HASH_TABLE_SIZE(H) XVECTOR ((H)->next)->size - /* The list of all weak hash tables. Don't staticpro this one. */ Lisp_Object Vweak_hash_tables; @@ -4929,8 +4903,10 @@ usage: (make-hash-table &rest KEYWORD-ARGS) */) /* See if there's a `:size SIZE' argument. */ i = get_key_arg (QCsize, nargs, args, used); - size = i < 0 ? make_number (DEFAULT_HASH_SIZE) : args[i]; - if (!INTEGERP (size) || XINT (size) < 0) + size = i < 0 ? Qnil : args[i]; + if (NILP (size)) + size = make_number (DEFAULT_HASH_SIZE); + else if (!INTEGERP (size) || XINT (size) < 0) Fsignal (Qerror, list2 (build_string ("Invalid hash table size"), size)); @@ -4988,22 +4964,6 @@ DEFUN ("copy-hash-table", Fcopy_hash_table, Scopy_hash_table, 1, 1, 0, } -DEFUN ("makehash", Fmakehash, Smakehash, 0, 1, 0, - doc: /* Create a new hash table. - -Optional first argument TEST specifies how to compare keys in the -table. Predefined tests are `eq', `eql', and `equal'. Default is -`eql'. New tests can be defined with `define-hash-table-test'. */) - (test) - Lisp_Object test; -{ - Lisp_Object args[2]; - args[0] = QCtest; - args[1] = NILP (test) ? Qeql : test; - return Fmake_hash_table (2, args); -} - - DEFUN ("hash-table-count", Fhash_table_count, Shash_table_count, 1, 1, 0, doc: /* Return the number of elements in TABLE. */) (table) @@ -5427,7 +5387,6 @@ syms_of_fns () defsubr (&Ssxhash); defsubr (&Smake_hash_table); defsubr (&Scopy_hash_table); - defsubr (&Smakehash); defsubr (&Shash_table_count); defsubr (&Shash_table_rehash_size); defsubr (&Shash_table_rehash_threshold); -- 2.39.2