Overview
Comment: | Optimize +[stringWithString:] and -[appendString:]. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
e250800382e482ec83403cab1915ba14 |
User & Date: | js on 2011-07-08 21:08:34 |
Other Links: | manifest | tags |
Context
2011-07-08
| ||
21:26 | Adjust TableGenerator to (not so) recent style changes. check-in: 30cdebfa2a user: js tags: trunk | |
21:08 | Optimize +[stringWithString:] and -[appendString:]. check-in: e250800382 user: js tags: trunk | |
20:13 | Rename -[deleteLeadingAndTrailingWhitespaces]. check-in: 7c66260ead user: js tags: trunk | |
Changes
Modified src/OFMutableString.m from [736e731460] to [8b9a1eb927].
︙ | ︙ | |||
246 247 248 249 250 251 252 | - (void)appendString: (OFString*)string { if (string == nil) @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; | > | > > > | 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | - (void)appendString: (OFString*)string { if (string == nil) @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; [self appendCStringWithoutUTF8Checking: [string cString] length: [string cStringLength]]; if (string->s->isUTF8) s->isUTF8 = YES; } - (void)appendFormat: (OFConstantString*)format, ... { va_list arguments; va_start(arguments, format); |
︙ | ︙ |
Modified src/OFString.m from [39b88703df] to [518f441548].
︙ | ︙ | |||
578 579 580 581 582 583 584 | } - initWithString: (OFString*)string { self = [super init]; @try { | < < < < < < | < < < | < < < < | | < < < < < < | 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 | } - initWithString: (OFString*)string { self = [super init]; @try { s = [self allocMemoryWithSize: sizeof(*s)]; memset(s, 0, sizeof(*s)); s->cStringLength = [string cStringLength]; s->isUTF8 = string->s->isUTF8; s->cString = [self allocMemoryWithSize: s->cStringLength + 1]; memcpy(s->cString, [string cString], s->cStringLength + 1); } @catch (id e) { [self release]; @throw e; } return self; } |
︙ | ︙ |