From d8510b3099514015e78fadc358ed3e0e2568d4fb Mon Sep 17 00:00:00 2001 From: Alexandros Naskos Date: Fri, 24 Jul 2020 13:04:01 +0300 Subject: [PATCH] Small code cleanup --- src/analysis.zig | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/analysis.zig b/src/analysis.zig index 6ba690d..926b767 100644 --- a/src/analysis.zig +++ b/src/analysis.zig @@ -1445,11 +1445,7 @@ const GetDocumentSymbolsContext = struct { }; fn getDocumentSymbolsInternal(allocator: *std.mem.Allocator, tree: *ast.Tree, node: *ast.Node, context: *GetDocumentSymbolsContext) anyerror!void { - const name = if (getDeclName(tree, node)) |name| - name - else - return; - + const name = getDeclName(tree, node) orelse return; if (name.len == 0) return;