summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-09-05 18:33:27 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-09-05 22:28:21 +0200
commitd211909bb95f99b5adc6d49f60610f4d0676afbd (patch)
treee824841b825a0f869c4336e51e817847a0ec4b41 /i18npool
parent1bc728580364c626aa04df624e2afac8fa92890e (diff)
Simplify comparison between OUString and raw pointer
...avoiding the construction of an intermediary temporary OUString, assuming the given `word` will never contain embedded NUL characters. (This change is a prerequisite for making the OUString ctor taking a raw pointer explicit.) Change-Id: I3b500557abb3554e9dfda63ef30b22c6c06c99c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102084 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/source/textconversion/textconversion_zh.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/i18npool/source/textconversion/textconversion_zh.cxx b/i18npool/source/textconversion/textconversion_zh.cxx
index d45baa553e53..23689c0b568e 100644
--- a/i18npool/source/textconversion/textconversion_zh.cxx
+++ b/i18npool/source/textconversion/textconversion_zh.cxx
@@ -218,7 +218,8 @@ TextConversion_zh::getWordConversion(const OUString& aText, sal_Int32 nStartPos,
while (bottom <= top && !found) {
current = (top + bottom) / 2;
- const sal_Int32 result = word.compareTo(wordData + entry[current]);
+ const sal_Int32 result = rtl_ustr_compare(
+ word.getStr(), wordData + entry[current]);
if (result < 0)
top = current - 1;
else if (result > 0)