diff --git a/Listify/app/src/main/java/com/example/listify/ListPage.java b/Listify/app/src/main/java/com/example/listify/ListPage.java index a45e323..a7a3e89 100644 --- a/Listify/app/src/main/java/com/example/listify/ListPage.java +++ b/Listify/app/src/main/java/com/example/listify/ListPage.java @@ -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());