diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-10 16:57:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-10 18:24:35 +0200 |
commit | d035f86de21f9508bc5ea0f35071873c0fd4c8c8 (patch) | |
tree | 0122043c3786535aca120980a3b7d192ffa5a63a /svl | |
parent | 0ff2a432f776d878fc17af5442f14844a9970bf7 (diff) |
loplugin:moveparam in svl
Change-Id: Icd45c7f693c866e7eafcf6aeb052a4d190dce38c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123337
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/misc/sharecontrolfile.cxx | 9 | ||||
-rw-r--r-- | svl/source/passwordcontainer/passwordcontainer.cxx | 2 | ||||
-rw-r--r-- | svl/source/passwordcontainer/passwordcontainer.hxx | 10 |
3 files changed, 11 insertions, 10 deletions
diff --git a/svl/source/misc/sharecontrolfile.cxx b/svl/source/misc/sharecontrolfile.cxx index 0ddc3efddd25..a7bdf7af85f6 100644 --- a/svl/source/misc/sharecontrolfile.cxx +++ b/svl/source/misc/sharecontrolfile.cxx @@ -174,7 +174,7 @@ std::vector< o3tl::enumarray< LockFileComponent, OUString > > ShareControlFile:: } -void ShareControlFile::SetUsersDataAndStore( const std::vector< LockFileEntry >& aUsersData ) +void ShareControlFile::SetUsersDataAndStore( std::vector< LockFileEntry >&& aUsersData ) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -243,7 +243,7 @@ LockFileEntry ShareControlFile::InsertOwnEntry() if ( !bExists ) aNewData.push_back( aNewEntry ); - SetUsersDataAndStore( aNewData ); + SetUsersDataAndStore( std::move(aNewData) ); return aNewEntry; } @@ -301,9 +301,10 @@ void ShareControlFile::RemoveEntry( const LockFileEntry& aEntry ) } } - SetUsersDataAndStore( aNewData ); + const bool bNewDataEmpty = aNewData.empty(); + SetUsersDataAndStore( std::move(aNewData) ); - if ( aNewData.empty() ) + if ( bNewDataEmpty ) { // try to remove the file if it is empty RemoveFile(); diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index 749f4c226a60..cbe36add1bb2 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -607,7 +607,7 @@ void PasswordContainer::PrivateAdd( const OUString& Url, const OUString& UserNam if( Mode == PERSISTENT_RECORD ) aRecord.SetPersistentPasswords( EncodePasswords( aStorePass, GetMasterPassword( aHandler ) ) ); else if( Mode == MEMORY_RECORD ) - aRecord.SetMemoryPasswords( aStorePass ); + aRecord.SetMemoryPasswords( std::move(aStorePass) ); else { OSL_FAIL( "Unexpected persistence status!" ); diff --git a/svl/source/passwordcontainer/passwordcontainer.hxx b/svl/source/passwordcontainer/passwordcontainer.hxx index 2687298ea23c..8bafeaa2d6fc 100644 --- a/svl/source/passwordcontainer/passwordcontainer.hxx +++ b/svl/source/passwordcontainer/passwordcontainer.hxx @@ -54,7 +54,7 @@ class NamePasswordRecord bool m_bHasPersistentPassword; OUString m_aPersistentPassword; - void InitArrays( bool bHasMemoryList, const ::std::vector< OUString >& aMemoryList, + void InitArrays( bool bHasMemoryList, ::std::vector< OUString >&& aMemoryList, bool bHasPersistentList, const OUString& aPersistentList ) { m_bHasMemoryPasswords = bHasMemoryList; @@ -88,7 +88,7 @@ public: , m_bHasMemoryPasswords( false ) , m_bHasPersistentPassword( false ) { - InitArrays( aRecord.m_bHasMemoryPasswords, aRecord.m_aMemoryPasswords, aRecord.m_bHasPersistentPassword, aRecord.m_aPersistentPassword ); + InitArrays( aRecord.m_bHasMemoryPasswords, std::vector(aRecord.m_aMemoryPasswords), aRecord.m_bHasPersistentPassword, aRecord.m_aPersistentPassword ); } NamePasswordRecord& operator=( const NamePasswordRecord& aRecord ) @@ -99,7 +99,7 @@ public: m_aMemoryPasswords.clear(); m_aPersistentPassword.clear(); - InitArrays( aRecord.m_bHasMemoryPasswords, aRecord.m_aMemoryPasswords, aRecord.m_bHasPersistentPassword, aRecord.m_aPersistentPassword ); + InitArrays( aRecord.m_bHasMemoryPasswords, std::vector(aRecord.m_aMemoryPasswords), aRecord.m_bHasPersistentPassword, aRecord.m_aPersistentPassword ); } return *this; } @@ -135,9 +135,9 @@ public: return OUString(); } - void SetMemoryPasswords( const ::std::vector< OUString >& aMemList ) + void SetMemoryPasswords( ::std::vector< OUString >&& aMemList ) { - m_aMemoryPasswords = aMemList; + m_aMemoryPasswords = std::move(aMemList); m_bHasMemoryPasswords = true; } |