From 623060dac387a0871ca9b3fbe815a5ec6b65188b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Sat, 19 Feb 2022 15:50:13 +0200 Subject: [PATCH] remove unnecessary cast --- src/shell.zig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/shell.zig b/src/shell.zig index d17c2b3..f951213 100644 --- a/src/shell.zig +++ b/src/shell.zig @@ -36,7 +36,10 @@ pub const ShellReader = struct { pub const ShellWriter = struct { counts: std.StringHashMap(u32), allocator: Allocator, - const KV = struct { shell: []const u8, score: u32 }; + const KV = struct { + shell: []const u8, + score: u64, + }; const ShellSections = struct { index: BoundedArray(ShellIndex, MaxShells), @@ -142,7 +145,7 @@ pub const ShellWriter = struct { if (entry.value_ptr.* == 1) { continue; } - const score = @truncate(u32, entry.key_ptr.*.len) * entry.value_ptr.*; + const score = entry.key_ptr.*.len * entry.value_ptr.*; try deque.add(KV{ .shell = entry.key_ptr.*, .score = score }); }