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) {
261261 if (pos (mid ).x < pos (end ).x ) swap (mid , end );
262262 int pivot = pos (end ).x ;
263263 while (true ) {
264- while (pos (start ).x < pivot ) start ++;
264+ while (pos (start ).x <= pivot ) start ++;
265265 while (pos (end ).x > pivot ) end --;
266266 if (start >= end ) return new Pivot (pivot , end );
267267 swap (start , end );
@@ -293,7 +293,8 @@ private void swap(int a, int b) {
293293 }
294294
295295 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 ));
297298 Pivot pivot ;
298299 if (xDim ) {
299300 pivot = partitionX (start , end );
You can’t perform that action at this time.
0 commit comments