M2: VALUE hash.c

This commit is contained in:
Jan Nieuwenhuizen 2019-10-25 14:30:27 +02:00
parent 73c5abdcf1
commit 93bb34fa31
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 10 additions and 5 deletions

View File

@ -69,7 +69,8 @@ hash (SCM x, SCM size)
SCM
hashq_get_handle (SCM table, SCM key, SCM dflt)
{
long size = VALUE (struct_ref_ (table, 3));
SCM s = struct_ref_ (table, 3);
long size = VALUE (s);
unsigned hash = hashq_ (key, size);
SCM buckets = struct_ref_ (table, 4);
SCM bucket = vector_ref_ (buckets, hash);
@ -87,7 +88,8 @@ hashq_ref (SCM table, SCM key, SCM dflt)
#if defined (INLINE)
SCM x = hashq_get_handle (table, key, dflt);
#else
long size = VALUE (struct_ref_ (table, 3));
SCM h = struct_ref_ (table, 3);
long size = VALUE (h);
unsigned hash = hashq_ (key, size);
SCM buckets = struct_ref_ (table, 4);
SCM bucket = vector_ref_ (buckets, hash);
@ -105,7 +107,8 @@ hashq_ref (SCM table, SCM key, SCM dflt)
SCM
hash_ref (SCM table, SCM key, SCM dflt)
{
long size = VALUE (struct_ref_ (table, 3));
SCM s = struct_ref_ (table, 3);
long size = VALUE (s);
unsigned hash = hash_ (key, size);
SCM buckets = struct_ref_ (table, 4);
SCM bucket = vector_ref_ (buckets, hash);
@ -139,7 +142,8 @@ hash_set_x_ (SCM table, unsigned hash, SCM key, SCM value)
SCM
hashq_set_x (SCM table, SCM key, SCM value)
{
long size = VALUE (struct_ref_ (table, 3));
SCM s = struct_ref_ (table, 3);
long size = VALUE (s);
unsigned hash = hashq_ (key, size);
#if defined (INLINE)
return hash_set_x_ (table, hash, key, value);
@ -157,7 +161,8 @@ hashq_set_x (SCM table, SCM key, SCM value)
SCM
hash_set_x (SCM table, SCM key, SCM value)
{
long size = VALUE (struct_ref_ (table, 3));
SCM s = struct_ref_ (table, 3);
long size = VALUE (s);
unsigned hash = hash_ (key, size);
#if defined (INLINE)
return hash_set_x_ (table, hash, key, value);