refactor: use strings.Builder to improve performance
Signed-off-by: rifeplight <rifeplight@outlook.com>
This commit is contained in:
parent
f575e91b2c
commit
ff2e25f516
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue