Skip to content

Commit d8fe6d8

Browse files
committed
Fix ifelse() optimization
Fixup for the previous commit.
1 parent 50c7036 commit d8fe6d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/laytonsmith/core/functions/ControlFlow.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ public ParseTree optimizeDynamic(Target t, Environment env,
478478

479479
// Optimize per condition code pair for constant conditions.
480480
boolean foundDynamicCond = false;
481-
for(int i = 0; i < children.size(); i += 2) {
481+
for(int i = 0; i < children.size() - 1; i += 2) {
482482
ParseTree condNode = children.get(i);
483483
if(condNode.isConst()) {
484484
if(ArgumentValidation.getBooleanish(condNode.getData(), t)) {

0 commit comments

Comments
 (0)