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 <quasilyte@gmail.com>
This commit is contained in:
Iskander (Alex) Sharipov 2019-01-28 19:50:28 +03:00 committed by GitHub
parent 9f705f40b8
commit dfebb404cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -70,9 +70,9 @@ func (h Bar) Format(state fmt.State, r rune) {
negative := width - pad - positive
n := 1
n += copy(p[n:], []byte(green))
n += copy(p[n:], green)
n += copy(p[n:], bytes.Repeat([]byte("+"), positive))
n += copy(p[n:], []byte(reset))
n += copy(p[n:], reset)
if negative > 0 {
copy(p[n:len(p)-1], bytes.Repeat([]byte("-"), negative))