cid#1555646 COPY_INSTEAD_OF_MOVE

Change-Id: I477cb9b74c99b32eb06e054fa38dd3ffa6bb77da
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170447
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Caolán McNamara
2024-07-13 21:11:03 +01:00
parent 2f3d6cf4d8
commit 990490781c

View File

@@ -177,7 +177,6 @@ std::vector< o3tl::enumarray< LockFileComponent, OUString > > ShareControlFile::
return m_aUsersData; return m_aUsersData;
} }
void ShareControlFile::SetUsersDataAndStore( std::unique_lock<std::mutex>& /*rGuard*/, std::vector< LockFileEntry >&& aUsersData ) void ShareControlFile::SetUsersDataAndStore( std::unique_lock<std::mutex>& /*rGuard*/, std::vector< LockFileEntry >&& aUsersData )
{ {
if ( !IsValid() ) if ( !IsValid() )
@@ -205,10 +204,9 @@ void ShareControlFile::SetUsersDataAndStore( std::unique_lock<std::mutex>& /*rGu
OString aStringData( OUStringToOString( aBuffer, RTL_TEXTENCODING_UTF8 ) ); OString aStringData( OUStringToOString( aBuffer, RTL_TEXTENCODING_UTF8 ) );
uno::Sequence< sal_Int8 > aData( reinterpret_cast<sal_Int8 const *>(aStringData.getStr()), aStringData.getLength() ); uno::Sequence< sal_Int8 > aData( reinterpret_cast<sal_Int8 const *>(aStringData.getStr()), aStringData.getLength() );
m_xOutputStream->writeBytes( aData ); m_xOutputStream->writeBytes( aData );
m_aUsersData = aUsersData; m_aUsersData = std::move(aUsersData);
} }
LockFileEntry ShareControlFile::InsertOwnEntry() LockFileEntry ShareControlFile::InsertOwnEntry()
{ {
std::unique_lock aGuard( m_aMutex ); std::unique_lock aGuard( m_aMutex );