From c2dc52e18bda953a5119c3e34dd5d67a281505c6 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 2 May 2020 16:13:57 +0200 Subject: [PATCH] Rename arguments for ObjectSpace::WeakMap#[]= for clarity --- gc.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gc.c b/gc.c index 33f38bb7ad..fb167bf7d5 100644 --- a/gc.c +++ b/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 */