remove unnecessary cast
This commit is contained in:
parent
fd1cab251d
commit
623060dac3
@ -36,7 +36,10 @@ pub const ShellReader = struct {
|
|||||||
pub const ShellWriter = struct {
|
pub const ShellWriter = struct {
|
||||||
counts: std.StringHashMap(u32),
|
counts: std.StringHashMap(u32),
|
||||||
allocator: Allocator,
|
allocator: Allocator,
|
||||||
const KV = struct { shell: []const u8, score: u32 };
|
const KV = struct {
|
||||||
|
shell: []const u8,
|
||||||
|
score: u64,
|
||||||
|
};
|
||||||
|
|
||||||
const ShellSections = struct {
|
const ShellSections = struct {
|
||||||
index: BoundedArray(ShellIndex, MaxShells),
|
index: BoundedArray(ShellIndex, MaxShells),
|
||||||
@ -142,7 +145,7 @@ pub const ShellWriter = struct {
|
|||||||
if (entry.value_ptr.* == 1) {
|
if (entry.value_ptr.* == 1) {
|
||||||
continue;
|
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 });
|
try deque.add(KV{ .shell = entry.key_ptr.*, .score = score });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user