forked from mirror/logrus
Merge pull request #129 from noxiouz/speedup_text_formatter
[TextFormatter] Preallocate enough memory for keys to speedup
This commit is contained in:
commit
273bd5984c
|
@ -43,7 +43,7 @@ type TextFormatter struct {
|
||||||
|
|
||||||
func (f *TextFormatter) Format(entry *Entry) ([]byte, error) {
|
func (f *TextFormatter) Format(entry *Entry) ([]byte, error) {
|
||||||
|
|
||||||
var keys []string
|
var keys []string = make([]string, 0, len(entry.Data))
|
||||||
for k := range entry.Data {
|
for k := range entry.Data {
|
||||||
keys = append(keys, k)
|
keys = append(keys, k)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue