[latex3-commits] [git/LaTeX3-latex3-latex3] master: Skip a micro-optimization in tl-act based functions (e214ce945)
Bruno Le Floch
blflatex at gmail.com
Tue Oct 27 09:30:11 CET 2020
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/e214ce9459caf6c4b409e3e9e8bf80aeb08260db
>---------------------------------------------------------------
commit e214ce9459caf6c4b409e3e9e8bf80aeb08260db
Author: Bruno Le Floch <blflatex at gmail.com>
Date: Tue Oct 27 09:30:11 2020 +0100
Skip a micro-optimization in tl-act based functions
The usual approach \exp_args:Nno \use:n {...} {code} was used to expand
a particular auxiliary inside the definition, to gain one step of expansion
at run time. However, in these cases it requires several \exp_after:wN,
quite ugly, and it doesn't gain much compared to the rather heavy code that
\@@_act:NNNnn has to do anyways.
>---------------------------------------------------------------
e214ce9459caf6c4b409e3e9e8bf80aeb08260db
l3kernel/l3tl.dtx | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/l3kernel/l3tl.dtx b/l3kernel/l3tl.dtx
index 57daeed07..62bebed7e 100644
--- a/l3kernel/l3tl.dtx
+++ b/l3kernel/l3tl.dtx
@@ -3252,10 +3252,10 @@
% avoids losing outer braces. The result is stored as an argument for the
% dummy function \cs{@@_act_result:n}.
% \begin{macrocode}
-\exp_args:Nno \use:n { \cs_new:Npn \@@_act:NNNnn #1#2#3#4#5 }
+\cs_new:Npn \@@_act:NNNnn #1#2#3#4#5
{
- \exp_after:wN \group_align_safe_begin:
- \@@_act_loop:w #5 {\s_@@_act_stop} ? \s_@@_act_stop
+ \group_align_safe_begin:
+ \@@_act_loop:w #5 { \s_@@_act_stop } ? \s_@@_act_stop
{#4} #1 #3 #2
\@@_act_result:n { }
}
@@ -3291,11 +3291,11 @@
% this is needed by \cs{@@_act:NNNnn} when changing case (to record
% which direction the change is in), but not when reversing the tokens.
% \begin{macrocode}
-\exp_args:Nno \use:n { \cs_new:Npn \tl_reverse:n #1 }
+\cs_new:Npn \tl_reverse:n #1
{
- \exp_after:wN \__kernel_exp_not:w \exp_after:wN \exp_after:wN \exp_after:wN
+ \__kernel_exp_not:w \exp_after:wN
{
- \exp_after:wN \exp:w
+ \exp:w
\@@_act:NNNnn
\@@_reverse_normal:nN
\@@_reverse_group_preserve:nn
More information about the latex3-commits
mailing list.