[latex3-commits] [git/LaTeX3-latex3-latex3] master: tweak tl_if_head_is_group:n to be optimized by prg_new_conditional (6c0d885e3)
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/6c0d885e32bf2e0bda49c4209c08c779769c1282
>---------------------------------------------------------------
commit 6c0d885e32bf2e0bda49c4209c08c779769c1282
Author: Jonathan Spratte <jspratte at yahoo.de>
Date: Sat Sep 19 15:22:32 2020 +0200
tweak tl_if_head_is_group:n to be optimized by prg_new_conditional
>---------------------------------------------------------------
6c0d885e32bf2e0bda49c4209c08c779769c1282
l3kernel/l3tl.dtx | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/l3kernel/l3tl.dtx b/l3kernel/l3tl.dtx
index 45fffc6ca..f8e2e8a40 100644
--- a/l3kernel/l3tl.dtx
+++ b/l3kernel/l3tl.dtx
@@ -3212,6 +3212,7 @@
% \end{macro}
%
% \begin{macro}[EXP,pTF]{\tl_if_head_is_group:n}
+% \begin{macro}[EXP]{\@@_if_head_is_group_fi_false:w}
% Pass the first token of |#1| through \cs{token_to_str:N}, then check
% for the brace balance. The extra \texttt{?} caters for an empty
% argument. This could be made faster, but we need all brace tricks
@@ -3224,13 +3225,18 @@
\exp_after:wN \use_none:n
\exp_after:wN { \exp_after:wN { \token_to_str:N #1 ? } }
\scan_stop: \scan_stop:
- \prg_return_false:
- \else:
+ \@@_if_head_is_group_fi_false:w
+ \fi:
+ \if_true:
\prg_return_true:
+ \else:
+ \prg_return_false:
\fi:
}
+\cs_new:Npn \@@_if_head_is_group_fi_false:w \fi: \if_true: { \fi: \if_false: }
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
% \begin{macro}[EXP,pTF]{\tl_if_head_is_space:n}
% \begin{macro}[EXP]{\@@_if_head_is_space:w}
More information about the latex3-commits
mailing list.