You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Had a shower-thought this morning: what if we change the result produced by IGListDiff(...) to be a generic result object with an array of operations (delete/insert/reload/move)?
Why?
There are currently too many things doing essentially the same stuff:
@zhubofei array is the cleanest way to interop with other methods expecting arrays. Plus the diff internals should already guarantee there aren’t dupe operations.
Had a shower-thought this morning: what if we change the result produced by
IGListDiff(...)
to be a generic result object with an array of operations (delete/insert/reload/move)?Why?
There are currently too many things doing essentially the same stuff:
NSIndexSet
orNSArray<NSIndexPath *>
NSInteger
orNSIndexPath
NSIndexPath
There's a lot of duplication going on here. I think we can clean it up:
Proposal
Create a generic "operation" object:
Then we create a new result object:
I'd also love to restore diff statistics (like clocking the time it takes to diff). We used to collect this data.
We could also add back APIs like
-[IGListDiffResult inserts]
that just query an internal map of operation types to operations. Might be convenient?Considerations
isEqual:
andhash
so we can add and unique them inNSSet
sQuestions
NSIndexPath
andNSInteger
with generic types?hash
andisEqual
for the operationNSNumber
withintegerValue
when enumerating operations a concern at all? The perf overhead should be minuscule, but it does existThe text was updated successfully, but these errors were encountered: