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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-01-14 03:35:25 +00:00
parent badd44845e
commit d4beba3f3e
3 changed files with 13 additions and 5 deletions

View File

@ -1,3 +1,7 @@
Wed Jan 14 12:35:20 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (rb_io_s_pipe): reduced nest of rb_ensure of main block.
Tue Jan 13 22:56:57 2009 Tanaka Akira <akr@fsij.org>
* ext/socket/addrinfo.h (AI_NUMERICSERV): defined.

10
io.c
View File

@ -7028,9 +7028,10 @@ io_encoding_set(rb_io_t *fptr, VALUE v1, VALUE v2, VALUE opt)
}
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 @@ rb_io_s_pipe(int argc, VALUE *argv, VALUE klass)
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;
}

View File

@ -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[];