mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-12 00:51:08 +00:00
implement new MacOS-X method.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26742 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7e82f60a9e
commit
5f12fdebd8
2 changed files with 24 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2008-07-02 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSIndexSet.m: Implement ([-countOfIndexesInRange:])
|
||||||
|
|
||||||
2008-06-30 Richard Frith-Macdonald <rfm@gnu.org>
|
2008-06-30 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/GSFFIInvocation.m:
|
* Source/GSFFIInvocation.m:
|
||||||
|
|
|
@ -234,7 +234,26 @@ static unsigned posForIndex(GSIArray array, unsigned index)
|
||||||
|
|
||||||
- (NSUInteger) countOfIndexesInRange: (NSRange)range
|
- (NSUInteger) countOfIndexesInRange: (NSRange)range
|
||||||
{
|
{
|
||||||
return 0;
|
if (_array == 0 || GSIArrayCount(_array) == 0)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unsigned count = GSIArrayCount(_array);
|
||||||
|
unsigned total = 0;
|
||||||
|
unsigned i = 0;
|
||||||
|
|
||||||
|
while (i < count)
|
||||||
|
{
|
||||||
|
NSRange r = GSIArrayItemAtIndex(_array, i).ext;
|
||||||
|
|
||||||
|
r = NSIntersectionRange(r, range);
|
||||||
|
total += r.length;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return total;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
|
|
Loading…
Reference in a new issue