mirror of
https://github.com/kaspanet/kaspad.git
synced 2026-03-15 12:55:00 +00:00
This commit improves the way the conditional execution stack is handled in a few ways. First, the current execution state is now pushed onto the end of the slice rather than the front of it. This has been done because it results in fewer allocations and is therefore more efficient. Second, the need for allocating and setting an initial true in the conditional stack has been eliminated. The vast majority of scripts don't contain any conditionals, so there is no reason to allocate a slice when it isn't needed. Third, a new function has been added to the engine to determine if the current conditional branch is executing named isBranchExecuting which handles the fact the conditional execution stack can now be empty and improves the readability of the code. Finally, it removes a couple of TODOs which I have verified do not apply.
54 KiB
54 KiB