[latex3-commits] [git/LaTeX3-latex3-latex2e] develop: Use \cs_new_eq:NN to optimise (64cc4215)
PhelypeOleinik
phelype.oleinik at latex-project.org
Thu Sep 17 13:12:01 CEST 2020
Repository : https://github.com/latex3/latex2e
On branch : develop
Link : https://github.com/latex3/latex2e/commit/64cc4215b6be88189a9e7e4b7c6ed7f4a2938801
>---------------------------------------------------------------
commit 64cc4215b6be88189a9e7e4b7c6ed7f4a2938801
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date: Thu Sep 17 08:12:01 2020 -0300
Use \cs_new_eq:NN to optimise
>---------------------------------------------------------------
64cc4215b6be88189a9e7e4b7c6ed7f4a2938801
base/lthooks.dtx | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index fb326e49..02b683c0 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -32,7 +32,7 @@
%
% \begin{macrocode}
\def\lthooksversion{v1.0a}
-\def\lthooksdate{2020/09/10}
+\def\lthooksdate{2020/09/17}
% \end{macrocode}
%
%<*driver>
@@ -3910,12 +3910,13 @@
%
%
% \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).
+% Here we avoid the overhead of \pkg{xparse}, since \cs{IfHookEmptyTF}
+% is used in \cs{end} (that is, every \LaTeX{} environment). As a
+% further optimisation, use \cs{let} rather than \cs{def} to avoid one
+% expansion step.
% \begin{macrocode}
-\cs_new:Npn \IfHookExistsTF { \hook_if_exist:nTF }
-\cs_new:Npn \IfHookEmptyTF { \hook_if_empty:nTF }
+\cs_new_eq:NN \IfHookExistsTF \hook_if_exist:nTF
+\cs_new_eq:NN \IfHookEmptyTF \hook_if_empty:nTF
% \end{macrocode}
% \end{macro}
%
More information about the latex3-commits
mailing list.