diff options
author | Dirk Herrmann <dirk@dirk-herrmanns-seiten.de> | 2001-10-08 21:23:00 +0000 |
---|---|---|
committer | Dirk Herrmann <dirk@dirk-herrmanns-seiten.de> | 2001-10-08 21:23:00 +0000 |
commit | ee083ac29f32c5657f02fae999701310bd7da7bf (patch) | |
tree | 85f677290cfa21e043307ddac056b7379436884c /libguile/hashtab.c | |
parent | c81f296a087281bab5a8708b2b16966e328c2363 (diff) | |
download | guile-ee083ac29f32c5657f02fae999701310bd7da7bf.tar.gz |
* hashtab.c (scm_hash_fn_create_handle_x): The result of assoc_fn
is known to be #f if no entry is found. Thus, use !SCM_FALSEP
instead of SCM_NIMP to test for that case.
* strings.h (SCM_SET_STRING_LENGTH): Cast the length to
scm_t_bits instead of long.
Diffstat (limited to 'libguile/hashtab.c')
-rw-r--r-- | libguile/hashtab.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/libguile/hashtab.c b/libguile/hashtab.c index ca06b2030..dc5545390 100644 --- a/libguile/hashtab.c +++ b/libguile/hashtab.c @@ -96,20 +96,21 @@ scm_hash_fn_create_handle_x (SCM table,SCM obj,SCM init,unsigned long (*hash_fn) scm_out_of_range ("hash_fn_create_handle_x", scm_ulong2num (k)); SCM_REDEFER_INTS; it = assoc_fn (obj, SCM_VELTS (table)[k], closure); - if (SCM_NIMP (it)) + if (!SCM_FALSEP (it)) { SCM_REALLOW_INTS; return it; } - { - SCM new_bucket; - SCM old_bucket; - old_bucket = SCM_VELTS (table)[k]; - new_bucket = scm_acons (obj, init, old_bucket); - SCM_VELTS(table)[k] = new_bucket; - SCM_REALLOW_INTS; - return SCM_CAR (new_bucket); - } + else + { + SCM new_bucket; + SCM old_bucket; + old_bucket = SCM_VELTS (table)[k]; + new_bucket = scm_acons (obj, init, old_bucket); + SCM_VELTS(table)[k] = new_bucket; + SCM_REALLOW_INTS; + return SCM_CAR (new_bucket); + } } #undef FUNC_NAME |