File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/main/java/org/bk/ass/query Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -261,7 +261,7 @@ private Pivot partitionX(int start, int end) {
261
261
if (pos (mid ).x < pos (end ).x ) swap (mid , end );
262
262
int pivot = pos (end ).x ;
263
263
while (true ) {
264
- while (pos (start ).x < pivot ) start ++;
264
+ while (pos (start ).x <= pivot ) start ++;
265
265
while (pos (end ).x > pivot ) end --;
266
266
if (start >= end ) return new Pivot (pivot , end );
267
267
swap (start , end );
@@ -293,7 +293,8 @@ private void swap(int a, int b) {
293
293
}
294
294
295
295
private Node makeTree (int start , int end , boolean xDim ) {
296
- if (end - start < 10 ) return new Node (Arrays .copyOfRange (data , start , end + 1 ));
296
+ // 15 elements seems to be the sweet spot for ~1000 positions
297
+ if (end - start < 15 ) return new Node (Arrays .copyOfRange (data , start , end + 1 ));
297
298
Pivot pivot ;
298
299
if (xDim ) {
299
300
pivot = partitionX (start , end );
You can’t perform that action at this time.
0 commit comments