# HG changeset patch # User Ruslan Ermilov # Date 1334226033 0 # Node ID 3d51fa5a110d1e8c4032710c6bd8222135217c2f # Parent a1d5842064f73138548b7a6d827b51c72a2fb7d5 Reduced the number of lines of code in ngx_inet_addr(). diff -r a1d5842064f7 -r 3d51fa5a110d src/core/ngx_inet.c --- a/src/core/ngx_inet.c Thu Apr 12 09:19:14 2012 +0000 +++ b/src/core/ngx_inet.c Thu Apr 12 10:20:33 2012 +0000 @@ -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); }