From caaec0198e99172abb5b06af3bfb229712e687da Mon Sep 17 00:00:00 2001 From: John Scipione Date: Fri, 27 Jul 2012 20:40:58 -0400 Subject: [PATCH] A for loop with just an end condition is better as a while loop. --- src/kits/tracker/Navigator.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/kits/tracker/Navigator.cpp b/src/kits/tracker/Navigator.cpp index 81d8e01c09..844b233f5b 100644 --- a/src/kits/tracker/Navigator.cpp +++ b/src/kits/tracker/Navigator.cpp @@ -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; }