From 972d98e0db1acbea52f58cddc4bfc90a7942a481 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Wed, 5 Jul 2017 09:32:34 -0700 Subject: [PATCH] hostlist: es6 fixes. --- lib/net/hostlist.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/net/hostlist.js b/lib/net/hostlist.js index 329f6ff4..71293708 100644 --- a/lib/net/hostlist.js +++ b/lib/net/hostlist.js @@ -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()) {