diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-10-26 07:48:38 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-10-26 07:48:38 -0700 |
commit | c4313b5b2df139dcee040b3b83333f9099a8e4c1 (patch) | |
tree | 52bd4731de10a2454c319e10812e6539cdc94634 /stdlib | |
parent | f32a5ba6ac37703987772560b57aa0dcace0c598 (diff) | |
download | txr-c4313b5b2df139dcee040b3b83333f9099a8e4c1.tar.gz txr-c4313b5b2df139dcee040b3b83333f9099a8e4c1.tar.bz2 txr-c4313b5b2df139dcee040b3b83333f9099a8e4c1.zip |
pic: use ifa to remove repeated array access.
* stdlib/pic.tl (insert-commas): Use ifa to bind the
anaphoric variable it to [num (pred i)]. With the new
ifa behavior involving read-place, this now prevents
two accesses to the array.
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/pic.tl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/stdlib/pic.tl b/stdlib/pic.tl index 7ca898a7..e66ecdfd 100644 --- a/stdlib/pic.tl +++ b/stdlib/pic.tl @@ -78,8 +78,8 @@ (string-extend out [num i]))) (when (plusp i) (when (< j pn) - (if (meq [num (pred i)] #\space #\- #\+) - (set comma [num (pred i)])) + (ifa (meq [num (pred i)] #\space #\- #\+) + (set comma it)) (let ((pj [positions j])) (cond ((eql pj p) |