po: Avoid regexps when interpreting '\n' sequences.
authorLudovic Courtès <ludo@gnu.org>
Mon, 22 Jun 2020 21:29:25 +0000 (23:29 +0200)
committerLudovic Courtès <ludo@gnu.org>
Mon, 22 Jun 2020 22:03:08 +0000 (00:03 +0200)
commit52b4524f4e87e16da6fb1475145685299f0febe0
treecaffb686abd41ac27de8e308915b87c6d84bd419
parenta524a31de43b330c911fb08ae02fcd880d32aa04
po: Avoid regexps when interpreting '\n' sequences.

This reduces the execution time of:

  (call-with-input-file "po/doc/guix-manual.de.po" read-po-file)

from 4.7s to 4.0s.

* guix/build/po.scm (interpret-newline-escape): New procedure.
(parse-tree->assoc): Use it instead of 'regexp-substitute/global'.
guix/build/po.scm