зеркало из https://github.com/github/ruby.git
When splitting a keyword hash, dup it first to not mutate it
This commit is contained in:
Родитель
5c507db467
Коммит
16cd0de6ec
|
@ -241,6 +241,7 @@ keyword_hash_p(VALUE *kw_hash_ptr, VALUE *rest_hash_ptr, int check_only_symbol)
|
|||
*kw_hash_ptr = Qnil;
|
||||
return FALSE;
|
||||
case KW_HASH_HAS_BOTH_KEYS:
|
||||
*rest_hash_ptr = rb_hash_dup(*rest_hash_ptr);
|
||||
keyword_hash_split(kw_hash_ptr, rest_hash_ptr);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче