[pitivi] timeline: Use directly a set when finding clips under marquee



commit 29f5e01c9b44b90ae57b1c86709a2f5fbd83abff
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Thu Oct 13 01:26:15 2016 +0200

    timeline: Use directly a set when finding clips under marquee
    
    Reviewed-by: Thibault Saunier <tsaunier gnome org>
    Differential Revision: https://phabricator.freedesktop.org/D1385

 pitivi/timeline/timeline.py |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index f691e78..78bbe30 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -165,7 +165,7 @@ class Marquee(Gtk.Box, Loggable):
             List[GES.Clip]: The clips under the marquee.
         """
         x = self._timeline.layout.child_get_property(self, "x")
-        res = []
+        res = set()
 
         w = self.props.width_request
         for layer in self._timeline.ges_timeline.get_layers():
@@ -179,14 +179,14 @@ class Marquee(Gtk.Box, Loggable):
 
                 toplevel = clip.get_toplevel_parent()
                 if isinstance(toplevel, GES.Group) and toplevel != self._timeline.current_group:
-                    res.extend([c for c in clip.get_toplevel_parent().get_children(True)
+                    res.update([c for c in toplevel.get_children(True)
                                 if isinstance(c, GES.Clip)])
                 else:
-                    res.append(clip)
+                    res.add(clip)
 
         self.debug("Result is %s", res)
 
-        return tuple(set(res))
+        return tuple(res)
 
     def contains(self, clip, marquee_start, marquee_width):
         if clip.ui is None:


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