0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 08:50:57 -05:00

Remove dead code with some cosmetic fixes on kdtree/core.js.

This commit is contained in:
Andrey Antukh 2016-06-07 17:18:20 +03:00
parent 8f55391167
commit a4013c283c
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

22
vendor/kdtree/core.js vendored
View file

@ -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){