mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
optimisations
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4233 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c71e8c0524
commit
8500c95ee2
5 changed files with 52 additions and 10 deletions
|
@ -369,6 +369,25 @@
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
- (NSRange) rangeOfComposedCharacterSequenceAtIndex: (unsigned)anIndex
|
||||
{
|
||||
unsigned start;
|
||||
unsigned end;
|
||||
|
||||
if (anIndex >= _count)
|
||||
[NSException raise: NSRangeException format:@"Invalid location."];
|
||||
|
||||
start = anIndex;
|
||||
while (uni_isnonsp(_contents_chars[start]) && start > 0)
|
||||
start--;
|
||||
end = start + 1;
|
||||
if (end < _count)
|
||||
while ((end < _count) && (uni_isnonsp(_contents_chars[end])) )
|
||||
end++;
|
||||
return NSMakeRange(start, end-start);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue