summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--array.c10
2 files changed, 6 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 61415d6045..b007cf7712 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Dec 26 13:29:35 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (tmpbuf): use rb_str_tmp_new().
+
Wed Dec 26 00:57:53 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/json/ext/generator/generator.c (Init_generator): requires
diff --git a/array.c b/array.c
index 0a3fb64b24..a2cf86a24c 100644
--- a/array.c
+++ b/array.c
@@ -2969,14 +2969,8 @@ rb_ary_cycle(VALUE ary)
return Qnil;
}
-static VALUE
-tmpbuf(int n, int size)
-{
- VALUE buf = rb_str_new(0, n*size);
-
- RBASIC(buf)->klass = 0;
- return buf;
-}
+VALUE rb_str_tmp_new(long);
+#define tmpbuf(n, size) rb_str_tmp_new((n)*(size))
/*
* Recursively compute permutations of r elements of the set [0..n-1].