Kaydet (Commit) 5929d8ea authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Replace function only used in an assert with a lambda

Change-Id: Id1809b6f14690dff2edbc806a33297fda4373c6f
Reviewed-on: https://gerrit.libreoffice.org/62782
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 4b0db40a
......@@ -761,13 +761,6 @@ static ComponentInfo const aComponentInfos [] =
{ OUStringLiteral("workwindow"), WindowType::WORKWINDOW }
};
#if !defined NDEBUG
bool ComponentInfoCompare( const ComponentInfo & lhs, const ComponentInfo & rhs)
{
return rtl_str_compare_WithLength(lhs.sName.data, lhs.sName.size, rhs.sName.data, rhs.sName.size) < 0;
}
#endif
bool ComponentInfoFindCompare( const ComponentInfo & lhs, const OUString & s)
{
return rtl_ustr_ascii_compareIgnoreAsciiCase_WithLengths(s.pData->buffer, s.pData->length,
......@@ -780,7 +773,12 @@ WindowType ImplGetComponentType( const OUString& rServiceName )
if( !bSorted )
{
assert( std::is_sorted( std::begin(aComponentInfos), std::end(aComponentInfos),
ComponentInfoCompare ) );
[](const ComponentInfo & lhs, const ComponentInfo & rhs) {
return
rtl_str_compare_WithLength(
lhs.sName.data, lhs.sName.size, rhs.sName.data, rhs.sName.size)
< 0;
} ) );
bSorted = true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment