summaryrefslogtreecommitdiff
path: root/include/rtl
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2022-03-01 10:44:12 +0100
committerLuboš Luňák <l.lunak@collabora.com>2022-03-01 18:00:17 +0100
commitffe7850a1449c43dd077c5cb073d8eee178f7099 (patch)
tree0b68713d8aa234e861afc8172e392b41ee126248 /include/rtl
parentee2a192923bf709d05c174848e7054cd411b205a (diff)
fix o3tl::equalsIgnoreAsciiCase()
As the OUString equivalent shows, it needs to check == 0. Commit 33ecd0d5c4fff9511a8436513936a3f7044a775a for some reason also dropped the cheap checks (even from OUString) that OString has, so add them. Change-Id: I88e68b5ae10fd76c3c08b9b36d5abed0fad17bbf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130753 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'include/rtl')
-rw-r--r--include/rtl/ustring.hxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx
index cad257caeb58..4d983a089f72 100644
--- a/include/rtl/ustring.hxx
+++ b/include/rtl/ustring.hxx
@@ -977,6 +977,10 @@ public:
*/
#if defined LIBO_INTERNAL_ONLY
bool equalsIgnoreAsciiCase(std::u16string_view sv) const {
+ if ( sal_uInt32(pData->length) != sv.size() )
+ return false;
+ if ( pData->buffer == sv.data() )
+ return true;
return
rtl_ustr_compareIgnoreAsciiCase_WithLength(
pData->buffer, pData->length, sv.data(), sv.size())