summaryrefslogtreecommitdiffstats
path: root/regex.c
diff options
context:
space:
mode:
Diffstat (limited to 'regex.c')
-rw-r--r--regex.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/regex.c b/regex.c
index 9d07f411..2fc08c64 100644
--- a/regex.c
+++ b/regex.c
@@ -1511,13 +1511,12 @@ val regexp(val obj)
if (consp(obj))
return if2(eq(car(obj), compiled_regex_s), t);
- return (is_ptr(obj) && obj->co.type == COBJ && obj->co.cls == regex_s)
- ? t : nil;
+ return typeof(obj) == regex_s ? t : nil;
}
static nfa_t *regex_nfa(val reg)
{
- assert (reg->co.type == COBJ && reg->co.cls == regex_s);
+ assert (typeof(reg) == regex_s);
return (nfa_t *) reg->co.handle;
}