String#index should no longer take integer argument

This commit is contained in:
Yukihiro "Matz" Matsumoto
2015-09-22 19:10:03 +09:00
parent e47f0fc0c2
commit 2cb6c27781
2 changed files with 1 additions and 12 deletions
-11
View File
@@ -1389,17 +1389,6 @@ mrb_str_index_m(mrb_state *mrb, mrb_value str)
}
switch (mrb_type(sub)) {
case MRB_TT_FIXNUM: {
mrb_int c = mrb_fixnum(sub);
mrb_int len = RSTRING_LEN(str);
unsigned char *p = (unsigned char*)RSTRING_PTR(str);
for (;pos<len;pos++) {
if (p[pos] == c) return mrb_fixnum_value(pos);
}
return mrb_nil_value();
}
default: {
mrb_value tmp;