~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/patiencediff.py

  • Committer: wang
  • Date: 2006-10-29 13:41:32 UTC
  • mto: (2104.4.1 wang_65714)
  • mto: This revision was merged to the branch mainline in revision 2109.
  • Revision ID: wang@ubuntu-20061029134132-3d7f4216f20c4aef
Replace python's difflib by patiencediff because the worst case 
performance is cubic for difflib and people commiting large data 
files are often hurt by this. The worst case performance of patience is 
quadratic. Fix bug 65714.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
    http://en.wikipedia.org/wiki/Patience_sorting
44
44
    """
45
45
    # set index[line in a] = position of line in a unless
46
 
    # unless a is a duplicate, in which case it's set to None
 
46
    # a is a duplicate, in which case it's set to None
47
47
    index = {}
48
48
    for i in xrange(len(a)):
49
49
        line = a[i]