refactor: use strings.Builder to improve performance (#537)

Signed-off-by: rifeplight <rifeplight@outlook.com>
This commit is contained in:
rifeplight 2025-10-29 20:07:46 +08:00 committed by GitHub
parent f575e91b2c
commit 1ad1dc15dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -848,11 +848,11 @@ func main() {
}
func dumpTiming(td *timingData, lvl int) {
ind := ""
var ind strings.Builder
for x := 0; x < lvl; x++ {
ind += " "
ind.WriteString(" ")
}
fmt.Printf("%s%s: %s\n", ind, td.Title, td.Value)
fmt.Printf("%s%s: %s\n", ind.String(), td.Title, td.Value)
for _, sd := range td.Sub {
dumpTiming(sd, lvl+1)
}