Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

holy-quad-tree

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

holy-quad-tree - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

bench.js

2

package.json
{
"name": "holy-quad-tree",
"version": "1.0.0",
"version": "1.1.0",
"description": "Optimized QuadTree made by Sopur",

@@ -5,0 +5,0 @@ "main": "src/node-js.js",

@@ -20,3 +20,3 @@ # Sopur's QuadTree library

```js
const QuadTree = require("holy-quadtree");
const QuadTree = require("holy-quad-tree");
const qt = new QuadTree.QuadTree(

@@ -23,0 +23,0 @@ new QuadTree.Bound(100, 100), // Width, height

@@ -56,3 +56,2 @@ /**

this.objects = [];
this.objectReferences = [];
this.nodes = [];

@@ -207,9 +206,2 @@ }

if (index !== -1) {
if (
this.nodes[index].x > object.x + object.width ||
this.nodes[index].x < object.x - object.width ||
this.nodes[index].y > object.y + object.height ||
this.nodes[index].y < object.y - object.height
)
return [];
returnObjects = returnObjects.concat(this.nodes[index].retrieve(object));

@@ -220,9 +212,2 @@

for (let i = 0; i < this.nodes.length; i++) {
if (
this.nodes[i].x > object.x + object.width ||
this.nodes[i].x < object.x - object.width ||
this.nodes[i].y > object.y + object.height ||
this.nodes[i].y < object.y - object.height
)
return [];
returnObjects = returnObjects.concat(this.nodes[i].retrieve(object));

@@ -239,3 +224,3 @@ }

* @param {Node} object The object that was inserted
* @return {Node} The subnode, or false if it wasn't found
* @return {QuadTree} The subnode, or false if it wasn't found
* @private

@@ -242,0 +227,0 @@ */

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc