From 9f2fca6ebeacaf35a2f6e17c30c9024c730c54d7 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Tue, 1 Dec 2015 10:54:00 +0900 Subject: mrb_str_to_inum(): no need to call mrb_string_value_cstr() here; ref 05411ee --- src/string.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src') diff --git a/src/string.c b/src/string.c index 2b47b06ca..510bd4e73 100644 --- a/src/string.c +++ b/src/string.c @@ -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 */ -- cgit v1.2.3