[Pkg-bazaar-commits] ./bzr/unstable r834: - Small performance optimization for merge3

Martin Pool mbp at sourcefrog.net
Fri Apr 10 08:21:12 UTC 2009


------------------------------------------------------------
revno: 834
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Tue 2005-07-05 22:52:34 +1000
message:
  - Small performance optimization for merge3
modified:
  bzrlib/merge3.py
-------------- next part --------------
=== modified file 'bzrlib/merge3.py'
--- a/bzrlib/merge3.py	2005-07-05 10:14:37 +0000
+++ b/bzrlib/merge3.py	2005-07-05 12:52:34 +0000
@@ -214,10 +214,13 @@
                 lines_a = self.a[ia:amatch]
                 lines_b = self.b[ib:bmatch]
 
-                # TODO: check the len just as a shortcut
-                equal_a = (lines_a == lines_base)
-                equal_b = (lines_b == lines_base)
-                same = lines_a == lines_b
+                # we check the len just as a shortcut
+                equal_a = (len_a == len_base
+                           and lines_a == lines_base)
+                equal_b = (len_b == len_base
+                           and lines_b == lines_base)
+                same = (len_a == len_b
+                        and lines_a == lines_b)
 
                 if same:
                     yield 'same', ia, amatch



More information about the Pkg-bazaar-commits mailing list