[latex3-commits] [git/LaTeX3-latex3-latex3] master: slightly faster tl_if_blank:n (7dafde53b)

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/7dafde53ba33de44800db0b3570728176a6c1fab

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

commit 7dafde53ba33de44800db0b3570728176a6c1fab
Author: Jonathan Spratte <jspratte at yahoo.de>
Date:   Sat Aug 8 19:46:16 2020 +0200

    slightly faster tl_if_blank:n


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

7dafde53ba33de44800db0b3570728176a6c1fab
 l3kernel/l3tl.dtx | 47 ++++++++++++++++++++++++-----------------------
 1 file changed, 24 insertions(+), 23 deletions(-)

diff --git a/l3kernel/l3tl.dtx b/l3kernel/l3tl.dtx
index 48bbc7fe9..57f12e300 100644
--- a/l3kernel/l3tl.dtx
+++ b/l3kernel/l3tl.dtx
@@ -2027,29 +2027,6 @@
 %
 % \subsection{Token list conditionals}
 %
-% \begin{macro}[pTF]{\tl_if_blank:n, \tl_if_blank:V, \tl_if_blank:o}
-% \begin{macro}{\@@_if_blank_p:NNw}
-%   \TeX{} skips spaces when reading a non-delimited arguments. Thus,
-%   a \meta{token list} is blank if and only if \cs{use_none:n}
-%   \meta{token list} |?| is empty after one expansion.  The auxiliary
-%   \cs{@@_if_empty_if:o} is a fast emptyness test, converting its
-%   argument to a string (after one expansion) and using the test
-%   \cs{if_meaning:w} \cs{q_@@_nil} |...| \cs{q_@@_nil}.
-%    \begin{macrocode}
-\prg_new_conditional:Npnn \tl_if_blank:n #1 { p , T , F , TF }
-  {
-    \@@_if_empty_if:o { \use_none:n #1 ? }
-      \prg_return_true:
-    \else:
-      \prg_return_false:
-    \fi:
-  }
-\prg_generate_conditional_variant:Nnn \tl_if_blank:n
-  { e , V , o } { p , T , F , TF }
-%    \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
 % \begin{macro}[pTF]{\tl_if_empty:N, \tl_if_empty:c}
 %    These functions check whether the token list in the argument is
 %    empty and execute the proper code from their argument(s).
@@ -2126,6 +2103,30 @@
 % \end{macro}
 % \end{macro}
 %
+% \begin{macro}[pTF]{\tl_if_blank:n, \tl_if_blank:V, \tl_if_blank:o}
+% \begin{macro}{\@@_if_blank_p:NNw}
+%   \TeX{} skips spaces when reading a non-delimited arguments. Thus,
+%   a \meta{token list} is blank if and only if \cs{use_none:n}
+%   \meta{token list} |?| is empty after one expansion.  The auxiliary
+%   \cs{@@_if_empty_if:o} is a fast emptyness test, converting its
+%   argument to a string (after one expansion) and using the test
+%   \cs{if:w} \cs{scan_stop:} |...| \cs{scan_stop:}.
+%    \begin{macrocode}
+\exp_args:Nno \use:n
+  { \prg_new_conditional:Npnn \tl_if_blank:n #1 { p , T , F , TF } }
+  {
+    \@@_if_empty_if:o { \use_none:n #1 ? }
+      \prg_return_true:
+    \else:
+      \prg_return_false:
+    \fi:
+  }
+\prg_generate_conditional_variant:Nnn \tl_if_blank:n
+  { e , V , o } { p , T , F , TF }
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
 % \begin{macro}[pTF]{\tl_if_eq:NN, \tl_if_eq:Nc, \tl_if_eq:cN, \tl_if_eq:cc}
 %   Returns \cs{c_true_bool} if and only if the two token list variables are
 %   equal.





More information about the latex3-commits mailing list.