From 67f87a76c23d6205370b0620f82d5847f8a76688 Mon Sep 17 00:00:00 2001 From: Chris Boesch Date: Fri, 10 May 2024 23:21:04 +0200 Subject: Nobody wants the long version of finding out if a variable is set. So switched to the short version with 'orelse'. ;) --- exercises/046_optionals2.zig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'exercises') 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 ??? } } -- cgit v1.2.3