Merge pull request #977 from sdboyer/master

nit: Condense switch fallthroughs into expression lists
pull/979/head
Ryan Breen 10 years ago
commit a02ba02815

@ -224,9 +224,7 @@ func (c *Client) lanEventHandler() {
switch e.EventType() { switch e.EventType() {
case serf.EventMemberJoin: case serf.EventMemberJoin:
c.nodeJoin(e.(serf.MemberEvent)) c.nodeJoin(e.(serf.MemberEvent))
case serf.EventMemberLeave: case serf.EventMemberLeave, serf.EventMemberFailed:
fallthrough
case serf.EventMemberFailed:
c.nodeFail(e.(serf.MemberEvent)) c.nodeFail(e.(serf.MemberEvent))
case serf.EventUser: case serf.EventUser:
c.localEvent(e.(serf.UserEvent)) c.localEvent(e.(serf.UserEvent))

@ -230,9 +230,7 @@ func (c *consulFSM) applyACLOperation(buf []byte, index uint64) interface{} {
} }
defer metrics.MeasureSince([]string{"consul", "fsm", "acl", string(req.Op)}, time.Now()) defer metrics.MeasureSince([]string{"consul", "fsm", "acl", string(req.Op)}, time.Now())
switch req.Op { switch req.Op {
case structs.ACLForceSet: case structs.ACLForceSet, structs.ACLSet:
fallthrough
case structs.ACLSet:
if err := c.state.ACLSet(index, &req.ACL); err != nil { if err := c.state.ACLSet(index, &req.ACL); err != nil {
return err return err
} else { } else {

@ -41,9 +41,7 @@ func (s *Server) lanEventHandler() {
s.nodeJoin(e.(serf.MemberEvent), false) s.nodeJoin(e.(serf.MemberEvent), false)
s.localMemberEvent(e.(serf.MemberEvent)) s.localMemberEvent(e.(serf.MemberEvent))
case serf.EventMemberLeave: case serf.EventMemberLeave, serf.EventMemberFailed:
fallthrough
case serf.EventMemberFailed:
s.nodeFailed(e.(serf.MemberEvent), false) s.nodeFailed(e.(serf.MemberEvent), false)
s.localMemberEvent(e.(serf.MemberEvent)) s.localMemberEvent(e.(serf.MemberEvent))
@ -71,9 +69,7 @@ func (s *Server) wanEventHandler() {
switch e.EventType() { switch e.EventType() {
case serf.EventMemberJoin: case serf.EventMemberJoin:
s.nodeJoin(e.(serf.MemberEvent), true) s.nodeJoin(e.(serf.MemberEvent), true)
case serf.EventMemberLeave: case serf.EventMemberLeave, serf.EventMemberFailed:
fallthrough
case serf.EventMemberFailed:
s.nodeFailed(e.(serf.MemberEvent), true) s.nodeFailed(e.(serf.MemberEvent), true)
case serf.EventMemberUpdate: // Ignore case serf.EventMemberUpdate: // Ignore
case serf.EventMemberReap: // Ignore case serf.EventMemberReap: // Ignore

Loading…
Cancel
Save