mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Some more performance tweaks for replagins strings in a mutable string.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26785 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b3464c3c03
commit
4c288ca2dd
3 changed files with 54 additions and 11 deletions
|
@ -381,10 +381,13 @@ GSEQ_STRCOMP(NSString *ss, NSString *os, unsigned mask, NSRange aRange)
|
|||
unsigned oLength; /* Length of other. */
|
||||
unsigned sLength = GSEQ_SLEN;
|
||||
|
||||
#if 0
|
||||
/* Range should be checked in calling code */
|
||||
if (aRange.location > sLength)
|
||||
[NSException raise: NSRangeException format: @"Invalid location."];
|
||||
if (aRange.length > (sLength - aRange.location))
|
||||
[NSException raise: NSRangeException format: @"Invalid location+length."];
|
||||
#endif
|
||||
|
||||
oLength = GSEQ_OLEN;
|
||||
if (aRange.length == 0)
|
||||
|
@ -604,11 +607,14 @@ GSEQ_STRRANGE(NSString *ss, NSString *os, unsigned mask, NSRange aRange)
|
|||
|
||||
/* Check that the search range is reasonable */
|
||||
myLength = GSEQ_SLEN;
|
||||
|
||||
#if 0
|
||||
/* Range should be checked in calling code */
|
||||
if (aRange.location > myLength)
|
||||
[NSException raise: NSRangeException format: @"Invalid location."];
|
||||
if (aRange.length > (myLength - aRange.location))
|
||||
[NSException raise: NSRangeException format: @"Invalid location+length."];
|
||||
|
||||
#endif
|
||||
|
||||
/* Ensure the string can be found */
|
||||
strLength = GSEQ_OLEN;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue