Merge pull request #3254 from enquora/cleanup-formatting

Cleanup formatting in CPSet class cluster.
Align variable declarations.
Convert Xcode landmarks from c preprocessor pragmas to objj-native // MARK:
This commit is contained in:
David Richardson
2026-07-21 11:11:53 -06:00
committed by GitHub
2 changed files with 34 additions and 34 deletions
+6 -6
View File
@@ -173,8 +173,8 @@
@end @end
#pragma mark - // MARK: -
#pragma mark Category: CPKeyValueCoding // MARK: Category: CPKeyValueCoding
@implementation CPSet (CPKeyValueCoding) @implementation CPSet (CPKeyValueCoding)
@@ -247,8 +247,8 @@
@end @end
#pragma mark - // MARK: -
#pragma mark Key-Value Observing Extensions // MARK: Key-Value Observing Extensions
@implementation CPObject (CPSetKVO) @implementation CPObject (CPSetKVO)
@@ -274,8 +274,8 @@
@end @end
#pragma mark - // MARK: -
#pragma mark Key-Value Observing Proxy Implementation // MARK: Key-Value Observing Proxy Implementation
@implementation _CPKVCSet : CPMutableSet @implementation _CPKVCSet : CPMutableSet
{ {
+28 -28
View File
@@ -103,7 +103,7 @@
- (id)initWithObjects:(id)anObject, ... - (id)initWithObjects:(id)anObject, ...
{ {
var index = 2, var index = 2,
count = arguments.length; count = arguments.length;
for (; index < count; ++index) for (; index < count; ++index)
if (arguments[index] === nil) if (arguments[index] === nil)
@@ -140,9 +140,9 @@
- (CPArray)allObjects - (CPArray)allObjects
{ {
var objects = [], var objects = [],
object, object,
objectEnumerator = [self objectEnumerator]; objectEnumerator = [self objectEnumerator];
while ((object = [objectEnumerator nextObject]) != nil) while ((object = [objectEnumerator nextObject]) != nil)
objects.push(object); objects.push(object);
@@ -162,9 +162,9 @@
- (CPSet)filteredSetUsingPredicate:(CPPredicate)aPredicate - (CPSet)filteredSetUsingPredicate:(CPPredicate)aPredicate
{ {
var objects = [], var objects = [],
object, object,
objectEnumerator = [self objectEnumerator]; objectEnumerator = [self objectEnumerator];
while ((object = [objectEnumerator nextObject]) != nil) while ((object = [objectEnumerator nextObject]) != nil)
if ([aPredicate evaluateWithObject:object]) if ([aPredicate evaluateWithObject:object])
@@ -186,8 +186,8 @@
- (void)makeObjectsPerformSelector:(SEL)aSelector withObjects:(CPArray)objects - (void)makeObjectsPerformSelector:(SEL)aSelector withObjects:(CPArray)objects
{ {
var object, var object,
objectEnumerator = [self objectEnumerator], objectEnumerator = [self objectEnumerator],
argumentsArray = [nil, aSelector].concat(objects || []); argumentsArray = [nil, aSelector].concat(objects || []);
while ((object = [objectEnumerator nextObject]) != nil) while ((object = [objectEnumerator nextObject]) != nil)
{ {
@@ -209,8 +209,8 @@
- (void)enumerateObjectsUsingBlock:(Function)aFunction - (void)enumerateObjectsUsingBlock:(Function)aFunction
{ {
var object, var object,
objectEnumerator = [self objectEnumerator], objectEnumerator = [self objectEnumerator],
shouldStop = NO; shouldStop = NO;
while (!shouldStop && (object = [objectEnumerator nextObject]) != nil) { while (!shouldStop && (object = [objectEnumerator nextObject]) != nil) {
if (aFunction(object, @ref(shouldStop)) !== undefined) { if (aFunction(object, @ref(shouldStop)) !== undefined) {
@@ -221,9 +221,9 @@
- (CPSet)objectsPassingTest:(Function)aFunction - (CPSet)objectsPassingTest:(Function)aFunction
{ {
var objects = [], var objects = [],
object = nil, object = nil,
objectEnumerator = [self objectEnumerator]; objectEnumerator = [self objectEnumerator];
while ((object = [objectEnumerator nextObject]) != nil) while ((object = [objectEnumerator nextObject]) != nil)
if (aFunction(object)) if (aFunction(object))
@@ -234,8 +234,8 @@
- (BOOL)isSubsetOfSet:(CPSet)aSet - (BOOL)isSubsetOfSet:(CPSet)aSet
{ {
var object = nil, var object = nil,
objectEnumerator = [self objectEnumerator]; objectEnumerator = [self objectEnumerator];
while ((object = [objectEnumerator nextObject]) != nil) while ((object = [objectEnumerator nextObject]) != nil)
if (![aSet containsObject:object]) if (![aSet containsObject:object])
@@ -249,8 +249,8 @@
if (self === aSet) if (self === aSet)
return [self count] > 0; return [self count] > 0;
var object = nil, var object = nil,
objectEnumerator = [self objectEnumerator]; objectEnumerator = [self objectEnumerator];
while ((object = [objectEnumerator nextObject]) != nil) while ((object = [objectEnumerator nextObject]) != nil)
if ([aSet containsObject:object]) if ([aSet containsObject:object])
@@ -279,10 +279,10 @@
- (CPString)description - (CPString)description
{ {
var string = "{(\n", var string = "{(\n",
objects = [self allObjects], objects = [self allObjects],
index = 0, index = 0,
count = [objects count]; count = [objects count];
for (; index < count; ++index) for (; index < count; ++index)
{ {
@@ -295,8 +295,8 @@
@end @end
#pragma mark - // MARK: -
#pragma mark Category: CPCopying // MARK: Category: CPCopying
@implementation CPSet (CPCopying) @implementation CPSet (CPCopying)
@@ -312,8 +312,8 @@
@end @end
#pragma mark - // MARK: -
#pragma mark Category: CPCoding // MARK: Category: CPCoding
var CPSetObjectsKey = @"CPSetObjectsKey"; var CPSetObjectsKey = @"CPSetObjectsKey";
@@ -331,8 +331,8 @@ var CPSetObjectsKey = @"CPSetObjectsKey";
@end @end
#pragma mark - // MARK: -
#pragma mark Private Allocation Placeholder // MARK: Private Allocation Placeholder
var _CPSharedPlaceholderSet = nil; var _CPSharedPlaceholderSet = nil;