Skip to content

Commit da753bd

Browse files
committed
Minor clean up
1 parent ee2adbb commit da753bd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

WordPress/Classes/Models/Notifications/Notification.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class Notification: NSManagedObject {
8181
///
8282
fileprivate var cachedHeaderAndBodyContentGroups: [FormattableContentGroup]?
8383

84-
private var cachedAttributesObserver: NotificationCachedAttributesObserver? = nil
84+
private var cachedAttributesObserver: NotificationCachedAttributesObserver?
8585

8686
/// Array that contains the Cached Property Names
8787
///
@@ -91,10 +91,11 @@ class Notification: NSManagedObject {
9191
super.awakeFromFetch()
9292

9393
if cachedAttributesObserver == nil {
94-
cachedAttributesObserver = NotificationCachedAttributesObserver()
94+
let observer = NotificationCachedAttributesObserver()
9595
for attr in Notification.cachedAttributes {
96-
addObserver(cachedAttributesObserver!, forKeyPath: attr, options: [.prior], context: nil)
96+
addObserver(observer, forKeyPath: attr, options: [.prior], context: nil)
9797
}
98+
cachedAttributesObserver = observer
9899
}
99100
}
100101

0 commit comments

Comments
 (0)