Inline map and array updates.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4447 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1999-06-21 08:30:26 +00:00
parent aade319e69
commit e704dbd2b8
22 changed files with 829 additions and 914 deletions

View file

@ -31,6 +31,7 @@
#include <Foundation/NSData.h>
#include <Foundation/NSDictionary.h>
#include <Foundation/NSCharacterSet.h>
#include <Foundation/NSRange.h>
#include <base/NSGString.h>
#include <base/NSGCString.h>
#include <base/IndexedCollection.h>
@ -343,10 +344,7 @@ static IMP msInitImp; /* designated initialiser for mutable */
{
int len;
if (aRange.location >= _count)
[NSException raise: NSRangeException format:@"Invalid location."];
if (aRange.length > (_count - aRange.location))
[NSException raise: NSRangeException format:@"Invalid location+length."];
GS_RANGE_CHECK(aRange, _count);
if (maxLength < aRange.length)
{
len = maxLength;
@ -403,10 +401,7 @@ static IMP msInitImp; /* designated initialiser for mutable */
{
int e, i;
if (aRange.location >= _count)
[NSException raise: NSRangeException format:@"Invalid location."];
if (aRange.length > (_count - aRange.location))
[NSException raise: NSRangeException format:@"Invalid location+length."];
GS_RANGE_CHECK(aRange, _count);
e = aRange.location + aRange.length;
for (i = aRange.location; i < e; i++)
*buffer++ = chartouni(((unsigned char *)_contents_chars)[i]);
@ -414,10 +409,7 @@ static IMP msInitImp; /* designated initialiser for mutable */
- (NSString*) substringFromRange: (NSRange)aRange
{
if (aRange.location > _count)
[NSException raise: NSRangeException format:@"Invalid location."];
if (aRange.length > (_count - aRange.location))
[NSException raise: NSRangeException format:@"Invalid location+length."];
GS_RANGE_CHECK(aRange, _count);
return [[self class] stringWithCString: _contents_chars + aRange.location
length: aRange.length];
}