From 5d6f247bb30ca8cd6b6a1170402db7d1c7300528 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Sun, 14 Apr 2013 02:02:31 -0400 Subject: [PATCH] Reverse loop to eliminate checking count each iteration --- src/apps/deskbar/BarApp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/deskbar/BarApp.cpp b/src/apps/deskbar/BarApp.cpp index 599f1f2cbc..75b60b6f8b 100644 --- a/src/apps/deskbar/BarApp.cpp +++ b/src/apps/deskbar/BarApp.cpp @@ -840,7 +840,7 @@ TBarApp::RemoveTeam(team_id team) void TBarApp::ResizeTeamIcons() { - for (int32 i = 0; i < sBarTeamInfoList.CountItems(); i++) { + for (int32 i = sBarTeamInfoList.CountItems() - 1; i >= 0; i--) { BarTeamInfo* barInfo = (BarTeamInfo*)sBarTeamInfoList.ItemAt(i); if ((barInfo->flags & B_BACKGROUND_APP) == 0 && strcasecmp(barInfo->sig, kDeskbarSignature) != 0) {