https://bugs.kde.org/show_bug.cgi?id=375831

--- Comment #1 from Wladimir Palant <ppk...@palant.de> ---
Created attachment 103745
  --> https://bugs.kde.org/attachment.cgi?id=103745&action=edit
Proposed patch

Here is a fix for this issue. Note that it is treating the case where both
strings are equal specially, this is for consistency with the logic at the
bottom of compareTextsAlphabetical() and compareTextsCharacterCode(). I don't
see a difference if I leave out this case but if it is important then
personally I would have written this differently:

> if (aS2.length() == 0) {
>     return false;
> } else if (aS1.length() == 0) {
>     return true;
> }

The checks in compareTextsAlphabetical() can be simplified similarly:

> if (lPositionS2 == aS2.length()) return false;
> else if (lPositionS1 == aS1.length()) return true;

These two comparisons produce the same result as the six comparisons currently
there.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to