summaryrefslogtreecommitdiff
path: root/enumerator.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-20 03:15:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-20 03:15:32 +0000
commit4b81b403eb606adbdc1c0126a46d0ed269076fa5 (patch)
tree5494b1a2dfc79e0d68d3bfdd667a0c94f45d1059 /enumerator.c
parent2d112d2c78d510641d66ec22a12eca90d350a689 (diff)
downloadruby-4b81b403eb606adbdc1c0126a46d0ed269076fa5.tar.gz
enumerator.c: suppress warnings
* enumerator.c (lazy_zip_arrays_func, lazy_zip_func, lazy_take_func), (lazy_drop_func, lazy_drop_while_func): suppress uninitialized instance vriable warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enumerator.c')
-rw-r--r--enumerator.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/enumerator.c b/enumerator.c
index bdf862789e..90511c5868 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -1631,7 +1631,7 @@ lazy_zip_arrays_func(VALUE val, VALUE arrays, int argc, VALUE *argv)
long i, count;
yielder = argv[0];
- memo = rb_ivar_get(yielder, id_memo);
+ memo = rb_attr_get(yielder, id_memo);
count = NIL_P(memo) ? 0 : NUM2LONG(memo);
ary = rb_ary_new2(RARRAY_LEN(arrays) + 1);
@@ -1651,7 +1651,7 @@ lazy_zip_func(VALUE val, VALUE zip_args, int argc, VALUE *argv)
long i;
yielder = argv[0];
- arg = rb_ivar_get(yielder, id_memo);
+ arg = rb_attr_get(yielder, id_memo);
if (NIL_P(arg)) {
arg = rb_ary_new2(RARRAY_LEN(zip_args));
for (i = 0; i < RARRAY_LEN(zip_args); i++) {
@@ -1708,7 +1708,7 @@ static VALUE
lazy_take_func(VALUE val, VALUE args, int argc, VALUE *argv)
{
long remain;
- VALUE memo = rb_ivar_get(argv[0], id_memo);
+ VALUE memo = rb_attr_get(argv[0], id_memo);
if (NIL_P(memo)) {
memo = args;
}
@@ -1791,7 +1791,7 @@ static VALUE
lazy_drop_func(VALUE val, VALUE args, int argc, VALUE *argv)
{
long remain;
- VALUE memo = rb_ivar_get(argv[0], id_memo);
+ VALUE memo = rb_attr_get(argv[0], id_memo);
if (NIL_P(memo)) {
memo = args;
}
@@ -1820,7 +1820,7 @@ lazy_drop(VALUE obj, VALUE n)
static VALUE
lazy_drop_while_func(VALUE val, VALUE args, int argc, VALUE *argv)
{
- VALUE memo = rb_ivar_get(argv[0], id_memo);
+ VALUE memo = rb_attr_get(argv[0], id_memo);
if (NIL_P(memo) && !RTEST(rb_yield_values2(argc - 1, &argv[1]))) {
rb_ivar_set(argv[0], id_memo, memo = Qtrue);
}