summary refs log tree commit diff
path: root/gnu/installer/services.scm
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2023-09-21 16:03:50 +0200
committerRicardo Wurmus <rekado@elephly.net>2023-09-24 13:49:53 +0200
commit670fc6ee50a2882fba8004de7d9d24e80459add2 (patch)
treeb5a780ca2df3f37345506841fdc9dd3ea68891f2 /gnu/installer/services.scm
parent5027bc19d8a3c7bac1d89d80fc3c717ae3ec399a (diff)
downloadguix-670fc6ee50a2882fba8004de7d9d24e80459add2.tar.gz
etc/committer: Speed up surrounding-sexp.
The old surrounding-sexp procedure would read all S-expressions from the
beginning of the file up to the given line number and then return the last
encountered S-expression.  This is quite wasteful.  Instead we can record all
lines that begin with an S-expression and jump straight to the offset closest
to the desired line number to read the S-expression there.

* etc/committer.scm.in (lines+offsets-with-opening-parens): New procedure.
(surrounding-sexp): Use it.
Diffstat (limited to 'gnu/installer/services.scm')
0 files changed, 0 insertions, 0 deletions