onmyway133 / DeepDiff

🦀Amazingly incredible extraordinary lightning fast diffing in Swift
https://onmyway133.com/apps/
Other
2.05k stars 145 forks source link

Is the documentation correct for diff("abcd", "adbc")? #48

Open znakeeye opened 4 years ago

znakeeye commented 4 years ago

In your list of examples, you have this piece of code:

let old = Array("abcd")
let new = Array("adbc")
let changes = diff(old: old, new: new)

// Move "d" from index 3 to index 1

Is this indeed correct or was this before introducing the Heckel algorithm?

Haven't verified this, but doesn't Heckel produce all three moves in this case? I.e.:

// Move "d" from index 3 to index 1
// Move "b" from index 1 to index 2
// Move "c" from index 2 to index 3
github-actions[bot] commented 4 years ago

Message that will be displayed on users' first issue