Commits

evhan committed e83bb14

Provide end index arguments to string-reading procedures (to avoid duplicate string-length lookups)

  • Participants
  • Parent commits a9193b9

Comments (0)

Files changed (1)

File schematic-format.scm

                            ((#\|) (scan (cons 'symbol f) (+ i 1)))
                            ((#\)) (scan (cdr f) (+ i 1)))
                            ((#\() (let* ((i (+ i 1))
-                                         (a (guard/value #f (string-read line i)))
-                                         (k (string-nth-read-index line 1 i))
+                                         (a (guard/value #f (string-read line i len)))
+                                         (k (string-nth-read-index line 1 i len))
                                          (f (cond ((number? (car f)) f)        ; No queue.
                                                   ((null? (cdar f)) f)         ; Exhausted.
                                                   ((cons (cdar f) (cdr f)))))) ; Shift.
                            ((#\#) (case (string-ref line (+ i 1) #f)
                                     ((#\|) (scan (cons 'comment f) (+ i 2)))
                                     ((#\;) (scan f (+ i 2)))
-                                    (else  (scan f (or (string-nth-read-index line 1 i)
+                                    (else  (scan f (or (string-nth-read-index line 1 i len)
                                                        (+ i 1))))))
-                           (else  (scan f (or (string-nth-read-index line 1 i)
+                           (else  (scan f (or (string-nth-read-index line 1 i len)
                                               (+ i 1)))))))))))))))))))
 
 (for-each