Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 5, 2015, 10:47:51 PM (9 years ago)
Author:
landauf
Message:

use range-based for-loop where it makes sense (e.g. ObjectList)

Location:
code/branches/cpp11_v2/src/libraries/core/command
Files:
3 edited

Legend:

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

    r10918 r10919  
    334334            ArgumentCompletionList threads;
    335335
    336             for (std::list<unsigned int>::const_iterator it = threadnumbers.begin(); it != threadnumbers.end(); ++it)
    337                 threads.emplace_back(multi_cast<std::string>(*it));
     336            for (unsigned int threadnumber : threadnumbers)
     337                threads.emplace_back(multi_cast<std::string>(threadnumber));
    338338
    339339            return threads;
  • code/branches/cpp11_v2/src/libraries/core/command/CommandEvaluation.cc

    r10916 r10919  
    328328
    329329        // iterate through all groups and their commands and calculate the distance to the current command. keep the best.
    330         for (const auto& mapEntry : ConsoleCommandManager::getInstance().getCommandsLC())
    331         {
    332             if (mapEntry.first != "")
    333             {
    334                 for (std::map<std::string, ConsoleCommand*>::const_iterator it_name = mapEntry.second.begin(); it_name != mapEntry.second.end(); ++it_name)
    335                 {
    336                     std::string command = mapEntry.first + " " + it_name->first;
     330        for (const auto& mapEntryGroup : ConsoleCommandManager::getInstance().getCommandsLC())
     331        {
     332            if (mapEntryGroup.first != "")
     333            {
     334                for (const auto& mapEntryName : mapEntryGroup.second)
     335                {
     336                    std::string command = mapEntryGroup.first + " " + mapEntryName.first;
    337337                    unsigned int distance = getLevenshteinDistance(command, token0_LC + " " + token1_LC);
    338338                    if (distance < nearestDistance)
  • code/branches/cpp11_v2/src/libraries/core/command/TclThreadManager.cc

    r10916 r10919  
    145145            {
    146146                boost::shared_lock<boost::shared_mutex> lock(*this->interpreterBundlesMutex_);
    147                 for (std::map<unsigned int, TclInterpreterBundle*>::const_iterator it = this->interpreterBundles_.begin(); it != this->interpreterBundles_.end(); ++it)
     147                for (const auto& mapEntry : this->interpreterBundles_)
    148148                {
    149                     if (it->first == 0)
     149                    if (mapEntry.first == 0)
    150150                        continue; // We'll handle the default interpreter later (and without threads of course)
    151151
    152                     TclInterpreterBundle* bundle = it->second;
     152                    TclInterpreterBundle* bundle = mapEntry.second;
    153153                    if (!bundle->queue_.empty())
    154154                    {
Note: See TracChangeset for help on using the changeset viewer.