meld r1230 - trunk



Author: kaiw
Date: Sun Mar  8 11:44:55 2009
New Revision: 1230
URL: http://svn.gnome.org/viewvc/meld?rev=1230&view=rev

Log:
Replace our uniq() implementation with a more standard idiom


Modified:
   trunk/dirdiff.py

Modified: trunk/dirdiff.py
==============================================================================
--- trunk/dirdiff.py	(original)
+++ trunk/dirdiff.py	Sun Mar  8 11:44:55 2009
@@ -39,16 +39,6 @@
 #
 ################################################################################
 
-def uniq(l):
-    i = iter(l)
-    a = i.next()
-    yield a
-    while 1:
-        b = i.next()
-        if a != b:
-            yield b
-            a = b
-
 _cache = {}
 
 def _files_same(lof, regexes):
@@ -411,8 +401,7 @@
                     def add(self, pane, items):
                         self.items.extend(items)
                     def get(self):
-                        self.items.sort()
-                        return [(i,) * self.n for i in uniq(self.items)]
+                        return [(i,) * self.n for i in sorted(list(set(self.items)))]
             else:
                 canonicalize = lambda x : x.lower()
                 class accum(object):



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