Rename arguments for ObjectSpace::WeakMap#[]= for clarity

This commit is contained in:
Benoit Daloze 2020-05-02 16:13:57 +02:00
Родитель e964f67b89
Коммит c2dc52e18b
1 изменённых файлов: 8 добавлений и 8 удалений

16
gc.c
Просмотреть файл

@ -10738,21 +10738,21 @@ wmap_aset_update(st_data_t *key, st_data_t *val, st_data_t arg, int existing)
/* Creates a weak reference from the given key to the given value */
static VALUE
wmap_aset(VALUE self, VALUE wmap, VALUE orig)
wmap_aset(VALUE self, VALUE key, VALUE value)
{
struct weakmap *w;
TypedData_Get_Struct(self, struct weakmap, &weakmap_type, w);
if (FL_ABLE(orig)) {
define_final0(orig, w->final);
if (FL_ABLE(value)) {
define_final0(value, w->final);
}
if (FL_ABLE(wmap)) {
define_final0(wmap, w->final);
if (FL_ABLE(key)) {
define_final0(key, w->final);
}
st_update(w->obj2wmap, (st_data_t)orig, wmap_aset_update, wmap);
st_insert(w->wmap2obj, (st_data_t)wmap, (st_data_t)orig);
return nonspecial_obj_id(orig);
st_update(w->obj2wmap, (st_data_t)value, wmap_aset_update, key);
st_insert(w->wmap2obj, (st_data_t)key, (st_data_t)value);
return nonspecial_obj_id(value);
}
/* Retrieves a weakly referenced object with the given key */