[latex3-commits] [git/LaTeX3-latex3-latex3] master: even faster tl_if_head_is_space:n (b82b0c596)

Bruno Le Floch blflatex at gmail.com
Tue Oct 27 09:11:58 CET 2020


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

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

commit b82b0c5967671b2c9dc3e6a6d3bb243babf686a0
Author: Jonathan Spratte <jspratte at yahoo.de>
Date:   Tue Aug 11 00:05:26 2020 +0200

    even faster tl_if_head_is_space:n


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

b82b0c5967671b2c9dc3e6a6d3bb243babf686a0
 l3kernel/l3tl.dtx | 25 ++++++++++---------------
 1 file changed, 10 insertions(+), 15 deletions(-)

diff --git a/l3kernel/l3tl.dtx b/l3kernel/l3tl.dtx
index b723f35d8..41fbf6333 100644
--- a/l3kernel/l3tl.dtx
+++ b/l3kernel/l3tl.dtx
@@ -3229,23 +3229,18 @@
 %    \begin{macrocode}
 \prg_new_conditional:Npnn \tl_if_head_is_space:n #1 { p , T , F , TF }
   {
-    \exp:w \if_false: { \fi:
-      \@@_if_head_is_space:w \prg_do_nothing: #1 ? ~ }
-  }
-\cs_new:Npn \@@_if_head_is_space:w #1 ~
-  {
-    \tl_if_empty:oTF { #1 }
-      { \exp_after:wN \@@_if_head_is_space_true:n }
-      { \exp_after:wN \@@_if_head_is_space_false:n }
-    \exp_after:wN { \if_false: } \fi:
-  }
-\cs_new:Npn \@@_if_head_is_space_true:n #1
-  {
-    \exp_end: \prg_return_true:
+    \if:w
+        \if_false: { \fi: \__tl_if_head_is_space:w \prg_do_nothing: #1 ? ~ }
+        \scan_stop: \scan_stop:
+      \prg_return_true:
+    \else:
+      \prg_return_false:
+    \fi:
   }
-\cs_new:Npn \@@_if_head_is_space_false:n #1
+\cs_new:Npn \__tl_if_head_is_space:w #1 ~
   {
-    \exp_end: \prg_return_false:
+    \tl_if_empty:oF {#1} { f }
+    \exp_after:wN \use_none:n \exp_after:wN { \if_false: } \fi:
   }
 %    \end{macrocode}
 % \end{macro}





More information about the latex3-commits mailing list.