[glib] gobject.py: Simplify or_join_array



commit 243bec9d0d52293ed6d6b2b6990f23ecb5309f9b
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Sep 19 15:41:09 2013 -0400

    gobject.py: Simplify or_join_array

 gobject/gobject.py |   12 ++----------
 1 files changed, 2 insertions(+), 10 deletions(-)
---
diff --git a/gobject/gobject.py b/gobject/gobject.py
index 5e8ff67..48a9309 100644
--- a/gobject/gobject.py
+++ b/gobject/gobject.py
@@ -160,16 +160,8 @@ class SignalFrame:
     def or_join_array (self, array):
         if len(array) == 0:
             return "???"
-
-        v = {}
-        for i in range(len(array)):
-            v[str(array[i])] = 1
-        array = v.keys()
-        s = array[0]
-        for i in range(1, len(array)):
-            s = s + " or %s"%array[i]
-
-        return s
+        else:
+            return ' or '.join(set(array))
 
     def get_detailed_signal_from_frame(self, frame, signal):
         detail = self.read_var (frame, "detail")


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