mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 17:12:03 +00:00
fixes to conform to coding style
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35477 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
739c0c8ece
commit
7fd19938a5
1 changed files with 102 additions and 88 deletions
|
@ -868,9 +868,9 @@ static NSUInteger posForIndex(GSIArray array, NSUInteger index)
|
||||||
options: (NSEnumerationOptions)opts
|
options: (NSEnumerationOptions)opts
|
||||||
usingBlock: (GSIndexSetEnumerationBlock)aBlock
|
usingBlock: (GSIndexSetEnumerationBlock)aBlock
|
||||||
{
|
{
|
||||||
NSUInteger lastInRange = (NSMaxRange(range) - 1);
|
NSUInteger lastInRange;
|
||||||
NSUInteger startArrayIndex = posForIndex(_array, range.location);
|
NSUInteger startArrayIndex;
|
||||||
NSUInteger endArrayIndex = MIN(posForIndex(_array, lastInRange), (GSIArrayCount(_array) - 1));
|
NSUInteger endArrayIndex;
|
||||||
NSUInteger i;
|
NSUInteger i;
|
||||||
NSUInteger c;
|
NSUInteger c;
|
||||||
BOOL isReverse = opts & NSEnumerationReverse;
|
BOOL isReverse = opts & NSEnumerationReverse;
|
||||||
|
@ -881,11 +881,15 @@ static NSUInteger posForIndex(GSIArray array, NSUInteger index)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
startArrayIndex = posForIndex(_array, range.location);
|
||||||
if (NSNotFound == startArrayIndex)
|
if (NSNotFound == startArrayIndex)
|
||||||
{
|
{
|
||||||
startArrayIndex = 0;
|
startArrayIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lastInRange = (NSMaxRange(range) - 1);
|
||||||
|
endArrayIndex = MIN(posForIndex(_array, lastInRange),
|
||||||
|
(GSIArrayCount(_array) - 1));
|
||||||
if (NSNotFound == endArrayIndex)
|
if (NSNotFound == endArrayIndex)
|
||||||
{
|
{
|
||||||
endArrayIndex = GSIArrayCount(_array) - 1;
|
endArrayIndex = GSIArrayCount(_array) - 1;
|
||||||
|
@ -908,6 +912,7 @@ static NSUInteger posForIndex(GSIArray array, NSUInteger index)
|
||||||
NSRange r = GSIArrayItemAtIndex(_array, i).ext;
|
NSRange r = GSIArrayItemAtIndex(_array, i).ext;
|
||||||
NSUInteger innerI;
|
NSUInteger innerI;
|
||||||
NSUInteger innerC;
|
NSUInteger innerC;
|
||||||
|
|
||||||
if (isReverse)
|
if (isReverse)
|
||||||
{
|
{
|
||||||
innerI = NSMaxRange(r) - 1;
|
innerI = NSMaxRange(r) - 1;
|
||||||
|
@ -922,7 +927,9 @@ static NSUInteger posForIndex(GSIArray array, NSUInteger index)
|
||||||
{
|
{
|
||||||
if ((innerI <= lastInRange) && (innerI >= range.location))
|
if ((innerI <= lastInRange) && (innerI >= range.location))
|
||||||
{
|
{
|
||||||
GS_DISPATCH_SUBMIT_BLOCK(enumQueueGroup, enumQueue, if (shouldStop) {return;}, return;, aBlock, innerI, &shouldStop);
|
GS_DISPATCH_SUBMIT_BLOCK(enumQueueGroup, enumQueue,
|
||||||
|
if (shouldStop) {return;}, return;,
|
||||||
|
aBlock, innerI, &shouldStop);
|
||||||
}
|
}
|
||||||
if (shouldStop)
|
if (shouldStop)
|
||||||
{
|
{
|
||||||
|
@ -966,13 +973,20 @@ static NSUInteger posForIndex(GSIArray array, NSUInteger index)
|
||||||
- (void) enumerateIndexesWithOptions: (NSEnumerationOptions)opts
|
- (void) enumerateIndexesWithOptions: (NSEnumerationOptions)opts
|
||||||
usingBlock: (GSIndexSetEnumerationBlock)aBlock
|
usingBlock: (GSIndexSetEnumerationBlock)aBlock
|
||||||
{
|
{
|
||||||
NSUInteger firstIndex = [self firstIndex];
|
NSUInteger firstIndex;
|
||||||
NSUInteger lastIndex = [self lastIndex];
|
NSUInteger lastIndex;
|
||||||
|
NSRange range;
|
||||||
|
|
||||||
|
firstIndex = [self firstIndex];
|
||||||
if (NSNotFound == firstIndex)
|
if (NSNotFound == firstIndex)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
[self enumerateIndexesInRange: NSMakeRange(firstIndex, ((lastIndex - firstIndex) + 1))
|
|
||||||
|
lastIndex = [self lastIndex];
|
||||||
|
range = NSMakeRange(firstIndex, ((lastIndex - firstIndex) + 1));
|
||||||
|
|
||||||
|
[self enumerateIndexesInRange: range
|
||||||
options: opts
|
options: opts
|
||||||
usingBlock: aBlock];
|
usingBlock: aBlock];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue