Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 10, 2008, 12:27:30 AM (17 years ago)
Author:
landauf
Message:

std::set instead of std::list for Identifier-lists (parents, children, …) for faster accessing by key ( std::set::find(xyz) )

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core2/src/orxonox/core/ClassTreeMask.cc

    r871 r876  
    327327        {
    328328            // No it's not: Search for classes inheriting from the given class and add the rules for them
    329             for (std::list<const Identifier*>::const_iterator it = subclass->getDirectChildrenBegin(); it != subclass->getDirectChildrenEnd(); ++it)
     329            for (std::set<const Identifier*>::const_iterator it = subclass->getDirectChildrenBegin(); it != subclass->getDirectChildrenEnd(); ++it)
    330330                if ((*it)->isA(this->root_->getClass()))
    331331                    if (overwrite || (!this->nodeExists(*it))) // If we don't want to overwrite, only add nodes that don't already exist
     
    422422    void ClassTreeMask::addSingle(const Identifier* subclass, bool bInclude, bool clean)
    423423    {
    424         for (std::list<const Identifier*>::const_iterator it = subclass->getDirectChildrenBegin(); it != subclass->getDirectChildrenEnd(); ++it)
     424        for (std::set<const Identifier*>::const_iterator it = subclass->getDirectChildrenBegin(); it != subclass->getDirectChildrenEnd(); ++it)
    425425            this->add(*it, this->isIncluded(*it), false, false);
    426426
Note: See TracChangeset for help on using the changeset viewer.