diff options
| author | 2024-02-27 11:16:41 -0400 | |
|---|---|---|
| committer | 2024-02-27 11:16:41 -0400 | |
| commit | f6418d582fc2294983bfa647c7148a263af13db5 (patch) | |
| tree | 8f05af609928553bd91c61c31580d78a0de68736 /src/main.zig | |
| parent | Removed equality functions from Normalizer (diff) | |
| download | zg-f6418d582fc2294983bfa647c7148a263af13db5.tar.gz zg-f6418d582fc2294983bfa647c7148a263af13db5.tar.xz zg-f6418d582fc2294983bfa647c7148a263af13db5.zip | |
Using NormPropsData in NormData; No Ziglyph deps in NOrmalizer
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main.zig b/src/main.zig index 2c2cf8c..15dca16 100644 --- a/src/main.zig +++ b/src/main.zig | |||
| @@ -25,9 +25,9 @@ pub fn main() !void { | |||
| 25 | _ = args_iter.skip(); | 25 | _ = args_iter.skip(); |
| 26 | const in_path = args_iter.next() orelse return error.MissingArg; | 26 | const in_path = args_iter.next() orelse return error.MissingArg; |
| 27 | 27 | ||
| 28 | var gpa = std.heap.GeneralPurposeAllocator(.{}){}; | 28 | var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator); |
| 29 | defer _ = gpa.deinit(); | 29 | defer arena.deinit(); |
| 30 | const allocator = gpa.allocator(); | 30 | const allocator = arena.allocator(); |
| 31 | 31 | ||
| 32 | const input = try std.fs.cwd().readFileAlloc(allocator, in_path, std.math.maxInt(u32)); | 32 | const input = try std.fs.cwd().readFileAlloc(allocator, in_path, std.math.maxInt(u32)); |
| 33 | defer allocator.free(input); | 33 | defer allocator.free(input); |
| @@ -51,9 +51,9 @@ pub fn main() !void { | |||
| 51 | // while (iter.next()) |_| result += 1; | 51 | // while (iter.next()) |_| result += 1; |
| 52 | // while (iter.next()) |line| result += strWidth(line, &data); | 52 | // while (iter.next()) |line| result += strWidth(line, &data); |
| 53 | while (iter.next()) |line| { | 53 | while (iter.next()) |line| { |
| 54 | var nfc = try n.nfc(allocator, line); | 54 | const nfc = try n.nfc(allocator, line); |
| 55 | result += nfc.slice.len; | 55 | result += nfc.slice.len; |
| 56 | nfc.deinit(); | 56 | // nfc.deinit(); |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | std.debug.print("result: {}, took: {}\n", .{ result, timer.lap() / std.time.ns_per_ms }); | 59 | std.debug.print("result: {}, took: {}\n", .{ result, timer.lap() / std.time.ns_per_ms }); |