1
Fork 0

remove unnecessary cast

This commit is contained in:
Motiejus Jakštys 2022-02-19 15:50:13 +02:00 committed by Motiejus Jakštys
parent fd1cab251d
commit 623060dac3
1 changed files with 5 additions and 2 deletions

View File

@ -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 });
}