From aaa083c0a1f1c47271aef8b11456e1e924cfa519 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 14 Jan 2011 01:51:58 +0200 Subject: Small optimisation in itemcontainer. --- src/gui/widgets/itemcontainer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index d25e4baa1..f4e2792ef 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -468,13 +468,13 @@ void ItemContainer::updateMatrix() break; } - for (unsigned idx = 0; idx < sortedItems.size(); idx ++) + std::vector::iterator iter; + for (iter = sortedItems.begin(); iter != sortedItems.end(); ++iter) { - int itemIndex = idx; if (j >= mGridRows) break; - mShowMatrix[j * mGridColumns + i] = sortedItems[itemIndex]->mId; + mShowMatrix[j * mGridColumns + i] = (*iter)->mId; i ++; if (i >= mGridColumns) -- cgit v1.2.3-70-g09d2