diff options
Diffstat (limited to 'xmlhelp')
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/databases.cxx | 26 | ||||
-rw-r--r-- | xmlhelp/source/treeview/tvread.cxx | 8 |
2 files changed, 10 insertions, 24 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index fa94f56a9a68..88cedb7bfefd 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -167,34 +167,20 @@ Databases::~Databases() { // DatabasesTable - DatabasesTable::iterator it = m_aDatabases.begin(); - while( it != m_aDatabases.end() ) - { - delete it->second; - ++it; - } + for (auto& rDatabase : m_aDatabases) + delete rDatabase.second; } { // ModInfoTable - - ModInfoTable::iterator it = m_aModInfo.begin(); - while( it != m_aModInfo.end() ) - { - delete it->second; - ++it; - } + for (auto& rModInfo : m_aModInfo) + delete rModInfo.second; } { // KeywordInfoTable - - KeywordInfoTable::iterator it = m_aKeywordInfo.begin(); - while( it != m_aKeywordInfo.end() ) - { - delete it->second; - ++it; - } + for (auto& rKeywordInfo : m_aKeywordInfo) + delete rKeywordInfo.second; } } diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index 2d98eb7755dd..c8006bee590f 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -503,11 +503,11 @@ TVChildTarget::SearchAndInsert(std::unique_ptr<TVDom> p, TVDom* tvDom) } else { - i = tvDom->children.begin(); - while ((i!=tvDom->children.end()) && (p != nullptr)) + for (auto& child : tvDom->children) { - p = SearchAndInsert(std::move(p), i->get()); - ++i; + p = SearchAndInsert(std::move(p), child.get()); + if (p == nullptr) + break; } return p; } |