From cfca480725ffd51a03f27768b4025d75f8eae63b Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 6 Jan 2021 00:54:24 -0500 Subject: [PATCH] Fixes bad has implementation --- src/system/searchTree.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/system/searchTree.ts b/src/system/searchTree.ts index cd5a042..3cf34a3 100644 --- a/src/system/searchTree.ts +++ b/src/system/searchTree.ts @@ -200,7 +200,8 @@ export class TernarySearchTree { } has(key: K): boolean { - return Boolean(this._getNode(key)); + const node = this._getNode(key); + return !(node?.value === undefined && node?.mid === undefined); } delete(key: K): void {