summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-06-23 15:02:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-06-24 08:43:55 +0200
commita2fc883173d7053cefe543620982051ae40c4b03 (patch)
treedac1b760925c8151dfd8a9cbe3a8735b68ab9f79 /connectivity
parent010713e65ccade7b682c219707c8db3d864145c1 (diff)
use more std::container::insert instead of std::copy
which is both more compact code, and more efficient, since the insert method can do smarter resizing Change-Id: I17f226660f87cdf002edccc29b4af8fd59a25f91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96948 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/commontools/dbtools.cxx7
-rw-r--r--connectivity/source/parse/sqliterator.cxx3
2 files changed, 2 insertions, 8 deletions
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
index 419cd26e7c07..7f2e418601e9 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -1388,12 +1388,7 @@ sal_Int32 getSearchColumnFlag( const Reference< XConnection>& _rxConn,sal_Int32
OUString createUniqueName( const Sequence< OUString >& _rNames, const OUString& _rBaseName, bool _bStartWithNumber )
{
- std::set< OUString > aUsedNames;
- std::copy(
- _rNames.begin(),
- _rNames.end(),
- std::insert_iterator< std::set< OUString > >( aUsedNames, aUsedNames.end() )
- );
+ std::set< OUString > aUsedNames(_rNames.begin(), _rNames.end());
OUString sName( _rBaseName );
sal_Int32 nPos = 1;
diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx
index d8c48c64321a..a91390eca2b8 100644
--- a/connectivity/source/parse/sqliterator.cxx
+++ b/connectivity/source/parse/sqliterator.cxx
@@ -345,8 +345,7 @@ void OSQLParseTreeIterator::impl_getQueryParameterColumns( const OSQLTable& _rQu
} while ( false );
// copy the parameters of the sub query to our own parameter array
- std::copy( pSubQueryParameterColumns->begin(), pSubQueryParameterColumns->end(),
- std::back_inserter( *m_aParameters ) );
+ m_aParameters->insert( m_aParameters->end(), pSubQueryParameterColumns->begin(), pSubQueryParameterColumns->end() );
}