[latex3-commits] [git/LaTeX3-latex3-latex2e] hook-args: Simplify logic (a7d8cfc0)

PhelypeOleinik phelype.oleinik at latex-project.org
Thu Mar 30 02:42:11 CEST 2023


Repository : https://github.com/latex3/latex2e
On branch  : hook-args
Link       : https://github.com/latex3/latex2e/commit/a7d8cfc0d47231046b82c8269fc529e0e8f87f91

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

commit a7d8cfc0d47231046b82c8269fc529e0e8f87f91
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Wed Mar 29 21:42:11 2023 -0300

    Simplify logic


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

a7d8cfc0d47231046b82c8269fc529e0e8f87f91
 base/lthooks.dtx | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index 1e2e368f..d6cdc1d9 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -3646,9 +3646,8 @@
   {
     \@@_if_replacing_args:TF
       {
-        \tl_if_exist:cTF { c_@@_#1_parameter_tl }
+        \@@_if_declared:nT {#1}
           { \tl_if_empty:cT { c_@@_#1_parameter_tl } { \use_ii:nn } }
-          { \@@_if_declared:nT {#1} { \use_ii:nn } }
         \use_none:n
           {
             \msg_error:nnnn { hooks } { without-args } {#1} {#2}
@@ -4268,24 +4267,13 @@
 %   which is chosen here depending if
 %   \cs[no-index]{c_@@_\meta{hook}_parameter_tl} exists, if the hook is
 %   declared, and if it's a generic hook.
-%   \pho{This logic could likely be sinplified:  the parameter tl seems
-%     to exist or not along with the declared tl, meaning that one of
-%     the tests can likely be dropped.}
 %    \begin{macrocode}
     \@@_code_gset_auxi:veen
       {
         c_@@_
-        \tl_if_exist:cTF { c_@@_#2_parameter_tl }
-            { #2_parameter }
-            {
-              \@@_if_declared:nTF {#2}
-                { #2_parameter }
-                {
-                  \@@_if_generic:nTF {#2}
-                    { empty }
-                    { nine_parameters }
-                }
-            }
+        \@@_if_declared:nTF {#2}
+          { #2_parameter }
+          { \@@_if_generic:nTF {#2} { empty } { nine_parameters } }
         _tl
       }
 %    \end{macrocode}





More information about the latex3-commits mailing list.