diff options
author | Andy Wingo <wingo@pobox.com> | 2011-02-18 10:42:13 +0100 |
---|---|---|
committer | Noah Lavine <nlavine@haverford.edu> | 2011-09-05 21:50:57 -0400 |
commit | d924bc8573cc02a4160aa620b104571667f44de3 (patch) | |
tree | b8b7ad24d277e0b49718ba010406397362af2ab3 | |
parent | bb0f1bef21843a7ab45d3b2f2f6bd2426e61bca5 (diff) | |
download | guile-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.scm | 3 |
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)))) |