summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/o3tl/string_view.hxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/o3tl/string_view.hxx b/include/o3tl/string_view.hxx
index bdb554babf27..79d6eba702a1 100644
--- a/include/o3tl/string_view.hxx
+++ b/include/o3tl/string_view.hxx
@@ -22,10 +22,12 @@
namespace o3tl
{
-// Like OUString::equalsIgnoreAsciiCase, but for two std::u16string_view:
-inline bool equalsAscii(std::u16string_view s1, const char* s2)
+// Like OUString::equalsAscii, but for std::u16string_view:
+inline bool equalsAscii(std::u16string_view s1, std::string_view s2)
{
- return rtl_ustr_ascii_compare_WithLength(s1.data(), s1.size(), s2) == 0;
+ return s1.size() == s2.size()
+ && rtl_ustr_ascii_shortenedCompare_WithLength(s1.data(), s1.size(), s2.data(), s2.size())
+ == 0;
}
// Like OUString::equalsAsciiL, but for std::u16string_view: