Skip to content

Implement short circuit evaluation for AND, OR #22

@nippur72

Description

@nippur72
IF cond1 AND cond2 THEN ...
IF cond3 OR cond4 THEN ...

If cond1 is false there is no need to evaluate cond2, it will be always false. Similarly if cond3 is true no need to evaluate cond4 as it will be always true.

That could provide some speed increase. The only caution is that cond2 and cond4 should not contain call to impure functions (functions that have side effects) but to my knowledge almost all BASIC V2 functions are pure (except RND and FN?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions