Remove lpush

It's just a trivial alias for lappend.
This commit is contained in:
Joshua Root
2026-04-25 02:30:29 +10:00
parent 92a1557742
commit 881dd4baef
3 changed files with 2 additions and 28 deletions
-9
View File
@@ -140,15 +140,6 @@ proc ldindex {varName args} {
return $item
}
# lpush varName ?value ...?
# Appends list elements onto a variable
# If varName does not exist then it is created
# really just an alias for lappend
proc lpush {varName args} {
upvar 1 $varName var
lappend var {*}$args
}
# lunshift varName ?value ...?
# Prepends list elements onto a variable
-17
View File
@@ -80,23 +80,6 @@ test ldindex {
} -result "ldindex successful."
test lpush {
Lpush unit test.
} -body {
set list {0 1}
if {[lpush list 2] != {0 1 2}} {
return "FAIL: element not appended"
}
if {[lpush list 3 4] != {0 1 2 3 4}} {
return "FAIL: multiple elements not appended"
}
if {[lpush list1 0] != 0} {
return "FAIL: list not created"
}
return "lpop successful."
} -result "lpop successful."
test lunshift {
Lunshift unit test.
} -body {
+2 -2
View File
@@ -385,7 +385,7 @@ proc portdestroot::destroot_finish {args} {
}
} elseif {[string equal -length [expr {[string length $dfile] + 1}] $dfile/ $prefix]} {
# we've found a subpath of our prefix
lpush pathsToCheck $dfile
lappend pathsToCheck $dfile
} else {
set dir_allowed no
# these files are (at least potentially) outside of the prefix
@@ -397,7 +397,7 @@ proc portdestroot::destroot_finish {args} {
}
}
if {$dir_allowed} {
lpush pathsToCheck $dfile
lappend pathsToCheck $dfile
} else {
# not a prefix of an allowed path, so it's either the path itself or a violation
switch -- $dfile \