From b81f34e70ab64e25999fe1f51b752c8f2acd4928 Mon Sep 17 00:00:00 2001 From: Dimitrij Denissenko Date: Tue, 15 Mar 2016 07:39:40 +0000 Subject: [PATCH] Avoid re-allocations --- entry.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entry.go b/entry.go index 9ae900bc5..89e966e7b 100644 --- a/entry.go +++ b/entry.go @@ -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 }