Changeset 660

Show
Ignore:
Timestamp:
2007-12-04 01:49:46 (1 year ago)
Author:
MaierMan
Message:

fixing off-by-one error (mostly left from the previous implementation)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/serverswitcher/chrome/content/manager.js

    r659 r660  
    114114                                                cset[host] = new SSWItem(host); 
    115115                                        } 
    116                                         else { 
    117                                                 ++cset[host].n; 
    118                                         } 
     116                                        ++cset[host].n; 
    119117                                }, 
    120118                                this 
     
    126124                                } 
    127125                                let host = d._ssw_host; 
    128                                 if (host in cset) { 
    129                                         cset[host].downloads.push(d); 
    130                                 } 
    131                                 else { 
     126                                if (!(host in cset)) { 
    132127                                        cset[host] = new SSWItem(host); 
    133128                                } 
     129                                cset[host].downloads.push(d); 
    134130                        } 
    135                          
    136131                        for (d in SSW._generator(cset)) { 
    137132                                if (this._running.length >= Prefs.maxInProgress) { 
     
    141136                                this.run(d); 
    142137                        } 
    143                          
    144138                        return rv; 
    145139                } catch(ex){ 
     
    175169function SSWItem(host) { 
    176170        this.host = host; 
    177         this.n = 1
     171        this.n = 0
    178172        this.downloads = []; 
    179173}; 
     
    188182        function() { 
    189183                if (!('_ssw_real_host' in this)) { 
    190                         this._ssw_real_host = _ssw_getHost(IOService.newURI(this.urlManager.url, null, null).host); 
     184                        this._ssw_real_host = SSW.getHost(IOService.newURI(this.urlManager.url, null, null).host); 
    191185                } 
    192186                return this._ssw_real_host;