summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2011-02-18 10:42:13 +0100
committerNoah Lavine <nlavine@haverford.edu>2011-09-05 21:50:57 -0400
commitd924bc8573cc02a4160aa620b104571667f44de3 (patch)
treeb8b7ad24d277e0b49718ba010406397362af2ab3
parentbb0f1bef21843a7ab45d3b2f2f6bd2426e61bca5 (diff)
downloadguile-d924bc8573cc02a4160aa620b104571667f44de3.tar.gz
peg: cg-string improvement
* module/ice-9/peg.scm (cg-string): Use the more efficient string= with range args, rather than string=? and substring.
-rw-r--r--module/ice-9/peg.scm3
1 files changed, 1 insertions, 2 deletions
diff --git a/module/ice-9/peg.scm b/module/ice-9/peg.scm
index 9a7873254..9735d6628 100644
--- a/module/ice-9/peg.scm
+++ b/module/ice-9/peg.scm
@@ -144,8 +144,7 @@ return EXP."
(define (cg-string for-syntax match accum)
(let ((len (string-length match)))
(cggl for-syntax #'str #'strlen #'at
- #`(if (string=? (substring str at (min (+ at #,len) strlen))
- #,match)
+ #`(if (string= str #,match at (min (+ at #,len) strlen))
#,(cggr for-syntax accum 'cg-string match
#`(+ at #,len))
#f))))