mirror of
https://github.com/penpot/penpot.git
synced 2025-01-25 07:58:49 -05:00
Remove dead code with some cosmetic fixes on kdtree/core.js.
This commit is contained in:
parent
8f55391167
commit
a4013c283c
1 changed files with 1 additions and 21 deletions
22
vendor/kdtree/core.js
vendored
22
vendor/kdtree/core.js
vendored
|
@ -15,7 +15,6 @@ goog.provide("kdtree.core");
|
||||||
goog.provide("kdtree.core.KDTree");
|
goog.provide("kdtree.core.KDTree");
|
||||||
|
|
||||||
goog.require("kdtree.heap");
|
goog.require("kdtree.heap");
|
||||||
goog.require("goog.array");
|
|
||||||
goog.require("goog.asserts");
|
goog.require("goog.asserts");
|
||||||
|
|
||||||
goog.scope(function() {
|
goog.scope(function() {
|
||||||
|
@ -23,7 +22,6 @@ goog.scope(function() {
|
||||||
|
|
||||||
const assert = goog.asserts.assert;
|
const assert = goog.asserts.assert;
|
||||||
const assertNumber = goog.asserts.assertNumber;
|
const assertNumber = goog.asserts.assertNumber;
|
||||||
const every = goog.array.every;
|
|
||||||
|
|
||||||
class Node {
|
class Node {
|
||||||
constructor(obj, dimension, parent) {
|
constructor(obj, dimension, parent) {
|
||||||
|
@ -252,7 +250,7 @@ goog.scope(function() {
|
||||||
nearestSearch(otherChild);
|
nearestSearch(otherChild);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
if(this.root) {
|
if(this.root) {
|
||||||
nearestSearch(this.root);
|
nearestSearch(this.root);
|
||||||
|
@ -266,24 +264,6 @@ goog.scope(function() {
|
||||||
|
|
||||||
return result;
|
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){
|
function distance2d(a, b){
|
||||||
|
|
Loading…
Add table
Reference in a new issue