On Thu, 13 Aug 2015 11:52:26 +0200 Jürgen Hestermann <[email protected]> wrote:
> There is a comment for UTF8CompareText in LazUTF8 which is contradictorily: > > // Returns: < 0 if S1 < S2, 0 if S1 = S2, > 0 if S2 > S1. > > But S1 < S2 is the same as S2 > S1. It should be >0 if S1 > S2. I changed the comment. > In the first case the result should be < 0 and in the second one > 0. > > It cannot even be retrieved from the code how it realy works (unless you are > fit in assembler). > So when will the result be positive and when negative? Under Linux it does not use Assembler. Internally it uses UTF8CompareStr, which uses CompareMemRange, which returns -1 if a byte of S1 is lower than S2. I added the comment. Mattias -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
