From 243bec9d0d52293ed6d6b2b6990f23ecb5309f9b Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Thu, 19 Sep 2013 15:41:09 -0400 Subject: [PATCH] gobject.py: Simplify or_join_array --- gobject/gobject.py | 12 ++---------- 1 file 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") -- 2.7.4