diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-27 02:10:22 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-27 02:10:22 +0000 |
commit | 66c2bbdea3f4f7b0ce988f66e7e0fa555c696d53 (patch) | |
tree | d715fbaeb693939368547c393b98c92f6910e46e | |
parent | e7bcea383134ceb0a018b89a01ac41d028959fee (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
-rw-r--r-- | parse.y | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -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; } |