diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-28 15:13:42 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-29 07:17:37 +0100 |
commit | 21de55596c0fdc2be736c6d0369bd9d3783020be (patch) | |
tree | 07d0f0cd54690e54405fe574c572cb2be74a3336 /xmlsecurity | |
parent | da9fb5d6d9ebf9363981c370ce937d8848989fcb (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 'xmlsecurity')
-rw-r--r-- | xmlsecurity/source/framework/saxeventkeeperimpl.cxx | 10 | ||||
-rw-r--r-- | xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx | 6 |
2 files changed, 5 insertions, 11 deletions
diff --git a/xmlsecurity/source/framework/saxeventkeeperimpl.cxx b/xmlsecurity/source/framework/saxeventkeeperimpl.cxx index 21d1ccc4bd2d..5358230f7a46 100644 --- a/xmlsecurity/source/framework/saxeventkeeperimpl.cxx +++ b/xmlsecurity/source/framework/saxeventkeeperimpl.cxx @@ -169,15 +169,11 @@ BufferNode* SAXEventKeeperImpl::addNewElementMarkBuffers() m_pNewBlocker = nullptr; } - if (!m_vNewElementCollectors.empty()) + for( const auto& i : m_vNewElementCollectors ) { - for( const auto& i : m_vNewElementCollectors ) - { - pBufferNode->addElementCollector(i); - } - - m_vNewElementCollectors.clear(); + pBufferNode->addElementCollector(i); } + m_vNewElementCollectors.clear(); } return pBufferNode; diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx index 0da6276551af..847bdc61e4a6 100644 --- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx @@ -126,10 +126,8 @@ SecurityEnvironment_NssImpl::~SecurityEnvironment_NssImpl() { PK11_FreeSlot(slot); } - if( !m_tSymKeyList.empty() ) { - for( auto& symKey : m_tSymKeyList ) - PK11_FreeSymKey( symKey ) ; - } + for( auto& symKey : m_tSymKeyList ) + PK11_FreeSymKey( symKey ) ; } /* XServiceInfo */ |