diff options
author | Andy Wingo <wingo@pobox.com> | 2011-02-18 10:42:13 +0100 |
---|---|---|
committer | Noah Lavine <noah.b.lavine@gmail.com> | 2012-01-20 08:26:44 -0500 |
commit | 8cba473cba59519bc6aaa23e1403494e901d65d9 (patch) | |
tree | 84da4f6329c4b35501a8df122cbfd00683026cbd | |
parent | 66f2d2650247b089c177b1190f7db0dc550ccce6 (diff) | |
download | guile-8cba473cba59519bc6aaa23e1403494e901d65d9.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)))) |