File tree Expand file tree Collapse file tree 1 file changed +1
-4
lines changed
Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Original file line number Diff line number Diff line change @@ -171,13 +171,12 @@ export default class Flatbush {
171171 }
172172
173173 let nodeIndex = this . _boxes . length - 4 ;
174- let level = this . _levelBounds . length - 1 ;
175174 const queue = [ ] ;
176175 const results = [ ] ;
177176
178177 while ( nodeIndex !== undefined ) {
179178 // find the end index of the node
180- const end = Math . min ( nodeIndex + this . nodeSize * 4 , this . _levelBounds [ level ] ) ;
179+ const end = Math . min ( nodeIndex + this . nodeSize * 4 , upperBound ( nodeIndex , this . _levelBounds ) ) ;
181180
182181 // search through child nodes
183182 for ( let pos = nodeIndex ; pos < end ; pos += 4 ) {
@@ -196,11 +195,9 @@ export default class Flatbush {
196195
197196 } else {
198197 queue . push ( index ) ; // node; add it to the search queue
199- queue . push ( level - 1 ) ;
200198 }
201199 }
202200
203- level = queue . pop ( ) ;
204201 nodeIndex = queue . pop ( ) ;
205202 }
206203
You can’t perform that action at this time.
0 commit comments