[latex3-commits] [git/LaTeX3-latex3-latex2e] develop: Avoid xparse overhead on \IfHookEmptyTF (629d684d)

PhelypeOleinik phelype.oleinik at latex-project.org
Thu Sep 17 11:24:22 CEST 2020


Repository : https://github.com/latex3/latex2e
On branch  : develop
Link       : https://github.com/latex3/latex2e/commit/629d684da7fa466f2c7fc4e532d1449220935d13

>---------------------------------------------------------------

commit 629d684da7fa466f2c7fc4e532d1449220935d13
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Thu Sep 17 06:24:22 2020 -0300

    Avoid xparse overhead on \IfHookEmptyTF


>---------------------------------------------------------------

629d684da7fa466f2c7fc4e532d1449220935d13
 base/lthooks.dtx | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index 17c3262a..fb326e49 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -3909,12 +3909,13 @@
 %  \end{macro}
 %
 %
-% \begin{macro}{\IfHookExistsTF,\IfHookEmptyTF}
+% \begin{macro}[EXP]{\IfHookExistsTF,\IfHookEmptyTF}
+%   Here, same as for \cs{UseHook}, we avoid the overhead of \pkg{xparse},
+%   since \cs{IfHookEmptyTF} is used in \cs{end} (that is, every \LaTeX{}
+%   environment).
 %    \begin{macrocode}
-\NewExpandableDocumentCommand \IfHookExistsTF { m }
-  { \hook_if_exist:nTF {#1} }
-\NewExpandableDocumentCommand \IfHookEmptyTF { m }
-  { \hook_if_empty:nTF {#1} }
+\cs_new:Npn \IfHookExistsTF { \hook_if_exist:nTF }
+\cs_new:Npn \IfHookEmptyTF { \hook_if_empty:nTF }
 %    \end{macrocode}
 % \end{macro}
 %





More information about the latex3-commits mailing list.