mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
String#rindex should no longer take integer argument
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user