summaryrefslogtreecommitdiff
path: root/scripting/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-11-28 15:13:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-11-29 07:17:37 +0100
commit21de55596c0fdc2be736c6d0369bd9d3783020be (patch)
tree07d0f0cd54690e54405fe574c572cb2be74a3336 /scripting/source
parentda9fb5d6d9ebf9363981c370ce937d8848989fcb (diff)
remove unnecessary "if (!empty()" checks before loops
found with git grep -n -A4 'if.*!.*empty' | grep -B3 -P '(\bfor)|(\bwhile)|(\bdo)' Change-Id: I582235b7cf977a0f9fb4099eb306fdb4a07b5334 Reviewed-on: https://gerrit.libreoffice.org/64169 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'scripting/source')
-rw-r--r--scripting/source/provider/BrowseNodeFactoryImpl.cxx21
1 files changed, 9 insertions, 12 deletions
diff --git a/scripting/source/provider/BrowseNodeFactoryImpl.cxx b/scripting/source/provider/BrowseNodeFactoryImpl.cxx
index b27ac817329f..a0ff04cf2e1f 100644
--- a/scripting/source/provider/BrowseNodeFactoryImpl.cxx
+++ b/scripting/source/provider/BrowseNodeFactoryImpl.cxx
@@ -123,23 +123,20 @@ public:
virtual sal_Bool SAL_CALL
hasChildNodes() override
{
- if ( !m_Nodes.empty() )
+ for (Reference<XBrowseNode> & xNode : m_Nodes)
{
- for (Reference<XBrowseNode> & xNode : m_Nodes)
+ try
{
- try
- {
- if ( xNode->hasChildNodes() )
- {
- return true;
- }
- }
- catch ( Exception& )
+ if ( xNode->hasChildNodes() )
{
- // some form of exception getting child nodes so move
- // on to the next one
+ return true;
}
}
+ catch ( Exception& )
+ {
+ // some form of exception getting child nodes so move
+ // on to the next one
+ }
}
return false;