[Timeline] Ensure empty timelines don’t break removal of short entries

This commit is contained in:
Daniel Borchmann 2018-11-28 16:38:47 +01:00
parent a4febc68d1
commit f2db1f5b5e
Signed by: exot
GPG Key ID: 4F63DB96D45AA9C6

View File

@ -333,6 +333,7 @@ A slot is short if it is not longer than THRESHOLD seconds.
Resulting gaps are distributed evenly among adjacent slots.
THRESHOLD defaults to the value of
`timeline-tools-short-task-threshold if not supplied."
(unless (null timeline)
(let ((start (timeline-tools-entry-start-time (-first-item timeline)))
(end (timeline-tools-entry-end-time (-last-item timeline)))
(threshold (or threshold timeline-tools-short-task-threshold))
@ -363,7 +364,7 @@ THRESHOLD defaults to the value of
(setf (timeline-tools-entry-end-time entry-1) middle)
(setf (timeline-tools-entry-start-time entry-2) middle)))))
new-timeline))
new-timeline)))
(defun timeline-tools-transform-timeline (timeline)
"Return timeline from files, after application of