diff options
Diffstat (limited to 'cppuhelper')
-rw-r--r-- | cppuhelper/source/supportsservice.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/cppuhelper/source/supportsservice.cxx b/cppuhelper/source/supportsservice.cxx index 629981310354..eea82602a2ef 100644 --- a/cppuhelper/source/supportsservice.cxx +++ b/cppuhelper/source/supportsservice.cxx @@ -9,6 +9,7 @@ #include <sal/config.h> +#include <algorithm> #include <cassert> #include <com/sun/star/lang/XServiceInfo.hpp> @@ -21,14 +22,9 @@ bool cppu::supportsService( css::lang::XServiceInfo * implementation, OUString const & name) { assert(implementation != nullptr); - css::uno::Sequence< OUString > s( + const css::uno::Sequence< OUString > s( implementation->getSupportedServiceNames()); - for (sal_Int32 i = 0; i != s.getLength(); ++i) { - if (s[i] == name) { - return true; - } - } - return false; + return std::find(s.begin(), s.end(), name) != s.end(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |