mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-09 13:30:26 +02:00
peg: cg-string improvement
* module/ice-9/peg.scm (cg-string): Use the more efficient string= with range args, rather than string=? and substring.
This commit is contained in:
parent
87c3ef2f95
commit
990b24b254
1 changed files with 1 additions and 2 deletions
|
@ -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))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue