summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2018-08-29 00:47:33 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-08-29 11:40:29 +0200
commit085269d25a705b656436feac47149296b4b4b35d (patch)
tree3195c0526652ebd9e125507aa17cd15b2acfb368 /connectivity
parentb0e74b65a86eb965c3e93da2fb77972cc5445f3c (diff)
Replace find_if with proper quantifier algorithms
Change-Id: Icc820a47ac891c358883f9c01224f676c58fdd11 Reviewed-on: https://gerrit.libreoffice.org/59744 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/parse/sqlnode.cxx15
1 files changed, 6 insertions, 9 deletions
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index ada5d32d4275..2b2a687f6e47 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -1690,9 +1690,8 @@ void OSQLParseNode::append(OSQLParseNode* pNewNode)
{
OSL_ENSURE(pNewNode != nullptr, "OSQLParseNode: invalid NewSubTree");
OSL_ENSURE(pNewNode->getParent() == nullptr, "OSQLParseNode: Node is not an orphan");
- OSL_ENSURE(std::find_if(m_aChildren.begin(), m_aChildren.end(),
- [&] (std::unique_ptr<OSQLParseNode> const & r) { return r.get() == pNewNode; })
- == m_aChildren.end(),
+ OSL_ENSURE(std::none_of(m_aChildren.begin(), m_aChildren.end(),
+ [&] (std::unique_ptr<OSQLParseNode> const & r) { return r.get() == pNewNode; }),
"OSQLParseNode::append() Node already element of parent");
// Create connection to getParent
@@ -2394,13 +2393,11 @@ OSQLParseNode* OSQLParseNode::replace(OSQLParseNode* pOldSubNode, OSQLParseNode*
{
OSL_ENSURE(pOldSubNode != nullptr && pNewSubNode != nullptr, "OSQLParseNode: invalid nodes");
OSL_ENSURE(pNewSubNode->getParent() == nullptr, "OSQLParseNode: node already has getParent");
- OSL_ENSURE(std::find_if(m_aChildren.begin(), m_aChildren.end(),
- [&] (std::unique_ptr<OSQLParseNode> const & r) { return r.get() == pOldSubNode; })
- != m_aChildren.end(),
+ OSL_ENSURE(std::any_of(m_aChildren.begin(), m_aChildren.end(),
+ [&] (std::unique_ptr<OSQLParseNode> const & r) { return r.get() == pOldSubNode; }),
"OSQLParseNode::Replace() Node not element of parent");
- OSL_ENSURE(std::find_if(m_aChildren.begin(), m_aChildren.end(),
- [&] (std::unique_ptr<OSQLParseNode> const & r) { return r.get() == pNewSubNode; })
- == m_aChildren.end(),
+ OSL_ENSURE(std::none_of(m_aChildren.begin(), m_aChildren.end(),
+ [&] (std::unique_ptr<OSQLParseNode> const & r) { return r.get() == pNewSubNode; }),
"OSQLParseNode::Replace() Node already element of parent");
pOldSubNode->setParent( nullptr );