From 671645c370498955eb101695bd9099bf4caf5aea Mon Sep 17 00:00:00 2001 From: ubq323 Date: Fri, 21 Jun 2024 02:46:15 +0100 Subject: minor optimization --- val.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'val.c') diff --git a/val.c b/val.c index 5a20d09..18d0ffa 100644 --- a/val.c +++ b/val.c @@ -76,8 +76,8 @@ void println_val(Val v) { } bool is_truthy(Val v) { - if (IS_NIL(v) || ( IS_BOOL(v) && AS_BOOL(v) == false)) - return false; + if (IS_BOOL(v)) return AS_BOOL(v); + if (IS_NIL(v)) return false; return true; } -- cgit v1.2.3