* array.c: use rb_equal_opt() for performance improvement.
[ruby-core:64954] [Feature #10227] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8bb93fc8ae
commit
e539565d9a
@ -1,3 +1,8 @@
|
|||||||
|
Sat Sep 20 03:46:58 2014 Masaki Matsushita <glass.saga@gmail.com>
|
||||||
|
|
||||||
|
* array.c: use rb_equal_opt() for performance improvement.
|
||||||
|
[ruby-core:64954] [Feature #10227]
|
||||||
|
|
||||||
Sun Sep 21 11:16:56 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
|
Sun Sep 21 11:16:56 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
|
||||||
|
|
||||||
* ext/win32ole/win32ole.c (rbtime2vtdate, vtdate2rbtime): fix
|
* ext/win32ole/win32ole.c (rbtime2vtdate, vtdate2rbtime): fix
|
||||||
|
8
array.c
8
array.c
@ -3846,9 +3846,15 @@ VALUE
|
|||||||
rb_ary_includes(VALUE ary, VALUE item)
|
rb_ary_includes(VALUE ary, VALUE item)
|
||||||
{
|
{
|
||||||
long i;
|
long i;
|
||||||
|
VALUE e;
|
||||||
|
|
||||||
for (i=0; i<RARRAY_LEN(ary); i++) {
|
for (i=0; i<RARRAY_LEN(ary); i++) {
|
||||||
if (rb_equal(RARRAY_AREF(ary, i), item)) {
|
e = RARRAY_AREF(ary, i);
|
||||||
|
switch (rb_equal_opt(e, item)) {
|
||||||
|
case Qundef:
|
||||||
|
if (rb_equal(e, item)) return Qtrue;
|
||||||
|
break;
|
||||||
|
case Qtrue:
|
||||||
return Qtrue;
|
return Qtrue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user