Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 2, 2015, 11:22:03 PM (9 years ago)
Author:
landauf
Message:

use actual types instead of 'auto'. only exception is for complicated template types, e.g. when iterating over a map

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/libraries/core/ClassTreeMask.cc

    r10821 r10916  
    293293        {
    294294            // No it's not: Search for classes inheriting from the given class and add the rules for them
    295             for (const auto & elem : subclass->getDirectChildren())
    296                 if ((elem)->isA(this->root_->getClass()))
    297                     if (overwrite || (!this->nodeExists(elem))) // If we don't want to overwrite, only add nodes that don't already exist
    298                         this->add(this->root_, elem, bInclude, overwrite);
     295            for (const Identifier* directChild : subclass->getDirectChildren())
     296                if (directChild->isA(this->root_->getClass()))
     297                    if (overwrite || (!this->nodeExists(directChild))) // If we don't want to overwrite, only add nodes that don't already exist
     298                        this->add(this->root_, directChild, bInclude, overwrite);
    299299        }
    300300
     
    325325        {
    326326            // Search for an already existing node, containing the subclass we want to add
    327             for (auto & elem : node->subnodes_)
     327            for (ClassTreeMaskNode* subnode : node->subnodes_)
    328328            {
    329                 if (subclass->isA((elem)->getClass()))
     329                if (subclass->isA(subnode->getClass()))
    330330                {
    331331                    // We've found an existing node -> delegate the work with a recursive function-call and return
    332                     this->add(elem, subclass, bInclude, overwrite);
     332                    this->add(subnode, subclass, bInclude, overwrite);
    333333                    return;
    334334                }
     
    392392        if (!subclass)
    393393            return;
    394         for (const auto & elem : subclass->getDirectChildren())
    395             this->add(elem, this->isIncluded(elem), false, false);
     394        for (const Identifier* directChild : subclass->getDirectChildren())
     395            this->add(directChild, this->isIncluded(directChild), false, false);
    396396
    397397        this->add(subclass, bInclude, false, clean);
     
    435435
    436436            // Go through the list of subnodes and look for a node containing the searched subclass and delegate the request by a recursive function-call.
    437             for (auto & elem : node->subnodes_)
    438                 if (subclass->isA((elem)->getClass()))
    439                     return isIncluded(elem, subclass);
     437            for (ClassTreeMaskNode* subnode : node->subnodes_)
     438                if (subclass->isA(subnode->getClass()))
     439                    return isIncluded(subnode, subclass);
    440440
    441441            // There is no subnode containing our class -> the rule of the current node takes in effect
     
    957957            // The bool is "false", meaning they have no subnodes and therefore need no further checks
    958958            if (node->isIncluded())
    959                 for (const auto & elem : directChildren)
    960                     this->subclasses_.insert(this->subclasses_.end(), std::pair<const Identifier*, bool>(elem, false));
     959                for (const Identifier* directChild : directChildren)
     960                    this->subclasses_.insert(this->subclasses_.end(), std::pair<const Identifier*, bool>(directChild, false));
    961961        }
    962962    }
Note: See TracChangeset for help on using the changeset viewer.