[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [snowflake/master] Simplify a conditional.



commit ca9ae12c383405bc9a755e1bc902e9755495c1f1
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date:   Tue Feb 4 22:35:12 2020 -0700

    Simplify a conditional.
---
 server/server.go | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/server/server.go b/server/server.go
index 85bf4f5..c484a19 100644
--- a/server/server.go
+++ b/server/server.go
@@ -111,11 +111,7 @@ func (handler *HTTPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
 	// Pass the address of client as the remote address of incoming connection
 	clientIPParam := r.URL.Query().Get("client_ip")
 	addr := clientAddr(clientIPParam)
-	if addr == "" {
-		statsChannel <- false
-	} else {
-		statsChannel <- true
-	}
+	statsChannel <- addr != ""
 	or, err := pt.DialOr(&ptInfo, addr, ptMethodName)
 	if err != nil {
 		log.Printf("failed to connect to ORPort: %s", err)

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits