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

ruby-changes:9961

From: nobu <ko1@a...>
Date: Wed, 14 Jan 2009 12:35:48 +0900 (JST)
Subject: [ruby-changes:9961] Ruby:r21502 (trunk): * io.c (rb_io_s_pipe): reduced nest of rb_ensure of main block.

nobu	2009-01-14 12:35:25 +0900 (Wed, 14 Jan 2009)

  New Revision: 21502

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

  Log:
    * io.c (rb_io_s_pipe): reduced nest of rb_ensure of main block.

  Modified files:
    trunk/ChangeLog
    trunk/io.c
    trunk/version.h

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 21501)
+++ ChangeLog	(revision 21502)
@@ -1,3 +1,7 @@
+Wed Jan 14 12:35:20 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* io.c (rb_io_s_pipe): reduced nest of rb_ensure of main block.
+
 Tue Jan 13 22:56:57 2009  Tanaka Akira  <akr@f...>
 
 	* ext/socket/addrinfo.h (AI_NUMERICSERV): defined.
Index: io.c
===================================================================
--- io.c	(revision 21501)
+++ io.c	(revision 21502)
@@ -7028,9 +7028,10 @@
 }
 
 static VALUE
-pipe_yield(VALUE rw)
+pipe_pair_close(VALUE rw)
 {
-    return rb_ensure(rb_yield, rw, io_close, rb_ary_entry(rw, 1));
+    VALUE *rwp = (VALUE *)rw;
+    return rb_ensure(io_close, rwp[0], io_close, rwp[1]);
 }
 
 /*
@@ -7135,7 +7136,10 @@
 
     ret = rb_assoc_new(r, w);
     if (rb_block_given_p()) {
-	return rb_ensure(pipe_yield, ret, io_close, r);
+	VALUE rw[2];
+	rw[0] = r;
+	rw[1] = w;
+	return rb_ensure(rb_yield, ret, pipe_pair_close, (VALUE)rw);
     }
     return ret;
 }
Index: version.h
===================================================================
--- version.h	(revision 21501)
+++ version.h	(revision 21502)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.1"
-#define RUBY_RELEASE_DATE "2009-01-13"
+#define RUBY_RELEASE_DATE "2009-01-14"
 #define RUBY_PATCHLEVEL 5000
 #define RUBY_BRANCH_NAME "trunk"
 
@@ -8,7 +8,7 @@
 #define RUBY_VERSION_TEENY 1
 #define RUBY_RELEASE_YEAR 2009
 #define RUBY_RELEASE_MONTH 1
-#define RUBY_RELEASE_DAY 13
+#define RUBY_RELEASE_DAY 14
 
 #ifdef RUBY_EXTERN
 RUBY_EXTERN const char ruby_version[];

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

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