st.c: fix num_entries
* st.c (st_insert2): should manage num_entries when the key is undefined, as well as st_insert(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4a09333b35
commit
813ffb8b53
2
st.c
2
st.c
@ -1197,6 +1197,8 @@ st_insert2(st_table *tab, st_data_t key, st_data_t value,
|
|||||||
if (tab->bins == NULL) {
|
if (tab->bins == NULL) {
|
||||||
bin = find_entry(tab, hash_value, key);
|
bin = find_entry(tab, hash_value, key);
|
||||||
new_p = bin == UNDEFINED_ENTRY_IND;
|
new_p = bin == UNDEFINED_ENTRY_IND;
|
||||||
|
if (new_p)
|
||||||
|
tab->num_entries++;
|
||||||
bin_ind = UNDEFINED_BIN_IND;
|
bin_ind = UNDEFINED_BIN_IND;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user