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

ruby-changes:4341

From: ko1@a...
Date: Mon, 24 Mar 2008 19:44:17 +0900 (JST)
Subject: [ruby-changes:4341] knu - Ruby:r15831 (trunk): * parse.y (debug_lines): Always prepare a new array for each

knu	2008-03-24 19:43:56 +0900 (Mon, 24 Mar 2008)

  New Revision: 15831

  Modified files:
    trunk/ChangeLog
    trunk/parse.y

  Log:
    * parse.y (debug_lines): Always prepare a new array for each
      file's SCRIPT_LINES__ storage, instead of appending source lines
      every time a file is re-loaded; submitted by Rocky Bernstein in
      #18517.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/parse.y?r1=15831&r2=15830&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=15831&r2=15830&diff_format=u

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 15830)
+++ ChangeLog	(revision 15831)
@@ -1,3 +1,10 @@
+Mon Mar 24 19:23:52 2008  Akinori MUSHA  <knu@i...>
+
+	* parse.y (debug_lines): Always prepare a new array for each
+	  file's SCRIPT_LINES__ storage, instead of appending source lines
+	  every time a file is re-loaded; submitted by Rocky Bernstein in
+	  #18517.
+
 Mon Mar 24 10:25:54 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* configure.in: sitearch should use target_cpu.  [ruby-core:15986]
Index: parse.y
===================================================================
--- parse.y	(revision 15830)
+++ parse.y	(revision 15831)
@@ -4680,11 +4680,8 @@
 	VALUE hash = rb_const_get_at(rb_cObject, rb_intern("SCRIPT_LINES__"));
 	if (TYPE(hash) == T_HASH) {
 	    VALUE fname = rb_str_new2(f);
-	    VALUE lines = rb_hash_lookup(hash, fname);
-	    if (NIL_P(lines)) {
-		lines = rb_ary_new();
-		rb_hash_aset(hash, fname, lines);
-	    }
+	    VALUE lines = rb_ary_new();
+	    rb_hash_aset(hash, fname, lines);
 	    return lines;
 	}
     }

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

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