Changeset 809
- Timestamp:
- 2008-02-29 21:20:04 (10 months ago)
- Files:
-
- sandbox/serverswitcher/chrome/content/manager.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/serverswitcher/chrome/content/manager.js
r808 r809 98 98 } 99 99 100 let cset = {}; 101 // Count the running task 102 Dialog._running.forEach( 103 function(i) { 104 let host = i.d._ssw_host; 105 if (!(host in cset)) { 106 cset[host] = new SSWItem(host); 107 } 108 else { 109 cset[host].inc(); 110 } 111 }, 112 this 113 ); 114 for (d in SSW._generator(cset)) { 100 for (d in SSW._generator()) { 115 101 if (this._running.length >= Prefs.maxInProgress) { 116 102 break; … … 126 112 return false; 127 113 }, 128 _generator: function(downloadSet) { 114 _generator: function() { 115 let downloadSet = {}; 116 117 // Count the running tasks 118 Dialog._running.forEach( 119 function(i) { 120 let host = i.d._ssw_host; 121 if (!(host in downloadSet)) { 122 downloadSet[host] = new SSWItem(host); 123 } 124 else { 125 downloadSet[host].inc(); 126 } 127 }, 128 this 129 ); 130 129 131 for (let d in Tree.all) { 130 132 if (!d.is(QUEUED)) { … … 150 152 } 151 153 while (sorted.length) { 154 155 // short-circut 156 if (sorted.length == 1) { 157 let s = sorted.shift(); 158 while (s.available) { 159 yield s.pop(); 160 } 161 return; 162 } 163 152 164 sorted.sort(SSWItem.prototype.cmp); 153 165 for (i in sorted) {
