[latex3-commits] [git/LaTeX3-latex3-latex2e] hotfix/gh441: Check for 'top-level' earlier (4994f518)

PhelypeOleinik phelype.oleinik at latex-project.org
Mon Dec 14 03:18:30 CET 2020


Repository : https://github.com/latex3/latex2e
On branch  : hotfix/gh441
Link       : https://github.com/latex3/latex2e/commit/4994f51857d904e9ad490a25565473f907be9581

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

commit 4994f51857d904e9ad490a25565473f907be9581
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Sun Dec 13 23:18:30 2020 -0300

    Check for 'top-level' earlier


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

4994f51857d904e9ad490a25565473f907be9581
 base/lthooks.dtx | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index 708eb6ce..0726a0aa 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -2479,14 +2479,20 @@
           }
           {
 %    \end{macrocode}
-%    Check if the label being removed exists in the code pool.  If it does,
-%    just call \cs{@@_gremove_code_do:nn} to do the removal, otherwise mark it
-%    to be removed.
-%    \begin{macrocode}
-            \prop_get:cnNTF { g_@@_#1_code_prop } {#2} \l_@@_return_tl
-              { \@@_gremove_code_do:nn }
-              { \@@_mark_removal:nn }
-                  {#1} {#2}
+%    If the label is |top-level| then clear the token list, as all code
+%    there is under the same label.
+%    Otherwise check if the label being removed exists in the code pool.
+%    If it does, just call \cs{@@_gremove_code_do:nn} to do the removal,
+%    otherwise mark it to be removed.
+%    \begin{macrocode}
+            \str_if_eq:nnTF {#2} { top-level }
+              { \tl_gclear:c { @@_toplevel~#1 } }
+              {
+                \prop_get:cnNTF { g_@@_#1_code_prop } {#2} \l_@@_return_tl
+                  { \@@_gremove_code_do:nn }
+                  { \@@_mark_removal:nn }
+                      {#1} {#2}
+              }
           }
         \debug_resume:
 %    \end{macrocode}
@@ -2506,15 +2512,10 @@
 %    \end{macrocode}
 %
 % \begin{macro}{\@@_gremove_code_do:nn}
-%   Remove code for a given label.  If the label is |top-level| then
-%   clear the token list, as all code there is under the same label.
+%   Remove code for a given label.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_gremove_code_do:nn #1 #2
-  {
-    \str_if_eq:nnTF {#2} { top-level }
-      { \tl_gclear:c { @@_toplevel~#1 } }
-      { \prop_gremove:cn { g_@@_#1_code_prop } {#2} }
-  }
+  { \prop_gremove:cn { g_@@_#1_code_prop } {#2} }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}





More information about the latex3-commits mailing list.