Skip to content

Commit

Permalink
register-groups-bind: don't call subseq for parse-integer.
Browse files Browse the repository at this point in the history
  • Loading branch information
stassats committed Apr 8, 2024
1 parent 743b5a5 commit 714ee6c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions api.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,14 @@ substrings may share structure with TARGET-STRING."
collect `(,var (let ((,start-index
(aref ,reg-starts ,counter)))
(if ,start-index
(funcall ,function
(funcall ,substr-fn
,target-string
,start-index
(aref ,reg-ends ,counter)))
,(if (equal function '#'parse-integer)
`(parse-integer ,target-string :start ,start-index
:end (aref ,reg-ends ,counter))
`(funcall ,function
(funcall ,substr-fn
,target-string
,start-index
(aref ,reg-ends ,counter))))
nil))))))
`(multiple-value-bind (,match-start ,match-end ,reg-starts ,reg-ends)
(scan ,regex ,target-string :start (or ,start 0)
Expand Down

0 comments on commit 714ee6c

Please sign in to comment.