From 22289342b47daa05df3669fcd0bbe1204853b56b Mon Sep 17 00:00:00 2001 From: rfm Date: Fri, 28 Oct 2011 15:02:46 +0000 Subject: [PATCH] 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 --- ChangeLog | 3 ++- Source/GSString.m | 8 ++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index ca21ba734..cb469223d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,7 +3,8 @@ * Source/NSString.m: Fix bug when widening mutable string in replaceOccurrencesOfString:...range: * 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 diff --git a/Source/GSString.m b/Source/GSString.m index d170ffb78..16c6faaea 100644 --- a/Source/GSString.m +++ b/Source/GSString.m @@ -2723,15 +2723,11 @@ transmute(GSStr self, NSString *aString) */ transmute = NO; } - else if (internalEncoding == externalEncoding - && [aString canBeConvertedToEncoding: internalEncoding] == YES) + else if ([aString canBeConvertedToEncoding: internalEncoding] == YES) { /* * 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 - * can *not* use its GSStr. - * NB. If 'internalEncoding != externalEncoding' the cString method - * of the other string will not return data in the internal encoding. + * so we don't need to transmute, but we can *not* use its GSStr. */ transmute = NO; other = 0;