Skip to content

Commit

Permalink
fix(FishCalculator): use correct method for getting fish
Browse files Browse the repository at this point in the history
  • Loading branch information
oscar-schwarz committed Jun 17, 2024
1 parent 441aae9 commit 48f0c87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/fish_variety/FishCalculator.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public static FishCollection mostCompatibleFishTypesOfCollection(int price, Fish

ArrayList<FishCollection> variants = new ArrayList<>();

for (Fish fish : constraints.getAllFish()) {
for (Fish fish : initialCollection.getUnaddedFishes()) {
FishCollection collectionVariant = new FishCollection(constraints, initialCollection.getFishes());

collectionVariant.add(fish);
Expand All @@ -19,7 +19,7 @@ public static FishCollection mostCompatibleFishTypesOfCollection(int price, Fish
}
}

if (variants.size() == 0) {
if (variants.isEmpty()) {
return initialCollection;
}

Expand Down

0 comments on commit 48f0c87

Please sign in to comment.