diff options
Diffstat (limited to 'xmlhelp/source/cxxhelp/provider/resultsetbase.cxx')
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/resultsetbase.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx b/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx index c399d32c660c..fa9ac9ba6f84 100644 --- a/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx +++ b/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx @@ -370,18 +370,17 @@ public: beans::Property SAL_CALL getPropertyByName( const OUString& aName ) override { - for( int i = 0; i < m_aSeq.getLength(); ++i ) - if( aName == m_aSeq[i].Name ) - return m_aSeq[i]; + auto pProp = std::find_if(m_aSeq.begin(), m_aSeq.end(), + [&aName](const beans::Property& rProp) { return aName == rProp.Name; }); + if (pProp != m_aSeq.end()) + return *pProp; throw beans::UnknownPropertyException(); } sal_Bool SAL_CALL hasPropertyByName( const OUString& Name ) override { - for( int i = 0; i < m_aSeq.getLength(); ++i ) - if( Name == m_aSeq[i].Name ) - return true; - return false; + return std::any_of(m_aSeq.begin(), m_aSeq.end(), + [&Name](const beans::Property& rProp) { return Name == rProp.Name; }); } private: |