core: Allow non-string hash keys.
This merely allows adding non-string keys to a hash table and puts them non-string keys in bucket 0. Efficiency is lost. TODO: calculate a proper hash. * src/hash.c (hash_): Allow non-string keys in bucket 0.
This commit is contained in:
parent
40a6b0e3b0
commit
9abd7d84ad
10
src/hash.c
10
src/hash.c
|
@ -46,13 +46,9 @@ hashq_ (struct scm *x, long size)
|
||||||
int
|
int
|
||||||
hash_ (struct scm *x, long size)
|
hash_ (struct scm *x, long size)
|
||||||
{
|
{
|
||||||
if (x->type != TSTRING)
|
if (x->type == TSTRING)
|
||||||
{
|
return hash_cstring (cell_bytes (x->string), size);
|
||||||
eputs ("hash_ failed, not a string:");
|
return 0;
|
||||||
display_error_ (x);
|
|
||||||
assert_msg (0, "0");
|
|
||||||
}
|
|
||||||
return hash_cstring (cell_bytes (x->string), size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct scm *
|
struct scm *
|
||||||
|
|
Loading…
Reference in New Issue