From: Mark Wooding Date: Sun, 30 Aug 2015 09:58:38 +0000 (+0100) Subject: src/parser/scanner-charbuf-impl.lisp: Use `replace' rather than a loop. X-Git-Url: https://git.distorted.org.uk/~mdw/sod/commitdiff_plain/777e16acbbe4c1524278fb59afee19759b9dec02 src/parser/scanner-charbuf-impl.lisp: Use `replace' rather than a loop. Somehow I failed to notice `replace' being a completely cromulent `memcpy' thing for Lisp. --- diff --git a/src/parser/scanner-charbuf-impl.lisp b/src/parser/scanner-charbuf-impl.lisp index 1919b69..414e1a8 100644 --- a/src/parser/scanner-charbuf-impl.lisp +++ b/src/parser/scanner-charbuf-impl.lisp @@ -415,10 +415,7 @@ (unless end (setf end (length seq))) (let ((i start) (n (- end start))) (labels ((copy (i buf start end) - (do ((j i (1+ j)) - (k start (1+ k))) - ((>= k end)) - (setf (char seq j) (schar buf k)))) + (replace seq buf :start1 i :start2 start :end2 end)) (snarf (buf start end) (let ((m (- end start))) (cond ((< m n)