summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
Diffstat (limited to 're.c')
-rw-r--r--re.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/re.c b/re.c
index e10901b83d..6dfb9f273f 100644
--- a/re.c
+++ b/re.c
@@ -3299,9 +3299,7 @@ rb_reg_match_m(int argc, VALUE *argv, VALUE re)
pos = 0;
}
- if (NIL_P(str)) {
- rb_warn("given argument is nil");
- }
+ str = SYMBOL_P(str) ? rb_sym2str(str) : StringValue(str);
pos = reg_match_pos(re, &str, pos);
if (pos < 0) {
rb_backref_set(Qnil);
@@ -3347,10 +3345,6 @@ rb_reg_match_p(VALUE re, VALUE str, long pos)
const UChar *start, *end;
int tmpreg;
- if (NIL_P(str)) {
- rb_warn("given argument is nil");
- return Qfalse;
- }
str = SYMBOL_P(str) ? rb_sym2str(str) : StringValue(str);
if (pos) {
if (pos < 0) {