array.c: yield_indexed_values

* array.c (yield_indexed_values): extract from permute0(),
  rpermute0(), and rcombinate0().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
array.c: combination on a shared copy

* array.c (rb_ary_combination): iterate on a shared copy, and use
  array of indexes instead of array of chosen objects.
  [ruby-core:63149] [Bug #9939]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e