]> Cypherpunks repositories - keks.git/commitdiff
Slightly reduced code
authorSergey Matveev <stargrave@stargrave.org>
Wed, 13 Nov 2024 11:07:03 +0000 (14:07 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Wed, 13 Nov 2024 11:07:03 +0000 (14:07 +0300)
tyac/tyac.tcl

index 311e46c48cd78c52c6b53ced31036e0894bfd38fa23b488d95c69a9a4b3c523b..189c3b0ad2704aef57e471d830c521754f969fb34ebbc8454454aaa1ee090e81 100644 (file)
@@ -42,12 +42,10 @@ proc toBEbin {l v} {
         set b [expr {($l - $i - 1) * 8}]
         lappend a [binary format c [expr {($v & (0xFF << $b)) >> $b}]]
     }
-    return $a
+    return [join $a ""]
 }
 
-proc toBE {l v} {
-    foreach c [toBEbin $l $v] { add $c }
-}
+proc toBE {l v} { add [toBEbin $l $v] }
 
 proc INT {v} {
     if {$v >= 0} {
@@ -65,7 +63,7 @@ proc INT {v} {
         if {$v < [expr {1 << (($l+1)*8)}]} { break }
         incr l
     }
-    BIN [join [toBEbin [expr {$l + 1}] $v] ""]
+    BIN [toBEbin [expr {$l + 1}] $v]
 }
 
 proc _str {atom v} {