[81271] branches/gsoc11-rev-upgrade/base/src/macports1.0/macports.tcl
cal at macports.org
cal at macports.org
Thu Jul 28 08:24:35 PDT 2011
Revision: 81271
http://trac.macports.org/changeset/81271
Author: cal at macports.org
Date: 2011-07-28 08:24:35 -0700 (Thu, 28 Jul 2011)
Log Message:
-----------
rev-upgrade: Use lremove as described in lreplace(n) rather than concat()ing two lrange()d lists
Modified Paths:
--------------
branches/gsoc11-rev-upgrade/base/src/macports1.0/macports.tcl
Modified: branches/gsoc11-rev-upgrade/base/src/macports1.0/macports.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/macports1.0/macports.tcl 2011-07-28 14:36:18 UTC (rev 81270)
+++ branches/gsoc11-rev-upgrade/base/src/macports1.0/macports.tcl 2011-07-28 15:24:35 UTC (rev 81271)
@@ -3887,14 +3887,13 @@
# add it to topsorted list
lappend topsort_ports $port
# remove from unsorted list
- # TODO: use lremove(n)
- set index [lsearch $unsorted_ports $port]
- set unsorted_ports [concat [lrange $unsorted_ports 0 $index-1] [lrange $unsorted_ports $index+1 end]]
+ set index [lsearch -exact $unsorted_ports $port]
+ set unsorted_ports [lreplace $unsorted_ports $index $index]
# remove edges
foreach target $revadjlist($port) {
- set index [lsearch $adjlist($target) $port]
- set adjlist($target) [concat [lrange $adjlist($target) 0 $index-1] [lrange $adjlist($target) $index+1 end]]
+ set index [lsearch -exact $adjlist($target) $port]
+ set adjlist($target) [lreplace $adjlist($target) $index $index]
}
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110728/6f691a8b/attachment.html>
More information about the macports-changes
mailing list