tweak for more efficient string handling

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34084 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2011-10-28 15:02:46 +00:00
parent a220e9bdf0
commit 22289342b4
2 changed files with 4 additions and 7 deletions

View file

@ -3,7 +3,8 @@
* Source/NSString.m: Fix bug when widening mutable string in * Source/NSString.m: Fix bug when widening mutable string in
replaceOccurrencesOfString:...range: replaceOccurrencesOfString:...range:
* Source/GSString.m: more efficient check to see if a literal string * Source/GSString.m: more efficient check to see if a literal string
can be converted to ascii or latin1 can be converted to ascii or latin1. Remove unnecessary constraint
on when we need to widen strings.
2011-10-28 Fred Kiefer <FredKiefer@gmx.de> 2011-10-28 Fred Kiefer <FredKiefer@gmx.de>

View file

@ -2723,15 +2723,11 @@ transmute(GSStr self, NSString *aString)
*/ */
transmute = NO; transmute = NO;
} }
else if (internalEncoding == externalEncoding else if ([aString canBeConvertedToEncoding: internalEncoding] == YES)
&& [aString canBeConvertedToEncoding: internalEncoding] == YES)
{ {
/* /*
* The other string can be converted to the internal 8-bit encoding, * The other string can be converted to the internal 8-bit encoding,
* via the cString method, so we don't need to transmute, but we * so we don't need to transmute, but we can *not* use its GSStr.
* can *not* use its GSStr.
* NB. If 'internalEncoding != externalEncoding' the cString method
* of the other string will not return data in the internal encoding.
*/ */
transmute = NO; transmute = NO;
other = 0; other = 0;