String#rindex should no longer take integer argument

This commit is contained in:
Yukihiro "Matz" Matsumoto
2015-09-23 01:06:11 +09:00
parent 418eec2c7d
commit 6a06a3e48d
2 changed files with 0 additions and 13 deletions
-10
View File
@@ -1725,16 +1725,6 @@ mrb_str_rindex_m(mrb_state *mrb, mrb_value str)
mrb_regexp_check(mrb, sub);
switch (mrb_type(sub)) {
case MRB_TT_FIXNUM: {
mrb_int c = mrb_fixnum(sub);
unsigned char *p = (unsigned char*)RSTRING_PTR(str);
for (pos=len-1;pos>=0;pos--) {
if (p[pos] == c) return mrb_fixnum_value(pos);
}
return mrb_nil_value();
}
default: {
mrb_value tmp;