minor optimisation

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30671 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2010-06-11 10:49:21 +00:00
parent c646d76a81
commit aa3592307c
2 changed files with 12 additions and 3 deletions

View file

@ -1,6 +1,7 @@
2010-06-10 Riccardo Mottola
* Source/ObjectiveC2/sync.m: Attempt of fixing test for defining _XOPEN_SOURCE again
* Source/ObjectiveC2/sync.m: Attempt of fixing test for defining
_XOPEN_SOURCE again
2010-06-10 Richard Frith-Macdonald <rfm@gnu.org>

View file

@ -2554,8 +2554,15 @@ NSDebugMLLog(@"GSMime", @"Header parsed - %@", info);
{
pos--;
}
childBody = [d subdataWithRange:
NSMakeRange(sectionStart, pos - sectionStart)];
/* Since we know the child can't modify it, and we know
* that we aren't going to change the buffer while the
* child is using it, we can safely pass a data object
* which simply references the memory in our own buffer.
*/
childBody = [[NSData alloc]
initWithBytesNoCopy: (void*)(buf + sectionStart)
length: pos - sectionStart
freeWhenDone: NO];
if ([child parse: childBody] == YES)
{
/*
@ -2564,6 +2571,7 @@ NSDebugMLLog(@"GSMime", @"Header parsed - %@", info);
*/
[child parse: nil];
}
[childBody release];
if ([child isComplete] == YES)
{
GSMimeDocument *doc;