mrb_str_to_inum(): no need to call mrb_string_value_cstr() here; ref 05411ee

This commit is contained in:
Yukihiro "Matz" Matsumoto
2015-12-01 10:54:00 +09:00
parent 05411ee15e
commit 9f2fca6ebe
+1 -7
View File
@@ -2198,13 +2198,7 @@ mrb_str_to_inum(mrb_state *mrb, mrb_value str, mrb_int base, mrb_bool badcheck)
const char *s;
mrb_int len;
if (badcheck) {
/* Raises if the string contains a null character (the badcheck) */
s = mrb_string_value_cstr(mrb, &str);
}
else {
s = mrb_string_value_ptr(mrb, str);
}
s = mrb_string_value_ptr(mrb, str);
if (s) {
len = RSTRING_LEN(str);
if (s[len]) { /* no sentinel somehow */