diff --git a/binaryurp/source/unmarshal.cxx b/binaryurp/source/unmarshal.cxx index 10eb4e780f3f..0bf97d34fdb5 100644 --- a/binaryurp/source/unmarshal.cxx +++ b/binaryurp/source/unmarshal.cxx @@ -19,6 +19,7 @@ #include +#include #include #include #include @@ -317,13 +318,9 @@ BinaryAny Unmarshal::readValue(css::uno::TypeDescription const & type) { type.makeComplete(); typelib_EnumTypeDescription * etd = reinterpret_cast< typelib_EnumTypeDescription * >(type.get()); - bool bFound = false; - for (sal_Int32 i = 0; i != etd->nEnumValues; ++i) { - if (etd->pEnumValues[i] == v) { - bFound = true; - break; - } - } + bool bFound = std::any_of( + etd->pEnumValues, etd->pEnumValues + etd->nEnumValues, + [v](sal_Int32 nValue) { return nValue == v; }); if (!bFound) { throw css::io::IOException( u"binaryurp::Unmarshal: unknown enum value"_ustr);