[latex3-commits] [git/LaTeX3-latex3-latex2e] gh1052: Simpler/faster \hook_if_empty:n (4c030ba3)

PhelypeOleinik phelype.oleinik at latex-project.org
Wed Apr 19 05:41:31 CEST 2023


Repository : https://github.com/latex3/latex2e
On branch  : gh1052
Link       : https://github.com/latex3/latex2e/commit/4c030ba39a6bfb2b8fbc3520bde991e1ac79a2b8

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

commit 4c030ba39a6bfb2b8fbc3520bde991e1ac79a2b8
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Wed Apr 19 00:41:31 2023 -0300

    Simpler/faster \hook_if_empty:n


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

4c030ba39a6bfb2b8fbc3520bde991e1ac79a2b8
 base/lthooks.dtx | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index 203fe775..da484d19 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -6784,19 +6784,17 @@
 %<latexrelease>                 {Hooks~with~args}
 \prg_new_conditional:Npnn \hook_if_empty:n #1 { p , T , F , TF }
   {
-    \@@_if_structure_exist:nTF {#1}
-      {
-        \bool_lazy_and:nnTF
-            { \prop_if_empty_p:c { g_@@_#1_code_prop } }
-            {
-              \bool_lazy_and_p:nn
-                { \@@_cs_if_empty_p:c { @@_toplevel~#1 } }
-                { \@@_cs_if_empty_p:c { @@_next~#1 } }
-            }
-          { \prg_return_true: }
-          { \prg_return_false: }
-      }
-      { \prg_return_true: }
+    \if:w
+        T
+        \prop_if_exist:cT { g_@@_#1_code_prop }
+          { \prop_if_empty:cF { g_@@_#1_code_prop } { F } }
+        \@@_cs_if_empty:cF { @@_toplevel~#1 } { F }
+        \@@_cs_if_empty:cF { @@_next~#1 } { F }
+        T
+      \prg_return_true:
+    \else:
+      \prg_return_false:
+    \fi:
   }
 %<latexrelease>\EndIncludeInRelease
 %    \end{macrocode}





More information about the latex3-commits mailing list.