~mdw
/
sod
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
61c7351
)
src/parser/scanner-charbuf-impl.lisp: Use `replace' rather than a loop.
author
Mark Wooding
<mdw@distorted.org.uk>
Sun, 30 Aug 2015 09:58:38 +0000
(10:58 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Thu, 17 Sep 2015 10:24:11 +0000
(11:24 +0100)
Somehow I failed to notice `replace' being a completely cromulent
`memcpy' thing for Lisp.
src/parser/scanner-charbuf-impl.lisp
patch
|
blob
|
blame
|
history
diff --git
a/src/parser/scanner-charbuf-impl.lisp
b/src/parser/scanner-charbuf-impl.lisp
index
1919b69
..
414e1a8
100644
(file)
--- 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)