diff options
| author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-30 12:35:04 +0000 |
|---|---|---|
| committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-30 12:35:04 +0000 |
| commit | a6774a0c045da4fd2c1441444873d4f7dc5c8d58 (patch) | |
| tree | 0cabd0e63180454b8817a8abe2737a523485a2ca | |
| parent | c4b7937de72b13d2c695497c943c360d3fb710eb (diff) | |
| download | ruby-a6774a0c045da4fd2c1441444873d4f7dc5c8d58.tar.gz ruby-a6774a0c045da4fd2c1441444873d4f7dc5c8d58.tar.xz ruby-a6774a0c045da4fd2c1441444873d4f7dc5c8d58.zip | |
* array.c (rb_ary_permutation): hide temporal array.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | array.c | 2 |
2 files changed, 6 insertions, 0 deletions
@@ -1,3 +1,7 @@ +Thu Oct 30 21:32:15 2008 Yusuke Endoh <mame@tsg.ne.jp> + + * array.c (rb_ary_permutation): hide temporal array. + Thu Oct 30 14:45:45 2008 Martin Duerst <duerst@it.aoyama.ac.jp> * enc/trans/single_byte.trans: refactoring to make it easier @@ -3461,12 +3461,14 @@ rb_ary_permutation(int argc, VALUE *argv, VALUE ary) volatile VALUE t1 = tmpbuf(n,sizeof(int)); int *used = (int*)RSTRING_PTR(t1); VALUE ary0 = ary_make_substitution(ary); /* private defensive copy of ary */ + RBASIC(ary0)->klass = 0; for (i = 0; i < n; i++) used[i] = 0; /* initialize array */ permute0(n, r, p, 0, used, ary0); /* compute and yield permutations */ RB_GC_GUARD(t0); RB_GC_GUARD(t1); + RBASIC(ary0)->klass = rb_cArray; } return ary; } |
