Merge pull request #2959 from Quasilyte/patch-1

remove excessive []byte(s) conversion
This commit is contained in:
Phil Estes 2019-01-28 12:17:42 -05:00 committed by GitHub
commit 4259f63e04
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))