Skip to content

Commit c5e69c5

Browse files
committed
Fix indent
Tabs.
1 parent c9d363a commit c5e69c5

File tree

3 files changed

+25
-13
lines changed

3 files changed

+25
-13
lines changed

Sources/ManagedModels/SchemaCompatibility/CoreDataPrimitiveValue.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import CoreData
77

88
public extension CoreData.NSAttributeDescription {
9-
struct TypeConfiguration: Sendable {
9+
struct TypeConfiguration: Sendable {
1010
let attributeType : NSAttributeType
1111
let isOptional : Bool
1212
let attributeValueClassName : String?

Sources/ManagedModels/SchemaCompatibility/NSPropertyDescription+Data.swift

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,29 @@ extension NSPropertyDescription {
1212
// Note: isUnique is only used during schema construction!
1313
set {
1414
if newValue {
15-
objc_setAssociatedObject(self, &AssociatedKeys.propertyIsUniqueAssociatedKey,
16-
type(of: self), .OBJC_ASSOCIATION_ASSIGN)
15+
objc_setAssociatedObject(
16+
self, &AssociatedKeys.propertyIsUniqueAssociatedKey,
17+
type(of: self), // Just used as a flag, type won't go away
18+
.OBJC_ASSOCIATION_ASSIGN
19+
)
1720
}
1821
else {
19-
objc_setAssociatedObject(self, &AssociatedKeys.propertyIsUniqueAssociatedKey, nil, .OBJC_ASSOCIATION_RETAIN)
22+
objc_setAssociatedObject(
23+
self, &AssociatedKeys.propertyIsUniqueAssociatedKey,
24+
nil, // clear // clear flag
25+
.OBJC_ASSOCIATION_ASSIGN
26+
)
2027
}
2128
#if false // do we need this? The entity might not yet be setup?
2229
guard !entity.isPropertyUnique(self) else { return }
2330
entity.uniquenessConstraints.append( [ self ])
2431
#endif
2532
}
2633
get {
27-
objc_getAssociatedObject(self, &AssociatedKeys.propertyIsUniqueAssociatedKey) != nil
34+
objc_getAssociatedObject(
35+
self,
36+
&AssociatedKeys.propertyIsUniqueAssociatedKey
37+
) != nil
2838
? true
2939
: entity.isPropertyUnique(self)
3040
}

Sources/ManagedModels/SchemaCompatibility/NSRelationshipDescription+Data.swift

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public extension CoreData.NSRelationshipDescription {
141141
self.maxCount = 0
142142
}
143143
else if valueType is NSOrderedSet.Type ||
144-
valueType is Optional<NSOrderedSet>.Type
144+
valueType is Optional<NSOrderedSet>.Type
145145
{
146146
self.maxCount = 0
147147
}
@@ -205,9 +205,8 @@ extension CoreData.NSRelationshipDescription {
205205
}
206206

207207
var writableRelationshipInfo : MacroInfo {
208-
if let info =
209-
objc_getAssociatedObject(self, &AssociatedKeys.relationshipInfoAssociatedKey)
210-
as? MacroInfo
208+
if let info = objc_getAssociatedObject(
209+
self, &AssociatedKeys.relationshipInfoAssociatedKey) as? MacroInfo
211210
{
212211
return info
213212
}
@@ -220,12 +219,15 @@ extension CoreData.NSRelationshipDescription {
220219
var relationshipInfo: MacroInfo? {
221220
// Note: isUnique is only used during schema construction!
222221
set {
223-
objc_setAssociatedObject(self, &AssociatedKeys.relationshipInfoAssociatedKey,
224-
newValue, .OBJC_ASSOCIATION_RETAIN)
222+
objc_setAssociatedObject(
223+
self, &AssociatedKeys.relationshipInfoAssociatedKey,
224+
newValue, .OBJC_ASSOCIATION_RETAIN
225+
)
225226
}
226227
get {
227-
objc_getAssociatedObject(self, &AssociatedKeys.relationshipInfoAssociatedKey)
228-
as? MacroInfo
228+
objc_getAssociatedObject(
229+
self, &AssociatedKeys.relationshipInfoAssociatedKey
230+
) as? MacroInfo
229231
}
230232
}
231233
}

0 commit comments

Comments
 (0)