FIX conflict resolution for empty lists

This commit is contained in:
Nathan Dwarshuis 2022-05-02 23:41:15 -04:00
parent 3d28aaa892
commit ff35f41ec5
1 changed files with 13 additions and 13 deletions

View File

@ -2278,19 +2278,19 @@ Return value is a list like (BUFFER NON-BUFFER)."
(cl-labels (cl-labels
((get-overlaps ((get-overlaps
(acc ss) (acc ss)
(-let* (((acc+ acc-) acc) (-if-let (s0 (car ss))
(s0 (car ss)) (-let* (((acc+ acc-) acc)
(A (cdr s0))) (A (cdr s0))
(-if-let (rest (cdr ss)) (a1 (cadr (car s0)))
(let ((a1 (cadr (car s0)))) (rest (cdr ss)))
;; add members while if the starting value is less than the ending ;; add members while if the starting value is less than the ending
;; value of the current member ;; value of the current member
(-if-let (over (->> (--take-while (< (car (car it)) a1) rest) (-if-let (over (->> (--take-while (< (car (car it)) a1) rest)
(--map (list A (cdr it))) (--map (list A (cdr it)))
(reverse))) (reverse)))
(get-overlaps `((,@over ,@acc+) ,acc-) rest) (get-overlaps `((,@over ,@acc+) ,acc-) rest)
(get-overlaps `(,acc+ (,A ,@acc-)) rest))) (get-overlaps `(,acc+ (,A ,@acc-)) rest)))
`(,acc+ (,A ,@acc-)))))) acc)))
(-let (((over non-over) (->> (-annotate interval-fun xs) (-let (((over non-over) (->> (-annotate interval-fun xs)
(--sort (< (car (car it)) (car (car other)))) (--sort (< (car (car it)) (car (car other))))
(get-overlaps nil)))) (get-overlaps nil))))