Skip to content
Snippets Groups Projects
Commit 3ca97a7f authored by Jan Möbius's avatar Jan Möbius
Browse files

Speedup

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15150 383ad7c9-94d9-4d36-a494-682f7c89f535
parent e4b45d4e
No related branches found
No related tags found
No related merge requests found
......@@ -42,8 +42,6 @@
#include "TreeItem.hh"
/// Acceleration map
static QMap<int,TreeItem*> treeMap_;
//--------------------------------------------------------------------------------
......@@ -191,8 +189,9 @@ TreeItem* TreeItem::next() {
while ( parentPointer ) {
// If there is an unvisited child of the parent, return this one
if ( parentPointer->childCount() > ( thisPointer->row() + 1) ) {
return parentPointer->childItems_[ thisPointer->row() + 1 ];
const int position = (thisPointer->row() + 1);
if ( parentPointer->childCount() > ( position ) ) {
return parentPointer->childItems_[ position ];
}
// Go to the next level
......
......@@ -110,12 +110,15 @@ class TreeItem {
int level();
private:
/// Parent item or 0 if rootnode
/// Parent item or 0 if root node
TreeItem *parentItem_;
/// Children of this node
QList<TreeItem*> childItems_;
/// Acceleration map
static QMap<int,TreeItem*> treeMap_;
public:
//===========================================================================
/** @name Tree : Parent nodes
......@@ -125,7 +128,7 @@ class TreeItem {
/// get the row of this item from the parent
int row() const;
/// Get the parent item ( 0 if rootitem )
/// Get the parent item ( 0 if root item )
TreeItem *parent();
/// Set the parent pointer
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment