chore(optim): Optimizing some piece of code

Simply use modern methods
This commit is contained in:
2025-06-26 23:57:19 +02:00
parent a3d1e9342f
commit a66fec07e1
3 changed files with 8 additions and 11 deletions

View File

@@ -319,7 +319,7 @@ func computeNIndent(b []byte) []byte {
startSpaces = spaces[0]
}
line = []byte(startSpaces + strings.TrimLeft(string(line), " "))
line = bytes.ReplaceAll(line, []byte("__indent__"), []byte(fmt.Sprintf("%d", len(startSpaces))))
line = bytes.ReplaceAll(line, []byte("__indent__"), fmt.Appendf(nil, "%d", len(startSpaces)))
lines[i] = line
}
return bytes.Join(lines, []byte("\n"))