Browse Source

Simplify switch

Evan Huus 12 years ago
parent
commit
290fec149a
1 changed files with 3 additions and 3 deletions
  1. 3 3
      protocol/message_set.go

+ 3 - 3
protocol/message_set.go

@@ -63,10 +63,10 @@ func (ms *MessageSet) Decode(pd enc.PacketDecoder) (err error) {
 	for pd.Remaining() > 0 {
 		msb := new(MessageBlock)
 		err = msb.Decode(pd)
-		switch {
-		case err == nil:
+		switch err {
+		case nil:
 			ms.Messages = append(ms.Messages, msb)
-		case err == enc.InsufficientData:
+		case enc.InsufficientData:
 			// As an optimization the server is allowed to return a partial message at the
 			// end of the message set. Clients should handle this case. So we just ignore such things.
 			ms.PartialTrailingMessage = true