Skip to content

Commit ffc16cf

Browse files
authored
fix(code): Use strings.Repeat (#23)
1 parent e5977a3 commit ffc16cf

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

internal/transform/space.go

+1-11
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ func NewSpace(n int) Substring {
1212
panic(errors.New("hyperspaced/internal/text/transform.NewSpace: really?"))
1313
}
1414

15-
sep := toSeparator(n)
15+
sep := strings.Repeat(" ", n)
1616

1717
return func(length, index int, str string) string {
1818
if index < length-1 {
@@ -22,13 +22,3 @@ func NewSpace(n int) Substring {
2222
return str
2323
}
2424
}
25-
26-
func toSeparator(length int) string {
27-
var builder strings.Builder
28-
29-
for index := 0; index < length; index++ {
30-
builder.WriteString(" ")
31-
}
32-
33-
return builder.String()
34-
}

0 commit comments

Comments
 (0)