Merge pull request #335 from dim/master

Avoid re-allocations
This commit is contained in:
Simon Eskildsen 2016-03-17 09:56:47 -04:00
commit 9ccfbde280
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
}