[前][次][番号順一覧][スレッド一覧]

ruby-changes:60981

From: Benoit <ko1@a...>
Date: Sat, 2 May 2020 23:17:32 +0900 (JST)
Subject: [ruby-changes:60981] c2dc52e18b (master): Rename arguments for ObjectSpace::WeakMap#[]= for clarity

https://git.ruby-lang.org/ruby.git/commit/?id=c2dc52e18b

From c2dc52e18bda953a5119c3e34dd5d67a281505c6 Mon Sep 17 00:00:00 2001
From: Benoit Daloze <eregontp@g...>
Date: Sat, 2 May 2020 16:13:57 +0200
Subject: Rename arguments for ObjectSpace::WeakMap#[]= for clarity


diff --git a/gc.c b/gc.c
index 33f38bb..fb167bf 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) https://github.com/ruby/ruby/blob/trunk/gc.c#L10738
 
 /* 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 */
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]