aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-29 08:43:59 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-29 08:43:59 +0000
commit43c4d8093074e4d7c2639a7fd81c889739599b4d (patch)
tree715aba650bcb5a560ff6a283a755214443321d76 /string.c
parent0d077554723c88f06dd351d29edd2246693e0a42 (diff)
downloadruby-43c4d8093074e4d7c2639a7fd81c889739599b4d.tar.gz
* array.c (rb_ary_combination): new method to give all combination
of elements from an array. [ruby-list:42671] * array.c (rb_ary_product): a new method to get all combinations of elements from two arrays. can be extended to combinations of n-arrays, e.g. a.product(b,c,d). anyone volunteer? * array.c (rb_ary_permutation): empty function body to calculate permutations of array elements. need volunteer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string.c b/string.c
index 690ce86856..c70dc16441 100644
--- a/string.c
+++ b/string.c
@@ -2872,6 +2872,7 @@ rb_str_inspect(VALUE str)
char *p, *pend;
VALUE result = rb_str_buf_new2("");
+ rb_enc_associate(result, enc);
str_cat_char(result, '"', enc);
p = RSTRING_PTR(str); pend = RSTRING_END(str);
while (p < pend) {
@@ -2928,7 +2929,6 @@ rb_str_inspect(VALUE str)
str_cat_char(result, '"', enc);
OBJ_INFECT(result, str);
- rb_enc_associate(result, enc);
return result;
}