shrink turbo-analyze

https://github.com/ziglang/zig/issues/12061
This commit is contained in:
Motiejus Jakštys 2022-07-09 21:02:03 +03:00
parent 02ddc548f5
commit 292bc4e4e0

View File

@ -107,9 +107,10 @@ fn execute(
const db = file.db;
var file_size_scratch: [16]u8 = undefined;
const buf = fmt.bufPrint(file_size_scratch[0..], "{:.2}", .{
fmt.fmtIntSizeBin(@intCast(u64, file_size_bytes)),
}) catch unreachable;
const buf = fmt.bufPrint(file_size_scratch[0..], "{d}", .{file_size_bytes}) catch unreachable;
//const buf = fmt.bufPrint(file_size_scratch[0..], "{:.2}", .{
// fmt.fmtIntSizeBin(@intCast(u64, file_size_bytes)),
//}) catch unreachable;
const info = Info{
.fname = db_file,
@ -147,9 +148,12 @@ fn execute(
inline for (meta.fields(DB.DBNumbers)) |field| {
const length = @field(lengths, field.name);
const size = fmt.bufPrint(file_size_scratch[0..], "{:.0}", .{
fmt.fmtIntSizeBin(@intCast(u64, length << section_length_bits)),
const size = fmt.bufPrint(file_size_scratch[0..], "{d}", .{
length << section_length_bits,
}) catch unreachable;
//const size = fmt.bufPrint(file_size_scratch[0..], "{:.0}", .{
// fmt.fmtIntSizeBin(@intCast(u64, length << section_length_bits)),
//}) catch unreachable;
const start = @field(offsets, field.name);
const end = start + @field(lengths, field.name);