mirror of https://github.com/sirupsen/logrus.git
Avoid re-allocations
This commit is contained in:
parent
a26f43589d
commit
b81f34e70a
2
entry.go
2
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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue