Skip to content

Commit 3e17c92

Browse files
committed
Clean up.
1 parent 65e02fa commit 3e17c92

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

qrm/utill.go

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -360,20 +360,16 @@ func cloneBytes(b []byte) []byte {
360360

361361
func concat(stringList ...string) string {
362362
var b strings.Builder
363-
b.Grow(length(stringList))
364363

365-
for _, str := range stringList {
366-
b.WriteString(str)
364+
var length int
365+
for i := 0; i < len(stringList); i++ {
366+
length += len(stringList[i])
367367
}
368-
return b.String()
369-
}
370368

371-
func length(strings []string) int {
372-
var ret int
369+
b.Grow(length)
373370

374-
for i := 0; i < len(strings); i++ {
375-
ret += len(strings[i])
371+
for _, str := range stringList {
372+
b.WriteString(str)
376373
}
377-
378-
return ret
374+
return b.String()
379375
}

0 commit comments

Comments
 (0)