diff options
| author | Hugo Machet <mail@hmachet.com> | 2022-01-13 13:08:42 +0100 |
|---|---|---|
| committer | Isaac Freund <mail@isaacfreund.com> | 2022-01-15 00:45:11 +0100 |
| commit | 0bdf3488836c9aad3d8fdc8f4f6433daca9a42cf (patch) | |
| tree | bd5a6d9857db00e122697de25c5771ef14959942 /rivertile | |
| parent | c9fd8b3f37bb8e8432b83b72776026cfb9bf7c5a (diff) | |
| download | river-0bdf3488836c9aad3d8fdc8f4f6433daca9a42cf.tar.gz river-0bdf3488836c9aad3d8fdc8f4f6433daca9a42cf.tar.xz | |
rivertile: Use saturating addition
Diffstat (limited to 'rivertile')
| -rw-r--r-- | rivertile/main.zig | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/rivertile/main.zig b/rivertile/main.zig index 07b9c38..b12c0e7 100644 --- a/rivertile/main.zig +++ b/rivertile/main.zig @@ -170,11 +170,7 @@ const Output = struct { return; }; switch (raw_arg[0]) { - '+' => output.main_count = math.add( - u32, - output.main_count, - @intCast(u32, arg), - ) catch math.maxInt(u32), + '+' => output.main_count +|= @intCast(u32, arg), '-' => { const result = @as(i33, output.main_count) + arg; if (result >= 0) output.main_count = @intCast(u32, result); |
