Skip to content

Added a clustering comments for the tests with empty path #969

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Sep 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ public static int[] runDefaultQuickSort(int value) {
}

// implementation from Arrays.sort. All static constants inlined, because we don't support them for now
static void sort(int[] a, int left, int right,
public static void sort(int[] a, int left, int right,
int[] work, int workBase, int workLen) {
// Use Quicksort on small arrays
if (right - left < 286) { //QUICKSORT_THRESHOLD
sort(a, left, right, true);
internalSort(a, left, right, true);
return;
}

Expand Down Expand Up @@ -54,7 +54,7 @@ static void sort(int[] a, int left, int right,
* use Quicksort instead of merge sort.
*/
if (++count == 67) { // MAX_RUN_COUNT
sort(a, left, right, true);
internalSort(a, left, right, true);
return;
}
}
Expand Down Expand Up @@ -134,7 +134,7 @@ static void sort(int[] a, int left, int right,
}
}

private static void sort(int[] a, int left, int right, boolean leftmost) {
private static void internalSort(int[] a, int left, int right, boolean leftmost) {
int length = right - left + 1;

// Use insertion sort on tiny arrays
Expand Down Expand Up @@ -350,8 +350,8 @@ private static void sort(int[] a, int left, int right, boolean leftmost) {
a[great + 1] = pivot2;

// Sort left and right parts recursively, excluding known pivots
sort(a, left, less - 2, leftmost);
sort(a, great + 2, right, false);
internalSort(a, left, less - 2, leftmost);
internalSort(a, great + 2, right, false);

/*
* If center part is too large (comprises > 4/7 of the array),
Expand Down Expand Up @@ -423,7 +423,7 @@ private static void sort(int[] a, int left, int right, boolean leftmost) {
}

// Sort center part recursively
sort(a, less, great, false);
internalSort(a, less, great, false);

} else { // Partitioning with one pivot
/*
Expand Down Expand Up @@ -490,8 +490,8 @@ private static void sort(int[] a, int left, int right, boolean leftmost) {
* All elements from center part are equal
* and, therefore, already sorted.
*/
sort(a, left, less - 1, leftmost);
sort(a, great + 1, right, false);
internalSort(a, left, less - 1, leftmost);
internalSort(a, great + 1, right, false);
}
}
}
Loading