redundant condition

This commit is contained in:
Josh Baker 2017-02-12 07:06:56 -07:00
parent ed300d7032
commit 033d0d333e
1 changed files with 5 additions and 7 deletions

View File

@ -192,8 +192,7 @@ func fenceMatch(hookName string, sw *scanWriter, fence *liveFenceSwitches, metas
}
}
msgs := make([][]byte, 0, 4)
if fence.detect == nil || fence.detect[detect] {
var msgs [][]byte
if fence.detect == nil || fence.detect[detect] {
if len(res) > 0 && res[0] == '{' {
msgs = append(msgs, makemsg(details.command, group, detect, hookName, metas, details.key, details.timestamp, res[1:]))
@ -201,7 +200,6 @@ func fenceMatch(hookName string, sw *scanWriter, fence *liveFenceSwitches, metas
msgs = append(msgs, res)
}
}
}
switch detect {
case "enter":
if fence.detect == nil || fence.detect["inside"] {