diff options
author | Noel Grandin <noel@peralex.com> | 2016-04-12 16:39:03 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-04-18 07:37:31 +0000 |
commit | 789055bc2acb4c71483fd60ea258d158bd5aec10 (patch) | |
tree | 7849de841a71f667a30b2a971ad0c3d406110396 /xmlhelp | |
parent | 150ac9cf05ed9da6a2af5bc3f820280fd853e519 (diff) |
clang-tidy performance-unnecessary-copy-initialization
probably not much performance benefit, but it sure is good at
identifying leftover intermediate variables from previous
refactorings.
Change-Id: I3ce16fe496ac2733c1cb0a35f74c0fc9193cc657
Reviewed-on: https://gerrit.libreoffice.org/24026
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'xmlhelp')
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/databases.cxx | 7 | ||||
-rw-r--r-- | xmlhelp/source/treeview/tvread.cxx | 36 |
2 files changed, 19 insertions, 24 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 8c7fae0a0eba..53e5cb3a3c50 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -1819,17 +1819,16 @@ OUString IndexFolderIterator::implGetIndexFolderFromPackage( bool& o_rbTemporary ::osl::FileBase::RC eErr = ::osl::File::createTempFile( nullptr, nullptr, &aTempFileURL ); if( eErr == ::osl::FileBase::E_None ) { - OUString aTempDirURL = aTempFileURL; try { - m_xSFA->kill( aTempDirURL ); + m_xSFA->kill( aTempFileURL ); } catch (const Exception &) { } - m_xSFA->createFolder( aTempDirURL ); + m_xSFA->createFolder( aTempFileURL ); - aZipDir = aTempDirURL; + aZipDir = aTempFileURL; o_rbTemporary = true; } } diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index 3dffd29d251d..53b56c71d358 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -312,13 +312,12 @@ TVRead::getByHierarchicalName( const OUString& aName ) RuntimeException, std::exception ) { sal_Int32 idx; - OUString name( aName ); - if( ( idx = name.indexOf( '/' ) ) != -1 && - name.copy( 0,idx ) == "Children" ) - return Children->getByHierarchicalName( name.copy( 1 + idx ) ); + if( ( idx = aName.indexOf( '/' ) ) != -1 && + aName.copy( 0,idx ) == "Children" ) + return Children->getByHierarchicalName( aName.copy( 1 + idx ) ); - return getByName( name ); + return getByName( aName ); } sal_Bool SAL_CALL @@ -326,13 +325,12 @@ TVRead::hasByHierarchicalName( const OUString& aName ) throw( RuntimeException, std::exception ) { sal_Int32 idx; - OUString name( aName ); - if( ( idx = name.indexOf( '/' ) ) != -1 && - name.copy( 0,idx ) == "Children" ) - return Children->hasByHierarchicalName( name.copy( 1 + idx ) ); + if( ( idx = aName.indexOf( '/' ) ) != -1 && + aName.copy( 0,idx ) == "Children" ) + return Children->hasByHierarchicalName( aName.copy( 1 + idx ) ); - return hasByName( name ); + return hasByName( aName ); } /**************************************************************************/ @@ -573,20 +571,19 @@ TVChildTarget::getByHierarchicalName( const OUString& aName ) RuntimeException, std::exception ) { sal_Int32 idx; - OUString name( aName ); - if( ( idx = name.indexOf( '/' ) ) != -1 ) + if( ( idx = aName.indexOf( '/' ) ) != -1 ) { - OUString num( name.getStr()+2,idx-4 ); + OUString num( aName.getStr()+2,idx-4 ); sal_Int32 pref = num.toInt32() - 1; if( pref < 0 || Elements.size() <= sal_uInt32( pref ) ) throw NoSuchElementException(); - return Elements[pref]->getByHierarchicalName( name.copy( 1 + idx ) ); + return Elements[pref]->getByHierarchicalName( aName.copy( 1 + idx ) ); } else - return getByName( name ); + return getByName( aName ); } sal_Bool SAL_CALL @@ -594,19 +591,18 @@ TVChildTarget::hasByHierarchicalName( const OUString& aName ) throw( RuntimeException, std::exception ) { sal_Int32 idx; - OUString name( aName ); - if( ( idx = name.indexOf( '/' ) ) != -1 ) + if( ( idx = aName.indexOf( '/' ) ) != -1 ) { - OUString num( name.getStr()+2,idx-4 ); + OUString num( aName.getStr()+2,idx-4 ); sal_Int32 pref = num.toInt32() - 1; if( pref < 0 || Elements.size() <= sal_uInt32( pref ) ) return false; - return Elements[pref]->hasByHierarchicalName( name.copy( 1 + idx ) ); + return Elements[pref]->hasByHierarchicalName( aName.copy( 1 + idx ) ); } else - return hasByName( name ); + return hasByName( aName ); } ConfigData TVChildTarget::init( const Reference< XComponentContext >& xContext ) |