diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2015-05-18 16:15:12 +0900 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-05-21 10:07:35 +0000 |
commit | 6e01306e2094e0e0ae731aed7162bb3371f274bc (patch) | |
tree | 1fec517394085cb670fd607547a2d94bcde6ffdb /svtools | |
parent | 731169179209566f094d24abd1aa05da256ea7f7 (diff) |
svtools: simplify code by replacing std::find_if with std::any_of
... or std::none_of.
Change-Id: Ib6af7f32d9495eca03e29dcea06ff3925b1cc7b7
Reviewed-on: https://gerrit.libreoffice.org/15839
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/contnr/fileview.cxx | 11 | ||||
-rw-r--r-- | svtools/source/control/inettbc.cxx | 20 |
2 files changed, 8 insertions, 23 deletions
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index ada14a38cf21..66aeece8762b 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -1795,15 +1795,8 @@ void SvtFileView_Impl::FilterFolderContent_Impl( const OUString &rFilter ) bDelete = true; else { - // search for the first filter which matches - ::std::vector< WildCard >::const_iterator pMatchingFilter = - ::std::find_if( - aFilters.begin(), - aFilters.end(), - FilterMatch( sCompareString ) - ); - - bDelete = aFilters.end() == pMatchingFilter; + bDelete = ::std::none_of( aFilters.begin(), aFilters.end(), + FilterMatch( sCompareString ) ); } if( bDelete ) diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx index 6f669b0cc985..997ce064e248 100644 --- a/svtools/source/control/inettbc.cxx +++ b/svtools/source/control/inettbc.cxx @@ -241,14 +241,9 @@ IMPL_LINK_NOARG( SvtMatchContext_Impl, Select_Impl ) { OUString sUpperURL( sURL.toAsciiUpperCase() ); - ::std::vector< WildCard >::const_iterator aMatchingFilter = - ::std::find_if( - pBox->pImp->m_aFilters.begin(), - pBox->pImp->m_aFilters.end(), - FilterMatch( sUpperURL ) - ); - if ( aMatchingFilter == pBox->pImp->m_aFilters.end() ) - + if ( ::std::none_of( pBox->pImp->m_aFilters.begin(), + pBox->pImp->m_aFilters.end(), + FilterMatch( sUpperURL ) ) ) { // this URL is not allowed bValidCompletionsFiltered = true; continue; @@ -988,12 +983,9 @@ void SvtURLBox::UpdatePicklistForSmartProtocol_Impl() OUString aUpperURL( aURL ); aUpperURL = aUpperURL.toAsciiUpperCase(); - bFound - = (::std::find_if( - pImp->m_aFilters.begin(), - pImp->m_aFilters.end(), - FilterMatch( aUpperURL ) ) - != pImp->m_aFilters.end()); + bFound = ::std::any_of(pImp->m_aFilters.begin(), + pImp->m_aFilters.end(), + FilterMatch( aUpperURL ) ); } if ( bFound ) { |