mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
check modifcation whil ar->st
* delete `ar_try_convert` but use `ar_force_convert_table` to make program simple. * `ar_force_convert_table` checks hash modification while calling `#hash` method with the following strategy: 1. copy keys (and vals) of ar_table 2. calc hashes from keys 3. check copied keys and hash's keys. if not matched, repeat from 1 fix [Bug #20050]
This commit is contained in:
parent
29e99c84ae
commit
7ba2506232
3 changed files with 62 additions and 39 deletions
7
st.c
7
st.c
|
@ -1173,6 +1173,13 @@ st_add_direct_with_hash(st_table *tab,
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
rb_st_add_direct_with_hash(st_table *tab,
|
||||
st_data_t key, st_data_t value, st_hash_t hash)
|
||||
{
|
||||
st_add_direct_with_hash(tab, key, value, hash);
|
||||
}
|
||||
|
||||
/* Insert (KEY, VALUE) into table TAB. The table should not have
|
||||
entry with KEY before the insertion. */
|
||||
void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue