Skip to content

Commit

Permalink
fix: checkEnoughStock함수 guard 조건부 수정 #1
Browse files Browse the repository at this point in the history
- 재고랑과 필요수량이 같은 경우를 누락하여 등호 추가
  • Loading branch information
ICS-Asan committed Oct 19, 2021
1 parent 1504f91 commit 3748c3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion JuiceMaker/JuiceMaker/Model/FruitStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class FruitStore {
}

func checkEnoughStock(from index: Int, for count: Int) throws {
guard inventory[index].count > count else {
guard inventory[index].count >= count else {
throw FruitStoreError.lackOfStock(stockNeeded: count - inventory[index].count)
}
}
Expand Down

0 comments on commit 3748c3f

Please sign in to comment.