Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/core/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class TstNode {
/**
* @param {string} key
* @param {any} value
* @returns {void}
*/
add (key, value) {
const length = key.length
Expand Down Expand Up @@ -91,7 +92,7 @@ class TstNode {
const keylength = key.length
let index = 0
/**
* @type {TstNode}
* @type {TstNode|null}
*/
let node = this
while (node !== null && index < keylength) {
Expand Down Expand Up @@ -127,6 +128,7 @@ class TernarySearchTree {
/**
* @param {string} key
* @param {any} value
* @returns {void}
* */
insert (key, value) {
if (this.node === null) {
Expand All @@ -138,7 +140,7 @@ class TernarySearchTree {

/**
* @param {Uint8Array} key
* @return {any}
* @returns {any}
*/
lookup (key) {
return this.node?.search(key)?.value ?? null
Expand Down
Loading