summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-18 11:51:54 +0000
committerglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-18 11:51:54 +0000
commite07e814ec3c732337153a71eb5718431d8e28a99 (patch)
tree3a5530f983fe4d818a6f5bc7ad6c7846884cd986 /array.c
parente1335a307c859f612d666245bf891436da8fdd86 (diff)
* array.c (rb_ary_fill): use memfill().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/array.c b/array.c
index 0cd2f0d..d2b45d9 100644
--- a/array.c
+++ b/array.c
@@ -3327,7 +3327,7 @@ rb_ary_fill(int argc, VALUE *argv, VALUE ary)
{
VALUE item, arg1, arg2;
long beg = 0, end = 0, len = 0;
- VALUE *p, *pend;
+ VALUE *p;
int block_p = FALSE;
if (rb_block_given_p()) {
@@ -3385,10 +3385,7 @@ rb_ary_fill(int argc, VALUE *argv, VALUE ary)
}
else {
p = RARRAY_PTR(ary) + beg;
- pend = p + len;
- while (p < pend) {
- *p++ = item;
- }
+ memfill(p, len, item);
}
return ary;
}