forked from mirror/logrus
hooks: Remove unnecessary explicit slice creation
This commit is contained in:
parent
1399b22d12
commit
927450cad5
4
hooks.go
4
hooks.go
|
@ -9,10 +9,6 @@ type levelHooks map[Level][]Hook
|
||||||
|
|
||||||
func (hooks levelHooks) Add(hook Hook) {
|
func (hooks levelHooks) Add(hook Hook) {
|
||||||
for _, level := range hook.Levels() {
|
for _, level := range hook.Levels() {
|
||||||
if _, ok := hooks[level]; !ok {
|
|
||||||
hooks[level] = make([]Hook, 0, 1)
|
|
||||||
}
|
|
||||||
|
|
||||||
hooks[level] = append(hooks[level], hook)
|
hooks[level] = append(hooks[level], hook)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue