From d229c581eb8dc41d6888a5789817e645ca1e491b Mon Sep 17 00:00:00 2001 From: Evan Haas Date: Wed, 6 Mar 2024 06:23:27 -0800 Subject: [PATCH] Parser: remove else branch from complex initializer handling --- src/aro/Parser.zig | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/aro/Parser.zig b/src/aro/Parser.zig index acb92f0a..a8aa9d0d 100644 --- a/src/aro/Parser.zig +++ b/src/aro/Parser.zig @@ -3334,17 +3334,16 @@ fn initializer(p: *Parser, init_ty: Type) Error!Result { if (init_ty.isComplex()) { return p.complexInitializer(init_ty); - } else { - var il: InitList = .{}; - defer il.deinit(p.gpa); + } + var il: InitList = .{}; + defer il.deinit(p.gpa); - _ = try p.initializerItem(&il, init_ty); + _ = try p.initializerItem(&il, init_ty); - const res = try p.convertInitList(il, init_ty); - var res_ty = p.nodes.items(.ty)[@intFromEnum(res)]; - res_ty.qual = init_ty.qual; - return Result{ .ty = res_ty, .node = res }; - } + const res = try p.convertInitList(il, init_ty); + var res_ty = p.nodes.items(.ty)[@intFromEnum(res)]; + res_ty.qual = init_ty.qual; + return Result{ .ty = res_ty, .node = res }; } /// initializerItems : designation? initializer (',' designation? initializer)* ','?