@calcit/ternary-tree
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -311,36 +311,30 @@ import { TernaryTreeKind, hashGenerator } from "./types"; | ||
if (tree.left != null) { | ||
if (tree.left != null) { | ||
if (tree.left.kind === TernaryTreeKind.ternaryTreeLeaf) { | ||
if (tree.left.hash === hx) { | ||
return true; | ||
} | ||
if (tree.left.kind === TernaryTreeKind.ternaryTreeLeaf) { | ||
if (tree.left.hash === hx) { | ||
return contains(tree.left, item, hx); | ||
} | ||
else if (hx >= tree.left.minHash && hx <= tree.left.maxHash) { | ||
return contains(tree.left, item, hx); // TODO | ||
} | ||
} | ||
else if (hx >= tree.left.minHash && hx <= tree.left.maxHash) { | ||
return contains(tree.left, item, hx); | ||
} | ||
} | ||
if (tree.middle != null) { | ||
if (tree.middle != null) { | ||
if (tree.middle.kind === TernaryTreeKind.ternaryTreeLeaf) { | ||
if (tree.middle.hash === hx) { | ||
return true; | ||
} | ||
if (tree.middle.kind === TernaryTreeKind.ternaryTreeLeaf) { | ||
if (tree.middle.hash === hx) { | ||
return contains(tree.middle, item, hx); | ||
} | ||
else if (hx >= tree.middle.minHash && hx <= tree.middle.maxHash) { | ||
return contains(tree.middle, item, hx); // TODO | ||
} | ||
} | ||
else if (hx >= tree.middle.minHash && hx <= tree.middle.maxHash) { | ||
return contains(tree.middle, item, hx); | ||
} | ||
} | ||
if (tree.right != null) { | ||
if (tree.right != null) { | ||
if (tree.right.kind === TernaryTreeKind.ternaryTreeLeaf) { | ||
if (tree.right.hash === hx) { | ||
return true; | ||
} | ||
if (tree.right.kind === TernaryTreeKind.ternaryTreeLeaf) { | ||
if (tree.right.hash === hx) { | ||
return contains(tree.right, item, hx); | ||
} | ||
else if (hx >= tree.right.minHash && hx <= tree.right.maxHash) { | ||
return contains(tree.right, item, hx); // TODO | ||
} | ||
} | ||
else if (hx >= tree.right.minHash && hx <= tree.right.maxHash) { | ||
return contains(tree.right, item, hx); | ||
} | ||
} | ||
@@ -347,0 +341,0 @@ return false; |
{ | ||
"name": "@calcit/ternary-tree", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"main": "./lib/index.js", | ||
@@ -5,0 +5,0 @@ "devDependencies": { |
@@ -332,32 +332,26 @@ import { TernaryTreeMap, TernaryTreeKind, TernaryTreeMapTheLeaf, TernaryTreeMapTheBranch, RefInt, Hash, hashGenerator, TernaryTreeMapHashEntry } from "./types"; | ||
if (tree.left != null) { | ||
if (tree.left != null) { | ||
if (tree.left.kind === TernaryTreeKind.ternaryTreeLeaf) { | ||
if (tree.left.hash === hx) { | ||
return true; | ||
} | ||
} else if (hx >= tree.left.minHash && hx <= tree.left.maxHash) { | ||
return contains(tree.left, item, hx); // TODO | ||
if (tree.left.kind === TernaryTreeKind.ternaryTreeLeaf) { | ||
if (tree.left.hash === hx) { | ||
return contains(tree.left, item, hx); | ||
} | ||
} else if (hx >= tree.left.minHash && hx <= tree.left.maxHash) { | ||
return contains(tree.left, item, hx); | ||
} | ||
} | ||
if (tree.middle != null) { | ||
if (tree.middle != null) { | ||
if (tree.middle.kind === TernaryTreeKind.ternaryTreeLeaf) { | ||
if (tree.middle.hash === hx) { | ||
return true; | ||
} | ||
} else if (hx >= tree.middle.minHash && hx <= tree.middle.maxHash) { | ||
return contains(tree.middle, item, hx); // TODO | ||
if (tree.middle.kind === TernaryTreeKind.ternaryTreeLeaf) { | ||
if (tree.middle.hash === hx) { | ||
return contains(tree.middle, item, hx); | ||
} | ||
} else if (hx >= tree.middle.minHash && hx <= tree.middle.maxHash) { | ||
return contains(tree.middle, item, hx); | ||
} | ||
} | ||
if (tree.right != null) { | ||
if (tree.right != null) { | ||
if (tree.right.kind === TernaryTreeKind.ternaryTreeLeaf) { | ||
if (tree.right.hash === hx) { | ||
return true; | ||
} | ||
} else if (hx >= tree.right.minHash && hx <= tree.right.maxHash) { | ||
return contains(tree.right, item, hx); // TODO | ||
if (tree.right.kind === TernaryTreeKind.ternaryTreeLeaf) { | ||
if (tree.right.hash === hx) { | ||
return contains(tree.right, item, hx); | ||
} | ||
} else if (hx >= tree.right.minHash && hx <= tree.right.maxHash) { | ||
return contains(tree.right, item, hx); | ||
} | ||
@@ -364,0 +358,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
441604
8426