Skip to content

Commit 5150f4b

Browse files
chore: minor updates
1 parent 94ce421 commit 5150f4b

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/config_loader.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub const ConfigLoader = struct {
5252
self: *ConfigLoader,
5353
options: types.LoadOptions,
5454
) !types.UntypedConfigResult {
55-
var sources = std.ArrayList(types.SourceInfo){};
55+
var sources = std.ArrayList(types.SourceInfo).empty;
5656
try sources.ensureTotalCapacity(self.allocator, 4);
5757
defer sources.deinit(self.allocator);
5858

src/merge.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ fn mergeArrays(
122122
}
123123

124124
fn cloneArray(allocator: std.mem.Allocator, arr: []std.json.Value) ![]std.json.Value {
125-
var result = std.ArrayList(std.json.Value){};
125+
var result = std.ArrayList(std.json.Value).empty;
126126
try result.ensureTotalCapacity(allocator, arr.len);
127127
for (arr) |item| {
128128
try result.append(allocator, try utils.cloneJsonValue(allocator, item));
@@ -135,7 +135,7 @@ fn concatArrays(
135135
target: []std.json.Value,
136136
source: []std.json.Value,
137137
) ![]std.json.Value {
138-
var result = std.ArrayList(std.json.Value){};
138+
var result = std.ArrayList(std.json.Value).empty;
139139
try result.ensureTotalCapacity(allocator, target.len + source.len);
140140

141141
// Add all target items
@@ -175,7 +175,7 @@ fn smartMergeArrays(
175175
return try concatArrays(allocator, target, source);
176176
};
177177

178-
var result = std.ArrayList(std.json.Value){};
178+
var result = std.ArrayList(std.json.Value).empty;
179179
try result.ensureTotalCapacity(allocator, target.len + source.len);
180180
var seen = std.StringHashMap(usize).init(allocator);
181181
defer seen.deinit();

src/services/file_loader.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn fileExists(path: []const u8) bool {
1919

2020
/// Strip single-line (//) and multi-line (/* */) comments from JSON content
2121
fn stripJsonComments(allocator: std.mem.Allocator, content: []const u8) ![]const u8 {
22-
var result = std.ArrayList(u8){};
22+
var result = std.ArrayList(u8).empty;
2323
try result.ensureTotalCapacity(allocator, content.len);
2424
errdefer result.deinit(allocator);
2525

0 commit comments

Comments
 (0)