From e07e814ec3c732337153a71eb5718431d8e28a99 Mon Sep 17 00:00:00 2001 From: glass Date: Thu, 18 Jul 2013 11:51:54 +0000 Subject: * array.c (rb_ary_fill): use memfill(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- array.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'array.c') diff --git a/array.c b/array.c index 0cd2f0d91a..d2b45d9312 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; } -- cgit v1.2.3