Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3653 in orxonox.OLD for orxonox/trunk/src/lib/util/list.h


Ignore:
Timestamp:
Mar 25, 2005, 6:14:40 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: now using iterator in world instead of old construct. on my pc, there is now a speedup of about 1 fps! (instead of 1fps i ve now 2fps :)) )

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/util/list.h

    r3652 r3653  
    7070
    7171template<class T>
    72 tIterator<T>::tIterator (listElement<T>* startElement)
     72inline tIterator<T>::tIterator (listElement<T>* startElement)
    7373{
    7474  this->currentEl = startElement;
     
    9292      return NULL;
    9393    }
     94  if( this->currentEl == this->firstEl)
     95    {
     96      this->currentEl = this->currentEl->next;
     97      return this->firstEl->curr;
     98    }
    9499  if( this->currentEl->next == NULL)
    95100    return NULL;
    96   return this->currentEl->next->curr;
     101  this->currentEl = this->currentEl->next;
     102  return this->currentEl->curr;
    97103}
    98104
     
    247253
    248254template<class T>
    249 tIterator<T>* tList<T>::getIterator()
     255inline tIterator<T>* tList<T>::getIterator()
    250256{
    251257  if( this->size == 0) return NULL;
Note: See TracChangeset for help on using the changeset viewer.