From a4013c283c774e37cb99c532ae95b2a941589c07 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 7 Jun 2016 17:18:20 +0300 Subject: [PATCH] Remove dead code with some cosmetic fixes on kdtree/core.js. --- vendor/kdtree/core.js | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/vendor/kdtree/core.js b/vendor/kdtree/core.js index db7549350..76a167e0f 100644 --- a/vendor/kdtree/core.js +++ b/vendor/kdtree/core.js @@ -15,7 +15,6 @@ goog.provide("kdtree.core"); goog.provide("kdtree.core.KDTree"); goog.require("kdtree.heap"); -goog.require("goog.array"); goog.require("goog.asserts"); goog.scope(function() { @@ -23,7 +22,6 @@ goog.scope(function() { const assert = goog.asserts.assert; const assertNumber = goog.asserts.assertNumber; - const every = goog.array.every; class Node { constructor(obj, dimension, parent) { @@ -252,7 +250,7 @@ goog.scope(function() { nearestSearch(otherChild); } } - } + }; if(this.root) { nearestSearch(this.root); @@ -266,24 +264,6 @@ goog.scope(function() { return result; } - - balanceFactor() { - function height(node) { - if (node === null) { - return 0; - } - return Math.max(height(node.left), height(node.right)) + 1; - } - - function count(node) { - if (node === null) { - return 0; - } - return count(node.left) + count(node.right) + 1; - } - - return height(this.root) / (Math.log(count(this.root)) / Math.log(2)); - } } function distance2d(a, b){