A for loop with just an end condition is better as a while loop.
This commit is contained in:
parent
b05aa8b5b1
commit
caaec0198e
|
@ -366,16 +366,19 @@ BNavigator::UpdateLocation(const Model* newmodel, int32 action)
|
|||
case kActionBackward:
|
||||
fForwHistory.AddItem(fBackHistory.RemoveItemAt(fBackHistory.CountItems()-1));
|
||||
break;
|
||||
|
||||
case kActionForward:
|
||||
fBackHistory.AddItem(fForwHistory.RemoveItemAt(fForwHistory.CountItems()-1));
|
||||
break;
|
||||
|
||||
case kActionUpdatePath:
|
||||
break;
|
||||
|
||||
default:
|
||||
fForwHistory.MakeEmpty();
|
||||
fBackHistory.AddItem(new BPath(fPath));
|
||||
|
||||
for (; fBackHistory.CountItems() > kMaxHistory;)
|
||||
while (fBackHistory.CountItems() > kMaxHistory)
|
||||
fBackHistory.RemoveItem(fBackHistory.FirstItem(), true);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue