[nginx] svn commit: r4585 - trunk/src/core

ru at nginx.com ru at nginx.com
Thu Apr 12 10:20:33 UTC 2012


Author: ru
Date: 2012-04-12 10:20:33 +0000 (Thu, 12 Apr 2012)
New Revision: 4585
URL: http://trac.nginx.org/nginx/changeset/4585/nginx

Log:
Reduced the number of lines of code in ngx_inet_addr().


Modified:
   trunk/src/core/ngx_inet.c

Modified: trunk/src/core/ngx_inet.c
===================================================================
--- trunk/src/core/ngx_inet.c	2012-04-12 09:19:14 UTC (rev 4584)
+++ trunk/src/core/ngx_inet.c	2012-04-12 10:20:33 UTC (rev 4585)
@@ -44,11 +44,7 @@
         return INADDR_NONE;
     }
 
-    if (n != 3) {
-        return INADDR_NONE;
-    }
-
-    if (octet < 256) {
+    if (n == 3 && octet < 256) {
         addr = (addr << 8) + octet;
         return htonl(addr);
     }



More information about the nginx-devel mailing list