summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/string.c b/string.c
index 300aacb..9238e6c 100644
--- a/string.c
+++ b/string.c
@@ -3244,7 +3244,7 @@ static VALUE
rb_str_aref_m(int argc, VALUE *argv, VALUE str)
{
if (argc == 2) {
- if (TYPE(argv[0]) == T_REGEXP) {
+ if (RB_TYPE_P(argv[0], T_REGEXP)) {
return rb_str_subpat(str, argv[0], argv[1]);
}
return rb_str_substr(str, NUM2LONG(argv[0]), NUM2LONG(argv[1]));
@@ -3469,7 +3469,7 @@ static VALUE
rb_str_aset_m(int argc, VALUE *argv, VALUE str)
{
if (argc == 3) {
- if (TYPE(argv[0]) == T_REGEXP) {
+ if (RB_TYPE_P(argv[0], T_REGEXP)) {
rb_str_subpat_set(str, argv[0], argv[1], argv[2]);
}
else {