mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
more utf8 optimisation
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38542 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
83dda5160c
commit
293606cda5
1 changed files with 11 additions and 5 deletions
|
@ -1072,7 +1072,7 @@ tsbytes(uintptr_t s, char *buf)
|
|||
/**
|
||||
* Constructs a tiny string.
|
||||
*/
|
||||
static id
|
||||
static inline id
|
||||
createTinyString(const char *str, int length)
|
||||
{
|
||||
unsigned int i;
|
||||
|
@ -1112,7 +1112,7 @@ createTinyString(const char *str, int length)
|
|||
return (id)s;
|
||||
}
|
||||
#else
|
||||
static id
|
||||
static inline id
|
||||
createTinyString(const char *str, int length)
|
||||
{
|
||||
return nil;
|
||||
|
@ -1712,9 +1712,15 @@ fixBOM(unsigned char **bytes, NSUInteger*length, BOOL *owned,
|
|||
|
||||
if (YES == ascii)
|
||||
{
|
||||
me = (GSStr)newCInline(length, myZone);
|
||||
memcpy(me->_contents.c, bytes, length);
|
||||
return (id)me;
|
||||
id o = createTinyString(bytes, length);
|
||||
|
||||
if (nil == o)
|
||||
{
|
||||
me = (GSStr)newCInline(length, myZone);
|
||||
memcpy(me->_contents.c, bytes, length);
|
||||
o = (id)me;
|
||||
}
|
||||
return o;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue