diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-01-21 16:28:33 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-01-24 08:36:24 +0100 |
commit | 654c5272299057681d295afb76fc984b20868c7c (patch) | |
tree | 3deb7bb0b8b787f90ae5b95b59f41d9debcbc8ba /connectivity | |
parent | b35f6971561bc095965e82f230e0307f6694228b (diff) |
Use ContainerType().swap and avoid local variables
Change-Id: I773555180758a97aff37f9bc27de83c355d71521
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109761
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/commontools/parameters.cxx | 6 | ||||
-rw-r--r-- | connectivity/source/commontools/paramwrapper.cxx | 3 | ||||
-rw-r--r-- | connectivity/source/parse/sqlnode.cxx | 3 |
3 files changed, 4 insertions, 8 deletions
diff --git a/connectivity/source/commontools/parameters.cxx b/connectivity/source/commontools/parameters.cxx index bd114ea19341..3eb116500e81 100644 --- a/connectivity/source/commontools/parameters.cxx +++ b/connectivity/source/commontools/parameters.cxx @@ -99,15 +99,13 @@ namespace dbtools m_pOuterParameters->dispose(); m_pOuterParameters = nullptr; m_nInnerCount = 0; - ParameterInformation aEmptyInfo; - m_aParameterInformation.swap( aEmptyInfo ); + ParameterInformation().swap(m_aParameterInformation); m_aMasterFields.clear(); m_aDetailFields.clear(); m_sIdentifierQuoteString.clear(); m_sSpecialCharacters.clear(); m_xConnectionMetadata.clear(); - std::vector< bool > aEmptyArray; - m_aParametersVisited.swap( aEmptyArray ); + std::vector< bool >().swap(m_aParametersVisited); m_bUpToDate = false; } diff --git a/connectivity/source/commontools/paramwrapper.cxx b/connectivity/source/commontools/paramwrapper.cxx index ffe42419daa6..17cb58cab220 100644 --- a/connectivity/source/commontools/paramwrapper.cxx +++ b/connectivity/source/commontools/paramwrapper.cxx @@ -343,8 +343,7 @@ namespace dbtools::param rxParam->dispose(); } - Parameters aEmpty; - m_aParameters.swap( aEmpty ); + Parameters().swap(m_aParameters); } diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index 77c1306d699d..387cc54d92b2 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -1496,8 +1496,7 @@ OSQLParser::~OSQLParser() // Is only set the first time, so we should delete it only when there are no more instances s_xLocaleData = nullptr; - RuleIDMap aEmpty; - s_aReverseRuleIDLookup.swap( aEmpty ); + RuleIDMap().swap(s_aReverseRuleIDLookup); } m_pParseTree = nullptr; } |