Clean up.
This commit is contained in:
parent
65e02fa87d
commit
3e17c9219f
1 changed files with 7 additions and 11 deletions
18
qrm/utill.go
18
qrm/utill.go
|
|
@ -360,20 +360,16 @@ func cloneBytes(b []byte) []byte {
|
|||
|
||||
func concat(stringList ...string) string {
|
||||
var b strings.Builder
|
||||
b.Grow(length(stringList))
|
||||
|
||||
var length int
|
||||
for i := 0; i < len(stringList); i++ {
|
||||
length += len(stringList[i])
|
||||
}
|
||||
|
||||
b.Grow(length)
|
||||
|
||||
for _, str := range stringList {
|
||||
b.WriteString(str)
|
||||
}
|
||||
return b.String()
|
||||
}
|
||||
|
||||
func length(strings []string) int {
|
||||
var ret int
|
||||
|
||||
for i := 0; i < len(strings); i++ {
|
||||
ret += len(strings[i])
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue