aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/exercises/046_optionals2.zig
diff options
context:
space:
mode:
authorChris Boesch <chrboesch@noreply.codeberg.org>2024-05-10 23:21:04 +0200
committerChris Boesch <chrboesch@noreply.codeberg.org>2024-05-10 23:21:04 +0200
commit67f87a76c23d6205370b0620f82d5847f8a76688 (patch)
tree09624b9c7400e3535099bc2e1a1f0fec63472883 /exercises/046_optionals2.zig
parentdfdaf03d9902058b97713428b628a7a36c9fdf52 (diff)
Nobody wants the long version of finding out if a variable is set.
So switched to the short version with 'orelse'. ;)
Diffstat (limited to 'exercises/046_optionals2.zig')
-rw-r--r--exercises/046_optionals2.zig4
1 files changed, 1 insertions, 3 deletions
diff --git a/exercises/046_optionals2.zig b/exercises/046_optionals2.zig
index d3f65bb..e745d29 100644
--- a/exercises/046_optionals2.zig
+++ b/exercises/046_optionals2.zig
@@ -51,8 +51,6 @@ fn visitElephants(first_elephant: *Elephant) void {
// We should stop once we encounter a tail that
// does NOT point to another element. What can
// we put here to make that happen?
- if (e.tail == null) ???;
-
- e = e.tail.?;
+ e = e.tail ???
}
}