Differences From Artifact [600171252e]:
- File src/OFString.m — part of check-in [1433aef0d0] at 2010-01-16 15:05:14 on branch trunk — Reduce dependencies between headers. (user: js, size: 17480) [annotate] [blame] [check-ins using]
To Artifact [1aae4ffc35]:
- File
src/OFString.m
— part of check-in
[13f2a20288]
at
2010-01-30 18:29:28
on branch trunk
— Change how the Unicode table is stored.
The recent optimization had a bug in the range check and thus did not
notice that an int16_t is not enough to store the difference, thus
leading to broken results. This reverts it to the old way the Unicode
table was stored. (user: js, size: 17196) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
608 609 610 611 612 613 614 | str_len = [str cStringLength]; i = j = 0; while (i < length && j < str_len) { of_unichar_t c1, c2; size_t l1, l2; | < < | < < | < | | | | < < | < < | < | | < | 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 | str_len = [str cStringLength]; i = j = 0; while (i < length && j < str_len) { of_unichar_t c1, c2; size_t l1, l2; l1 = of_string_utf8_to_unicode(string + i, length - i, &c1); l2 = of_string_utf8_to_unicode(str_cstr + j, str_len - j, &c2); if (l1 == 0 || l2 == 0 || c1 > 0x10FFFF || c2 > 0x10FFFF) @throw [OFInvalidEncodingException newWithClass: isa]; if (c1 >> 8 < OF_UNICODE_CASEFOLDING_TABLE_SIZE) { of_unichar_t tc = of_unicode_casefolding_table[c1 >> 8][c1 & 0xFF]; if (tc) c1 = tc; } if (c2 >> 8 < OF_UNICODE_CASEFOLDING_TABLE_SIZE) { of_unichar_t tc = of_unicode_casefolding_table[c2 >> 8][c2 & 0xFF]; if (tc) c2 = tc; } if (c1 > c2) return OF_ORDERED_DESCENDING; if (c1 < c2) return OF_ORDERED_ASCENDING; |
︙ | ︙ |