From 686f32d30a3f0f0b700170acdd8c6c3694ccfdb676cbd1496e8a8f881d812013 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Wed, 24 Dec 2025 14:42:58 +0300 Subject: [PATCH] No need in dict --- dsc | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/dsc b/dsc index 50186eb..779367c 100755 --- a/dsc +++ b/dsc @@ -58,16 +58,16 @@ if {[info exists env(DSC_SCHEMA)]} {set Schema $env(DSC_SCHEMA)} {set Schema sch if {[info exists env(DSC_STASH)]} {set Stash $env(DSC_STASH)} {set Stash stash} if {[info exists env(DSC_SAVED)]} {set Saved $env(DSC_SAVED)} {set Saved saved} if {[info exists env(DSC_HASHES)]} { - set Hashes [dict create] + set Hashes [list] foreach pair [split $env(DSC_HASHES) ,] { set cols [split $pair :] if {[llength $cols] != 2} { error "bad DSC_HASHES" } - dict set Hashes [lindex $cols 0] [lindex $cols 1] + lappend Hashes [lindex $cols 0] [lindex $cols 1] } } { - set Hashes [dict create sha2-512 sha512] + set Hashes [list sha2-512 sha512] } proc readents {root typ} { @@ -349,23 +349,21 @@ switch [lindex $argv 0] { file delete -force $Saved.bak } csum { - set hsh [dict create] - dict for {name cmd} $Hashes { + set hsh [list] + foreach {name cmd} $Hashes { lassign [pipe] r w set fh [open [list |$cmd >@$w] w] fconfigure $fh -translation binary - dict set hsh $name [list $fh $r $w] + lappend hsh $name $fh $r $w } fconfigure stdin -translation binary while {![eof stdin]} { set buf [read stdin $CopyBufLen] - dict for {_ fhs} $hsh { - lassign $fhs fh + foreach {_ $fh _ _} $hsh { puts -nonewline $fh $buf } } - foreach name [lsort [dict keys $hsh]] { - lassign [dict get $hsh $name] fh r w + foreach {name fh r w} $hsh { close $fh close $w gets $r v -- 2.52.0