summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
Diffstat (limited to 're.c')
-rw-r--r--re.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/re.c b/re.c
index 17612d48f4..4e57971364 100644
--- a/re.c
+++ b/re.c
@@ -2667,12 +2667,7 @@ reg_operand(VALUE s, int check)
return rb_sym_to_s(s);
}
else {
- VALUE tmp = rb_check_string_type(s);
- if (check && NIL_P(tmp)) {
- rb_raise(rb_eTypeError, "can't convert %s to String",
- rb_obj_classname(s));
- }
- return tmp;
+ return (check ? rb_str_to_str : rb_check_string_type)(s);
}
}