summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-27 02:10:22 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-27 02:10:22 +0000
commit66c2bbdea3f4f7b0ce988f66e7e0fa555c696d53 (patch)
treed715fbaeb693939368547c393b98c92f6910e46e /parse.y
parente7bcea383134ceb0a018b89a01ac41d028959fee (diff)
parse.y: use rb_ary_tmp_new_fill
* parse.y (coverage): use rb_ary_tmp_new_fill() instead of setting internal structure directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y6
1 files changed, 1 insertions, 5 deletions
diff --git a/parse.y b/parse.y
index a51c276403..58a6dbf016 100644
--- a/parse.y
+++ b/parse.y
@@ -5313,11 +5313,7 @@ coverage(VALUE fname, int n)
{
VALUE coverages = rb_get_coverages();
if (RTEST(coverages) && RBASIC(coverages)->klass == 0) {
- VALUE lines = rb_ary_new2(n);
- int i;
- RBASIC_CLEAR_CLASS(lines);
- for (i = 0; i < n; i++) RARRAY_ASET(lines, i, Qnil);
- RARRAY(lines)->as.heap.len = n;
+ VALUE lines = rb_ary_tmp_new_fill(n);
rb_hash_aset(coverages, fname, lines);
return lines;
}