hostlist: es6 fixes.

This commit is contained in:
Christopher Jeffrey 2017-07-05 09:32:34 -07:00
parent 5b62a87a21
commit 972d98e0db
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -668,11 +668,12 @@ HostList.prototype.remove = function remove(hostname) {
if (bucket.head === head) {
bucket.remove(entry);
this.totalUsed--;
head = null;
break;
}
}
// assert(i < this.used.length);
assert(!head);
} else {
for (let bucket of this.fresh) {
if (bucket.delete(entry.key()))
@ -966,7 +967,7 @@ HostList.prototype.getLocal = function getLocal(src) {
if (!src)
src = this.address;
if (this.local.length === 0)
if (this.local.size === 0)
return null;
for (let dest of this.local.values()) {