Differences From Artifact [3c8f4c2bc5]:
- File
src/OFMutableString.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: 16105) [annotate] [blame] [check-ins using]
To Artifact [f5b0d569c9]:
- File src/OFMutableString.m — part of check-in [f977192a23] at 2011-08-04 16:48:32 on branch trunk — Get rid of -[*FromIndex:toIndex:]. (user: js, size: 15837) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
429 430 431 432 433 434 435 | string->s->cStringLength); s->cString[newCStringLength] = '\0'; s->cStringLength = newCStringLength; s->length += string->s->length; } | | > | > | | 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 | string->s->cStringLength); s->cString[newCStringLength] = '\0'; s->cStringLength = newCStringLength; s->length += string->s->length; } - (void)deleteCharactersInRange: (of_range_t)range { size_t start = range.start; size_t end = range.start + range.length; if (start > end) @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; if (end > s->length) @throw [OFOutOfRangeException newWithClass: isa]; |
︙ | ︙ | |||
461 462 463 464 465 466 467 | toSize: s->cStringLength + 1]; } @catch (OFOutOfMemoryException *e) { /* We don't really care, as we only made it smaller */ [e release]; } } | < < < < < < | < | > > | 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 | toSize: s->cStringLength + 1]; } @catch (OFOutOfMemoryException *e) { /* We don't really care, as we only made it smaller */ [e release]; } } - (void)replaceCharactersInRange: (of_range_t)range withString: (OFString*)replacement { size_t start = range.start; size_t end = range.start + range.length; size_t newCStringLength, newLength; if (start > end) @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; if (end > s->length) |
︙ | ︙ | |||
504 505 506 507 508 509 510 | replacement->s->cStringLength); s->cString[newCStringLength] = '\0'; s->cStringLength = newCStringLength; s->length = newLength; } | < < < < < < < < | 501 502 503 504 505 506 507 508 509 510 511 512 513 514 | replacement->s->cStringLength); s->cString[newCStringLength] = '\0'; s->cStringLength = newCStringLength; s->length = newLength; } - (void)replaceOccurrencesOfString: (OFString*)string withString: (OFString*)replacement { const char *cString = [string cString]; const char *replacementCString = [replacement cString]; size_t cStringLength = string->s->cStringLength; size_t replacementCStringLength = replacement->s->cStringLength; |
︙ | ︙ |