meld r1293 - trunk



Author: vincele
Date: Thu Mar 26 21:26:02 2009
New Revision: 1293
URL: http://svn.gnome.org/viewvc/meld?rev=1293&view=rev

Log:
Replace code with just a simple list comprehension

I think this code is more complicated that the
simple and natural equivalent list comprehension


Modified:
   trunk/historyentry.py

Modified: trunk/historyentry.py
==============================================================================
--- trunk/historyentry.py	(original)
+++ trunk/historyentry.py	Thu Mar 26 21:26:02 2009
@@ -87,12 +87,7 @@
         return key
 
     def __get_history_list(self):
-        store = self.__get_history_store()
-        if len(store):
-            hist_list = [row[0] for row in store]
-            return hist_list
-        else:
-            return []
+        return [row[0] for row in self.__get_history_store()]
 
     def _save_history(self):
         key = self.__get_history_key()



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