Differences From Artifact [808aebc7d8]:
- File
src/OFMutableString.m
— part of check-in
[1255f3a11a]
at
2012-08-10 20:08:24
on branch trunk
— Directly use the runtime's autorelease pools.
This greatly improves performance, as it gets rid of the overhead of
OFAutoreleasePool. (user: js, size: 12619) [annotate] [blame] [check-ins using]
To Artifact [869c2383b0]:
- File src/OFMutableString.m — part of check-in [c137da5e5b] at 2012-09-16 15:27:48 on branch trunk — Prefix all private methods with OF_. (user: js, size: 12623) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
251 252 253 254 255 256 257 | { if (self == [OFMutableString class]) return (id)&placeholder; return [super alloc]; } | | | | | | 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | { if (self == [OFMutableString class]) return (id)&placeholder; return [super alloc]; } - (void)OF_convertWithWordStartTable: (const of_unichar_t *const[])startTable wordMiddleTable: (const of_unichar_t *const[])middleTable wordStartTableSize: (size_t)startTableSize wordMiddleTableSize: (size_t)middleTableSize { void *pool = objc_autoreleasePoolPush(); const of_unichar_t *string = [self unicodeString]; size_t i, length = [self length]; BOOL isStart = YES; for (i = 0; i < length; i++) { |
︙ | ︙ | |||
406 407 408 409 410 411 412 | [self setCharacter: tmp atIndex: i]; } } - (void)uppercase { | | | | | | | | | | | | | | 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 | [self setCharacter: tmp atIndex: i]; } } - (void)uppercase { [self OF_convertWithWordStartTable: of_unicode_uppercase_table wordMiddleTable: of_unicode_uppercase_table wordStartTableSize: OF_UNICODE_UPPERCASE_TABLE_SIZE wordMiddleTableSize: OF_UNICODE_UPPERCASE_TABLE_SIZE]; } - (void)lowercase { [self OF_convertWithWordStartTable: of_unicode_lowercase_table wordMiddleTable: of_unicode_lowercase_table wordStartTableSize: OF_UNICODE_LOWERCASE_TABLE_SIZE wordMiddleTableSize: OF_UNICODE_LOWERCASE_TABLE_SIZE]; } - (void)capitalize { [self OF_convertWithWordStartTable: of_unicode_titlecase_table wordMiddleTable: of_unicode_lowercase_table wordStartTableSize: OF_UNICODE_TITLECASE_TABLE_SIZE wordMiddleTableSize: OF_UNICODE_LOWERCASE_TABLE_SIZE]; } - (void)insertString: (OFString*)string atIndex: (size_t)index { @throw [OFNotImplementedException exceptionWithClass: [self class] selector: _cmd]; |
︙ | ︙ |