src/plugins/contrib/wxSmithSTC/stc/scintilla/src/CellBuffer.cxx line 584
Code:
int UndoHistory::StartRedo() {
// Drop any leading startAction
if (actions[currentAction].at == startAction && currentAction < maxAction) //<-- change conditions
currentAction++;
// Count the steps in this action
int act = currentAction;
while (actions[act].at != startAction && act < maxAction) { ) //<-- change conditions
act++;
}
return act - currentAction;
}
Diff:
maxAction is not the array capacity, IMHO in this case the conditions can be checked in any order. Also both have similar execution times, so there is no gain in swapping them.