summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--par/piece-table.scm5
1 files changed, 4 insertions, 1 deletions
diff --git a/par/piece-table.scm b/par/piece-table.scm
index 9f967c0..1c2940f 100644
--- a/par/piece-table.scm
+++ b/par/piece-table.scm
@@ -172,7 +172,10 @@
(can-merge-pieces? piece candidate))
(append! beg (list (merge-pieces! piece candidate)) end)
(let-values (((first second) (split-piece! piece rem)))
- (append! beg (list first candidate second) end))))))
+ (append! beg
+ (remove (lambda (p) (= 0 (piece-length p)))
+ (list first candidate second))
+ end))))))
; TODO: SET-CDR for the win?