summaryrefslogtreecommitdiffhomepage
path: root/src/string.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2015-12-01 10:54:00 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2015-12-01 10:54:00 +0900
commit9f2fca6ebeacaf35a2f6e17c30c9024c730c54d7 (patch)
tree8bf69a9eb6be6152ba71dc63da293d61422745c3 /src/string.c
parent05411ee15e13d415fa385c534b155452668d052b (diff)
downloadmruby-9f2fca6ebeacaf35a2f6e17c30c9024c730c54d7.tar.gz
mruby-9f2fca6ebeacaf35a2f6e17c30c9024c730c54d7.zip
mrb_str_to_inum(): no need to call mrb_string_value_cstr() here; ref 05411ee
Diffstat (limited to 'src/string.c')
-rw-r--r--src/string.c8
1 files changed, 1 insertions, 7 deletions
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 */