Avoid re-allocations

This commit is contained in:
Dimitrij Denissenko 2016-03-15 07:39:40 +00:00
parent a26f43589d
commit b81f34e70a
1 changed files with 1 additions and 1 deletions

View File

@ -68,7 +68,7 @@ func (entry *Entry) WithField(key string, value interface{}) *Entry {
// Add a map of fields to the Entry.
func (entry *Entry) WithFields(fields Fields) *Entry {
data := Fields{}
data := make(Fields, len(entry.Data)+len(fields))
for k, v := range entry.Data {
data[k] = v
}