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

ruby-changes:31286

From: tmm1 <ko1@a...>
Date: Sun, 20 Oct 2013 04:21:12 +0900 (JST)
Subject: [ruby-changes:31286] tmm1:r43365 (trunk): * variable.c (rb_class2name): call rb_tmp_class_path() directly to avoid extra rb_str_dup() from rb_class_name().

tmm1	2013-10-20 04:21:05 +0900 (Sun, 20 Oct 2013)

  New Revision: 43365

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43365

  Log:
    * variable.c (rb_class2name): call rb_tmp_class_path() directly to avoid extra rb_str_dup() from rb_class_name().

  Modified files:
    trunk/ChangeLog
    trunk/variable.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43364)
+++ ChangeLog	(revision 43365)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Oct 20 04:18:48 2013  Aman Gupta <ruby@t...>
+
+	* variable.c (rb_class2name): call rb_tmp_class_path() directly to
+	  avoid extra rb_str_dup() from rb_class_name().
+
 Sat Oct 19 19:59:02 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* win32/file.c (code_page): use simple array instead of st_table.
Index: variable.c
===================================================================
--- variable.c	(revision 43364)
+++ variable.c	(revision 43365)
@@ -385,8 +385,10 @@ rb_class_name(VALUE klass) https://github.com/ruby/ruby/blob/trunk/variable.c#L385
 const char *
 rb_class2name(VALUE klass)
 {
-    VALUE name = rb_class_name(klass);
-    return RSTRING_PTR(name);
+    int permanent;
+    VALUE path = rb_tmp_class_path(klass, &permanent, rb_ivar_set);
+    if (NIL_P(path)) return NULL;
+    return RSTRING_PTR(path);
 }
 
 const char *

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

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