mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 08:41:03 +00:00
Another small optimisation for string creation ...
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38540 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1c74bc231b
commit
1a8e11c350
2 changed files with 35 additions and 26 deletions
|
@ -790,7 +790,7 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale)
|
|||
* Set up infrastructure for placeholder strings.
|
||||
*/
|
||||
defaultPlaceholderString = (GSPlaceholderString*)
|
||||
NSAllocateObject(GSPlaceholderStringClass, 0, NSDefaultMallocZone());
|
||||
[GSPlaceholderStringClass allocWithZone: NSDefaultMallocZone()];
|
||||
placeholderMap = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks,
|
||||
NSNonRetainedObjectMapValueCallBacks, 0);
|
||||
placeholderLock = [NSLock new];
|
||||
|
@ -852,7 +852,7 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale)
|
|||
* There is no placeholder object for this zone, so we
|
||||
* create a new one and use that.
|
||||
*/
|
||||
obj = (id)NSAllocateObject(GSPlaceholderStringClass, 0, z);
|
||||
obj = (id)[GSPlaceholderStringClass allocWithZone: z];
|
||||
NSMapInsert(placeholderMap, (void*)z, (void*)obj);
|
||||
}
|
||||
[placeholderLock unlock];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue