diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-12 09:56:59 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-12 13:12:11 +0200 |
commit | d968425f009598bca3d10964c64f093b8d785c86 (patch) | |
tree | d2243b3dce0159044e5c112dac5fc54b702efe51 /vbahelper | |
parent | d19299f579e820c34b38ee56b26125dc30f96ada (diff) |
loplugin:moveparam check for collection params
Empirically, when we are passing a collection type to a constructor,
80% of the time, we are passing a local temporary that can be moved
instead of being copied.
Change-Id: I5acc9d761c920691934a4be806a3d3ab6cdbab96
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123056
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vbahelper')
-rw-r--r-- | vbahelper/source/vbahelper/vbadocumentsbase.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/vbahelper/source/vbahelper/vbadocumentsbase.cxx b/vbahelper/source/vbahelper/vbadocumentsbase.cxx index b7b8124c2f0a..65ef6b6019e4 100644 --- a/vbahelper/source/vbahelper/vbadocumentsbase.cxx +++ b/vbahelper/source/vbahelper/vbadocumentsbase.cxx @@ -60,7 +60,7 @@ class DocumentsEnumImpl : public ::cppu::WeakImplHelper< container::XEnumeration public: /// @throws uno::RuntimeException - DocumentsEnumImpl( const uno::Reference< uno::XComponentContext >& xContext, const Documents& docs ) : m_xContext( xContext ), m_documents( docs ) + DocumentsEnumImpl( const uno::Reference< uno::XComponentContext >& xContext, Documents&& docs ) : m_xContext( xContext ), m_documents( std::move(docs) ) { m_it = m_documents.begin(); } @@ -138,7 +138,7 @@ public: //XEnumerationAccess virtual uno::Reference< container::XEnumeration > SAL_CALL createEnumeration( ) override { - return new DocumentsEnumImpl( m_xContext, m_documents ); + return new DocumentsEnumImpl( m_xContext, std::vector(m_documents) ); } // XIndexAccess virtual ::sal_Int32 SAL_CALL getCount( ) override |