[latex3-commits] [git/LaTeX3-latex3-latex3] l3bitset: use prg_replicate instead of int_step to fill up with 0 (0635491cf)

Ulrike Fischer fischer at troubleshooting-tex.de
Tue Dec 22 14:10:48 CET 2020


Repository : https://github.com/latex3/latex3
On branch  : l3bitset
Link       : https://github.com/latex3/latex3/commit/0635491cfab8c6a39851ac7174b837ae21e539f8

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

commit 0635491cfab8c6a39851ac7174b837ae21e539f8
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Tue Dec 22 14:10:48 2020 +0100

    use prg_replicate instead of int_step to fill up with 0


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

0635491cfab8c6a39851ac7174b837ae21e539f8
 l3kernel/l3bitset.dtx | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/l3kernel/l3bitset.dtx b/l3kernel/l3bitset.dtx
index 6617c6b3c..26c37f9ea 100644
--- a/l3kernel/l3bitset.dtx
+++ b/l3kernel/l3bitset.dtx
@@ -295,10 +295,8 @@
         \int_compare:nNnTF {\str_count:N #1 } < { #2  }
           {
             %extend the str
-            \int_step_inline:nn { #2 - \str_count:N #1 -1 }
-              {
-                \str_put_left:Nn #1 { 0 }
-              }
+            \exp_args:NNe
+            \str_put_left:Nn #1 { \prg_replicate:nn {  #2 - \str_count:N #1 -1 } {0} }
             \str_put_left:Nn #1 { 1 }
           }
           {
@@ -320,11 +318,9 @@
       {
         \int_compare:nNnTF {\str_count:N #1 } < { #2  }
           {
-            %extend the str
-            \int_step_inline:nn { #2 - \str_count:N #1 -1}
-              {
-                \str_gput_left:Nn #1 { 0 }
-              }
+          %  %extend the str
+            \exp_args:NNe
+            \str_gput_left:Nn #1 { \prg_replicate:nn {  #2 - \str_count:N #1 -1 } {0} }
             \str_gput_left:Nn #1 { 1 }
           }
           {





More information about the latex3-commits mailing list.