From 992a33313046f4a4d322db9464c474e7429a019a Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 6 Apr 2017 10:47:24 +0200 Subject: clang-tidy: readability-else-after-return run it against sal,cppu,cppuhelper I had to run this multiple times to catch all the cases in each module, and it requires some hand-tweaking of the resulting output - clang-tidy is not very good about cleaning up trailing spaces, and aligning things nicely. Change-Id: I00336345f5f036e12422b98d66526509380c497a Reviewed-on: https://gerrit.libreoffice.org/36194 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- cppuhelper/source/propshlp.cxx | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'cppuhelper/source/propshlp.cxx') diff --git a/cppuhelper/source/propshlp.cxx b/cppuhelper/source/propshlp.cxx index 5533e9857477..8cc395a847f9 100644 --- a/cppuhelper/source/propshlp.cxx +++ b/cppuhelper/source/propshlp.cxx @@ -220,8 +220,7 @@ Any OPropertySetHelper2::queryInterface( const css::uno::Type & rType ) Any cnd(cppu::queryInterface(rType, static_cast< XPropertySetOption * >(this))); if ( cnd.hasValue() ) return cnd; - else - return OPropertySetHelper::queryInterface(rType); + return OPropertySetHelper::queryInterface(rType); } /** @@ -1054,19 +1053,16 @@ sal_Bool OPropertyArrayHelper::fillPropertyMembersByHandle *pAttributes = pProperties[ nHandle ].Attributes; return true; } - else + // normally the array is sorted + for( sal_Int32 i = 0; i < nElements; i++ ) { - // normally the array is sorted - for( sal_Int32 i = 0; i < nElements; i++ ) + if( pProperties[i].Handle == nHandle ) { - if( pProperties[i].Handle == nHandle ) - { - if( pPropName ) - *pPropName = pProperties[ i ].Name; - if( pAttributes ) - *pAttributes = pProperties[ i ].Attributes; - return true; - } + if( pPropName ) + *pPropName = pProperties[ i ].Name; + if( pAttributes ) + *pAttributes = pProperties[ i ].Attributes; + return true; } } return false; -- cgit