Skip to content

Commit 5852722

Browse files
committed
remove comments
1 parent ba24df1 commit 5852722

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

rope.lisp

+3-20
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,6 @@
131131
(with-slots (left right) rope
132132
(rotate-left (concat-rope* left (rotate-right right)))))
133133

134-
;; (defun balance-children (rope)
135-
;; (with-slots (left right) rope
136-
;; (concat-rope* (balance-rope left)
137-
;; (balance-rope right))))
138-
139134
(defgeneric balance-rope (rope)
140135
(:method ((rope leaf))
141136
rope)
@@ -183,7 +178,9 @@
183178
(merge-leaves leaves mid end)))))))
184179

185180
(defun rebuild-rope (rope)
186-
"Balance a rope by reconstructing it from the bottom up."
181+
"Reconstruct a rope from the bottom up.
182+
Doing this occasionally can reduce the number of leaves in a rope,
183+
but it is expensive - O(n)."
187184
(let ((leaves (normalize-leaves (collect-rope rope))))
188185
(merge-leaves leaves 0 (length leaves))))
189186

@@ -219,20 +216,6 @@
219216
(with-slots (left right) rope
220217
(concat-rope* left (append-rope right source)))))
221218

222-
;; (defgeneric prepend-rope (rope source)
223-
;; (:documentation "Return a new rope with a string or rope inserted at the beginning of a rope.")
224-
;; (:method (rope (source rope))
225-
;; (concat-rope source rope))
226-
;; (:method (rope (source t))
227-
;; (concat-rope (make-rope source) rope)))
228-
229-
;; (defgeneric append-rope (rope source)
230-
;; (:documentation "Return a new rope with a string or rope inserted at the end of a rope.")
231-
;; (:method (rope (source rope))
232-
;; (concat-rope rope source))
233-
;; (:method (rope (source t))
234-
;; (concat-rope rope (make-rope source))))
235-
236219
(defun insert-rope (rope index str)
237220
"Return a new rope with a string or rope inserted at the specified index of a rope."
238221
(cond ((= index 0) (prepend-rope rope str))

0 commit comments

Comments
 (0)