mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-18 23:17:02 +01:00
remove warnings when calling unsafeBitCast()
This commit is contained in:
@@ -677,7 +677,12 @@ public final class ListMonitor<T: NSManagedObject>: Hashable {
|
||||
|
||||
internal func downcast() -> ListMonitor<NSManagedObject> {
|
||||
|
||||
return unsafeBitCast(self, to: ListMonitor<NSManagedObject>.self)
|
||||
@inline(__always)
|
||||
func noWarnUnsafeBitCast<T, U>(_ x: T, to type: U.Type) -> U {
|
||||
|
||||
return unsafeBitCast(x, to: type)
|
||||
}
|
||||
return noWarnUnsafeBitCast(self, to: ListMonitor<NSManagedObject>.self)
|
||||
}
|
||||
|
||||
internal func registerChangeNotification(_ notificationKey: UnsafeRawPointer, name: Notification.Name, toObserver observer: AnyObject, callback: @escaping (_ monitor: ListMonitor<T>) -> Void) {
|
||||
|
||||
@@ -110,11 +110,21 @@ public final class ObjectMonitor<EntityType: NSManagedObject>: Equatable {
|
||||
return lhs === rhs
|
||||
}
|
||||
|
||||
public static func == <T: NSManagedObject, U: NSManagedObject>(lhs: ObjectMonitor<T>, rhs: ObjectMonitor<U>) -> Bool {
|
||||
|
||||
return lhs.fetchedResultsController === rhs.fetchedResultsController
|
||||
}
|
||||
|
||||
public static func ~= <T: NSManagedObject>(lhs: ObjectMonitor<T>, rhs: ObjectMonitor<T>) -> Bool {
|
||||
|
||||
return lhs === rhs
|
||||
}
|
||||
|
||||
public static func ~= <T: NSManagedObject, U: NSManagedObject>(lhs: ObjectMonitor<T>, rhs: ObjectMonitor<U>) -> Bool {
|
||||
|
||||
return lhs.fetchedResultsController === rhs.fetchedResultsController
|
||||
}
|
||||
|
||||
|
||||
// MARK: Hashable
|
||||
|
||||
@@ -212,7 +222,12 @@ public final class ObjectMonitor<EntityType: NSManagedObject>: Equatable {
|
||||
|
||||
internal func downcast() -> ObjectMonitor<NSManagedObject> {
|
||||
|
||||
return unsafeBitCast(self, to: ObjectMonitor<NSManagedObject>.self)
|
||||
@inline(__always)
|
||||
func noWarnUnsafeBitCast<T, U>(_ x: T, to type: U.Type) -> U {
|
||||
|
||||
return unsafeBitCast(x, to: type)
|
||||
}
|
||||
return noWarnUnsafeBitCast(self, to: ObjectMonitor<NSManagedObject>.self)
|
||||
}
|
||||
|
||||
deinit {
|
||||
|
||||
Reference in New Issue
Block a user