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
{{ message }}
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.
@benqo Hi, to make it work like you describe, then we need a function to merge delete and insert changes at the same index to form a update change.
However, how can we tell if an object has been changed or not? The way DeepDiff works now is to base on the hashValue to tell if we are talking about the same object, usually we have object ID for uniqueness, and use Equatable conformance to tell if any of its properties have changed, you can take a look at https://github.com/onmyway133/DeepDiff/blob/master/DeepDiffTests/HeckelTests.swift#L55
@onmyway133 thanks! Tried it again with my Hashable struct and works as expected. It detects if an object is replaced with a new (different) one or the same one is just updated.
Hi,
I have a problem with the Hecker algorithm, I think it doesn't detect replaces correctly. A simple example:
diff(old: Array("abc"), new: Array("adc"))
This will return delete at 1 and insert at 1.
Using WagnerFischer, it works as expected:
diff(old: Array("abc"), new: Array("adc"), algorithm: WagnerFischer())
This returns replace at 1.
Is this algorithm specific or just a bug?
Thanks!
The text was updated successfully, but these errors were encountered: