Skip to content

Commit

Permalink
* array.c (rb_ary_equal): compare RARRAY_PTR() for performance
Browse files Browse the repository at this point in the history
  improvement in case of that self and other are shared.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
glass committed Jul 18, 2013
1 parent e07e814 commit 4595d9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Thu Jul 18 21:15:41 2013 Masaki Matsushita <glass.saga@gmail.com>

* array.c (rb_ary_equal): compare RARRAY_PTR() for performance
improvement in case of that self and other are shared.

Thu Jul 18 20:44:51 2013 Masaki Matsushita <glass.saga@gmail.com>

* array.c (rb_ary_fill): use memfill().
Expand Down
1 change: 1 addition & 0 deletions array.c
Original file line number Diff line number Diff line change
Expand Up @@ -3637,6 +3637,7 @@ rb_ary_equal(VALUE ary1, VALUE ary2)
return rb_equal(ary2, ary1);
}
if (RARRAY_LEN(ary1) != RARRAY_LEN(ary2)) return Qfalse;
if (RARRAY_PTR(ary1) == RARRAY_PTR(ary2)) return Qtrue;
return rb_exec_recursive_paired(recursive_equal, ary1, ary2, ary2);
}

Expand Down

0 comments on commit 4595d9a

Please sign in to comment.