mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* struct.c (rb_struct_members): Refactoring. As Struct#members had
returned an array of String, the old code was needed to convert Symbols to Strings. But it is almost unnecessary because the method now returns an array of Symbols. A patch by Masaki Matsushita <glass.saga at gmail dot com> [Feature #6218] [ruby-dev:45451] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2f6c48e53b
commit
f9217681c5
2 changed files with 11 additions and 11 deletions
|
@ -1,3 +1,12 @@
|
|||
Tue May 22 00:45:05 2012 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* struct.c (rb_struct_members): Refactoring. As Struct#members had
|
||||
returned an array of String, the old code was needed to convert
|
||||
Symbols to Strings. But it is almost unnecessary because the
|
||||
method now returns an array of Symbols. A patch by Masaki
|
||||
Matsushita <glass.saga at gmail dot com> [Feature #6218]
|
||||
[ruby-dev:45451]
|
||||
|
||||
Mon May 21 19:20:25 2012 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* lib/net/ftp.rb (Net::FTP#retrbinary): close only if conn is not nil
|
||||
|
|
13
struct.c
13
struct.c
|
@ -64,18 +64,9 @@ rb_struct_members(VALUE s)
|
|||
static VALUE
|
||||
rb_struct_s_members_m(VALUE klass)
|
||||
{
|
||||
VALUE members, ary;
|
||||
VALUE *p, *pend;
|
||||
VALUE members = rb_struct_s_members(klass);
|
||||
|
||||
members = rb_struct_s_members(klass);
|
||||
ary = rb_ary_new2(RARRAY_LEN(members));
|
||||
p = RARRAY_PTR(members); pend = p + RARRAY_LEN(members);
|
||||
while (p < pend) {
|
||||
rb_ary_push(ary, *p);
|
||||
p++;
|
||||
}
|
||||
|
||||
return ary;
|
||||
return rb_ary_dup(members);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Reference in a new issue