[PATCH] Replace code with just a simple list comprehension



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

Kai, do you want me to commit this, will it become
obsolete with your historyentry.py work, or will you
integrate it in your patch series ? I don't want to
interfere...

-- 
Vincent Legoll
Index: historyentry.py
===================================================================
--- historyentry.py	(révision 1280)
+++ historyentry.py	(copie de travail)
@@ -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]