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>
This commit is contained in:
Stephan Bergmann
2020-09-05 18:33:27 +02:00
parent 1bc7285803
commit d211909bb9

View File

@@ -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)