meld r1162 - trunk



Author: vincele
Date: Mon Feb 23 22:32:25 2009
New Revision: 1162
URL: http://svn.gnome.org/viewvc/meld?rev=1162&view=rev

Log:
Inline lambda as it obfuscates the code, use variable before its definition, etc...


Modified:
   trunk/diffutil.py

Modified: trunk/diffutil.py
==============================================================================
--- trunk/diffutil.py	(original)
+++ trunk/diffutil.py	Mon Feb 23 22:32:25 2009
@@ -105,11 +105,10 @@
 
     def _locate_chunk(self, whichdiffs, sequence, line):
         """Find the index of the chunk which contains line."""
-        idx = 1 + 2*(sequence != 1)
-        line_in_chunk = lambda x: line < c[idx+1]
+        idx = 1 + 2 * (sequence != 1)
         i = 0
         for c in self.diffs[whichdiffs]:
-            if line_in_chunk(c):
+            if line < c[idx + 1]: # Is line in chunk ?
                 break
             else:
                 i += 1



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]