- Timestamp:
- Nov 21, 2015, 7:05:53 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/core/config/ConfigFileSection.cc
r10765 r10821 80 80 { 81 81 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 (const auto & elem : this->entries_) 83 if ((elem)->getName() == name) 84 if ((elem)->getIndex() >= size) 85 size = (elem)->getIndex() + 1; 86 86 return size; 87 87 } … … 105 105 ConfigFileEntry* ConfigFileSection::getEntry(const std::string& name) const 106 106 { 107 for ( std::list<ConfigFileEntry*>::const_iterator it = this->entries_.begin(); it != this->entries_.end(); ++it)107 for (const auto & elem : this->entries_) 108 108 { 109 if (( *it)->getName() == name)110 return *it;109 if ((elem)->getName() == name) 110 return elem; 111 111 } 112 112 return nullptr; … … 121 121 ConfigFileEntry* ConfigFileSection::getEntry(const std::string& name, unsigned int index) const 122 122 { 123 for ( std::list<ConfigFileEntry*>::const_iterator it = this->entries_.begin(); it != this->entries_.end(); ++it)123 for (const auto & elem : this->entries_) 124 124 { 125 if ((( *it)->getName() == name) && ((*it)->getIndex() == index))126 return *it;125 if (((elem)->getName() == name) && ((elem)->getIndex() == index)) 126 return elem; 127 127 } 128 128 return nullptr;
Note: See TracChangeset
for help on using the changeset viewer.