Skip to content

Commit

Permalink
Fix code that don't respect one of calisthenics rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Emalios committed Aug 10, 2020
1 parent 458716b commit 8fd252b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion poo/value_objects/code/Products.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public void addProduct(Product product) {
public Money getProductsCost() {
Money money = new Money(0);
for (Product product : products) {
money = money.addMoney(product.getCost());
Money productCost = product.getCost();
money = money.addMoney(productCost);
}
return money;
}
Expand Down

0 comments on commit 8fd252b

Please sign in to comment.