diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2018-02-26 21:45:06 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2018-02-27 09:12:59 +0100 |
commit | 573f87f6ea57a248c79f52b1cd4e5f1978112567 (patch) | |
tree | d5425462ab8c9a4a0c2f18e8bf79fe6bef1380ac /configmgr/source/partial.cxx | |
parent | 59363e639b67a8acbd6da240635de47921b2c955 (diff) |
Use for-range loops in comphelper and configmgr
Change-Id: I91033395cb30a4ba9e65adb89712b3c70a39a508
Reviewed-on: https://gerrit.libreoffice.org/50396
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'configmgr/source/partial.cxx')
-rw-r--r-- | configmgr/source/partial.cxx | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/configmgr/source/partial.cxx b/configmgr/source/partial.cxx index cba7147aa8bc..911a2ae62d59 100644 --- a/configmgr/source/partial.cxx +++ b/configmgr/source/partial.cxx @@ -68,13 +68,12 @@ Partial::Partial( // * Inner node, !startInclude: contains in-/excluded sub-trees // * Leaf node, startInclude: an include starts here // * Leaf node, !startInclude: an exclude starts here - for (std::set< OUString >::const_iterator i(includedPaths.begin()); - i != includedPaths.end(); ++i) + for (auto const& includedPath : includedPaths) { sal_Int32 n = 0; for (Node * p = &root_;;) { OUString seg; - bool end = parseSegment(*i, &n, &seg); + bool end = parseSegment(includedPath, &n, &seg); p = &p->children[seg]; if (p->startInclude) { break; @@ -86,13 +85,12 @@ Partial::Partial( } } } - for (std::set< OUString >::const_iterator i(excludedPaths.begin()); - i != excludedPaths.end(); ++i) + for (auto const& excludedPath : excludedPaths) { sal_Int32 n = 0; for (Node * p = &root_;;) { OUString seg; - bool end = parseSegment(*i, &n, &seg); + bool end = parseSegment(excludedPath, &n, &seg); if (end) { p->children[seg].clear(); break; @@ -120,8 +118,9 @@ Partial::Containment Partial::contains(std::vector<OUString> const & path) const // ** If there is no startInclude along its trace: => CONTAINS_SUBNODES Node const * p = &root_; bool bIncludes = false; - for (auto i(path.begin()); i != path.end(); ++i) { - Node::Children::const_iterator j(p->children.find(*i)); + for (auto const& elemPath : path) + { + Node::Children::const_iterator j(p->children.find(elemPath)); if (j == p->children.end()) { return p->startInclude ? CONTAINS_NODE : CONTAINS_NOT; } |