fix o3tl::equalsAsciiL

after I got it wrong in both the original commit
    commit d15a6560bd
    use more string_view
and in the attempted fix
    commit dd41ea3ec1
    fix for o3tl::equalsAscii
thanks to sberg for spotting that

Change-Id: Iff12879de823553b2623db48979e9a720302f2d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150240
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2023-04-11 17:56:56 +02:00
parent f69614d811
commit 4c288a18e7
3 changed files with 3 additions and 10 deletions

View File

@@ -131,7 +131,7 @@ bool ServiceDecl::supportsService( std::u16string_view name ) const
sal_Int32 nIndex = 0;
do {
std::string_view const token( o3tl::getToken(str, 0, cDelim, nIndex ) );
if (o3tl::equalsAsciiL(name, token))
if (o3tl::equalsAscii(name, token))
return true;
}
while (nIndex >= 0);

View File

@@ -57,7 +57,7 @@ css::uno::Environment cppuhelper::detail::getEnvironment(
for (sal_Int32 i = 0; i != -1;) {
std::string_view imp(o3tl::getToken(imps, 0, ';', i));
//TODO: this assumes UNO_ENV_LOG only contains ASCII characters:
if (o3tl::equalsAsciiL(implementation, imp))
if (o3tl::equalsAscii(implementation, imp))
{
n += ":log";
break;

View File

@@ -22,7 +22,7 @@
namespace o3tl
{
// Like OUString::equalsAscii, but for std::u16string_view:
// Like OUString::equalsAscii/OUString::equalsAsciiL, but for std::u16string_view:
inline bool equalsAscii(std::u16string_view s1, std::string_view s2)
{
return s1.size() == s2.size()
@@ -30,13 +30,6 @@ inline bool equalsAscii(std::u16string_view s1, std::string_view s2)
== 0;
}
// Like OUString::equalsAsciiL, but for std::u16string_view:
inline bool equalsAsciiL(std::u16string_view s1, std::string_view s2)
{
return rtl_ustr_ascii_shortenedCompare_WithLength(s1.data(), s1.size(), s2.data(), s2.size())
== 0;
}
// Like OUString::equalsIgnoreAsciiCase, but for two std::u16string_view:
inline bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
{