summaryrefslogtreecommitdiff
path: root/val.c
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-06-21 02:46:15 +0100
committerubq323 <ubq323@ubq323.website>2024-06-21 02:46:15 +0100
commit671645c370498955eb101695bd9099bf4caf5aea (patch)
tree119db5228fceaa1e340a2f30017885b5377a2068 /val.c
parent5298940fc7798455d701d075b910e0545d3f6048 (diff)
minor optimization
Diffstat (limited to 'val.c')
-rw-r--r--val.c4
1 files changed, 2 insertions, 2 deletions
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;
}