Differences From Artifact [c1cbc7f938]:
- File src/OFConstantString.m — part of check-in [7c66260ead] at 2011-07-08 20:13:39 on branch trunk — Rename -[deleteLeadingAndTrailingWhitespaces]. (user: js, size: 12777) [annotate] [blame] [check-ins using]
To Artifact [87992a22fc]:
- File
src/OFConstantString.m
— part of check-in
[36e8a94f34]
at
2011-07-09 14:45:44
on branch trunk
— Cache the length of a string.
Also removes -[appendCStringWithoutUTF8Checking:] as it is dangerous and
not compatible with this optimization. (user: js, size: 12798) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
51 52 53 54 55 56 57 | @throw [OFOutOfMemoryException newWithClass: isa requestedSize: sizeof(*ivars)]; memset(ivars, 0, sizeof(*ivars)); ivars->cString = (char*)s; ivars->cStringLength = initialized; | | > | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | @throw [OFOutOfMemoryException newWithClass: isa requestedSize: sizeof(*ivars)]; memset(ivars, 0, sizeof(*ivars)); ivars->cString = (char*)s; ivars->cStringLength = initialized; switch (of_string_check_utf8(ivars->cString, ivars->cStringLength, &ivars->length)) { case 1: ivars->isUTF8 = YES; break; case -1: free(ivars); @throw [OFInvalidEncodingException newWithClass: isa]; } |
︙ | ︙ |