Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 15, 2009, 1:26:23 AM (15 years ago)
Author:
rgrieder
Message:
  • Using std::vector instead of std::list in register/unregister Iterator/ObjectListIterator. That is approximately 6 times faster because the list has very few elements.
  • Inlined getIdentifier() for sure by exporting the heavy part to another function.
  • Also eliminated the need of isFirstCall() because the "static initialisation chaos" only applies to variables that cannot be evaluated at compile time.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/core/ObjectListBase.cc

    r2171 r2784  
    7575    void ObjectListBase::notifyIterators(OrxonoxClass* object) const
    7676    {
    77         for (std::list<void*>::const_iterator it = this->iterators_.begin(); it != this->iterators_.end(); ++it)
     77        for (std::vector<void*>::const_iterator it = this->iterators_.begin(); it != this->iterators_.end(); ++it)
    7878            ((Iterator<OrxonoxClass>*)(*it))->incrementIfEqual(object);
    79         for (std::list<void*>::const_iterator it = this->objectListIterators_.begin(); it != this->objectListIterators_.end(); ++it)
     79        for (std::vector<void*>::const_iterator it = this->objectListIterators_.begin(); it != this->objectListIterators_.end(); ++it)
    8080            ((ObjectListIterator<OrxonoxClass>*)(*it))->incrementIfEqual(object);
    8181    }
Note: See TracChangeset for help on using the changeset viewer.