[pitivi: 15/16] Add a comment explaining why TimelineEdges does what it does.



commit 9f75b5c44a323c683aef5731bcc29b919479bdcc
Author: Alessandro Decina <alessandro d gmail com>
Date:   Tue Jul 7 10:43:20 2009 +0200

    Add a comment explaining why TimelineEdges does what it does.

 pitivi/timeline/timeline.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index ba6c83f..0b5ee56 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -640,6 +640,14 @@ class Link(object):
 # end values.
 # Bonus : GnlComposition already has all this information, we could maybe add
 # an action signal to it to drastically speed up this process.
+#
+# Alessandro: this is faster than having two separate lists. By keeping start
+# and end edges in the same list, we reduce the time we scan the list
+# of edges. In fact once we find a start edge at pos X, we then scan for an end
+# edge by starting at edges[X] and going forward, avoiding to rescan the edges
+# from 0 to X.
+# I don't see how exposing the gnl lists would make things faster, what's taking
+# time here is scanning the lists, and it's something you'd have to do anyway.
 class TimelineEdges(object):
     """
     Tracks start/stop values and offers convenience methods to find the



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