From f4bec54f7d928806ed294ffd2990f76474fc1007 Mon Sep 17 00:00:00 2001 From: FredKiefer Date: Tue, 12 Sep 2000 23:11:34 +0000 Subject: [PATCH] [getCharacters:] and [getCharacters:range:] use higher level methods for conversion. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@7489 72102866-910b-0410-8b05-ffd578937521 --- Source/NSGCString.m | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Source/NSGCString.m b/Source/NSGCString.m index c7a1a3fab..b05fed593 100644 --- a/Source/NSGCString.m +++ b/Source/NSGCString.m @@ -421,20 +421,13 @@ static IMP msInitImp; /* designated initialiser for mutable */ - (void) getCharacters: (unichar*)buffer { - unsigned i; - - for (i = 0; i < _count; i++) - buffer[i] = chartouni(((unsigned char *)_contents_chars)[i]); + strtoustr(buffer, _contents_chars, _count); } - (void) getCharacters: (unichar*)buffer range: (NSRange)aRange { - unsigned e, i; - GS_RANGE_CHECK(aRange, _count); - e = aRange.location + aRange.length; - for (i = aRange.location; i < e; i++) - *buffer++ = chartouni(((unsigned char *)_contents_chars)[i]); + strtoustr(buffer, _contents_chars + aRange.location, aRange.length); } - (NSString*) substringFromRange: (NSRange)aRange