server/addrmap.c (hash): Visually tighten the arithmetic.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 29 Sep 2017 09:06:13 +0000 (10:06 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 28 Jun 2018 23:29:23 +0000 (00:29 +0100)
server/addrmap.c

index 140d0b6..6091dbf 100644 (file)
@@ -76,9 +76,9 @@ static uint32 hash(const addr *a)
 {
   switch (a->sa.sa_family) {
     case AF_INET:
-      return (U32((AF_INET * 0x4eaac1b7ul) +
-                 (a->sin.sin_addr.s_addr * 0xa5dbc837) +
-                 (a->sin.sin_port * 0x3b049e83)));
+      return (U32(0x4eaac1b7ul*AF_INET +
+                 0xa5dbc837ul*a->sin.sin_addr.s_addr +
+                 0x3b049e83ul*a->sin.sin_port));
     default:
       abort();
   }