Skip to content

Commit

Permalink
switch logic to handle most common case first
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgabrielma committed Jan 23, 2025
1 parent 45a26ac commit 29b3990
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ final class CollectCashViewHelper {
func validateAmountOnSubmit(orderTotal: String,
textFieldAmountInput: String,
onError: (String) -> Void) -> Bool {
let userInput = textFieldAmountInput.isEmpty ? "0" : textFieldAmountInput
let userInput = textFieldAmountInput.isNotEmpty ? textFieldAmountInput : "0"

guard let orderDecimal = parseCurrency(orderTotal),
let inputDecimal = parseCurrency(userInput) else {
Expand Down

0 comments on commit 29b3990

Please sign in to comment.