livereload: Simplify conditional
authorsrinivasreddy <thatiparthysreenivas@gmail.com>
Sun, 20 Mar 2016 18:19:51 +0000 (23:49 +0530)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 20 Mar 2016 18:42:10 +0000 (19:42 +0100)
livereload/connection.go

index 533cfe889fdb239eaf87ada1521bb70fd13fa950..154c823ffc9807dbf90e946fb3d9bb59656b68e7 100644 (file)
@@ -33,8 +33,7 @@ func (c *connection) reader() {
                if err != nil {
                        break
                }
-               switch true {
-               case bytes.Contains(message, []byte(`"command":"hello"`)):
+               if  bytes.Contains(message, []byte(`"command":"hello"`)){
                        c.send <- []byte(`{
                                "command": "hello",
                                "protocols": [ "http://livereload.com/protocols/official-7" ],