Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 21, 2015, 7:05:53 PM (8 years ago)
Author:
muemart
Message:

Run clang-modernize -loop-convert

  • Again, not all possible loops were converted
  • It can do pretty cool transformations, but I had to fix a few compile errors, so there might be some runtime errors lurking around too
File:
1 edited

Legend:

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

    r8858 r10821  
    103103                bool bFoundMatchingNamespace = false;
    104104
    105                 for (std::map<std::string, NamespaceNode*>::iterator it = this->subnodes_.begin(); it != this->subnodes_.end(); ++it)
     105                for (auto & elem : this->subnodes_)
    106106                {
    107                     if (it->first.find(firstPart) == (it->first.size() - firstPart.size()))
     107                    if (elem.first.find(firstPart) == (elem.first.size() - firstPart.size()))
    108108                    {
    109                         std::set<NamespaceNode*> temp2 = it->second->getNodeRelative(secondPart);
     109                        std::set<NamespaceNode*> temp2 = elem.second->getNodeRelative(secondPart);
    110110                        nodes.insert(temp2.begin(), temp2.end());
    111111                        bFoundMatchingNamespace = true;
     
    132132        else
    133133        {
    134             for (std::map<std::string, NamespaceNode*>::const_iterator it = this->subnodes_.begin(); it != this->subnodes_.end(); ++it)
    135                 if (it->second->includes(ns))
     134            for (const auto & elem : this->subnodes_)
     135                if (elem.second->includes(ns))
    136136                    return true;
    137137        }
     
    167167        std::string output = (indentation + this->name_ + '\n');
    168168
    169         for (std::map<std::string, NamespaceNode*>::const_iterator it = this->subnodes_.begin(); it != this->subnodes_.end(); ++it)
    170             output += it->second->toString(indentation + "  ");
     169        for (const auto & elem : this->subnodes_)
     170            output += elem.second->toString(indentation + "  ");
    171171
    172172        return output;
Note: See TracChangeset for help on using the changeset viewer.