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/command/ArgumentCompletionFunctions.cc

    r10821 r10916  
    7777            bool groupIsVisible(const std::map<std::string, ConsoleCommand*>& group, bool bOnlyShowHidden)
    7878            {
    79                 for (const auto & elem : group)
    80                     if (elem.second->isActive() && elem.second->hasAccess() && (!elem.second->isHidden())^bOnlyShowHidden)
     79                for (const auto& mapEntry : group)
     80                    if (mapEntry.second->isActive() && mapEntry.second->hasAccess() && (!mapEntry.second->isHidden())^bOnlyShowHidden)
    8181                        return true;
    8282
     
    100100                // get all the groups that are visible (except the shortcut group "")
    101101                const std::map<std::string, std::map<std::string, ConsoleCommand*>>& commands = ConsoleCommandManager::getInstance().getCommands();
    102                 for (const auto & command : commands)
    103                     if (groupIsVisible(command.second, bOnlyShowHidden) && command.first != "" && (fragmentLC == "" || getLowercase(command.first).find(fragmentLC) == 0))
    104                         groupList.push_back(ArgumentCompletionListElement(command.first, getLowercase(command.first)));
     102                for (const auto& mapEntry : commands)
     103                    if (groupIsVisible(mapEntry.second, bOnlyShowHidden) && mapEntry.first != "" && (fragmentLC == "" || getLowercase(mapEntry.first).find(fragmentLC) == 0))
     104                        groupList.push_back(ArgumentCompletionListElement(mapEntry.first, getLowercase(mapEntry.first)));
    105105
    106106                // now add all shortcuts (in group "")
     
    113113
    114114                    // add the shortcuts
    115                     for (const auto & elem : it_group->second)
    116                         if (elem.second->isActive() && elem.second->hasAccess() && (!elem.second->isHidden())^bOnlyShowHidden && (fragmentLC == "" || getLowercase(elem.first).find(fragmentLC) == 0))
    117                             groupList.push_back(ArgumentCompletionListElement(elem.first, getLowercase(elem.first)));
     115                    for (const auto& mapEntry : it_group->second)
     116                        if (mapEntry.second->isActive() && mapEntry.second->hasAccess() && (!mapEntry.second->isHidden())^bOnlyShowHidden && (fragmentLC == "" || getLowercase(mapEntry.first).find(fragmentLC) == 0))
     117                            groupList.push_back(ArgumentCompletionListElement(mapEntry.first, getLowercase(mapEntry.first)));
    118118                }
    119119
     
    146146                if (it_group != ConsoleCommandManager::getInstance().getCommands().end())
    147147                {
    148                     for (const auto & elem : it_group->second)
    149                         if (elem.second->isActive() && elem.second->hasAccess() && (!elem.second->isHidden())^bOnlyShowHidden)
    150                             commandList.push_back(ArgumentCompletionListElement(elem.first, getLowercase(elem.first)));
     148                    for (const auto& mapEntry : it_group->second)
     149                        if (mapEntry.second->isActive() && mapEntry.second->hasAccess() && (!mapEntry.second->isHidden())^bOnlyShowHidden)
     150                            commandList.push_back(ArgumentCompletionListElement(mapEntry.first, getLowercase(mapEntry.first)));
    151151                }
    152152
     
    281281
    282282            const std::set<std::string>& names = SettingsConfigFile::getInstance().getSectionNames();
    283             for (const auto & name : names)
     283            for (const std::string& name : names)
    284284                sectionList.push_back(ArgumentCompletionListElement(name, getLowercase(name)));
    285285
Note: See TracChangeset for help on using the changeset viewer.