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

ruby-changes:49932

From: nobu <ko1@a...>
Date: Fri, 26 Jan 2018 14:34:24 +0900 (JST)
Subject: [ruby-changes:49932] nobu:r62050 (trunk): error.c: use already initialized IDs

nobu	2018-01-26 14:34:18 +0900 (Fri, 26 Jan 2018)

  New Revision: 62050

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62050

  Log:
    error.c: use already initialized IDs
    [Feature #14313]

  Modified files:
    trunk/error.c
Index: error.c
===================================================================
--- error.c	(revision 62049)
+++ error.c	(revision 62050)
@@ -1705,14 +1705,10 @@ key_err_initialize(int argc, VALUE *argv https://github.com/ruby/ruby/blob/trunk/error.c#L1705
     }
 
     if (!NIL_P(options)) {
-	static ID keywords[2];
+	ID keywords[2];
 	VALUE values[2];
-	if (!keywords[0]) {
-	    CONST_ID(keywords[0], "receiver");
-	}
-	if (!keywords[1]) {
-	    CONST_ID(keywords[1], "key");
-	}
+	keywords[0] = id_receiver;
+	keywords[1] = id_key;
 	rb_get_kwargs(options, keywords, 0, 2, values);
 	if (values[0] != Qundef) {
 	    receiver = values[0];

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

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