refactor: use strings.Builder to improve performance

Signed-off-by: rifeplight <rifeplight@outlook.com>
This commit is contained in:
rifeplight 2025-10-29 15:59:34 +08:00
parent f575e91b2c
commit ff2e25f516
1 changed files with 3 additions and 3 deletions

View File

@ -848,11 +848,11 @@ func main() {
} }
func dumpTiming(td *timingData, lvl int) { func dumpTiming(td *timingData, lvl int) {
ind := "" var ind strings.Builder
for x := 0; x < lvl; x++ { 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 { for _, sd := range td.Sub {
dumpTiming(sd, lvl+1) dumpTiming(sd, lvl+1)
} }