aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Shitov <mail@andreyshitov.com>2025-05-26 10:56:07 +0200
committerAndrew Shitov <mail@andreyshitov.com>2025-05-26 10:56:07 +0200
commit16a99f5bf5681b0adc157f4588672cc7a9ec4da6 (patch)
treef92d5837fc0fdf809a4a7b9c06847382e90a9a8e
parent3fe2807cf99865d74bf0fe2a3488c84e7c67c72a (diff)
downloadperlweeklychallenge-club-16a99f5bf5681b0adc157f4588672cc7a9ec4da6.tar.gz
perlweeklychallenge-club-16a99f5bf5681b0adc157f4588672cc7a9ec4da6.tar.bz2
perlweeklychallenge-club-16a99f5bf5681b0adc157f4588672cc7a9ec4da6.zip
truncate the rest of calculations
-rw-r--r--challenge-323/ash/raku/ch-2.raku4
1 files changed, 3 insertions, 1 deletions
diff --git a/challenge-323/ash/raku/ch-2.raku b/challenge-323/ash/raku/ch-2.raku
index aac6590902..91727ca2c9 100644
--- a/challenge-323/ash/raku/ch-2.raku
+++ b/challenge-323/ash/raku/ch-2.raku
@@ -24,7 +24,9 @@ sub income-tax($income, @levels) {
else {
$taxable = $remainder;
$remainder = 0;
- }
+ }
+
+ last unless $taxable;
$tax += $taxable * $rate / 100;