Fix item sort deadlock (#319)

This commit is contained in:
MedicOP
2019-01-13 01:14:10 +01:00
committed by Ronan Lana
parent 08e7ef3f66
commit 51211cfb1e

View File

@@ -117,7 +117,7 @@ class PairedQuicksort {
}
private void PartitionByLevel(int Esq, int Dir, ArrayList<Item> A) {
Equip x, w, eqpI, eqpJ;
Equip x, w;
i = Esq;
j = Dir;
@@ -125,11 +125,9 @@ class PairedQuicksort {
x = (Equip)(A.get((i + j) / 2));
do {
eqpI = (Equip)A.get(i);
eqpJ = (Equip)A.get(j);
while (x.getLevel() > eqpI.getLevel()) i++;
while (x.getLevel() < eqpJ.getLevel()) j--;
while (x.getLevel() > ((Equip)A.get(i)).getLevel()) i++;
while (x.getLevel() < ((Equip)A.get(j)).getLevel()) j--;
if (i <= j) {
w = (Equip)A.get(i);