mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-16 10:48:46 +00:00
Simplified a section of code for total price by store (used HashMap to access header section)
This commit is contained in:
parent
8afa81db59
commit
7bc43d8249
@ -100,11 +100,7 @@ public class ListPage extends AppCompatActivity {
|
||||
pListItemPair.add(entry);
|
||||
}
|
||||
else {
|
||||
int index = 0;
|
||||
|
||||
while(index < pNames.size() && !pNames.get(index).equals("Kroger")) {
|
||||
index++;
|
||||
}
|
||||
int index = storeHeaderIndex.get("Kroger");
|
||||
|
||||
totalPriceByStore.put("Kroger", totalPriceByStore.get("Kroger") + (item.getPrice().doubleValue() * entry.getQuantity()));
|
||||
pPrices.set(index, totalPriceByStore.get("Kroger").toString());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user