From 3dddb70be039787b976558752f36e6fb4a868687 Mon Sep 17 00:00:00 2001 From: Antoni Sawicki Date: Mon, 26 Oct 2020 01:42:11 -0700 Subject: [PATCH] remove else to improve readability --- wrp.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/wrp.go b/wrp.go index 9bc7992..6b3c9aa 100644 --- a/wrp.go +++ b/wrp.go @@ -173,13 +173,13 @@ func pageServer(out http.ResponseWriter, req *http.Request) { w.req = req w.out = out w.parseForm() - if len(w.url) > 4 { - w.navigate() - w.capture() - } else { + if len(w.url) < 4 { w.printPage("#FFFFFF") w.printFooter("", "") + return } + w.navigate() + w.capture() } // Process HTTP requests to ISMAP '/map/' url @@ -203,13 +203,12 @@ func mapServer(out http.ResponseWriter, req *http.Request) { return } log.Printf("%s WrpReq from ISMAP: %+v\n", req.RemoteAddr, w) - if len(w.url) > 4 { - w.navigate() - w.capture() - } else { + if len(w.url) < 4 { w.printPage("#FFFFFF") w.printFooter("", "") } + w.navigate() + w.capture() } // Process HTTP requests for images '/img/' url