Change takezore loop

This commit is contained in:
jacques 2021-07-04 22:20:40 +02:00
parent 4486b45bd9
commit 88616adb15

View file

@ -292,13 +292,17 @@ class DBHelper extends SQLiteOpenHelper {
// Move drug with prise = 0 at the end of the list
// todo: If some drug moved, must redo all the loop
for (int position = 0 ; position < getCount() ; position++ ) {
int position = 0 ;
for ( int nbOps = 0; nbOps < getCount() ; nbOps ++ ) {
currentDrug = getItem(position);
double currentTake = currentDrug.getTake();
if (currentTake == 0)
{
drug = drugs.remove(position);
drugs.add(drug);
} else
{
position++;
}
}
return drugs;