<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/b58e22dd050a5e9132ebaff1ea1f085f16dc9f8f">https://github.com/macports/macports-base/commit/b58e22dd050a5e9132ebaff1ea1f085f16dc9f8f</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit b58e22dd050a5e9132ebaff1ea1f085f16dc9f8f
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Fri Feb 23 14:16:02 2024 +1100

<span style='display:block; white-space:pre;color:#404040;'>    Use dict for tool_path_cache
</span>---
 src/macports1.0/macports.tcl | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/macports1.0/macports.tcl b/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 877cb2f4c..998a1dc09 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -83,6 +83,8 @@ namespace eval macports {
</span>     variable current_phase main
 
     variable ui_prefix "---> "
<span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    variable tool_path_cache [dict create]
</span> }
 
 ##
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -6006,10 +6008,10 @@ proc macports::get_compiler_version {compiler} {
</span> 
 # check availability and location of tool
 proc macports::get_tool_path {tool} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    global macports::tool_path_cache
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    variable tool_path_cache
</span> 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    if {[info exists tool_path_cache($tool)]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        return $tool_path_cache($tool)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    if {[dict exists $tool_path_cache $tool]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        return [dict get $tool_path_cache $tool]
</span>     }
 
     # first try /usr/bin since this doesn't move around
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -6021,7 +6023,7 @@ proc macports::get_tool_path {tool} {
</span>         }
     }
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    set tool_path_cache($tool) $toolpath
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    dict set tool_path_cache $tool $toolpath
</span>     return $toolpath
 }
 
</pre><pre style='margin:0'>

</pre>