Skip to content
Snippets Groups Projects
Commit a788fbe6 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel:
Browse files

Fix incorrect pivot selection.

parent 8ecc5aa0
No related branches found
No related tags found
No related merge requests found
......@@ -158,7 +158,7 @@ MED3(const SORT_TYPE *a, size_t i, size_t j, size_t k XT_SORT_EXTRA_ARGS_DECL)
{
return SORT_TYPE_CMP_LT(a[i],a[j],i,j) ?
(SORT_TYPE_CMP_LT(a[j],a[k],j,k) ?
j : (SORT_TYPE_CMP_LT(a[i],a[k],i,k) ? i : k ))
j : (SORT_TYPE_CMP_LT(a[i],a[k],i,k) ? k : i ))
: (SORT_TYPE_CMP_LT(a[k],a[j],k,j) ?
j : (SORT_TYPE_CMP_LT(a[i],a[k],i,k) ? i : k));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment