diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-06-09 08:36:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-06-10 13:13:15 +0200 |
commit | f71606c920a3f78294da745cd9ef1eacde010224 (patch) | |
tree | b808351112a9b13fb775f7794d18b0cb8b6e1645 /sot | |
parent | b28de9d32016a904e4ba457a9a6c62098416c729 (diff) |
new loplugin:moveit
look for local variables that can be std::move'd to parameters
off by default, since it doesn't do proper data flow analysis
Change-Id: I3403a0fcffd165bdea6a772528bc53995c5fdb40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135527
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sot')
-rw-r--r-- | sot/source/sdstor/stgdir.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx index d4d629aedd11..ee70d390542e 100644 --- a/sot/source/sdstor/stgdir.cxx +++ b/sot/source/sdstor/stgdir.cxx @@ -709,7 +709,7 @@ StgDirStrm::StgDirStrm( StgIo& r ) static constexpr OUStringLiteral sRootEntry = u"Root Entry"; aRoot.SetName( sRootEntry ); aRoot.SetType( STG_ROOT ); - m_pRoot = new StgDirEntry( aRoot ); + m_pRoot = new StgDirEntry( std::move(aRoot) ); m_pRoot->SetDirty(); } else @@ -890,7 +890,7 @@ StgDirEntry* StgDirStrm::Find( StgDirEntry& rStg, const OUString& rName ) aEntry.Init(); aEntry.SetName( rName ); // Look in the directory attached to the entry - StgDirEntry aTest( aEntry ); + StgDirEntry aTest( std::move(aEntry) ); return static_cast<StgDirEntry*>( rStg.m_pDown->Find( &aTest ) ); } else @@ -921,7 +921,7 @@ StgDirEntry* StgDirStrm::Create( StgDirEntry& rStg, const OUString& rName, StgEn } else { - std::unique_ptr<StgDirEntry> pNewRes(new StgDirEntry( aEntry )); + std::unique_ptr<StgDirEntry> pNewRes(new StgDirEntry( std::move(aEntry) )); if( StgAvlNode::Insert( reinterpret_cast<StgAvlNode**>(&rStg.m_pDown), pNewRes.get() ) ) { pNewRes->m_pUp = &rStg; |