mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
2 changed files with 12 additions and 1 deletions
|
@ -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>
|
||||
|
||||
* 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)
|
||||
{
|
||||
long i;
|
||||
VALUE e;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue