Skip to content
This repository has been archived by the owner on Oct 13, 2020. It is now read-only.

Commit

Permalink
mini fix for negative numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
ChFlick committed Sep 2, 2018
1 parent 7117219 commit 9ff9c25
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public void initDiscountCalculation() {

@Override
public void accept(Product product) {
if(productsProcessed % 2 == 1) {
if(productsProcessed % 2 != 0) {
product.setPriceInCentsAfterDiscount(0l);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/warehouse/product/Product.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class Product {
private ProductType productType;
private long priceInCentsAfterDiscount;

public Product(ProductType productType) {
Product(ProductType productType) {
this.productType = productType;
this.priceInCentsAfterDiscount = productType.getPriceInCents();
}
Expand Down

0 comments on commit 9ff9c25

Please sign in to comment.