mirror of
https://github.com/jfoucry/Pilldroid.git
synced 2024-11-22 04:29:22 +01:00
Change takezore loop
This commit is contained in:
parent
4486b45bd9
commit
88616adb15
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue