mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Make NSPropertyList.m use the temporary buffer macros, instead of reimplementing them.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32062 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
45c20425df
commit
ef600d4917
1 changed files with 2 additions and 13 deletions
|
@ -1464,22 +1464,14 @@ PString(NSString *obj, NSMutableData *output)
|
|||
else if ([obj rangeOfCharacterFromSet: oldQuotables].length > 0
|
||||
|| [obj characterAtIndex: 0] == '/')
|
||||
{
|
||||
unichar tmp[length <= 1024 ? length : 0];
|
||||
unichar *ustring;
|
||||
unichar *from;
|
||||
unichar *end;
|
||||
unsigned char *ptr;
|
||||
int base = [output length];
|
||||
int len = 0;
|
||||
GS_BEGINITEMBUF(tmp, (length * sizeof(unichar)), unichar)
|
||||
|
||||
if (length <= 1024)
|
||||
{
|
||||
ustring = tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
ustring = NSAllocateCollectable(sizeof(unichar) * length, 0);
|
||||
}
|
||||
end = &ustring[length];
|
||||
[obj getCharacters: ustring];
|
||||
for (from = ustring; from < end; from++)
|
||||
|
@ -1581,10 +1573,7 @@ PString(NSString *obj, NSMutableData *output)
|
|||
}
|
||||
*ptr++ = '"';
|
||||
|
||||
if (ustring != tmp)
|
||||
{
|
||||
NSZoneFree(NSDefaultMallocZone(), ustring);
|
||||
}
|
||||
GS_ENDITEMBUF();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue