A for loop with just an end condition is better as a while loop.

This commit is contained in:
John Scipione
2012-07-27 20:46:48 -04:00
parent b05aa8b5b1
commit caaec0198e
+4 -1
View File
@@ -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;
}