Skip to content

Commit dfebb40

Browse files
authored
remove excessive []byte(s) conversion
`copy` permits using to mix `[]byte` and `string` arguments without explicit conversion. I removed explicit conversion to make the code simpler. Signed-off-by: Iskander Sharipov <[email protected]>
1 parent 9f705f4 commit dfebb40

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pkg/progress/bar.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ func (h Bar) Format(state fmt.State, r rune) {
7070
negative := width - pad - positive
7171

7272
n := 1
73-
n += copy(p[n:], []byte(green))
73+
n += copy(p[n:], green)
7474
n += copy(p[n:], bytes.Repeat([]byte("+"), positive))
75-
n += copy(p[n:], []byte(reset))
75+
n += copy(p[n:], reset)
7676

7777
if negative > 0 {
7878
copy(p[n:len(p)-1], bytes.Repeat([]byte("-"), negative))

0 commit comments

Comments
 (0)