Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IGListDiff( IGListDiffEquality) quesiton #1539

Open
LeonLeeboy opened this issue Oct 26, 2021 · 0 comments
Open

IGListDiff( IGListDiffEquality) quesiton #1539

LeonLeeboy opened this issue Oct 26, 2021 · 0 comments

Comments

@LeonLeeboy
Copy link

LeonLeeboy commented Oct 26, 2021

if (originalIndex < oldCount) {
const id n = newArray[i];
const id o = oldArray[originalIndex];
switch (option) {
case IGListDiffPointerPersonality:
// flag the entry as updated if the pointers are not the same
if (n != o) {
entry->updated = YES;
}
break;
case IGListDiffEquality:
// use -[IGListDiffable isEqualToDiffableObject:] between both version of data to see if anything has changed
// skip the equality check if both indexes point to the same object
[if (![n isEqualToDiffableObject:o]) **{ // there should be like this?it's not work,when i extends isEqualToDiffableObject,i wanna same data,but i can control it refresh**
entry->updated = YES;
}
break;
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant