diff options
Diffstat (limited to 're.c')
-rw-r--r-- | re.c | 8 |
1 files changed, 1 insertions, 7 deletions
@@ -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) { |