mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
array.c: Optimize rb_ary_and. Patch by Stefan Schüßler. [Fix GH-1938]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4e62527c33
commit
4452e857d4
1 changed files with 1 additions and 1 deletions
2
array.c
2
array.c
|
@ -4236,7 +4236,7 @@ rb_ary_and(VALUE ary1, VALUE ary2)
|
|||
|
||||
ary2 = to_ary(ary2);
|
||||
ary3 = rb_ary_new();
|
||||
if (RARRAY_LEN(ary2) == 0) return ary3;
|
||||
if (RARRAY_LEN(ary1) == 0 || RARRAY_LEN(ary2) == 0) return ary3;
|
||||
|
||||
if (RARRAY_LEN(ary1) <= SMALL_ARRAY_LEN && RARRAY_LEN(ary2) <= SMALL_ARRAY_LEN) {
|
||||
for (i=0; i<RARRAY_LEN(ary1); i++) {
|
||||
|
|
Loading…
Reference in a new issue