From 2732879f3e35d78c59a2bb10c6b09df06853b727 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Wed, 17 Dec 2014 20:19:52 +0900 Subject: String#[]: float handling merged to #2677 --- src/string.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src') 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)) { -- cgit v1.2.3