silflow/quadtree-javascript — pull request #1 by fonsinchen (2012-05-01 20:51:05+00:00)
Title: retrieve objects from all overlapping nodes, not just the upper left

retrieve() currently doesn't respect width and height of the given object and just retrieves objects from the area the upper right corner of the given object is in. I've changed that.

Additionally I've eliminated the concatenation of results of retrieve() by calling a callback function for each result instead. As you'll most likely call a function on each result anyway and newer browsers are good at inlining function calls this should be faster. (I've done some silly tests: http://jsperf.com/cbvsconc - it seems Firefox 3.5 isn't good at inlining, but Chrome 6 is ...).