i18npool/source/search/textsearch.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 4ac48ae4b02b8e0e3ae7e4833893f9ad40d4d14d
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Fri Feb 28 14:20:24 2020 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Fri Feb 28 21:43:48 2020 +0100

    Use icu::UnicodeString's readonly-aliasing char16_t* constructor
    
    Then it stores a pointer to the passed const UTF-16 string, so
    avoids extra overhead (both memory and CPU) to copy the data
    
    Change-Id: I561998d5534f76ae450577ce6fcbd9c08207f2fe
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89698
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/i18npool/source/search/textsearch.cxx 
b/i18npool/source/search/textsearch.cxx
index 0efa67bcf33a..da4d9cada678 100644
--- a/i18npool/source/search/textsearch.cxx
+++ b/i18npool/source/search/textsearch.cxx
@@ -930,7 +930,7 @@ SearchResult TextSearch::RESrchFrwrd( const OUString& 
searchStr,
 
     // use the ICU RegexMatcher to find the matches
     UErrorCode nIcuErr = U_ZERO_ERROR;
-    const IcuUniString aSearchTargetStr(reinterpret_cast<const 
UChar*>(searchStr.getStr()),
+    const IcuUniString aSearchTargetStr(false, reinterpret_cast<const 
UChar*>(searchStr.getStr()),
                                         searchStr.getLength());
     pRegexMatcher->reset( aSearchTargetStr);
     // search until there is a valid match
@@ -985,7 +985,7 @@ SearchResult TextSearch::RESrchBkwrd( const OUString& 
searchStr,
     // TODO: use ICU's backward searching once it becomes available
     //       as its replacement using forward search is not as good as the 
real thing
     UErrorCode nIcuErr = U_ZERO_ERROR;
-    const IcuUniString aSearchTargetStr(reinterpret_cast<const 
UChar*>(searchStr.getStr()),
+    const IcuUniString aSearchTargetStr(false, reinterpret_cast<const 
UChar*>(searchStr.getStr()),
                                         searchStr.getLength());
     pRegexMatcher->reset( aSearchTargetStr);
     if (!lcl_findRegex( pRegexMatcher, endPos, startPos, nIcuErr))
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to