mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-15 05:33:31 +01:00
[ListMonitor] [subscript(safeSectionIndex:safeItemIndex:)] Use subscript(indexPath:) after the validation of sectionIndex and itemIndex to get an object.
There is a performance problem in Swift when getting an object from the Objective-C array with a large number of objects using subscript. It requires casting the array between Objective-C and Swift, that is pretty slow.
This commit is contained in:
@@ -144,7 +144,7 @@ public final class ListMonitor<D: DynamicObject>: Hashable {
|
||||
|
||||
return nil
|
||||
}
|
||||
return ObjectType.cs_fromRaw(object: section.objects![itemIndex] as! NSManagedObject)
|
||||
return self[IndexPath(indexes: [sectionIndex, itemIndex])]
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user