From ba83c21354a022ce771b28af5ac65b2da4509b43 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sun, 22 Aug 2021 13:06:05 -0400 Subject: [PATCH] Fix trie instance iterator --- src/js/hntrie.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/js/hntrie.js b/src/js/hntrie.js index 14a921373..955de2a1a 100644 --- a/src/js/hntrie.js +++ b/src/js/hntrie.js @@ -732,11 +732,7 @@ HNTrieContainer.prototype.HNTrieRef = class { i0 += 1; } this.icell = this.container.buf32[this.icell+1]; - if ( this.icell === 0 ) { - return this.toHostname(); - } - if ( this.container.buf32[this.icell+2] === 0 ) { - this.icell = this.container.buf32[this.icell+1]; + if ( (v & 0x80) !== 0 ) { return this.toHostname(); } } @@ -748,7 +744,7 @@ HNTrieContainer.prototype.HNTrieRef = class { return this; }, container: this.container, - icell: this.iroot, + icell: this.container.buf32[this.iroot], charBuf: new Uint8Array(256), charPtr: 256, forks: [],