Skip to content

Commit d14f7d7

Browse files
author
Chaitanya Gupta
committed
Simplify superentities' property removal
1 parent 6a96100 commit d14f7d7

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/MOMPrinter.m

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,17 +143,10 @@ - (BOOL)printPath:(NSString *)path {
143143
[entityStr appendFormat:@" (%@)", [entity managedObjectClassName]];
144144
NSPrintf(@"%@\n", entityStr);
145145

146-
NSMutableArray *properties = nil;
146+
NSMutableArray *properties = [NSMutableArray arrayWithArray:[entity properties]];
147147

148-
if (self.mode == MOMPrinterIncludeSuperclassProperties) {
149-
properties = [NSMutableArray arrayWithArray:[entity properties]];
150-
} else {
151-
// Filter out properties that belong to superclasses.
152-
NSSet *superentityProperties = [NSSet setWithArray:[superentity properties]];
153-
NSMutableSet *entityProperties = [NSMutableSet setWithArray:[entity properties]];
154-
[entityProperties minusSet:superentityProperties];
155-
156-
properties = [[entityProperties allObjects] mutableCopy];
148+
if (self.mode == MOMPrinterOmitSuperclassProperties) {
149+
[properties removeObjectsInArray:[superentity properties]];
157150
}
158151

159152
[properties sortUsingComparator:^(id obj1, id obj2) {

0 commit comments

Comments
 (0)