diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-18 11:37:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-18 21:46:13 +0200 |
commit | ed0097845a07b6129f4e56cd28b90ce9b9368cf5 (patch) | |
tree | ebfc7bf30a62f69bafd22ed9d9e45738308e2ec6 /codemaker/source/codemaker/exceptiontree.cxx | |
parent | simplify some SwRect code - use the SwRect Add* variants (diff) | |
download | core-ed0097845a07b6129f4e56cd28b90ce9b9368cf5.tar.gz core-ed0097845a07b6129f4e56cd28b90ce9b9368cf5.zip |
loplugin:flatten in codemaker
Change-Id: I973ecef5df990511a41e422b73ed2314434f2871
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92479
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'codemaker/source/codemaker/exceptiontree.cxx')
-rw-r--r-- | codemaker/source/codemaker/exceptiontree.cxx | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/codemaker/source/codemaker/exceptiontree.cxx b/codemaker/source/codemaker/exceptiontree.cxx index b6c2aeee6f87..148f017b6877 100644 --- a/codemaker/source/codemaker/exceptiontree.cxx +++ b/codemaker/source/codemaker/exceptiontree.cxx @@ -63,27 +63,28 @@ void ExceptionTree::add( getDirectBase()); assert(!n.isEmpty()); } - if (!bRuntimeException) { - ExceptionTreeNode * node = &m_root; - for (std::vector< OString >::reverse_iterator i(list.rbegin()); - !node->present; ++i) + if (bRuntimeException) + return; + + ExceptionTreeNode * node = &m_root; + for (std::vector< OString >::reverse_iterator i(list.rbegin()); + !node->present; ++i) + { + if (i == list.rend()) { + node->setPresent(); + break; + } + for (ExceptionTreeNode::Children::iterator j( + node->children.begin());; + ++j) { - if (i == list.rend()) { - node->setPresent(); + if (j == node->children.end()) { + node = node->add(*i); break; } - for (ExceptionTreeNode::Children::iterator j( - node->children.begin());; - ++j) - { - if (j == node->children.end()) { - node = node->add(*i); - break; - } - if ((*j)->name == *i) { - node = j->get(); - break; - } + if ((*j)->name == *i) { + node = j->get(); + break; } } } |