[latex3-commits] [git/LaTeX3-latex3-latex3] master: Speed up \::x for x-expansion (cde0887)

Bruno Le Floch bruno at le-floch.fr
Sun Apr 29 18:52:17 CEST 2018


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/cde0887a9b40f4a5cca8775e1845623655acc4df

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

commit cde0887a9b40f4a5cca8775e1845623655acc4df
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Sun Apr 29 12:52:17 2018 -0400

    Speed up \::x for x-expansion
    
    In some experiments that's about a 20% speed-up because we avoid re-reading
    tokens that were expanded


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

cde0887a9b40f4a5cca8775e1845623655acc4df
 l3kernel/l3expan.dtx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/l3kernel/l3expan.dtx b/l3kernel/l3expan.dtx
index 51a4e5f..55c5e37 100644
--- a/l3kernel/l3expan.dtx
+++ b/l3kernel/l3expan.dtx
@@ -982,11 +982,13 @@
 %
 % \begin{macro}{\::x}
 %   This function is used to expand an argument fully.
+%   We build in the expansion of \cs{@@_arg_next:nnn}.
 %    \begin{macrocode}
 \cs_new_protected:Npn \::x #1 \::: #2#3
   {
-    \cs_set_nopar:Npx \l_@@_internal_tl { {#3} }
-    \exp_after:wN \@@_arg_next:nnn \l_@@_internal_tl {#1} {#2}
+    \cs_set_nopar:Npx \l_@@_internal_tl
+      { \exp_not:n { #1 \::: } { \exp_not:n {#2} {#3} } }
+    \l_@@_internal_tl
   }
 %    \end{macrocode}
 % \end{macro}





More information about the latex3-commits mailing list