diff options
author | Benoit Daloze <eregontp@gmail.com> | 2020-05-02 16:13:57 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2020-05-02 16:16:56 +0200 |
commit | c2dc52e18bda953a5119c3e34dd5d67a281505c6 (patch) | |
tree | 5ccbe6dc2d97cde5b2928bfd2cb160d8e9b79b25 | |
parent | e964f67b897706763f390717d8adcdbba1c04f4f (diff) | |
download | ruby-c2dc52e18bda953a5119c3e34dd5d67a281505c6.tar.gz |
Rename arguments for ObjectSpace::WeakMap#[]= for clarity
-rw-r--r-- | gc.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -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 */ |