Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
179b9c44
Commit
179b9c44
authored
Jun 09, 2019
by
Paul Eggert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* src/fns.c (cmpfn_eql): Simplify.
parent
963d4e24
Pipeline
#1953
failed with stage
in 3 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
21 deletions
+14
-21
src/fns.c
src/fns.c
+14
-21
No files found.
src/fns.c
View file @
179b9c44
...
...
@@ -3948,26 +3948,19 @@ HASH_INDEX (struct Lisp_Hash_Table *h, ptrdiff_t idx)
return XFIXNUM (AREF (h->index, idx));
}
/*
C
ompare KEY1 and KEY2
in hash table HT
using
`
eql'.
Value is true
if KEY1 and KEY2 are the same.
KEY1 and KEY2 must not be eq.
*/
/*
Ignore HT and c
ompare KEY1 and KEY2 using
'
eql'.
Value is true
if KEY1 and KEY2 are the same. */
static bool
cmpfn_eql (struct hash_table_test *ht,
Lisp_Object key1,
Lisp_Object key2)
{
if (FLOATP (key1)
&& FLOATP (key2)
&& same_float (key1, key2))
return true;
return (BIGNUMP (key1)
&& BIGNUMP (key2)
&& mpz_cmp (XBIGNUM (key1)->value, XBIGNUM (key2)->value) == 0);
return !NILP (Feql (key1, key2));
}
/* Compare KEY1 and KEY2 in hash table HT using `equal'. Value is
true if KEY1 and KEY2 are the same. */
/* Ignore HT and compare KEY1 and KEY2 using 'equal'.
Value is true if KEY1 and KEY2 are the same. */
static bool
cmpfn_equal (struct hash_table_test *ht,
...
...
@@ -3978,7 +3971,7 @@ cmpfn_equal (struct hash_table_test *ht,
}
/*
C
ompare KEY1 and KEY2
in hash table HT
using HT->user_cmp_function.
/*
Given HT, c
ompare KEY1 and KEY2 using HT->user_cmp_function.
Value is true if KEY1 and KEY2 are the same. */
static bool
...
...
@@ -3989,8 +3982,8 @@ cmpfn_user_defined (struct hash_table_test *ht,
return !NILP (call2 (ht->user_cmp_function, key1, key2));
}
/*
Value is
a hash code for KEY
for use in hash table H which uses
`eq' to compare keys. The valu
e is at most INTMASK. */
/*
Ignore HT and return
a hash code for KEY
which uses 'eq' to compare keys.
The hash cod
e is at most INTMASK. */
static EMACS_UINT
hashfn_eq (struct hash_table_test *ht, Lisp_Object key)
...
...
@@ -3998,8 +3991,8 @@ hashfn_eq (struct hash_table_test *ht, Lisp_Object key)
return XHASH (key) ^ XTYPE (key);
}
/*
Value is
a hash code for KEY
for use in hash table H which uses
`equal' to compare keys. The valu
e is at most INTMASK. */
/*
Ignore HT and return
a hash code for KEY
which uses 'equal' to compare keys.
The hash cod
e is at most INTMASK. */
EMACS_UINT
hashfn_equal (struct hash_table_test *ht, Lisp_Object key)
...
...
@@ -4007,8 +4000,8 @@ hashfn_equal (struct hash_table_test *ht, Lisp_Object key)
return sxhash (key, 0);
}
/*
Value is
a hash code for KEY
for use in hash table H which uses
`eql' to compare keys. The valu
e is at most INTMASK. */
/*
Ignore HT and return
a hash code for KEY
which uses 'eql' to compare keys.
The hash cod
e is at most INTMASK. */
EMACS_UINT
hashfn_eql (struct hash_table_test *ht, Lisp_Object key)
...
...
@@ -4018,8 +4011,8 @@ hashfn_eql (struct hash_table_test *ht, Lisp_Object key)
: hashfn_eq (ht, key));
}
/*
Value is
a hash code for KEY
for use in hash table H which uses as
user-defined
function to compare keys. The
valu
e is at most INTMASK. */
/*
Given HT, return
a hash code for KEY
which uses a user-defined
function to compare keys. The
hash cod
e is at most INTMASK. */
static EMACS_UINT
hashfn_user_defined (struct hash_table_test *ht, Lisp_Object key)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment