Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2016, 10:29:21 PM (8 years ago)
Author:
landauf
Message:

merged branch cpp11_v3 back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/core/config/ConfigFileSection.cc

    r9559 r11071  
    8080    {
    8181        unsigned int size = 0;
    82         for (std::list<ConfigFileEntry*>::const_iterator it = this->entries_.begin(); it != this->entries_.end(); ++it)
    83             if ((*it)->getName() == name)
    84                 if ((*it)->getIndex() >= size)
    85                     size = (*it)->getIndex() + 1;
     82        for (ConfigFileEntry* entry : this->entries_)
     83            if (entry->getName() == name)
     84                if (entry->getIndex() >= size)
     85                    size = entry->getIndex() + 1;
    8686        return size;
    8787    }
     
    9999
    100100    /**
    101         @brief Returns the entry with given name (or NULL if it doesn't exist).
     101        @brief Returns the entry with given name (or nullptr if it doesn't exist).
    102102
    103103        @param name     The name of the entry
     
    105105    ConfigFileEntry* ConfigFileSection::getEntry(const std::string& name) const
    106106    {
    107         for (std::list<ConfigFileEntry*>::const_iterator it = this->entries_.begin(); it != this->entries_.end(); ++it)
     107        for (ConfigFileEntry* entry : this->entries_)
    108108        {
    109             if ((*it)->getName() == name)
    110                 return *it;
     109            if (entry->getName() == name)
     110                return entry;
    111111        }
    112         return NULL;
     112        return nullptr;
    113113    }
    114114
    115115    /**
    116         @brief Returns the entry of a vector element with given name and index (or NULL if it doesn't exist).
     116        @brief Returns the entry of a vector element with given name and index (or nullptr if it doesn't exist).
    117117
    118118        @param name     The name of the vector
     
    121121    ConfigFileEntry* ConfigFileSection::getEntry(const std::string& name, unsigned int index) const
    122122    {
    123         for (std::list<ConfigFileEntry*>::const_iterator it = this->entries_.begin(); it != this->entries_.end(); ++it)
     123        for (ConfigFileEntry* entry : this->entries_)
    124124        {
    125             if (((*it)->getName() == name) && ((*it)->getIndex() == index))
    126                 return *it;
     125            if ((entry->getName() == name) && (entry->getIndex() == index))
     126                return entry;
    127127        }
    128         return NULL;
     128        return nullptr;
    129129    }
    130130
Note: See TracChangeset for help on using the changeset viewer.