RHASH_AR_TABLE
never returns NULL now [ci skip]
This commit is contained in:
parent
abd0b9b28a
commit
779cab6655
6
hash.c
6
hash.c
@ -484,7 +484,7 @@ rb_hash_dump(VALUE hash)
|
|||||||
rb_obj_info_dump(hash);
|
rb_obj_info_dump(hash);
|
||||||
|
|
||||||
if (RHASH_AR_TABLE_P(hash)) {
|
if (RHASH_AR_TABLE_P(hash)) {
|
||||||
unsigned i, n = 0, bound = RHASH_AR_TABLE_BOUND(hash);
|
unsigned i, bound = RHASH_AR_TABLE_BOUND(hash);
|
||||||
|
|
||||||
fprintf(stderr, " size:%u bound:%u\n",
|
fprintf(stderr, " size:%u bound:%u\n",
|
||||||
RHASH_AR_TABLE_SIZE(hash), bound);
|
RHASH_AR_TABLE_SIZE(hash), bound);
|
||||||
@ -501,7 +501,6 @@ rb_hash_dump(VALUE hash)
|
|||||||
rb_raw_obj_info(b1, 0x100, k),
|
rb_raw_obj_info(b1, 0x100, k),
|
||||||
rb_raw_obj_info(b2, 0x100, v),
|
rb_raw_obj_info(b2, 0x100, v),
|
||||||
ar_hint(hash, i));
|
ar_hint(hash, i));
|
||||||
n++;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fprintf(stderr, " %d empty\n", i);
|
fprintf(stderr, " %d empty\n", i);
|
||||||
@ -995,8 +994,6 @@ ar_insert(VALUE hash, st_data_t key, st_data_t value)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
HASH_ASSERT(RHASH_AR_TABLE(hash));
|
|
||||||
|
|
||||||
bin = ar_find_entry(hash, hash_value, key);
|
bin = ar_find_entry(hash, hash_value, key);
|
||||||
if (bin == RHASH_AR_TABLE_MAX_BOUND) {
|
if (bin == RHASH_AR_TABLE_MAX_BOUND) {
|
||||||
if (RHASH_AR_TABLE_SIZE(hash) >= RHASH_AR_TABLE_MAX_SIZE) {
|
if (RHASH_AR_TABLE_SIZE(hash) >= RHASH_AR_TABLE_MAX_SIZE) {
|
||||||
@ -1004,7 +1001,6 @@ ar_insert(VALUE hash, st_data_t key, st_data_t value)
|
|||||||
}
|
}
|
||||||
else if (bin >= RHASH_AR_TABLE_MAX_BOUND) {
|
else if (bin >= RHASH_AR_TABLE_MAX_BOUND) {
|
||||||
bin = ar_compact_table(hash);
|
bin = ar_compact_table(hash);
|
||||||
HASH_ASSERT(RHASH_AR_TABLE(hash));
|
|
||||||
}
|
}
|
||||||
HASH_ASSERT(bin < RHASH_AR_TABLE_MAX_BOUND);
|
HASH_ASSERT(bin < RHASH_AR_TABLE_MAX_BOUND);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user