1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-11 01:54:16 +00:00

Significantly optimize the speed and cache of scanning

This commit is contained in:
Tw93
2025-11-19 11:53:57 +08:00
parent c16047a3a6
commit 45c65345ac
7 changed files with 259 additions and 238 deletions

View File

@@ -98,21 +98,6 @@ func humanizeBytes(size int64) string {
return fmt.Sprintf("%.1f %cB", value, "KMGTPE"[exp])
}
func progressBar(value, max int64) string {
if max <= 0 {
return strings.Repeat("░", barWidth)
}
filled := int((value * int64(barWidth)) / max)
if filled > barWidth {
filled = barWidth
}
bar := strings.Repeat("█", filled)
if filled < barWidth {
bar += strings.Repeat("░", barWidth-filled)
}
return bar
}
func coloredProgressBar(value, max int64, percent float64) string {
if max <= 0 {
return colorGray + strings.Repeat("░", barWidth) + colorReset