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:40:58 -04:00
parent b05aa8b5b1
commit caaec0198e
1 changed files with 4 additions and 1 deletions

View File

@ -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;
} }