{"action":"created","issue":{"url":"https://api.github.com/repos/wokalski/Diff.swift/issues/22","repository_url":"https://api.github.com/repos/wokalski/Diff.swift","labels_url":"https://api.github.com/repos/wokalski/Diff.swift/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/wokalski/Diff.swift/issues/22/comments","events_url":"https://api.github.com/repos/wokalski/Diff.swift/issues/22/events","html_url":"https://github.com/wokalski/Diff.swift/issues/22","id":191967659,"number":22,"title":"Invalid insertion when comparing identical single-element arrays","user":{"login":"flovouin","id":5155149,"avatar_url":"https://avatars.githubusercontent.com/u/5155149?v=3","gravatar_id":"","url":"https://api.github.com/users/flovouin","html_url":"https://github.com/flovouin","followers_url":"https://api.github.com/users/flovouin/followers","following_url":"https://api.github.com/users/flovouin/following{/other_user}","gists_url":"https://api.github.com/users/flovouin/gists{/gist_id}","starred_url":"https://api.github.com/users/flovouin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flovouin/subscriptions","organizations_url":"https://api.github.com/users/flovouin/orgs","repos_url":"https://api.github.com/users/flovouin/repos","events_url":"https://api.github.com/users/flovouin/events{/privacy}","received_events_url":"https://api.github.com/users/flovouin/received_events","type":"User","site_admin":false},"labels":[{"id":308373001,"url":"https://api.github.com/repos/wokalski/Diff.swift/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-28T10:21:25Z","updated_at":"2016-11-28T12:31:50Z","closed_at":"2016-11-28T12:22:13Z","body":"Hi,\r\n\r\nThanks for the great library, it is indeed a lot faster than Dwifft. As I'm still using Swift 2.3, I'm currently on `b153507`, however the following is an issue that is still present on `master`.\r\nWhen comparing two arrays containing a single, identical element, the diff algorithm returns a single insertion at index `-1`. For example, `let changes = [\"a\"].diff([\"a\"])` produces\r\n```\r\n(Diff.Diff) $R0 = {\r\n  elements = 1 value {\r\n    [0] = insert {\r\n      insert = (at = -1)\r\n    }\r\n  }\r\n}\r\n```\r\nThis could probably be avoided by implementing the \"equality pre-processing optimisation\" #5, but maybe there is something to check in the core algorithm?\r\n\r\nCheers,\r\nFlo"},"comment":{"url":"https://api.github.com/repos/wokalski/Diff.swift/issues/comments/263259838","html_url":"https://github.com/wokalski/Diff.swift/issues/22#issuecomment-263259838","issue_url":"https://api.github.com/repos/wokalski/Diff.swift/issues/22","id":263259838,"user":{"login":"wokalski","id":1693190,"avatar_url":"https://avatars.githubusercontent.com/u/1693190?v=3","gravatar_id":"","url":"https://api.github.com/users/wokalski","html_url":"https://github.com/wokalski","followers_url":"https://api.github.com/users/wokalski/followers","following_url":"https://api.github.com/users/wokalski/following{/other_user}","gists_url":"https://api.github.com/users/wokalski/gists{/gist_id}","starred_url":"https://api.github.com/users/wokalski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wokalski/subscriptions","organizations_url":"https://api.github.com/users/wokalski/orgs","repos_url":"https://api.github.com/users/wokalski/repos","events_url":"https://api.github.com/users/wokalski/events{/privacy}","received_events_url":"https://api.github.com/users/wokalski/received_events","type":"User","site_admin":false},"created_at":"2016-11-28T12:31:50Z","updated_at":"2016-11-28T12:31:50Z","body":"Fixed in [0.3](https://github.com/wokalski/Diff.swift/releases/tag/0.3)"}}
{"actor":{"display_login":"wokalski"}}