1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* array.c (rb_ary_index, rb_ary_rindex): We know that argc is not

zero when we reach here.

* array.c (rb_ary_initialize, rb_ary_index): Shrink a double
  space. (NFC)



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
knu 2009-02-23 06:54:58 +00:00
parent bcf6fd2c86
commit 1a1990df71
2 changed files with 12 additions and 4 deletions

View file

@ -1,3 +1,11 @@
Mon Feb 23 15:53:30 2009 Akinori MUSHA <knu@iDaemons.org>
* array.c (rb_ary_index, rb_ary_rindex): We know that argc is not
zero when we reach here.
* array.c (rb_ary_initialize, rb_ary_index): Shrink a double
space. (NFC)
Mon Feb 23 14:47:04 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/fileutils.rb (mv): added description for the case of

View file

@ -1127,7 +1127,7 @@ rb_ary_index(int argc, VALUE *argv, VALUE ary)
}
return Qnil;
}
rb_scan_args(argc, argv, "01", &val);
rb_scan_args(argc, argv, "1", &val);
for (i=0; i<RARRAY_LEN(ary); i++) {
if (rb_equal(RARRAY_PTR(ary)[i], val))
return LONG2NUM(i);
@ -1167,7 +1167,7 @@ rb_ary_rindex(int argc, VALUE *argv, VALUE ary)
}
return Qnil;
}
rb_scan_args(argc, argv, "01", &val);
rb_scan_args(argc, argv, "1", &val);
while (i--) {
if (rb_equal(RARRAY_PTR(ary)[i], val))
return LONG2NUM(i);