use buffer length to avoid generating strings every time

This commit is contained in:
dmathieu 2017-07-25 09:39:35 +02:00
parent 3eef8ce63d
commit 211aba39c8
1 changed files with 1 additions and 1 deletions

View File

@ -154,7 +154,7 @@ func (f *TextFormatter) needsQuoting(text string) bool {
}
func (f *TextFormatter) appendKeyValue(b *bytes.Buffer, key string, value interface{}) {
if b.String() != "" {
if b.Len() > 0 {
b.WriteByte(' ')
}
b.WriteString(key)