[latex3-commits] [latex3/latex2e] gh1189: Only optimise cmds not envs (2140dec7)
github at latex-project.org
github at latex-project.org
Tue Nov 28 14:51:53 CET 2023
Repository : https://github.com/latex3/latex2e
On branch : gh1189
Link : https://github.com/latex3/latex2e/commit/2140dec71443084aaa3b909ab80724bc62b3b888
>---------------------------------------------------------------
commit 2140dec71443084aaa3b909ab80724bc62b3b888
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Tue Nov 28 13:41:25 2023 +0000
Only optimise cmds not envs
>---------------------------------------------------------------
2140dec71443084aaa3b909ab80724bc62b3b888
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.