Differences From Artifact [b1a528232d]:
- File
src/OFMutableString.m
— part of check-in
[301ee63212]
at
2011-11-20 18:41:25
on branch trunk
— Make OFString a class cluster.
It is a class cluster now, but there is still much to improve. (user: js, size: 11046) [annotate] [blame] [check-ins using]
To Artifact [bd2a3492a4]:
- File src/OFMutableString.m — part of check-in [41e6f07b2a] at 2011-11-20 19:36:03 on branch trunk — Remove a useless variable. (user: js, size: 11014) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
415 416 417 418 419 420 421 | { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init], *pool2; const of_unichar_t *unicodeString; const of_unichar_t *searchString = [string unicodeString]; size_t length = [self length]; size_t searchLength = [string length]; size_t replacementLength = [replacement length]; | | | < | 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 440 441 442 443 444 445 446 447 448 449 450 | { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init], *pool2; const of_unichar_t *unicodeString; const of_unichar_t *searchString = [string unicodeString]; size_t length = [self length]; size_t searchLength = [string length]; size_t replacementLength = [replacement length]; size_t i; if (searchLength > length) { [pool release]; return; } pool2 = [[OFAutoreleasePool alloc] init]; unicodeString = [self unicodeString]; for (i = 0; i <= length - searchLength; i++) { if (memcmp(unicodeString + i, searchString, searchLength * sizeof(of_unichar_t))) continue; [self replaceCharactersInRange: of_range(i, searchLength) withString: replacement]; length -= searchLength; length += replacementLength; i += replacementLength - 1; [pool2 releaseObjects]; unicodeString = [self unicodeString]; } [pool release]; |
︙ | ︙ |