mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
fix small bug and add optimisation
This commit is contained in:
parent
947f0f8b52
commit
d6bb6deff6
3 changed files with 34 additions and 12 deletions
|
@ -1,3 +1,10 @@
|
|||
2024-02-02 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
Source/NSString.m: Return empty string of correct class when loading
|
||||
from an empty file or URL.
|
||||
Source/Additions/GSMime.m: minor optimisation usng more efficient
|
||||
method to append headers to mutable data object.
|
||||
|
||||
2024-02-01 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Source/NSLocale.m: Fix -countryCode incorrectly returning language
|
||||
|
|
|
@ -3544,7 +3544,7 @@ static NSCharacterSet *tokenSet = nil;
|
|||
}
|
||||
}
|
||||
}
|
||||
[buf appendData: [self rawMimeDataPreservingCase: YES foldedAt: 0]];
|
||||
[self rawMimeDataPreservingCase: YES foldedAt: 0 to: buf];
|
||||
if (masked && *masked)
|
||||
{
|
||||
NSUInteger len = [buf length];
|
||||
|
@ -7290,7 +7290,7 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
|
|||
enumerator = [headers objectEnumerator];
|
||||
while ((hdr = [enumerator nextObject]) != nil)
|
||||
{
|
||||
[md appendData: [hdr rawMimeDataPreservingCase: NO foldedAt: fold]];
|
||||
[hdr rawMimeDataPreservingCase: NO foldedAt: fold to: md];
|
||||
}
|
||||
|
||||
if (partData != nil)
|
||||
|
@ -8085,7 +8085,7 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
|
|||
[document setHeader: @"Content-Transfer-Encoding"
|
||||
value: enc
|
||||
parameters: nil];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1542,8 +1542,10 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale)
|
|||
if (len == 0)
|
||||
{
|
||||
RELEASE(d);
|
||||
DESTROY(self);
|
||||
return @"";
|
||||
return [self initWithBytesNoCopy: (char *)""
|
||||
length: 0
|
||||
encoding: NSASCIIStringEncoding
|
||||
freeWhenDone: NO];
|
||||
}
|
||||
data_bytes = [d bytes];
|
||||
if ((data_bytes != NULL) && (len >= 2))
|
||||
|
@ -1616,8 +1618,10 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale)
|
|||
if (len == 0)
|
||||
{
|
||||
RELEASE(d);
|
||||
DESTROY(self);
|
||||
return @"";
|
||||
return [self initWithBytesNoCopy: (char *)""
|
||||
length: 0
|
||||
encoding: NSASCIIStringEncoding
|
||||
freeWhenDone: NO];
|
||||
}
|
||||
data_bytes = [d bytes];
|
||||
if ((data_bytes != NULL) && (len >= 2))
|
||||
|
@ -1668,8 +1672,10 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale)
|
|||
if (len == 0)
|
||||
{
|
||||
RELEASE(d);
|
||||
DESTROY(self);
|
||||
return @"";
|
||||
return [self initWithBytesNoCopy: (char *)""
|
||||
length: 0
|
||||
encoding: NSASCIIStringEncoding
|
||||
freeWhenDone: NO];
|
||||
}
|
||||
self = [self initWithData: d encoding: enc];
|
||||
RELEASE(d);
|
||||
|
@ -1719,7 +1725,10 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale)
|
|||
if (len == 0)
|
||||
{
|
||||
DESTROY(self);
|
||||
return @"";
|
||||
return [self initWithBytesNoCopy: (char *)""
|
||||
length: 0
|
||||
encoding: NSASCIIStringEncoding
|
||||
freeWhenDone: NO];
|
||||
}
|
||||
data_bytes = [d bytes];
|
||||
if ((data_bytes != NULL) && (len >= 2))
|
||||
|
@ -1766,7 +1775,10 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale)
|
|||
if (len == 0)
|
||||
{
|
||||
DESTROY(self);
|
||||
return @"";
|
||||
return [self initWithBytesNoCopy: (char *)""
|
||||
length: 0
|
||||
encoding: NSASCIIStringEncoding
|
||||
freeWhenDone: NO];
|
||||
}
|
||||
data_bytes = [d bytes];
|
||||
if ((data_bytes != NULL) && (len >= 2))
|
||||
|
@ -1816,7 +1828,10 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale)
|
|||
if (len == 0)
|
||||
{
|
||||
DESTROY(self);
|
||||
return @"";
|
||||
return [self initWithBytesNoCopy: (char *)""
|
||||
length: 0
|
||||
encoding: NSASCIIStringEncoding
|
||||
freeWhenDone: NO];
|
||||
}
|
||||
self = [self initWithData: d encoding: enc];
|
||||
if (self == nil)
|
||||
|
|
Loading…
Reference in a new issue