Skip to content

Instantly share code, notes, and snippets.

View minhnguyen-iosdev's full-sized avatar

Minh Nguyen minhnguyen-iosdev

  • Ho Chi Minh City
View GitHub Profile
@minhnguyen-iosdev
minhnguyen-iosdev / AnyDiffable.swift
Created November 3, 2018 12:35 — forked from regexident/AnyDiffable.swift
Implementation of Paul Heckel's Diff Algorithm in Swift 3
public protocol Diffable: Hashable {
var primaryKeyValue: String { get }
}
public struct AnyDiffable: Diffable {
private let _primaryKeyValue: () -> String
@minhnguyen-iosdev
minhnguyen-iosdev / diff.mdown
Created November 3, 2018 12:42 — forked from ndarville/diff.mdown
Paul Heckel's Diff Algorithm

[Isolating Differences Between Files][paper]

Advantage over Other Algorithms

The diff output is more specific:

[I]f a whole block of text is moved, then all of it, rather than just the beginning and end, is detected as changed.

>The algorithm described here avoids these difficulties. It detects differences that correspond very closely to our intuitive notion of difference.