summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/string.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/string.c b/src/string.c
index aa26b261c..c602be926 100644
--- a/src/string.c
+++ b/src/string.c
@@ -15,7 +15,6 @@
#include "mruby/class.h"
#include "mruby/range.h"
#include "mruby/string.h"
-#include "mruby/numeric.h"
#include "mruby/re.h"
const char mrb_digitmap[] = "0123456789abcdefghijklmnopqrstuvwxyz";
@@ -751,9 +750,6 @@ mrb_str_aref(mrb_state *mrb, mrb_value str, mrb_value indx)
mrb_regexp_check(mrb, indx);
switch (mrb_type(indx)) {
- case MRB_TT_FLOAT:
- indx = mrb_flo_to_fixnum(mrb, indx);
- /* fall through */
case MRB_TT_FIXNUM:
idx = mrb_fixnum(indx);
@@ -780,6 +776,7 @@ num_index:
return mrb_nil_value();
}
}
+ case MRB_TT_FLOAT:
default:
indx = mrb_Integer(mrb, indx);
if (mrb_nil_p(indx)) {