<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/a33ec0f9546e3fbb10227a2654a18d0fb5f0cc9e">https://github.com/macports/macports-base/commit/a33ec0f9546e3fbb10227a2654a18d0fb5f0cc9e</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit a33ec0f9546e3fbb10227a2654a18d0fb5f0cc9e
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Sun Feb 11 23:42:12 2024 +1100
<span style='display:block; white-space:pre;color:#404040;'> Do option processing in-place
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> And other small list optimisations
</span>---
src/port1.0/portutil.tcl | 29 ++++++++++-------------------
1 file changed, 10 insertions(+), 19 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/portutil.tcl b/src/port1.0/portutil.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 388672603..68fcd79bf 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/portutil.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/portutil.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -102,11 +102,7 @@ proc handle_option-append {option args} {
</span> global $option user_options
if {![info exists user_options($option)]} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[info exists $option]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set $option [concat [set $option] $args]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set $option $args
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend $option {*}$args
</span> }
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -136,11 +132,9 @@ proc handle_option-delete {option args} {
</span> global $option user_options
if {![info exists user_options($option)] && [info exists $option]} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set temp [set $option]
</span> foreach val $args {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set temp [ldelete $temp $val]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set $option [ldelete [set $option][set $option {}] $val]
</span> }
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set $option $temp
</span> }
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -153,11 +147,9 @@ proc handle_option-strsed {option args} {
</span> global $option user_options
if {![info exists user_options($option)] && [info exists $option]} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set temp [set $option]
</span> foreach val $args {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set temp [strsed $temp $val]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set $option [strsed [set $option][set $option {}] $val]
</span> }
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set $option $temp
</span> }
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -172,10 +164,9 @@ proc handle_option-replace {option args} {
</span> if {![info exists user_options($option)] && [info exists $option]} {
foreach {old new} $args {
set index [lsearch -exact [set $option] $old]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$index == -1} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- continue
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$index != -1} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lset $option $index $new
</span> }
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set $option [lreplace [set $option] $index $index $new]
</span> }
}
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -700,7 +691,7 @@ proc variant_remove_ditem {name} {
</span> foreach variant_item $all_variants {
set item_provides [ditem_key $variant_item provides]
if {$item_provides eq $name} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set all_variants [lreplace $all_variants $item_index $item_index]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set all_variants [lreplace ${all_variants}[set all_variants {}] $item_index $item_index]
</span> break
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1004,7 +995,7 @@ proc tbool {key} {
</span> proc ldelete {list value} {
set ix [lsearch -exact $list $value]
if {$ix >= 0} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- return [lreplace $list $ix $ix]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return [lreplace ${list}[set ilist {}] $ix $ix]
</span> }
return $list
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1270,7 +1261,7 @@ proc move {args} {
</span> set options [list]
while {[string match "-*" [lindex $args 0]]} {
set arg [string range [lindex $args 0] 1 end]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set args [lreplace $args 0 0]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set args [lreplace ${args}[set args {}] 0 0]
</span> switch -- $arg {
force {lappend options -$arg}
- break
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1304,9 +1295,9 @@ proc ln {args} {
</span> if {[string length $arg] > 1} {
set remainder -[string range $arg 1 end]
set arg [string range $arg 0 0]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set args [lreplace $args 0 0 $remainder]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lset args 0 $remainder
</span> } else {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set args [lreplace $args 0 0]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set args [lreplace ${args}[set args {}] 0 0]
</span> }
switch -- $arg {
f -
</pre><pre style='margin:0'>
</pre>