[latex3-commits] [latex3/latex2e] develop: Only optimise cmds not envs (aaf648d1)
github at latex-project.org
github at latex-project.org
Fri Dec 1 13:13:27 CET 2023
Repository : https://github.com/latex3/latex2e
On branch : develop
Link : https://github.com/latex3/latex2e/commit/aaf648d19e3009b25137b0b9233185904b739e3c
>---------------------------------------------------------------
commit aaf648d19e3009b25137b0b9233185904b739e3c
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Tue Nov 28 13:41:25 2023 +0000
Only optimise cmds not envs
>---------------------------------------------------------------
aaf648d19e3009b25137b0b9233185904b739e3c
base/ltcmd.dtx | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/base/ltcmd.dtx b/base/ltcmd.dtx
index 1798230e..1b92e601 100644
--- a/base/ltcmd.dtx
+++ b/base/ltcmd.dtx
@@ -451,15 +451,20 @@
% {Optimise cmd creation for all-\texttt{m} arguments}
% At this stage we can check for a short-cut possibility: if the signature
% is just made up of \cs{@@_expandable_grab_m:w}, then we can produce an
-% optimised document command.
+% optimised document command. This only applies to document commands,
+% not creation of environments (which are more complex).
% \begin{macrocode}
\cs_new_protected:Npn \@@_declare_cmd_code:Nnn
{
- \str_if_eq:eeTF
- { \exp_not:V \l_@@_signature_tl }
+ \bool_lazy_and:nnTF
+ { ! \l_@@_environment_bool }
{
- \prg_replicate:nn \l_@@_current_arg_int
- { \exp_not:N \@@_expandable_grab_m:w }
+ \str_if_eq_p:ee
+ { \exp_not:V \l_@@_signature_tl }
+ {
+ \prg_replicate:nn \l_@@_current_arg_int
+ { \exp_not:N \@@_expandable_grab_m:w }
+ }
}
{ \@@_declare_cmd_optimised:Nnn }
{
More information about the latex3-commits
mailing list.