* array.c (rb_ary_assoc): check and convert inner arrays (assocs)

using #to_ary.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2007-10-25 16:52:40 +00:00
parent bb053cd824
commit d9ff0a6c22
3 changed files with 10 additions and 6 deletions

View File

@ -1,3 +1,8 @@
Fri Oct 26 01:48:28 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* array.c (rb_ary_assoc): check and convert inner arrays (assocs)
using #to_ary.
Thu Oct 25 14:19:33 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (rb_io_tell, rb_io_seek): check errno too. [ruby-dev:32093]

View File

@ -2283,9 +2283,8 @@ rb_ary_assoc(VALUE ary, VALUE key)
VALUE v;
for (i = 0; i < RARRAY_LEN(ary); ++i) {
v = RARRAY_PTR(ary)[i];
if (TYPE(v) == T_ARRAY &&
RARRAY_LEN(v) > 0 &&
v = rb_check_array_type(RARRAY_PTR(ary)[i]);
if (!NIL_P(v) && RARRAY_LEN(v) > 0 &&
rb_equal(RARRAY_PTR(v)[0], key))
return v;
}

View File

@ -1,7 +1,7 @@
#define RUBY_VERSION "1.9.0"
#define RUBY_RELEASE_DATE "2007-10-25"
#define RUBY_RELEASE_DATE "2007-10-26"
#define RUBY_VERSION_CODE 190
#define RUBY_RELEASE_CODE 20071025
#define RUBY_RELEASE_CODE 20071026
#define RUBY_PATCHLEVEL 0
#define RUBY_VERSION_MAJOR 1
@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_YEAR 2007
#define RUBY_RELEASE_MONTH 10
#define RUBY_RELEASE_DAY 25
#define RUBY_RELEASE_DAY 26
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];