diff --git a/dom/dom-impl.lisp b/dom/dom-impl.lisp index 3d04535..bdd446c 100644 --- a/dom/dom-impl.lisp +++ b/dom/dom-impl.lisp @@ -587,9 +587,11 @@ (setf (slot-value new-child 'parent) node) new-child)) -(defmethod dom:insert-before ((node node) (fragment document-fragment) ref-child) - (dovector (child (dom:child-nodes fragment)) - (dom:insert-before node child ref-child)) +(defmethod dom:insert-before + ((node node) (fragment document-fragment) ref-child) + (let ((children (dom:child-nodes fragment))) + (cxml::while (plusp (length children)) + (dom:insert-before node (elt children 0) ref-child))) fragment) (defmethod dom:replace-child ((node node) (new-child node) (old-child node)) @@ -631,8 +633,9 @@ (defmethod dom:append-child ((node node) (new-child document-fragment)) (assert-writeable node) - (dovector (child (dom:child-nodes new-child)) - (dom:append-child node child)) + (let ((children (dom:child-nodes new-child))) + (cxml::while (plusp (length children)) + (dom:append-child node (elt children 0)))) new-child) ;; was auf node noch implemetiert werden muss: diff --git a/xml/xml-name-rune-p.lisp b/xml/xml-name-rune-p.lisp index 8bc808f..44d27ea 100644 --- a/xml/xml-name-rune-p.lisp +++ b/xml/xml-name-rune-p.lisp @@ -105,15 +105,19 @@ (declare (type simple-vector range-vector)) ;;we were always dealing with a sorted vector... bin search it - (loop with start = 0 - with end = (length range-vector) - while (< start end) - for mid-index = (+ start (floor (- end start) 2)) - for (mid-item-low mid-item-high) = (aref range-vector mid-index) - if (< mid-item-high code) do (setf start (1+ mid-index)) - else if (< code mid-item-low) do (setf end mid-index) - else do (return T) - finally (return nil))) + (let ((start 0) + (end (length range-vector))) + (while (< start end) + (let ((mid-index (+ start (floor (- end start) 2)))) + (destructuring-bind (mid-item-low mid-item-high) + (aref range-vector mid-index) + (cond + ((< mid-item-high code) + (setf start (1+ mid-index))) + ((< code mid-item-low) + (setf end mid-index)) + (t + (return t)))))))) (name-start-rune-p (rune) (or (letter-rune-p rune)