summaryrefslogtreecommitdiff
path: root/svl/source/misc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-10-10 16:57:19 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-10-10 18:24:35 +0200
commitd035f86de21f9508bc5ea0f35071873c0fd4c8c8 (patch)
tree0122043c3786535aca120980a3b7d192ffa5a63a /svl/source/misc
parent0ff2a432f776d878fc17af5442f14844a9970bf7 (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/source/misc')
-rw-r--r--svl/source/misc/sharecontrolfile.cxx9
1 files changed, 5 insertions, 4 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();