[Libreoffice-commits] core.git: i18npool/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Mon Mar 2 12:51:45 UTC 2020


 i18npool/source/collator/collator_unicode.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit efd267fac274daaf18a095b958d622e2d1468eed
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Mar 2 11:41:46 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Mar 2 13:51:12 2020 +0100

    can pass length to icu compare here
    
    which will skip the need to do strlen()
    
    Change-Id: I0c9663f5f51f158179c4e0725c1901d7256173e0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89817
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/i18npool/source/collator/collator_unicode.cxx b/i18npool/source/collator/collator_unicode.cxx
index e2aee8282541..609ef0f20351 100644
--- a/i18npool/source/collator/collator_unicode.cxx
+++ b/i18npool/source/collator/collator_unicode.cxx
@@ -123,7 +123,8 @@ Collator_Unicode::compareSubstring( const OUString& str1, sal_Int32 off1, sal_In
 sal_Int32 SAL_CALL
 Collator_Unicode::compareString( const OUString& str1, const OUString& str2)
 {
-    return collator->compare(reinterpret_cast<const UChar *>(str1.getStr()), reinterpret_cast<const UChar *>(str2.getStr()));
+    return collator->compare(reinterpret_cast<const UChar *>(str1.getStr()), str1.getLength(),
+                             reinterpret_cast<const UChar *>(str2.getStr()), str2.getLength());
 }
 
 #ifndef DISABLE_DYNLOADING


More information about the Libreoffice-commits mailing list