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:
|
case kActionBackward:
|
||||||
fForwHistory.AddItem(fBackHistory.RemoveItemAt(fBackHistory.CountItems()-1));
|
fForwHistory.AddItem(fBackHistory.RemoveItemAt(fBackHistory.CountItems()-1));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kActionForward:
|
case kActionForward:
|
||||||
fBackHistory.AddItem(fForwHistory.RemoveItemAt(fForwHistory.CountItems()-1));
|
fBackHistory.AddItem(fForwHistory.RemoveItemAt(fForwHistory.CountItems()-1));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kActionUpdatePath:
|
case kActionUpdatePath:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fForwHistory.MakeEmpty();
|
fForwHistory.MakeEmpty();
|
||||||
fBackHistory.AddItem(new BPath(fPath));
|
fBackHistory.AddItem(new BPath(fPath));
|
||||||
|
|
||||||
for (; fBackHistory.CountItems() > kMaxHistory;)
|
while (fBackHistory.CountItems() > kMaxHistory)
|
||||||
fBackHistory.RemoveItem(fBackHistory.FirstItem(), true);
|
fBackHistory.RemoveItem(fBackHistory.FirstItem(), true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue