Refactor code.

This commit is contained in:
Dianne Skoll
2025-03-13 23:51:22 -04:00
parent 04404a252e
commit c506fa4613

View File

@@ -1132,8 +1132,7 @@ int DoIf(ParsePtr p)
syndrome = IF_TRUE | BEFORE_ELSE;
Eprint("%s", GetErr(r));
} else
if ( (v.type != STR_TYPE && v.v.val) ||
(v.type == STR_TYPE && strcmp(v.v.str, "")) ) {
if (truthy(&v)) {
syndrome = IF_TRUE | BEFORE_ELSE;
} else {
syndrome = IF_FALSE | BEFORE_ELSE;