mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-04-17 22:49:41 +02:00
Improve perfomance by bypassing bridging (similar to https://github.com/JohnEstropia/CoreStore/pull/288)
This commit is contained in:
@@ -90,7 +90,7 @@ public final class ListMonitor<D: DynamicObject>: Hashable {
|
|||||||
)
|
)
|
||||||
if self.isSectioned {
|
if self.isSectioned {
|
||||||
|
|
||||||
return ObjectType.cs_fromRaw(object: self.fetchedResultsController.fetchedObjects![index])
|
return ObjectType.cs_fromRaw(object: (self.fetchedResultsController.fetchedObjects as NSArray?)![index] as! NSManagedObject)
|
||||||
}
|
}
|
||||||
return self[0, index]
|
return self[0, index]
|
||||||
}
|
}
|
||||||
@@ -105,10 +105,10 @@ public final class ListMonitor<D: DynamicObject>: Hashable {
|
|||||||
|
|
||||||
if self.isSectioned {
|
if self.isSectioned {
|
||||||
|
|
||||||
let fetchedObjects = self.fetchedResultsController.fetchedObjects!
|
let fetchedObjects = (self.fetchedResultsController.fetchedObjects as NSArray?)!
|
||||||
if index < fetchedObjects.count && index >= 0 {
|
if index < fetchedObjects.count && index >= 0 {
|
||||||
|
|
||||||
return ObjectType.cs_fromRaw(object: fetchedObjects[index])
|
return ObjectType.cs_fromRaw(object: fetchedObjects[index] as! NSManagedObject)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -353,7 +353,7 @@ public final class ListMonitor<D: DynamicObject>: Hashable {
|
|||||||
)
|
)
|
||||||
if self.isSectioned {
|
if self.isSectioned {
|
||||||
|
|
||||||
return self.fetchedResultsController.fetchedObjects?.index(of: object.cs_toRaw())
|
return (self.fetchedResultsController.fetchedObjects as NSArray?)?.index(of: object.cs_toRaw())
|
||||||
}
|
}
|
||||||
return self.fetchedResultsController.indexPath(forObject: object.cs_toRaw())?[1]
|
return self.fetchedResultsController.indexPath(forObject: object.cs_toRaw())?[1]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user