~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/patiencediff.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-10-31 22:18:23 UTC
  • mfrom: (2104.4.2 wang_65714)
  • Revision ID: pqm@pqm.ubuntu.com-20061031221823-64fb0443861befd1
(Cheuksan Edward Wang) Fix bug #65714 by switching to patience diff (O(N^2) instead of O(N^3) for difflib)

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]